修复绑定打印设计模板左边面板绑定问题
This commit is contained in:
parent
b48ebc4cc8
commit
86f8356ef4
@ -9,7 +9,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<div style="margin: 0px 0px 0px 0px">
|
||||
<HiprintDesign ref="hiprintDesignRef" />
|
||||
<HiprintDesign :mode-index="mode" ref="hiprintDesignRef" />
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer" style="margin-top: 10px">
|
||||
@ -93,6 +93,8 @@ import { UpdatePrintInput } from '/@/api-services/models';
|
||||
|
||||
const hiprintDesignRef = ref<InstanceType<typeof HiprintDesign>>();
|
||||
|
||||
const mode = ref(0);
|
||||
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
});
|
||||
@ -110,6 +112,8 @@ onMounted(async () => {});
|
||||
// 打开弹窗
|
||||
const openDialog = (row: any) => {
|
||||
state.ruleForm = JSON.parse(JSON.stringify(row));
|
||||
let templateJson = JSON.parse(state.ruleForm.template);
|
||||
mode.value = templateJson.panels[0].index;
|
||||
state.isShowDialog = true;
|
||||
ruleFormRef.value?.resetFields();
|
||||
|
||||
|
||||
@ -109,6 +109,14 @@ import providers from './providers';
|
||||
import PrintPreview from './preview.vue';
|
||||
import printData from './print-data';
|
||||
|
||||
//父级传递来的参数
|
||||
var props = defineProps({
|
||||
modeIndex: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
});
|
||||
|
||||
let hiprintTemplate = ref();
|
||||
// 模板选择
|
||||
let mode = ref(0);
|
||||
@ -318,6 +326,7 @@ onMounted(() => {
|
||||
state.modeList = providers.map((e) => {
|
||||
return { type: e.type, name: e.name, value: e.value };
|
||||
});
|
||||
mode.value = props.modeIndex;
|
||||
changeMode();
|
||||
// otherPaper(); // 默认纸张
|
||||
});
|
||||
@ -325,7 +334,6 @@ onMounted(() => {
|
||||
// 初始化纸张大小
|
||||
const initPaper = () => {
|
||||
var template = hiprintTemplate.value.getJson();
|
||||
mode.value = template.panels[0].index;
|
||||
var width = template.panels[0].width;
|
||||
var height = template.panels[0].height;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user