Skip to content

Commit

Permalink
chore: 优化部分代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed May 19, 2024
1 parent fdd4b9a commit 65917d2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/views/system/dict/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const columns: TableInstanceColumns[] = [
},
{ title: '标签', dataIndex: 'label', slotName: 'label', width: 100, align: 'center' },
{ 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: '排序',
dataIndex: 'sort',
Expand Down
4 changes: 2 additions & 2 deletions src/views/system/dict/tree/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<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>
<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>
<div v-else @contextmenu="onContextmenu(node)">{{ node.name }}{{ node.code }}</div>
<div v-else @contextmenu="onContextmenu(node)">{{ node.name }} ({{ node.code }})</div>
<template #content>
<RightMenu v-if="has.hasPermOr(['system:dict:update', 'system:dict:delete'])" :data="node"
@on-menu-item-click="onMenuItemClick" />
Expand Down
30 changes: 15 additions & 15 deletions src/views/system/file/main/FileMain/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import {
import FileGrid from './FileGrid.vue'
import useFileManage from './useFileManage'
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 'viewerjs/dist/viewer.css'
import { downloadByUrl } from '@/utils/downloadFile'
Expand Down Expand Up @@ -187,19 +187,19 @@ const handleMulDelete = () => {
const handleUpload = (options: RequestOption) => {
const controller = new AbortController()
; (async function requestWrap() {
const { onProgress, onError, onSuccess, fileItem, name = 'file' } = options
onProgress(20)
const formData = new FormData()
formData.append(name as string, fileItem.file as Blob)
try {
const res = await uploadFile(formData)
Message.success('上传成功')
onSuccess(res)
search()
} catch (error) {
onError(error)
}
})()
const { onProgress, onError, onSuccess, fileItem, name = 'file' } = options
onProgress(20)
const formData = new FormData()
formData.append(name as string, fileItem.file as Blob)
try {
const res = await uploadFile(formData)
Message.success('上传成功')
onSuccess(res)
search()
} catch (error) {
onError(error)
}
})()
return {
abort() {
controller.abort()
Expand Down Expand Up @@ -243,7 +243,7 @@ onMounted(() => {
}
.pagination {
margin: 10px 0;
padding: 0 var(--padding) var(--padding);
:deep(.arco-pagination) {
justify-content: end;
Expand Down
2 changes: 1 addition & 1 deletion src/views/system/menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<template #action="{ record }">
<a-space>
<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 v-permission="['system:menu:delete']" status="danger" @click="onDelete(record)">删除</a-link>
Expand Down

0 comments on commit 65917d2

Please sign in to comment.