Commit c132f305 authored by 皮倩雯's avatar 皮倩雯

解决事件管理外部字段展示错误

parent 89f4fb9b
Pipeline #38066 skipped with stages
......@@ -16,6 +16,7 @@ const AddFlowsModal = props => {
const [visible1, setVisible1] = useState(false)
const [pickItem, setPickItem] = useState('')
const [checkedList1, setCheckedList1] = useState([])
const [nu1, setNu1] = useState([])
const [inputValue, setInputValue] = useState({ Roles: '' });
const [selectValue, setSelectValue] = useState('')
const [characterValue, setCharacterValue] = useState('')
......@@ -242,6 +243,7 @@ const AddFlowsModal = props => {
const getRole = () => {
CM_Event_LoadDepartmentAndRoles().then(res => {
if (res.msg === 'Ok') {
setNu1(res.data)
setFiled1(formateArrDataA1(res.data, 'groupType'))
console.log(res.data)
......@@ -255,6 +257,36 @@ const AddFlowsModal = props => {
}
const pickFiled1 = (fileds) => {
// setTypes('app')
let pp = formateArrDataA1(nu1, 'group')
let ab = inputValue[fileds].split(',')
console.log(pp)
let arr = Object.keys(pp)
let b = []
let a = []
arr.map((item, index) => {
pp[item].map((i, j) => {
b.push(i)
})
})
console.log(ab)
ab.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
}
})
if(a.length >0){
pp.外部字段 = a
console.log(pp)
arr.push('外部字段')
}
console.log(a)
console.log(pp)
setFiled1(pp)
console.log(fileds)
setCharacterValue(inputValue[fileds])
setCheckedList1(inputValue[fileds].split(','))
......
......@@ -25,6 +25,8 @@ const AddModal = props => {
const [checkedList2, setCheckedList2] = useState([])
const [checkedList3, setCheckedList3] = useState([])
const [checkedList4, setCheckedList4] = useState([])
const [nu, setNu] = useState([])
const [nu1, setNu1] = useState([])
const [editable, setEditable] = useState(false)
const [ReportFromMobile, setReportFromMobile] = useState(false)
......@@ -259,6 +261,7 @@ const AddModal = props => {
const getRole = () => {
CM_Event_LoadDepartmentAndRoles().then(res => {
if (res.msg === 'Ok') {
setNu1(res.data)
setFiled1(formateArrDataA1(res.data, 'groupType'))
console.log(res.data)
......@@ -296,6 +299,7 @@ const AddModal = props => {
setFlag(flag+1)
LoadEventFields({ eventTableName: value, distinctFields: '' }).then(res => {
if (res.data.root) {
setNu(res.data.root)
setFiled(formateArrDataA(res.data.root, 'group'))
console.log(filed)
console.log(res.data.root)
......@@ -489,6 +493,36 @@ const AddModal = props => {
setIsVisible1(false)
}
const pickFiled = (fileds) => {
let pp = formateArrDataA(nu, 'group')
let ab = inputValue[fileds].split(',')
console.log(pp)
let arr = Object.keys(pp)
let b = []
let a = []
arr.map((item, index) => {
pp[item].map((i, j) => {
b.push(i)
})
})
console.log(ab)
ab.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
}
})
if(a.length >0){
pp.外部字段 = a
console.log(pp)
arr.push('外部字段')
}
console.log(a)
console.log(pp)
setFiled(pp)
setTypes('add')
setCharacterValue(inputValue[fileds])
setCheckedList1(inputValue[fileds].split(','))
......@@ -496,10 +530,37 @@ const AddModal = props => {
setIsVisible(true)
}
const pickFiled1 = (fileds) => {
let pp = formateArrDataA1(nu1, 'group')
let ab = inputValue[fileds].split(',')
console.log(pp)
let arr = Object.keys(pp)
let b = []
let a = []
arr.map((item, index) => {
pp[item].map((i, j) => {
b.push(i)
})
})
console.log(ab)
ab.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
}
})
if(a.length >0){
pp.外部字段 = a
console.log(pp)
arr.push('外部字段')
}
console.log(a)
console.log(pp)
setFiled1(pp)
setTypes('app')
// console.log(fileds)
// console.log(inputValue)
// console.log(inputValue[fileds])
setCharacterValue(inputValue[fileds])
setCheckedList1(inputValue[fileds].split(','))
setPickItem(fileds)
......
......@@ -70,12 +70,12 @@ const ChangeAddFlows = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
// let b = []
// let a = []
arr.map((item, index) => {
filed1[item].map((i, j) => {
b.push(i)
})
// filed1[item].map((i, j) => {
// b.push(i)
// })
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed1[item].includes(checkItem)) {
......@@ -85,23 +85,23 @@ const ChangeAddFlows = props => {
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed1[item].length)
checkAllArr.push(checkArr[index].length === filed1[item].length)
})
newCheckedList.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
// newCheckedList.map((item, index) => {
// if (b.includes(item) == false) {
// if(item == ''){
// a=[]
// }else{
// a.push(item)
// }
}
})
if(a.length >0){
filed1.外部字段 = a
console.log(filed1)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
// }
// })
// if(a.length >0){
// filed1.外部字段 = a
// console.log(filed1)
// arr.push('外部字段')
// }
// setTitle(arr)
// checkArr.push(a)
console.log(checkArr)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
......
......@@ -78,12 +78,12 @@ const AddModal = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
// let b = []
// let a = []
arr.map((item, index) => {
filed[item].map((i, j) => {
b.push(i)
})
// filed[item].map((i, j) => {
// b.push(i)
// })
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed[item].includes(checkItem)) {
......@@ -93,23 +93,23 @@ const AddModal = props => {
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed[item].length)
checkAllArr.push(checkArr[index].length === filed[item].length)
})
newCheckedList.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
// newCheckedList.map((item, index) => {
// if (b.includes(item) == false) {
// if(item == ''){
// a=[]
// }else{
// a.push(item)
// }
}
})
if(a.length >0){
filed.外部字段 = a
console.log(filed)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
// }
// })
// if(a.length >0){
// filed.外部字段 = a
// console.log(filed)
// arr.push('外部字段')
// }
// setTitle(arr)
// checkArr.push(a)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
......@@ -127,12 +127,12 @@ const AddModal = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
// let b = []
// let a = []
arr.map((item, index) => {
filed1[item].map((i, j) => {
b.push(i)
})
// filed1[item].map((i, j) => {
// b.push(i)
// })
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed1[item].includes(checkItem)) {
......@@ -142,23 +142,23 @@ const AddModal = props => {
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed1[item].length)
checkAllArr.push(checkArr[index].length === filed1[item].length)
})
newCheckedList.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
// newCheckedList.map((item, index) => {
// if (b.includes(item) == false) {
// if(item == ''){
// a=[]
// }else{
// a.push(item)
// }
}
})
if(a.length >0){
filed1.外部字段 = a
console.log(filed1)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
// }
// })
// if(a.length >0){
// filed1.外部字段 = a
// console.log(filed1)
// arr.push('外部字段')
// }
// setTitle(arr)
// checkArr.push(a)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment