From 8efdd59010ff654c4a8b7be62a0b7249efb07f0a Mon Sep 17 00:00:00 2001 From: expdsn <18111002318@163.com> Date: Fri, 15 Nov 2024 17:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E6=A0=87=E7=BC=BA=E5=B0=91=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/icons/bgGameCloud.png | Bin 0 -> 381 bytes src/layout/GlobalMenu.tsx | 36 +++++++++--- src/layout/adder/AdderPage.tsx | 46 +++++++-------- src/layout/adder/CustomAdder.tsx | 75 ++++++++++++++++++------- src/layout/adder/useAdderPageStore.tsx | 14 ++++- src/layout/useLayoutStore.ts | 19 ++++++- 6 files changed, 137 insertions(+), 53 deletions(-) create mode 100644 public/icons/bgGameCloud.png diff --git a/public/icons/bgGameCloud.png b/public/icons/bgGameCloud.png new file mode 100644 index 0000000000000000000000000000000000000000..800b86ccdae515b97b5920ea2b046335e13cc601 GIT binary patch literal 381 zcmV-@0fPRCP)Px$H%UZ6R5(wy)W0jmQ5?qc_md3Dk0g=*z@n5v7z_rpK_)VY$)K*qz#pL8#bU8g zHZt5nB<06qGWa7*Wbvcx(MMf<-7eSdo_nU#>2qG^>6}kT{BzhI0j7WfpdEMu?tnu{ z*OeGmvu(Ek>%hbxwI{%aq_=EMMcj55&=0%dVml=qWHH`Owg-Wo?ENQ7UkH2?7*7OdnTNp7fQ|;>#lUY8v|puckAWWpeGN!{ z75FMJ-2glncn@#@v?V;?TvD#o=R-hrO>2S!E`T*jFWJAP7nlb|f$kc9MFY>kJ#ZxH bv=s0YHK}2=C4Hf>00000NkvXXu0mjf=C7a$ literal 0 HcmV?d00001 diff --git a/src/layout/GlobalMenu.tsx b/src/layout/GlobalMenu.tsx index 024ca91..e53267c 100644 --- a/src/layout/GlobalMenu.tsx +++ b/src/layout/GlobalMenu.tsx @@ -17,9 +17,9 @@ const defaultDisplay = { export const useMenuStore = defineStore('menu', () => { const display = reactive(defaultDisplay) const selectPage = ref<{ - id: string, - label: string, - name: string, + id: string + label: string + name: string }>() const showEditPage = ref(false) const mPos = { @@ -83,8 +83,8 @@ const Item = defineComponent({ style={ props.noStyle ? { - padding: '6px 10px' - } + padding: '6px 10px' + } : {} } onClick={() => { @@ -207,9 +207,11 @@ export default defineComponent(() => { alert onClick={() => { // 删除链接 - console.log(menu.selectPage); + console.log(menu.selectPage) - const idx = layout.state.content[layout.state.current].pages.findIndex(el => el.id === menu.selectPage?.id) + const idx = layout.state.content[layout.state.current].pages.findIndex( + (el) => el.id === menu.selectPage?.id + ) menu.dismiss() if (idx < 0) return @@ -315,7 +317,25 @@ export default defineComponent(() => { // 链接 return ( <> - 编辑 + { + useAdderPageStore().editBlockItem = { + id: block.id, + name: block.name, + link: block.link, + icon: block.icon, + text: block.text, + background: block.background, + color: block.color, + type: block.color ? 1 : 0 + } + router.go('global-adder') + useAdderPageStore().type = 2 + menu.dismiss() + }} + > + 编辑 + { diff --git a/src/layout/adder/AdderPage.tsx b/src/layout/adder/AdderPage.tsx index e2b3302..530af8a 100644 --- a/src/layout/adder/AdderPage.tsx +++ b/src/layout/adder/AdderPage.tsx @@ -145,29 +145,31 @@ export default defineComponent(() => { }))} /> - - { - if (store.type === 1) { - store.search(e) - } else if (store.type === 0) { - store.widgetSearchWords = e - } else if (store.type === 3) { - store.gameSearch = e + {store.type !== 2 && ( + + { + if (store.type === 1) { + store.search(e) + } else if (store.type === 0) { + store.widgetSearchWords = e + } else if (store.type === 3) { + store.gameSearch = e + } + }} + class="w-[220px]" + placeholder={ + store.type === 0 + ? '搜索想要添加的组件' + : store.type === 1 + ? '搜索想要添加的网址导航' + : store.type === 2 + ? '' + : '搜索想要添加的游戏' } - }} - class="w-[220px]" - placeholder={ - store.type === 0 - ? '搜索想要添加的组件' - : store.type === 1 - ? '搜索想要添加的网址导航' - : store.type === 2 - ? '' - : '搜索想要添加的游戏' - } - /> - + /> + + )}