refactor(工作台): [预览模板]样式调整

This commit is contained in:
ulleo 2025-01-15 15:41:04 +08:00 committed by xuwei-fit2cloud
parent 91cfe2254c
commit 46ee665ca0
2 changed files with 70 additions and 39 deletions

View File

@ -13,11 +13,11 @@
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
<el-row v-show="state.asideActive" style="padding: 24px 12px 0"> <el-row v-show="state.asideActive" style="padding: 24px 12px 0">
<el-row style="align-items: center"> <el-row style="display: flex; align-items: center">
<span class="custom-breadcrumb-item" @click="closePreview()">{{ <span class="custom-breadcrumb-item" @click="closePreview()">{{
t('template_manage.template_center') t('template_manage.template_center')
}}</span> }}</span>
<el-icon><ArrowRight /></el-icon> <el-icon style="color: #8f959e"><ArrowRight /></el-icon>
<span class="custom-breadcrumb-item-to">{{ t('template_manage.preview') }}</span> <span class="custom-breadcrumb-item-to">{{ t('template_manage.preview') }}</span>
<el-tooltip <el-tooltip
@ -46,7 +46,7 @@
:class="state.extFilterActive ? 'filter-icon-active' : ''" :class="state.extFilterActive ? 'filter-icon-active' : ''"
@click="extFilterActiveChange()" @click="extFilterActiveChange()"
> >
<Filter /> <iconFilter />
</el-icon> </el-icon>
</el-row> </el-row>
<el-row v-show="state.extFilterActive"> <el-row v-show="state.extFilterActive">
@ -77,10 +77,10 @@
/> />
</el-select> </el-select>
</el-row> </el-row>
<el-divider /> <el-divider class="mp-divider" />
</el-row> </el-row>
<el-row <el-main
v-show="state.asideActive" v-show="state.asideActive"
class="aside-list" class="aside-list"
:class="state.extFilterActive ? 'aside-list-filter-active' : ''" :class="state.extFilterActive ? 'aside-list-filter-active' : ''"
@ -114,14 +114,14 @@
<span>{{ t('work_branch.relevant_templates_found') }}</span> <span>{{ t('work_branch.relevant_templates_found') }}</span>
</div> </div>
</el-row> </el-row>
</el-row> </el-main>
</el-col> </el-col>
<el-col <el-col
style="float: left" style="float: left"
class="main-area" class="main-area"
:class="state.asideActive ? 'main-area-active' : ''" :class="state.asideActive ? 'main-area-active' : ''"
> >
<el-row v-if="state.curTemplate"> <el-row v-if="state.curTemplate" style="padding: 24px 24px 0">
<span class="template-title">{{ state.curTemplate.title }}</span> <span class="template-title">{{ state.curTemplate.title }}</span>
<div style="flex: 1; text-align: right"> <div style="flex: 1; text-align: right">
<el-button <el-button
@ -145,6 +145,7 @@
<script setup lang="ts"> <script setup lang="ts">
import marketExpand from '@/assets/svg/market-expand.svg' import marketExpand from '@/assets/svg/market-expand.svg'
import icon_left_outlined from '@/assets/svg/icon_left_outlined.svg' import icon_left_outlined from '@/assets/svg/icon_left_outlined.svg'
import iconFilter from '@/assets/svg/icon-filter.svg'
import no_result from '@/assets/svg/no_result.svg' import no_result from '@/assets/svg/no_result.svg'
import { searchMarketPreview } from '@/api/templateMarket' import { searchMarketPreview } from '@/api/templateMarket'
import { onMounted, reactive, watch, ref } from 'vue' import { onMounted, reactive, watch, ref } from 'vue'
@ -379,7 +380,10 @@ onMounted(() => {
padding: 0px 12px 12px 12px; padding: 0px 12px 12px 12px;
width: 100%; width: 100%;
height: calc(100vh - 200px); height: calc(100vh - 200px);
overflow-y: auto; //overflow-y: auto;
:deep(.ed-collapse) {
--ed-collapse-header-font-size: 14px;
}
} }
.aside-list-filter-active { .aside-list-filter-active {
@ -453,7 +457,7 @@ onMounted(() => {
} }
.aside-active { .aside-active {
width: 206px; width: 224px;
height: calc(100vh - 56px); height: calc(100vh - 56px);
background-color: rgba(245, 246, 247, 1); background-color: rgba(245, 246, 247, 1);
} }
@ -464,20 +468,20 @@ onMounted(() => {
} }
.main-area-active { .main-area-active {
width: calc(100% - 206px) !important; width: calc(100% - 224px) !important;
background: #ffffff; background: #ffffff;
} }
.main-area { .main-area {
width: 100%; width: 100%;
padding: 24px; //padding: 24px;
text-align: center; text-align: center;
height: calc(100vh - 56px); height: calc(100vh - 56px);
transition: 0.5s; transition: 0.5s;
} }
.title-name-search { .title-name-search {
width: 140px; flex: 1;
float: left; float: left;
} }
@ -541,7 +545,7 @@ onMounted(() => {
.insert-retract { .insert-retract {
position: absolute; position: absolute;
left: 182px; left: 199px;
top: 2px; top: 2px;
border: 1px solid #dee0e3; border: 1px solid #dee0e3;
background: #fff; background: #fff;
@ -599,11 +603,12 @@ onMounted(() => {
} }
.img-main { .img-main {
display: inherit; display: inherit;
border-radius: 4px; //border-radius: 4px;
background: #0f1114; background: #0f1114;
overflow-x: auto; overflow-x: auto;
overflow-y: hidden; overflow-y: hidden;
height: calc(100% - 50px) !important; width: 100%;
height: calc(100% - 76px) !important;
} }
.open-button { .open-button {
cursor: pointer; cursor: pointer;
@ -623,7 +628,7 @@ onMounted(() => {
} }
.filter-icon-span { .filter-icon-span {
float: left; float: left;
border: 1px solid #dcdfe6; border: 1px solid #bbbfc4;
width: 32px; width: 32px;
height: 32px; height: 32px;
border-radius: 4px; border-radius: 4px;
@ -644,16 +649,41 @@ onMounted(() => {
.search-area { .search-area {
width: 100%; width: 100%;
position: relative; position: relative;
display: flex;
} }
.custom-breadcrumb-item { .custom-breadcrumb-item {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
color: rgba(100, 106, 115, 1); font-weight: 400;
color: #646a73;
width: 64px;
height: 22px;
padding: 0 4px 0 4px;
border-radius: 4px 0 0 0;
display: flex;
align-items: center;
&:hover {
color: #3370ff;
background: #3370ff1a;
}
&:active {
color: #245bdb;
background: #3370ff33;
}
} }
.custom-breadcrumb-item-to { .custom-breadcrumb-item-to {
font-size: 14px; font-size: 14px;
color: rgba(31, 35, 41, 1); font-weight: 400;
color: #1f2329;
cursor: default;
}
.mp-divider {
border-color: #1f232926;
margin-top: 16px;
margin-bottom: 8px;
} }
</style> </style>

View File

@ -1,15 +1,17 @@
<template> <template>
<div <div
class="template-item-main"
:class="[ :class="[
{ {
['template-item-main-active']: active ['template-item-main-active']: active
}, }
'template-item-main'
]" ]"
@click.stop="previewTemplate" @click.stop="previewTemplate"
> >
<div class="template-item-img" :style="classBackground" /> <div class="template-item-img">
<span class="demonstration">{{ template.title }}</span> <div class="template-item-img-inner" :style="classBackground" />
</div>
<div class="demonstration">{{ template.title }}</div>
</div> </div>
</template> </template>
@ -63,8 +65,8 @@ const previewTemplate = () => {
margin: 0 0 12px 0; margin: 0 0 12px 0;
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
width: 182px; width: 192px;
height: 116px; height: 145px;
background-color: var(--ContentBG, #ffffff); background-color: var(--ContentBG, #ffffff);
border: 1px solid #dee0e3; border: 1px solid #dee0e3;
border-radius: 4px; border-radius: 4px;
@ -73,33 +75,32 @@ const previewTemplate = () => {
flex-grow: 0; flex-grow: 0;
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
display: flex;
flex-direction: column;
} }
.template-item-main-active { .template-item-main-active {
border: 2px solid var(--ed-color-primary) !important; border: 2px solid var(--ed-color-primary) !important;
} }
.template-item-img { .template-item-img {
position: absolute; flex: 1;
width: 182px; display: flex;
height: 86px; padding: 4px 4px 0;
left: 0px; }
top: 0px; .template-item-img-inner {
flex: 1;
} }
.demonstration { .demonstration {
position: absolute; height: 38px;
width: 166px; padding: 8px 12px;
height: 20px; font-weight: 500;
left: 8px; font-size: 14px;
top: 91px; line-height: 22px;
font-style: normal;
font-weight: 400;
font-size: 12px;
line-height: 20px;
display: block;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
border-top: 1px solid #dee0e3;
} }
.template-item-main:hover { .template-item-main:hover {