Files
dvcp_v2_wxcp_app/src/components/AiItem.vue

112 lines
2.0 KiB
Vue
Raw Normal View History

2022-05-19 17:28:53 +08:00
<template>
2022-06-01 18:22:19 +08:00
<section class="AiItem" :class="{border}">
2022-05-19 17:28:53 +08:00
<div v-if="topLabel" class="topLabel">
<div class="labelPane" flex>
2022-06-01 18:22:19 +08:00
<div class="label" :class="{required,labelBold}" v-text="label"/>
2022-07-18 11:36:06 +08:00
<slot name="sub" v-if="$scopedSlots.sub"/>
2022-05-19 17:28:53 +08:00
</div>
<div class="content">
2022-07-18 11:36:06 +08:00
<slot v-if="$scopedSlots.default"/>
2022-05-19 17:28:53 +08:00
<div v-else v-text="value"/>
</div>
</div>
<div v-else class="normal" flex>
<div class="fill" flex>
2022-06-01 18:22:19 +08:00
<div class="label" :class="{required,labelBold}" v-text="label"/>
2022-07-18 11:36:06 +08:00
<slot name="sub" v-if="$scopedSlots.sub"/>
2022-05-19 17:28:53 +08:00
</div>
2022-06-01 18:22:19 +08:00
<div class="flexContent">
2022-07-18 11:36:06 +08:00
<slot v-if="$scopedSlots.default"/>
2022-06-01 18:22:19 +08:00
<div v-else v-text="value"/>
</div>
2022-05-19 17:28:53 +08:00
</div>
</section>
</template>
<script>
export default {
name: "AiItem",
props: {
value: {default: ""},
label: {default: ""},
required: Boolean,
2022-06-01 18:22:19 +08:00
topLabel: Boolean,
border: {default: true},
labelBold: Boolean
2022-05-19 17:28:53 +08:00
},
data() {
return {}
}
}
</script>
<style lang="scss" scoped>
.AiItem {
font-family: PingFangSC-Regular, PingFang SC;
2022-08-15 18:39:33 +08:00
&.border {
2022-06-01 18:22:19 +08:00
.normal {
border-bottom: 2px solid #ddd;
}
.topLabel {
border-bottom: 2px solid #ddd;
}
}
2022-05-19 17:28:53 +08:00
.normal {
width: 100%;
padding-right: 32px;
box-sizing: border-box;
height: 112px;
2022-06-01 18:22:19 +08:00
.flexContent {
max-width: 62vw;
2022-08-15 18:39:33 +08:00
input {
text-align: right;
}
2022-06-01 18:22:19 +08:00
}
2022-05-19 17:28:53 +08:00
}
.label {
padding-left: 20px;
font-weight: 400;
color: #333333;
margin-right: 20px;
position: relative;
&.required:before {
position: absolute;
display: block;
left: 0;
top: 50%;
transform: translateY(-50%);
content: "*";
color: #f46;
}
2022-06-01 18:22:19 +08:00
&.labelBold {
font-weight: bold;
font-size: 34px;
}
2022-05-19 17:28:53 +08:00
}
2022-06-01 18:22:19 +08:00
::v-deep.topLabel {
2022-05-19 17:28:53 +08:00
padding: 32px 32px 32px 0;
.labelPane {
margin-bottom: 32px;
}
.content {
padding-left: 20px;
2022-06-01 18:22:19 +08:00
.AiMore > .u-icon {
width: 100%;
}
2022-05-19 17:28:53 +08:00
}
}
}
</style>