perf: 修改 detail card

This commit is contained in:
ibuler
2024-05-23 18:26:36 +08:00
parent 23f6502d99
commit 5996d89e4c
9 changed files with 51 additions and 37 deletions

View File

@@ -67,7 +67,7 @@ export default {
h2 { h2 {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
line-height: 2; line-height: 50px;
color: var(--color-text-primary); color: var(--color-text-primary);
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;

View File

@@ -526,3 +526,24 @@ li.rmenu i.fa {
.el-checkbox__inner { .el-checkbox__inner {
border-radius: 1px !important; border-radius: 1px !important;
} }
.el-alert.el-alert--info.is-light {
i.el-icon-info.is-big {
font-size: 16px;
width: 18px;
}
}
.el-card.no-border {
margin-bottom: 20px;
.el-card__header {
padding-top: 20px;
padding-bottom: 0;
border-bottom: none;
display: inline-block;
font-size: 14px;
font-weight: 500;
}
}

View File

@@ -90,14 +90,13 @@ export function changeMenuColor(themeColors) {
colors['--menu-hover'] = mix(white, menuActiveTextColor.replace(/#/g, ''), 90) colors['--menu-hover'] = mix(white, menuActiveTextColor.replace(/#/g, ''), 90)
} }
const lights = [15, 40, 60, 80] const lights = [15, 40, 60, 80, 90]
const darken = [15, 30, 40, 60] const darken = [15, 30, 40, 60, 80]
for (const key in colors) { for (const key in colors) {
const currentColor = colors[key] const currentColor = colors[key]
elementStyle.setProperty(key, currentColor) elementStyle.setProperty(key, currentColor)
if (key === '--color-primary') {
for (const [i, light] of lights.entries()) { for (const [i, light] of lights.entries()) {
const color = mix(white, currentColor.replace(/#/g, ''), light) const color = mix(white, currentColor.replace(/#/g, ''), light)
elementStyle.setProperty(key + '-light' + '-' + i, color) elementStyle.setProperty(key + '-light' + '-' + i, color)
@@ -106,7 +105,6 @@ export function changeMenuColor(themeColors) {
const color = mix(black, currentColor.replace(/#/g, ''), dark) const color = mix(black, currentColor.replace(/#/g, ''), dark)
elementStyle.setProperty(key + '-dark' + '-' + i, color) elementStyle.setProperty(key + '-dark' + '-' + i, color)
} }
}
if (key.includes('--color')) { if (key.includes('--color')) {
const lightColor = mix(white, currentColor.replace(/#/g, ''), 70) const lightColor = mix(white, currentColor.replace(/#/g, ''), 70)

View File

@@ -47,6 +47,9 @@ export function changeElementColor(themeColors) {
.el-tag--dark.el-tag--${key} { .el-tag--dark.el-tag--${key} {
background-color: ${value} !important; background-color: ${value} !important;
} }
.el-alert.el-alert--${key}.is-light {
background-color: var(--color-${key}-light-4);
}
` `
} }
} }

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-alert v-if="helpMessage" type="success"> <el-alert v-if="helpMessage" show-icon type="info">
<span class="announcement-main" v-html="helpMessage" /> <span class="announcement-main" v-html="helpMessage" />
</el-alert> </el-alert>
<ListTable ref="ListTable" :header-actions="iHeaderActions" :table-config="iTableConfig" /> <ListTable ref="ListTable" :header-actions="iHeaderActions" :table-config="iTableConfig" />

View File

@@ -22,7 +22,7 @@ export default {
}, },
data() { data() {
return { return {
url: `/api/v1/assets/domains/${this.object.id}`, url: `/api/v1/assets/domains/${this.object.id}/`,
detailFields: [ detailFields: [
'name', 'assets_amount', 'name', 'assets_amount',
{ {

View File

@@ -25,6 +25,7 @@ export default {
TaskDetail: {}, TaskDetail: {},
config: { config: {
activeMenu: 'Detail', activeMenu: 'Detail',
url: '/api/v1/assets/domains/',
submenu: [ submenu: [
{ {
title: this.$t('Detail'), title: this.$t('Detail'),

View File

@@ -1,6 +1,6 @@
<template> <template>
<div id="HomeCard"> <div id="HomeCard">
<el-card class="box-card" shadow="never"> <el-card class="box-card no-border" shadow="never">
<div v-show="title || btnText" slot="header" class="clearfix"> <div v-show="title || btnText" slot="header" class="clearfix">
<span v-show="title" class="head-title">{{ title }}</span> <span v-show="title" class="head-title">{{ title }}</span>
<el-button <el-button
@@ -73,13 +73,9 @@ export default {
position: relative; position: relative;
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
//box-shadow: 0 2px 4px 0 rgb(54 58 80 / 32%);
transition: all 0.4s ease; transition: all 0.4s ease;
overflow: hidden; overflow: hidden;
&>>> .el-card__header {
padding: 20px 20px 0;
border-bottom: 0;
}
&:nth-child(n) { &:nth-child(n) {
margin-bottom: 20px; margin-bottom: 20px;
} }
@@ -92,11 +88,6 @@ export default {
font-size: 110px; font-size: 110px;
opacity: .1; opacity: .1;
} }
.head-title {
display: inline-block;
font-size: 14px;
font-weight: 500;
}
.others { .others {
width: 100%; width: 100%;
height: auto; height: auto;

View File

@@ -1,5 +1,5 @@
<template> <template>
<el-card class="box-card" shadow="never"> <el-card class="box-card no-border" shadow="never">
<div slot="header" class="title"> <div slot="header" class="title">
<span>{{ $t('YourProfile') }}</span> <span>{{ $t('YourProfile') }}</span>
</div> </div>
@@ -10,10 +10,10 @@
</el-col> </el-col>
<el-col ::md="20" :sm="24"> <el-col ::md="20" :sm="24">
<ul> <ul>
<li><span class="title">{{ $t('Username') }}</span><span>{{ users.name }}</span></li> <li><span class="title">{{ $t('Username') }}:</span><span>{{ users.name }}</span></li>
<li><span class="title">{{ $t('Email') }}</span><span>{{ users.email }}</span></li> <li><span class="title">{{ $t('Email') }}:</span><span>{{ users.email }}</span></li>
<li> <li>
<span class="title">{{ $t('LoginDate') }}</span> <span class="title">{{ $t('LoginDate') }}:</span>
<span>{{ users.last_login | date }}</span> <span>{{ users.last_login | date }}</span>
</li> </li>
</ul> </ul>
@@ -60,14 +60,14 @@ li {
min-width: 100px; min-width: 100px;
} }
} }
//
.box-card { //.box-card {
margin-bottom: 20px; // margin-bottom: 20px;
//
& >>> .el-card__header { // & >>> .el-card__header {
padding-top: 20px; // padding-top: 20px;
} // }
} //}
.content { .content {
overflow: hidden; overflow: hidden;