Browse Source

chore: print

master
wangxiang 2 years ago
parent
commit
58eeda98c0
No known key found for this signature in database
GPG Key ID: 1BA7946AB6B232E4
  1. 10
      src/views/workflow/task/TaskForm.vue

10
src/views/workflow/task/TaskForm.vue

@ -14,12 +14,14 @@ @@ -14,12 +14,14 @@
</template>
<!-- 动态表单:内置使用枇杷表单设计器(待更新为VUE3海豚表单设计器) -->
<workflow-preview-form v-if="state.formType !== '2'"
id="task-form"
ref="formPreview"
:task-form-data="state.taskFormData"
/>
<!-- 外置表单:内置使用用户自定义的vue页面,手动填写页面路径即可 -->
<component :is="state.formPath"
v-if="state.formType === '2'"
id="task-form"
ref="formPreview"
:form-read-only="state.formReadOnly"
:businessId="state.businessId"
@ -194,6 +196,7 @@ @@ -194,6 +196,7 @@
import RollBackTaskModal from './popups/RollBackTaskModal.vue';
import { PageEnum } from '/@/enums/workflowEnum';
import { useAppStore } from '/@/store/modules/app';
import printJS from 'print-js';
/** 类型规范统一声明定义区域 */
interface WindowState {
@ -524,7 +527,12 @@ @@ -524,7 +527,12 @@
function print() {
state.loading = true;
try {
console.warn('---工作流表单打印成功,此处可以做一些打印回调逻辑处理!---');
printJS({
documentTitle: state.formTitle,
printable: 'task-form',
type: 'html',
targetStyle: ['*']
});
} finally {
state.loading = false;
}

Loading…
Cancel
Save