|
|
@ -54,7 +54,7 @@ import CalendarPage from "@/components/DesignForm/app/calendar/calendar1/calenda |
|
|
import SearchSelect from "@/components/DesignForm/app/calendar/selectSearch.vue"; |
|
|
import SearchSelect from "@/components/DesignForm/app/calendar/selectSearch.vue"; |
|
|
import AKSelect from "@/components/DesignForm/public/form/select.vue"; |
|
|
import AKSelect from "@/components/DesignForm/public/form/select.vue"; |
|
|
import ContainerPath from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/container.vue"; |
|
|
import ContainerPath from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/container.vue"; |
|
|
import exportPanel from '../exportPanel.vue'; |
|
|
import exportPanel from "../exportPanel.vue"; |
|
|
import importPanel from "../importPanel.vue"; |
|
|
import importPanel from "../importPanel.vue"; |
|
|
|
|
|
|
|
|
const props = withDefaults( |
|
|
const props = withDefaults( |
|
|
@ -155,7 +155,7 @@ const currentAsfTableDataList = ref([]); //当前点击的关联表单数据 |
|
|
const openTaskDrawer = ref(false); //新增数据 |
|
|
const openTaskDrawer = ref(false); //新增数据 |
|
|
|
|
|
|
|
|
//导出窗口的父元素 |
|
|
//导出窗口的父元素 |
|
|
const dynamicVNode = ref<VNode | null>(null) //组件的父组件 |
|
|
const dynamicVNode = ref<VNode | null>(null); //组件的父组件 |
|
|
|
|
|
|
|
|
const state = reactive({ |
|
|
const state = reactive({ |
|
|
loading: false, |
|
|
loading: false, |
|
|
@ -552,9 +552,9 @@ const setUpClick = (val: string, id: string) => { |
|
|
drawerWith.value = container.value?.clientWidth; |
|
|
drawerWith.value = container.value?.clientWidth; |
|
|
openTaskDrawer.value = true; |
|
|
openTaskDrawer.value = true; |
|
|
} else if (val.key === "export") { |
|
|
} else if (val.key === "export") { |
|
|
doExportTableData() |
|
|
doExportTableData(); |
|
|
} else if (val.key === "import") { |
|
|
} else if (val.key === "import") { |
|
|
doImportTableData() |
|
|
doImportTableData(); |
|
|
} else if (val.key == "showQrCode") { |
|
|
} else if (val.key == "showQrCode") { |
|
|
//liwenxuan 20250114 二维码打印弹窗 start |
|
|
//liwenxuan 20250114 二维码打印弹窗 start |
|
|
//在此组装参数,以生成二维码图片 |
|
|
//在此组装参数,以生成二维码图片 |
|
|
@ -870,18 +870,18 @@ const columnsFilter = computed(() => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const subTableFieldsFilter = computed(() => { |
|
|
const subTableFieldsFilter = computed(() => { |
|
|
const arr:{table:string,field:string,label:string}[]=[] |
|
|
const arr: { table: string; field: string; label: string }[] = []; |
|
|
const names:string[]=[] |
|
|
const names: string[] = []; |
|
|
props.fieldsDetailList.forEach((item: any) => { |
|
|
props.fieldsDetailList.forEach((item: any) => { |
|
|
if (item.type === "table") { |
|
|
if (item.type === "table") { |
|
|
names.push(item.name) |
|
|
names.push(item.name); |
|
|
item.list.forEach((sub: any) => { |
|
|
item.list.forEach((sub: any) => { |
|
|
arr.push({table:item.name, field: sub.name, label: sub.item.label}) |
|
|
arr.push({ table: item.name, field: sub.name, label: sub.item.label }); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
return {tables:names,fields:arr} |
|
|
return { tables: names, fields: arr }; |
|
|
}) |
|
|
}); |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ -981,10 +981,12 @@ const getPageData = () => { |
|
|
default: |
|
|
default: |
|
|
state.loading = true; |
|
|
state.loading = true; |
|
|
//by han2015, 抽成独立部分,方便其他功能调用 |
|
|
//by han2015, 抽成独立部分,方便其他功能调用 |
|
|
doGainFormPageListCont(sendData).then(datas=>{ |
|
|
doGainFormPageListCont(sendData) |
|
|
tableDataList.value = datas.list |
|
|
.then((datas) => { |
|
|
state.total=datas.total |
|
|
tableDataList.value = datas.list; |
|
|
}).finally(()=>{ |
|
|
state.total = datas.total; |
|
|
|
|
|
}) |
|
|
|
|
|
.finally(() => { |
|
|
//原 finally的处理内容 |
|
|
//原 finally的处理内容 |
|
|
state.loading = false; |
|
|
state.loading = false; |
|
|
asfs = []; |
|
|
asfs = []; |
|
|
@ -995,28 +997,30 @@ const getPageData = () => { |
|
|
tables = []; |
|
|
tables = []; |
|
|
dofs = []; |
|
|
dofs = []; |
|
|
getAsfs(); |
|
|
getAsfs(); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
//表单导入 |
|
|
//表单导入 |
|
|
function doImportTableData() { |
|
|
function doImportTableData() { |
|
|
dynamicVNode.value = h(importPanel, { |
|
|
dynamicVNode.value = h(importPanel, { |
|
|
fields:props.fieldsDetailList.filter(val=>val.type!=="table"), |
|
|
fields: props.fieldsDetailList.filter((val) => val.type !== "table"), |
|
|
formId: props.versionid, |
|
|
formId: props.versionid, |
|
|
commitFunc: () => { |
|
|
commitFunc: () => { |
|
|
getPageData() //刷新table页面 |
|
|
getPageData(); //刷新table页面 |
|
|
dynamicVNode.value=null |
|
|
dynamicVNode.value = null; |
|
|
}, |
|
|
}, |
|
|
closeFunc:()=>dynamicVNode.value=null |
|
|
closeFunc: () => (dynamicVNode.value = null), |
|
|
}) |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//表格导出 |
|
|
//表格导出 |
|
|
function doExportTableData() { |
|
|
function doExportTableData() { |
|
|
//fields表示主表单的导出字段,subs表示主表单包含的子表格的导出字段 |
|
|
//fields表示主表单的导出字段,subs表示主表单包含的子表格的导出字段 |
|
|
function exportFunc(fields:{field:string,label:string}[],subs:{table:string,field:string,label:string}[]){ |
|
|
function exportFunc( |
|
|
|
|
|
fields: { field: string; label: string }[], |
|
|
|
|
|
subs: { table: string; field: string; label: string }[] |
|
|
|
|
|
) { |
|
|
let sendData = { |
|
|
let sendData = { |
|
|
formId: props.formId, |
|
|
formId: props.formId, |
|
|
page: 1, |
|
|
page: 1, |
|
|
@ -1024,17 +1028,18 @@ function doExportTableData(){ |
|
|
searchData: json2string(props.searchData), |
|
|
searchData: json2string(props.searchData), |
|
|
}; |
|
|
}; |
|
|
//全量获取页面的数据 |
|
|
//全量获取页面的数据 |
|
|
doGainFormPageListCont(sendData).then(datas=>{ |
|
|
doGainFormPageListCont(sendData) |
|
|
|
|
|
.then((datas) => { |
|
|
const array: string[] = []; |
|
|
const array: string[] = []; |
|
|
//写入表头行 |
|
|
//写入表头行 |
|
|
const title: string[] = []; |
|
|
const title: string[] = []; |
|
|
for (let val of fields) { |
|
|
for (let val of fields) { |
|
|
title.push(val.label) |
|
|
title.push(val.label); |
|
|
} |
|
|
} |
|
|
for (let val of subs) { |
|
|
for (let val of subs) { |
|
|
title.push(val.label) |
|
|
title.push(val.label); |
|
|
} |
|
|
} |
|
|
array.push(title.join(",")) |
|
|
array.push(title.join(",")); |
|
|
|
|
|
|
|
|
//写入数据行 |
|
|
//写入数据行 |
|
|
datas.list.forEach((item) => { |
|
|
datas.list.forEach((item) => { |
|
|
@ -1042,61 +1047,68 @@ function doExportTableData(){ |
|
|
let maxline = 0; |
|
|
let maxline = 0; |
|
|
//写主表列 |
|
|
//写主表列 |
|
|
for (let val of fields) { |
|
|
for (let val of fields) { |
|
|
if(typeof(val)==="string") line.push((item[val.field] as string).replaceAll(",",",")) |
|
|
if (typeof val === "string") |
|
|
else line.push(item[val.field]) |
|
|
line.push((item[val.field] as string).replaceAll(",", ",")); |
|
|
|
|
|
else line.push(item[val.field]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//写子表列 |
|
|
//写子表列 |
|
|
if (subs.length > 0) { |
|
|
if (subs.length > 0) { |
|
|
//计算所有子列表的最大行数 |
|
|
//计算所有子列表的最大行数 |
|
|
for (let tab of subTableFieldsFilter.value.tables) { |
|
|
for (let tab of subTableFieldsFilter.value.tables) { |
|
|
if(item[tab] && item[tab].length>maxline) maxline=item[tab].length |
|
|
if (item[tab] && item[tab].length > maxline) maxline = item[tab].length; |
|
|
} |
|
|
} |
|
|
//全都是空的 |
|
|
//全都是空的 |
|
|
if (maxline === 0) { |
|
|
if (maxline === 0) { |
|
|
array.push(line.join(",")+","+Array(subs.length).fill("")) |
|
|
array.push(line.join(",") + "," + Array(subs.length).fill("")); |
|
|
return |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//除第一行数据包含子表数据外,其他行都省略主表字段数据,用spaceprefix填充,避免重复 |
|
|
//除第一行数据包含子表数据外,其他行都省略主表字段数据,用spaceprefix填充,避免重复 |
|
|
const spacePrefix=Array(line.length).fill("") |
|
|
const spacePrefix = Array(line.length).fill(""); |
|
|
|
|
|
|
|
|
for (let i = 0; i < maxline; i++) { |
|
|
for (let i = 0; i < maxline; i++) { |
|
|
const row:any[]=[] |
|
|
const row: any[] = []; |
|
|
subTableFieldsFilter.value.tables.forEach(name => { |
|
|
subTableFieldsFilter.value.tables.forEach((name) => { |
|
|
if (item[name] && item[name].length - 1 >= i) { |
|
|
if (item[name] && item[name].length - 1 >= i) { |
|
|
//添加实际数据 |
|
|
//添加实际数据 |
|
|
subs.filter(v=>v.table===name).forEach(f=>{ |
|
|
subs |
|
|
row.push(item[name][i][f.field]) |
|
|
.filter((v) => v.table === name) |
|
|
}) |
|
|
.forEach((f) => { |
|
|
|
|
|
row.push(item[name][i][f.field]); |
|
|
|
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
//添加字段长度的N个空列 |
|
|
//添加字段长度的N个空列 |
|
|
row.push(...(Array(subs.filter(v=>v.table===name).length).fill(""))) |
|
|
row.push( |
|
|
|
|
|
...Array(subs.filter((v) => v.table === name).length).fill("") |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
|
|
|
|
|
|
//写入总csv数组 |
|
|
//写入总csv数组 |
|
|
if (i === 0) { |
|
|
if (i === 0) { |
|
|
array.push(line.join(",")+","+row.join(",")) |
|
|
array.push(line.join(",") + "," + row.join(",")); |
|
|
} else { |
|
|
} else { |
|
|
array.push(spacePrefix+","+row.join(",")) |
|
|
array.push(spacePrefix + "," + row.join(",")); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return |
|
|
return; |
|
|
} |
|
|
} |
|
|
//没有子表 |
|
|
//没有子表 |
|
|
array.push(line.join(",")) |
|
|
array.push(line.join(",")); |
|
|
}) |
|
|
}); |
|
|
|
|
|
|
|
|
//去掉标题行的统计 |
|
|
//去掉标题行的统计 |
|
|
if((array.length-1)!==datas.total) alert(`导出记录数:${datas.total}, 共计:${array.length-1} 行`) |
|
|
if (array.length - 1 !== datas.total) |
|
|
|
|
|
alert(`导出记录数:${datas.total}, 共计:${array.length - 1} 行`); |
|
|
|
|
|
|
|
|
const filename= props.pickAppMenu.label+".csv" |
|
|
const filename = props.pickAppMenu.label + ".csv"; |
|
|
const csvString = array.join('\n'); |
|
|
const csvString = array.join("\n"); |
|
|
const blob = new Blob([csvString], { type: "text/csv;charset=utf-8;" }); |
|
|
const blob = new Blob([csvString], { type: "text/csv;charset=utf-8;" }); |
|
|
const link = document.createElement("a"); |
|
|
const link = document.createElement("a"); |
|
|
if (link.download !== undefined) { // feature detection |
|
|
if (link.download !== undefined) { |
|
|
|
|
|
// feature detection |
|
|
// Browsers that support HTML5 download attribute |
|
|
// Browsers that support HTML5 download attribute |
|
|
const url = URL.createObjectURL(blob); |
|
|
const url = URL.createObjectURL(blob); |
|
|
link.setAttribute("href", url); |
|
|
link.setAttribute("href", url); |
|
|
@ -1106,7 +1118,8 @@ function doExportTableData(){ |
|
|
link.click(); |
|
|
link.click(); |
|
|
document.body.removeChild(link); |
|
|
document.body.removeChild(link); |
|
|
} |
|
|
} |
|
|
}).finally(()=>dynamicVNode.value=null) |
|
|
}) |
|
|
|
|
|
.finally(() => (dynamicVNode.value = null)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
dynamicVNode.value = h(exportPanel, { |
|
|
dynamicVNode.value = h(exportPanel, { |
|
|
@ -1114,12 +1127,12 @@ function doExportTableData(){ |
|
|
subtabs: columnsFilter.value.filter((item) => item.pattern === "table"), |
|
|
subtabs: columnsFilter.value.filter((item) => item.pattern === "table"), |
|
|
subFields: subTableFieldsFilter.value.fields, |
|
|
subFields: subTableFieldsFilter.value.fields, |
|
|
commitFunc: exportFunc, |
|
|
commitFunc: exportFunc, |
|
|
closeFunc:()=>dynamicVNode.value=null |
|
|
closeFunc: () => (dynamicVNode.value = null), |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async function doGainFormPageListCont(sendData: any) { |
|
|
async function doGainFormPageListCont(sendData: any) { |
|
|
const data =await gainFormPageListCont(sendData) |
|
|
const data = await gainFormPageListCont(sendData); |
|
|
// console.log("获取列表详细信息----------------->",data) |
|
|
// console.log("获取列表详细信息----------------->",data) |
|
|
//console.log(dataList) |
|
|
//console.log(dataList) |
|
|
asfDetails = props.data.columns.filter((item: any) => { |
|
|
asfDetails = props.data.columns.filter((item: any) => { |
|
|
@ -1185,7 +1198,7 @@ async function doGainFormPageListCont(sendData:any){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//console.log(data.data.list) |
|
|
//console.log(data.data.list) |
|
|
transferDetails.forEach(element => { |
|
|
transferDetails.forEach((element) => { |
|
|
//console.log(element) |
|
|
//console.log(element) |
|
|
data.data.list.forEach((obj: any) => { |
|
|
data.data.list.forEach((obj: any) => { |
|
|
//console.log(obj) |
|
|
//console.log(obj) |
|
|
@ -1196,7 +1209,7 @@ async function doGainFormPageListCont(sendData:any){ |
|
|
|
|
|
|
|
|
// 特殊处理数组/嵌套对象(使用JSON格式化) |
|
|
// 特殊处理数组/嵌套对象(使用JSON格式化) |
|
|
const formattedValue = |
|
|
const formattedValue = |
|
|
(Array.isArray(value) || (typeof value === 'object' && value !== null)) |
|
|
Array.isArray(value) || (typeof value === "object" && value !== null) |
|
|
? JSON.stringify(value, null, 2) |
|
|
? JSON.stringify(value, null, 2) |
|
|
: value; |
|
|
: value; |
|
|
|
|
|
|
|
|
@ -1205,7 +1218,7 @@ async function doGainFormPageListCont(sendData:any){ |
|
|
//console.log(key) |
|
|
//console.log(key) |
|
|
/* console.log(element.control.fixedOptions) |
|
|
/* console.log(element.control.fixedOptions) |
|
|
console.log(obj[key]) */ |
|
|
console.log(obj[key]) */ |
|
|
obj[key] = mapIdsToLabels(element.control.fixedOptions,obj[key]) |
|
|
obj[key] = mapIdsToLabels(element.control.fixedOptions, obj[key]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -1233,14 +1246,14 @@ function mapIdsToLabels(treeNodes: TreeNode[], ids1: string): string[] { |
|
|
// 递归遍历树节点并填充映射字典 |
|
|
// 递归遍历树节点并填充映射字典 |
|
|
function traverse(node: TreeNode) { |
|
|
function traverse(node: TreeNode) { |
|
|
idToLabelMap[node.id] = node.label; // 存储当前节点的映射 |
|
|
idToLabelMap[node.id] = node.label; // 存储当前节点的映射 |
|
|
node.children.forEach(child => traverse(child)); // 递归处理子节点 |
|
|
node.children.forEach((child) => traverse(child)); // 递归处理子节点 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 遍历根节点列表 |
|
|
// 遍历根节点列表 |
|
|
treeNodes.forEach(root => traverse(root)); |
|
|
treeNodes.forEach((root) => traverse(root)); |
|
|
//console.log(ids) |
|
|
//console.log(ids) |
|
|
// 将id数组转换为label数组 |
|
|
// 将id数组转换为label数组 |
|
|
return ids.map(id => idToLabelMap[id] || "已删除的节点(id):"+id); |
|
|
return ids.map((id) => idToLabelMap[id] || "已删除的节点(id):" + id); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const asfGetPageData = (asfFormId: any, asfToSelectMastersKey: any) => { |
|
|
const asfGetPageData = (asfFormId: any, asfToSelectMastersKey: any) => { |
|
|
@ -1755,7 +1768,7 @@ const transformOption = (val: string | number, type?: string) => { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const readerColumnSun = (column: any) => { |
|
|
const readerColumnSun = (column: any) => { |
|
|
console.log("表头label长度-11->", column); |
|
|
// console.log("表头label长度-11->", column); |
|
|
let labelLong = 0; // 表头label长度 |
|
|
let labelLong = 0; // 表头label长度 |
|
|
if (column.children) { |
|
|
if (column.children) { |
|
|
labelLong = column.children.length; |
|
|
labelLong = column.children.length; |
|
|
@ -1764,12 +1777,12 @@ const readerColumnSun = (column: any) => { |
|
|
let countLenght = 3; |
|
|
let countLenght = 3; |
|
|
column.children.forEach((item: any) => { |
|
|
column.children.forEach((item: any) => { |
|
|
if (item.label.length < 3) { |
|
|
if (item.label.length < 3) { |
|
|
countLenght = countLenght + 90; |
|
|
countLenght = countLenght + 15; |
|
|
} else { |
|
|
} else { |
|
|
countLenght = countLenght + item.label.length * 40; |
|
|
countLenght = countLenght + item.label.length * 15; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
console.log("表头label长度-->", countLenght); |
|
|
// console.log("表头label长度-->", countLenght); |
|
|
return countLenght; |
|
|
return countLenght; |
|
|
} else { |
|
|
} else { |
|
|
return 100; |
|
|
return 100; |
|
|
@ -2044,7 +2057,6 @@ const readerColumnSun = (column: any) => { |
|
|
> |
|
|
> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<el-button-group> |
|
|
<el-button-group> |
|
|
|
|
|
|
|
|
<el-tooltip |
|
|
<el-tooltip |
|
|
v-if="scope.row.flowIsOpens == 1 && scope.row.taskStatus == 1" |
|
|
v-if="scope.row.flowIsOpens == 1 && scope.row.taskStatus == 1" |
|
|
class="box-item" |
|
|
class="box-item" |
|
|
@ -2263,7 +2275,6 @@ const readerColumnSun = (column: any) => { |
|
|
{{ scope.row[scope.column.property] }}== |
|
|
{{ scope.row[scope.column.property] }}== |
|
|
</el-link> |
|
|
</el-link> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</template> |
|
|
</template> |
|
|
</el-table> |
|
|
</el-table> |
|
|
@ -2516,7 +2527,7 @@ const readerColumnSun = (column: any) => { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
} |
|
|
} |
|
|
.table-list-comm { |
|
|
.table-list-comm { |
|
|
padding: 0px 15px 5px 15px; |
|
|
padding: 0px 5px 5px 5px; |
|
|
} |
|
|
} |
|
|
.seacherForm { |
|
|
.seacherForm { |
|
|
min-height: auto; |
|
|
min-height: auto; |
|
|
|