Commit 045d6530 authored by 皮倩雯's avatar 皮倩雯

给事件流程添加选项默认值

parent 1f0d00c1
Pipeline #33974 skipped with stages
...@@ -10,7 +10,7 @@ import { getRoleGroup } from '@/services/userCenter/roleManage/api'; ...@@ -10,7 +10,7 @@ import { getRoleGroup } from '@/services/userCenter/roleManage/api';
const { Option } = Select; const { Option } = Select;
const AddModal = props => { const AddModal = props => {
const [inputValue, setInputValue] = useState({ SummaryFields: '', ReportFields: '', DisplayFields: '', EditableFields: '', TransitFields: '', Roles: '', RelatedEventFields: '', pictureFields: '' }); const [inputValue, setInputValue] = useState({ SummaryFields: '', ReportFields: '', DisplayFields: '', EditableFields: '', TransitFields: '', Roles: '', RelatedEventFields: '', pictureFields: '' });
const { callBackSubmit = () => { }, visible, type, formObj, treeData, maxLength } = props; const { callBackSubmit = () => { }, visible, type, formObj, treeData, maxLength, selectData } = props;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const defaultCheckedList = ['前端', '手持'] const defaultCheckedList = ['前端', '手持']
...@@ -188,10 +188,11 @@ const AddModal = props => { ...@@ -188,10 +188,11 @@ const AddModal = props => {
}; };
useEffect(() => { useEffect(() => {
console.log(selectData)
getRole() getRole()
if (type === 'add') { if (type === 'add') {
getEventData() getEventData()
setSelectValue(selectData[0])
setInputValue({ SummaryFields: '', ReportFields: '', DisplayFields: '', EditableFields: '', TransitFields: '', Roles: '', RelatedEventFields: '', pictureFields: '' }) setInputValue({ SummaryFields: '', ReportFields: '', DisplayFields: '', EditableFields: '', TransitFields: '', Roles: '', RelatedEventFields: '', pictureFields: '' })
setFiled({}) setFiled({})
setFiled1({}) setFiled1({})
...@@ -236,7 +237,7 @@ const AddModal = props => { ...@@ -236,7 +237,7 @@ const AddModal = props => {
arr.push(item.text) arr.push(item.text)
}) })
console.log(arr) console.log(arr)
setSelectValue(arr[0]) // setSelectValue(arr[0])
changTable(arr[0]) changTable(arr[0])
} }
}) })
......
...@@ -24,7 +24,7 @@ import { ...@@ -24,7 +24,7 @@ import {
ApartmentOutlined, ApartmentOutlined,
DesktopOutlined DesktopOutlined
} from '@ant-design/icons'; } from '@ant-design/icons';
import {GetCM_Event_LoadEventTable, CM_Event_RemoveEventTable, CM_Event_ReOrder} from '@/services/standingBook/api'; import {GetCM_Event_LoadEventTable, CM_Event_RemoveEventTable, CM_Event_ReOrder, GetCM_Event_LoadEventTypeTable} from '@/services/standingBook/api';
import classnames from 'classnames'; import classnames from 'classnames';
import AddModal from './AddModal' import AddModal from './AddModal'
import ProcessModal from './ProcessModal' import ProcessModal from './ProcessModal'
...@@ -46,6 +46,7 @@ const incident = () => { ...@@ -46,6 +46,7 @@ const incident = () => {
const [flag, setFlag] = useState(0); const [flag, setFlag] = useState(0);
const [title1, setTitle1] = useState('') const [title1, setTitle1] = useState('')
const [title2, setTitle2] = useState('') const [title2, setTitle2] = useState('')
const [select, setSelect] = useState('')
...@@ -54,8 +55,6 @@ const incident = () => { ...@@ -54,8 +55,6 @@ const incident = () => {
const [maxLength, setMaxLength] = useState(0); const [maxLength, setMaxLength] = useState(0);
const [pickItem, setPickItem] = useState(''); const [pickItem, setPickItem] = useState('');
// const setRowClassName = record =>
// record.userID === selectColor.userID ? styles.clickRowStyle : '';
const columns = [ const columns = [
{ {
title: '事件名称', title: '事件名称',
...@@ -309,6 +308,17 @@ const incident = () => { ...@@ -309,6 +308,17 @@ const incident = () => {
} }
}) })
},[flag]) },[flag])
useEffect(()=>{
GetCM_Event_LoadEventTypeTable().then(res => {
if (res.msg === 'Ok') {
let arr = []
res.data.map((item, index)=>{
arr.push(item.text)
})
setSelect(arr)
}
})
},[])
const formateArrDataA = (initialArr, name) => { const formateArrDataA = (initialArr, name) => {
console.log(initialArr) console.log(initialArr)
console.log(name) console.log(name)
...@@ -530,6 +540,7 @@ const incident = () => { ...@@ -530,6 +540,7 @@ const incident = () => {
maxLength={maxLength} maxLength={maxLength}
onCancel={() => setAddvisible(false)} onCancel={() => setAddvisible(false)}
treeData={treeData} treeData={treeData}
selectData={select}
callBackSubmit={onSubmit} callBackSubmit={onSubmit}
/> />
<ProcessModal <ProcessModal
......
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