Commit 5f3f16f2 authored by 皮倩雯's avatar 皮倩雯

fix: '巡维保前端界面优化'

parent 4ff2023e
Pipeline #54018 waiting for manual action with stages
...@@ -273,33 +273,6 @@ const AddModal = props => { ...@@ -273,33 +273,6 @@ const AddModal = props => {
data[0].Config = `${data[0].Config}?${obj.filterName}`; data[0].Config = `${data[0].Config}?${obj.filterName}`;
} }
break; break;
// case '人员选择器':
// if (radio1 == '全部') {
// if (radio3 == '全部ID') {
// if (obj.ConfigName) {
// let str =
// radio == 0 ? `全部ID.${obj.ConfigName}` : `全部ID.${obj.ConfigName}.n`;
// data[0].Config = str;
// } else {
// let str = radio == 0 ? `全部ID` : `全部ID.n`;
// data[0].Config = str;
// }
// } else {
// if (obj.ConfigName) {
// let str = radio == 0 ? `全部.${obj.ConfigName}` : `全部.${obj.ConfigName}.n`;
// data[0].Config = str;
// } else {
// let str = radio == 0 ? `全部` : `全部.n`;
// data[0].Config = str;
// }
// }
// } else {
// let str = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
// console.log(str);
// data[0].Config = str;
// }
// break;
case '人员选择器': case '人员选择器':
if (checkboxAll1 == true) { if (checkboxAll1 == true) {
if (checkboxAllID1 == true) { if (checkboxAllID1 == true) {
...@@ -419,6 +392,30 @@ const AddModal = props => { ...@@ -419,6 +392,30 @@ const AddModal = props => {
? (coordinates = true) ? (coordinates = true)
: (coordinates = false); : (coordinates = false);
break; break;
case '日期时间':
case '日期':
case '日期月份':
case '日期年份':
case '日期周':
case '时分秒':
if (res[0].data.root.Config === '默认为空') {
form.setFieldsValue({
Config: '默认为空',
});
} else if (res[0].data.root.Config === '锁定为当前时间') {
form.setFieldsValue({
Config: '不可选择',
});
} else if (res[0].data.root.Config === '默认为当前时间') {
form.setFieldsValue({
Config: '默认为当前时间',
});
} else if (res[0].data.root.Config === '不超过当前时间') {
form.setFieldsValue({
Config: '不超过当前时间',
});
}
break;
case '图片': case '图片':
case '可预览图片': case '可预览图片':
res[0].data.root.Preset === '拍照相册' ? (picture = true) : (picture = false); res[0].data.root.Preset === '拍照相册' ? (picture = true) : (picture = false);
...@@ -542,66 +539,6 @@ const AddModal = props => { ...@@ -542,66 +539,6 @@ const AddModal = props => {
setRadio(0); setRadio(0);
} }
break; break;
// case '人员选择器':
// let pepole = res[0].data.root.Config.split('.');
// console.log(pepole);
// form.setFieldsValue({ ShowConfig: res[0].data.root.Config });
// if (pepole[0] == '全部') {
// setRadio1('全部');
// setRadio3('0');
// if (pepole[1] != 'n') {
// form.setFieldsValue({
// All: '全部',
// AllID: '0',
// // Config: pepole[0],
// ConfigName: pepole[1],
// });
// } else {
// form.setFieldsValue({
// All: '全部',
// AllID: '0',
// // Config: pepole[0],
// ConfigName: '',
// });
// }
// } else if (pepole[0] == '全部ID') {
// setRadio1('全部');
// setRadio3('全部ID');
// if (pepole[1] != 'n') {
// form.setFieldsValue({
// All: '全部',
// AllID: '全部ID',
// // Config: pepole[0],
// ConfigName: pepole[1],
// });
// } else {
// form.setFieldsValue({
// All: '全部',
// AllID: '全部ID',
// // Config: pepole[0],
// ConfigName: '',
// });
// }
// } else {
// setRadio1('0');
// setRadio3('0');
// form.setFieldsValue({
// All: '0',
// AllID: '0',
// Config: pepole[0],
// });
// }
// if (res[0].data.root.Config.endsWith('.n')) {
// console.log(111);
// form.setFieldsValue({ check: 1 });
// setRadio(1);
// } else {
// console.log(222);
// form.setFieldsValue({ check: 0 });
// setRadio(0);
// }
// break;
case '人员选择器': case '人员选择器':
let pepole = res[0].data.root.Config.split('.'); let pepole = res[0].data.root.Config.split('.');
console.log(pepole); console.log(pepole);
...@@ -653,11 +590,9 @@ const AddModal = props => { ...@@ -653,11 +590,9 @@ const AddModal = props => {
}); });
} }
if (res[0].data.root.Config.endsWith('.n')) { if (res[0].data.root.Config.endsWith('.n')) {
console.log(1212);
form.setFieldsValue({ choose: false }); form.setFieldsValue({ choose: false });
setCho(false); setCho(false);
} else { } else {
console.log(3434);
form.setFieldsValue({ choose: true }); form.setFieldsValue({ choose: true });
setCho(true); setCho(true);
} }
...@@ -700,16 +635,6 @@ const AddModal = props => { ...@@ -700,16 +635,6 @@ const AddModal = props => {
} }
}, [isVisible]); }, [isVisible]);
const layout = {
layout: 'horizontal',
labelCol: {
span: 3,
},
wrapperCol: {
span: 30,
},
};
const handleChange = value => { const handleChange = value => {
form.setFieldsValue({ schemename: value }); form.setFieldsValue({ schemename: value });
}; };
...@@ -1053,14 +978,39 @@ const AddModal = props => { ...@@ -1053,14 +978,39 @@ const AddModal = props => {
} else { } else {
setDetail(''); setDetail('');
} }
console.log(aa.Shape);
let coordinates = false, let coordinates = false,
picture = false, picture = false,
must = false; must = false;
switch (aa.Shape) { switch (aa.Shape) {
case '坐标控件': case '坐标控件':
aa.Config === '当前坐标' ? (coordinates = true) : (coordinates = false); aa.Config === '当前坐标' ? (coordinates = true) : (coordinates = false);
break; break;
case '日期时间':
case '日期':
case '日期月份':
case '日期年份':
case '日期周':
case '时分秒':
if (aa.Config === '默认为空') {
form.setFieldsValue({
Config: '默认为空',
});
} else if (aa.Config === '锁定为当前时间') {
form.setFieldsValue({
Config: '不可选择',
});
} else if (aa.Config === '默认为当前时间') {
form.setFieldsValue({
Config: '默认为当前时间',
});
} else if (aa.Config === '不超过当前时间') {
form.setFieldsValue({
Config: '不超过当前时间',
});
}
break;
case '图片': case '图片':
case '可预览图片': case '可预览图片':
aa.Preset === '拍照相册' ? (picture = true) : (picture = false); aa.Preset === '拍照相册' ? (picture = true) : (picture = false);
...@@ -1184,62 +1134,6 @@ const AddModal = props => { ...@@ -1184,62 +1134,6 @@ const AddModal = props => {
setRadio(0); setRadio(0);
} }
break; break;
// case '人员选择器':
// let pepole = aa.Config.split('.');
// // form.setFieldsValue({ ShowConfig: pepole });
// if (pepole[0] == '全部') {
// setRadio1('全部');
// setRadio3('0');
// if (pepole[1] != 'n') {
// form.setFieldsValue({
// All: '全部',
// AllID: '0',
// ConfigName: pepole[1],
// });
// } else {
// form.setFieldsValue({
// All: '全部',
// AllID: '0',
// ConfigName: '',
// });
// }
// } else if (pepole[0] == '全部ID') {
// setRadio1('全部');
// setRadio3('全部ID');
// if (pepole[1] != 'n') {
// form.setFieldsValue({
// All: '全部',
// AllID: '全部ID',
// ConfigName: pepole[1],
// });
// } else {
// form.setFieldsValue({
// All: '全部',
// AllID: '全部ID',
// ConfigName: '',
// });
// }
// } else {
// setRadio1('0');
// setRadio3('0');
// form.setFieldsValue({
// All: '0',
// AllID: '0',
// Config: pepole[0],
// });
// }
// if (aa.Config.endsWith('.n')) {
// form.setFieldsValue({
// check: 1,
// });
// setRadio(1);
// } else {
// form.setFieldsValue({
// check: 0,
// });
// setRadio(0);
// }
// break;
case '人员选择器': case '人员选择器':
let pepole = aa.Config.split('.'); let pepole = aa.Config.split('.');
console.log(pepole); console.log(pepole);
...@@ -1323,6 +1217,7 @@ const AddModal = props => { ...@@ -1323,6 +1217,7 @@ const AddModal = props => {
setCheckedList(res[0].data.root.ExceptionEventFields.split(',')); setCheckedList(res[0].data.root.ExceptionEventFields.split(','));
} }
setShape(res[0].data.root.Shape); setShape(res[0].data.root.Shape);
console.log(res[0].data.root.Shape);
let coordinates = false, let coordinates = false,
picture = false, picture = false,
must = false; must = false;
...@@ -1332,6 +1227,30 @@ const AddModal = props => { ...@@ -1332,6 +1227,30 @@ const AddModal = props => {
? (coordinates = true) ? (coordinates = true)
: (coordinates = false); : (coordinates = false);
break; break;
case '日期时间':
case '日期':
case '日期月份':
case '日期年份':
case '日期周':
case '时分秒':
if (res[0].data.root.Config === '默认为空') {
form.setFieldsValue({
Config: '默认为空',
});
} else if (res[0].data.root.Config === '锁定为当前时间') {
form.setFieldsValue({
Config: '不可选择',
});
} else if (res[0].data.root.Config === '默认为当前时间') {
form.setFieldsValue({
Config: '默认为当前时间',
});
} else if (res[0].data.root.Config === '不超过当前时间') {
form.setFieldsValue({
Config: '不超过当前时间',
});
}
break;
case '图片': case '图片':
case '可预览图片': case '可预览图片':
res[0].data.root.Preset === '拍照相册' ? (picture = true) : (picture = false); res[0].data.root.Preset === '拍照相册' ? (picture = true) : (picture = false);
...@@ -1456,67 +1375,6 @@ const AddModal = props => { ...@@ -1456,67 +1375,6 @@ const AddModal = props => {
setRadio(0); setRadio(0);
} }
break; break;
// case '人员选择器':
// let pepole = res[0].data.root.Config.split('.');
// // form.setFieldsValue({ ShowConfig: pepole });
// console.log(pepole);
// if (pepole[0] == '全部') {
// setRadio1('全部');
// setRadio3('全部');
// if (pepole[1] != 'n') {
// form.setFieldsValue({
// All: '全部',
// AllID: '0',
// // Config: pepole[0],
// ConfigName: pepole[1],
// });
// } else {
// form.setFieldsValue({
// All: '全部',
// AllID: '0',
// // Config: pepole[0],
// ConfigName: '',
// });
// }
// } else if (pepole[0] == '全部ID') {
// setRadio1('全部');
// setRadio3('全部ID');
// if (pepole[1] != 'n') {
// form.setFieldsValue({
// All: '全部',
// AllID: '全部ID',
// // Config: pepole[0],
// ConfigName: pepole[1],
// });
// } else {
// form.setFieldsValue({
// All: '全部',
// AllID: '全部ID',
// // Config: pepole[0],
// ConfigName: '',
// });
// }
// } else {
// setRadio1('0');
// setRadio3('0');
// form.setFieldsValue({
// All: '0',
// AllID: '0',
// Config: pepole[0],
// });
// }
// if (res[0].data.root.Config.endsWith('.n')) {
// form.setFieldsValue({
// check: 1,
// });
// setRadio(1);
// } else {
// form.setFieldsValue({
// check: 0,
// });
// setRadio(0);
// }
// break;
case '人员选择器': case '人员选择器':
let pepole = res[0].data.root.Config.split('.'); let pepole = res[0].data.root.Config.split('.');
console.log(pepole); console.log(pepole);
...@@ -1683,38 +1541,6 @@ const AddModal = props => { ...@@ -1683,38 +1541,6 @@ const AddModal = props => {
data[0].Config = `${data[0].Config}?${obj.filterName}`; data[0].Config = `${data[0].Config}?${obj.filterName}`;
} }
break; break;
// case '人员选择器':
// console.log(obj.ConfigName);
// console.log(form.getFieldValue().ConfigName);
// console.log(radio1);
// console.log(radio3);
// console.log(form.getFieldValue().All);
// console.log(form.getFieldValue().AllID);
// if (radio1 == '全部') {
// if (radio3 == '全部ID') {
// if (obj.ConfigName) {
// let str = radio == 0 ? `全部ID.${obj.ConfigName}` : `全部ID.${obj.ConfigName}.n`;
// data[0].Config = str;
// } else {
// let str = radio == 0 ? `全部ID` : `全部ID.n`;
// data[0].Config = str;
// }
// } else {
// if (obj.ConfigName) {
// let str = radio == 0 ? `全部.${obj.ConfigName}` : `全部.${obj.ConfigName}.n`;
// data[0].Config = str;
// } else {
// let str = radio == 0 ? `全部` : `全部.n`;
// data[0].Config = str;
// }
// }
// } else {
// let str = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
// console.log(str);
// data[0].Config = str;
// }
// break;
case '人员选择器': case '人员选择器':
if (checkboxAll1 == true) { if (checkboxAll1 == true) {
if (checkboxAllID1 == true) { if (checkboxAllID1 == true) {
...@@ -1970,14 +1796,10 @@ const AddModal = props => { ...@@ -1970,14 +1796,10 @@ const AddModal = props => {
}; };
const changePepole = e => { const changePepole = e => {
console.log(e.target.value);
console.log(e.target.checked);
setPep(e.target.checked); setPep(e.target.checked);
}; };
const changeChoose = e => { const changeChoose = e => {
console.log(e.target.value);
console.log(e.target.checked);
setCho(e.target.checked); setCho(e.target.checked);
}; };
...@@ -1986,13 +1808,13 @@ const AddModal = props => { ...@@ -1986,13 +1808,13 @@ const AddModal = props => {
let bb = form.getFieldsValue().Config; let bb = form.getFieldsValue().Config;
setCheckboxAll1(e.target.checked); setCheckboxAll1(e.target.checked);
if (e.target.checked == true) { if (e.target.checked == true) {
if (bb) { if (bb || bb == '' || bb == undefined) {
form.setFieldsValue({ ConfigName: bb }); form.setFieldsValue({ ConfigName: bb });
} }
setHide(false); setHide(false);
setFlag(true); setFlag(true);
} else { } else {
if (aa) { if (aa || aa == '' || bb == undefined) {
form.setFieldsValue({ Config: aa }); form.setFieldsValue({ Config: aa });
} }
setHide(true); setHide(true);
...@@ -2009,7 +1831,7 @@ const AddModal = props => { ...@@ -2009,7 +1831,7 @@ const AddModal = props => {
<> <>
<Drawer <Drawer
title="修改" title="修改"
width="900px" width="1000px"
// {...props} // {...props}
visible={isVisible} visible={isVisible}
onClose={onCancel} onClose={onCancel}
...@@ -2051,15 +1873,15 @@ const AddModal = props => { ...@@ -2051,15 +1873,15 @@ const AddModal = props => {
<Item <Item
label="字段名" label="字段名"
name="Name" name="Name"
labelCol={{ span: 3 }} labelCol={{ span: 4 }}
rules={[{ required: true, message: '请输入表名' }]} rules={[{ required: true, message: '请输入表名' }]}
> >
<Input placeholder="请输入别名" disabled style={{ width: '93%' }} /> <Input placeholder="请输入别名" disabled />
</Item> </Item>
<Item label="别名" name="Alias" labelCol={{ span: 3 }}> <Item label="别名" name="Alias" labelCol={{ span: 4 }}>
<Input placeholder="请输入别名" allowClear style={{ width: '93%' }} /> <Input placeholder="请输入别名" allowClear />
</Item> </Item>
<Item name="ReadOnly" label="属性" labelCol={{ span: 3 }}> <Item name="ReadOnly" label="属性" labelCol={{ span: 4 }}>
<div> <div>
<Checkbox <Checkbox
checked={pramData.ReadOnly} checked={pramData.ReadOnly}
...@@ -2075,7 +1897,7 @@ const AddModal = props => { ...@@ -2075,7 +1897,7 @@ const AddModal = props => {
</Checkbox> </Checkbox>
</div> </div>
</Item> </Item>
<Item label="同步" name="SyncEvent" labelCol={{ span: 3 }}> <Item label="同步" name="SyncEvent" labelCol={{ span: 4 }}>
<Radio.Group> <Radio.Group>
<Radio value={0} style={{ marginRight: '0.5rem' }}> <Radio value={0} style={{ marginRight: '0.5rem' }}>
不同步 不同步
...@@ -2088,8 +1910,8 @@ const AddModal = props => { ...@@ -2088,8 +1910,8 @@ const AddModal = props => {
</Item> </Item>
<Row> <Row>
{/* <Col span={1} /> */} {/* <Col span={1} /> */}
<Col span={15}> <Col span={16}>
<Item label="形态" labelCol={{ span: 5 }}> <Item label="形态" labelCol={{ span: 6 }}>
<div className={styles.listEvent}> <div className={styles.listEvent}>
<TreeSelect <TreeSelect
style={{ width: '95%' }} style={{ width: '95%' }}
...@@ -2134,13 +1956,13 @@ const AddModal = props => { ...@@ -2134,13 +1956,13 @@ const AddModal = props => {
</Col> </Col>
<Col span={5}> <Col span={5}>
<Item label="单位" name="Unit" labelCol={{ span: 7 }}> <Item label="单位" name="Unit" labelCol={{ span: 10 }}>
<Input style={{ width: '95%' }} placeholder="" /> <Input style={{ width: '95%' }} placeholder="" />
</Item> </Item>
</Col> </Col>
<Col span={3}> <Col span={3}>
<Item label="宽" name="RowSpan" labelCol={{ span: 7 }}> <Item label="宽" name="RowSpan" labelCol={{ span: 8 }}>
<Input style={{ width: '87%' }} placeholder="" /> <Input placeholder="" />
</Item> </Item>
</Col> </Col>
</Row> </Row>
...@@ -2151,10 +1973,10 @@ const AddModal = props => { ...@@ -2151,10 +1973,10 @@ const AddModal = props => {
case '编码': case '编码':
return ( return (
<> <>
<Item label="前缀" name="prefix" labelCol={{ span: 3 }}> <Item label="前缀" name="prefix" labelCol={{ span: 4 }}>
<Input style={{ width: '93%' }} placeholder="" allowClear /> <Input placeholder="" allowClear />
</Item> </Item>
<Item label="编码方式" name="code" labelCol={{ span: 3 }}> <Item label="编码方式" name="code" labelCol={{ span: 4 }}>
<Radio.Group> <Radio.Group>
<Radio value="年份编码" style={{ marginRight: '0.5rem' }}> <Radio value="年份编码" style={{ marginRight: '0.5rem' }}>
XJ-2019-000001(前缀-年份-六位编码) XJ-2019-000001(前缀-年份-六位编码)
...@@ -2174,10 +1996,9 @@ const AddModal = props => { ...@@ -2174,10 +1996,9 @@ const AddModal = props => {
return ( return (
<> <>
{' '} {' '}
<Item label="可选值" name="Config" labelCol={{ span: 3 }}> <Item label="可选值" name="Config" labelCol={{ span: 4 }}>
<TextArea <TextArea
allowClear allowClear
style={{ width: '93%' }}
placeholder="用英文逗号分隔自定义的值,可设置初始值" placeholder="用英文逗号分隔自定义的值,可设置初始值"
/> />
</Item> </Item>
...@@ -2206,10 +2027,9 @@ const AddModal = props => { ...@@ -2206,10 +2027,9 @@ const AddModal = props => {
return ( return (
<> <>
{' '} {' '}
<Item label="可选值" name="Config" labelCol={{ span: 3 }}> <Item label="可选值" name="Config" labelCol={{ span: 4 }}>
<TextArea <TextArea
allowClear allowClear
style={{ width: '93%' }}
placeholder="用英文逗号分隔自定义的值,可编辑,可设置初始值" placeholder="用英文逗号分隔自定义的值,可编辑,可设置初始值"
/> />
</Item> </Item>
...@@ -2219,19 +2039,13 @@ const AddModal = props => { ...@@ -2219,19 +2039,13 @@ const AddModal = props => {
return ( return (
<> <>
{' '} {' '}
<Item <Item label="可选值" name="Config" labelCol={{ span: 4 }}>
label="可选值"
name="Config"
labelCol={{ span: 3 }}
// rules={[{ required: true, message: '请输入表名' }]}
>
<TextArea <TextArea
allowClear allowClear
style={{ width: '93%' }}
placeholder="用英文逗号分隔自定义的值,勾选,可设置初始值" placeholder="用英文逗号分隔自定义的值,勾选,可设置初始值"
/> />
</Item> </Item>
<Item colon={false} name="check" label="配置:" labelCol={{ span: 3 }}> <Item colon={false} name="check" label="配置:" labelCol={{ span: 4 }}>
<Radio.Group onChange={onChange2} value={radio} defaultValue={chee}> <Radio.Group onChange={onChange2} value={radio} defaultValue={chee}>
<Radio value={0}>单选</Radio> <Radio value={0}>单选</Radio>
<Radio value={1}>多选</Radio> <Radio value={1}>多选</Radio>
...@@ -2242,7 +2056,7 @@ const AddModal = props => { ...@@ -2242,7 +2056,7 @@ const AddModal = props => {
case '图片': case '图片':
// case '可预览图片': // case '可预览图片':
return ( return (
<Item name="ReadOnly" label="选项" labelCol={{ span: 3 }}> <Item name="ReadOnly" label="选项" labelCol={{ span: 4 }}>
<div> <div>
<Checkbox <Checkbox
checked={pramData.picture} checked={pramData.picture}
...@@ -2266,20 +2080,20 @@ const AddModal = props => { ...@@ -2266,20 +2080,20 @@ const AddModal = props => {
<Item <Item
label="表名" label="表名"
name="tableName" name="tableName"
labelCol={{ span: 6 }} labelCol={{ span: 8 }}
rules={[{ required: true, message: '请输入表名' }]} rules={[{ required: true, message: '请输入表名' }]}
> >
<Input style={{ width: '95%' }} placeholder="请输入表名" /> <Input placeholder="请输入表名" />
</Item> </Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Item <Item
label="字段名" label="字段名"
name="fieldName" name="fieldName"
labelCol={{ span: 5 }} labelCol={{ span: 8 }}
rules={[{ required: true, message: '请输入表名' }]} rules={[{ required: true, message: '请输入表名' }]}
> >
<Input style={{ width: '85%' }} placeholder="请输入字段名" /> <Input placeholder="请输入字段名" />
</Item> </Item>
</Col> </Col>
</Row> </Row>
...@@ -2292,24 +2106,24 @@ const AddModal = props => { ...@@ -2292,24 +2106,24 @@ const AddModal = props => {
<Item <Item
label="表名" label="表名"
name="tableName" name="tableName"
labelCol={{ span: 6 }} labelCol={{ span: 8 }}
rules={[{ required: true, message: '请输入表名' }]} rules={[{ required: true, message: '请输入表名' }]}
> >
<Input style={{ width: '95%' }} placeholder="请输入表名" /> <Input placeholder="请输入表名" />
</Item> </Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Item <Item
label="字段名" label="字段名"
name="fieldName" name="fieldName"
labelCol={{ span: 5 }} labelCol={{ span: 8 }}
rules={[{ required: true, message: '请输入表名' }]} rules={[{ required: true, message: '请输入表名' }]}
> >
<Input style={{ width: '85%' }} placeholder="请输入字段名" /> <Input placeholder="请输入字段名" />
</Item> </Item>
</Col> </Col>
</Row> </Row>
<Item colon={false} name="check" label="配置:" labelCol={{ span: 3 }}> <Item colon={false} name="check" label="配置:" labelCol={{ span: 4 }}>
<Radio.Group onChange={onChange2} value={radio} defaultValue={chee}> <Radio.Group onChange={onChange2} value={radio} defaultValue={chee}>
<Radio value={0}>单选</Radio> <Radio value={0}>单选</Radio>
<Radio value={1}>多选</Radio> <Radio value={1}>多选</Radio>
...@@ -2323,14 +2137,10 @@ const AddModal = props => { ...@@ -2323,14 +2137,10 @@ const AddModal = props => {
<Item <Item
label="配置" label="配置"
name="Config" name="Config"
labelCol={{ span: 3 }} labelCol={{ span: 4 }}
// rules={[{ required: true, message: '请输入数据字典名称' }]} // rules={[{ required: true, message: '请输入数据字典名称' }]}
> >
<TextArea <TextArea allowClear placeholder="请输入数据字典名称" />
allowClear
style={{ width: '93%' }}
placeholder="请输入数据字典名称"
/>
</Item> </Item>
</> </>
); );
...@@ -2340,16 +2150,12 @@ const AddModal = props => { ...@@ -2340,16 +2150,12 @@ const AddModal = props => {
<Item <Item
label="数据字典名称" label="数据字典名称"
name="Config" name="Config"
labelCol={{ span: 7 }} labelCol={{ span: 4 }}
// rules={[{ required: true, message: '请输入数据字典名称' }]} // rules={[{ required: true, message: '请输入数据字典名称' }]}
> >
<Input <Input allowClear placeholder="请输入数据字典名称" />
allowClear
style={{ width: '92%' }}
placeholder="请输入数据字典名称"
/>
</Item> </Item>
<Item colon={false} name="check" label="配置:" labelCol={{ span: 7 }}> <Item colon={false} name="check" label="配置:" labelCol={{ span: 4 }}>
<Radio.Group onChange={onChange2} value={radio} defaultValue={chee}> <Radio.Group onChange={onChange2} value={radio} defaultValue={chee}>
<Radio value={0}>单选</Radio> <Radio value={0}>单选</Radio>
<Radio value={1}>多选</Radio> <Radio value={1}>多选</Radio>
...@@ -2360,7 +2166,7 @@ const AddModal = props => { ...@@ -2360,7 +2166,7 @@ const AddModal = props => {
case '部门选择器': case '部门选择器':
return ( return (
<> <>
<Item colon={false} name="check" label="配置:" labelCol={{ span: 3 }}> <Item colon={false} name="check" label="配置:" labelCol={{ span: 4 }}>
<Radio.Group onChange={onChange2} value={radio} defaultValue={chee}> <Radio.Group onChange={onChange2} value={radio} defaultValue={chee}>
<Radio value={0}>单选</Radio> <Radio value={0}>单选</Radio>
<Radio value={1}>多选</Radio> <Radio value={1}>多选</Radio>
...@@ -2370,24 +2176,7 @@ const AddModal = props => { ...@@ -2370,24 +2176,7 @@ const AddModal = props => {
); );
case '站点选择器': case '站点选择器':
return ( return (
<Item <Item name="Config" labelCol={{ span: 4 }} label="配置">
name="Config"
labelCol={{ span: 3 }}
// label={
// <div>
// <Tooltip title="默认全局多选">
// <InfoCircleOutlined
// style={{
// color: 'rgb(24 144 255)',
// marginRight: '2px',
// }}
// />
// </Tooltip>
// <span>配置</span>
// </div>
// }
label="配置"
>
<div style={{ display: 'inline-block' }}> <div style={{ display: 'inline-block' }}>
<Item name="pepole" style={{ marginBottom: '0' }}> <Item name="pepole" style={{ marginBottom: '0' }}>
<Checkbox <Checkbox
...@@ -2416,7 +2205,7 @@ const AddModal = props => { ...@@ -2416,7 +2205,7 @@ const AddModal = props => {
return ( return (
<> <>
<Row> <Row>
<Col span={12}> <Col span={16}>
<Item <Item
label="台账名" label="台账名"
name="standingBook" name="standingBook"
...@@ -2434,23 +2223,20 @@ const AddModal = props => { ...@@ -2434,23 +2223,20 @@ const AddModal = props => {
</Select> </Select>
</Item> </Item>
</Col> </Col>
<Col span={12}> <Col span={8}>
<Item <Item
label="字段名" label="字段名"
name="fieldName" name="fieldName"
labelCol={{ span: 5 }} labelCol={{ span: 8 }}
rules={[{ required: true, message: '请输入字段名' }]} rules={[{ required: true, message: '请输入字段名' }]}
> >
<Input style={{ width: '85%' }} placeholder="请输入字段名" /> <Input placeholder="请输入字段名" />
</Item> </Item>
</Col> </Col>
</Row> </Row>
{/* <Col span={12}> */} {/* <Col span={12}> */}
<Item label="台账过滤" name="filterName" labelCol={{ span: 3 }}> <Item label="SQL过滤" name="filterName" labelCol={{ span: 4 }}>
<TextArea <TextArea placeholder="示例:部门='研发一部'" />
style={{ width: '93%' }}
placeholder="示例:部门='研发一部'"
/>
</Item> </Item>
{/* </Col> */} {/* </Col> */}
...@@ -2466,7 +2252,7 @@ const AddModal = props => { ...@@ -2466,7 +2252,7 @@ const AddModal = props => {
</Item> </Item>
</Col> */} </Col> */}
<Item colon={false} name="check" label="配置:" labelCol={{ span: 3 }}> <Item colon={false} name="check" label="配置:" labelCol={{ span: 4 }}>
<Radio.Group onChange={onChange2} value={radio} defaultValue={chee}> <Radio.Group onChange={onChange2} value={radio} defaultValue={chee}>
<Radio value={0}>单选</Radio> <Radio value={0}>单选</Radio>
<Radio value={1}>多选</Radio> <Radio value={1}>多选</Radio>
...@@ -2477,119 +2263,8 @@ const AddModal = props => { ...@@ -2477,119 +2263,8 @@ const AddModal = props => {
case '人员选择器': case '人员选择器':
return ( return (
<> <>
{/* <Item colon={false} label="全部:" name="All" labelCol={{ span: 3 }}>
<Radio.Group onChange={onChange1} value={radio1}>
<Radio value="0">否</Radio>
<Radio value="全部">是</Radio>
</Radio.Group>
</Item> */}
{/* {(() => {
switch (radio1) {
case '全部':
return (
<>
<Item
colon={false}
label="全部ID:"
name="AllID"
labelCol={{ span: 3 }}
>
<Radio.Group onChange={onChange3} value={radio3}>
<Radio value="0">否</Radio>
<Radio value="全部ID">是</Radio>
</Radio.Group>
</Item>
<Item
colon={false}
name="check"
label="形态功能:"
labelCol={{ span: 3 }}
>
<Radio.Group onChange={onChange2} value={radio}>
<Radio value={0}>单选</Radio>
<Radio value={1}>多选</Radio>
</Radio.Group>
</Item>
<Item
label="角色或机构名称"
name="ConfigName"
labelCol={{ span: 5 }}
rules={[
{
validator: (rule, value) => {
let str = /[.]/g;
if (str.test(form.getFieldValue().ConfigName)) {
return Promise.reject('.作为分隔符,请勿输入');
}
return Promise.resolve();
},
},
]}
>
<Input
allowClear
style={{ width: '92%' }}
placeholder="请输入角色或机构名称"
onChange={inputOnChange}
/>
</Item>
<Item label="配置" name="ShowConfig" labelCol={{ span: 5 }}>
<Input allowClear style={{ width: '92%' }} disabled />
</Item>
</>
);
case '0':
return (
<>
<Item
colon={false}
name="check"
label="形态功能:"
labelCol={{ span: 3 }}
>
<Radio.Group onChange={onChange2} value={radio}>
<Radio value={0}>单选</Radio>
<Radio value={1}>多选</Radio>
</Radio.Group>
</Item>
<Item
label="角色或机构或部门名称"
name="Config"
labelCol={{ span: 7 }}
rules={[
{
required: true,
message: '请输入角色或机构或部门名称',
},
{
validator: (rule, value) => {
let str = /[.]/g;
if (str.test(form.getFieldValue().Config)) {
return Promise.reject('.作为分隔符,请勿输入');
}
return Promise.resolve();
},
},
]}
>
<Input
allowClear
style={{ width: '93%' }}
placeholder="请输入角色或机构或部门名称"
onChange={inputOnchange}
/>
</Item>
<Item label="配置" name="ShowConfig" labelCol={{ span: 5 }}>
<Input allowClear style={{ width: '92%' }} disabled />
</Item>
</>
);
}
})()} */}
<Item <Item
labelCol={{ span: 3 }} labelCol={{ span: 4 }}
label={ label={
<div> <div>
<Tooltip <Tooltip
...@@ -2660,18 +2335,6 @@ const AddModal = props => { ...@@ -2660,18 +2335,6 @@ const AddModal = props => {
</Checkbox> </Checkbox>
</Item> </Item>
</div> </div>
{/* <div style={{ display: 'inline-block', marginRight: '10px' }}>
<Item name="department" style={{ marginBottom: '0' }}>
<Checkbox
checked={checkboxAllID1}
onChange={changeAllID1}
style={{ marginBottom: '0' }}
disabled={hide}
>
展示部门
</Checkbox>
</Item>
</div> */}
</Item> </Item>
{(() => { {(() => {
switch (flag) { switch (flag) {
...@@ -2681,7 +2344,7 @@ const AddModal = props => { ...@@ -2681,7 +2344,7 @@ const AddModal = props => {
<Item <Item
label="角色|机构" label="角色|机构"
name="ConfigName" name="ConfigName"
labelCol={{ span: 3 }} labelCol={{ span: 4 }}
rules={[ rules={[
{ {
validator: (rule, value) => { validator: (rule, value) => {
...@@ -2696,7 +2359,6 @@ const AddModal = props => { ...@@ -2696,7 +2359,6 @@ const AddModal = props => {
> >
<Input <Input
allowClear allowClear
style={{ width: '93%' }}
placeholder="请输入角色或机构名称" placeholder="请输入角色或机构名称"
onChange={inputOnChange} onChange={inputOnChange}
/> />
...@@ -2709,7 +2371,7 @@ const AddModal = props => { ...@@ -2709,7 +2371,7 @@ const AddModal = props => {
<Item <Item
label="角色|机构" label="角色|机构"
name="Config" name="Config"
labelCol={{ span: 3 }} labelCol={{ span: 4 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -2728,7 +2390,6 @@ const AddModal = props => { ...@@ -2728,7 +2390,6 @@ const AddModal = props => {
> >
<Input <Input
allowClear allowClear
style={{ width: '93%' }}
placeholder="请输入角色或机构名称" placeholder="请输入角色或机构名称"
onChange={inputOnchange} onChange={inputOnchange}
/> />
...@@ -2747,7 +2408,7 @@ const AddModal = props => { ...@@ -2747,7 +2408,7 @@ const AddModal = props => {
case '日期周': case '日期周':
case '时分秒': case '时分秒':
return ( return (
<Item label="选项" name="Config" labelCol={{ span: 3 }}> <Item label="选项" name="Config" labelCol={{ span: 4 }}>
<Radio.Group <Radio.Group
style={{ marginTop: '0.3rem' }} style={{ marginTop: '0.3rem' }}
value={timeData} value={timeData}
...@@ -2769,7 +2430,7 @@ const AddModal = props => { ...@@ -2769,7 +2430,7 @@ const AddModal = props => {
); );
case '坐标控件': case '坐标控件':
return ( return (
<Item label="选项" name="Config" labelCol={{ span: 3 }}> <Item label="选项" name="Config" labelCol={{ span: 4 }}>
<div> <div>
<Checkbox <Checkbox
value="当前坐标" value="当前坐标"
...@@ -2783,7 +2444,7 @@ const AddModal = props => { ...@@ -2783,7 +2444,7 @@ const AddModal = props => {
); );
case '位置坐标': case '位置坐标':
return ( return (
<Item label="字段名称" name="Config" labelCol={{ span: 3 }}> <Item label="字段名称" name="Config" labelCol={{ span: 4 }}>
<Input <Input
allowClear allowClear
style={{ width: '93%' }} style={{ width: '93%' }}
...@@ -2809,8 +2470,8 @@ const AddModal = props => { ...@@ -2809,8 +2470,8 @@ const AddModal = props => {
return <></>; return <></>;
default: default:
return ( return (
<Item label="配置" name="Config" labelCol={{ span: 3 }}> <Item label="配置" name="Config" labelCol={{ span: 4 }}>
<TextArea allowClear style={{ width: '93%' }} placeholder={detail} /> <TextArea allowClear placeholder={detail} />
</Item> </Item>
); );
} }
...@@ -2819,7 +2480,7 @@ const AddModal = props => { ...@@ -2819,7 +2480,7 @@ const AddModal = props => {
{Shape === '图片' || Shape === '可预览图片' ? ( {Shape === '图片' || Shape === '可预览图片' ? (
'' ''
) : ( ) : (
<Item label="预设值" labelCol={{ span: 3 }}> <Item label="预设值" labelCol={{ span: 4 }}>
{/* <div className={styles.listEvent}> */} {/* <div className={styles.listEvent}> */}
<Row> <Row>
<Col span={10}> <Col span={10}>
...@@ -2835,7 +2496,7 @@ const AddModal = props => { ...@@ -2835,7 +2496,7 @@ const AddModal = props => {
<Item <Item
style={{ marginLeft: '1rem' }} style={{ marginLeft: '1rem' }}
label="验证" label="验证"
labelCol={{ span: 5 }} labelCol={{ span: 8 }}
name="ValidationRule" name="ValidationRule"
> >
<Input style={{ width: '92%' }} placeholder="" allowClear /> <Input style={{ width: '92%' }} placeholder="" allowClear />
......
/* eslint-disable indent */
/* eslint-disable camelcase */
/* eslint-disable no-unused-expressions */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { import {
Drawer, Drawer,
...@@ -11,9 +14,10 @@ import { ...@@ -11,9 +14,10 @@ import {
Dropdown, Dropdown,
Menu, Menu,
Space, Space,
Radio,
} from 'antd'; } from 'antd';
import { PlusOutlined, DownOutlined, StepForwardFilled } from '@ant-design/icons';
import styles from './maintenance.less'; import styles from './maintenance.less';
import ModalDrag from './ModalDrag';
import { import {
CM_XWBPlan_AccountTable, CM_XWBPlan_AccountTable,
CM_XWBPlan_feedbackTable, CM_XWBPlan_feedbackTable,
...@@ -21,7 +25,7 @@ import { ...@@ -21,7 +25,7 @@ import {
CM_XWBPlan_DataList, CM_XWBPlan_DataList,
} from '@/services/maintenance/api'; } from '@/services/maintenance/api';
import { CM_Event_LoadDepartmentAndRoles } from '@/services/standingBook/api'; import { CM_Event_LoadDepartmentAndRoles } from '@/services/standingBook/api';
import { PlusOutlined, DownOutlined, StepForwardFilled } from '@ant-design/icons';
import ChangeAdd from './ChangeAdd'; import ChangeAdd from './ChangeAdd';
const { Option } = Select; const { Option } = Select;
...@@ -45,28 +49,35 @@ const AddModal = props => { ...@@ -45,28 +49,35 @@ const AddModal = props => {
const [checkedList1, setCheckedList1] = useState([]); // 最新选择数据 const [checkedList1, setCheckedList1] = useState([]); // 最新选择数据
const [characterValue, setCharacterValue] = useState(''); // 打开弹框之前数据 const [characterValue, setCharacterValue] = useState(''); // 打开弹框之前数据
const [ff, setFf] = useState([]); const [ff, setFf] = useState([]);
const [chee, setChee] = useState('');
const [form] = Form.useForm(); const [form] = Form.useForm();
const { Item } = Form; const { Item } = Form;
const { TextArea } = Input; const { TextArea } = Input;
useEffect(() => { useEffect(() => {
getRole(); if (visible) {
if (type === 'add') { getRole();
setType1(''); if (type === 'add') {
setType2(''); setChee('否');
setInputValue({ feedbackName: '', doRole: '' }); form.setFieldsValue({ isSubmit: '否', docycle: '一周一次' });
setFiled1({}); setType1('');
setType2('');
setInputValue({ feedbackName: '', doRole: '' });
setFiled1({});
} else if (type === 'edit') {
CM_XWBPlan_DataList({ id: formObj.id }).then(res => {
let data = res.data[0];
data && form.setFieldsValue({ ...data });
setInputValue({ ...data });
console.log(data.businessTypee);
setType1(data.businessType);
setType2(data.accountName);
});
}
} else {
setChee('');
form.resetFields(); form.resetFields();
} else if (type === 'edit') {
CM_XWBPlan_DataList({ id: formObj.id }).then(res => {
let data = res.data[0];
data && form.setFieldsValue({ ...data });
setInputValue({ ...data });
console.log(data.businessTypee);
setType1(data.businessType);
setType2(data.accountName);
});
} }
}, [visible]); }, [visible]);
...@@ -270,12 +281,19 @@ const AddModal = props => { ...@@ -270,12 +281,19 @@ const AddModal = props => {
setInputValue(inputText); setInputValue(inputText);
}; };
// const title = <ModalDrag title="巡维保计划配置" /> // const title = <ModalDrag title="巡维保计划配置" />
const inputType = value => {
console.log(value);
if (value) {
form.setFieldsValue({ businessType: value });
}
};
return ( return (
<Drawer <Drawer
title="巡维保计划配置" title="巡维保计划配置"
visible={visible} visible={visible}
destroyOnClose destroyOnClose
width="600px" width="650px"
{...props} {...props}
footer={ footer={
<Space> <Space>
...@@ -318,22 +336,15 @@ const AddModal = props => { ...@@ -318,22 +336,15 @@ const AddModal = props => {
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={23}>
<span
style={{
position: 'absolute',
left: '1%',
top: '9%',
color: 'red',
fontSize: '16px',
}}
>
*
</span>
<Item <Item
label="业务类型" label="业务类型"
name="businessType" name="businessType"
labelCol={{ span: 4 }} labelCol={{ span: 4 }}
rules={[ rules={[
{
required: true,
message: '请输入业务名称',
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
if (form.getFieldsValue().businessType == '') { if (form.getFieldsValue().businessType == '') {
...@@ -344,67 +355,15 @@ const AddModal = props => { ...@@ -344,67 +355,15 @@ const AddModal = props => {
}, },
]} ]}
> >
<div> <Select placeholder="选择业务类型" onSearch={inputType} showSearch>
<Input <Option value="巡检">巡检</Option>
className="ue-editable-select-input" <Option value="保养">保养</Option>
onChange={inputType1} </Select>
value={Type1}
placeholder="选择或手动输入业务类型"
/>
<Dropdown
placement="bottomRight"
style={{ width: '430px' }}
overlay={
<Menu>
<Menu.Item
key="巡检"
onClick={() => {
setType1('巡检');
form.setFieldsValue({ businessType: '巡检' });
}}
style={{ width: '430px', marginLeft: '-8px' }}
>
巡检
</Menu.Item>
<Menu.Item
key="保养"
onClick={() => {
setType1('保养');
form.setFieldsValue({ businessType: '保养' });
}}
style={{ width: '430px', marginLeft: '-8px' }}
>
保养
</Menu.Item>
</Menu>
}
>
<div className={styles.linkDrowp} onClick={e => e.preventDefault()}>
<DownOutlined
style={{
fontSize: '12px',
color: 'rgba(0, 0, 0, 0.25)',
marginLeft: '5px',
}}
/>
</div>
</Dropdown>
</div>
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={23}>
<Item <Item label="执行周期" name="docycle" labelCol={{ span: 4 }}>
label="执行周期" <Select placeholder="选择计划执行周期">
name="docycle"
labelCol={{ span: 4 }}
rules={[
{
required: true,
message: '请选择执行周期',
},
]}
>
<Select placeholder="选择计划执行周期" onChange={changTable} value={selectValue}>
<Option value="一周一次">一周一次</Option> <Option value="一周一次">一周一次</Option>
<Option value="半月一次">半月一次</Option> <Option value="半月一次">半月一次</Option>
<Option value="一月一次">一月一次</Option> <Option value="一月一次">一月一次</Option>
...@@ -415,22 +374,15 @@ const AddModal = props => { ...@@ -415,22 +374,15 @@ const AddModal = props => {
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={23}>
<span
style={{
position: 'absolute',
left: '1%',
top: '9%',
color: 'red',
fontSize: '16px',
}}
>
*
</span>
<Item <Item
label="台账名称" label="台账名称"
name="accountName" name="accountName"
labelCol={{ span: 4 }} labelCol={{ span: 4 }}
rules={[ rules={[
{
required: true,
message: '请输入业务名称',
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
if (form.getFieldsValue().accountName == '') { if (form.getFieldsValue().accountName == '') {
...@@ -441,73 +393,27 @@ const AddModal = props => { ...@@ -441,73 +393,27 @@ const AddModal = props => {
}, },
]} ]}
> >
<div> <Select placeholder="选择此计划关联的设备台账名称" showSearch>
<Input {treeData
className="ue-editable-select-input" ? treeData.map((item, index) => (
onChange={inputType2} <Option key={index} value={item}>
value={Type2} {item}
placeholder="选择此计划关联的设备台账名称" </Option>
/> ))
<Dropdown : ''}
placement="bottomRight" </Select>
style={{ width: '430px' }}
overlay={
<Menu>
{treeData.length ? (
treeData.map((item, index) => {
return (
<Menu.Item
onClick={() => {
setType2(item);
form.setFieldsValue({ accountName: item });
}}
style={{ width: '430px', marginLeft: '-8px' }}
key={index}
>
{item}
</Menu.Item>
);
})
) : (
<Menu.Item style={{ width: '430px', marginLeft: '-8px' }}>
<span style={{ color: 'red' }}>
暂无数据,请先配置台账管理台账名称为设备
</span>
</Menu.Item>
)}
</Menu>
}
>
<div className={styles.linkDrowp} onClick={e => e.preventDefault()}>
<DownOutlined
style={{
fontSize: '12px',
color: 'rgba(0, 0, 0, 0.25)',
marginLeft: '5px',
}}
/>
</div>
</Dropdown>
</div>
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={23}>
<span
style={{
position: 'absolute',
left: '1%',
top: '9%',
color: 'red',
fontSize: '16px',
}}
>
*
</span>
<Item <Item
label="反馈名称" label="反馈名称"
name="feedbackName" name="feedbackName"
labelCol={{ span: 4 }} labelCol={{ span: 4 }}
rules={[ rules={[
{
required: true,
message: '请输入业务名称',
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
if (inputValue.feedbackName == '') { if (inputValue.feedbackName == '') {
...@@ -530,28 +436,21 @@ const AddModal = props => { ...@@ -530,28 +436,21 @@ const AddModal = props => {
type="dashed" type="dashed"
onClick={() => pickFiled('feedbackName')} onClick={() => pickFiled('feedbackName')}
icon={<PlusOutlined style={{ marginTop: '5px' }} />} icon={<PlusOutlined style={{ marginTop: '5px' }} />}
style={{ marginLeft: '0.5rem', width: '4rem' }} style={{ marginLeft: '10px', width: '70px' }}
/> />
</div> </div>
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={23}>
<span
style={{
position: 'absolute',
left: '1%',
top: '9%',
color: 'red',
fontSize: '16px',
}}
>
*
</span>
<Item <Item
label="执行角色" label="执行角色"
name="doRole" name="doRole"
labelCol={{ span: 4 }} labelCol={{ span: 4 }}
rules={[ rules={[
{
required: true,
message: '请输入业务名称',
},
{ {
validator: (rule, value) => { validator: (rule, value) => {
if (inputValue.doRole == '') { if (inputValue.doRole == '') {
...@@ -574,7 +473,7 @@ const AddModal = props => { ...@@ -574,7 +473,7 @@ const AddModal = props => {
type="dashed" type="dashed"
onClick={() => pickFiled1('doRole')} onClick={() => pickFiled1('doRole')}
icon={<PlusOutlined style={{ marginTop: '5px' }} />} icon={<PlusOutlined style={{ marginTop: '5px' }} />}
style={{ marginLeft: '0.5rem', width: '4rem' }} style={{ marginLeft: '10px', width: '70px' }}
/> />
</div> </div>
</Item> </Item>
...@@ -609,25 +508,15 @@ const AddModal = props => { ...@@ -609,25 +508,15 @@ const AddModal = props => {
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={23}>
<Item <Item label="是否送审" name="isSubmit" labelCol={{ span: 4 }}>
label="是否送审" <Radio.Group defaultValue={chee}>
name="isSubmit" <Radio value="否"></Radio>
labelCol={{ span: 4 }} <Radio value="是"></Radio>
rules={[ </Radio.Group>
{
required: true,
message: '请选择是否送审',
},
]}
>
<Select placeholder="是否送审" onChange={changTable1} value={selectValue1}>
<Option value="否"></Option>
<Option value="是"></Option>
</Select>
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={23}>
<Item label="台账过滤条件" name="filterCondition" labelCol={{ span: 4 }}> <Item label="SQL过滤" name="filterCondition" labelCol={{ span: 4 }}>
<TextArea placeholder="例如:and 泵房品牌='熊猫'" /> <TextArea placeholder="例如:and 泵房品牌='熊猫'" />
</Item> </Item>
</Col> </Col>
......
...@@ -88,6 +88,7 @@ const ChangeAdd = props => { ...@@ -88,6 +88,7 @@ const ChangeAdd = props => {
console.log(indeterminate); console.log(indeterminate);
if (type == 'edit') { if (type == 'edit') {
if (isType != '' && isType === 'add') { if (isType != '' && isType === 'add') {
// 反馈名称
let checkArr = []; let checkArr = [];
console.log(newCheckedList); console.log(newCheckedList);
newCheckedList.map(checkItem => { newCheckedList.map(checkItem => {
...@@ -96,11 +97,12 @@ const ChangeAdd = props => { ...@@ -96,11 +97,12 @@ const ChangeAdd = props => {
} }
}); });
setCheckedList(checkArr); setCheckedList(checkArr);
setIndeterminate(!!newCheckedList.length && newCheckedList.length < filed.length); setIndeterminate(!!checkArr.length && checkArr.length < filed.length);
setCheckAll(newCheckedList.length === filed.length); setCheckAll(checkArr.length === filed.length);
let newArr = characterValue.length ? characterValue.split(',') : []; let newArr = characterValue.length ? characterValue.split(',') : [];
setSelectData(newArr); setSelectData(newArr);
} else if (isType === 'app') { } else if (isType === 'app') {
// 执行角色
let checkArr = []; let checkArr = [];
console.log(newCheckedList); console.log(newCheckedList);
newCheckedList.map(checkItem => { newCheckedList.map(checkItem => {
...@@ -109,26 +111,30 @@ const ChangeAdd = props => { ...@@ -109,26 +111,30 @@ const ChangeAdd = props => {
} }
}); });
setCheckedList(checkArr); setCheckedList(checkArr);
setIndeterminate(!!newCheckedList.length && newCheckedList.length < ff.length); setIndeterminate(!!checkArr.length && checkArr.length < ff.length);
setCheckAll(newCheckedList.length === ff.length); setCheckAll(checkArr.length === ff.length);
let newArr = characterValue.length ? characterValue.split(',') : []; let newArr = characterValue.length ? characterValue.split(',') : [];
setSelectData(newArr); setSelectData(newArr);
} }
} else { } else {
if (isType != '' && isType === 'add') { if (isType != '' && isType === 'add') {
// 反馈名称
let checkArr = []; let checkArr = [];
console.log(filed);
console.log(newCheckedList); console.log(newCheckedList);
newCheckedList.map(checkItem => { newCheckedList.map(checkItem => {
if (filed.includes(checkItem)) { if (filed.includes(checkItem)) {
checkArr.push(checkItem); checkArr.push(checkItem);
} }
}); });
console.log(checkArr);
setCheckedList(checkArr); setCheckedList(checkArr);
setIndeterminate(false); setIndeterminate(!!checkArr.length && checkArr.length < filed.length);
setCheckAll(false); setCheckAll(checkArr.length === filed.length);
let newArr = characterValue.length ? characterValue.split(',') : []; let newArr = characterValue.length ? characterValue.split(',') : [];
setSelectData(newArr); setSelectData(newArr);
} else if (isType === 'app') { } else if (isType === 'app') {
// 执行角色
let checkArr = []; let checkArr = [];
console.log(newCheckedList); console.log(newCheckedList);
newCheckedList.map(checkItem => { newCheckedList.map(checkItem => {
...@@ -137,8 +143,8 @@ const ChangeAdd = props => { ...@@ -137,8 +143,8 @@ const ChangeAdd = props => {
} }
}); });
setCheckedList(checkArr); setCheckedList(checkArr);
setIndeterminate(false); setIndeterminate(!!checkArr.length && checkArr.length < ff.length);
setCheckAll(false); setCheckAll(checkArr.length === ff.length);
let newArr = characterValue.length ? characterValue.split(',') : []; let newArr = characterValue.length ? characterValue.split(',') : [];
setSelectData(newArr); setSelectData(newArr);
} }
......
...@@ -48,7 +48,7 @@ const maintenance = () => { ...@@ -48,7 +48,7 @@ const maintenance = () => {
title: '业务类型', title: '业务类型',
dataIndex: 'businessType', dataIndex: 'businessType',
key: 'businessType', key: 'businessType',
// width: 100, width: 100,
onCell: () => ({ onCell: () => ({
style: { style: {
maxWidth: 100, maxWidth: 100,
...@@ -69,26 +69,17 @@ const maintenance = () => { ...@@ -69,26 +69,17 @@ const maintenance = () => {
title: '执行周期', title: '执行周期',
dataIndex: 'docycle', dataIndex: 'docycle',
key: 'docycle', key: 'docycle',
// width: 100, width: 100,
onCell: () => ({
style: {
maxWidth: 100,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
align: 'center', align: 'center',
}, },
{ {
title: '台账名称', title: '台账名称',
dataIndex: 'accountName', dataIndex: 'accountName',
key: 'accountName', key: 'accountName',
// width: 100, width: 200,
onCell: () => ({ onCell: () => ({
style: { style: {
maxWidth: 100, maxWidth: 200,
overflow: 'hidden', overflow: 'hidden',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
...@@ -106,10 +97,9 @@ const maintenance = () => { ...@@ -106,10 +97,9 @@ const maintenance = () => {
title: '反馈名称', title: '反馈名称',
dataIndex: 'feedbackName', dataIndex: 'feedbackName',
key: 'feedbackName', key: 'feedbackName',
width: 200,
onCell: () => ({ onCell: () => ({
style: { style: {
maxWidth: 200,
overflow: 'hidden', overflow: 'hidden',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
...@@ -127,10 +117,10 @@ const maintenance = () => { ...@@ -127,10 +117,10 @@ const maintenance = () => {
title: '台账过滤条件', title: '台账过滤条件',
dataIndex: 'filterCondition', dataIndex: 'filterCondition',
key: 'filterCondition', key: 'filterCondition',
// width: 150, width: 150,
onCell: () => ({ onCell: () => ({
style: { style: {
maxWidth: 200, maxWidth: 150,
overflow: 'hidden', overflow: 'hidden',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
...@@ -149,32 +139,22 @@ const maintenance = () => { ...@@ -149,32 +139,22 @@ const maintenance = () => {
dataIndex: 'isSubmit', dataIndex: 'isSubmit',
key: 'isSubmit', key: 'isSubmit',
width: 80, width: 80,
onCell: () => ({
style: {
maxWidth: 100,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
align: 'center', align: 'center',
}, },
{ {
title: '执行角色', title: '执行角色',
dataIndex: 'doRole', dataIndex: 'doRole',
key: 'doRole', key: 'doRole',
width: 300, align: 'center',
onCell: () => ({ onCell: () => ({
style: { style: {
maxWidth: 350,
overflow: 'hidden', overflow: 'hidden',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
cursor: 'pointer', cursor: 'pointer',
}, },
}), }),
align: 'center',
render: record => ( render: record => (
<Tooltip placement="topLeft" title={record}> <Tooltip placement="topLeft" title={record}>
{record} {record}
...@@ -186,32 +166,32 @@ const maintenance = () => { ...@@ -186,32 +166,32 @@ const maintenance = () => {
dataIndex: 'produceDays', dataIndex: 'produceDays',
key: 'produceDays', key: 'produceDays',
width: 80, width: 80,
align: 'center',
onCell: () => ({ onCell: () => ({
style: { style: {
maxWidth: 100, maxWidth: 80,
overflow: 'hidden', overflow: 'hidden',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
cursor: 'pointer', cursor: 'pointer',
}, },
}), }),
align: 'center',
}, },
{ {
title: '在线任务量', title: '在线任务量',
dataIndex: 'onLines', dataIndex: 'onLines',
key: 'onLines', key: 'onLines',
width: 80, width: 80,
align: 'center',
onCell: () => ({ onCell: () => ({
style: { style: {
maxWidth: 100, maxWidth: 80,
overflow: 'hidden', overflow: 'hidden',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
cursor: 'pointer', cursor: 'pointer',
}, },
}), }),
align: 'center',
render: record => ( render: record => (
<Tooltip placement="topLeft" title={record}> <Tooltip placement="topLeft" title={record}>
{record} {record}
...@@ -222,16 +202,7 @@ const maintenance = () => { ...@@ -222,16 +202,7 @@ const maintenance = () => {
title: '启停', title: '启停',
dataIndex: 'doNot', dataIndex: 'doNot',
key: 'doNot', key: 'doNot',
// width: 100, width: 80,
onCell: () => ({
style: {
maxWidth: 100,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
align: 'center', align: 'center',
}, },
{ {
......
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