mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-09-14 07:59:46 +00:00
style(design,editor,form): 事件模块处理 & 卡片样式调整
This commit is contained in:
parent
dec4ebfa20
commit
be7b38f97e
@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<component :is="uiComponent" :class="['tmagic-design-card', { 'tmagic-design-card--flat': isFlat }]" v-bind="uiProps">
|
<component
|
||||||
|
:is="uiComponent"
|
||||||
|
:class="['tmagic-design-card', { 'tmagic-design-card--flat': isFlat, 'm-flat-hide-body': isHideBody }]"
|
||||||
|
v-bind="uiProps"
|
||||||
|
>
|
||||||
<template #header v-if="$slots.header">
|
<template #header v-if="$slots.header">
|
||||||
<slot name="header" class="header"></slot>
|
<slot name="header" class="header"></slot>
|
||||||
</template>
|
</template>
|
||||||
@ -30,7 +34,7 @@ const uiComponent = ui?.component || 'el-card';
|
|||||||
// 当祖先 `<MEditor>` / `<MForm>` 的 theme 是 `magic-admin` 时,整套设计语言默认走「无卡片感」,
|
// 当祖先 `<MEditor>` / `<MForm>` 的 theme 是 `magic-admin` 时,整套设计语言默认走「无卡片感」,
|
||||||
// 因此这里自动等价于 `flat=true`;调用方仍可显式传 `flat` 强制开启。
|
// 因此这里自动等价于 `flat=true`;调用方仍可显式传 `flat` 强制开启。
|
||||||
const isFlat = computed(() => !!props.flat || isGlobalFlat.value);
|
const isFlat = computed(() => !!props.flat || isGlobalFlat.value);
|
||||||
|
const isHideBody = computed(() => isFlat.value && props.bodyStyle?.display === 'none');
|
||||||
// 把 `flat` 从转发给底层 UI 库(el-card / t-card 等)的 props 中剥离:
|
// 把 `flat` 从转发给底层 UI 库(el-card / t-card 等)的 props 中剥离:
|
||||||
// 它仅作用于本组件的视觉修饰类,不需要也不应该作为属性落到底层组件 / DOM 上。
|
// 它仅作用于本组件的视觉修饰类,不需要也不应该作为属性落到底层组件 / DOM 上。
|
||||||
const uiProps = computed<CardProps>(() => {
|
const uiProps = computed<CardProps>(() => {
|
||||||
|
|||||||
@ -11,7 +11,11 @@
|
|||||||
border-right: 0;
|
border-right: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
|
&.m-flat-hide-body {
|
||||||
|
.el-card__header {
|
||||||
|
border-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
&.m-fields-group-list-item {
|
&.m-fields-group-list-item {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
@ -21,7 +25,7 @@
|
|||||||
|
|
||||||
.el-card__header {
|
.el-card__header {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
padding: 16px;
|
padding: 8px 16px;
|
||||||
&:hover {
|
&:hover {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
@ -29,11 +33,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.m-fields-group-list-footer {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
.el-card__body {
|
.el-card__body {
|
||||||
padding: 0 16px 0 16px;
|
padding: 0 16px 0 16px;
|
||||||
// 这里每个form-item应该要有一个16px间距,但是除了tbody中的form-item
|
// 这里每个form-item应该要有一个16px间距,但是除了tbody中的form-item
|
||||||
.tmagic-design-form-item:not(tbody .tmagic-design-form-item) {
|
.tmagic-design-form-item:not(tbody .tmagic-design-form-item) {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
> .m-container-row {
|
> .m-container-row {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
@ -61,7 +69,7 @@
|
|||||||
}
|
}
|
||||||
> .el-card__body {
|
> .el-card__body {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding-top: 16px;
|
padding-top: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,13 +37,12 @@
|
|||||||
:model="entry.cardItem"
|
:model="entry.cardItem"
|
||||||
:last-values="entry.lastCardItem"
|
:last-values="entry.lastCardItem"
|
||||||
:is-compare="isCompareMode"
|
:is-compare="isCompareMode"
|
||||||
:hide-expand="true"
|
:hide-expand="false"
|
||||||
:label-width="config.labelWidth || '100px'"
|
:label-width="config.labelWidth || '100px'"
|
||||||
@change="onChangeHandler"
|
@change="onChangeHandler"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="event-item-header">
|
<div class="event-item-header">
|
||||||
<div class="event-item-title">事件{{ Number(entry.index) + 1 }}</div>
|
|
||||||
<MFormContainer
|
<MFormContainer
|
||||||
class="fullWidth"
|
class="fullWidth"
|
||||||
:config="eventNameConfig"
|
:config="eventNameConfig"
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
> .m-fields-group-list {
|
> .m-fields-group-list {
|
||||||
> .tmagic-design-card--flat {
|
> .tmagic-design-card--flat {
|
||||||
> .el-card__header {
|
> .el-card__header {
|
||||||
padding: 16px 0;
|
padding: 8px 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -34,7 +34,7 @@
|
|||||||
.create-button {
|
.create-button {
|
||||||
&.fullWidth {
|
&.fullWidth {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0 0 16px 0;
|
margin: 0 0 8px 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
.m-fields-event-select {
|
.m-fields-event-select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.fullWidth {
|
.fullWidth {
|
||||||
width: 100%;
|
width: calc(100% - 32px);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
&.create-button {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.event-select-container {
|
.event-select-container {
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
@ -11,7 +14,7 @@
|
|||||||
border-bottom: 1px solid #ebeef5;
|
border-bottom: 1px solid #ebeef5;
|
||||||
}
|
}
|
||||||
> .el-card__body {
|
> .el-card__body {
|
||||||
padding-bottom: 16px;
|
padding-bottom: 8px;
|
||||||
.m-fields-group-list-footer {
|
.m-fields-group-list-footer {
|
||||||
div {
|
div {
|
||||||
justify-content: flex-start !important;
|
justify-content: flex-start !important;
|
||||||
@ -19,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
.el-card.tmagic-design-card--flat {
|
.el-card.tmagic-design-card--flat {
|
||||||
> .el-card__header {
|
> .el-card__header {
|
||||||
padding: 16px 0;
|
padding: 8px 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,17 +79,18 @@
|
|||||||
.event-item-header {
|
.event-item-header {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
.event-item-title {
|
.event-item-title {
|
||||||
color: #0f1113;
|
color: #0f1113;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
.event-item-delete-button {
|
.event-item-delete-button {
|
||||||
position: absolute;
|
color: #0f1113;
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
.m-fields-group-list-item.tmagic-design-card--flat:last-child {
|
.m-fields-group-list-item.tmagic-design-card--flat:last-child {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-button--text {
|
.el-button--text {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin-bottom: 7px;
|
margin-bottom: 7px;
|
||||||
@ -32,7 +31,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.m-fields-group-list-footer {
|
.m-fields-group-list-footer {
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user