|
|
|
@ -1776,6 +1776,71 @@ const location = ref('North Pole') |
|
|
|
|
|
|
|
function updateLocation(currentValue: any,currentComp:any) { |
|
|
|
location.value = currentValue+currentComp |
|
|
|
let deepCopyedCurrentValue:string = JSON.stringify(toRaw(currentValue)) |
|
|
|
let workNumber = getParenthesesContent(deepCopyedCurrentValue) |
|
|
|
console.log(workNumber) |
|
|
|
let mainOrg = 309 |
|
|
|
getMainOrgByWorkNumber({workNumber:workNumber}).then(({ data }) => { |
|
|
|
console.log(data) |
|
|
|
mainOrg = data*1 |
|
|
|
}).finally(()=>{ |
|
|
|
|
|
|
|
//找到关联此 user 组件的所有 org 组件 |
|
|
|
let connectOrgs: any[] = [] |
|
|
|
selectOrgs.forEach((element:any) => { |
|
|
|
if(element.control.connectUserComponent){ |
|
|
|
let realCurrentCompName = getAfterLastColon(element.control.connectUserComponent) |
|
|
|
if(currentComp == realCurrentCompName){ |
|
|
|
connectOrgs.push(element) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
let deepCopyedConnectOrgs = JSON.parse(JSON.stringify(connectOrgs)) |
|
|
|
//console.log(selectOrgsPath) |
|
|
|
|
|
|
|
deepCopyedConnectOrgs.forEach((element:any) => { |
|
|
|
selectOrgsPath.forEach((item: any) => { |
|
|
|
if(item.obj==element.name){ |
|
|
|
if(item.path==undefined || item.path=="" || item.path=="undefined"){ |
|
|
|
element.path = "" |
|
|
|
}else{ |
|
|
|
element.path = item.path |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
if(element.path==""){ |
|
|
|
model.value[element.name] = mainOrg |
|
|
|
}else{ |
|
|
|
let length = model.value[element.path].length |
|
|
|
//console.log(length) |
|
|
|
model.value[element.path].forEach((x:any) => { |
|
|
|
x[element.name] = mainOrg |
|
|
|
}); |
|
|
|
//model.value[element.path][element.name] = 309 |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
//console.log(deepCopyedConnectOrgs) |
|
|
|
console.log(model.value) |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function getMainOrgByWorkNumber(obj: { workNumber: string}) { |
|
|
|
return request({ |
|
|
|
url: "/javasys/lowCode/manCont/getMainOrgByWorkNumber", |
|
|
|
method: "post", |
|
|
|
data: obj, |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function getParenthesesContent(str:string) { |
|
|
|
//console.log(str) |
|
|
|
const match = str.match(/\((.*?)\)/); |
|
|
|
return match ? match[1] : ''; |
|
|
|
} |
|
|
|
|
|
|
|
provide('location', { |
|
|
|
@ -1783,7 +1848,38 @@ provide('location', { |
|
|
|
updateLocation |
|
|
|
}) |
|
|
|
|
|
|
|
/** |
|
|
|
* 提取字符串中最后一个英文冒号后的内容,无冒号则返回原字符串 |
|
|
|
* @param {string} str - 输入的字符串 |
|
|
|
* @returns {string} 最后一个冒号后的内容或原字符串 |
|
|
|
*/ |
|
|
|
function getAfterLastColon(str:string) { |
|
|
|
// 首先验证入参类型,确保是字符串(避免非字符串类型导致方法出错) |
|
|
|
if (typeof str !== 'string') { |
|
|
|
//console.warn('入参必须是字符串类型,当前已自动转为字符串'); |
|
|
|
str = String(str); // 非字符串类型自动转为字符串 |
|
|
|
} |
|
|
|
|
|
|
|
// 查找最后一个英文冒号的索引位置 |
|
|
|
const lastColonIndex = str.lastIndexOf(':'); |
|
|
|
|
|
|
|
// 若未找到冒号(索引为 -1),或冒号在字符串最后一位(后面无内容),返回原字符串 |
|
|
|
if (lastColonIndex === -1 || lastColonIndex === str.length - 1) { |
|
|
|
return str; |
|
|
|
} |
|
|
|
|
|
|
|
// 截取最后一个冒号后面的字符(索引+1 开始到字符串结尾) |
|
|
|
return str.slice(lastColonIndex + 1); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//实现选择用户选择时,自动填充选择组织 liwenxuan 2025-11-11 end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function modifyTreeData(treeData, idList) { |
|
|
|
//console.log("modifyTreeDataMinimal 执行了"); |
|
|
|
let gkFlag = true |
|
|
|
@ -2057,10 +2153,13 @@ function groupExpandUserConfigs(configs) { |
|
|
|
|
|
|
|
const asfs: any[] = []; |
|
|
|
const rangedUsers :any= []; |
|
|
|
const selectOrgs :any = []; |
|
|
|
const selectOrgsPath :any = []; |
|
|
|
|
|
|
|
const tables: any[] = []; |
|
|
|
|
|
|
|
const getAsfsRunedFlag = ref(false) |
|
|
|
|
|
|
|
function getAsfs() { |
|
|
|
/* setTimeout(() => { */ |
|
|
|
if(props.formData.list&&props.formData.list.length>0){ |
|
|
|
@ -2071,26 +2170,38 @@ function getAsfs() { |
|
|
|
if (dataList && Array.isArray(dataList.value) && dataList.value.length > 0) { |
|
|
|
|
|
|
|
for (let i = 0; i < dataList.value.length; i++) { |
|
|
|
let for1Name = dataList.value[i].name |
|
|
|
|
|
|
|
if (dataList.value[i].type == "associatedForms") { |
|
|
|
asfs.push(dataList.value[i]); |
|
|
|
} else if(dataList.value[i].type == "expand-user"){ |
|
|
|
rangedUsers.push(dataList.value[i]); |
|
|
|
} else if(dataList.value[i].type == "orgCentent"){ |
|
|
|
let pathObj = {path:"",obj: dataList.value[i].name} |
|
|
|
selectOrgsPath.push(pathObj) |
|
|
|
selectOrgs.push(dataList.value[i]); |
|
|
|
}else if ( |
|
|
|
dataList.value[i].type == "card" || |
|
|
|
dataList.value[i].type == "flex" || |
|
|
|
dataList.value[i].type == "div" || |
|
|
|
dataList.value[i].type == "table" |
|
|
|
) { |
|
|
|
|
|
|
|
if (dataList.value[i].type == "table") { |
|
|
|
tables.push(dataList.value[i]); |
|
|
|
} |
|
|
|
|
|
|
|
dataList.value[i].list.forEach((element: any) => { |
|
|
|
|
|
|
|
if (element.type == "associatedForms") { |
|
|
|
asfs.push(element); |
|
|
|
}else if(element.type == "expand-user"){ |
|
|
|
rangedUsers.push(element); |
|
|
|
} |
|
|
|
rangedUsers.push(element); |
|
|
|
}else if(element.type == "orgCentent"){ |
|
|
|
let pathObj = {path:""+for1Name,obj:element.name} |
|
|
|
selectOrgsPath.push(pathObj) |
|
|
|
selectOrgs.push(element); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else if (dataList.value[i].type == "grid") { |
|
|
|
let columns = JSON.parse(JSON.stringify(dataList.value[i].columns)); |
|
|
|
@ -2104,6 +2215,10 @@ function getAsfs() { |
|
|
|
asfs.push(a); |
|
|
|
}else if(a.type == "expand-user"){ |
|
|
|
rangedUsers.push(a); |
|
|
|
}else if(a.type == "orgCentent"){ |
|
|
|
let pathObj = {path:""+for1Name,obj:a.name} |
|
|
|
selectOrgsPath.push(pathObj) |
|
|
|
selectOrgs.push(a); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2120,7 +2235,12 @@ function getAsfs() { |
|
|
|
asfs.push(a); |
|
|
|
} else if(a.type == "expand-user"){ |
|
|
|
rangedUsers.push(a); |
|
|
|
} else if(a.type == "orgCentent"){ |
|
|
|
let pathObj = {path:""+for1Name,obj:a.name} |
|
|
|
selectOrgsPath.push(pathObj) |
|
|
|
selectOrgs.push(a); |
|
|
|
}else if (a.type == "flex" || a.type == "table") { |
|
|
|
let for2Name = a.name |
|
|
|
if (a.type == "table") { |
|
|
|
tables.push(dataList.value[i]); |
|
|
|
} |
|
|
|
@ -2133,6 +2253,10 @@ function getAsfs() { |
|
|
|
asfs.push(q); |
|
|
|
}else if(q.type == "expand-user"){ |
|
|
|
rangedUsers.push(q); |
|
|
|
}else if(q.type == "orgCentent"){ |
|
|
|
let pathObj = {path:""+for2Name,obj:q.name} |
|
|
|
selectOrgsPath.push(pathObj) |
|
|
|
selectOrgs.push(q); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2586,6 +2710,7 @@ const webPage = computed({ |
|
|
|
// |
|
|
|
</script> |
|
|
|
<template> |
|
|
|
{{ model }} |
|
|
|
<div v-if="webPage" class="webBox"> |
|
|
|
<el-form |
|
|
|
v-bind="formData.form" |
|
|
|
|