|
|
@ -70,6 +70,7 @@ const props = withDefaults( |
|
|
viewPage?: viewPageType; |
|
|
viewPage?: viewPageType; |
|
|
formBasicConfig?: any; |
|
|
formBasicConfig?: any; |
|
|
fieldsDetailList?:any; |
|
|
fieldsDetailList?:any; |
|
|
|
|
|
orgAndManTree?:any; |
|
|
}>(), |
|
|
}>(), |
|
|
{ |
|
|
{ |
|
|
showPage: true, |
|
|
showPage: true, |
|
|
@ -112,6 +113,9 @@ const props = withDefaults( |
|
|
fieldsDetailList: () => { |
|
|
fieldsDetailList: () => { |
|
|
return {}; |
|
|
return {}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
orgAndManTree: () => { |
|
|
|
|
|
return {}; |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|
const emits = defineEmits<{ |
|
|
const emits = defineEmits<{ |
|
|
@ -314,6 +318,8 @@ let checkboxs: any[] = []; |
|
|
let switchs: any[] = []; |
|
|
let switchs: any[] = []; |
|
|
let selects: any[] = []; |
|
|
let selects: any[] = []; |
|
|
let tables: any[] = []; |
|
|
let tables: any[] = []; |
|
|
|
|
|
let dofs: any[] = [];//deptOrgAndOrgCententAndFounderArr |
|
|
|
|
|
|
|
|
function getAsfs() { |
|
|
function getAsfs() { |
|
|
//setTimeout(() => { |
|
|
//setTimeout(() => { |
|
|
let dataList = ref({}); |
|
|
let dataList = ref({}); |
|
|
@ -330,7 +336,9 @@ function getAsfs() { |
|
|
switchs.push(dataList.value[i]) |
|
|
switchs.push(dataList.value[i]) |
|
|
} else if(dataList.value[i].type == "select"){ |
|
|
} else if(dataList.value[i].type == "select"){ |
|
|
selects.push(dataList.value[i]) |
|
|
selects.push(dataList.value[i]) |
|
|
} else if ( |
|
|
} else if(dataList.value[i].type == "deptOrg"||dataList.value[i].type == "orgCentent"||dataList.value[i].type == "founder"){//||dataList.value[i].type == "owner"拥有者,"expand-user"选择用户 |
|
|
|
|
|
dofs.push(dataList.value[i]) |
|
|
|
|
|
}else if ( |
|
|
dataList.value[i].type == "card" || |
|
|
dataList.value[i].type == "card" || |
|
|
dataList.value[i].type == "flex" || |
|
|
dataList.value[i].type == "flex" || |
|
|
dataList.value[i].type == "div" || |
|
|
dataList.value[i].type == "div" || |
|
|
@ -351,6 +359,8 @@ function getAsfs() { |
|
|
switchs.push(element) |
|
|
switchs.push(element) |
|
|
}else if(element.type == "select"){ |
|
|
}else if(element.type == "select"){ |
|
|
selects.push(element) |
|
|
selects.push(element) |
|
|
|
|
|
}else if(element.type == "deptOrg"||element.type == "orgCentent"||element.type == "founder"){ |
|
|
|
|
|
dofs.push(element) |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} else if (dataList.value[i].type == "grid") { |
|
|
} else if (dataList.value[i].type == "grid") { |
|
|
@ -371,6 +381,8 @@ function getAsfs() { |
|
|
switchs.push(a) |
|
|
switchs.push(a) |
|
|
}else if(a.type == "select"){ |
|
|
}else if(a.type == "select"){ |
|
|
selects.push(a) |
|
|
selects.push(a) |
|
|
|
|
|
}else if(a.type == "deptOrg"||a.type == "orgCentent"||a.type == "founder"){ |
|
|
|
|
|
dofs.push(a) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -393,6 +405,8 @@ function getAsfs() { |
|
|
switchs.push(a) |
|
|
switchs.push(a) |
|
|
}else if(a.type == "select"){ |
|
|
}else if(a.type == "select"){ |
|
|
selects.push(a) |
|
|
selects.push(a) |
|
|
|
|
|
}else if(a.type == "deptOrg"||a.type == "orgCentent"||a.type == "founder"){ |
|
|
|
|
|
dofs.push(a) |
|
|
}else if (a.type == "flex" || a.type == "table") { |
|
|
}else if (a.type == "flex" || a.type == "table") { |
|
|
if (a.type == "table") { |
|
|
if (a.type == "table") { |
|
|
tables.push(dataList.value[i]); |
|
|
tables.push(dataList.value[i]); |
|
|
@ -412,6 +426,8 @@ function getAsfs() { |
|
|
switchs.push(q) |
|
|
switchs.push(q) |
|
|
}else if(q.type == "select"){ |
|
|
}else if(q.type == "select"){ |
|
|
selects.push(q) |
|
|
selects.push(q) |
|
|
|
|
|
}else if(q.type == "deptOrg"||q.type == "orgCentent"||q.type == "founder"){ |
|
|
|
|
|
dofs.push(q) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -425,7 +441,6 @@ function getAsfs() { |
|
|
//}, 500); |
|
|
//}, 500); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function convertStringToArray(str: string) { |
|
|
function convertStringToArray(str: string) { |
|
|
if (typeof str!== 'string') { |
|
|
if (typeof str!== 'string') { |
|
|
throw new Error('Input must be a string.'); |
|
|
throw new Error('Input must be a string.'); |
|
|
@ -442,6 +457,45 @@ function convertStringToArray(str: string) { |
|
|
return parts.map(part => parseFloat(part)); |
|
|
return parts.map(part => parseFloat(part)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
interface Tree { |
|
|
|
|
|
id?: string; |
|
|
|
|
|
label: string; |
|
|
|
|
|
disabled?: boolean; |
|
|
|
|
|
children?: Tree[]; |
|
|
|
|
|
parentId?: string; |
|
|
|
|
|
[key: string]: any; |
|
|
|
|
|
} |
|
|
|
|
|
function getLabelById(id: string): string | undefined { |
|
|
|
|
|
//console.log(id) |
|
|
|
|
|
const treeNodes = props.orgAndManTree; |
|
|
|
|
|
|
|
|
|
|
|
const findLabel = (nodes: Tree[]): string | undefined => { |
|
|
|
|
|
for (const node of nodes) { |
|
|
|
|
|
// 检查当前节点是否匹配目标id |
|
|
|
|
|
if (node.id === id) { |
|
|
|
|
|
return node.label; |
|
|
|
|
|
} |
|
|
|
|
|
// 递归遍历子节点 |
|
|
|
|
|
if (node.children?.length) { |
|
|
|
|
|
const found = findLabel(node.children); |
|
|
|
|
|
if (found) return found; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return undefined; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return findLabel(treeNodes); |
|
|
|
|
|
} |
|
|
|
|
|
function isAllCharactersNumbers(str: string) { |
|
|
|
|
|
// 遍历字符串中的每个字符 |
|
|
|
|
|
for (let i = 0; i < str.length; i++) { |
|
|
|
|
|
// 检查当前字符是否不是数字字符 |
|
|
|
|
|
if (isNaN(parseInt(str[i], 10))) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//liwenxuan 20250120 二维码 end |
|
|
//liwenxuan 20250120 二维码 end |
|
|
|
|
|
|
|
|
@ -467,6 +521,14 @@ const setUpClick = (val: string, id: string) => { |
|
|
text: '正在生成二维码,请稍候...' // 添加的文字内容,可根据需要修改 |
|
|
text: '正在生成二维码,请稍候...' // 添加的文字内容,可根据需要修改 |
|
|
}); |
|
|
}); |
|
|
//console.log(props.formBasicConfig) |
|
|
//console.log(props.formBasicConfig) |
|
|
|
|
|
|
|
|
|
|
|
if(props.formBasicConfig.qrCodeFlag==true){ |
|
|
|
|
|
if(props.formBasicConfig.qrCodeInside==true){ |
|
|
|
|
|
if(props.formBasicConfig.qrCodePrintStyle&&props.formBasicConfig.qrCodePrintStyle=="2"&&props.formBasicConfig.qrCodeShowFields.length==0){ |
|
|
|
|
|
alert("未选择表格展示字段") |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//请求数据 |
|
|
//请求数据 |
|
|
let getDetailQrCodesData: any = {} |
|
|
let getDetailQrCodesData: any = {} |
|
|
let currentFieldsMapArrObj: any = {} |
|
|
let currentFieldsMapArrObj: any = {} |
|
|
@ -516,6 +578,20 @@ const setUpClick = (val: string, id: string) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
//console.log(dofs) |
|
|
|
|
|
dofs.forEach(function(element) { |
|
|
|
|
|
if(attr_name==element.name){ |
|
|
|
|
|
//表格属性中存在此单选,将其value根据options替换为可读值 |
|
|
|
|
|
let toConvertValue = currentFieldsMap[attr_name].split("!@#@!")[1] |
|
|
|
|
|
//console.log(toConvertValue) |
|
|
|
|
|
if(isAllCharactersNumbers(toConvertValue)){ |
|
|
|
|
|
let orgName = getLabelById(toConvertValue) |
|
|
|
|
|
currentFieldsMap[attr_name] = currentFieldsMap[attr_name].split("!@#@!")[0]+"!@#@!"+orgName |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
switchs.forEach(function(element) { |
|
|
switchs.forEach(function(element) { |
|
|
if(attr_name==element.name){ |
|
|
if(attr_name==element.name){ |
|
|
//表格属性中存在此单选,将其value根据options替换为可读值 |
|
|
//表格属性中存在此单选,将其value根据options替换为可读值 |
|
|
@ -631,10 +707,16 @@ const setUpClick = (val: string, id: string) => { |
|
|
loadingInstance1.close() |
|
|
loadingInstance1.close() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
})/* .finally(()=>{ |
|
|
}).finally(()=>{ |
|
|
loadingInstance1.close() |
|
|
loadingInstance1.close() |
|
|
qrCodesPrintDialogFlag.value = true |
|
|
}) |
|
|
}) */ |
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
alert("内部二维码功能未启用") |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
alert("请先为本表单开启二维码功能") |
|
|
|
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
alert("未选中任何一条,请先选择") |
|
|
alert("未选中任何一条,请先选择") |
|
|
|
|
|
|
|
|
@ -1952,9 +2034,9 @@ const diGuiJilian = (val: any, options: any[]) => { |
|
|
title="生成的二维码" |
|
|
title="生成的二维码" |
|
|
:show-close="false" |
|
|
:show-close="false" |
|
|
style="margin-top: 10px" |
|
|
style="margin-top: 10px" |
|
|
width="50%" |
|
|
width="40%" |
|
|
> |
|
|
> |
|
|
<div v-if="formBasicConfig.qrCodePrintStyle == '2'" style="min-height: 50px; max-height: 750px; overflow-y: auto"> |
|
|
<div v-if="formBasicConfig.qrCodePrintStyle == '2'" style="max-width: 600px;min-height: 50px; max-height: 750px; overflow-y: auto"> |
|
|
<div |
|
|
<div |
|
|
v-for="(tableData, tableKey) in tablesData" |
|
|
v-for="(tableData, tableKey) in tablesData" |
|
|
:id="tableKey" |
|
|
:id="tableKey" |
|
|
@ -1964,8 +2046,8 @@ const diGuiJilian = (val: any, options: any[]) => { |
|
|
> |
|
|
> |
|
|
<table> |
|
|
<table> |
|
|
<tr> |
|
|
<tr> |
|
|
<th style="font-weight: bold; font-size:medium;" colspan="2">{{ tablesData[tableKey].appName }}-{{ tablesData[tableKey].formName }}</th> |
|
|
<th colspan="2">{{ tablesData[tableKey].appName }}-{{ tablesData[tableKey].formName }}</th> |
|
|
<th rowspan="6"><img :src="tableData.bufferedImage" alt="二维码" width="auto" height="100%"></th> |
|
|
<td rowspan="6" style="width: 240px;"><img :src="tableData.bufferedImage" alt="二维码" width="200px" style="margin-top: 5px;" ></td> |
|
|
</tr> |
|
|
</tr> |
|
|
<tr v-for="(item, fIndex) in tableData.fieldsMap" :key="fIndex"> |
|
|
<tr v-for="(item, fIndex) in tableData.fieldsMap" :key="fIndex"> |
|
|
<th>{{ item.key }}</th> |
|
|
<th>{{ item.key }}</th> |
|
|
@ -2087,11 +2169,15 @@ const diGuiJilian = (val: any, options: any[]) => { |
|
|
table { |
|
|
table { |
|
|
border-collapse: collapse; |
|
|
border-collapse: collapse; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
|
|
|
font-size: 13px; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
td, th { |
|
|
td, th { |
|
|
border: 1px solid black; |
|
|
border: 1px solid black; |
|
|
padding: 8px; |
|
|
padding: 8px; |
|
|
|
|
|
vertical-align: middle; /* 设置文字上下居中 */ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
</style> |
|
|
</style> |