Browse Source

Merge branch 'fix-printing'

master
han2015 4 days ago
parent
commit
efb0e3cd89
  1. 14
      src/components/DesignForm/printHtmlRender.ts
  2. 57
      src/components/DesignForm/printHtmlRender.vue
  3. 1
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageList.vue
  4. 293
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/printHtmlDom.js
  5. 9
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/printSetupPage2.vue
  6. 1
      src/views/sysworkflow/lowcodepage/pageList.vue

14
src/components/DesignForm/printHtmlRender.ts

@ -7,6 +7,7 @@ import { useOrgMemberStore } from "@/store/modules/orgMember";
const printRenderTree: Ref<any[]> = ref([]);
const orgMembers = useOrgMemberStore()
await orgMembers.havueOrgTree()
export const printHtmlPage = async (pformid:string,pappkey:string,pversionid:string,pformkey:string,row: any) => {
let data:any[]=[]
let _pageConfig:PageConfig
@ -37,13 +38,13 @@ export const printHtmlPage = async (pformid:string,pappkey:string,pversionid:str
if(resp.data.pageconfigjson!=""){
_pageConfig=JSON.parse(resp.data.pageconfigjson)
if(_pageConfig.founder!=""){
_pageConfig.founder=row[_pageConfig.founder]
_pageConfig.deptOrg=orgMembers.listMap[row.createrOrg]
if(_pageConfig.pagebrow.includes("creater")){
_pageConfig.creater=row["creater"]
_pageConfig.createrOrg=orgMembers.listMap[row.createrOrg]
}
if(_pageConfig.founderTime!=""){
_pageConfig.founderTime=row[_pageConfig.founderTime]
if(_pageConfig.pagebrow.includes("creater_time")){
_pageConfig.createrTime=row["creater_time"]
}
_pageConfig.masters_key=row.masters_key
@ -106,12 +107,15 @@ const deepLoopForm=(node:fieldTree, row: Record<string, any>)=>{
}else if(node.type=="select"||node.type=="checkbox"){
const val=row[node.field!]
node.field=""
if(node.options){
for(let op of node.options!){
if(op.value==val){
node.field=op.label
break;
}
}
}
}else{
node.field=row[node.field!]
}

57
src/components/DesignForm/printHtmlRender.vue

@ -21,9 +21,9 @@ export interface PageConfig{
//
pagebrow:string[];
founder:string;
founderTime:string;
deptOrg:string;
creater:string;
createrTime:string;
createrOrg:string;
masters_key:string;
qrcode:boolean;
}
@ -90,12 +90,12 @@ const getStateText=(val:number)=>{
</div>
<div id="printContainer">
<h3>{{props.name}}</h3>
<div style="display: flex;justify-content: space-between; margin-bottom: 10px;">
<span v-if="props.pageConfig.pagebrow.includes('founder')">创建人: {{ props.pageConfig.founder }}</span>
<span v-if="props.pageConfig.pagebrow.includes('founderTime')">创建时间: {{ props.pageConfig.founderTime }}</span>
<span v-if="props.pageConfig.pagebrow.includes('deptOrg')">所属部门: {{ props.pageConfig.deptOrg }}</span>
<div style="display: flex;justify-content: space-between; margin-bottom: 10px;width: 100%;">
<span v-if="props.pageConfig.pagebrow.includes('creater')">创建人: <strong>{{ props.pageConfig.creater }}</strong></span>
<span v-if="props.pageConfig.pagebrow.includes('creater_time')">创建时间: <strong>{{ props.pageConfig.createrTime }}</strong></span>
<span v-if="props.pageConfig.pagebrow.includes('createrOrg')">所属部门: <strong>{{ props.pageConfig.createrOrg }}</strong></span>
</div>
<div v-for="group in props.fieldTree">
<div v-for="group in props.fieldTree" style="width:100%">
<div v-if="Array.isArray(group) && group.length>0" class="auto_table">
<template v-for="item in group" >
<div v-if="item.checked!=2" class="cell_box">
@ -110,9 +110,9 @@ const getStateText=(val:number)=>{
<div v-else-if="group.type=='divider'" v-if="group.checked!=2" class="title">{{ group.name }}</div>
<div v-else-if="group.type=='textarea'" v-if="group.checked!=2" class="section">
<h5>{{ group.name }}</h5>
<div class="text_area">{{ group.field }}</div>
<div class="text_area">{{ group.field+" " }}</div>
</div>
<div v-else-if="group.type=='table'" class="section_table" v-if="group.checked!=2">
<div v-else-if="group.type=='table'" class="section_tabs" v-if="group.checked!=2">
<table class="bder_table">
<caption >{{ group.name }}</caption>
<thead>
@ -157,7 +157,7 @@ v-else-if="tabs.type=='divider'" v-if="tabs.checked!=2" class="title"
style="font-size: 12px; margin-top: 20px;">{{ tabs.name }}</div>
<div v-else-if="tabs.type=='textarea'" v-if="tabs.checked!=2" class="section">
<h5>{{ tabs.name }}</h5>
<div class="text_area">{{ tabs.field }}</div>
<div class="text_area">{{ tabs.field+" " }}</div>
</div>
<div v-else-if="tabs.type=='table'" v-if="tabs.checked!=2" class="section">
<h5>{{ tabs.name }}</h5>
@ -185,7 +185,7 @@ v-else-if="tabs.type=='divider'" v-if="tabs.checked!=2" class="title"
</tbody>
</table>
</div>
<div v-else class="section tabs_wide_box" v-if="tabs.checked!=2">
<div v-else class=" tabs_wide_box" v-if="tabs.checked!=2">
<span class="box_name">
{{tabs.name}}
</span>
@ -195,22 +195,22 @@ v-else-if="tabs.type=='divider'" v-if="tabs.checked!=2" class="title"
</div>
</div>
<div v-else v-if="group.checked!=2 && group.type">{{ group }}</div>
<div v-else v-if="group.checked!=2 && group.type">{{ group }} fuck!</div>
</div>
<div v-if="props.flowList && props.flowList.length>0" class="section_table">
<div v-if="props.flowList && props.flowList.length>0" class="section_tabs">
<table class="bder_table">
<caption >审批流程</caption>
<thead>
<tr>
<th >审批节点</th>
<th >处理人</th>
<th >操作记录</th>
<th style="width: 35%;">审批节点</th>
<th style="width: 15%;">处理人</th>
<th style="width: 50%;">操作记录</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in props.flowList" :key="dd">
<template v-if="item.step>1">
<tr v-for="(item, index) in props.flowList" :key="index">
<template v-if="item.step>=1">
<td >
<div style="line-height: 22px;">{{ item.nodeName}}
<span v-if="item.examinemode==1">(依次审批)</span>
@ -224,18 +224,16 @@ v-else-if="tabs.type=='divider'" v-if="tabs.checked!=2" class="title"
<td >
<template v-for="oper in item.operator" >
<span v-if="oper.log" class="operate_log" >
<template v-for="log in oper.log">
{{ oper.name }}--{{ oper.departmentname }}--{{ oper.postname }}
</template>
<span v-if="oper" class="operate_log" >
{{ oper.name }}
</span>
</template>
</td>
<td >
<template v-for="oper in item.operator" >
<span v-if="oper.log" class="operate_log" >
<span v-if="oper" class="operate_log" >
<template v-for="log in oper.log">
({{ getStateText(log.state) }}) {{ log.cause }} {{ log.time.slice(0,16) }}
{{ oper.name }} ({{ getStateText(log.state) }}) {{ log.cause }} {{ log.time.slice(0,16) }}
</template>
</span>
</template>
@ -246,15 +244,15 @@ v-else-if="tabs.type=='divider'" v-if="tabs.checked!=2" class="title"
</table>
</div>
<div v-if="props.pageConfig.qrcode" style="display: flex; justify-content: space-between;margin-top: 20px; ">
<div v-if="props.pageConfig.qrcode" style="display: flex; justify-content: space-between;margin-top: 20px;width: 100%; ">
{{ generateQrCode() }}
<div style="display: inherit; align-items: center;">
<img id="qrcode" width="100px" :src="qrdata"/>
<div style="text-align: left;padding-left: 5px;">使用手机企业微信<br>扫一扫</div>
</div>
<div style="display: flex;flex-direction: column;text-align: left;justify-content: center; ">
<p>打印日期{{ new Date().toLocaleString() }}</p>
<p>打印人 {{userName}}</p>
<p>打印日期<strong>{{ new Date().toLocaleDateString() }}</strong></p>
<p>打印人 <strong>{{userName}}</strong></p>
</div>
</div>
</div>
@ -337,6 +335,7 @@ h5{
}
.section_tabs{
width: 100%;
margin: 10px 0;
display: flex;
flex-wrap: wrap;
@ -387,7 +386,7 @@ h5{
width: 30%;
min-height: 30px;
text-wrap: wrap;
max-height: 80px;
//max-height: 80px;
overflow: hidden; /* 配合 ellipsis 需要 */
}

1
src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageList.vue

@ -872,7 +872,6 @@ const saveFormListData = () => {
data: json2string(state),
id: props.appPageKey.toString(),
};
console.log(params,"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")
// console.log("",params)
editCustomerFormList(params).then((data) => {

293
src/views/sysworkflow/lowcodepage/appPage/appPageForm/printHtmlDom.js

@ -37,7 +37,7 @@ function analyzePageStructure(container) {
return {
hasHeader: !!header,
hasBottom: false,
header: header?.cloneNode(true),
header: header,
bottom: "",
main: mainContent,
tables: Array.from(mainContent.querySelectorAll('table'))
@ -61,13 +61,12 @@ function paginateContent(structure, options) {
}
const paperHeight = _pageH * 3.78;
const marginPx = margin * 3.78;
const printableHeight = paperHeight - marginPx * 2;
const headerHeight = structure.hasHeader ? structure.header.getBoundingClientRect().height : 0;
const bottomHeight = structure.hasBottom ? structure.bottom.getBoundingClientRect().height : 0;
const availableHeight = printableHeight - headerHeight - bottomHeight-30; //50是页眉与内容的间距,
const availableHeight = printableHeight - headerHeight - bottomHeight; //50是页眉与内容的间距,
console.log(`📊 分页基础参数:`);
console.log(` 纸张高度: ${paperHeight.toFixed(0)}px, 可用高度: ${availableHeight.toFixed(0)}px`);
@ -75,88 +74,285 @@ function paginateContent(structure, options) {
const pages = [];
let currentPage = [];
let currentHeight = 0;
const ElementMarginPx=10;
Array.from(structure.main.children).forEach((child, index) => {
const childHeight = child.getBoundingClientRect().height;
if (childHeight.toFixed(1)==0) return;
const elementInfo = `${child.tagName}${child.className ? '.' + child.className.split(' ')[0] : ''}`;
const isTableContainer = child.querySelector('table');
const remainingHeight = availableHeight - currentHeight;
console.log(`\n🔍 [元素 ${index + 1}] ${elementInfo}`);
console.log(` 高度: ${childHeight.toFixed(1)}px, 累积: ${currentHeight.toFixed(1)}px`);
console.log(` 剩余空间: ${remainingHeight.toFixed(1)}px`);
// ==================== 智能表格分割 ====================
if (isTableContainer) {
if (currentHeight + childHeight <= availableHeight * 0.92) {
console.log(` ✅ 表格能完整放入当前页`);
// 普通元素处理
if (currentHeight + childHeight > availableHeight) {
if (currentPage.length > 0 && (childHeight<=100 || remainingHeight<=100)){
console.log(` 📄 推入当前页 (${currentPage.length}个元素)`);
pages.push(currentPage);
currentPage = [];
currentHeight = 0;
}else{
// //child 本身比较大,currentPage还有比较大的空白
const result=splitElement(child, remainingHeight,availableHeight,ElementMarginPx)
const subPages=result.pages
if (subPages.length > 0) {
// 第一页:部分表格 + 前面累积的普通元素(合并在一起)
const firstPageContent = subPages[0];
if (firstPageContent.length > 0) {
currentPage.push(...firstPageContent);
pages.push(currentPage);
console.log(` ✅ 创建混合页: ${currentPage.length}个元素`);
}
if(subPages.length==1) return
// 剩余的分页,直到倒数第二页
for (let i = 1; i < subPages.length-1; i++) {
pages.push(subPages[i]);
console.log(` 📊 添加普通页 ${i} (${subPages[i].length}个元素)`);
}
currentPage = subPages[subPages.length-1]; //继续使用最后一页,可能有大片的空间
currentHeight = result.curHight; //智能表格分页后最后一页的高度(可能包含 caption 和部分表格)
}
return;
}
}
currentPage.push(child.cloneNode(true));
currentHeight += childHeight;
currentHeight += (childHeight+ElementMarginPx); //20margin
});
// 处理剩余元素
if (currentPage.length > 0) {
console.log(`\n📄 最后推入剩余元素 (${currentPage.length}个)`);
pages.push([...currentPage]);
}
return pages;
}
function splitElement(element, remainingHeight, availableHeight,elementMarginPx) {
console.log(` 🔪 开始递归探测可拆分内容,上一页剩余高度: ${remainingHeight}px`);
// 递归查找可拆分的容器
const findSplittableContainer = (el, depth = 0) => {
// 检查当前元素的高度是否小于100px
const elHeight = el.getBoundingClientRect().height;
if (elHeight <= 105 ) {
console.log(` 元素高度 ${elHeight.toFixed(1)}px < 100px,停止拆分,返回元素本身`);
return {
container: el,
items: [el], // 将自身作为唯一项返回
level: depth,
isMinimumSize: true // 标记为最小尺寸元素
};
}
if (el.tagName=="table" || el.tagName=="TABLE"){
return {
container: el,
items: [el], // 将自身作为唯一项返回
level: depth,
istable: true // 标记为最小尺寸元素
};
}
const children = Array.from(el.children);
// 如果当前层有多个子元素,就在这里拆分
if (children.length > 1) {
console.log(` 在第${depth}层找到${children.length}个子元素,在此拆分`);
return {
container: el,
items: children,
level: depth
};
}
// 如果只有一个子元素,继续向下探测
if (children.length === 1) {
return findSplittableContainer(children[0], depth + 1);
}
// 没有子元素,无法拆分
return null;
}
// 获取元素在布局中的垂直增量(对当前页高度的贡献)
const getVerticalIncrement = (item, previousItem) => {
const itemRect = item.getBoundingClientRect();
// 如果没有前一个元素,或者这是新行的第一个元素,返回完整高度
if (!previousItem) {
return itemRect.height;
}
const prevRect = previousItem.getBoundingClientRect();
// 判断是否在同一行(垂直位置相近)
const isSameRow = Math.abs(itemRect.top - prevRect.top) < 10;
if (isSameRow) {
// 同一行:不增加高度(因为已经在同一行的高度中了)
return 0;
} else {
// 不同行:返回新行的高度
return itemRect.height+3;
}
};
// // 找到可拆分的容器
const splittable = findSplittableContainer(element);
// 按高度拆分这些项
const pages = []; // 存储所有页的元素数组
let currentPage = []; // 当前页的元素
let currentHeight = 0; // 当前页的总高度
let lastItemInPage = null; // 当前页最后一个元素,用于判断同行
// 首先处理上一页的剩余空间
if (remainingHeight > 0) {
console.log(` ⬆️ 尝试填充上一页剩余高度: ${remainingHeight}px`);
// 找出能放入上一页的元素
let remainingItems = [...splittable.items];
let itemsForPreviousPage = [];
let heightForPreviousPage = 0;
let lastItemForPrevious = null;
for (let i = 0; i < remainingItems.length; i++) {
const item = remainingItems[i];
const verticalIncrement = getVerticalIncrement(item, lastItemForPrevious);
// 如果加上这个元素的垂直增量不会超出剩余高度,就加入上一页
if (heightForPreviousPage + verticalIncrement <= remainingHeight) {
itemsForPreviousPage.push(item.cloneNode(true));
heightForPreviousPage += verticalIncrement;
lastItemForPrevious = item;
remainingItems.shift(); // 移除已处理的元素
i--; // 调整索引
} else {
console.log(` ⚠️ 表格无法完整放入,剩余空间: ${remainingHeight.toFixed(1)}px`);
if (item.tagName=="table" || item.tagName=="TABLE") {
const remain=remainingHeight-heightForPreviousPage
console.log(` ⚠️ 表格无法上一页剩余空间,剩余空间: ${remainingHeight.toFixed(1)}px`);
// 对表格进行智能分页,第一页使用剩余空间
const tablePages = paginateTableSmart(child, remainingHeight, availableHeight, options);
const result = paginateTableSmart(item, remain, availableHeight,elementMarginPx, null);
const tablePages=result.pages
if (tablePages.length > 0) {
// 第一页:部分表格 + 前面累积的普通元素(合并在一起)
const firstPageContent = tablePages[0];
if (firstPageContent.length > 0) {
itemsForPreviousPage.push(...firstPageContent);
pages.push(itemsForPreviousPage);
console.log(` ✅ 创建混合页: ${itemsForPreviousPage.length}个元素 (含caption和部分表格)`);
itemsForPreviousPage=[] //立刻清理掉,后面有对非table的处理
}
if(tablePages.length>1){
// 剩余的表格页(纯表格)
for (let i = 1; i < tablePages.length-1; i++) {
pages.push(tablePages[i]);
console.log(` 📊 添加纯表格页 ${i} (${tablePages[i].length}个元素)`);
}
currentPage = tablePages[tablePages.length-1]; //继续使用最后一页,可能有大片的空间
currentHeight = result.curHight; //智能表格分页后最后一页的高度(可能包含 caption 和部分表格)
}
}
remainingItems.shift(); // 移除已处理的元素
splittable.items = remainingItems;
}
break;
}
}
// 如果有元素放入上一页
if (itemsForPreviousPage.length > 0) {
pages.push(itemsForPreviousPage);
console.log(` ⬆️ 填充上一页: ${itemsForPreviousPage.length}项,高度 ${heightForPreviousPage.toFixed(1)}px`);
// 剩余的元素继续处理
splittable.items = remainingItems;
}
}
// 处理剩余的元素,分页
splittable.items.forEach((item, index) => {
// 计算这个元素对当前页高度的垂直增量
const verticalIncrement = getVerticalIncrement(item, lastItemInPage);
// 如果当前页不为空,且加上这个元素的垂直增量会超高,则开始新页
if (currentHeight + verticalIncrement > availableHeight) {
if (item.tagName=="table" || item.tagName=="TABLE") {
const remain=availableHeight-currentHeight
console.log(` ⚠️ 表格无法上一页剩余空间,剩余空间: ${remainingHeight.toFixed(1)}px`);
// 对表格进行智能分页,第一页使用剩余空间
const result = paginateTableSmart(item, remain, availableHeight,elementMarginPx, null);
const tablePages=result.pages
if (tablePages.length > 0) {
// 第一页:部分表格 + 前面累积的普通元素(合并在一起)
const firstPageContent = tablePages[0];
if (firstPageContent.length > 0) {
currentPage.push(...firstPageContent);
pages.push([...currentPage]);
pages.push(currentPage);
console.log(` ✅ 创建混合页: ${currentPage.length}个元素 (含caption和部分表格)`);
}
if(tablePages.length==1) return;
// 剩余的表格页(纯表格)
for (let i = 1; i < tablePages.length; i++) {
for (let i = 1; i < tablePages.length-1; i++) {
pages.push(tablePages[i]);
console.log(` 📊 添加纯表格页 ${i} (${tablePages[i].length}个元素)`);
}
}
currentPage = [];
currentHeight = 0;
currentPage = tablePages[tablePages.length-1]; //继续使用最后一页,可能有大片的空间
currentHeight = result.curHight; //智能表格分页后最后一页的高度(可能包含 caption 和部分表格)
}
return;
}
// ============================================================
// 普通元素处理
if (currentHeight + childHeight > availableHeight * 0.92) {
if (currentPage.length > 0) {
console.log(` 📄 推入当前页 (${currentPage.length}个元素)`);
pages.push([...currentPage]);
currentPage = [];
currentHeight = 0;
}
}
// 保存当前页
pages.push(currentPage);
console.log(` 📄 第 ${pages.length} 页: ${currentPage.length}项,高度 ${currentHeight.toFixed(1)}px`);
currentPage.push(child.cloneNode(true));
currentHeight += (childHeight+20); //20margin
// 开始新页 - 当前元素作为新页的第一个元素
currentPage = [item.cloneNode(true)];
currentHeight = item.getBoundingClientRect().height; // 新页第一个元素贡献完整高度
lastItemInPage = item;
} else {
// 加入当前页
currentPage.push(item.cloneNode(true));
currentHeight += verticalIncrement; // 只增加垂直方向上的增量
lastItemInPage = item;
}
});
// 处理最后一个元素
pages.push(currentPage);
// 处理剩余元素
if (currentPage.length > 0) {
console.log(`\n📄 最后推入剩余元素 (${currentPage.length}个)`);
pages.push([...currentPage]);
}
console.log(` 📄 第 ${pages.length} 页: ${currentPage.length}项,高度 ${currentHeight.toFixed(1)}px`);
console.log(` ✅ 递归探测拆分完成,共 ${pages.length}`);
return pages;
// 返回所有页的数据
return {
pages: pages,
curHight: currentHeight, // 最后一页的高度
};
}
/**
* 智能表格分页函数支持 caption
* @returns {Array<Array>} 分页结果每个元素是一个页面数组
*/
function paginateTableSmart(tableContainer, firstPageHeight, subsequentPageHeight, options) {
const table = tableContainer.querySelector('table');
function paginateTableSmart(tableContainer, firstPageHeight, subsequentPageHeight,ElementMarginPx, options) {
const table = tableContainer//.querySelector('table');
const caption = table?.querySelector('caption'); // 获取 caption
const thead = table?.querySelector('thead');
const tbody = table?.querySelector('tbody');
if (!thead || !tbody) {
console.warn('⚠️ 表格缺少 thead 或 tbody');
return [[tableContainer.cloneNode(true)]];
return {pages:[tableContainer.cloneNode(true)],curHight:tableContainer.getBoundingClientRect().height};
}
const captionHeight = caption ? caption.getBoundingClientRect().height : 0;
@ -170,10 +366,10 @@ function paginateTableSmart(tableContainer, firstPageHeight, subsequentPageHeigh
// 如果整个表格能在第一页放下
const totalTableHeight = tableContainer.getBoundingClientRect().height;
if (totalTableHeight <= firstPageHeight * 0.85) {
if (totalTableHeight <= firstPageHeight) {
console.log(` ✅ 表格总高度 ${totalTableHeight.toFixed(1)}px 能放入第一页`);
// 包含 caption
return [[createTablePage(tableContainer, thead, rows, true)]];
return {pages:[createTablePage(tableContainer, thead, rows, true)],curHight:totalTableHeight};
}
const pages = [];
@ -186,18 +382,18 @@ function paginateTableSmart(tableContainer, firstPageHeight, subsequentPageHeigh
const pageHeight = isFirstPage ? firstPageHeight : subsequentPageHeight;
// 检查是否需要分页
if (currentHeight + rowHeight > pageHeight * 0.85 && currentRows.length > 0) {
if (currentHeight + rowHeight > pageHeight && currentRows.length > 0) {
// 创建当前页(只有第一页包含 caption)
pages.push([createTablePage(tableContainer, thead, currentRows, isFirstPage)]);
console.log(` 📊 分页${isFirstPage ? '(含caption)' : ''}: ${currentRows.length}行, ${currentHeight.toFixed(1)}px`);
// 重置为新页面
currentRows = [row];
currentHeight = captionHeight + headerHeight + rowHeight; // 新页面也要包含 caption 高度
currentHeight = captionHeight + headerHeight + rowHeight+ElementMarginPx; // 新页面也要包含 caption 高度
isFirstPage = false;
} else {
currentRows.push(row);
currentHeight += rowHeight;
currentHeight += rowHeight+ElementMarginPx;
}
// 最后一行
@ -208,7 +404,7 @@ function paginateTableSmart(tableContainer, firstPageHeight, subsequentPageHeigh
});
console.log(` 📊 表格总计分页: ${pages.length}`);
return pages;
return {pages:pages,curHight:currentHeight};
}
/**
@ -219,7 +415,7 @@ function createTablePage(originalContainer, thead, rows, includeCaption = false)
const container = originalContainer.cloneNode(false);
const table = document.createElement('table');
const originalTable = originalContainer.querySelector('table');
const originalTable = originalContainer//.querySelector('table');
table.className = originalTable.className;
table.style.cssText = originalTable.style.cssText;
@ -237,8 +433,7 @@ function createTablePage(originalContainer, thead, rows, includeCaption = false)
rows.forEach(row => tbody.appendChild(row.cloneNode(true)));
table.appendChild(tbody);
container.appendChild(table);
return container;
return table;
}
function buildPrintPages(pages, structure, options) {
@ -260,6 +455,8 @@ function buildPrintPages(pages, structure, options) {
const contentDiv = document.createElement('div');
contentDiv.className = 'print-page-content';
contentDiv.style.display="flex"
contentDiv.style.flexWrap="wrap"
elements.forEach(el => {
if (el?.nodeType === Node.ELEMENT_NODE) {
@ -313,7 +510,7 @@ function printViaIframe(content, options) {
}
.print-page {
page-break-after: always;
padding:${margin}mm ${margin+5}mm;
padding: ${margin}mm ${margin+5}mm 0 ${margin+5}mm;
}
.print-page:last-child {
page-break-after: avoid;

9
src/views/sysworkflow/lowcodepage/appPage/appPageForm/printSetupPage2.vue

@ -28,7 +28,7 @@ const pageSize=ref('A4')
const pageDret=ref('vtal')
//pageConfig
const systemType:string[]=["founder","founderTime","deptOrg"]
const systemType:string[]=["creater","createrTime","createrOrg"]
const props = defineProps({
@ -287,7 +287,6 @@ onMounted(async ()=>{
})
/*********************为解决pageconfig字段的问题**************************/
console.log(fieldTreeData.value.length,"length????")
let newForm:boolean;
if(fieldTreeData.value.length==0){
newForm=true;
@ -337,9 +336,9 @@ const updateNodeData=(val:fieldTree,val2:boolean,val3:boolean)=>{
<div class="hiprintEpContainer" >
<span>系统字段</span>
<el-checkbox-group v-model="objPageConfig.pagebrow" class="basic_fields">
<el-checkbox label="创建人" value="founder" />
<el-checkbox label="创建时间" value="founderTime" />
<el-checkbox label="所属部门" value="deptOrg" />
<el-checkbox label="创建人" value="creater" />
<el-checkbox label="创建时间" value="creater_time" />
<el-checkbox label="所属部门" value="createrOrg" />
<el-checkbox label="表单编号" value="masters_key" />
</el-checkbox-group>
<el-checkbox v-model="objPageConfig.qrcode" style="margin-left: 22px;" label="表单二维码" />

1
src/views/sysworkflow/lowcodepage/pageList.vue

@ -755,7 +755,6 @@ const saveFormListData = () => {
data: json2string(state),
id: props.formKey.toString(),
};
console.log(params,"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")
// console.log("",params)
editCustomerFormList(params).then((data) => {
// console.log("",data)

Loading…
Cancel
Save