<!-- 标签---限用说明 --> <script name="LabelLimitInstruction" 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' import { useCreateQr } from '@/commonMethods/useCreateQr' const props = defineProps({ title: { // 标题 type: String, default: '限用说明', }, backgroundColor: { // 背景颜色 type: String, default: '#00a8ff', }, limitInstruction: { // 限用说明 type: String, default: '', }, manufactureNo: { // 设备编号 type: String, default: '', }, }) const qrUrl = ref('') // 二维码图片 watch(() => props.manufactureNo, (newValue) => { if (newValue) { qrUrl.value = useCreateQr(newValue)! } }, { immediate: true }) </script> <template> <div id="printData" class="label-limitInstruction"> <div class="left"> <div class="banner"> <img style="width: 46px; height: 32px;" src="../../../../../../assets/images/login-image-new/logo-border.png"> <span class="title">{{ props.title }}</span> </div> <div class="data-area"> {{ props.limitInstruction }} </div> </div> <div class="right"> <el-image style="width: 160px; height: 160px; margin-left: 10px;" :src="qrUrl" /> </div> </div> </template> <style lang="scss" scoped> .label-limitInstruction { display: flex; border-radius: 10px; width: 550px; height: 200px; background-color: #f2f3f5; .left { padding: 10px 20px; flex: 1; background-color: v-bind(backgroundColor); border-radius: 10px; .banner { display: flex; align-items: center; margin-bottom: 10px; .title { flex: 1; font-weight: 600; font-size: 20px; color: #fff; text-align: center; margin-left: -20px; } } .data-area { width: 330px; height: 130px; background-color: #fff; border-radius: 2px; font-size: 18px; padding: 8px; } } .right { width: 220px; display: flex; align-items: center; } } </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>