|
|
|
@ -70,6 +70,7 @@ const props = withDefaults( |
|
|
|
viewPage?: viewPageType; |
|
|
|
formBasicConfig?: any; |
|
|
|
fieldsDetailList?:any; |
|
|
|
orgAndManTree?:any; |
|
|
|
}>(), |
|
|
|
{ |
|
|
|
showPage: true, |
|
|
|
@ -112,6 +113,9 @@ const props = withDefaults( |
|
|
|
fieldsDetailList: () => { |
|
|
|
return {}; |
|
|
|
}, |
|
|
|
orgAndManTree: () => { |
|
|
|
return {}; |
|
|
|
}, |
|
|
|
} |
|
|
|
); |
|
|
|
const emits = defineEmits<{ |
|
|
|
@ -314,6 +318,8 @@ let checkboxs: any[] = []; |
|
|
|
let switchs: any[] = []; |
|
|
|
let selects: any[] = []; |
|
|
|
let tables: any[] = []; |
|
|
|
let dofs: any[] = [];//deptOrgAndOrgCententAndFounderArr |
|
|
|
|
|
|
|
function getAsfs() { |
|
|
|
//setTimeout(() => { |
|
|
|
let dataList = ref({}); |
|
|
|
@ -330,6 +336,8 @@ function getAsfs() { |
|
|
|
switchs.push(dataList.value[i]) |
|
|
|
} else if(dataList.value[i].type == "select"){ |
|
|
|
selects.push(dataList.value[i]) |
|
|
|
} 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 == "flex" || |
|
|
|
@ -351,6 +359,8 @@ function getAsfs() { |
|
|
|
switchs.push(element) |
|
|
|
}else if(element.type == "select"){ |
|
|
|
selects.push(element) |
|
|
|
}else if(element.type == "deptOrg"||element.type == "orgCentent"||element.type == "founder"){ |
|
|
|
dofs.push(element) |
|
|
|
} |
|
|
|
}); |
|
|
|
} else if (dataList.value[i].type == "grid") { |
|
|
|
@ -371,6 +381,8 @@ function getAsfs() { |
|
|
|
switchs.push(a) |
|
|
|
}else if(a.type == "select"){ |
|
|
|
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) |
|
|
|
}else if(a.type == "select"){ |
|
|
|
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") { |
|
|
|
if (a.type == "table") { |
|
|
|
tables.push(dataList.value[i]); |
|
|
|
@ -412,6 +426,8 @@ function getAsfs() { |
|
|
|
switchs.push(q) |
|
|
|
}else if(q.type == "select"){ |
|
|
|
selects.push(q) |
|
|
|
}else if(q.type == "deptOrg"||q.type == "orgCentent"||q.type == "founder"){ |
|
|
|
dofs.push(q) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -425,7 +441,6 @@ function getAsfs() { |
|
|
|
//}, 500); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function convertStringToArray(str: string) { |
|
|
|
if (typeof str!== 'string') { |
|
|
|
throw new Error('Input must be a string.'); |
|
|
|
@ -442,6 +457,45 @@ function convertStringToArray(str: string) { |
|
|
|
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 |
|
|
|
|
|
|
|
@ -462,11 +516,11 @@ const setUpClick = (val: string, id: string) => { |
|
|
|
//在此组装参数,以生成二维码图片 |
|
|
|
let idArray = state.selectionChecked.map(item => item.id); |
|
|
|
if(idArray.length>0){ |
|
|
|
/* const loadingInstance1 = ElLoading.service({ |
|
|
|
const loadingInstance1 = ElLoading.service({ |
|
|
|
fullscreen: true, |
|
|
|
text: '正在生成二维码,请稍候...' // 添加的文字内容,可根据需要修改 |
|
|
|
}); */ |
|
|
|
console.log(props.formBasicConfig) |
|
|
|
}); |
|
|
|
//console.log(props.formBasicConfig) |
|
|
|
|
|
|
|
if(props.formBasicConfig.qrCodeFlag==true){ |
|
|
|
if(props.formBasicConfig.qrCodeInside==true){ |
|
|
|
@ -524,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) { |
|
|
|
if(attr_name==element.name){ |
|
|
|
//表格属性中存在此单选,将其value根据options替换为可读值 |
|
|
|
@ -628,7 +696,7 @@ const setUpClick = (val: string, id: string) => { |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
//loadingInstance1.close() |
|
|
|
loadingInstance1.close() |
|
|
|
qrCodesPrintDialogFlag.value = true |
|
|
|
},820) |
|
|
|
|
|
|
|
@ -636,9 +704,11 @@ const setUpClick = (val: string, id: string) => { |
|
|
|
//fieldsMap = null |
|
|
|
tablesData.value = getDetailQrCodesData |
|
|
|
qrCodesPrintDialogFlag.value = true |
|
|
|
//loadingInstance1.close() |
|
|
|
loadingInstance1.close() |
|
|
|
} |
|
|
|
|
|
|
|
}).finally(()=>{ |
|
|
|
loadingInstance1.close() |
|
|
|
}) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|