增加删除完善优化文档

Squashed commit of the following:

commit c0e6400bcd
Author: Sun <95302870@qq.com>
Date:   Fri Nov 10 13:02:35 2023 +0800

    更新说明文档

commit 0a81db157b
Author: Sun <95302870@qq.com>
Date:   Fri Nov 10 13:02:27 2023 +0800

    完善删除图标功能
This commit is contained in:
Sun
2023-11-10 13:08:59 +08:00
parent 211c3071dc
commit 7c939175db
7 changed files with 90 additions and 26 deletions
@@ -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"
+25 -3
View File
@@ -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: