herenshan112 7 days ago
parent
commit
4deb6467a9
  1. 33
      src/components/DesignForm/formControlPropertiNew.vue
  2. 62
      src/components/DesignForm/public/form/form.vue

33
src/components/DesignForm/formControlPropertiNew.vue

@ -2941,16 +2941,35 @@ const currentComponentOptions = computed(() => {
return controlData.value.options return controlData.value.options
}) })
// label //
const currentIndexColumnNode = computed(() => { const findTreeNode = (tree, id) => {
if (!controlData.value?.control?.zdtcsz?.tby) return null if (!tree || !Array.isArray(tree)) return null
return zdtcszTree.value.find(item => item.id == controlData.value.control.zdtcsz.tby)
}) for (let node of tree) {
if (node.id === id) {
return node
}
//
if (node.children && node.children.length > 0) {
const found = findTreeNode(node.children, id)
if (found) return found
}
}
return null
}
// label // label
const currentTitleColumnNode = computed(() => { const currentTitleColumnNode = computed(() => {
if (!controlData.value?.control?.zdtcsz?.tbx) return null if (!controlData.value?.control?.zdtcsz?.tbx) return null
return zdtcszTree.value.find(item => item.id == controlData.value.control.zdtcsz.tbx) return findTreeNode(zdtcszTree.value, controlData.value.control.zdtcsz.tbx)
})
// label
const currentIndexColumnNode = computed(() => {
if (!controlData.value?.control?.zdtcsz?.tby) return null
return findTreeNode(zdtcszTree.value, controlData.value.control.zdtcsz.tby)
}) })
// //
@ -2989,8 +3008,10 @@ const zdtcszTableColumns = computed(() => {
// //
watch([titleOptions, indexOptions], ([newTitleOptions, newIndexOptions]) => { watch([titleOptions, indexOptions], ([newTitleOptions, newIndexOptions]) => {
// //
if (!newTitleOptions.length && !newIndexOptions.length) { if (!newTitleOptions.length && !newIndexOptions.length) {
console.log("如果都没有选择,清空表格数据")
zdtcszTableData.value = [] zdtcszTableData.value = []
return return
} }

62
src/components/DesignForm/public/form/form.vue

@ -646,7 +646,7 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any)
} }
// }) // })
showOrHide(data); showOrHide(data,value);
if (typeof props.changeKeyVal === "function") { if (typeof props.changeKeyVal === "function") {
props.changeKeyVal(key, value, type, attribute); props.changeKeyVal(key, value, type, attribute);
@ -688,8 +688,25 @@ function isEmptyPlainObject(obj) {
} }
function showOrHide(data: any) { function showOrHide(data: any,currentDataNameValue?:any) {
//console.log(data)
let dataObjFlag = false//data
if(data=="onMounted"||data=="kong"){
}else{
console.log(data)
dataObjFlag = true
console.log(data.name)
}
if(dataObjFlag){
if(data.type=="select"||data.type=="radio"||data.type=="checkbox"||data.type=="switch"){
}else{
return
}
}
/* /*
企管部有当前用户, 企管部有当前用户,
@ -1292,21 +1309,32 @@ nextTick(()=>{
//console.log(rowValue) //console.log(rowValue)
let columnValue = model.value[tby] let columnValue = model.value[tby]
//console.log(columnValue) //console.log(columnValue)
if(tbx!=""&&tby!=""){
/* if(dataObjFlag && element.name==data.name && currentDataNameValue!=""){//允许直接选择被矩阵填充的字段
console.log(data.name)
console.log("直接选择被矩阵填充的字段,允许")
model.value[element.name] = currentDataNameValue
return
}else{ */
if(tbx!=""&&tby!=""){
let cellValue = getTableCellValue(element.tableData, rowValue, columnValue) let cellValue = getTableCellValue(element.tableData, rowValue, columnValue)
model.value[element.name] = cellValue*1 model.value[element.name] = cellValue*1
}else if(tbx!=""&&tby==""){ }else if(tbx!=""&&tby==""){
//console.log("") //console.log("")
let cellValue = getTableCellValue(element.tableData, rowValue, 'default') let cellValue = getTableCellValue(element.tableData, rowValue, 'default')
//console.log(cellValue) //console.log(cellValue)
model.value[element.name] = cellValue*1 model.value[element.name] = cellValue*1
}else if(tbx==""&&tby!=""){ }else if(tbx==""&&tby!=""){
//console.log("") //console.log("")
let cellValue = getTableCellValue(element.tableData, 'any', columnValue) let cellValue = getTableCellValue(element.tableData, 'any', columnValue)
//console.log(cellValue) //console.log(cellValue)
model.value[element.name] = cellValue*1 model.value[element.name] = cellValue*1
} }
//}

Loading…
Cancel
Save