Commit 2f66a49f authored by 皮倩雯's avatar 皮倩雯

fix: '关联表单形态映射字段切换提交增加验证'

parent f600299e
Pipeline #62962 passed with stages
......@@ -49,6 +49,7 @@ import {
InfoCircleOutlined,
MinusCircleOutlined,
PlusOutlined,
SwapOutlined,
} from '@ant-design/icons';
import styles from './index.less';
import VerifyModal from './VerifyModal';
......@@ -215,235 +216,244 @@ const AddModal = props => {
// 不切换树
if (valueData.length == 0) {
console.log(pramData);
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
let aa = '';
if (synchronization == true) {
aa = 1;
} else {
aa = 0;
}
console.log(Shape);
let data = [
{
Unit: obj.Unit || '',
StoreType: pramData.StoreType,
Group: pramData.Group || '',
Shape,
ExceptionEvent: pramData.ExceptionEvent || '',
RowSpan: Number(obj.RowSpan) || 0,
ColSpan: pramData.ColSpan || 0,
ReadOnly: pramData.ReadOnly || false,
EditableLater: pramData.EditableLater || false,
ExceptionValue: pramData.ExceptionValue || '',
Preset: pramData.Preset || '',
ID: pramData.ID,
Order: pramData.Order,
Name: obj.Name,
Alias: obj.Alias,
SyncEvent: aa,
ValidationRule: obj.ValidationRule,
ExceptionEventFields: characterValue,
},
];
console.log(data);
switch (Shape) {
case '编码':
data[0].Config = `${obj.code}.${obj.prefix ? obj.prefix : ''}`;
break;
case '坐标控件':
pramData.coordinates ? (data[0].Config = '当前坐标') : (data[0].Config = '');
break;
case '图片':
case '可预览图片':
// data[0].Config = pramData.picture ? '拍照相册' : '';
data[0].Preset = pramData.picture ? '拍照相册' : '';
data[0].ValidationRule = pramData.must ? 'required' : '';
break;
case '值选择器':
if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config;
} else if (radiostyle == 1) {
// 平铺值选择器
data[0].Config = cho ? `${obj.Config}.n` : `${obj.Config}`;
} else {
data[0].Config = obj.Config;
}
break;
case '搜索选择器':
if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config;
} else {
// 平铺值选择器
data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
}
break;
case '部门选择器':
if (obj.check == 0) {
data[0].Config = '';
formAdd.validateFields().then(validate1 => {
if (validate1) {
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
let aa = '';
if (synchronization == true) {
aa = 1;
} else {
data[0].Config = '.n';
aa = 0;
}
break;
case '唯一值文本':
data[0].Config = obj.fieldName
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}`;
break;
case '站点选择器':
console.log(obj);
console.log(obj.pepole);
console.log(obj.choose);
console.log(pep);
console.log(cho);
data[0].Config = pep ? `本人${cho ? '.n' : ''}` : `全部${cho ? '.n' : ''}`;
break;
case '业务选择器':
if (obj.fieldName.endsWith('.n')) {
data[0].Config = obj.fieldName
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}`;
} else if (obj.fieldName) {
data[0].Config =
radio == 0
console.log(Shape);
let data = [
{
Unit: obj.Unit || '',
StoreType: pramData.StoreType,
Group: pramData.Group || '',
Shape,
ExceptionEvent: pramData.ExceptionEvent || '',
RowSpan: Number(obj.RowSpan) || 0,
ColSpan: pramData.ColSpan || 0,
ReadOnly: pramData.ReadOnly || false,
EditableLater: pramData.EditableLater || false,
ExceptionValue: pramData.ExceptionValue || '',
Preset: pramData.Preset || '',
ID: pramData.ID,
Order: pramData.Order,
Name: obj.Name,
Alias: obj.Alias,
SyncEvent: aa,
ValidationRule: obj.ValidationRule,
ExceptionEventFields: characterValue,
},
];
console.log(data);
switch (Shape) {
case '编码':
data[0].Config = `${obj.code}.${obj.prefix ? obj.prefix : ''}`;
break;
case '坐标控件':
pramData.coordinates ? (data[0].Config = '当前坐标') : (data[0].Config = '');
break;
case '图片':
case '可预览图片':
// data[0].Config = pramData.picture ? '拍照相册' : '';
data[0].Preset = pramData.picture ? '拍照相册' : '';
data[0].ValidationRule = pramData.must ? 'required' : '';
break;
case '值选择器':
if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config;
} else if (radiostyle == 1) {
// 平铺值选择器
data[0].Config = cho ? `${obj.Config}.n` : `${obj.Config}`;
} else {
data[0].Config = obj.Config;
}
break;
case '搜索选择器':
if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config;
} else {
// 平铺值选择器
data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
}
break;
case '部门选择器':
if (obj.check == 0) {
data[0].Config = '';
} else {
data[0].Config = '.n';
}
break;
case '唯一值文本':
data[0].Config = obj.fieldName
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}.${obj.fieldName}.n`;
} else {
data[0].Config = radio == 0 ? `${obj.tableName}` : `${obj.tableName}.n`;
}
break;
case '台账选择器':
if (obj.fieldName.endsWith('.n')) {
data[0].Config = `${obj.standingBook}.${obj.fieldName}`;
} else if (obj.fieldName) {
data[0].Config =
radio == 0
? `${obj.standingBook}.${obj.fieldName}`
: `${obj.standingBook}.${obj.fieldName}.n`;
} else {
data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`;
}
if (obj.filterName) {
data[0].Config = `${data[0].Config}?${obj.filterName}`;
}
break;
case '关联表单':
let aalist = {};
let arrlist = {};
aalist.台账名称 = obj.standingBook;
arrlist.key = obj.workOrder;
arrlist.value = obj.eventOrder;
aalist.默认显示 = visibleChecked || false;
aalist.控制规则 = obj.configName;
console.log(formAdd.getFieldValue('parmars'))
let lii = [];
if(formAdd.getFieldValue('parmars')){
lii = [...formAdd.getFieldValue('parmars')]
}
console.log(lii);
lii.push(arrlist);
aalist.映射字段 = lii;
data[0].Config = JSON.stringify(aalist);
break;
case '选择器':
if (cse) {
let str = cho
? `${obj.farter}.${obj.farterData}.n`
: `${obj.farter}.${obj.farterData}`;
data[0].Config = str;
} else {
console.log(obj.Config);
let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
data[0].Config = str;
}
break;
case '人员选择器':
if (popeleShape == '分组模态') {
if (checkboxAllID1 == true) {
if (obj.ConfigName) {
let str = cho ? `全部ID.${obj.ConfigName}.n` : `全部ID.${obj.ConfigName}`;
: `${obj.tableName}`;
break;
case '站点选择器':
console.log(obj);
console.log(obj.pepole);
console.log(obj.choose);
console.log(pep);
console.log(cho);
data[0].Config = pep ? `本人${cho ? '.n' : ''}` : `全部${cho ? '.n' : ''}`;
break;
case '业务选择器':
if (obj.fieldName.endsWith('.n')) {
data[0].Config = obj.fieldName
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}`;
} else if (obj.fieldName) {
data[0].Config =
radio == 0
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}.${obj.fieldName}.n`;
} else {
data[0].Config = radio == 0 ? `${obj.tableName}` : `${obj.tableName}.n`;
}
break;
case '台账选择器':
if (obj.fieldName.endsWith('.n')) {
data[0].Config = `${obj.standingBook}.${obj.fieldName}`;
} else if (obj.fieldName) {
data[0].Config =
radio == 0
? `${obj.standingBook}.${obj.fieldName}`
: `${obj.standingBook}.${obj.fieldName}.n`;
} else {
data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`;
}
if (obj.filterName) {
data[0].Config = `${data[0].Config}?${obj.filterName}`;
}
break;
case '关联表单':
let aalist = {};
let arrlist = {};
aalist.台账名称 = obj.standingBook;
arrlist.key = obj.workOrder;
arrlist.value = obj.eventOrder;
aalist.默认显示 = visibleChecked || false;
aalist.控制规则 = obj.configName;
console.log(formAdd.getFieldValue('parmars'))
let lii = [];
if(formAdd.getFieldValue('parmars')){
lii = [...formAdd.getFieldValue('parmars')]
}
console.log(lii);
lii.push(arrlist);
aalist.映射字段 = lii;
data[0].Config = JSON.stringify(aalist);
break;
case '选择器':
if (cse) {
let str = cho
? `${obj.farter}.${obj.farterData}.n`
: `${obj.farter}.${obj.farterData}`;
data[0].Config = str;
} else {
let str = cho ? `全部ID.n` : `全部ID`;
console.log(obj.Config);
let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
data[0].Config = str;
}
break;
case '人员选择器':
if (popeleShape == '分组模态') {
if (checkboxAllID1 == true) {
if (obj.ConfigName) {
let str = cho ? `全部ID.${obj.ConfigName}.n` : `全部ID.${obj.ConfigName}`;
data[0].Config = str;
} else {
let str = cho ? `全部ID.n` : `全部ID`;
data[0].Config = str;
}
} else if (obj.ConfigName) {
let str = cho ? `全部.${obj.ConfigName}.n` : `全部.${obj.ConfigName}`;
data[0].Config = str;
} else {
let str = cho ? `全部.n` : `全部`;
data[0].Config = str;
}
} else if (popeleShape == '下拉框') {
let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
console.log(str);
data[0].Config = str;
} else if (popeleShape == '树形模态') {
if (gl) {
let str = cho ? `tree.多选|站点` : `tree.单选|站点`;
data[0].Config = str;
} else {
let str = cho ? `tree.多选|非站点` : `tree.单选|非站点`;
data[0].Config = str;
}
}
} else if (obj.ConfigName) {
let str = cho ? `全部.${obj.ConfigName}.n` : `全部.${obj.ConfigName}`;
data[0].Config = str;
break;
default:
data[0].Config = obj.Config;
}
console.log(data);
if (Shape == '图片') {
if (view) {
data[0].Shape = '可预览图片';
} else {
let str = cho ? `全部.n` : `全部`;
data[0].Config = str;
data[0].Shape = '图片';
}
} else if (popeleShape == '下拉框') {
let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
console.log(str);
data[0].Config = str;
} else if (popeleShape == '树形模态') {
if (gl) {
let str = cho ? `tree.多选|站点` : `tree.单选|站点`;
data[0].Config = str;
}
if (Shape == '附件') {
if (preView) {
data[0].Shape = '可预览附件';
} else {
let str = cho ? `tree.多选|非站点` : `tree.单选|非站点`;
data[0].Config = str;
data[0].Shape = '附件';
}
}
break;
default:
data[0].Config = obj.Config;
}
console.log(data);
if (Shape == '图片') {
if (view) {
data[0].Shape = '可预览图片';
} else {
data[0].Shape = '图片';
}
}
if (Shape == '附件') {
if (preView) {
data[0].Shape = '可预览附件';
} else {
data[0].Shape = '附件';
}
}
if (Shape == '值选择器') {
if (radiostyle == 0) {
if (!cho) {
data[0].Shape = '值选择器';
} else {
data[0].Shape = '值复选器';
if (Shape == '值选择器') {
if (radiostyle == 0) {
if (!cho) {
data[0].Shape = '值选择器';
} else {
data[0].Shape = '值复选器';
}
} else {
data[0].Shape = '平铺值选择器';
}
}
} else {
data[0].Shape = '平铺值选择器';
}
}
console.log(data);
UpdateFields(data).then(res => {
setLoading(false);
if (res.msg === 'Ok' || res.msg === '') {
form.resetFields();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: '修改成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
console.log(data);
UpdateFields(data).then(res => {
setLoading(false);
if (res.msg === 'Ok' || res.msg === '') {
form.resetFields();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: '修改成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
}
});
}
});
} else {
onSelect(1.14, keep);
formAdd.validateFields().then(validate => {
if (validate) {
onSelect(1.14, keep);
}
});
}
};
......@@ -1230,7 +1240,8 @@ const AddModal = props => {
value == '图片' ||
value == '可预览图片' ||
value == '录音' ||
value == '视频'
value == '视频'||
value == '关联表单'
) {
form.setFieldsValue({ RowSpan: 6 });
} else {
......@@ -2319,294 +2330,312 @@ const AddModal = props => {
}
}
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
let aa = '';
if (synchronization == true) {
aa = 1;
} else {
aa = 0;
}
console.log(obj);
let data = [
{
Unit: obj.Unit || '',
StoreType: pramData.StoreType,
Group: pramData.Group || '',
Shape,
ExceptionEvent: pramData.ExceptionEvent || '',
RowSpan: Number(obj.RowSpan) || 0,
ColSpan: pramData.ColSpan || 0,
ReadOnly: pramData.ReadOnly || false,
EditableLater: pramData.EditableLater || false,
ExceptionValue: pramData.ExceptionValue || '',
Preset: pramData.Preset || '',
ID: pramData.ID,
Order: pramData.Order,
Name: obj.Name,
Alias: obj.Alias,
SyncEvent: aa,
ValidationRule: obj.ValidationRule,
ExceptionEventFields: characterValue,
},
];
console.log(Shape);
if (Shape == '图片') {
if (view) {
data[0].Shape = '可预览图片';
} else {
data[0].Shape = '图片';
}
}
if (Shape == '附件') {
if (preView) {
data[0].Shape = '可预览附件';
} else {
data[0].Shape = '附件';
}
}
if (Shape == '值选择器') {
if (radiostyle == 0) {
if (!cho) {
data[0].Shape = '值选择器';
} else {
data[0].Shape = '值复选器';
}
} else {
data[0].Shape = '平铺值选择器';
}
}
switch (Shape) {
case '编码':
data[0].Config = `${obj.code}.${obj.prefix ? obj.prefix : ''}`;
break;
case '坐标控件':
pramData.coordinates ? (data[0].Config = '当前坐标') : (data[0].Config = '');
break;
case '图片':
case '可预览图片':
// data[0].Config = pramData.picture ? '拍照相册' : '';
data[0].Preset = pramData.picture ? '拍照相册' : '';
data[0].ValidationRule = pramData.must ? 'required' : '';
break;
case '搜索选择器':
if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config;
} else {
data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
}
break;
case '唯一值文本':
data[0].Config = obj.fieldName
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}`;
break;
case '站点选择器':
data[0].Config = pep ? `本人${cho ? '.n' : ''}` : `全部${cho ? '.n' : ''}`;
break;
case '业务选择器':
if (obj.fieldName.endsWith('.n')) {
data[0].Config = obj.fieldName
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}`;
} else if (obj.fieldName) {
data[0].Config =
radio == 0
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}.${obj.fieldName}.n`;
} else {
data[0].Config = radio == 0 ? `${obj.tableName}` : `${obj.tableName}.n`;
}
break;
case '部门选择器':
if (obj.check == 0) {
data[0].Config = '';
} else {
data[0].Config = '.n';
}
break;
case '台账选择器':
if (obj.fieldName.endsWith('.n')) {
data[0].Config = `${obj.standingBook}.${obj.fieldName}`;
} else if (obj.fieldName) {
data[0].Config =
radio == 0
? `${obj.standingBook}.${obj.fieldName}`
: `${obj.standingBook}.${obj.fieldName}.n`;
} else {
data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`;
}
if (obj.filterName) {
data[0].Config = `${data[0].Config}?${obj.filterName}`;
}
break;
case '关联表单':
let aalist = {};
let arrlist = {};
aalist.台账名称 = obj.standingBook;
arrlist.key = obj.workOrder;
arrlist.value = obj.eventOrder;
aalist.默认显示 = visibleChecked || false;
aalist.控制规则 = obj.configName;
let lii = [];
if(formAdd.getFieldValue('parmars')){
lii = [...formAdd.getFieldValue('parmars')]
}
console.log(lii);
lii.push(arrlist);
aalist.映射字段 = lii;
data[0].Config = JSON.stringify(aalist);
break;
case '选择器':
if (cse) {
let str = cho
? `${obj.farter}.${obj.farterData}.n`
: `${obj.farter}.${obj.farterData}`;
data[0].Config = str;
} else {
let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
data[0].Config = str;
}
break;
case '值选择器':
if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config;
} else if (radiostyle == 1) {
// 平铺值选择器
data[0].Config = cho ? `${obj.Config}.n` : `${obj.Config}`;
} else {
data[0].Config = obj.Config;
}
break;
case '人员选择器':
if (popeleShape == '分组模态') {
if (checkboxAllID1 == true) {
if (obj.ConfigName) {
let str = cho ? `全部ID.${obj.ConfigName}.n` : `全部ID.${obj.ConfigName}`;
data[0].Config = str;
// formAdd.validateFields().then(validate1 => {
// if(validate1){
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
let aa = '';
if (synchronization == true) {
aa = 1;
} else {
aa = 0;
}
console.log(obj);
let data = [
{
Unit: obj.Unit || '',
StoreType: pramData.StoreType,
Group: pramData.Group || '',
Shape,
ExceptionEvent: pramData.ExceptionEvent || '',
RowSpan: Number(obj.RowSpan) || 0,
ColSpan: pramData.ColSpan || 0,
ReadOnly: pramData.ReadOnly || false,
EditableLater: pramData.EditableLater || false,
ExceptionValue: pramData.ExceptionValue || '',
Preset: pramData.Preset || '',
ID: pramData.ID,
Order: pramData.Order,
Name: obj.Name,
Alias: obj.Alias,
SyncEvent: aa,
ValidationRule: obj.ValidationRule,
ExceptionEventFields: characterValue,
},
];
console.log(Shape);
if (Shape == '图片') {
if (view) {
data[0].Shape = '可预览图片';
} else {
let str = cho ? `全部ID.n` : `全部ID`;
data[0].Config = str;
data[0].Shape = '图片';
}
}
if (Shape == '附件') {
if (preView) {
data[0].Shape = '可预览附件';
} else {
data[0].Shape = '附件';
}
} else if (obj.ConfigName) {
let str = cho ? `全部.${obj.ConfigName}.n` : `全部.${obj.ConfigName}`;
data[0].Config = str;
} else {
let str = cho ? `全部.n` : `全部`;
data[0].Config = str;
}
} else if (popeleShape == '下拉框') {
let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
data[0].Config = str;
} else if (popeleShape == '树形模态') {
if (gl) {
let str = cho ? `tree.多选|站点` : `tree.单选|站点`;
data[0].Config = str;
if (Shape == '值选择器') {
if (radiostyle == 0) {
if (!cho) {
data[0].Shape = '值选择器';
} else {
data[0].Shape = '值复选器';
}
} else {
data[0].Shape = '平铺值选择器';
}
}
switch (Shape) {
case '编码':
data[0].Config = `${obj.code}.${obj.prefix ? obj.prefix : ''}`;
break;
case '坐标控件':
pramData.coordinates ? (data[0].Config = '当前坐标') : (data[0].Config = '');
break;
case '图片':
case '可预览图片':
// data[0].Config = pramData.picture ? '拍照相册' : '';
data[0].Preset = pramData.picture ? '拍照相册' : '';
data[0].ValidationRule = pramData.must ? 'required' : '';
break;
case '搜索选择器':
if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config;
} else {
data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
}
break;
case '唯一值文本':
data[0].Config = obj.fieldName
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}`;
break;
case '站点选择器':
data[0].Config = pep ? `本人${cho ? '.n' : ''}` : `全部${cho ? '.n' : ''}`;
break;
case '业务选择器':
if (obj.fieldName.endsWith('.n')) {
data[0].Config = obj.fieldName
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}`;
} else if (obj.fieldName) {
data[0].Config =
radio == 0
? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}.${obj.fieldName}.n`;
} else {
data[0].Config = radio == 0 ? `${obj.tableName}` : `${obj.tableName}.n`;
}
break;
case '部门选择器':
if (obj.check == 0) {
data[0].Config = '';
} else {
data[0].Config = '.n';
}
break;
case '台账选择器':
if (obj.fieldName.endsWith('.n')) {
data[0].Config = `${obj.standingBook}.${obj.fieldName}`;
} else if (obj.fieldName) {
data[0].Config =
radio == 0
? `${obj.standingBook}.${obj.fieldName}`
: `${obj.standingBook}.${obj.fieldName}.n`;
} else {
data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`;
}
if (obj.filterName) {
data[0].Config = `${data[0].Config}?${obj.filterName}`;
}
break;
case '关联表单':
let aalist = {};
let arrlist = {};
aalist.台账名称 = obj.standingBook;
arrlist.key = obj.workOrder;
arrlist.value = obj.eventOrder;
aalist.默认显示 = visibleChecked || false;
aalist.控制规则 = obj.configName;
let lii = [];
if(formAdd.getFieldValue('parmars')){
lii = [...formAdd.getFieldValue('parmars')]
}
console.log(lii);
lii.push(arrlist);
let lia = [];
lii.length>0 &&lii.map(i=>{
if(i){
if(i.key&&i.value){
lia.push(i)
}
}
})
console.log(lia)
aalist.映射字段 = lia;
console.log(aalist);
data[0].Config = JSON.stringify(aalist);
break;
case '选择器':
if (cse) {
let str = cho
? `${obj.farter}.${obj.farterData}.n`
: `${obj.farter}.${obj.farterData}`;
data[0].Config = str;
} else {
let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
data[0].Config = str;
}
break;
case '值选择器':
if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config;
} else if (radiostyle == 1) {
// 平铺值选择器
data[0].Config = cho ? `${obj.Config}.n` : `${obj.Config}`;
} else {
data[0].Config = obj.Config;
}
break;
case '人员选择器':
if (popeleShape == '分组模态') {
if (checkboxAllID1 == true) {
if (obj.ConfigName) {
let str = cho ? `全部ID.${obj.ConfigName}.n` : `全部ID.${obj.ConfigName}`;
data[0].Config = str;
} else {
let str = cho ? `全部ID.n` : `全部ID`;
data[0].Config = str;
}
} else if (obj.ConfigName) {
let str = cho ? `全部.${obj.ConfigName}.n` : `全部.${obj.ConfigName}`;
data[0].Config = str;
} else {
let str = cho ? `全部.n` : `全部`;
data[0].Config = str;
}
} else if (popeleShape == '下拉框') {
let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
data[0].Config = str;
} else if (popeleShape == '树形模态') {
if (gl) {
let str = cho ? `tree.多选|站点` : `tree.单选|站点`;
data[0].Config = str;
} else {
let str = cho ? `tree.多选|非站点` : `tree.单选|非站点`;
data[0].Config = str;
}
}
break;
default:
data[0].Config = obj.Config;
}
console.log(data[0]);
let aadata = valueData;
console.log(keepTreeFirst);
// if (keepTreeFirst.indexOf(e.node.org.name) == -1) {
if (aadata.length > 0) {
let aa = [];
aadata.map(i => {
aa.push(i.ID);
});
if (aa.indexOf(data[0].ID) != -1) {
aadata.map((i, j) => {
if (i.ID == data[0].ID) {
aadata[j] = data[0];
}
});
} else {
aadata.push(data[0]);
}
} else {
let str = cho ? `tree.多选|非站点` : `tree.单选|非站点`;
data[0].Config = str;
aadata.push(data[0]);
}
// }
console.log(valueData);
console.log(aadata);
setValueData(aadata);
form.setFieldsValue({
Association: '',
Config: '',
guolv: '',
ConfigName: '',
tableName: '',
fieldName: '',
filterName: '',
filterValue: '',
standingBook: '',
check: 0,
AllID: '0',
All: '0',
AllID1: '',
All1: '',
ShowConfig: '',
pepole: '',
choose: '',
SyncEvent: '',
PeShape: '',
farter: '',
farterData: '',
workOrder: '',
eventOrder: '',
configName: '',
});
setVisibleChecked(true);
setCse('');
setPopeleShape('');
setRadio(0);
setRadiostyle(0);
setRadio3('0');
setRadio1('0');
setGl('');
setPep('');
setCho('');
setCheckboxAll1('');
setCheckboxAllID1('');
setSynchronization(false);
setFlag(false);
setPopeleShape('');
setHide(true);
if (i == 1.14) {
console.log(valueData);
UpdateFields(valueData).then(res => {
setLoading(false);
if (res.msg === 'Ok' || res.msg === '') {
form.resetFields();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: '修改成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
}
}
break;
default:
data[0].Config = obj.Config;
}
console.log(data[0]);
let aadata = valueData;
console.log(keepTreeFirst);
// if (keepTreeFirst.indexOf(e.node.org.name) == -1) {
if (aadata.length > 0) {
let aa = [];
aadata.map(i => {
aa.push(i.ID);
});
if (aa.indexOf(data[0].ID) != -1) {
aadata.map((i, j) => {
if (i.ID == data[0].ID) {
aadata[j] = data[0];
}
});
} else {
aadata.push(data[0]);
}
} else {
aadata.push(data[0]);
}
// }
console.log(valueData);
// });
console.log(aadata);
setValueData(aadata);
form.setFieldsValue({
Association: '',
Config: '',
guolv: '',
ConfigName: '',
tableName: '',
fieldName: '',
filterName: '',
filterValue: '',
standingBook: '',
check: 0,
AllID: '0',
All: '0',
AllID1: '',
All1: '',
ShowConfig: '',
pepole: '',
choose: '',
SyncEvent: '',
PeShape: '',
farter: '',
farterData: '',
workOrder: '',
eventOrder: '',
configName: '',
});
setVisibleChecked(true);
setCse('');
setPopeleShape('');
setRadio(0);
setRadiostyle(0);
setRadio3('0');
setRadio1('0');
setGl('');
setPep('');
setCho('');
setCheckboxAll1('');
setCheckboxAllID1('');
setSynchronization(false);
setFlag(false);
setPopeleShape('');
setHide(true);
if (i == 1.14) {
console.log(valueData);
UpdateFields(valueData).then(res => {
setLoading(false);
if (res.msg === 'Ok' || res.msg === '') {
form.resetFields();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: '修改成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
}
}
});
};
const onChange2 = e => {
......@@ -3296,19 +3325,20 @@ const AddModal = props => {
<Col span={11}>
<Item
name="workOrder"
rules={[{ required: true, message: '请输入映射名' }]}
rules={[{ required: true, message: '请输入字段名' }]}
style={{ marginBottom:0}}
>
<Input placeholder="请输入映射名" />
<Input placeholder="请输入字段名" />
</Item>
</Col>
<Col span={2} style={{paddingTop:'3px'}}><SwapOutlined style={{marginLeft:'14px'}}/></Col>
<Col span={11}>
<Item
name="eventOrder"
rules={[{ required: true, message: '请输入映射' }]}
rules={[{ required: true, message: '请输入映射字段名' }]}
style={{ marginBottom:0}}
>
<Input placeholder="请输入映射值" style={{marginLeft:'41px', width:'189px'}}/>
<Input placeholder="请输入映射字段名" style={{ width:'189px'}}/>
</Item>
</Col>
</Row>
......@@ -3334,32 +3364,37 @@ const AddModal = props => {
fieldKey={[fieldKey, 'key']}
validateTrigger={['onChange', 'onBlur']}
rules={[
{ required: true, message: '请填写映射名' },
// {
// validator: () => {
// // 验证参数名不能重复
// const allKey = form
// .getFieldsValue()
// .parmars.map(item => (item ? item.key : ''));
// const repeatKey = new Set(allKey);
// if (repeatKey.size !== allKey.length) {
// return Promise.reject(new Error('参数名重复'));
// }
// return Promise.resolve();
// },
// },
{ required: true, message: '请填写字段名' },
{
validator: () => {
let aa = formAdd.getFieldsValue().parmars
let data =[];
aa.length >0 && aa.map(i=>{
if(i){
data.push(i.key)
}
})
let list = new Set(data);
let ee = form.getFieldsValue().workOrder;
if (list.size !== data.length || data.indexOf(ee) != -1) {
return Promise.reject(new Error('字段名重复'));
}
return Promise.resolve();
},
},
]}
>
<Input placeholder="请填写映射名" style={{ width:'227px', marginLeft:'98px'}}/>
<Input placeholder="请填写字段名" style={{ width:'227px', marginLeft:'98px'}}/>
</Form.Item>
<SwapOutlined style={{marginLeft:'6px'}}/>
<Form.Item
{...restField}
style={{ marginBottom: '5px' }}
name={[name, 'value']}
fieldKey={[fieldKey, 'value']}
rules={[{ required: true, message: '请填写映射'}]}
rules={[{ required: true, message: '请填写映射字段名'}]}
>
<Input placeholder="请填写映射值" style={{ width:'188px', marginLeft:'32px'}}/>
<Input placeholder="请填写映射字段名" style={{ width:'188px', marginLeft:'6px'}}/>
</Form.Item>
<MinusCircleOutlined
onClick={() => remove(name)}
......@@ -3369,7 +3404,7 @@ const AddModal = props => {
))}
<Form.Item>
<Button
style={{ width: '494px', marginLeft: '100px' }}
style={{ width: '456px', marginLeft: '100px' }}
type="dashed"
onClick={() => add()}
block
......@@ -3397,7 +3432,7 @@ const AddModal = props => {
labelCol={{ span: 4 }}
rules={[{ required: true, message: '请输入控制规则' }]}
>
<TextArea placeholder="示例:部门='研发一部'{表名.是否缴费} = ‘是’ and {表名.缴费金额} > 1000" />
<TextArea placeholder="示例:{表名.是否缴费} = ‘是’ and {表名.缴费金额} > 1000" />
</Item>
</>
);
......
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