Commit 378d7cf1 authored by 皮倩雯's avatar 皮倩雯

fix: '事件增加是否内置配置'

parent e4c07525
Pipeline #65750 passed with stages
......@@ -37,6 +37,7 @@ import {
Tooltip,
Upload,
Image,
Switch,
} from 'antd';
import {
GetCM_Event_LoadEventTypeTable,
......@@ -493,7 +494,7 @@ const AddModal = props => {
const [im, setIm] = useState();
const [previewModal, setPreviewModal] = useState(false);
const [show, setShow] = useState('hidden');
const [visibleChecked, setVisibleChecked] = useState(false);
const onSubmit = () => {
form.validateFields().then(validate => {
if (validate) {
......@@ -519,24 +520,29 @@ const AddModal = props => {
obj.Editable = editable;
}
if (ReportFromWeb === true && ReportFromMobile === true) {
obj.Reportable = '均可';
// obj.Reportable = '均可';
obj.ReportFromMobile = '手持';
obj.ReportFromWeb = '前端';
} else if (ReportFromWeb === true) {
obj.Reportable = '前端';
// obj.Reportable = '前端';
obj.ReportFromMobile = '';
obj.ReportFromWeb = '前端';
} else if (ReportFromMobile === true) {
obj.Reportable = '手持';
// obj.Reportable = '手持';
obj.ReportFromMobile = '手持';
obj.ReportFromWeb = '';
} else {
obj.Reportable = '否';
// obj.Reportable = '否';
obj.ReportFromMobile = '';
obj.ReportFromWeb = '';
}
if(visibleChecked===false){
obj.Reportable=true;
}else{
obj.Reportable=false;
}
if ((obj.Roles == '' || obj.Roles == undefined) && obj.CreateMode === '0') {
console.log(obj.CreateMode)
console.log(obj.CreateMode);
notification.warning({
message: '提示',
description: '事件权限必填',
......@@ -624,7 +630,9 @@ const AddModal = props => {
form.setFieldsValue({
ImageExpression: 'assets/images/caseCenter/events/通用问题1.png',
});
setImageUrl(`${window.location.origin}/civweb4/assets/images/caseCenter/events/通用问题1.png`);
setImageUrl(
`${window.location.origin}/civweb4/assets/images/caseCenter/events/通用问题1.png`,
);
setIm('assets/images/caseCenter/events/通用问题1.png');
} else if (type === 'edit') {
setChee();
......@@ -634,6 +642,11 @@ const AddModal = props => {
setEditable(res.data.root.Editable);
setReportFromMobile(res.data.root.ReportFromMobile);
setReportFromWeb(res.data.root.ReportFromWeb);
if(res.data.root.Reportable=== false){
setVisibleChecked(true);
}else{
setVisibleChecked(false);
}
setType1(res.data.root.BusinessType);
setOrder(res.data.root.Order);
form.setFieldsValue({ ...res.data.root });
......@@ -644,7 +657,9 @@ const AddModal = props => {
form.setFieldsValue({
ImageExpression: 'assets/images/caseCenter/events/通用问题1.png',
});
setImageUrl(`${window.location.origin}/civweb4/assets/images/caseCenter/events/通用问题1.png`);
setImageUrl(
`${window.location.origin}/civweb4/assets/images/caseCenter/events/通用问题1.png`,
);
setIm('assets/images/caseCenter/events/通用问题1.png');
}
LoadEventFields({
......@@ -1004,18 +1019,18 @@ const AddModal = props => {
arr.push(item.fieldName);
});
}
if(aa.length>0){
if (aa.length > 0) {
tempObj.内置字段 = [...aa];
}
let list ={}
Object.keys(tempObj).forEach(i=>{
console.log(i)
if(tempObj[i].length>0){
console.log(tempObj[i])
list[i]=[...tempObj[i]]
}
})
console.log(list)
let list = {};
Object.keys(tempObj).forEach(i => {
console.log(i);
if (tempObj[i].length > 0) {
console.log(tempObj[i]);
list[i] = [...tempObj[i]];
}
});
console.log(list);
return list;
};
......@@ -1344,6 +1359,10 @@ const AddModal = props => {
setShow('hidden');
};
const change = e => {
setVisibleChecked(e);
};
return (
<Drawer
title={type === 'add' ? '添加事件类型' : '编辑事件类型'}
......@@ -1534,6 +1553,16 @@ const AddModal = props => {
{/* </Item> */}
</Col>
<Col span={24}>
<Item name="Reportable" label="是否内置" labelCol={{ span: 5 }}>
<Switch
checkedChildren="是"
unCheckedChildren="否"
checked={visibleChecked}
onChange={change}
/>
</Item>
</Col>
{/* <Col span={5}>
<Item />
</Col>
......@@ -1557,10 +1586,10 @@ const AddModal = props => {
</Tooltip>
<span>上报方式</span>
</div>
}
name="CreateMode"
}
name="CreateMode"
labelCol={{ span: 5 }}
>
>
<Radio.Group onChange={onChange2} value={value} defaultValue={chee}>
<Radio value={1}>立即发起(工单模型)</Radio>
<Radio value={0}>仅上报(事件模型)</Radio>
......
......@@ -146,12 +146,12 @@ const incident = () => {
// </Tooltip>
// ),
// },
{
title: '上报',
dataIndex: 'reportable',
key: 'reportable',
width: 50,
},
// {
// title: '上报',
// dataIndex: 'reportable',
// key: 'reportable',
// width: 50,
// },
// {
// title: '上报字段',
// dataIndex: 'reportFields',
......
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