增加删除完善优化文档
Squashed commit of the following: commitc0e6400bcdAuthor: Sun <95302870@qq.com> Date: Fri Nov 10 13:02:35 2023 +0800 更新说明文档 commit0a81db157bAuthor: Sun <95302870@qq.com> Date: Fri Nov 10 13:02:27 2023 +0800 完善删除图标功能
This commit is contained in:
@@ -12,6 +12,8 @@ const show = ref(false)
|
||||
<div class="flex-1 flex-shrink-0 overflow-hidden">
|
||||
<!-- <UserAvatar /> -->
|
||||
</div>
|
||||
<a href="https://gitee.com/hslr/sun-panel.git">Gitee</a>
|
||||
<a href="https://github.com/hslr-s/sun-panel.git">Github</a>
|
||||
|
||||
<HoverButton @click="show = true">
|
||||
<span class="text-xl text-[#4f555e] dark:text-white">
|
||||
|
||||
@@ -118,7 +118,7 @@ const handleUploadFinish = ({
|
||||
<div v-if="checkedValueRef === 3">
|
||||
<div>
|
||||
<NInput v-model:value="itemIconInfo.text" class="mb-[5px]" size="small" type="text" placeholder="请输入图标名字" @input="handleChange" />
|
||||
<a target="_blank" href="https://icon-sets.iconify.design/" class="text-[blue]">图标列表</a>
|
||||
<a target="_blank" href="https://icon-sets.iconify.design/" class="text-[blue]">图标库</a>
|
||||
</div>
|
||||
<NColorPicker
|
||||
v-model:value="itemIconInfo.bgColor"
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { NButton, NButtonGroup, NDropdown, NEllipsis, NGrid, NGridItem, NModal, NSkeleton, NSpin, useMessage } from 'naive-ui'
|
||||
import { NButton, NButtonGroup, NDropdown, NEllipsis, NGrid, NGridItem, NModal, NSkeleton, NSpin, useDialog, useMessage } from 'naive-ui'
|
||||
import { nextTick, onMounted, ref } from 'vue'
|
||||
import { EditItem, Setting } from './components'
|
||||
import { Clock } from '@/components/deskModule'
|
||||
import { ItemIcon, SvgIcon } from '@/components/common'
|
||||
import { getListByGroupId } from '@/api/panel/itemIcon'
|
||||
import { deletes, getListByGroupId } from '@/api/panel/itemIcon'
|
||||
import { getInfo } from '@/api/system/user'
|
||||
import { usePanelState, useUserStore } from '@/store'
|
||||
import { PanelStateNetworkModeEnum } from '@/enum'
|
||||
import { setTitle } from '@/utils/cmn'
|
||||
|
||||
const ms = useMessage()
|
||||
const dialog = useDialog()
|
||||
const panelState = usePanelState()
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -39,6 +40,10 @@ const dropdownMenuOptions = [
|
||||
label: '编辑',
|
||||
key: 'edit',
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
key: 'delete',
|
||||
},
|
||||
]
|
||||
const items = ref<Panel.ItemInfo[]>()
|
||||
|
||||
@@ -100,7 +105,24 @@ function handleSelect(key: string | number) {
|
||||
editItemInfoData.value = { ...currentRightSelectItem.value } as Panel.ItemInfo
|
||||
editItemInfoShow.value = true
|
||||
break
|
||||
case 'del':
|
||||
case 'delete':
|
||||
dialog.warning({
|
||||
title: '警告',
|
||||
content: `你确定要删除图标 ${currentRightSelectItem.value?.title} ?`,
|
||||
positiveText: '确定',
|
||||
negativeText: '取消',
|
||||
onPositiveClick: () => {
|
||||
deletes([currentRightSelectItem.value?.id as number]).then(({ code, msg }) => {
|
||||
if (code === 0) {
|
||||
ms.success('已删除')
|
||||
getList()
|
||||
}
|
||||
else {
|
||||
ms.error(`删除失败:${msg}`)
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
break
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user