Переглянути джерело

Merge branch 'next' of https://gitee.com/zuohuaijun/Admin.NET into next

zuohuaijun 2 роки тому
батько
коміт
548a475c33

+ 4 - 2
Web/src/views/system/print/component/editPrint.vue

@@ -65,7 +65,7 @@
 </template>
 
 <script lang="ts" setup name="sysEditPrint">
-import { onMounted, reactive, ref } from 'vue';
+import { onMounted, reactive, ref, nextTick } from 'vue';
 import HiprintDesign from '/@/views/system/print/component/hiprint/index.vue';
 
 import { getAPI } from '/@/utils/axios-utils';
@@ -93,7 +93,9 @@ const openDialog = (row: any) => {
 	state.isShowDialog = true;
 	ruleFormRef.value?.resetFields();
 
-	if (hiprintDesignRef.value != undefined) loadTemplate();
+	nextTick(() => {
+		loadTemplate();
+	});
 };
 
 // 加载模板

+ 3 - 0
Web/src/views/system/print/component/hiprint/preview.vue

@@ -28,6 +28,9 @@ const showDialog = (hiprintTemplate: any, printData: {}, width = 210) => {
 	state.hiprintTemplate = hiprintTemplate;
 	state.printData = printData;
 	nextTick(() => {
+		while (previewContentRef.value?.firstChild) {
+			previewContentRef.value.removeChild(previewContentRef.value.firstChild);
+		}
 		const newHtml = hiprintTemplate.getHtml(printData);
 		previewContentRef.value.appendChild(newHtml[0]);
 	});