Commit 7d8693a5 authored by 皮倩雯's avatar 皮倩雯

新增事件管理外部字段显示

parent 98a67b67
Pipeline #36163 skipped with stages
......@@ -70,7 +70,12 @@ const ChangeAddFlows = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
arr.map((item, index) => {
filed1[item].map((i, j) => {
b.push(i)
})
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed1[item].includes(checkItem)) {
......@@ -80,6 +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)
}
}
})
if(a.length >0){
filed1.外部字段 = a
console.log(filed1)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
console.log(checkArr)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
......
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { Form, Modal, Divider, Checkbox} from 'antd';
import { Form, Modal, Divider, Checkbox } from 'antd';
import styles from './incident.less';
import Sortable from 'sortablejs';
......@@ -17,6 +17,7 @@ const AddModal = props => {
const [checkAll, setCheckAll] = useState([]);
const [selectData, setSelectData] = useState([])
let objArr = []
const onChangeList = (list, index, title) => {
const checkedListArr = [...checkedList]
checkedListArr[index] = list
......@@ -76,7 +77,12 @@ const AddModal = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
arr.map((item, index) => {
filed[item].map((i, j) => {
b.push(i)
})
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed[item].includes(checkItem)) {
......@@ -86,10 +92,29 @@ 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)
}
}
})
if(a.length >0){
filed.外部字段 = a
console.log(filed)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
console.log(characterValue)
let newArr = characterValue.length ? characterValue.split(",") : []
console.log(newArr)
setSelectData(newArr)
draftSort()
} else if (isType === 'app') {
......@@ -101,7 +126,12 @@ const AddModal = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
arr.map((item, index) => {
filed1[item].map((i, j) => {
b.push(i)
})
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed1[item].includes(checkItem)) {
......@@ -111,6 +141,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)
}
}
})
if(a.length >0){
filed1.外部字段 = a
console.log(filed1)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
......@@ -180,7 +227,8 @@ const AddModal = props => {
{title.map((item, index) => {
return <div className={styles.cardItemData} key={index}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', color: '#15428b', borderTopColor: '#99bbe8' }}><Checkbox indeterminate={indeterminate[index]} onChange={onCheckAllChange} index={index} checkvalue={filed[item]} checked={checkAll[index]} style={{ marginRight: '7px' }}></Checkbox>{item}</Divider>
<CheckboxGroup options={filed[item]} value={checkedList[index]} onChange={(e) => onChangeList(e, index, item)} /></div>
<CheckboxGroup options={filed[item]} value={checkedList[index]} onChange={(e) => onChangeList(e, index, item)} />
</div>
})}
</div>
</>
......
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