fix
This commit is contained in:
1 parent
757de9a43f
commit
3950057707
17 files changed
+2681
-202
No files matched your search
+12
-4
@@ -485,7 +485,9 @@ const exportData = async () => {
|
||||
dataMenuOpen.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const exportReport = async ()=>{
|
||||
|
||||
}
|
||||
const triggerImport = () => {
|
||||
importFileRef.value?.click()
|
||||
}
|
||||
@@ -629,17 +631,23 @@ watch(
|
||||
v-if="dataMenuOpen"
|
||||
class="absolute right-0 top-full mt-1 z-50 min-w-[108px] rounded-md border bg-background p-1 shadow-md"
|
||||
>
|
||||
<button
|
||||
class="w-full cursor-pointer rounded px-3 py-1.5 text-left text-sm hover:bg-muted"
|
||||
@click="triggerImport"
|
||||
>
|
||||
导入
|
||||
</button>
|
||||
<button
|
||||
class="w-full cursor-pointer rounded px-3 py-1.5 text-left text-sm hover:bg-muted"
|
||||
@click="exportData"
|
||||
>
|
||||
导出
|
||||
</button>
|
||||
<button
|
||||
<button
|
||||
class="w-full cursor-pointer rounded px-3 py-1.5 text-left text-sm hover:bg-muted"
|
||||
@click="triggerImport"
|
||||
@click="exportReport"
|
||||
>
|
||||
导入
|
||||
导出报表
|
||||
</button>
|
||||
</div>
|
||||
<input
|
||||
|
||||
+196
-2
@@ -1,8 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, ref, watch, type Component } from 'vue'
|
||||
import { computed, onBeforeUnmount, ref, watch, type Component ,onMounted} from 'vue'
|
||||
import { ScrollArea } from '@/components/ui/scroll-area'
|
||||
import { Button } from '@/components/ui/button'
|
||||
|
||||
import {
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogOverlay,
|
||||
DialogPortal,
|
||||
DialogRoot,
|
||||
DialogTitle,
|
||||
DialogTrigger,DialogDescription
|
||||
} from 'reka-ui'
|
||||
import { Icon } from '@iconify/vue'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { animate, AnimatePresence, Motion, useMotionValue, useMotionValueEvent, useTransform } from 'motion-v'
|
||||
interface TypeLineCategory {
|
||||
key: string
|
||||
label: string
|
||||
@@ -59,6 +70,7 @@ const activeComponent = computed(() => {
|
||||
})
|
||||
|
||||
const copyBtnText = ref('复制')
|
||||
const sheetOpen = ref(false)
|
||||
let copyBtnTimer: ReturnType<typeof setTimeout> | null = null
|
||||
|
||||
const handleCopySubtitle = async () => {
|
||||
@@ -81,7 +93,91 @@ const handleCopySubtitle = async () => {
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (copyBtnTimer) clearTimeout(copyBtnTimer)
|
||||
if (!root) return
|
||||
root.style.scale = ''
|
||||
root.style.translate = ''
|
||||
root.style.borderRadius = ''
|
||||
})
|
||||
|
||||
//
|
||||
|
||||
|
||||
const inertiaTransition = {
|
||||
type: 'inertia' as const,
|
||||
bounceStiffness: 300,
|
||||
bounceDamping: 40,
|
||||
timeConstant: 300,
|
||||
}
|
||||
|
||||
const staticTransition = {
|
||||
duration: 0.5,
|
||||
ease: [0.32, 0.72, 0, 1] as const,
|
||||
}
|
||||
|
||||
const SHEET_TOP_RATIO = 0.1
|
||||
const SHEET_RADIUS = 12
|
||||
const OFFICIAL_SITE_URL = 'http://www.zwgczx.com.cn/'
|
||||
|
||||
let root: HTMLElement | null = null
|
||||
|
||||
onMounted(() => {
|
||||
root = document.body.firstElementChild as HTMLElement | null
|
||||
})
|
||||
|
||||
const { height, width } = useWindowSize()
|
||||
|
||||
const sheetTop = computed(() => Math.round(height.value * SHEET_TOP_RATIO))
|
||||
const h = computed(() => Math.max(0, height.value - sheetTop.value))
|
||||
const y = useMotionValue(h.value)
|
||||
|
||||
watch(
|
||||
() => h.value,
|
||||
(nextHeight) => {
|
||||
if (!sheetOpen.value) y.jump(nextHeight)
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => sheetOpen.value,
|
||||
(isOpen) => {
|
||||
if (!isOpen) {
|
||||
y.jump(h.value)
|
||||
return
|
||||
}
|
||||
y.jump(h.value)
|
||||
animate(y, 0, staticTransition)
|
||||
}
|
||||
)
|
||||
|
||||
// Scale the body down and adjust the border radius when the sheet is open.
|
||||
const bodyScale = useTransform(
|
||||
y,
|
||||
[0, h.value],
|
||||
[(width.value - sheetTop.value) / width.value, 1],
|
||||
)
|
||||
const bodyTranslate = useTransform(y, [0, h.value], [sheetTop.value - SHEET_RADIUS, 0])
|
||||
const bodyBorderRadius = useTransform(y, [0, h.value], [SHEET_RADIUS, 0])
|
||||
|
||||
useMotionValueEvent(bodyScale, 'change', (v) => {
|
||||
if (!root) return
|
||||
root.style.scale = `${v}`
|
||||
})
|
||||
useMotionValueEvent(
|
||||
bodyTranslate,
|
||||
'change',
|
||||
(v) => {
|
||||
if (!root) return
|
||||
root.style.translate = `0 ${v}px`
|
||||
},
|
||||
)
|
||||
useMotionValueEvent(
|
||||
bodyBorderRadius,
|
||||
'change',
|
||||
(v) => {
|
||||
if (!root) return
|
||||
root.style.borderRadius = `${v}px`
|
||||
},
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -140,6 +236,104 @@ onBeforeUnmount(() => {
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DialogRoot v-model:open="sheetOpen">
|
||||
<DialogTrigger as-child>
|
||||
<button
|
||||
type="button"
|
||||
class="absolute left-4 right-4 bottom-4 flex cursor-pointer flex-col items-center gap-1.5 rounded-lg border bg-muted/35 px-3 py-2 text-center text-[12px] leading-5 text-foreground/85 shadow-sm transition-colors hover:bg-muted/55 hover:text-foreground"
|
||||
>
|
||||
<img src="/favicon.ico" alt="众为咨询" class="h-5 w-5 shrink-0 rounded-sm" />
|
||||
<span>本网站由众为工程咨询有限公司提供免费技术支持</span>
|
||||
</button>
|
||||
</DialogTrigger>
|
||||
<DialogPortal>
|
||||
<AnimatePresence
|
||||
multiple
|
||||
as="div"
|
||||
>
|
||||
<DialogOverlay as-child>
|
||||
<Motion
|
||||
class="fixed inset-0 z-10 bg-black/45 backdrop-blur-[2px]"
|
||||
:initial="{ opacity: 0 }"
|
||||
:animate="{ opacity: 1 }"
|
||||
:exit="{ opacity: 0 }"
|
||||
:transition="staticTransition"
|
||||
/>
|
||||
</DialogOverlay>
|
||||
|
||||
<DialogContent as-child>
|
||||
<Motion
|
||||
class="fixed inset-x-0 bottom-0 z-20 overflow-hidden rounded-t-2xl border border-border/60 bg-card/95 shadow-2xl backdrop-blur-xl will-change-transform"
|
||||
:style="{
|
||||
y,
|
||||
top: `${sheetTop}px`,
|
||||
}"
|
||||
drag="y"
|
||||
:drag-constraints="{ top: 0 }"
|
||||
@drag-end="(e, { offset, velocity }) => {
|
||||
if (offset.y > h * 0.35 || velocity.y > 10) {
|
||||
sheetOpen = false;
|
||||
}
|
||||
else {
|
||||
animate(y, 0, { ...inertiaTransition, min: 0, max: 0 });
|
||||
}
|
||||
}"
|
||||
>
|
||||
<div class="mx-auto mt-2 h-1.5 w-12 cursor-grab rounded-full bg-muted-foreground/35 active:cursor-grabbing" />
|
||||
<div class="mx-auto flex h-full w-full max-w-2xl flex-col px-4 pb-5 pt-3">
|
||||
<div class="mb-3">
|
||||
<div class="flex justify-end">
|
||||
<DialogClose class="inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-muted-foreground/30 text-muted-foreground transition-colors hover:border-foreground/40 hover:text-foreground">
|
||||
<Icon icon="lucide:x" class="h-4 w-4" />
|
||||
</DialogClose>
|
||||
</div>
|
||||
<DialogTitle class="mt-2">
|
||||
<div class="flex items-center gap-3">
|
||||
<img src="/favicon.ico" alt="众为咨询" class="h-7 w-7 shrink-0 rounded-sm" />
|
||||
<span class="text-2xl font-semibold leading-none">关于我们</span>
|
||||
</div>
|
||||
</DialogTitle>
|
||||
</div>
|
||||
|
||||
<DialogDescription class="mb-4 text-base text-muted-foreground">
|
||||
<div class="flex items-center gap-2">
|
||||
<a
|
||||
:href="OFFICIAL_SITE_URL"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="inline-flex cursor-pointer items-center font-medium text-foreground transition-colors hover:text-primary hover:underline"
|
||||
>
|
||||
众为工程咨询有限公司
|
||||
</a>
|
||||
<a
|
||||
:href="OFFICIAL_SITE_URL"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-md border border-muted-foreground/30 text-muted-foreground transition-colors hover:border-foreground/40 hover:text-foreground"
|
||||
aria-label="跳转到官网首页"
|
||||
title="官网首页"
|
||||
>
|
||||
<Icon icon="lucide:arrow-up-right" class="h-4 w-4" />
|
||||
</a>
|
||||
</div>
|
||||
</DialogDescription>
|
||||
|
||||
<div class="space-y-4 overflow-y-auto pr-1 text-[15px] leading-7">
|
||||
<p>
|
||||
众为工程咨询有限公司 2009 年成立,专注工程造价与工程成本管控全过程咨询,是广东省政府审计入库优选单位。公司服务覆盖多领域、全类型客户,累计服务投资额超万亿元,深度参与港珠澳大桥、澳门大学横琴校区等国家级重点工程,参编三十余项国家及省市行业标准。
|
||||
</p>
|
||||
<p>
|
||||
公司立足大湾区,布局全球,设有澳门公司、斯里兰卡分公司,具备跨境与海外项目服务能力,以十五年专业沉淀、万亿级项目经验,为客户提供精准、可靠的工程咨询服务。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</Motion>
|
||||
</DialogContent>
|
||||
</AnimatePresence>
|
||||
</DialogPortal>
|
||||
</DialogRoot>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="w-88/100 min-h-0 h-full flex flex-col">
|
||||
|
||||
Reference in new issue
Block a user