| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item :label="t('template.templateSize')" prop="templateSize"> |
| | | <el-select |
| | | style="width: 100%" |
| | | v-model="formData.templateSize" |
| | | clearable |
| | | :placeholder="t('common.selectText') + t('template.templateSize')" |
| | | class="!w-240px" |
| | | @change="changeTemplateSize" |
| | | > |
| | | <el-option |
| | | v-for="dict in getStrDictOptions(DICT_TYPE.TEMPLATE_SIZE)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :label="t('template.digitalPeopleWidth')" prop="humanW"> |
| | | <el-input type="number" v-model="formData.humanW" :placeholder="t('common.inputText') + t('template.digitalPeopleWidth')" /> |
| | | <el-input type="number" disabled v-model="formData.humanW" :placeholder="t('common.inputText') + t('template.digitalPeopleWidth')" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :label="t('template.digitalPeopleHeight')" prop="humanH"> |
| | | <el-input type="number" v-model="formData.humanH" :placeholder="t('common.inputText') + t('template.digitalPeopleHeight')" /> |
| | | <el-input type="number" disabled v-model="formData.humanH" :placeholder="t('common.inputText') + t('template.digitalPeopleHeight')" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item :label="t('template.templateSize')" prop="templateSize"> |
| | | <el-select |
| | | v-model="formData.templateSize" |
| | | clearable |
| | | :placeholder="t('common.selectText') + t('template.templateSize')" |
| | | class="!w-240px" |
| | | > |
| | | <el-option |
| | | v-for="dict in getStrDictOptions(DICT_TYPE.TEMPLATE_SIZE)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | pptX: [{ required: true, message: t('template.topPositionPPT') + t('common.notEmpty'), trigger: 'blur' }], |
| | | pptY: [{ required: true, message: t('template.leftPositionPPT') + t('common.notEmpty'), trigger: 'blur' }], |
| | | humanW: [{ required: true, message: t('template.digitalPeopleWidth') + t('common.notEmpty'), trigger: 'blur' }], |
| | | templateSize: [{ required: true, message: t('template.templateSize') + t('common.notEmpty'), trigger: 'blur' }], |
| | | humanH: [{ required: true, message: t('template.digitalPeopleHeight') + t('common.notEmpty'), trigger: 'blur' }], |
| | | humanX: [{ required: true, message: t('template.topPositionDigitalPeople') + t('common.notEmpty'), trigger: 'blur' }], |
| | | humanY: [{ required: true, message: t('template.leftPositionDigitalPeople') + t('common.notEmpty'), trigger: 'blur' }], |
| | |
| | | } |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | const changeTemplateSize = () => { |
| | | console.log(formData.value.templateSize) |
| | | const screenWidth = window.screen.width; |
| | | const screenHeight = window.screen.height; |
| | | if(formData.value.templateSize=='16:9'){ |
| | | formData.value.humanW = screenWidth / 3; |
| | | formData.value.humanH = screenHeight / 3; |
| | | }else if(formData.value.templateSize=='9:16'){ |
| | | formData.value.humanH = screenWidth / 3; |
| | | formData.value.humanW = screenHeight / 3; |
| | | } |
| | | } |
| | | /** 提交表单 */ |
| | | const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
| | | const submitForm = async () => { |