Commit f600299e authored by 皮倩雯's avatar 皮倩雯

fix: '新增形态关联表单'

parent 361898fc
Pipeline #62917 passed with stages
......@@ -30,6 +30,7 @@ import {
Row,
TreeSelect,
Image,
Switch,
} from 'antd';
import AllImage from '@/assets/images/title/All.png';
import TreeImage from '@/assets/images/title/Tree.png';
......@@ -41,14 +42,16 @@ import {
LoadEventType,
UpdateFields,
} from '@/services/tablemanager/tablemanager';
import styles from './index.less';
import VerifyModal from './VerifyModal';
import {
PlusSquareOutlined,
UnorderedListOutlined,
FontColorsOutlined,
InfoCircleOutlined,
MinusCircleOutlined,
PlusOutlined,
} from '@ant-design/icons';
import styles from './index.less';
import VerifyModal from './VerifyModal';
import Tree from '@/components/ExpendableTree';
import Things from '../../../../../assets/images/icons/时间.svg';
const AddModal = props => {
......@@ -112,7 +115,7 @@ const AddModal = props => {
{
name: '附件类',
ID: 2,
children: ['附件', '图片', '录音', '视频'],
children: ['附件', '图片', '录音', '视频'],
},
{
name: '时间类',
......@@ -129,6 +132,11 @@ const AddModal = props => {
// ID: 5,
// children: ['智能抄表'],
// },
{
name: '高级控件',
ID: 5,
children: ['关联表单'],
},
]);
const [visible, setVisible] = useState(false); // 弹窗
const [isShow, setIsShow] = useState(false); // 弹窗
......@@ -150,7 +158,6 @@ const AddModal = props => {
picture: '',
must: '',
coordinates: '',
});
const [currentSelectOrg, setCurrentSelectOrg] = useState([]);
const [checkedList, setCheckedList] = useState([]); // 选中的复选框内容
......@@ -180,22 +187,28 @@ const AddModal = props => {
const [preView, setPreView] = useState(true);
const [viewMuise, setViewMuise] = useState(true);
const [preViewVideo, setPreViewVideo] = useState(true);
const [visibleChecked, setVisibleChecked] = useState(true);
const [formAdd] = Form.useForm();
const onChangeView = e =>{
setView(e.target.checked)
}
const change = e => {
console.log(e);
setVisibleChecked(e);
};
const onChangeView = e => {
setView(e.target.checked);
};
const onChangePreView = e =>{
setPreView(e.target.checked)
}
const onChangePreView = e => {
setPreView(e.target.checked);
};
const onChangePreViewMuise = e =>{
setViewMuise(e.target.checked)
}
const onChangePreViewMuise = e => {
setViewMuise(e.target.checked);
};
const onChangePreViewVideo = e =>{
setPreViewVideo(e.target.checked)
}
const onChangePreViewVideo = e => {
setPreViewVideo(e.target.checked);
};
// 提交
const onSubmit = () => {
......@@ -212,7 +225,7 @@ const AddModal = props => {
} else {
aa = 0;
}
console.log(Shape)
console.log(Shape);
let data = [
{
Unit: obj.Unit || '',
......@@ -249,28 +262,23 @@ const AddModal = props => {
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
}
}
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`;
// 平铺值选择器
data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
}
break;
case '部门选择器':
......@@ -298,34 +306,49 @@ const AddModal = props => {
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 {
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`;
}
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 {
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`;
}
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
......@@ -348,14 +371,12 @@ const AddModal = props => {
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 {
if (obj.ConfigName) {
let str = cho ? `全部.${obj.ConfigName}.n` : `全部.${obj.ConfigName}`;
data[0].Config = str;
} else {
let str = cho ? `全部.n` : `全部`;
data[0].Config = str;
}
let str = cho ? `全部.n` : `全部`;
data[0].Config = str;
}
} else if (popeleShape == '下拉框') {
let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
......@@ -375,32 +396,32 @@ const AddModal = props => {
data[0].Config = obj.Config;
}
console.log(data);
if(Shape=='图片'){
if(view){
data[0].Shape='可预览图片'
}else{
data[0].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 (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='平铺值选择器'
if (Shape == '值选择器') {
if (radiostyle == 0) {
if (!cho) {
data[0].Shape = '值选择器';
} else {
data[0].Shape = '值复选器';
}
} else {
data[0].Shape = '平铺值选择器';
}
}
console.log(data)
console.log(data);
UpdateFields(data).then(res => {
setLoading(false);
if (res.msg === 'Ok' || res.msg === '') {
......@@ -465,63 +486,72 @@ const AddModal = props => {
setSynchronization(false);
}
console.log(res[0].data.root.Shape);
if(res[0].data.root.StoreType=='datetime'){
setCharacteristics1([{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
}])
}else{
setCharacteristics1([{
name: '文本类',
ID: 0,
children: [
'文本',
'唯一值文本',
'多行文本',
'本人部门',
'本人姓名',
'数值',
'地址',
'设备二维码',
'本人ID',
'富文本',
'编码',
],
},
{
name: '选择器类',
ID: 1,
children: [
'选择器',
'搜索选择器',
'值选择器',
'可编辑值选择器',
'站点选择器',
'人员选择器',
'城市选择器',
'台账选择器',
'业务选择器',
'部门选择器',
],
},
{
name: '附件类',
ID: 2,
children: ['附件', '图片', '录音', '视频'],
},
{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
},
{
name: '地图类',
ID: 4,
children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'],
}])
if (res[0].data.root.StoreType == 'datetime') {
setCharacteristics1([
{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
},
]);
} else {
setCharacteristics1([
{
name: '文本类',
ID: 0,
children: [
'文本',
'唯一值文本',
'多行文本',
'本人部门',
'本人姓名',
'数值',
'地址',
'设备二维码',
'本人ID',
'富文本',
'编码',
],
},
{
name: '选择器类',
ID: 1,
children: [
'选择器',
'搜索选择器',
'值选择器',
'可编辑值选择器',
'站点选择器',
'人员选择器',
'城市选择器',
'台账选择器',
'业务选择器',
'部门选择器',
],
},
{
name: '附件类',
ID: 2,
children: ['附件', '图片', '录音', '视频'],
},
{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
},
{
name: '地图类',
ID: 4,
children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'],
},
{
name: '高级控件',
ID: 5,
children: ['关联表单'],
},
]);
}
if (res[0].data.root.Shape == '文本') {
setDetail('输入内容将显示在前端输入框提示信息中');
} else if (res[0].data.root.Shape == '多行文本') {
......@@ -545,10 +575,10 @@ const AddModal = props => {
setDetail('');
}
let coordinates = false,
picture = false,
must = false;
let coordinates = false;
let picture = false;
let must = false;
switch (res[0].data.root.Shape) {
case '坐标控件':
res[0].data.root.Config === '当前坐标'
......@@ -582,13 +612,13 @@ const AddModal = props => {
case '图片':
// res[0].data.root.Config === '拍照相册' ? (picture = true) : (picture = false);
res[0].data.root.Preset === '拍照相册' ? (picture = true) : (picture = false);
res[0].data.root.ValidationRule === 'required' ? (must = true) : (must = false);
res[0].data.root.ValidationRule === 'required' ? (must = true) : (must = false);
break;
case '可预览图片':
// res[0].data.root.Config === '拍照相册' ? (picture = true) : (picture = false);
res[0].data.root.Preset === '拍照相册' ? (picture = true) : (picture = false);
res[0].data.root.ValidationRule === 'required' ? (must = true) : (must = false);
break;
// res[0].data.root.Config === '拍照相册' ? (picture = true) : (picture = false);
res[0].data.root.Preset === '拍照相册' ? (picture = true) : (picture = false);
res[0].data.root.ValidationRule === 'required' ? (must = true) : (must = false);
break;
case '编码':
let code = res[0].data.root.Config.split('.');
form.setFieldsValue({
......@@ -609,16 +639,14 @@ const AddModal = props => {
setPep(true);
setCho(false);
}
} else if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: false, choose: true });
setPep(false);
setCho(true);
} else {
if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: false, choose: true });
setPep(false);
setCho(true);
} else {
form.setFieldsValue({ pepole: false, choose: false });
setPep(false);
setCho(false);
}
form.setFieldsValue({ pepole: false, choose: false });
setPep(false);
setCho(false);
}
break;
case '搜索选择器':
......@@ -638,31 +666,31 @@ const AddModal = props => {
setRadio(0);
}
break;
case '平铺值选择器':
let dataa = res[0].data.root.Config.split('.');
form.setFieldsValue({
Config: dataa[0] || '',
});
if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({
check: 1,
choose: true
});
setCho(true)
setRadio(1);
} else {
form.setFieldsValue({
check: 0,
choose:false
});
setCho(false)
setRadio(0);
}
form.setFieldsValue({
style: 1,
});
setRadiostyle(1);
break;
case '平铺值选择器':
let dataa = res[0].data.root.Config.split('.');
form.setFieldsValue({
Config: dataa[0] || '',
});
if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({
check: 1,
choose: true,
});
setCho(true);
setRadio(1);
} else {
form.setFieldsValue({
check: 0,
choose: false,
});
setCho(false);
setRadio(0);
}
form.setFieldsValue({
style: 1,
});
setRadiostyle(1);
break;
case '唯一值文本':
let arr = res[0].data.root.Config.split('.');
form.setFieldsValue({
......@@ -731,6 +759,24 @@ const AddModal = props => {
setRadio(0);
}
break;
case '关联表单':
let data11 = JSON.parse(res[0].data.root.Config);
form.setFieldsValue({
standingBook: data11.台账名称,
workOrder: data11.映射字段[data11.映射字段.length-1].key,
eventOrder: data11.映射字段[data11.映射字段.length-1].value,
configName: data11.控制规则,
});
let gg = [...data11.映射字段];
let a11=[]
gg.length>0&&gg.map((i,j)=>{
if(j!==gg.length-1){
a11.push(i)
}
})
formAdd.setFieldsValue({ parmars: a11 });
setVisibleChecked(data11.默认显示);
break;
case '选择器':
let sele = res[0].data.root.Config.split('.');
console.log(sele[0]);
......@@ -845,28 +891,26 @@ const AddModal = props => {
setGl(false);
setCho(true);
}
} else if (tree[1] == '站点') {
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: true,
choose: false,
});
setGl(true);
setCho(false);
} else {
if (tree[1] == '站点') {
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: true,
choose: false,
});
setGl(true);
setCho(false);
} else {
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: false,
choose: false,
});
setGl(false);
setCho(false);
}
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: false,
choose: false,
});
setGl(false);
setCho(false);
}
setPopeleShape('树形模态');
} else {
......@@ -892,45 +936,50 @@ const AddModal = props => {
break;
}
if(res[0].data.root.Shape=='可预览图片'){
if (res[0].data.root.Shape == '可预览图片') {
setView(true);
}else if(res[0].data.root.Shape=='图片'){
} else if (res[0].data.root.Shape == '图片') {
setView(false);
}else if(res[0].data.root.Shape=='可预览附件'){
} else if (res[0].data.root.Shape == '可预览附件') {
setPreView(true);
}else if(res[0].data.root.Shape=='附件'){
} else if (res[0].data.root.Shape == '附件') {
setPreView(false);
}else if(res[0].data.root.Shape=='值选择器'){
} else if (res[0].data.root.Shape == '值选择器') {
setRadiostyle(0);
setCho(false)
form.setFieldsValue({style:0, choose:false})
}else if(res[0].data.root.Shape=='值复选器'){
setCho(false);
form.setFieldsValue({ style: 0, choose: false });
} else if (res[0].data.root.Shape == '值复选器') {
setRadiostyle(0);
setCho(true)
form.setFieldsValue({style:0, choose: true})
setCho(true);
form.setFieldsValue({ style: 0, choose: true });
}
if(res[0].data.root.Shape=='可预览图片'){
setShape('图片')
}else if(res[0].data.root.Shape=='可预览附件'){
setShape('附件')
}else if(res[0].data.root.Shape=='平铺值选择器'){
setShape('值选择器')
}else if(res[0].data.root.Shape=='值复选器'){
setShape('值选择器')
}else {
setShape(res[0].data.root.Shape)
if (res[0].data.root.Shape == '可预览图片') {
setShape('图片');
} else if (res[0].data.root.Shape == '可预览附件') {
setShape('附件');
} else if (res[0].data.root.Shape == '平铺值选择器') {
setShape('值选择器');
} else if (res[0].data.root.Shape == '值复选器') {
setShape('值选择器');
} else {
setShape(res[0].data.root.Shape);
}
if(!res[0].data.root.Shape){
console.log(1111)
if(res[0].data.root.StoreType=='datetime'){
if (!res[0].data.root.Shape) {
console.log(1111);
if (res[0].data.root.StoreType == 'datetime') {
setShape('日期时间');
}else if(res[0].data.root.StoreType=='int'||res[0].data.root.StoreType=='float'||res[0].data.root.StoreType=='bigint'||res[0].data.root.StoreType=='int'=='decimal'){
} else if (
res[0].data.root.StoreType == 'int' ||
res[0].data.root.StoreType == 'float' ||
res[0].data.root.StoreType == 'bigint' ||
(res[0].data.root.StoreType == 'int') == 'decimal'
) {
setShape('数值');
}else{
console.log(1111122222)
} else {
console.log(1111122222);
setShape('文本');
}
}
......@@ -996,7 +1045,7 @@ const AddModal = props => {
setCharacterValue(prop.str);
}
};
const add = aa => {
const add1 = aa => {
let obj = form.getFieldsValue();
let data = { numerical: '', rule: [] };
console.log(obj.ValidationRule, 'ValidationRule');
......@@ -1127,8 +1176,13 @@ const AddModal = props => {
Association: '',
farter: '',
farterData: '',
workOrder: '',
eventOrder: '',
configName: '',
});
}
formAdd.resetFields()
setVisibleChecked(true);
setView(true);
setPreView(true);
setViewMuise(true);
......@@ -1262,7 +1316,7 @@ const AddModal = props => {
const mapTree = org => {
const haveChildren = Array.isArray(org.children) && org.children.length > 0;
if(org.storeType=='datetime'){
if (org.storeType == 'datetime') {
return {
title: (
<span className={styles.titleText}>
......@@ -1280,86 +1334,92 @@ const AddModal = props => {
org,
};
}
return {
title: (
<span className={styles.titleText}>
{org.children ? (
<UnorderedListOutlined style={{ color: '#1890FF' }} />
) : (
<FontColorsOutlined style={{ color: '#1890FF' }} />
)}
<span style={{ marginLeft: '5px' }}>{org.name}</span>
</span>
),
key: org.ID,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children: haveChildren ? org.children.map(i => mapTree(i)) : [],
org,
};
return {
title: (
<span className={styles.titleText}>
{org.children ? (
<UnorderedListOutlined style={{ color: '#1890FF' }} />
) : (
<FontColorsOutlined style={{ color: '#1890FF' }} />
)}
<span style={{ marginLeft: '5px' }}>{org.name}</span>
</span>
),
key: org.ID,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children: haveChildren ? org.children.map(i => mapTree(i)) : [],
org,
};
};
const onSelect = (i, e) => {
console.log(i)
console.log(e)
if(e.node.org.storeType&&e.node.org.storeType=='datetime'){
setCharacteristics1([{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
}])
}else if(e.node.org.storeType&&e.node.org.storeType!='datetime'){
setCharacteristics1([{
name: '文本类',
ID: 0,
children: [
'文本',
'唯一值文本',
'多行文本',
'本人部门',
'本人姓名',
'数值',
'地址',
'设备二维码',
'本人ID',
'富文本',
'编码',
],
},
{
name: '选择器类',
ID: 1,
children: [
'选择器',
'搜索选择器',
'值选择器',
'可编辑值选择器',
'站点选择器',
'人员选择器',
'城市选择器',
'台账选择器',
'业务选择器',
'部门选择器',
],
},
{
name: '附件类',
ID: 2,
children: ['附件', '图片', '录音', '视频'],
},
{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
},
{
name: '地图类',
ID: 4,
children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'],
}])
console.log(i);
console.log(e);
if (e.node.org.storeType && e.node.org.storeType == 'datetime') {
setCharacteristics1([
{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
},
]);
} else if (e.node.org.storeType && e.node.org.storeType != 'datetime') {
setCharacteristics1([
{
name: '文本类',
ID: 0,
children: [
'文本',
'唯一值文本',
'多行文本',
'本人部门',
'本人姓名',
'数值',
'地址',
'设备二维码',
'本人ID',
'富文本',
'编码',
],
},
{
name: '选择器类',
ID: 1,
children: [
'选择器',
'搜索选择器',
'值选择器',
'可编辑值选择器',
'站点选择器',
'人员选择器',
'城市选择器',
'台账选择器',
'业务选择器',
'部门选择器',
],
},
{
name: '附件类',
ID: 2,
children: ['附件', '图片', '录音', '视频'],
},
{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
},
{
name: '地图类',
ID: 4,
children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'],
},
{
name: '高级控件',
ID: 5,
children: ['关联表单'],
},
]);
}
if(e && !e.node.org.children){
if (e && !e.node.org.children) {
setKeep(e);
if (e.node) {
setCurrentSelectOrg(e.node.org.ID);
......@@ -1379,54 +1439,59 @@ const AddModal = props => {
valueData.map(i => {
bb.push(i.ID.toString());
});
console.log(valueData)
console.log(bb)
console.log(e.node.org.ID)
console.log(valueData);
console.log(bb);
console.log(e.node.org.ID);
if (bb.indexOf(e.node.org.ID) != -1) {
let aa = valueData.find(i => i.ID == e.node.org.ID);
Promise.all([req1, req2, req3]).then(res => {
res[1].msg === 'Ok' && setFieldName(res[1].data.root);
res[2].msg === 'Ok' && setEventList(res[2].data.root);
if (res[0].msg === 'Ok') {
console.log(aa)
if(aa.Shape=='可预览图片'){
setView(true);
}else if(aa.Shape=='图片'){
setView(false)
}else if(aa.Shape=='可预览附件'){
setPreView(true);
}else if(aa.Shape=='附件'){
setPreView(false)
}else if(aa.Shape=='值选择器'){
console.log(aa);
if (aa.Shape == '可预览图片') {
setView(true);
} else if (aa.Shape == '图片') {
setView(false);
} else if (aa.Shape == '可预览附件') {
setPreView(true);
} else if (aa.Shape == '附件') {
setPreView(false);
} else if (aa.Shape == '值选择器') {
setRadiostyle(0);
setCho(false);
form.setFieldsValue({style:0,choose:false})
}else if(aa.Shape=='值复选器'){
form.setFieldsValue({ style: 0, choose: false });
} else if (aa.Shape == '值复选器') {
setRadiostyle(0);
setCho(true);
form.setFieldsValue({style:0,choose:true})
form.setFieldsValue({ style: 0, choose: true });
}
if(aa.Shape=='可预览图片'){
if (aa.Shape == '可预览图片') {
setShape('图片');
}else if(aa.Shape=='可预览附件'){
setShape('附件')
}else if(aa.Shape=='平铺值选择器'){
setShape('值选择器')
}else if(aa.Shape=='值复选器'){
setShape('值选择器')
}else{
} else if (aa.Shape == '可预览附件') {
setShape('附件');
} else if (aa.Shape == '平铺值选择器') {
setShape('值选择器');
} else if (aa.Shape == '值复选器') {
setShape('值选择器');
} else {
setShape(aa.Shape);
}
console.log(aa)
if(aa.Shape){
console.log(1111)
if(aa.StoreType=='datetime'){
console.log(aa);
if (!aa.Shape) {
console.log(1111);
if (aa.StoreType == 'datetime') {
setShape('日期时间');
}else if(aa.StoreType=='int'||aa.StoreType=='float'||aa.StoreType=='bigint'||aa.StoreType=='int'=='decimal'){
} else if (
aa.StoreType == 'int' ||
aa.StoreType == 'float' ||
aa.StoreType == 'bigint' ||
(aa.StoreType == 'int') == 'decimal'
) {
setShape('数值');
}else{
console.log(1111122222)
} else {
console.log(1111122222);
setShape('文本');
}
}
......@@ -1447,7 +1512,7 @@ const AddModal = props => {
form.setFieldsValue({ SyncEvent: false });
setSynchronization(false);
}
if (aa.Shape == '文本') {
setDetail('输入内容将显示在前端输入框提示信息中');
} else if (aa.Shape == '多行文本') {
......@@ -1467,10 +1532,10 @@ const AddModal = props => {
} else {
setDetail('');
}
let coordinates = false,
picture = false,
must = false;
let coordinates = false;
let picture = false;
let must = false;
switch (aa.Shape) {
case '坐标控件':
aa.Config === '当前坐标' ? (coordinates = true) : (coordinates = false);
......@@ -1530,26 +1595,26 @@ const AddModal = props => {
}
break;
case '平铺值选择器':
let dataa = aa.Config.split('.');
form.setFieldsValue({
Config: dataa[0] || '',
});
if (aa.Config.endsWith('.n')) {
form.setFieldsValue({
choose:true,
});
setCho(true)
} else {
form.setFieldsValue({
choose: false,
});
setCho(false);
}
form.setFieldsValue({
style: 1,
});
setRadiostyle(1)
break;
let dataa = aa.Config.split('.');
form.setFieldsValue({
Config: dataa[0] || '',
});
if (aa.Config.endsWith('.n')) {
form.setFieldsValue({
choose: true,
});
setCho(true);
} else {
form.setFieldsValue({
choose: false,
});
setCho(false);
}
form.setFieldsValue({
style: 1,
});
setRadiostyle(1);
break;
case '唯一值文本':
let arr = aa.Config.split('.');
form.setFieldsValue({
......@@ -1576,9 +1641,8 @@ const AddModal = props => {
}
break;
case '站点选择器':
let site = aa.Config.split('.');
if (site[0] == '本人') {
if (aa.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: true, choose: true });
......@@ -1589,21 +1653,19 @@ const AddModal = props => {
setPep(true);
setCho(false);
}
} else if (aa.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: false, choose: true });
setPep(false);
setCho(true);
} else {
if (aa.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: false, choose: true });
setPep(false);
setCho(true);
} else {
form.setFieldsValue({ pepole: false, choose: false });
setPep(false);
setCho(false);
}
form.setFieldsValue({ pepole: false, choose: false });
setPep(false);
setCho(false);
}
break;
case '部门选择器':
let department = aa.Config;
if (department == '.n') {
form.setFieldsValue({
check: 1,
......@@ -1616,6 +1678,24 @@ const AddModal = props => {
setRadio(0);
}
break;
case '关联表单':
let data11 = JSON.parse(aa.Config);
form.setFieldsValue({
standingBook: data11.台账名称,
workOrder: data11.映射字段[data11.映射字段.length-1].key,
eventOrder: data11.映射字段[data11.映射字段.length-1].value,
configName: data11.控制规则,
});
let gg = [...data11.映射字段];
let a11=[]
gg.length>0&&gg.map((i,j)=>{
if(j!==gg.length-1){
a11.push(i)
}
})
formAdd.setFieldsValue({ parmars: a11 });
setVisibleChecked(data11.默认显示);
break;
case '台账选择器':
let book = aa.Config.split('.');
let ad = book[1].split('?');
......@@ -1644,7 +1724,6 @@ const AddModal = props => {
}
break;
case '选择器':
let sele = aa.Config.split('.');
if (sele[1] && sele[1] != 'n') {
form.setFieldsValue({
......@@ -1654,7 +1733,6 @@ const AddModal = props => {
});
setCse(true);
} else {
form.setFieldsValue({
Association: false,
Config: sele[0],
......@@ -1671,7 +1749,7 @@ const AddModal = props => {
break;
case '人员选择器':
let pepole = aa.Config.split('.');
form.setFieldsValue({ ShowConfig: aa.Config });
if (pepole[0] == '全部') {
setHide(false);
......@@ -1756,28 +1834,26 @@ const AddModal = props => {
setGl(false);
setCho(true);
}
} else if (tree[1] == '站点') {
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: true,
choose: false,
});
setGl(true);
setCho(false);
} else {
if (tree[1] == '站点') {
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: true,
choose: false,
});
setGl(true);
setCho(false);
} else {
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: false,
choose: false,
});
setGl(false);
setCho(false);
}
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: false,
choose: false,
});
setGl(false);
setCho(false);
}
setPopeleShape('树形模态');
} else {
......@@ -1800,13 +1876,13 @@ const AddModal = props => {
}
setPopeleShape('下拉框');
}
break;
}
setValue1();
setPramData({ ...aa, coordinates, must, picture });
let index = res[2].data.root.find(item => item.Name == aa.ExceptionEvent);
getFieldData(index.TableName);
}
});
......@@ -1816,46 +1892,49 @@ const AddModal = props => {
res[2].msg === 'Ok' && setEventList(res[2].data.root);
if (res[0].msg === 'Ok') {
console.log(res[0].data.root.Shape);
if(res[0].data.root.Shape=='可预览图片'){
setView(true)
}else if(res[0].data.root.Shape=='图片'){
setView(false)
}else if(res[0].data.root.Shape=='可预览附件'){
setPreView(true)
}else if(res[0].data.root.Shape=='附件'){
setPreView(false)
}else if(res[0].data.root.Shape=='值选择器'){
if (res[0].data.root.Shape == '可预览图片') {
setView(true);
} else if (res[0].data.root.Shape == '图片') {
setView(false);
} else if (res[0].data.root.Shape == '可预览附件') {
setPreView(true);
} else if (res[0].data.root.Shape == '附件') {
setPreView(false);
} else if (res[0].data.root.Shape == '值选择器') {
setRadiostyle(0);
setCho(false)
form.setFieldsValue({check:0,style:0,choose:false})
}else if(res[0].data.root.Shape=='值复选器'){
setCho(false);
form.setFieldsValue({ check: 0, style: 0, choose: false });
} else if (res[0].data.root.Shape == '值复选器') {
setRadiostyle(0);
setCho(true)
form.setFieldsValue({check:1,style:0,choose:true})
setCho(true);
form.setFieldsValue({ check: 1, style: 0, choose: true });
}
if(res[0].data.root.Shape=='可预览图片'){
if (res[0].data.root.Shape == '可预览图片') {
setShape('图片');
}else if(res[0].data.root.Shape=='可预览附件'){
} else if (res[0].data.root.Shape == '可预览附件') {
setShape('附件');
}
else if(res[0].data.root.Shape=='平铺值选择器'){
} else if (res[0].data.root.Shape == '平铺值选择器') {
setShape('值选择器');
}else if(res[0].data.root.Shape=='值复选器'){
} else if (res[0].data.root.Shape == '值复选器') {
setShape('值选择器');
}else{
setShape(res[0].data.root.Shape)
} else {
setShape(res[0].data.root.Shape);
}
console.log(res[0].data.root)
if(!res[0].data.root.Shape){
console.log(1111)
if(res[0].data.root.StoreType=='datetime'){
console.log(res[0].data.root);
if (!res[0].data.root.Shape) {
console.log(1111);
if (res[0].data.root.StoreType == 'datetime') {
setShape('日期时间');
}else if(res[0].data.root.StoreType=='int'||res[0].data.root.StoreType=='float'||res[0].data.root.StoreType=='bigint'||res[0].data.root.StoreType=='int'=='decimal'){
} else if (
res[0].data.root.StoreType == 'int' ||
res[0].data.root.StoreType == 'float' ||
res[0].data.root.StoreType == 'bigint' ||
(res[0].data.root.StoreType == 'int') == 'decimal'
) {
setShape('数值');
}else{
console.log(1111122222)
} else {
setShape('文本');
}
}
......@@ -1876,11 +1955,10 @@ const AddModal = props => {
form.setFieldsValue({ SyncEvent: false });
setSynchronization(false);
}
let coordinates = false,
picture = false,
must = false;
let coordinates = false;
let picture = false;
let must = false;
switch (res[0].data.root.Shape) {
case '坐标控件':
res[0].data.root.Config === '当前坐标'
......@@ -1924,7 +2002,7 @@ const AddModal = props => {
prefix: code[1] === 'undefined' ? '' : code[1],
});
break;
case '搜索选择器':
let data = res[0].data.root.Config.split('.');
form.setFieldsValue({
......@@ -1942,27 +2020,27 @@ const AddModal = props => {
setRadio(0);
}
break;
case '平铺值选择器':
let dataa = res[0].data.root.Config.split('.');
form.setFieldsValue({
Config: dataa[0] || '',
});
if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({
choose:true
});
setCho(true)
} else {
form.setFieldsValue({
choose:false
});
setCho(false);
}
form.setFieldsValue({
style: 1,
});
setRadiostyle(1)
break;
case '平铺值选择器':
let dataa = res[0].data.root.Config.split('.');
form.setFieldsValue({
Config: dataa[0] || '',
});
if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({
choose: true,
});
setCho(true);
} else {
form.setFieldsValue({
choose: false,
});
setCho(false);
}
form.setFieldsValue({
style: 1,
});
setRadiostyle(1);
break;
case '唯一值文本':
let arr = res[0].data.root.Config.split('.');
form.setFieldsValue({
......@@ -1972,7 +2050,7 @@ const AddModal = props => {
break;
case '站点选择器':
let site = res[0].data.root.Config.split('.');
if (site[0] == '本人') {
if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: true, choose: true });
......@@ -1983,21 +2061,19 @@ const AddModal = props => {
setPep(true);
setCho(false);
}
} else if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: false, choose: true });
setPep(false);
setCho(true);
} else {
if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: false, choose: true });
setPep(false);
setCho(true);
} else {
form.setFieldsValue({ pepole: false, choose: false });
setPep(false);
setCho(false);
}
form.setFieldsValue({ pepole: false, choose: false });
setPep(false);
setCho(false);
}
break;
case '业务选择器':
let list = res[0].data.root.Config.split('.');
form.setFieldsValue({
tableName: list[0] || '',
fieldName: list[1] || '',
......@@ -2016,7 +2092,7 @@ const AddModal = props => {
break;
case '部门选择器':
let department = res[0].data.root.Config;
if (department == '.n') {
form.setFieldsValue({
check: 1,
......@@ -2029,6 +2105,25 @@ const AddModal = props => {
setRadio(0);
}
break;
case '关联表单':
let data11 = JSON.parse(res[0].data.root.Config);
form.setFieldsValue({
standingBook: data11.台账名称,
workOrder: data11.映射字段[data11.映射字段.length-1].key,
eventOrder: data11.映射字段[data11.映射字段.length-1].value,
configName: data11.控制规则,
});
let gg = [...data11.映射字段];
let a11=[]
gg.length>0&&gg.map((i,j)=>{
if(j!==gg.length-1){
a11.push(i)
}
})
formAdd.setFieldsValue({ parmars: a11 });
setVisibleChecked(data11.默认显示);
break;
case '台账选择器':
let book = res[0].data.root.Config.split('.');
let ab = book[1].split('?');
......@@ -2066,7 +2161,6 @@ const AddModal = props => {
});
setCse(true);
} else {
form.setFieldsValue({
Association: false,
Config: sele[0],
......@@ -2083,7 +2177,7 @@ const AddModal = props => {
break;
case '人员选择器':
let pepole = res[0].data.root.Config.split('.');
form.setFieldsValue({ ShowConfig: res[0].data.root.Config });
if (pepole[0] == '全部') {
setHide(false);
......@@ -2168,28 +2262,26 @@ const AddModal = props => {
setGl(false);
setCho(true);
}
} else if (tree[1] == '站点') {
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: true,
choose: false,
});
setGl(true);
setCho(false);
} else {
if (tree[1] == '站点') {
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: true,
choose: false,
});
setGl(true);
setCho(false);
} else {
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: false,
choose: false,
});
setGl(false);
setCho(false);
}
form.setFieldsValue({
PeShape: '树形模态',
All1: true,
AllID1: true,
guolv: false,
choose: false,
});
setGl(false);
setCho(false);
}
setPopeleShape('树形模态');
} else {
......@@ -2216,17 +2308,18 @@ const AddModal = props => {
}
setValue1();
setPramData({ ...res[0].data.root, coordinates, must, picture });
let index = res[2].data.root.find(item => item.Name == res[0].data.root.ExceptionEvent);
let index = res[2].data.root.find(
item => item.Name == res[0].data.root.ExceptionEvent,
);
getFieldData(index.TableName);
}
});
}
}
}
form.validateFields().then(validate => {
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
......@@ -2236,7 +2329,7 @@ const AddModal = props => {
} else {
aa = 0;
}
console.log(obj)
console.log(obj);
let data = [
{
Unit: obj.Unit || '',
......@@ -2259,34 +2352,33 @@ const AddModal = props => {
ExceptionEventFields: characterValue,
},
];
console.log(Shape)
if(Shape=='图片'){
if(view){
data[0].Shape='可预览图片'
}else{
data[0].Shape='图片'
}
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 (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='平铺值选择器'
if (Shape == '值选择器') {
if (radiostyle == 0) {
if (!cho) {
data[0].Shape = '值选择器';
} else {
data[0].Shape = '值复选器';
}
} else {
data[0].Shape = '平铺值选择器';
}
}
switch (Shape) {
case '编码':
......@@ -2305,10 +2397,7 @@ const AddModal = props => {
if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config;
} else {
data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
}
break;
case '唯一值文本':
......@@ -2324,15 +2413,13 @@ const AddModal = props => {
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 {
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`;
}
data[0].Config = radio == 0 ? `${obj.tableName}` : `${obj.tableName}.n`;
}
break;
case '部门选择器':
......@@ -2345,20 +2432,35 @@ const AddModal = props => {
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 {
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`;
}
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
......@@ -2370,18 +2472,15 @@ const AddModal = props => {
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
}
}
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 == '分组模态') {
......@@ -2393,18 +2492,16 @@ const AddModal = props => {
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 {
if (obj.ConfigName) {
let str = cho ? `全部.${obj.ConfigName}.n` : `全部.${obj.ConfigName}`;
data[0].Config = str;
} else {
let str = cho ? `全部.n` : `全部`;
data[0].Config = str;
}
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) {
......@@ -2419,32 +2516,32 @@ const AddModal = props => {
default:
data[0].Config = obj.Config;
}
console.log(data[0])
console.log(data[0]);
let aadata = valueData;
console.log(keepTreeFirst)
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 (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];
}
});
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]);
}
} else {
aadata.push(data[0]);
}
// }
console.log(valueData)
console.log(aadata)
setValueData(aadata)
console.log(valueData);
console.log(aadata);
setValueData(aadata);
form.setFieldsValue({
Association: '',
Config: '',
......@@ -2467,7 +2564,11 @@ const AddModal = props => {
PeShape: '',
farter: '',
farterData: '',
workOrder: '',
eventOrder: '',
configName: '',
});
setVisibleChecked(true);
setCse('');
setPopeleShape('');
setRadio(0);
......@@ -2513,9 +2614,9 @@ const AddModal = props => {
setValue1();
};
const onChangestyle = e =>{
const onChangestyle = e => {
setRadiostyle(e.target.value);
}
};
const timeDataOnVChange = e => {
console.log(e.target.value);
......@@ -2565,42 +2666,32 @@ const AddModal = props => {
} else {
form.setFieldsValue({ ShowConfig: `全部ID.${bb}` });
}
} else if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部ID.n` });
} else {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部ID.n` });
} else {
form.setFieldsValue({ ShowConfig: `全部ID` });
}
form.setFieldsValue({ ShowConfig: `全部ID` });
}
} else {
if (bb) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部.${bb}.n` });
} else {
form.setFieldsValue({ ShowConfig: `全部.${bb}` });
}
} else {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部.n` });
} else {
form.setFieldsValue({ ShowConfig: `全部` });
}
}
}
} else {
if (aa) {
} else if (bb) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `${aa}.n` });
form.setFieldsValue({ ShowConfig: `全部.${bb}.n` });
} else {
form.setFieldsValue({ ShowConfig: `${aa}` });
form.setFieldsValue({ ShowConfig: `全部.${bb}` });
}
} else if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部.n` });
} else {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `.n` });
} else {
form.setFieldsValue({ ShowConfig: '' });
}
form.setFieldsValue({ ShowConfig: `全部` });
}
} else if (aa) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `${aa}.n` });
} else {
form.setFieldsValue({ ShowConfig: `${aa}` });
}
} else if (ff == 1) {
form.setFieldsValue({ ShowConfig: `.n` });
} else {
form.setFieldsValue({ ShowConfig: '' });
}
};
......@@ -2618,46 +2709,37 @@ const AddModal = props => {
} else {
form.setFieldsValue({ ShowConfig: `全部ID.${aa}` });
}
} else if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部ID.n` });
} else {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部ID.n` });
} else {
form.setFieldsValue({ ShowConfig: `全部ID` });
}
form.setFieldsValue({ ShowConfig: `全部ID` });
}
} else {
if (aa) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部.${aa}.n` });
} else {
form.setFieldsValue({ ShowConfig: `全部.${aa}` });
}
} else {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部.n` });
} else {
form.setFieldsValue({ ShowConfig: `全部` });
}
}
}
} else {
if (bb) {
} else if (aa) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `${bb}.n` });
form.setFieldsValue({ ShowConfig: `全部.${aa}.n` });
} else {
form.setFieldsValue({ ShowConfig: `${bb}` });
form.setFieldsValue({ ShowConfig: `全部.${aa}` });
}
} else if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部.n` });
} else {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `.n` });
} else {
form.setFieldsValue({ ShowConfig: '' });
}
form.setFieldsValue({ ShowConfig: `全部` });
}
} else if (bb) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `${bb}.n` });
} else {
form.setFieldsValue({ ShowConfig: `${bb}` });
}
} else if (ff == 1) {
form.setFieldsValue({ ShowConfig: `.n` });
} else {
form.setFieldsValue({ ShowConfig: '' });
}
};
const mapTreeSelect = org => org.children ? (
const mapTreeSelect = org =>
org.children ? (
<TreeNode value={org.name} title={org.name} disabled>
{org.children.map(item => mapTreeSelect(item))}
</TreeNode>
......@@ -2825,27 +2907,24 @@ const AddModal = props => {
<Row>
{/* <Col span={1} /> */}
<Col span={16}>
<Item label="形态" labelCol={{ span: 6 }}>
<TreeSelect
style={{ width: '95%' }}
value={Shape}
onChange={handleCharacteristics}
showSearch
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择表名 "
allowClear
treeDefaultExpandAll
showCheckedStrategy
>
{characteristics1 ? (
characteristics1.map(i => mapTreeSelect(i))
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</TreeSelect>
<Item label="形态" labelCol={{ span: 6 }}>
<TreeSelect
style={{ width: '95%' }}
value={Shape}
onChange={handleCharacteristics}
showSearch
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择表名 "
allowClear
treeDefaultExpandAll
showCheckedStrategy
>
{characteristics1 ? (
characteristics1.map(i => mapTreeSelect(i))
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</TreeSelect>
</Item>
</Col>
......@@ -2939,8 +3018,17 @@ const AddModal = props => {
placeholder="用英文逗号分隔自定义的值,勾选,可设置初始值"
/>
</Item>
<Item colon={false} name="style" label="交互方式:" labelCol={{ span: 4 }}>
<Radio.Group onChange={onChangestyle} value={radiostyle} defaultValue={cheestyle}>
<Item
colon={false}
name="style"
label="交互方式:"
labelCol={{ span: 4 }}
>
<Radio.Group
onChange={onChangestyle}
value={radiostyle}
defaultValue={cheestyle}
>
<Radio value={0}>下拉框</Radio>
<Radio value={1}>平铺</Radio>
</Radio.Group>
......@@ -2951,15 +3039,15 @@ const AddModal = props => {
<Radio value={1}>多选</Radio>
</Radio.Group>
</Item> */}
<Item name="choose" label="配置:" labelCol={{ span: 4 }} >
<Checkbox
checked={cho}
onChange={changeChoose}
style={{ marginBottom: '0' }}
>
多选
</Checkbox>
</Item>
<Item name="choose" label="配置:" labelCol={{ span: 4 }}>
<Checkbox
checked={cho}
onChange={changeChoose}
style={{ marginBottom: '0' }}
>
多选
</Checkbox>
</Item>
</>
);
case '图片':
......@@ -2967,8 +3055,7 @@ const AddModal = props => {
return (
<Item name="ReadOnly" label="配置" labelCol={{ span: 4 }}>
<div>
<Checkbox
checked={view} onChange={onChangeView}>
<Checkbox checked={view} onChange={onChangeView}>
可预览
</Checkbox>
<Checkbox
......@@ -2986,20 +3073,17 @@ const AddModal = props => {
</div>
</Item>
);
case '附件':
case '可预览附件':
return (
<Item label="配置" labelCol={{ span: 4 }}>
<div>
<Checkbox
checked={preView}
onChange={onChangePreView}
>
可预览
</Checkbox>
</div>
</Item>
);
case '附件':
case '可预览附件':
return (
<Item label="配置" labelCol={{ span: 4 }}>
<div>
<Checkbox checked={preView} onChange={onChangePreView}>
可预览
</Checkbox>
</div>
</Item>
);
case '唯一值文本':
return (
<Row>
......@@ -3180,6 +3264,144 @@ const AddModal = props => {
</div>
</Item>
);
case '关联表单':
return (
<>
<Item
label="台账名"
name="standingBook"
labelCol={{ span: 4 }}
rules={[{ required: true, message: '请选择台账名' }]}
>
<Select showSearch>
{keepStandingBook
? keepStandingBook.map((item, index) => (
<Option key={index} value={item}>
{item}
</Option>
))
: ''}
</Select>
</Item>
{/* <Item
label="映射字段"
name="workOrder"
rules={[{ required: true, message: '请填写映射字段' }]}
labelCol={{ span: 4 }}
>
<Input placeholder="示例:工单编号:工单编号,事件编号:事件编号" />
</Item> */}
<Item label={<><span style={{color:'red', fontSize:'17px',marginRight:'5px', marginTop:'3px'}}>*</span><span>映射字段</span></>} labelCol={{ span: 4 }}>
<Row>
<Col span={11}>
<Item
name="workOrder"
rules={[{ required: true, message: '请输入映射名' }]}
style={{ marginBottom:0}}
>
<Input placeholder="请输入映射名" />
</Item>
</Col>
<Col span={11}>
<Item
name="eventOrder"
rules={[{ required: true, message: '请输入映射值' }]}
style={{ marginBottom:0}}
>
<Input placeholder="请输入映射值" style={{marginLeft:'41px', width:'189px'}}/>
</Item>
</Col>
</Row>
</Item>
<Form name="form" form={formAdd} labelCol={{ span: 7 }}>
<Form.List name="parmars">
{(fields, { add, remove }) => (
<>
{fields.map(({ key, name, fieldKey, ...restField }) => (
<Space
key={key}
style={{
display: 'flex',
marginBottom: '5px',
justifyContent: 'center',
}}
align="baseline"
>
<Form.Item
{...restField}
style={{ marginBottom: '5px' }}
name={[name, 'key']}
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();
// },
// },
]}
>
<Input placeholder="请填写映射名" style={{ width:'227px', marginLeft:'98px'}}/>
</Form.Item>
<Form.Item
{...restField}
style={{ marginBottom: '5px' }}
name={[name, 'value']}
fieldKey={[fieldKey, 'value']}
rules={[{ required: true, message: '请填写映射值'}]}
>
<Input placeholder="请填写映射值" style={{ width:'188px', marginLeft:'32px'}}/>
</Form.Item>
<MinusCircleOutlined
onClick={() => remove(name)}
style={{ marginLeft: '10px', fontSize: '20px' }}
/>
</Space>
))}
<Form.Item>
<Button
style={{ width: '494px', marginLeft: '100px' }}
type="dashed"
onClick={() => add()}
block
icon={<PlusOutlined />}
>
添加映射
</Button>
</Form.Item>
</>
)}
</Form.List>
</Form>
<Item label="默认显示" labelCol={{ span: 4 }}>
<Switch
checkedChildren="是"
unCheckedChildren="否"
checked={visibleChecked}
onChange={change}
// style={{ marginLeft: '35px' }}
/>
</Item>
<Item
label="控制规则"
name="configName"
labelCol={{ span: 4 }}
rules={[{ required: true, message: '请输入控制规则' }]}
>
<TextArea placeholder="示例:部门='研发一部'{表名.是否缴费} = ‘是’ and {表名.缴费金额} > 1000" />
</Item>
</>
);
case '台账选择器':
return (
<>
......@@ -3189,7 +3411,7 @@ const AddModal = props => {
label="台账名"
name="standingBook"
labelCol={{ span: 6 }}
rules={[{ required: true, message: '请输入台账名' }]}
rules={[{ required: true, message: '请选择台账名' }]}
>
<Select showSearch style={{ width: '95%' }}>
{keepStandingBook
......@@ -3480,50 +3702,49 @@ const AddModal = props => {
{Shape === '图片' || Shape === '可预览图片' ? (
''
) : (
<Item labelCol={{ span: 4 }}>
{/* <div className={styles.listEvent}> */}
<Row>
<Col span={12}>
<Item label="预设值" labelCol={{ span: 8 }}>
<Input
// style={{ width: '41%', height: '1.8rem' }}
value={pramData.Preset}
onChange={e => handleInput(e, 'Preset')}
placeholder=""
allowClear
/>
</Item>
</Col>
<Col span={11}>
<Item
style={{ marginLeft: '1rem' }}
label="验证"
labelCol={{ span: 7 }}
name="ValidationRule"
>
<Input style={{ width: '92%' }} placeholder="" allowClear />
</Item>
</Col>
<Col span={1}>
<Tooltip title="选择验证规则">
<PlusSquareOutlined
onClick={() => {
add('rule');
}}
style={{
fontSize: '24px',
color: '#1890FF',
marginTop: '8px',
marginLeft: '-3px',
}}
/>
</Tooltip>
</Col>
</Row>
</Item>
)}
<Item labelCol={{ span: 4 }}>
{/* <div className={styles.listEvent}> */}
<Row>
<Col span={12}>
<Item label="预设值" labelCol={{ span: 8 }}>
<Input
// style={{ width: '41%', height: '1.8rem' }}
value={pramData.Preset}
onChange={e => handleInput(e, 'Preset')}
placeholder=""
allowClear
/>
</Item>
</Col>
<Col span={11}>
<Item
style={{ marginLeft: '1rem' }}
label="验证"
labelCol={{ span: 7 }}
name="ValidationRule"
>
<Input style={{ width: '92%' }} placeholder="" allowClear />
</Item>
</Col>
<Col span={1}>
<Tooltip title="选择验证规则">
<PlusSquareOutlined
onClick={() => {
add1('rule');
}}
style={{
fontSize: '24px',
color: '#1890FF',
marginTop: '8px',
marginLeft: '-3px',
}}
/>
</Tooltip>
</Col>
</Row>
</Item>
)}
{/* <Item label="异常值">
<div className={styles.listEvent}>
<Input
......
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