From 37c391713fe2fd48a3f34f65f3cadb5734d74b8b Mon Sep 17 00:00:00 2001
From: expdsn <18111002318@163.com>
Date: Mon, 18 Nov 2024 15:15:18 +0800
Subject: [PATCH] fix
---
src/layout/GlobalMenu.tsx | 49 ++++++-----
src/layout/grid/BlockWrapper.tsx | 2 +-
src/layout/grid/Feedback.tsx | 34 ++++++--
src/layout/grid/useSortable.ts | 2 +-
src/layout/header/GlobalTime.tsx | 130 +++++++++++++++--------------
src/layout/header/search/index.tsx | 6 +-
src/layout/sider/index.tsx | 3 +-
7 files changed, 129 insertions(+), 97 deletions(-)
diff --git a/src/layout/GlobalMenu.tsx b/src/layout/GlobalMenu.tsx
index 63ad351..9dfa9de 100644
--- a/src/layout/GlobalMenu.tsx
+++ b/src/layout/GlobalMenu.tsx
@@ -75,10 +75,10 @@ const Item = defineComponent({
return () => (
{
v-outside-click={() => {
menu.dismiss()
}}
- class="fixed px-2 pt-4 pb-2 bg-white/60 backdrop-blur shadow-lg rounded-lg overflow-hidden"
+ class="fixed px-2 pt-2 pb-1 bg-white/60 backdrop-blur shadow-lg rounded-lg overflow-hidden"
style={{
zIndex: '999',
left: menu.display.x + 'px',
@@ -223,26 +223,31 @@ export default defineComponent(() => {
>
编辑
-
- {
- // 删除链接
- console.log(menu.selectPage)
+ {layout.state.content[layout.state.current].pages.length > 1 && (
+
- {
+ // 删除链接
- const idx = layout.state.content[layout.state.current].pages.findIndex(
- (el) => el.id === menu.selectPage?.id
- )
- menu.dismiss()
+ const idx = layout.state.content[layout.state.current].pages.findIndex(
+ (el) => el.id === menu.selectPage?.id
+ )
+ menu.dismiss()
- if (idx < 0) return
- if (idx === layout.state.currentPage) {
- return
- }
- layout.state.content[layout.state.current].pages.splice(idx, 1)
- }}
- >
- 删除
-
+ if (idx < 0) return
+ layout.state.content[layout.state.current].pages.splice(idx, 1)
+ if (
+ layout.state.currentPage >=
+ layout.state.content[layout.state.current].pages.length
+ ) {
+ layout.state.currentPage =
+ layout.state.content[layout.state.current].pages.length - 1
+ }
+ }}
+ >
+ 删除
+
+ )}
>
)
}
diff --git a/src/layout/grid/BlockWrapper.tsx b/src/layout/grid/BlockWrapper.tsx
index d0b9095..4ff1da3 100644
--- a/src/layout/grid/BlockWrapper.tsx
+++ b/src/layout/grid/BlockWrapper.tsx
@@ -40,7 +40,7 @@ export default defineComponent({
gridColumn: `span ${props.block.w}`,
gridRow: `span ${props.block.h}`,
transition: 'border .3s, transform .2s',
- border: hover.value ? '2px solid rgba(255,255,255,.5)' : '2px solid rgba(255,255,255,0)'
+ // border: hover.value ? '2px solid rgba(255,255,255,.5)' : '2px solid rgba(255,255,255,0)'
}}
data-transportable={props.block.link && !props.block.link.startsWith('id:') ? '1' : ''}
onDragover={(e) => {
diff --git a/src/layout/grid/Feedback.tsx b/src/layout/grid/Feedback.tsx
index c219b2e..15b561f 100644
--- a/src/layout/grid/Feedback.tsx
+++ b/src/layout/grid/Feedback.tsx
@@ -40,22 +40,24 @@ export default defineComponent(() => {
get: () => data.images[2],
set: (val) => (data.images[2] = val)
})
+ const list = [img1, img2, img3]
return () => (
- *
+ *
问题描述
{
let his = await db.getItem
('feedbacks')
if (!his) his = []
- const ins = Modal.info({
+ const ins = Modal.warn({
title: '历史反馈',
width: '1024px',
maskClosable: true,
+ okText: '关闭',
content: () => (
{
历史反馈
-
+
-
-
-
+ {list
+ .filter(
+ (_, idx) =>
+ idx <=
+ list.reduce((acc, cur) => {
+ if (cur.value) acc++
+ return acc
+ }, 0)
+ )
+ .map((item) => (
+
+ ))}
+
{data.description.length}/80
联系方式
留下您的联系方式,以便必要时我们可以联系到您
diff --git a/src/layout/grid/useSortable.ts b/src/layout/grid/useSortable.ts
index 24fddea..dac5542 100644
--- a/src/layout/grid/useSortable.ts
+++ b/src/layout/grid/useSortable.ts
@@ -32,7 +32,7 @@ export default function useSortable(list: Ref
, type: Ref) {
filter: '.operation-button'
}
: {}),
- ghostClass: 'opacity-20',
+ ghostClass: 'opacity-0',
onStart: (e: any) => {
dragging.type = type.value
dragging.id = e.item.id || ''
diff --git a/src/layout/header/GlobalTime.tsx b/src/layout/header/GlobalTime.tsx
index e50dfcd..4d0eb15 100644
--- a/src/layout/header/GlobalTime.tsx
+++ b/src/layout/header/GlobalTime.tsx
@@ -3,6 +3,7 @@ import useTimeStore from '@/utils/useTimeStore'
import { Lunar } from 'lunar-typescript'
import { computed, defineComponent, Transition } from 'vue'
import useLayoutStore from '../useLayoutStore'
+import clsx from 'clsx'
export default defineComponent({
setup() {
@@ -39,7 +40,10 @@ export default defineComponent({
const layout = useLayoutStore()
return () => (
-
- {
- layout.state.simple ?
- settings.state.simpleModeShowString.includes('showTime') &&
-
- {text.value.timeStr}
-
- :
- settings.state!.showTime &&
-
- {text.value.timeStr}
-
- }
+ {layout.state.simple
+ ? settings.state.simpleModeShowString.includes('showTime') && (
+
+ {text.value.timeStr}
+
+ )
+ : settings.state!.showTime && (
+
+ {text.value.timeStr}
+
+ )}
- {
- layout.state.simple ?
- settings.state.simpleModeShowString.includes('showDate') &&
-
- {settings.state.timeOptions.includes('date') &&
{text.value.dateStr}
}
-
- {!layout.isCompact && settings.state.timeOptions.includes('week') && (
- 星期{info.value.dayWeek}
- )}
-
-
- {!layout.isCompact && settings.state.timeOptions.includes('lunal') && (
- {info.value.day}
- )}
-
-
- :
- settings.state!.showTime &&
-
- {settings.state.timeOptions.includes('date') &&
{text.value.dateStr}
}
-
- {!layout.isCompact && settings.state.timeOptions.includes('week') && (
- 星期{info.value.dayWeek}
- )}
-
-
- {!layout.isCompact && settings.state.timeOptions.includes('lunal') && (
- {info.value.day}
- )}
-
-
- }
-
+ {layout.state.simple
+ ? settings.state.simpleModeShowString.includes('showDate') && (
+
+ {settings.state.timeOptions.includes('date') &&
{text.value.dateStr}
}
+
+ {!layout.isCompact && settings.state.timeOptions.includes('week') && (
+ 星期{info.value.dayWeek}
+ )}
+
+
+ {!layout.isCompact && settings.state.timeOptions.includes('lunal') && (
+ {info.value.day}
+ )}
+
+
+ )
+ : settings.state!.showTime && (
+
+ {settings.state.timeOptions.includes('date') &&
{text.value.dateStr}
}
+
+ {!layout.isCompact && settings.state.timeOptions.includes('week') && (
+ 星期{info.value.dayWeek}
+ )}
+
+
+ {!layout.isCompact && settings.state.timeOptions.includes('lunal') && (
+ {info.value.day}
+ )}
+
+
+ )}
)
diff --git a/src/layout/header/search/index.tsx b/src/layout/header/search/index.tsx
index 867c61c..3898100 100644
--- a/src/layout/header/search/index.tsx
+++ b/src/layout/header/search/index.tsx
@@ -17,20 +17,20 @@ export default defineComponent(
return () => (
{
{layout.ready && (
{
+ onContextmenu={(e) => {
e.stopPropagation()
e.preventDefault()
}}
@@ -174,6 +174,7 @@ export default defineComponent(() => {
label="添加"
onClick={() => {
menu.showEditPage = true
+ menu.selectPage = undefined
}}
/>