mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-10-24 18:57:11 +08:00
chore: 优化部分代码
This commit is contained in:
@@ -94,7 +94,7 @@ const columns: TableInstanceColumns[] = [
|
|||||||
},
|
},
|
||||||
{ title: '标签', dataIndex: 'label', slotName: 'label', width: 100, align: 'center' },
|
{ title: '标签', dataIndex: 'label', slotName: 'label', width: 100, align: 'center' },
|
||||||
{ title: '值', dataIndex: 'value', width: 100, align: 'center', ellipsis: true, tooltip: true },
|
{ title: '值', dataIndex: 'value', width: 100, align: 'center', ellipsis: true, tooltip: true },
|
||||||
{ title: '状态', slotName: 'status', width: 90, align: 'center' },
|
{ title: '状态', slotName: 'status', width: 80, align: 'center' },
|
||||||
{
|
{
|
||||||
title: '排序',
|
title: '排序',
|
||||||
dataIndex: 'sort',
|
dataIndex: 'sort',
|
||||||
|
|||||||
@@ -13,9 +13,9 @@
|
|||||||
<a-trigger v-model:popup-visible="node.popupVisible" trigger="contextMenu" align-point
|
<a-trigger v-model:popup-visible="node.popupVisible" trigger="contextMenu" align-point
|
||||||
animation-name="slide-dynamic-origin" auto-fit-transform-origin position="bl" scroll-to-close>
|
animation-name="slide-dynamic-origin" auto-fit-transform-origin position="bl" scroll-to-close>
|
||||||
<a-tooltip v-if="node.description" :content="node.description" background-color="rgb(var(--primary-6))" position="right">
|
<a-tooltip v-if="node.description" :content="node.description" background-color="rgb(var(--primary-6))" position="right">
|
||||||
<div @contextmenu="onContextmenu(node)">{{ node.name }}({{ node.code }})</div>
|
<div @contextmenu="onContextmenu(node)">{{ node.name }} ({{ node.code }})</div>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<div v-else @contextmenu="onContextmenu(node)">{{ node.name }}({{ node.code }})</div>
|
<div v-else @contextmenu="onContextmenu(node)">{{ node.name }} ({{ node.code }})</div>
|
||||||
<template #content>
|
<template #content>
|
||||||
<RightMenu v-if="has.hasPermOr(['system:dict:update', 'system:dict:delete'])" :data="node"
|
<RightMenu v-if="has.hasPermOr(['system:dict:update', 'system:dict:delete'])" :data="node"
|
||||||
@on-menu-item-click="onMenuItemClick" />
|
@on-menu-item-click="onMenuItemClick" />
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ import {
|
|||||||
import FileGrid from './FileGrid.vue'
|
import FileGrid from './FileGrid.vue'
|
||||||
import useFileManage from './useFileManage'
|
import useFileManage from './useFileManage'
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
import { type FileItem, type FilePageQuery, type FileQuery, deleteFile, listFile, uploadFile } from '@/apis'
|
import { type FileItem, type FileQuery, deleteFile, listFile, uploadFile } from '@/apis'
|
||||||
import { ImageTypes } from '@/constant/file'
|
import { ImageTypes } from '@/constant/file'
|
||||||
import 'viewerjs/dist/viewer.css'
|
import 'viewerjs/dist/viewer.css'
|
||||||
import { downloadByUrl } from '@/utils/downloadFile'
|
import { downloadByUrl } from '@/utils/downloadFile'
|
||||||
@@ -187,19 +187,19 @@ const handleMulDelete = () => {
|
|||||||
const handleUpload = (options: RequestOption) => {
|
const handleUpload = (options: RequestOption) => {
|
||||||
const controller = new AbortController()
|
const controller = new AbortController()
|
||||||
; (async function requestWrap() {
|
; (async function requestWrap() {
|
||||||
const { onProgress, onError, onSuccess, fileItem, name = 'file' } = options
|
const { onProgress, onError, onSuccess, fileItem, name = 'file' } = options
|
||||||
onProgress(20)
|
onProgress(20)
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append(name as string, fileItem.file as Blob)
|
formData.append(name as string, fileItem.file as Blob)
|
||||||
try {
|
try {
|
||||||
const res = await uploadFile(formData)
|
const res = await uploadFile(formData)
|
||||||
Message.success('上传成功')
|
Message.success('上传成功')
|
||||||
onSuccess(res)
|
onSuccess(res)
|
||||||
search()
|
search()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
onError(error)
|
onError(error)
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
return {
|
return {
|
||||||
abort() {
|
abort() {
|
||||||
controller.abort()
|
controller.abort()
|
||||||
@@ -243,7 +243,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.pagination {
|
.pagination {
|
||||||
margin: 10px 0;
|
padding: 0 var(--padding) var(--padding);
|
||||||
|
|
||||||
:deep(.arco-pagination) {
|
:deep(.arco-pagination) {
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-link v-permission="['system:menu:update']" @click="onUpdate(record)">修改</a-link>
|
<a-link v-permission="['system:menu:update']" @click="onUpdate(record)">修改</a-link>
|
||||||
<a-link v-if="[1, 2].includes(record.type)" v-permission="['system:menu:add']" @click="onAdd(record.id)">
|
<a-link v-permission="['system:menu:add']" :disabled="![1, 2].includes(record.type)" @click="onAdd(record.id)">
|
||||||
新增
|
新增
|
||||||
</a-link>
|
</a-link>
|
||||||
<a-link v-permission="['system:menu:delete']" status="danger" @click="onDelete(record)">删除</a-link>
|
<a-link v-permission="['system:menu:delete']" status="danger" @click="onDelete(record)">删除</a-link>
|
||||||
|
|||||||
Reference in New Issue
Block a user