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

fix: 重构事件编辑代码

parent dcd38827
Pipeline #43041 skipped with stages
......@@ -447,7 +447,7 @@ const AddModal = props => {
const [editable, setEditable] = useState(false);
const [ReportFromMobile, setReportFromMobile] = useState(false);
const [ReportFromWeb, setReportFromWeb] = useState(false);
const [chee, setChee] = useState(0);
const [chee, setChee] = useState('');
const [pickItem, setPickItem] = useState('');
const [prefixName, setPrefixName] = useState('');
const [selectValue, setSelectValue] = useState('');
......@@ -534,6 +534,7 @@ const AddModal = props => {
form.resetFields();
setValue('');
callBackSubmit();
setChee('');
notification.success({
message: '提示',
duration: 3,
......@@ -561,6 +562,7 @@ const AddModal = props => {
if (res.msg === 'Ok') {
form.resetFields();
setValue('');
setChee('');
callBackSubmit();
notification.success({
message: '提示',
......@@ -601,7 +603,7 @@ const AddModal = props => {
setEditable(false);
setReportFromMobile(false);
} else if (type === 'edit') {
setChee('');
setChee();
getEventData1();
GetCM_Event_QueryEventType({ eventTypeId: formObj.ID }).then(res => {
if (res.data.root) {
......@@ -661,19 +663,13 @@ const AddModal = props => {
});
}
setFlag(0);
} else if (type == 'edit') {
} else if (type == 'edit' || type == 'add') {
setEditable(false);
setReportFromMobile(false);
setReportFromWeb(false);
form.resetFields();
setValue('');
setSummaryIsShow('none');
setReportIsShow('none');
setDisplayIsShow('none');
setEditableIsShow('none');
setTransitIsShow('none');
setRelatedEventIsShow('none');
} else if (type == 'add') {
setChee('');
setSummaryIsShow('none');
setReportIsShow('none');
setDisplayIsShow('none');
......@@ -1231,7 +1227,7 @@ const AddModal = props => {
return (
<Drawer
title={type === 'add' ? '添加事件类型' : '编辑事件类型'}
width="600px"
width="500px"
destroyOnClose
{...props}
footer={
......@@ -1243,12 +1239,12 @@ const AddModal = props => {
}
// confirmLoading={loading}
>
<Form form={form} labelCol={{ span: 7 }} style={{ overflowY: 'scroll' }}>
<Form form={form} style={{ overflowY: 'scroll' }}>
<Row>
<Col span={14}>
<Col span={15}>
<Item
label="事件名称"
labelCol={{ span: 7 }}
labelCol={{ span: 8 }}
name="Name"
rules={[
{
......@@ -1257,10 +1253,14 @@ const AddModal = props => {
},
]}
>
<Input onChange={prefix} placeholder="请输入事件名称" />
<Input
onChange={prefix}
placeholder="请输入事件名称"
style={{ marginLeft: '-3px' }}
/>
</Item>
</Col>
<Col span={10}>
<Col span={9}>
<Item
label="编码前缀"
labelCol={{ span: 14 }}
......@@ -1276,23 +1276,13 @@ const AddModal = props => {
</Item>
</Col>
<Col span={24}>
<span
style={{
position: 'absolute',
left: '2%',
top: '9%',
color: 'red',
fontSize: '16px',
}}
>
*
</span>
<Item
label="业务类型"
name="BusinessType"
labelCol={{ span: 4 }}
labelCol={{ span: 5 }}
rules={[
{
required: true,
validator: (rule, value) => {
if (form.getFieldsValue().BusinessType == '') {
return Promise.reject('业务类型必填');
......@@ -1303,7 +1293,12 @@ const AddModal = props => {
]}
>
<div>
<Input className="ue-editable-select-input" onChange={inputType} value={Type1} />
<Input
className="ue-editable-select-input"
onChange={inputType}
value={Type1}
style={{ marginLeft: '-3px' }}
/>
<Dropdown
placement="bottomRight"
style={{ width: '430px' }}
......@@ -1346,7 +1341,7 @@ const AddModal = props => {
<Item
label="事件主表"
name="TableName"
labelCol={{ span: 4 }}
labelCol={{ span: 5 }}
rules={[
{
required: true,
......@@ -1354,7 +1349,11 @@ const AddModal = props => {
},
]}
>
<Select placeholder="选择事件主表" onChange={changTable}>
<Select
placeholder="选择事件主表"
onChange={changTable}
style={{ marginLeft: '-3px' }}
>
{standingTable
? standingTable.map((item, index) => (
<Option key={index} value={item.text}>
......@@ -1365,15 +1364,16 @@ const AddModal = props => {
</Select>
</Item>
</Col>
<Col span={4}>
<Col span={5}>
<Item />
</Col>
<Col span={20}>
<Col span={19}>
<Item>
<span>客户端上报和配单(需配置事件权限、受理流程)</span>
</Item>
</Col>
<Col span={4}>
<Col span={5}>
<Item />
</Col>
<Col span={4}>
......@@ -1383,7 +1383,7 @@ const AddModal = props => {
</Checkbox>
</Item>
</Col>
<Col span={16}>
<Col span={15}>
<Item name="ReportFromMobile">
<Checkbox onChange={onChange4} checked={ReportFromMobile}>
手持
......@@ -1392,25 +1392,21 @@ const AddModal = props => {
{/* </Item> */}
</Col>
<Col span={4}>
<Col span={5}>
<Item />
</Col>
<Col span={20}>
<Col span={19}>
<Item name="Editable">
<Checkbox onChange={onChange1} checked={editable}>
上报后可以编辑(需配置编辑字段)
</Checkbox>
</Item>
</Col>
<Col span={23}>
<Item label="上报方式" name="CreateMode" labelCol={{ span: 4 }}>
<Col span={24}>
<Item label="上报方式" name="CreateMode" labelCol={{ span: 5 }}>
<Radio.Group onChange={onChange2} value={value} defaultValue={chee}>
<Radio value={0} style={{ marginLeft: '5px' }}>
仅上报
</Radio>
<Radio value={1} style={{ marginLeft: '100px' }}>
工单分派
</Radio>
<Radio value={0}>仅上报</Radio>
<Radio value={1}>工单分派</Radio>
</Radio.Group>
</Item>
</Col>
......@@ -1441,7 +1437,7 @@ const AddModal = props => {
</div>
}
name="SummaryFields"
labelCol={{ span: 4 }}
labelCol={{ span: 5 }}
rules={[
{
validator: (rule, value) => {
......@@ -1493,7 +1489,7 @@ const AddModal = props => {
</div>
}
name="ReportFields"
labelCol={{ span: 4 }}
labelCol={{ span: 5 }}
rules={[
{
validator: (rule, value) => {
......@@ -1545,7 +1541,7 @@ const AddModal = props => {
</div>
}
name="DisplayFields"
labelCol={{ span: 4 }}
labelCol={{ span: 5 }}
rules={[
{
validator: (rule, value) => {
......@@ -1597,7 +1593,7 @@ const AddModal = props => {
</div>
}
name="EditableFields"
labelCol={{ span: 4 }}
labelCol={{ span: 5 }}
rules={[
{
validator: (rule, value) => {
......@@ -1639,7 +1635,7 @@ const AddModal = props => {
</div>
}
name="TransitFields"
labelCol={{ span: 4 }}
labelCol={{ span: 5 }}
>
<div style={{ display: 'flex' }}>
<Form.Item name="TransitFields" style={{ marginBottom: 0, width: '100%' }}>
......@@ -1655,7 +1651,7 @@ const AddModal = props => {
</Item>
</Col>
<Col span={24}>
<Item label="事件权限" name="Roles" labelCol={{ span: 4 }}>
<Item label="事件权限" name="Roles" labelCol={{ span: 5 }}>
<div style={{ display: 'flex' }}>
<Form.Item name="Roles" style={{ marginBottom: 0, width: '100%' }}>
<Input placeholder="请选择事件权限" allowClear />
......@@ -1670,22 +1666,22 @@ const AddModal = props => {
</Item>
</Col>
<Col span={24}>
<Item label="置顶条件" name="TopWhere" labelCol={{ span: 4 }}>
<Item label="置顶条件" name="TopWhere" labelCol={{ span: 5 }}>
<Input placeholder="请输入置顶条件" allowClear />
</Item>
</Col>
<Col span={24}>
<Item label="上报视图" name="ReportPage" labelCol={{ span: 4 }}>
<Item label="上报视图" name="ReportPage" labelCol={{ span: 5 }}>
<Input placeholder="请输入上报视图" allowClear />
</Item>
</Col>
<Col span={24}>
<Item label="处理视图" name="DealPage" labelCol={{ span: 4 }}>
<Item label="处理视图" name="DealPage" labelCol={{ span: 5 }}>
<Input placeholder="请输入处理视图" allowClear />
</Item>
</Col>
<Col span={24}>
<Item label="关联事件" name="RelatedEvents" labelCol={{ span: 4 }}>
<Item label="关联事件" name="RelatedEvents" labelCol={{ span: 5 }}>
<Input placeholder="请输入关联事件" allowClear />
</Item>
</Col>
......@@ -1706,7 +1702,7 @@ const AddModal = props => {
</div>
}
name="RelatedEventFields"
labelCol={{ span: 4 }}
labelCol={{ span: 5 }}
>
<div style={{ display: 'flex' }}>
<Form.Item name="RelatedEventFields" style={{ marginBottom: 0, width: '100%' }}>
......@@ -1722,7 +1718,7 @@ const AddModal = props => {
</Item>
</Col>
<Col span={24}>
<Item label="接口配置" name="InterfaceConfig" labelCol={{ span: 4 }}>
<Item label="接口配置" name="InterfaceConfig" labelCol={{ span: 5 }}>
<Input placeholder="请输入接口配置" />
</Item>
</Col>
......
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