Commit f6166d5b authored by 涂伟's avatar 涂伟
parents 6e7c610b 5e81f878
Pipeline #75604 passed with stages
......@@ -93,7 +93,7 @@
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-react": "^1.0.6",
"@wisdom-cesium/cesium": "1.1.12",
"@wisdom-cesium/krpano": "^1.0.29-55",
"@wisdom-cesium/krpano": "^1.0.29-60",
"@wisdom-map/amap": "1.1.0-beta.45",
"@wisdom-map/arcgismap": "1.4.0-150",
"@wisdom-map/basemap": "1.1.0-24",
......
......@@ -47,13 +47,18 @@ const RuleConfig = props => {
}, [visible]);
// 保存线配置
const onSave = () => {
RuleValidation({ ruleContent: rule, flowId: flowID }).then(res => {
if (res.data) {
onSubumit(rule);
} else {
message.error('请检查规则是否正确');
}
});
if (rule) {
RuleValidation({ ruleContent: rule, flowId: flowID }).then(res => {
if (res.data) {
onSubumit(rule);
} else {
message.error('请检查规则是否正确');
}
});
} else {
onSubumit('');
handleCancel();
}
};
// 处理树数据
const mapTree = (val, index) => ({
......
/* eslint-disable no-else-return */
/* eslint-disable prefer-promise-reject-errors */
/* eslint-disable indent */
/* eslint-disable camelcase */
......@@ -153,6 +154,7 @@ const AddModal = props => {
setType2('');
setFiled1({});
} else if (type === 'edit') {
onChangeFeed(formObj.feedbackName, '', JSON.parse(formObj.mappingFields));
CM_XWBPlan_DataList({ id: formObj.id }).then(res => {
let data = res.data[0];
if (data.isSubmit === '是') {
......@@ -160,10 +162,8 @@ const AddModal = props => {
} else {
setAutoFlag(false);
}
onChangeFeed(data.feedbackName);
setVisibleChecked(data.isSubmit === '是');
setVisibleChecked1(data.autoAssign === '是');
console.log(data);
data && form.setFieldsValue({ ...data });
if (data.parentBusinessName) {
form.setFieldsValue({ parentId: data.parentId });
......@@ -171,8 +171,6 @@ const AddModal = props => {
form.setFieldsValue({ parentId: '' });
}
let mappingFields = JSON.parse(data.mappingFields);
getGetTaskSyncField(mappingFields); // 获取字段名数据
onChangeEvent(data.relationEvent, mappingFields); // 改变关联事件类型
setType1(data.businessType);
......@@ -198,6 +196,8 @@ const AddModal = props => {
getFeedbackTable();
}, []);
useEffect(() => {}, [keepData]);
const getParentList = () => {
GetParentDeviceTemplate({ id: formObj.id }).then(res => {
if (res.code === 0) {
......@@ -239,15 +239,6 @@ const AddModal = props => {
if (validate) {
let obj = form.getFieldsValue();
let mappingFields = formAdd.getFieldValue('parmars');
// mappingFields &&
// mappingFields.forEach(i => {
// keep.forEach(j => {
// if (j === i.fromField) {
// i.fromField = j;
// }
// });
// });
mappingFields &&
mappingFields.forEach(i => {
let data = i.fromField.split('%');
......@@ -279,10 +270,8 @@ const AddModal = props => {
});
}
if (type === 'edit') {
console.log(obj.isSubmit);
obj.isSubmit = visibleChecked === true ? '是' : '否';
obj.autoAssign = visibleChecked1 === true ? '是' : '否';
console.log(obj);
CM_XWBPlan_DataEditORAdd({
...obj,
id: formObj.id,
......@@ -446,7 +435,6 @@ const AddModal = props => {
};
const onOK1 = prop => {
console.log(prop);
setIsVisible(false);
let inputText = {};
inputText[prop.pickItem] = prop.str;
......@@ -464,13 +452,11 @@ const AddModal = props => {
if (e === true) {
setVisibleChecked1(false);
}
console.log(e);
setVisibleChecked(e);
setAutoFlag(e);
};
const change1 = e => {
console.log(e);
setVisibleChecked1(e);
};
......@@ -513,44 +499,42 @@ const AddModal = props => {
};
// 获取字段名数据
const getGetTaskSyncField = e => {
// 编辑时处理数据为下拉框过滤调已选数据
const getGetTaskSyncField = (e, newKeep) => {
// 编辑时初始处理数据为下拉框过滤调已选数据
let dataList = newKeep ? newKeep : keep;
if (e) {
// 编辑时
let datalist = [...e];
// datalist.forEach(i => {
// keep.forEach(j => {
// if (j === i.fromField) {
// i.fromField = j;
// }
// });
// });
let arr = [];
datalist.forEach(i => {
if (i.fromTable) {
arr.push({ fromField: `${i.fromField}%${i.fromTable}`, toField: i.toField });
} else {
arr.push({ fromField: i.fromField, toField: i.toField });
}
});
formAdd.setFieldsValue({ parmars: arr }); // 处理数据让下拉框回显title值
let aa = e;
let from = [];
aa.forEach(i => {
if (i && i.fromField) {
from.push(i.fromField);
from.push(`${i.fromField}%${i.fromTable}`);
}
});
let lastFrom = [];
keep.forEach(j => {
dataList.forEach(j => {
if (from.indexOf(j) === -1) {
lastFrom.push(j);
}
});
// let bb = detailData(dataList, from);
// setKeepData(lastFrom);
// setKeep(lastFrom);
let arr = [];
datalist.forEach(i => {
if (i.fromTable) {
arr.push({ fromField: `${i.fromField}%${i.fromTable}`, toField: i.toField });
} else {
arr.push({ fromField: i.fromField, toField: i.toField });
}
});
setTimeout(() => {
formAdd.setFieldsValue({ parmars: arr }); // 处理数据让下拉框回显title值
}, 0);
} else {
setKeepData(keep);
setKeepData(dataList);
}
// setKeep(res.data);
};
const changeValue = () => {
......@@ -566,16 +550,15 @@ const AddModal = props => {
to.push(i.toField);
}
});
let lastFrom = [];
let lastTo = [];
let lastFrom = [];
keep.forEach(j => {
if (from.indexOf(j) === -1) {
lastFrom.push(j);
}
});
let bb = detailData(keep, from);
setKeepData(lastFrom);
// let bb = detailData(keep, from);
// setKeepData(lastFrom);
keepAll.forEach(j => {
if (to.indexOf(j.name) === -1) {
lastTo.push(j);
......@@ -597,12 +580,11 @@ const AddModal = props => {
// newKeep[i.TableName].push(j);
// }
// }
if (from.indexOf(data) === -1) {
if (!newKeep[i.TableName]) {
newKeep[i.TableName] = [j];
} else {
newKeep[i.TableName].push(j);
}
j.show = true;
} else {
j.show = false;
}
});
});
......@@ -611,7 +593,7 @@ const AddModal = props => {
keys.forEach(item => {
arr.push({ TableName: item, TableFields: newKeep[item] });
});
return arr;
return val;
};
// 改变关联事件类型
......@@ -698,7 +680,7 @@ const AddModal = props => {
return arr;
};
const onChangeFeed = val => {
const onChangeFeed = (val, flag, str) => {
GetFeedbackTableFields({ feedbackName: val }).then(res => {
if (res.code === 0) {
let newData = [res.data.DeviceData];
......@@ -707,7 +689,12 @@ const AddModal = props => {
newData.push(i);
});
setKeepData(newData);
debugger;
setKeep(newData);
if (str) {
// 编辑初次回显处理过滤下拉款数据
getGetTaskSyncField(str, newData);
}
}
});
GetAccountConfigInfo({ accountName: val }).then(res => {
......@@ -718,6 +705,9 @@ const AddModal = props => {
setFieldList(data);
}
});
if (flag) {
formAdd.setFieldsValue({ parmars: [] });
}
};
const saveRule = e => {
......@@ -898,7 +888,7 @@ const AddModal = props => {
placeholder="请选择反馈名称"
showSearch
allowClear
onChange={e => onChangeFeed(e)}
onChange={e => onChangeFeed(e, 1)}
>
{filed
? filed.map((item, index) => (
......@@ -1117,7 +1107,21 @@ const AddModal = props => {
name={[name, 'fromField']}
fieldKey={[fieldKey, 'key']}
validateTrigger={['onChange', 'onBlur']}
rules={[{ required: true, message: '请填写字段名' }]}
rules={[
{ required: true, message: '请填写字段名' },
{
validator: (rule, value) => {
let filterValue = formAdd.getFieldsValue().parmars;
let num = filterValue.findIndex(i => i.fromField === value);
let index = rule.field.split('.')[1];
// debugger
if (num !== undefined && num !== Number(index)) {
return Promise.reject('字段重复');
}
return Promise.resolve();
},
},
]}
>
<TreeSelect
showSearch
......
......@@ -549,7 +549,7 @@ const ChangeRoles = props => {
showTotal={item => `共 ${item} 条`}
defaultPageSize={pageSize}
defaultCurrent={1}
pageSizeOptions={[10, 20, 40, 100]}
pageSizeOptions={[10, 20, 50, 100]}
current={currentPage}
onChange={paginationChange}
style={{ marginBottom: '10px' }}
......
......@@ -593,7 +593,7 @@ const ChangeAddFlows = props => {
defaultCurrent={1}
current={currentPage}
onChange={paginationChange}
pageSizeOptions={[10, 20, 40, 100]}
pageSizeOptions={[10, 20, 50, 100]}
style={{ marginBottom: '10px' }}
size="small"
showQuickJumper
......
......@@ -11,10 +11,11 @@ const ConfigCase = (props, ref) => {
useEffect(() => {
form.resetFields();
const { EventsInformation, IsSendMessage } = editMsg;
const { EventsInformation, IsSendMessage, IsHookingGis } = editMsg;
const obj = {
EventsInformation: EventsInformation === 1,
IsSendMessage: IsSendMessage === 1,
IsHookingGis: IsHookingGis === 1,
};
form.setFieldsValue({ ...editMsg, ...obj });
......@@ -51,7 +52,9 @@ const ConfigCase = (props, ref) => {
case 'IsSendMessage':
value = changedFields[0].value ? 1 : 0;
break;
case 'IsHookingGis':
value = changedFields[0].value ? 1 : 0;
break;
default:
value = changedFields[0].value;
break;
......@@ -86,6 +89,20 @@ const ConfigCase = (props, ref) => {
>
<Switch checkedChildren="是" unCheckedChildren="否" />
</Form.Item>
<div
style={{
display: editMsg.NodeType === '2' ? 'block' : 'none',
}}
>
<Form.Item
valuePropName="checked"
style={{ marginBottom: '0', padding: '2px', borderBottom: '1px solid #ccc' }}
label="挂接GIS设备"
name="IsHookingGis"
>
<Switch checkedChildren="是" unCheckedChildren="否" />
</Form.Item>
</div>
<Form.Item
valuePropName="checked"
style={{
......
......@@ -46,6 +46,11 @@ const LoginLog = () => {
onFilter: (value, record) => record.LoginName === value,
filteredValue,
},
{
title: 'IP',
dataIndex: 'IP',
key: 'IP',
},
{
title: '用户名',
dataIndex: 'ShowName',
......
......@@ -384,7 +384,7 @@ const OmsLog = () => {
showTotal={(aa, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`}
defaultPageSize={pageSize}
defaultCurrent={1}
pageSizeOptions={[10, 20, 40, 100]}
pageSizeOptions={[10, 20, 50, 100]}
current={currentPage}
onChange={paginationChange}
size="small"
......
......@@ -500,7 +500,7 @@ const ModelFileManage = () => {
showTotal={(aa, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`}
defaultPageSize={pageSize}
defaultCurrent={1}
pageSizeOptions={[10, 20, 40, 100]}
pageSizeOptions={[10, 20, 50, 100]}
current={currentPage}
onChange={paginationChange}
size="small"
......
......@@ -302,13 +302,14 @@ const NewSelectUser = props => {
total={total}
showTotal={(totals, range) => `第${range[0]}-${range[1]} 条/共 ${totals} 条`}
defaultPageSize={pageSize}
pageSizeOptions={[10, 20]}
pageSizeOptions={[10, 20, 50, 100]}
defaultCurrent={1}
current={currentPage}
onChange={paginationChange}
style={{ marginBottom: '10px', width: '70%' }}
size="small"
showQuickJumper
showSizeChanger
/>
{/* </Modal> */}
......
......@@ -320,7 +320,8 @@ const UserModal = props => {
current={page.pageNum}
defaultPageSize="5"
onChange={handleChangePage}
pageSizeOptions={['5']}
// pageSizeOptions={['5']}
pageSizeOptions={[10, 20, 40, 100]}
/>
</div>
</Card>
......
......@@ -1844,7 +1844,7 @@ const UserManage = () => {
defaultPageSize={pageSize}
defaultCurrent={1}
showSizeChanger
pageSizeOptions={[10, 20, 40, 100]}
pageSizeOptions={[10, 20, 50, 100]}
current={currentPage}
onChange={paginationChange}
style={{ marginBottom: '10px' }}
......
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