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

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

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