Commit ac0d34bb authored by 涂伟's avatar 涂伟
parents c480131e 9c0f796d
Pipeline #94247 passed with stages
import React, { useEffect, useState, useRef } from 'react';
import { Button, Divider, Tooltip, message } from 'antd';
import { Button, Divider, Tooltip, message, Modal } from 'antd';
import classNames from 'classnames';
import ConfigSubprocess from './nodeModalComponents/ConfigSubprocess';
......@@ -14,7 +14,10 @@ import ConfigGIS from './nodeModalComponents/ConfigGIS';
import ConfigAccount from './ConfigAccount';
import ConfigTimeLimit from './nodeModalComponents/ConfigTimeLimit';
import CongfigHeightMsg from './nodeModalComponents/CongfigHeightMsg';
import {
getTableInfo,
} from '@/services/tablemanager/tablemanager';
const { confirm } = Modal;
import styles from './NodeModal.less';
const tabList = ['常用配置', '权限配置', '高级配置'];
const NodeModal = props => {
......@@ -42,12 +45,40 @@ const NodeModal = props => {
const refConfigAccount = useRef();
const refConfigTimeLimit = useRef();
const refCongfigHeightMsg = useRef();
let needConfigField = useRef(false); //首节点验证是否配置了处理站点
useEffect(() => {
console.log(editMsg, afterNodes, 'editMsgeditMsgeditMsg');
setActiveConfig('常用配置');
if(editMsg.NodeType == 1){
getVaildField();
}
}, [editMsg]);
const getVaildField = () => {
getTableInfo({ tableName: editMsg.TableName, isIncludeField: true }).then(res => {
if (res.data.root && res.data.root.length) {
const tableFields = res.data.root[0].TableFields || [];
needConfigField.current = tableFields.some(t => t.Key === '处理站点');
}
// eslint-disable-next-line no-lone-blocks
// {
// form.setFieldsValue({ tableStyle: '大' });
// }
});
}
const onOk = () => {
//首节点检查有无配置处【处理站点】
if(needConfigField.current && !editMsg.Fields?.split(',')?.includes('处理站点')){
confirm({
title: '提示',
content: <>首节点未配置<span style={{ color: 'red' }}>处理站点</span>,确定继续吗?</>,
onOk: onFinish
})
}else{
onFinish();
}
}
// 提交表单
const onFinish = () => {
// 规则填写校验
......@@ -65,6 +96,7 @@ const NodeModal = props => {
...refConfigTimeLimit.current?.getParmar(),
};
// 开始中间结束节点才校验表名编辑字段
const arr = ['0', '1', '2'];
if (arr.includes(editMsg.NodeType)) {
......@@ -296,7 +328,7 @@ const NodeModal = props => {
</div>
</div>
<div className={styles.footer}>
<Button type="primary" onClick={onFinish}>
<Button type="primary" onClick={onOk}>
确定
</Button>
</div>
......
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