Fix: Card h-100

This commit is contained in:
unitwk 2024-01-05 16:32:49 +08:00
parent 55ad4b2b3c
commit 12f6b7a8d0
9 changed files with 44 additions and 25 deletions

View File

@ -1,5 +1,14 @@
// Global tool style class // Global tool style class
.full-card-body-wrapper {
position: absolute;
top: 0px;
bottom: 0px;
right: 0px;
left: 0px;
overflow-y: auto;
}
.flex-between { .flex-between {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@ -258,12 +258,6 @@ const openPhoneMenu = (b = false) => {
> >
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</div> </div>
<span>|</span>
<div class="nav-button">
<span>开发版本</span>
</div>
</nav> </nav>
<div class="btns"> <div class="btns">
<div v-for="(item, index) in appMenus" :key="index"> <div v-for="(item, index) in appMenus" :key="index">

View File

@ -63,6 +63,7 @@ const props = defineProps({
.card-panel-content { .card-panel-content {
flex-grow: 1; flex-grow: 1;
color: var(--text-color); color: var(--text-color);
position: relative;
} }
} }

View File

@ -268,9 +268,9 @@ router.beforeEach((to, from, next) => {
const toRoutePath = to.path.trim(); const toRoutePath = to.path.trim();
console.info( console.info(
"Router Changed:", "Router Changed:",
from.path, fromRoutePath,
"->", "->",
to.path, toRoutePath,
"\nMyPermission:", "\nMyPermission:",
userPermission, userPermission,
"toPagePermission:", "toPagePermission:",
@ -289,10 +289,8 @@ router.beforeEach((to, from, next) => {
if (!state.userInfo?.token) return next("/login"); if (!state.userInfo?.token) return next("/login");
if (["", "/"].includes(fromRoutePath) && toRoutePath !== "/customer") { if (toPagePermission > userPermission && userPermission !== ROLE.ADMIN) {
if (userPermission === ROLE.USER) { return next("/customer");
return next("/customer");
}
} }
if (toPagePermission <= userPermission) { if (toPagePermission <= userPermission) {

View File

@ -14,7 +14,6 @@ export function useLayoutCardTools(card: LayoutCard) {
}; };
const getMetaOrRouteValue = (key: string, require = true): string | undefined => { const getMetaOrRouteValue = (key: string, require = true): string | undefined => {
console.debug("route.queryroute.query:", route.query, key, route.query[key]);
if (card.meta[key] != null) { if (card.meta[key] != null) {
return card.meta[key]; return card.meta[key];
} }

View File

@ -123,7 +123,7 @@ onMounted(async () => {
<template #body> <template #body>
<LeftMenusPanel :menus="menus"> <LeftMenusPanel :menus="menus">
<template #baseInfo> <template #baseInfo>
<div style="max-height: 500px; overflow-y: auto"> <div :style="{ maxHeight: card.height, overflowY: 'auto' }">
<a-typography-title :level="4" class="mb-24"> <a-typography-title :level="4" class="mb-24">
{{ t("TXT_CODE_5206cf41") }} {{ t("TXT_CODE_5206cf41") }}
</a-typography-title> </a-typography-title>
@ -209,7 +209,7 @@ onMounted(async () => {
</template> </template>
<template #api> <template #api>
<div style="max-height: 500px; overflow-y: auto"> <div :style="{ maxHeight: card.height, overflowY: 'auto' }">
<a-typography-title :level="4" class="mb-24"> <a-typography-title :level="4" class="mb-24">
{{ t("TXT_CODE_9c3ca8f") }} {{ t("TXT_CODE_9c3ca8f") }}
</a-typography-title> </a-typography-title>
@ -300,7 +300,7 @@ onMounted(async () => {
</template> </template>
<template #password> <template #password>
<div style="max-height: 500px; overflow-y: auto"> <div :style="{ maxHeight: card.height, overflowY: 'auto' }">
<a-typography-title :level="4" class="mb-24"> <a-typography-title :level="4" class="mb-24">
{{ t("TXT_CODE_3b4b656d") }} {{ t("TXT_CODE_3b4b656d") }}
</a-typography-title> </a-typography-title>

View File

@ -5,6 +5,8 @@ import type { LayoutCard } from "@/types";
import { userInfoApi } from "@/services/apis/index"; import { userInfoApi } from "@/services/apis/index";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { INSTANCE_STATUS, INSTANCE_STATUS_CODE } from "@/types/const"; import { INSTANCE_STATUS, INSTANCE_STATUS_CODE } from "@/types/const";
import { parseTimestamp } from "../tools/time";
import { text } from "stream/consumers";
defineProps<{ defineProps<{
card: LayoutCard; card: LayoutCard;
@ -32,13 +34,19 @@ const columns = [
title: t("TXT_CODE_662ad338"), title: t("TXT_CODE_662ad338"),
dataIndex: "ie", dataIndex: "ie",
customRender: (e: { text: string; record: { oe: string; ie: string } }) => { customRender: (e: { text: string; record: { oe: string; ie: string } }) => {
if (!e.record.oe && !e.record.ie) {
return "--";
}
return `Output:${e.record.oe} Input:${e.record.ie}`; return `Output:${e.record.oe} Input:${e.record.ie}`;
} }
}, },
{ {
title: t("TXT_CODE_5ab2062d"), title: t("TXT_CODE_5ab2062d"),
dataIndex: "lastDatetime", dataIndex: "lastDatetime",
key: "lastDatetime" key: "lastDatetime",
customRender: (e: { text: number }) => {
return parseTimestamp(e.text);
}
}, },
{ {
title: t("TXT_CODE_fa920c0"), title: t("TXT_CODE_fa920c0"),

View File

@ -124,7 +124,7 @@ const save = async () => {
<template> <template>
<div style="width: 100%; height: 100%; position: relative"> <div style="width: 100%; height: 100%; position: relative">
<a-carousel v-if="imgList.length !== 0" arrows autoplay> <a-carousel v-if="imgList.length !== 0" class="h-100" arrows autoplay :adaptive-height="false">
<template #prevArrow> <template #prevArrow>
<div class="custom-slick-arrow" style="left: 10px; z-index: 1"> <div class="custom-slick-arrow" style="left: 10px; z-index: 1">
<left-circle-outlined /> <left-circle-outlined />
@ -135,8 +135,8 @@ const save = async () => {
<right-circle-outlined /> <right-circle-outlined />
</div> </div>
</template> </template>
<div v-for="item in displayImgList" :key="item.url"> <div v-for="item in displayImgList" :key="item.url" class="h-100">
<img :src="item.url" /> <img :src="item.url" :style="{ height: '100%' }" />
</div> </div>
</a-carousel> </a-carousel>
<div v-if="imgList.length !== 0 && containerState.isDesignMode" class="mask"> <div v-if="imgList.length !== 0 && containerState.isDesignMode" class="mask">
@ -298,3 +298,13 @@ img {
color: #fff; color: #fff;
} }
</style> </style>
<style lang="scss">
// For antdv carousel
.ant-carousel {
height: 100% !important;
div {
height: 100% !important;
}
}
</style>

View File

@ -36,9 +36,7 @@ const editTextContent = () => {
<template> <template>
<CardPanel> <CardPanel>
<template #title> <template #title>
<div class="flex"> <div class="flex">{{ card.title }} card.height:{{ card.height }}</div>
{{ card.title }}
</div>
</template> </template>
<template #operator> <template #operator>
<div v-if="containerState.isDesignMode" class="ml-10"> <div v-if="containerState.isDesignMode" class="ml-10">
@ -68,8 +66,10 @@ const editTextContent = () => {
</template> </template>
<template v-else #body> <template v-else #body>
<!-- eslint-disable-next-line vue/no-v-html --> <div class="full-card-body-wrapper">
<div class="previews global-markdown-html h-100" v-html="markdownToHTML(textContent)"></div> <!-- eslint-disable-next-line vue/no-v-html -->
<div class="previews global-markdown-html h-100" v-html="markdownToHTML(textContent)"></div>
</div>
</template> </template>
</CardPanel> </CardPanel>
</template> </template>