Commit f79efa29 authored by 邓超's avatar 邓超

Merge branch 'master' of https://g.civnet.cn:8443/ReactWeb5/maintenance

# Conflicts: # src/services/tablemanager/tablemanager.js
parents 1123424f 5f3f16f2
Pipeline #54042 passed with stages
...@@ -58,6 +58,7 @@ const AddModal = props => { ...@@ -58,6 +58,7 @@ const AddModal = props => {
onCancel, onCancel,
treeData, treeData,
keepTreeFirst, keepTreeFirst,
keepStandingBook,
} = props; } = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [fieldName, setFieldName] = useState([]); // 弹窗 const [fieldName, setFieldName] = useState([]); // 弹窗
...@@ -86,6 +87,7 @@ const AddModal = props => { ...@@ -86,6 +87,7 @@ const AddModal = props => {
'设备二维码', '设备二维码',
'本人ID', '本人ID',
'富文本', '富文本',
'编码',
], ],
}, },
{ {
...@@ -121,11 +123,11 @@ const AddModal = props => { ...@@ -121,11 +123,11 @@ const AddModal = props => {
ID: 4, ID: 4,
children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'], children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'],
}, },
{ // {
name: '台账专有类', // name: '台账专有类',
ID: 5, // ID: 5,
children: ['编码', '智能抄表'], // children: ['智能抄表'],
}, // },
]); ]);
const [visible, setVisible] = useState(false); // 弹窗 const [visible, setVisible] = useState(false); // 弹窗
const [isShow, setIsShow] = useState(false); // 弹窗 const [isShow, setIsShow] = useState(false); // 弹窗
...@@ -165,6 +167,7 @@ const AddModal = props => { ...@@ -165,6 +167,7 @@ const AddModal = props => {
const { Item } = Form; const { Item } = Form;
const { TreeNode } = TreeSelect; const { TreeNode } = TreeSelect;
const [timeData, setTimeData] = useState(''); const [timeData, setTimeData] = useState('');
const { Option } = Select;
// 提交 // 提交
const onSubmit = () => { const onSubmit = () => {
// 不切换树 // 不切换树
...@@ -266,37 +269,10 @@ const AddModal = props => { ...@@ -266,37 +269,10 @@ const AddModal = props => {
data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`; data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`;
} }
} }
if (obj.filterName && obj.filterValue) { if (obj.filterName) {
data[0].Config = `${data[0].Config}?${obj.filterName}='${obj.filterValue}'`; 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) {
...@@ -416,6 +392,30 @@ const AddModal = props => { ...@@ -416,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);
...@@ -521,10 +521,10 @@ const AddModal = props => { ...@@ -521,10 +521,10 @@ const AddModal = props => {
}); });
let book1 = res[0].data.root.Config.split('?'); let book1 = res[0].data.root.Config.split('?');
if (book1[1]) { if (book1[1]) {
let aa = book1[1].split('='); // let aa = book1[1].split('=');
form.setFieldsValue({ form.setFieldsValue({
filterName: aa[0], filterName: book1[1],
filterValue: aa[1].substring(1, aa[1].length - 1), // filterValue: aa[1].substring(1, aa[1].length - 1),
}); });
} }
if (book1[0].endsWith('.n')) { if (book1[0].endsWith('.n')) {
...@@ -539,66 +539,6 @@ const AddModal = props => { ...@@ -539,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);
...@@ -650,11 +590,9 @@ const AddModal = props => { ...@@ -650,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);
} }
...@@ -697,16 +635,6 @@ const AddModal = props => { ...@@ -697,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 });
}; };
...@@ -1050,14 +978,39 @@ const AddModal = props => { ...@@ -1050,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);
...@@ -1163,10 +1116,10 @@ const AddModal = props => { ...@@ -1163,10 +1116,10 @@ const AddModal = props => {
}); });
let book1 = aa.Config.split('?'); let book1 = aa.Config.split('?');
if (book1[1]) { if (book1[1]) {
let cc = book1[1].split('='); // let cc = book1[1].split('=');
form.setFieldsValue({ form.setFieldsValue({
filterName: cc[0], filterName: book1[1],
filterValue: cc[1].substring(1, cc[1].length - 1), // filterValue: cc[1].substring(1, cc[1].length - 1),
}); });
} }
if (book1[0].endsWith('.n')) { if (book1[0].endsWith('.n')) {
...@@ -1181,62 +1134,6 @@ const AddModal = props => { ...@@ -1181,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);
...@@ -1320,6 +1217,7 @@ const AddModal = props => { ...@@ -1320,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;
...@@ -1329,6 +1227,30 @@ const AddModal = props => { ...@@ -1329,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);
...@@ -1435,10 +1357,10 @@ const AddModal = props => { ...@@ -1435,10 +1357,10 @@ const AddModal = props => {
}); });
let book1 = res[0].data.root.Config.split('?'); let book1 = res[0].data.root.Config.split('?');
if (book1[1]) { if (book1[1]) {
let aa = book1[1].split('='); // let aa = book1[1].split('=');
form.setFieldsValue({ form.setFieldsValue({
filterName: aa[0], filterName: book1[1],
filterValue: aa[1].substring(1, aa[1].length - 1), // filterValue: aa[1].substring(1, aa[1].length - 1),
}); });
} }
if (book1[0].endsWith('.n')) { if (book1[0].endsWith('.n')) {
...@@ -1453,67 +1375,6 @@ const AddModal = props => { ...@@ -1453,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);
...@@ -1676,42 +1537,10 @@ const AddModal = props => { ...@@ -1676,42 +1537,10 @@ const AddModal = props => {
data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`; data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`;
} }
} }
if (obj.filterName && obj.filterValue) { if (obj.filterName) {
data[0].Config = `${data[0].Config}?${obj.filterName}='${obj.filterValue}'`; 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) {
...@@ -1967,14 +1796,10 @@ const AddModal = props => { ...@@ -1967,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);
}; };
...@@ -1983,13 +1808,13 @@ const AddModal = props => { ...@@ -1983,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);
...@@ -2006,7 +1831,7 @@ const AddModal = props => { ...@@ -2006,7 +1831,7 @@ const AddModal = props => {
<> <>
<Drawer <Drawer
title="修改" title="修改"
width="900px" width="1000px"
// {...props} // {...props}
visible={isVisible} visible={isVisible}
onClose={onCancel} onClose={onCancel}
...@@ -2048,15 +1873,15 @@ const AddModal = props => { ...@@ -2048,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}
...@@ -2072,7 +1897,7 @@ const AddModal = props => { ...@@ -2072,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' }}>
不同步 不同步
...@@ -2080,12 +1905,12 @@ const AddModal = props => { ...@@ -2080,12 +1905,12 @@ const AddModal = props => {
<Radio value={1} style={{ marginRight: '0.5rem' }}> <Radio value={1} style={{ marginRight: '0.5rem' }}>
工单 → 事件 工单 → 事件
</Radio> </Radio>
<Radio value={2}>事件(上报时) → 工单</Radio> {/* <Radio value={2}>事件(上报时) → 工单</Radio> */}
</Radio.Group> </Radio.Group>
</Item> </Item>
<Row> <Row>
{/* <Col span={1} /> */} {/* <Col span={1} /> */}
<Col span={12}> <Col span={16}>
<Item label="形态" labelCol={{ span: 6 }}> <Item label="形态" labelCol={{ span: 6 }}>
<div className={styles.listEvent}> <div className={styles.listEvent}>
<TreeSelect <TreeSelect
...@@ -2129,15 +1954,15 @@ const AddModal = props => { ...@@ -2129,15 +1954,15 @@ const AddModal = props => {
</div> </div>
</Item> </Item>
</Col> </Col>
<Col span={1} />
<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={5}> <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>
...@@ -2148,10 +1973,10 @@ const AddModal = props => { ...@@ -2148,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(前缀-年份-六位编码)
...@@ -2171,10 +1996,9 @@ const AddModal = props => { ...@@ -2171,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>
...@@ -2203,10 +2027,9 @@ const AddModal = props => { ...@@ -2203,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>
...@@ -2216,19 +2039,13 @@ const AddModal = props => { ...@@ -2216,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>
...@@ -2239,7 +2056,7 @@ const AddModal = props => { ...@@ -2239,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}
...@@ -2263,20 +2080,20 @@ const AddModal = props => { ...@@ -2263,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>
...@@ -2289,24 +2106,24 @@ const AddModal = props => { ...@@ -2289,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>
...@@ -2320,14 +2137,10 @@ const AddModal = props => { ...@@ -2320,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>
</> </>
); );
...@@ -2337,16 +2150,12 @@ const AddModal = props => { ...@@ -2337,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>
...@@ -2357,7 +2166,7 @@ const AddModal = props => { ...@@ -2357,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>
...@@ -2367,32 +2176,7 @@ const AddModal = props => { ...@@ -2367,32 +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>
}
>
{/* <Select
placeholder="默认为全局.n即全局多选,.n为多选(全局时勾选由问题)"
style={{ width: '93%' }}
>
<Select.Option value="全局.n">全局(多选)</Select.Option>
<Select.Option value="全局">全局</Select.Option>
<Select.Option value="本人.n">本人(多选)</Select.Option>
<Select.Option value="本人">本人</Select.Option>
</Select> */}
<div style={{ display: 'inline-block' }}> <div style={{ display: 'inline-block' }}>
<Item name="pepole" style={{ marginBottom: '0' }}> <Item name="pepole" style={{ marginBottom: '0' }}>
<Checkbox <Checkbox
...@@ -2421,32 +2205,42 @@ const AddModal = props => { ...@@ -2421,32 +2205,42 @@ const AddModal = props => {
return ( return (
<> <>
<Row> <Row>
<Col span={12}> <Col span={16}>
<Item <Item
label="台账名" label="台账名"
name="standingBook" name="standingBook"
labelCol={{ span: 6 }} labelCol={{ span: 6 }}
rules={[{ required: true, message: '请输入台账名' }]} rules={[{ required: true, message: '请输入台账名' }]}
> >
<Input style={{ width: '95%' }} placeholder="请输入台账名" /> <Select showSearch style={{ width: '95%' }}>
{keepStandingBook
? keepStandingBook.map((item, index) => (
<Option key={index} value={item}>
{item}
</Option>
))
: ''}
</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>
<Col span={12}> </Row>
<Item label="台账过滤" name="filterName" labelCol={{ span: 6 }}> {/* <Col span={12}> */}
<Input style={{ width: '95%' }} placeholder="请输入字段名" /> <Item label="SQL过滤" name="filterName" labelCol={{ span: 4 }}>
<TextArea placeholder="示例:部门='研发一部'" />
</Item> </Item>
</Col>
<Col span={2}> {/* </Col> */}
{/* <Col span={2}>
<span style={{ marginLeft: '20px' }}>=</span> <span style={{ marginLeft: '20px' }}>=</span>
</Col> </Col>
<Col span={9}> <Col span={9}>
...@@ -2456,9 +2250,9 @@ const AddModal = props => { ...@@ -2456,9 +2250,9 @@ const AddModal = props => {
placeholder="请输入过滤条件" placeholder="请输入过滤条件"
/> />
</Item> </Item>
</Col> </Col> */}
</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>
...@@ -2469,125 +2263,14 @@ const AddModal = props => { ...@@ -2469,125 +2263,14 @@ 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 <Item
colon={false} labelCol={{ span: 4 }}
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
labelCol={{ span: 3 }}
label={ label={
<div> <div>
<Tooltip <Tooltip
title={ title={
<> <>
<span>默认非全部,展示形式为下拉框</span> <span>默认展示形式为下拉框</span>
<Image width={200} src={partImage} /> <Image width={200} src={partImage} />
</> </>
} }
...@@ -2606,7 +2289,7 @@ const AddModal = props => { ...@@ -2606,7 +2289,7 @@ const AddModal = props => {
<Tooltip <Tooltip
title={ title={
<> <>
<span>全部,展示形式为弹窗</span> <span>展示形式为弹窗显示人员所属机构</span>
<Image width={200} src={AllImage} /> <Image width={200} src={AllImage} />
</> </>
} }
...@@ -2629,18 +2312,6 @@ const AddModal = props => { ...@@ -2629,18 +2312,6 @@ const AddModal = props => {
</Checkbox> </Checkbox>
</Item> </Item>
</div> </div>
<div style={{ display: 'inline-block', marginRight: '10px' }}>
<Item name="AllID1" style={{ marginBottom: '0' }}>
<Checkbox
checked={checkboxAllID1}
onChange={changeAllID1}
style={{ marginBottom: '0' }}
disabled={hide}
>
存储ID
</Checkbox>
</Item>
</div>
<div style={{ display: 'inline-block', marginRight: '10px' }}> <div style={{ display: 'inline-block', marginRight: '10px' }}>
<Item name="choose" style={{ marginBottom: '0' }}> <Item name="choose" style={{ marginBottom: '0' }}>
<Checkbox <Checkbox
...@@ -2652,18 +2323,18 @@ const AddModal = props => { ...@@ -2652,18 +2323,18 @@ const AddModal = props => {
</Checkbox> </Checkbox>
</Item> </Item>
</div> </div>
{/* <div style={{ display: 'inline-block', marginRight: '10px' }}> <div style={{ display: 'inline-block', marginRight: '10px' }}>
<Item name="department" style={{ marginBottom: '0' }}> <Item name="AllID1" style={{ marginBottom: '0' }}>
<Checkbox <Checkbox
checked={checkboxAllID1} checked={checkboxAllID1}
onChange={changeAllID1} onChange={changeAllID1}
style={{ marginBottom: '0' }} style={{ marginBottom: '0' }}
disabled={hide} disabled={hide}
> >
展示部门 ID存储
</Checkbox> </Checkbox>
</Item> </Item>
</div> */} </div>
</Item> </Item>
{(() => { {(() => {
switch (flag) { switch (flag) {
...@@ -2673,7 +2344,7 @@ const AddModal = props => { ...@@ -2673,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) => {
...@@ -2688,7 +2359,6 @@ const AddModal = props => { ...@@ -2688,7 +2359,6 @@ const AddModal = props => {
> >
<Input <Input
allowClear allowClear
style={{ width: '93%' }}
placeholder="请输入角色或机构名称" placeholder="请输入角色或机构名称"
onChange={inputOnChange} onChange={inputOnChange}
/> />
...@@ -2701,7 +2371,7 @@ const AddModal = props => { ...@@ -2701,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,
...@@ -2720,7 +2390,6 @@ const AddModal = props => { ...@@ -2720,7 +2390,6 @@ const AddModal = props => {
> >
<Input <Input
allowClear allowClear
style={{ width: '93%' }}
placeholder="请输入角色或机构名称" placeholder="请输入角色或机构名称"
onChange={inputOnchange} onChange={inputOnchange}
/> />
...@@ -2739,7 +2408,7 @@ const AddModal = props => { ...@@ -2739,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}
...@@ -2761,7 +2430,7 @@ const AddModal = props => { ...@@ -2761,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="当前坐标"
...@@ -2775,7 +2444,7 @@ const AddModal = props => { ...@@ -2775,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%' }}
...@@ -2801,8 +2470,8 @@ const AddModal = props => { ...@@ -2801,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>
); );
} }
...@@ -2811,7 +2480,7 @@ const AddModal = props => { ...@@ -2811,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}>
...@@ -2827,7 +2496,7 @@ const AddModal = props => { ...@@ -2827,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 />
......
...@@ -27,6 +27,7 @@ import { ...@@ -27,6 +27,7 @@ import {
reloadTableFields, reloadTableFields,
removeFields, removeFields,
loadUnattachedTables, loadUnattachedTables,
LoadLedgers,
} from '@/services/tablemanager/tablemanager'; } from '@/services/tablemanager/tablemanager';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import FieldEditor from './fieldEditor'; import FieldEditor from './fieldEditor';
...@@ -61,6 +62,7 @@ const AddModal = props => { ...@@ -61,6 +62,7 @@ const AddModal = props => {
const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 批量删除 const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 批量删除
const [checkStrictly, setCheckStrictly] = useState(false); const [checkStrictly, setCheckStrictly] = useState(false);
const [selectGroup, setSelectGroup] = useState([]); const [selectGroup, setSelectGroup] = useState([]);
const [keepStandingBook, setKeepStandingBook] = useState([]);
const editor = record => { const editor = record => {
console.log(record); console.log(record);
...@@ -300,6 +302,17 @@ const AddModal = props => { ...@@ -300,6 +302,17 @@ const AddModal = props => {
}, },
}, },
]; ];
useEffect(() => {
LoadLedgers().then(res => {
if (res.code === 0) {
let data = [];
res.data.root.map(i => {
data.push(i.name);
});
setKeepStandingBook(data);
}
});
}, []);
useEffect(() => { useEffect(() => {
console.log(props); console.log(props);
...@@ -724,6 +737,7 @@ const AddModal = props => { ...@@ -724,6 +737,7 @@ const AddModal = props => {
treeData={treeData} treeData={treeData}
keepTreeFirst={keepTreeFirst} keepTreeFirst={keepTreeFirst}
callBackSubmit={Submit} callBackSubmit={Submit}
keepStandingBook={keepStandingBook}
/> />
{visible && type === 'affiliateAdd' && ( {visible && type === 'affiliateAdd' && (
<AffiliateAdd <AffiliateAdd
......
/* 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;
...@@ -30,7 +34,7 @@ const AddModal = props => { ...@@ -30,7 +34,7 @@ const AddModal = props => {
feedbackName: '', feedbackName: '',
doRole: '', doRole: '',
}); });
const { callBackSubmit = () => {}, visible, type, formObj } = props; const { callBackSubmit = () => {}, visible, type, formObj, keepTableData } = props;
const [Type1, setType1] = useState(''); const [Type1, setType1] = useState('');
const [Type2, setType2] = useState(''); const [Type2, setType2] = useState('');
...@@ -45,19 +49,22 @@ const AddModal = props => { ...@@ -45,19 +49,22 @@ 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(() => {
if (visible) {
getRole(); getRole();
if (type === 'add') { if (type === 'add') {
setChee('否');
form.setFieldsValue({ isSubmit: '否', docycle: '一周一次' });
setType1(''); setType1('');
setType2(''); setType2('');
setInputValue({ feedbackName: '', doRole: '' }); setInputValue({ feedbackName: '', doRole: '' });
setFiled1({}); setFiled1({});
form.resetFields();
} else if (type === 'edit') { } else if (type === 'edit') {
CM_XWBPlan_DataList({ id: formObj.id }).then(res => { CM_XWBPlan_DataList({ id: formObj.id }).then(res => {
let data = res.data[0]; let data = res.data[0];
...@@ -68,6 +75,10 @@ const AddModal = props => { ...@@ -68,6 +75,10 @@ const AddModal = props => {
setType2(data.accountName); setType2(data.accountName);
}); });
} }
} else {
setChee('');
form.resetFields();
}
}, [visible]); }, [visible]);
useEffect(() => { useEffect(() => {
...@@ -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>
...@@ -297,28 +315,36 @@ const AddModal = props => { ...@@ -297,28 +315,36 @@ const AddModal = props => {
required: true, required: true,
message: '请输入业务名称', message: '请输入业务名称',
}, },
{
validator: (rule, value) => {
let aa = form.getFieldValue().businessName;
if (type === 'add' && keepTableData.indexOf(aa) != -1) {
return Promise.reject('业务名称已存在');
} else if (
type === 'edit' &&
keepTableData.indexOf(aa) != -1 &&
aa != formObj.businessName
) {
return Promise.reject('业务名称已存在');
}
return Promise.resolve();
},
},
]} ]}
> >
<Input placeholder="业务名称不可重复" /> <Input placeholder="业务名称不可重复" />
</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 == '') {
...@@ -329,67 +355,15 @@ const AddModal = props => { ...@@ -329,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>
...@@ -400,22 +374,15 @@ const AddModal = props => { ...@@ -400,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 == '') {
...@@ -426,73 +393,27 @@ const AddModal = props => { ...@@ -426,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}
placeholder="选择此计划关联的设备台账名称"
/>
<Dropdown
placement="bottomRight"
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} {item}
</Menu.Item> </Option>
); ))
}) : ''}
) : ( </Select>
<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 == '') {
...@@ -515,28 +436,21 @@ const AddModal = props => { ...@@ -515,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 == '') {
...@@ -559,7 +473,7 @@ const AddModal = props => { ...@@ -559,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>
...@@ -594,26 +508,16 @@ const AddModal = props => { ...@@ -594,26 +508,16 @@ 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="设备对应的Scada台账名称,可多选" /> <TextArea placeholder="例如:and 泵房品牌='熊猫'" />
</Item> </Item>
</Col> </Col>
</Row> </Row>
......
...@@ -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);
} }
......
...@@ -20,6 +20,7 @@ const maintenance = () => { ...@@ -20,6 +20,7 @@ const maintenance = () => {
const [flag, setFlag] = useState(0); const [flag, setFlag] = useState(0);
const [sortVisible, setSortVisible] = useState(false); const [sortVisible, setSortVisible] = useState(false);
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
const [keepTableData, setKeepTableData] = useState([]);
const columns = [ const columns = [
{ {
...@@ -47,7 +48,7 @@ const maintenance = () => { ...@@ -47,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,
...@@ -68,26 +69,17 @@ const maintenance = () => { ...@@ -68,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',
...@@ -105,10 +97,9 @@ const maintenance = () => { ...@@ -105,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',
...@@ -126,10 +117,10 @@ const maintenance = () => { ...@@ -126,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',
...@@ -148,32 +139,22 @@ const maintenance = () => { ...@@ -148,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}
...@@ -185,32 +166,32 @@ const maintenance = () => { ...@@ -185,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}
...@@ -221,16 +202,7 @@ const maintenance = () => { ...@@ -221,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',
}, },
{ {
...@@ -265,6 +237,11 @@ const maintenance = () => { ...@@ -265,6 +237,11 @@ const maintenance = () => {
setTreeLoading(false); setTreeLoading(false);
if (res.msg === 'Ok') { if (res.msg === 'Ok') {
setTableData(res.data); setTableData(res.data);
let list = [];
res.data.map(i => {
list.push(i.businessName);
});
setKeepTableData(list);
} }
}); });
}, [flag]); }, [flag]);
...@@ -388,6 +365,7 @@ const maintenance = () => { ...@@ -388,6 +365,7 @@ const maintenance = () => {
onClose={() => setAddVisible(false)} onClose={() => setAddVisible(false)}
callBackSubmit={onSubmit} callBackSubmit={onSubmit}
formObj={formObj} formObj={formObj}
keepTableData={keepTableData}
placement="right" placement="right"
/> />
<SortModal <SortModal
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-04-06 11:38:46 * @Date: 2022-04-06 11:38:46
* @LastEditTime: 2022-05-23 10:49:46 * @LastEditTime: 2022-06-22 13:53:09
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -119,8 +119,8 @@ const DrawBoardManage = () => { ...@@ -119,8 +119,8 @@ const DrawBoardManage = () => {
const updateTrees = e => { const updateTrees = e => {
setTreeLoading(true); setTreeLoading(true);
typeList().then(res => { typeList().then(res => {
if (res.code === 0) {
setTreeLoading(false); setTreeLoading(false);
if (res.code === 0) {
if (e) { if (e) {
let aa = res.data.find(i => i.name === e); let aa = res.data.find(i => i.name === e);
setPickItem(aa); setPickItem(aa);
......
/* eslint-disable react/jsx-boolean-value */
import React, { useState, useEffect } from 'react';
import {
Form,
Modal,
Input,
notification,
Radio,
InputNumber,
Checkbox,
Switch,
Tooltip,
Row,
Col,
} from 'antd';
import { SaveRoutes } from '@/services/hostmanager/hostmanager';
import { InfoCircleOutlined } from '@ant-design/icons';
const { Item } = Form;
const AddModal = props => {
const { callBackSubmit = () => {}, type, pickItem, visible, onCancel } = props;
const [loading, setLoading] = useState(false);
const [current, setCurrent] = useState(false);
const [advanced, setAdvanced] = useState(0);
const [form] = Form.useForm();
useEffect(() => {
if (visible) {
if (type === 'edit') {
let aa = pickItem.methods.replace(/\s/g, '');
form.setFieldsValue({
UpstreamPathTemplate: pickItem.upstreamPathTemplate,
DownstreamPathTemplate: pickItem.downstreamPathTemplate,
Methods: aa.split(','),
Url: pickItem.url,
IsAuthentication: pickItem.isAuthentication,
Key: pickItem.key,
Priority: pickItem.priority,
UpstreamHost: pickItem.upstreamHost,
AddHeasersToRequest: pickItem.addHeasersToRequest,
UpstreamHeaderTransform: pickItem.upstreamHeaderTransform,
DownstreamHeaderTransform: pickItem.downstreamHeaderTransform,
Timeout: pickItem.timeout,
QoSOptions: pickItem.qoSOptions,
RateLimitOptions: pickItem.rateLimitOptions,
CacheOptions: pickItem.cacheOptions,
LoadBalancerOptions: pickItem.loadBalancerOptions,
SecurityOptions: pickItem.securityOptions,
RequestIdKey: pickItem.requestIdKey,
ServiceName: pickItem.serviceName,
ServiceNamespace: pickItem.serviceNamespace,
DelegatingHandlers: pickItem.delegatingHandlers,
ReRouteIsCaseSensitive: pickItem.reRouteIsCaseSensitive,
DownstreamHttpMethod: pickItem.downstreamHttpMethod,
});
if (
pickItem.upstreamHost ||
pickItem.addHeasersToRequest ||
pickItem.upstreamHeaderTransform ||
pickItem.downstreamHeaderTransform ||
pickItem.timeout ||
pickItem.qoSOptions ||
pickItem.rateLimitOptions ||
pickItem.cacheOptions ||
pickItem.loadBalancerOptions ||
pickItem.securityOptions ||
pickItem.requestIdKey ||
pickItem.serviceName ||
pickItem.serviceNamespace ||
pickItem.delegatingHandlers ||
pickItem.reRouteIsCaseSensitive ||
pickItem.downstreamHttpMethod
) {
setAdvanced(1);
setCurrent(true);
}
} else {
form.setFieldsValue({ IsAuthentication: true });
}
} else {
form.resetFields();
setAdvanced(0);
setCurrent(false);
}
}, [visible]);
// 提交
const onSubmit = () => {
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
console.log(obj.IsAuthentication);
console.log(obj.Ptiority);
let aa = obj.Methods.toString();
obj.Methods = aa.replace(/\s/g, '');
console.log(obj.Methods);
let data = {
UpstreamPathTemplate: obj.UpstreamPathTemplate || null,
DownstreamPathTemplate: obj.DownstreamPathTemplate || null,
Methods: obj.Methods || null,
Url: obj.Url || null,
IsAuthentication: obj.IsAuthentication,
Key: obj.Key || null,
Priority: obj.Priority || null,
UpstreamHost: obj.UpstreamHost || null,
AddHeasersToRequest: obj.AddHeasersToRequest || null,
UpstreamHeaderTransform: obj.UpstreamHeaderTransform || null,
DownstreamHeaderTransform: obj.DownstreamHeaderTransform || null,
Timeout: obj.Timeout || null,
QoSOptions: obj.QoSOptions || null,
RateLimitOptions: obj.RateLimitOptions || null,
CacheOptions: obj.CacheOptions || null,
LoadBalancerOptions: obj.LoadBalancerOptions || null,
SecurityOptions: obj.SecurityOptions || null,
RequestIdKey: obj.RequestIdKey || null,
ServiceName: obj.ServiceName || null,
ServiceNamespace: obj.ServiceNamespace || null,
DelegatingHandlers: obj.DelegatingHandlers || null,
ReRouteIsCaseSensitive: obj.ReRouteIsCaseSensitive || null,
DownstreamHttpMethod: obj.DownstreamHttpMethod || null,
};
if (type === 'add') {
SaveRoutes([
{
...data,
IsEnable: 1,
},
])
.then(res => {
setLoading(false);
if (res.code === 0) {
onCancel();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: res.msg || '新增成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg || '新增失败',
});
}
})
.catch(err => {
setLoading(false);
});
} else {
SaveRoutes([
{
id: pickItem.id,
...data,
IsEnable: 1,
},
])
.then(res => {
setLoading(false);
if (res.code === 0) {
onCancel();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: res.msg || '编辑成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg || '编辑失败',
});
}
})
.catch(err => {
setLoading(false);
});
}
}
});
};
const layout = {
layout: 'horizontal',
labelCol: { span: 4 },
wrapperCol: { span: 18 },
};
const plainOptions = ['GET', 'POST', 'PUT', 'DELETE'];
const change = (e, event) => {
if (e) {
setAdvanced(1);
setCurrent(true);
} else {
setAdvanced(0);
setCurrent(false);
}
};
return (
<Modal
title={type === 'add' ? '新增网关配置' : '编辑网关配置'}
bodyStyle={{ width: '100%', maxHeight: '600px', overflow: 'scroll', minHeight: '360px' }}
width="700px"
destroyOnClose
maskClosable={false}
cancelText="取消"
okText="确认"
{...props}
onOk={() => onSubmit()}
confirmLoading={loading}
forceRender={true}
getContainer={false}
>
<Form form={form} {...layout}>
<Item
label="上游路由模板"
name="UpstreamPathTemplate"
rules={[
{
validator: (rule, value) => {
let aa = form.getFieldValue().UpstreamPathTemplate;
console.log(aa.startsWith('/'));
if (!aa.startsWith('/')) {
return Promise.reject('必须以/开头');
}
return Promise.resolve();
},
},
{
required: true,
message: '请输入上游路由模板',
},
]}
>
<Input allowClear style={{ width: '100%' }} placeholder="示例:/PandaOMS/PandaOMS/{url}" />
</Item>
<Item
label="下游路由模板"
name="DownstreamPathTemplate"
rules={[
{
validator: (rule, value) => {
let aa = form.getFieldValue().DownstreamPathTemplate;
console.log(aa.startsWith('/'));
if (!aa.startsWith('/')) {
return Promise.reject('必须以/开头');
}
return Promise.resolve();
},
},
{
required: true,
message: '请输入下游路由模板',
},
]}
>
<Input allowClear placeholder="示例:/{url}" />
</Item>
<Item
label="上游请求方式"
name="Methods"
rules={[
{
required: true,
message: '请选择上游请求方式',
},
]}
>
<Checkbox.Group options={plainOptions} style={{ display: 'flex' }} />
</Item>
<Item
label="下游服务地址"
name="Url"
rules={[
{
required: true,
message: '请输入下游服务地址',
},
]}
>
<Input allowClear placeholder="示例:http://localhost:8050" />
</Item>
<Item label="身份认证" name="IsAuthentication">
<Radio.Group>
<Radio value={true}>开启</Radio>
<Radio value={false}>关闭</Radio>
</Radio.Group>
</Item>
<Item
label="关键字"
name="Key"
rules={[
{
required: true,
message: '请输入关键字',
},
]}
>
<Input allowClear />
</Item>
<Row>
<Col span={8}>
<Item
// label={
// <div>
// <Tooltip title="0默认级别最低,10最高,优先级越高越先匹配">
// <InfoCircleOutlined
// style={{
// color: 'rgb(24, 144, 255)',
// marginLeft: '0px',
// marginRight: '5px',
// }}
// />
// </Tooltip>
// <span>优先级</span>
// </div>
// }
label="优先级"
name="Priority"
labelCol={{ span: 12 }}
>
<InputNumber min={0} max={10} defaultValue={0} />
</Item>
</Col>
<Col span={16}>
<Item>
<span style={{ color: 'red' }}>0默认级别最低,10最高,优先级越高越先匹配</span>
</Item>
</Col>
</Row>
{/* <Switch
checkedChildren="高级设置"
unCheckedChildren="高级设置"
onChange={change}
checked={current}
style={{ marginLeft: '40px', marginBottom: '15px' }}
/>
{advanced === 1 ? (
<>
<Item label="上游host" name="UpstreamHost">
<Input allowClear />
</Item>
<Item label="头部信息" name="AddHeasersToRequest">
<Input allowClear />
</Item>
<Item label="上游头信息转发" name="UpstreamHeaderTransform">
<Input allowClear />
</Item>
<Item label="下游头信息转发" name="DownstreamHeaderTransform">
<Input allowClear />
</Item>
<Item label="超时设置" name="Timeout">
<Input allowClear />
</Item>
<Item label="服务质量与熔断" name="QoSOptions">
<Input allowClear />
</Item>
<Item label="限流配置" name="RateLimitOptions">
<Input allowClear />
</Item>
<Item label="缓存" name="CacheOptions">
<Input allowClear />
</Item>
<Item label="负载均衡" name="LoadBalancerOptions">
<Input allowClear />
</Item>
<Item label="安全配置" name="SecurityOptions">
<Input allowClear />
</Item>
<Item label="请求Id Key" name="RequestIdKey">
<Input allowClear />
</Item>
<Item label="服务名" name="ServiceName">
<Input allowClear />
</Item>
<Item label="服务空间" name="ServiceNamespace">
<Input allowClear />
</Item>
<Item label="委托配置" name="DelegatingHandlers">
<Input allowClear />
</Item>
<Item label="路由大小写敏感" name="ReRouteIsCaseSensitive">
<Radio.Group>
<Radio value={0}>否</Radio>
<Radio value={1}>是</Radio>
</Radio.Group>
</Item>
<Item label="下游请求方式" name="DownstreamHttpMethod">
<Checkbox.Group options={plainOptions} />
</Item>
</>
) : (
''
)} */}
</Form>
</Modal>
);
};
export default AddModal;
/* eslint-disable no-else-return */
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Card, Form, Switch, message, Divider, Row, Col, Spin } from 'antd'; import {
Card,
Form,
Switch,
message,
Divider,
Row,
Col,
Spin,
Tooltip,
Input,
Space,
Button,
Popconfirm,
Table,
notification,
} from 'antd';
import {
EditTwoTone,
DeleteOutlined,
PlusOutlined,
SyncOutlined,
SearchOutlined,
} from '@ant-design/icons';
import styles from './gateWay.less'; import styles from './gateWay.less';
import { GetGateWay, UpdateGeteWay } from '@/services/hostmanager/hostmanager'; import {
GetGateWay,
UpdateGeteWay,
GetReRoutes,
DelRoutes,
} from '@/services/hostmanager/hostmanager';
import configuration from '../../../../assets/images/icons/消息.svg'; import configuration from '../../../../assets/images/icons/消息.svg';
import AddModal from './AddModal';
const GateConfig = () => { const GateConfig = () => {
const [loading, setLoading] = useState(false); // 加载 const [loading, setLoading] = useState(false); // 加载
const [form] = Form.useForm(); const [form] = Form.useForm();
const [flag, setFlag] = useState(1); const [flag, setFlag] = useState(1);
const [currentConfig, setCurrentConfig] = useState(); const [currentConfig, setCurrentConfig] = useState();
const [tableData, setTableData] = useState([]);
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const [searchWord, setSearchWord] = useState(''); // 关键字
const [searchWord1, setSearchWord1] = useState(''); // 关键字
const [addVisible, setAddVisible] = useState(false);
const [pickItem, setPickItem] = useState('');
const [type, setType] = useState('');
const { Search } = Input;
const OperateNginx = checked => { const OperateNginx = checked => {
console.log(checked); console.log(checked);
...@@ -34,22 +73,250 @@ const GateConfig = () => { ...@@ -34,22 +73,250 @@ const GateConfig = () => {
GetGateWay().then(res => { GetGateWay().then(res => {
if (res.code === 0) { if (res.code === 0) {
setCurrentConfig(res.data); setCurrentConfig(res.data);
console.log(res.data);
console.log(currentConfig); console.log(currentConfig);
} }
}); });
setLoading(true);
GetReRoutes({
UpstreamPathTemplate: '',
key: '',
}).then(res => {
setLoading(false);
if (res.code === 0) {
setTableData(res.data);
}
});
}, [flag]); }, [flag]);
const columns = [
{
title: '上游路由模板',
dataIndex: 'upstreamPathTemplate',
key: 'upstreamPathTemplate',
align: 'center',
ellipsis: true,
render: (text, record) => (
<span>
<Tooltip placement="top" title={text}>
{searchStyle(text)}
</Tooltip>
</span>
),
},
{
title: '上游请求方式',
dataIndex: 'methods',
key: 'methods',
align: 'center',
ellipsis: true,
width: 200,
render: (text, record) => (
<span>
<Tooltip placement="top" title={text}>
{text}
</Tooltip>
</span>
),
},
{
title: '下游服务地址',
dataIndex: 'url',
key: 'url',
align: 'center',
ellipsis: true,
width: 250,
render: (text, record) => (
<span>
<Tooltip placement="top" title={text}>
{text}
</Tooltip>
</span>
),
},
{
title: '下游路由模板',
dataIndex: 'downstreamPathTemplate',
key: 'downstreamPathTemplate',
ellipsis: true,
align: 'center',
render: (text, record) => (
<span>
<Tooltip placement="top" title={text}>
{text}
</Tooltip>
</span>
),
},
{
title: '关键字',
dataIndex: 'key',
key: 'key',
align: 'center',
width: 100,
render: (text, record) => (
<span>
<Tooltip placement="top" title={text}>
{searchStyle1(text)}
</Tooltip>
</span>
),
},
{
title: '开启身份认证',
dataIndex: 'isAuthentication',
key: 'isAuthentication',
align: 'center',
width: 120,
render: (text, record) => {
if (text == true) {
return <span></span>;
} else {
return <span></span>;
}
},
},
{
title: '操作',
key: 'action',
width: 100,
align: 'center',
render: record => (
<Space size="middle">
<Tooltip title="编辑">
<EditTwoTone onClick={() => edit(record)} style={{ fontSize: '16px' }} />
</Tooltip>
<Tooltip title="删除">
<Popconfirm
placement="bottomRight"
title={
<p>
即将删除 <span>{record.loginName}</span>
,是否确认删除?
</p>
}
okText="确认"
cancelText="取消"
onConfirm={() => dele(record)}
>
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} />
</Popconfirm>
</Tooltip>
</Space>
),
},
];
// 模糊查询匹配的样式
const searchStyle = val => {
let n;
if (showSearchStyle) {
n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`);
} else {
n = val;
}
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
// 模糊查询匹配的样式
const searchStyle1 = val => {
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(searchWord1, 'g'),
`<span style='color:red'>${searchWord1}</span>`,
);
} else {
n = val;
}
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
const handleReset = () => {
setSearchWord('');
setSearchWord1('');
setShowSearchStyle(false);
setFlag(flag + 1);
};
const handleSearch = e => {
setSearchWord(e.target.value);
};
const handleSearch1 = e => {
setSearchWord1(e.target.value);
};
const submitSearch = () => {
setLoading(true);
GetReRoutes({ UpstreamPathTemplate: searchWord, Key: searchWord1 }).then(resnew => {
setLoading(false);
if (resnew.code === 0) {
setTableData(resnew.data);
setShowSearchStyle(true);
} else {
notification.error({
message: '查询失败',
description: resnew.msg,
});
}
});
};
const add = () => {
setType('add');
setAddVisible(true);
};
const edit = e => {
setType('edit');
setPickItem(e);
setAddVisible(true);
};
const dele = e => {
setPickItem(e);
let data = [];
data.push(e.id);
console.log(data);
if (e.id == 1) {
notification.error({
message: '删除失败',
description: '默认数据无法删除',
});
} else {
DelRoutes({
Ids: e.id,
}).then(res => {
if (res.code === 0) {
setFlag(flag + 1);
notification.success({
message: '删除成功',
description: res.msg,
});
} else {
notification.error({
message: '删除失败',
description: res.msg,
});
}
});
}
};
const onSubmit = () => {
setFlag(flag + 1);
};
return ( return (
<div className={styles.gateWay_container}> <div className={styles.gateWay_container}>
<Card style={{ width: '100%', height: 'calc(100vh - 130px)' }}> <Card style={{ width: '100%', height: 'calc(100vh - 130px)' }}>
<Spin spinning={loading} tip="loading">
<div style={{ display: 'flex', alignItems: 'center', marginTop: '10px' }}> <div style={{ display: 'flex', alignItems: 'center', marginTop: '10px' }}>
<img src={configuration} style={{ height: '16px' }} alt="" /> <img src={configuration} style={{ height: '16px' }} alt="" />
<span style={{ marginLeft: '10px', fontWeight: 'bold' }}>网关配置</span> <span style={{ marginLeft: '10px', fontWeight: 'bold' }}>网关配置</span>
</div> </div>
<Divider /> <Divider />
<div className={styles.operate_container}> <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '20px' }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div <div
style={{ style={{
marginLeft: '35px', marginLeft: '35px',
...@@ -66,7 +333,86 @@ const GateConfig = () => { ...@@ -66,7 +333,86 @@ const GateConfig = () => {
</div> </div>
{console.log(currentConfig)} {console.log(currentConfig)}
</div> </div>
{currentConfig ? (
<div className={styles.head1}>
<span>快速搜索上游路由模板:</span>
<Input
value={searchWord}
placeholder="请输入上游路由模板"
style={{ width: 200 }}
onChange={handleSearch}
/>
<span style={{ marginLeft: '20px' }}>快速搜索关键字:</span>
<Input
value={searchWord1}
placeholder="请输入键值"
style={{ width: 200 }}
onChange={handleSearch1}
/>
<Button
type="primary"
icon={<SearchOutlined />}
onClick={submitSearch}
style={{ marginLeft: '20px' }}
>
搜索
</Button>
<Button icon={<SyncOutlined />} onClick={handleReset} style={{ marginLeft: '20px' }}>
重置
</Button>
<Button
icon={<PlusOutlined className={styles.icon} />}
onClick={add}
style={{
verticalAlign: 'middle',
marginTop: '-3px',
marginLeft: '20px',
}}
>
新增
</Button>
</div>
) : (
<></>
)}
</div>
{currentConfig ? (
<Spin spinning={loading} tip="loading">
<div className={styles.table}>
<Table
size="small"
bordered
rowKey={record => record.Id}
columns={columns}
dataSource={tableData}
scroll={{ y: 'calc(100vh - 380px)', x: 'max-content' }}
onRow={record => ({
onDoubleClick: event => {
event.stopPropagation();
edit(record);
}, // 双击
})}
pagination={{
showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`,
pageSizeOptions: [10, 20, 50, 100],
defaultPageSize: 20,
showQuickJumper: true,
showSizeChanger: true,
}}
/>
</div>
</Spin> </Spin>
) : (
<></>
)}
<AddModal
visible={addVisible}
pickItem={pickItem}
onCancel={() => setAddVisible(false)}
type={type}
callBackSubmit={onSubmit}
/>
</Card> </Card>
</div> </div>
); );
......
.getWay_container{ .getWay_container {
display: flex; display: flex;
height: 100%; height: 100%;
width: 100%; width: 100%;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
.operate_container{ .operate_container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
width: 100%; .operate_item {
height: 100%;
.operate_item{
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content:flex-start; justify-content: flex-start;
align-items: center; align-items: center;
height: 50px; height: 50px;
margin-left:25px; margin-left: 25px;
}
}
.head {
width: 100%;
display: flex;
justify-content: space-between;
.head1 {
display: flex;
align-items: center;
} }
} }
} }
.anticon svg { .anticon svg {
margin-top:-5px; margin-top: -5px;
} }
...@@ -42,12 +42,12 @@ ...@@ -42,12 +42,12 @@
line-height: 1; line-height: 1;
} }
.ant-dropdown-menu-item>.anticon:first-child { .ant-dropdown-menu-item > .anticon:first-child {
vertical-align: 0.15em !important; vertical-align: 0.15em !important;
} }
.ant-table-tbody { .ant-table-tbody {
.ant-table-row:hover>td { .ant-table-row:hover > td {
background: #aed8fa !important; background: #aed8fa !important;
} }
} }
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
} }
.ant-tree-treenode:hover { .ant-tree-treenode:hover {
.iconWraper1>span { .iconWraper1 > span {
margin-left: 12px; margin-left: 12px;
font-size: 18px; font-size: 18px;
display: inline-block; display: inline-block;
...@@ -260,7 +260,6 @@ ...@@ -260,7 +260,6 @@
} }
.ant-card-body { .ant-card-body {
height: 100%; height: 100%;
} }
} }
...@@ -271,7 +270,7 @@ ...@@ -271,7 +270,7 @@
min-width: 600px; min-width: 600px;
} }
.siteCheckbox .ant-collapse-content>.ant-collapse-content-box { .siteCheckbox .ant-collapse-content > .ant-collapse-content-box {
padding: 16px 16px 0; padding: 16px 16px 0;
} }
...@@ -320,7 +319,7 @@ ...@@ -320,7 +319,7 @@
overflow: auto; overflow: auto;
} }
.sitePanel .ant-checkbox-wrapper+.ant-checkbox-wrapper { .sitePanel .ant-checkbox-wrapper + .ant-checkbox-wrapper {
margin: 0; margin: 0;
} }
...@@ -356,7 +355,8 @@ ...@@ -356,7 +355,8 @@
li { li {
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
background: rgba(24, 144, 255, 0.16) url('../../../assets/images/icons/close.png') no-repeat 170px; background: rgba(24, 144, 255, 0.16) url('../../../assets/images/icons/close.png') no-repeat
170px;
background-size: 20px; background-size: 20px;
background-position: center right; background-position: center right;
margin: 0 10px 10px 0; margin: 0 10px 10px 0;
...@@ -369,7 +369,8 @@ ...@@ -369,7 +369,8 @@
} }
} }
.siteline {} .siteline {
}
.siteBtn { .siteBtn {
width: 100%; width: 100%;
...@@ -389,7 +390,7 @@ ...@@ -389,7 +390,7 @@
.ant-checkbox-group .ant-checkbox-group-item { .ant-checkbox-group .ant-checkbox-group-item {
margin-right: 0px !important; margin-right: 0px !important;
min-width: 300px !important; width: 300px;
} }
.ant-tree-list-holder { .ant-tree-list-holder {
......
import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index'; /*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-06-23 16:42:21
* @LastEditors: leizhe
*/
import { get, post, PUBLISH_SERVICE, CITY_SERVICE, PandaCore } from '@/services/index';
// 基础信息展示 // 基础信息展示
export const GetDataBaseConfig = param => export const GetDataBaseConfig = param =>
...@@ -32,6 +39,10 @@ export const ReloadNginx = param => get(`${PUBLISH_SERVICE}/HostManager/ReloadNg ...@@ -32,6 +39,10 @@ export const ReloadNginx = param => get(`${PUBLISH_SERVICE}/HostManager/ReloadNg
// 获取网关配置 // 获取网关配置
export const GetGateWay = param => get(`${PUBLISH_SERVICE}/HostManager/GetGateWay`, param); export const GetGateWay = param => get(`${PUBLISH_SERVICE}/HostManager/GetGateWay`, param);
export const UpdateGeteWay = param => get(`${PUBLISH_SERVICE}/HostManager/UpdateGeteWay`, param); export const UpdateGeteWay = param => get(`${PUBLISH_SERVICE}/HostManager/UpdateGeteWay`, param);
// 网关配置
export const GetReRoutes = param => get(`${PandaCore}/OcelotSettings/GetReRoutes`, param);
export const SaveRoutes = param => post(`/OcelotSettings/SaveRoutes`, param);
export const DelRoutes = param => get(`/OcelotSettings/DelRoutes`, param);
// 代理服务老接口 // 代理服务老接口
export const GetNginxConfigInfoOLD = param => export const GetNginxConfigInfoOLD = param =>
......
...@@ -7,6 +7,7 @@ const PUBLISH_SERVICE = '/PandaOMS/OMS'; ...@@ -7,6 +7,7 @@ const PUBLISH_SERVICE = '/PandaOMS/OMS';
const WebSERVICE = '/Publish/Web'; const WebSERVICE = '/Publish/Web';
const CoreSERVICE = '/PandaCore/GCK'; const CoreSERVICE = '/PandaCore/GCK';
const PANDA_GIS = '/PandaGIS/MapServer'; const PANDA_GIS = '/PandaGIS/MapServer';
const PandaCore = '/PandaCore/GateWay';
const get = async (url, params, options = {}) => const get = async (url, params, options = {}) =>
request({ request({
url, url,
...@@ -29,4 +30,14 @@ const postForm = async (url, params = {}, options = {}) => { ...@@ -29,4 +30,14 @@ const postForm = async (url, params = {}, options = {}) => {
return post(url, formData, options); return post(url, formData, options);
}; };
export { get, post, postForm, CITY_SERVICE, PUBLISH_SERVICE, WebSERVICE, CoreSERVICE, PANDA_GIS }; export {
get,
post,
postForm,
CITY_SERVICE,
PUBLISH_SERVICE,
WebSERVICE,
CoreSERVICE,
PANDA_GIS,
PandaCore,
};
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-06-28 09:42:40
* @LastEditors: dengchao 754083046@qq.com
*/
import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index'; import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index';
// 1.获取所有已附加的表 // 1.获取所有已附加的表
export const CM_Table_LoadTable = param => get(`${PUBLISH_SERVICE}/CaseManage/LoadTable`, param); export const CM_Table_LoadTable = param => get(`${PUBLISH_SERVICE}/CaseManage/LoadTable`, param);
...@@ -61,3 +68,7 @@ export const ChangeOrder = data => post(`${PUBLISH_SERVICE}/CaseManage/ChangeOrd ...@@ -61,3 +68,7 @@ export const ChangeOrder = data => post(`${PUBLISH_SERVICE}/CaseManage/ChangeOrd
export const CreateTablePost = data => post(`${PUBLISH_SERVICE}/CaseManage/CreateTable`, data); export const CreateTablePost = data => post(`${PUBLISH_SERVICE}/CaseManage/CreateTable`, data);
// 修改表 // 修改表
export const updateTablePost = param => post(`${PUBLISH_SERVICE}/CaseManage/UpdateTable`, param); export const updateTablePost = param => post(`${PUBLISH_SERVICE}/CaseManage/UpdateTable`, param);
// 加载台账
export const LoadLedgers = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Ledger_LoadLedgers`, query);
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