<!-- 标签---三行信息,测试、校准、限用、停用、封存、合格、禁用 --> <script name="LabelThreeInfo" lang="ts" setup> import type { Ref } from 'vue' import { onMounted, ref } from 'vue' import dayjs from 'dayjs' import { ElLoading, ElMessage } from 'element-plus' import { printHtml } from '@/utils/printUtils' const props = defineProps({ title: { // 标题 type: String, default: '测试', }, backgroundColor: { // 背景颜色 type: String, default: '#12cccc', }, dateTitle: { // 日期标题 type: String, default: '测试日期', }, personTitle: { // 人员标题 type: String, default: '测试人', }, }) const form = ref({ no: '', // 编号 date: '', // 日期 person: '', // 人员 }) const print = () => { printHtml('printData') } defineExpose({ print }) </script> <template> <div id="printData" class="three-info"> <div class="left"> <div class="banner"> <img style="width: 46px; height: 32px;background-color: red;" src="../../../../../../assets//images/logo.png"> <span class="title">{{ props.title }}</span> </div> <div class="data-area"> <el-form ref="formRef" :model="form" :label-width="80" label-position="right" > <el-form-item label="编号" prop="no"> <el-input v-model="form.no" /> </el-form-item> <el-form-item :label="props.dateTitle" prop="date"> <el-input v-model="form.date" /> </el-form-item> <el-form-item :label="props.personTitle" prop="person"> <el-input v-model="form.person" /> </el-form-item> </el-form> </div> </div> <div class="right"> <img style="width: 46px; height: 32px;" src="../../../../../../assets/images/login-image-new/logo-border.png"> </div> </div> </template> <style lang="scss" scoped> .three-info { padding: 10px 20px 20px; display: flex; border-radius: 10px; // width: fit-content; background-color: v-bind(backgroundColor); widows: 360px; height: 260px; .left { flex: 1; .banner { display: flex; align-items: center; margin-bottom: 20px; .title { flex: 1; font-weight: 600; font-size: 24px; color: #000; text-align: center; } } .data-area { background-color: #fff; padding: 20px 20px 10px; border-radius: 2px; } } } </style> <style lang="scss"> .three-info { .el-form-item--default .el-form-item__label { // color: v-bind(backgroundColor); color: #000; } .el-input__wrapper { border-bottom: 1px solid v-bind(backgroundColor); box-shadow: none; border-radius: 0; padding: 0 10px; } } </style>