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

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

parent 361898fc
Pipeline #62917 passed with stages
...@@ -30,6 +30,7 @@ import { ...@@ -30,6 +30,7 @@ import {
Row, Row,
TreeSelect, TreeSelect,
Image, Image,
Switch,
} from 'antd'; } from 'antd';
import AllImage from '@/assets/images/title/All.png'; import AllImage from '@/assets/images/title/All.png';
import TreeImage from '@/assets/images/title/Tree.png'; import TreeImage from '@/assets/images/title/Tree.png';
...@@ -41,14 +42,16 @@ import { ...@@ -41,14 +42,16 @@ import {
LoadEventType, LoadEventType,
UpdateFields, UpdateFields,
} from '@/services/tablemanager/tablemanager'; } from '@/services/tablemanager/tablemanager';
import styles from './index.less';
import VerifyModal from './VerifyModal';
import { import {
PlusSquareOutlined, PlusSquareOutlined,
UnorderedListOutlined, UnorderedListOutlined,
FontColorsOutlined, FontColorsOutlined,
InfoCircleOutlined, InfoCircleOutlined,
MinusCircleOutlined,
PlusOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import styles from './index.less';
import VerifyModal from './VerifyModal';
import Tree from '@/components/ExpendableTree'; import Tree from '@/components/ExpendableTree';
import Things from '../../../../../assets/images/icons/时间.svg'; import Things from '../../../../../assets/images/icons/时间.svg';
const AddModal = props => { const AddModal = props => {
...@@ -129,6 +132,11 @@ const AddModal = props => { ...@@ -129,6 +132,11 @@ const AddModal = props => {
// ID: 5, // ID: 5,
// children: ['智能抄表'], // children: ['智能抄表'],
// }, // },
{
name: '高级控件',
ID: 5,
children: ['关联表单'],
},
]); ]);
const [visible, setVisible] = useState(false); // 弹窗 const [visible, setVisible] = useState(false); // 弹窗
const [isShow, setIsShow] = useState(false); // 弹窗 const [isShow, setIsShow] = useState(false); // 弹窗
...@@ -150,7 +158,6 @@ const AddModal = props => { ...@@ -150,7 +158,6 @@ const AddModal = props => {
picture: '', picture: '',
must: '', must: '',
coordinates: '', coordinates: '',
}); });
const [currentSelectOrg, setCurrentSelectOrg] = useState([]); const [currentSelectOrg, setCurrentSelectOrg] = useState([]);
const [checkedList, setCheckedList] = useState([]); // 选中的复选框内容 const [checkedList, setCheckedList] = useState([]); // 选中的复选框内容
...@@ -180,22 +187,28 @@ const AddModal = props => { ...@@ -180,22 +187,28 @@ const AddModal = props => {
const [preView, setPreView] = useState(true); const [preView, setPreView] = useState(true);
const [viewMuise, setViewMuise] = useState(true); const [viewMuise, setViewMuise] = useState(true);
const [preViewVideo, setPreViewVideo] = useState(true); const [preViewVideo, setPreViewVideo] = useState(true);
const [visibleChecked, setVisibleChecked] = useState(true);
const [formAdd] = Form.useForm();
const onChangeView = e =>{ const change = e => {
setView(e.target.checked) console.log(e);
} setVisibleChecked(e);
};
const onChangeView = e => {
setView(e.target.checked);
};
const onChangePreView = e =>{ const onChangePreView = e => {
setPreView(e.target.checked) setPreView(e.target.checked);
} };
const onChangePreViewMuise = e =>{ const onChangePreViewMuise = e => {
setViewMuise(e.target.checked) setViewMuise(e.target.checked);
} };
const onChangePreViewVideo = e =>{ const onChangePreViewVideo = e => {
setPreViewVideo(e.target.checked) setPreViewVideo(e.target.checked);
} };
// 提交 // 提交
const onSubmit = () => { const onSubmit = () => {
...@@ -212,7 +225,7 @@ const AddModal = props => { ...@@ -212,7 +225,7 @@ const AddModal = props => {
} else { } else {
aa = 0; aa = 0;
} }
console.log(Shape) console.log(Shape);
let data = [ let data = [
{ {
Unit: obj.Unit || '', Unit: obj.Unit || '',
...@@ -252,14 +265,11 @@ const AddModal = props => { ...@@ -252,14 +265,11 @@ const AddModal = props => {
case '值选择器': case '值选择器':
if (obj.Config.endsWith('.n')) { if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config; data[0].Config = obj.Config;
} else { } else if (radiostyle == 1) {
if(radiostyle==1){
// 平铺值选择器 // 平铺值选择器
data[0].Config = cho ? `${obj.Config}.n` : `${obj.Config}`; data[0].Config = cho ? `${obj.Config}.n` : `${obj.Config}`;
}else{ } else {
data[0].Config=obj.Config data[0].Config = obj.Config;
}
} }
break; break;
...@@ -267,10 +277,8 @@ const AddModal = props => { ...@@ -267,10 +277,8 @@ const AddModal = props => {
if (obj.Config.endsWith('.n')) { if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config; data[0].Config = obj.Config;
} else { } else {
// 平铺值选择器 // 平铺值选择器
data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`; data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
} }
break; break;
case '部门选择器': case '部门选择器':
...@@ -298,8 +306,7 @@ const AddModal = props => { ...@@ -298,8 +306,7 @@ const AddModal = props => {
data[0].Config = obj.fieldName data[0].Config = obj.fieldName
? `${obj.tableName}.${obj.fieldName}` ? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}`; : `${obj.tableName}`;
} else { } else if (obj.fieldName) {
if (obj.fieldName) {
data[0].Config = data[0].Config =
radio == 0 radio == 0
? `${obj.tableName}.${obj.fieldName}` ? `${obj.tableName}.${obj.fieldName}`
...@@ -307,13 +314,11 @@ const AddModal = props => { ...@@ -307,13 +314,11 @@ const AddModal = props => {
} else { } else {
data[0].Config = radio == 0 ? `${obj.tableName}` : `${obj.tableName}.n`; data[0].Config = radio == 0 ? `${obj.tableName}` : `${obj.tableName}.n`;
} }
}
break; break;
case '台账选择器': case '台账选择器':
if (obj.fieldName.endsWith('.n')) { if (obj.fieldName.endsWith('.n')) {
data[0].Config = `${obj.standingBook}.${obj.fieldName}`; data[0].Config = `${obj.standingBook}.${obj.fieldName}`;
} else { } else if (obj.fieldName) {
if (obj.fieldName) {
data[0].Config = data[0].Config =
radio == 0 radio == 0
? `${obj.standingBook}.${obj.fieldName}` ? `${obj.standingBook}.${obj.fieldName}`
...@@ -321,11 +326,29 @@ const AddModal = props => { ...@@ -321,11 +326,29 @@ const AddModal = props => {
} else { } else {
data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`; data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`;
} }
}
if (obj.filterName) { if (obj.filterName) {
data[0].Config = `${data[0].Config}?${obj.filterName}`; data[0].Config = `${data[0].Config}?${obj.filterName}`;
} }
break; 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 '选择器': case '选择器':
if (cse) { if (cse) {
let str = cho let str = cho
...@@ -348,15 +371,13 @@ const AddModal = props => { ...@@ -348,15 +371,13 @@ const AddModal = props => {
let str = cho ? `全部ID.n` : `全部ID`; let str = cho ? `全部ID.n` : `全部ID`;
data[0].Config = str; data[0].Config = str;
} }
} else { } else if (obj.ConfigName) {
if (obj.ConfigName) {
let str = cho ? `全部.${obj.ConfigName}.n` : `全部.${obj.ConfigName}`; let str = cho ? `全部.${obj.ConfigName}.n` : `全部.${obj.ConfigName}`;
data[0].Config = str; data[0].Config = str;
} else { } else {
let str = cho ? `全部.n` : `全部`; let str = cho ? `全部.n` : `全部`;
data[0].Config = str; data[0].Config = str;
} }
}
} else if (popeleShape == '下拉框') { } else if (popeleShape == '下拉框') {
let str = cho ? `${obj.Config}.n` : `${obj.Config}`; let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
console.log(str); console.log(str);
...@@ -375,32 +396,32 @@ const AddModal = props => { ...@@ -375,32 +396,32 @@ const AddModal = props => {
data[0].Config = obj.Config; data[0].Config = obj.Config;
} }
console.log(data); console.log(data);
if(Shape=='图片'){ if (Shape == '图片') {
if(view){ if (view) {
data[0].Shape='可预览图片' data[0].Shape = '可预览图片';
}else{ } else {
data[0].Shape='图片' data[0].Shape = '图片';
} }
} }
if(Shape=='附件'){ if (Shape == '附件') {
if(preView){ if (preView) {
data[0].Shape='可预览附件' data[0].Shape = '可预览附件';
}else{ } else {
data[0].Shape='附件' data[0].Shape = '附件';
} }
} }
if(Shape=='值选择器'){ if (Shape == '值选择器') {
if(radiostyle==0){ if (radiostyle == 0) {
if(!cho){ if (!cho) {
data[0].Shape='值选择器' data[0].Shape = '值选择器';
}else{ } else {
data[0].Shape='值复选器' data[0].Shape = '值复选器';
} }
}else{ } else {
data[0].Shape='平铺值选择器' data[0].Shape = '平铺值选择器';
} }
} }
console.log(data) console.log(data);
UpdateFields(data).then(res => { UpdateFields(data).then(res => {
setLoading(false); setLoading(false);
if (res.msg === 'Ok' || res.msg === '') { if (res.msg === 'Ok' || res.msg === '') {
...@@ -465,14 +486,17 @@ const AddModal = props => { ...@@ -465,14 +486,17 @@ const AddModal = props => {
setSynchronization(false); setSynchronization(false);
} }
console.log(res[0].data.root.Shape); console.log(res[0].data.root.Shape);
if(res[0].data.root.StoreType=='datetime'){ if (res[0].data.root.StoreType == 'datetime') {
setCharacteristics1([{ setCharacteristics1([
{
name: '时间类', name: '时间类',
ID: 3, ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'], children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
}]) },
}else{ ]);
setCharacteristics1([{ } else {
setCharacteristics1([
{
name: '文本类', name: '文本类',
ID: 0, ID: 0,
children: [ children: [
...@@ -519,7 +543,13 @@ const AddModal = props => { ...@@ -519,7 +543,13 @@ const AddModal = props => {
name: '地图类', name: '地图类',
ID: 4, ID: 4,
children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'], children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'],
}]) },
{
name: '高级控件',
ID: 5,
children: ['关联表单'],
},
]);
} }
if (res[0].data.root.Shape == '文本') { if (res[0].data.root.Shape == '文本') {
...@@ -545,9 +575,9 @@ const AddModal = props => { ...@@ -545,9 +575,9 @@ const AddModal = props => {
setDetail(''); setDetail('');
} }
let coordinates = false, let coordinates = false;
picture = false, let picture = false;
must = false; let must = false;
switch (res[0].data.root.Shape) { switch (res[0].data.root.Shape) {
case '坐标控件': case '坐标控件':
...@@ -609,8 +639,7 @@ const AddModal = props => { ...@@ -609,8 +639,7 @@ const AddModal = props => {
setPep(true); setPep(true);
setCho(false); setCho(false);
} }
} else { } else if (res[0].data.root.Config.endsWith('.n')) {
if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: false, choose: true }); form.setFieldsValue({ pepole: false, choose: true });
setPep(false); setPep(false);
setCho(true); setCho(true);
...@@ -619,7 +648,6 @@ const AddModal = props => { ...@@ -619,7 +648,6 @@ const AddModal = props => {
setPep(false); setPep(false);
setCho(false); setCho(false);
} }
}
break; break;
case '搜索选择器': case '搜索选择器':
let data = res[0].data.root.Config.split('.'); let data = res[0].data.root.Config.split('.');
...@@ -646,16 +674,16 @@ const AddModal = props => { ...@@ -646,16 +674,16 @@ const AddModal = props => {
if (res[0].data.root.Config.endsWith('.n')) { if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({ form.setFieldsValue({
check: 1, check: 1,
choose: true choose: true,
}); });
setCho(true) setCho(true);
setRadio(1); setRadio(1);
} else { } else {
form.setFieldsValue({ form.setFieldsValue({
check: 0, check: 0,
choose:false choose: false,
}); });
setCho(false) setCho(false);
setRadio(0); setRadio(0);
} }
form.setFieldsValue({ form.setFieldsValue({
...@@ -731,6 +759,24 @@ const AddModal = props => { ...@@ -731,6 +759,24 @@ const AddModal = props => {
setRadio(0); setRadio(0);
} }
break; 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 '选择器': case '选择器':
let sele = res[0].data.root.Config.split('.'); let sele = res[0].data.root.Config.split('.');
console.log(sele[0]); console.log(sele[0]);
...@@ -845,8 +891,7 @@ const AddModal = props => { ...@@ -845,8 +891,7 @@ const AddModal = props => {
setGl(false); setGl(false);
setCho(true); setCho(true);
} }
} else { } else if (tree[1] == '站点') {
if (tree[1] == '站点') {
form.setFieldsValue({ form.setFieldsValue({
PeShape: '树形模态', PeShape: '树形模态',
All1: true, All1: true,
...@@ -867,7 +912,6 @@ const AddModal = props => { ...@@ -867,7 +912,6 @@ const AddModal = props => {
setGl(false); setGl(false);
setCho(false); setCho(false);
} }
}
setPopeleShape('树形模态'); setPopeleShape('树形模态');
} else { } else {
setCheckboxAll1(false); setCheckboxAll1(false);
...@@ -892,45 +936,50 @@ const AddModal = props => { ...@@ -892,45 +936,50 @@ const AddModal = props => {
break; break;
} }
if(res[0].data.root.Shape=='可预览图片'){ if (res[0].data.root.Shape == '可预览图片') {
setView(true); setView(true);
}else if(res[0].data.root.Shape=='图片'){ } else if (res[0].data.root.Shape == '图片') {
setView(false); setView(false);
}else if(res[0].data.root.Shape=='可预览附件'){ } else if (res[0].data.root.Shape == '可预览附件') {
setPreView(true); setPreView(true);
}else if(res[0].data.root.Shape=='附件'){ } else if (res[0].data.root.Shape == '附件') {
setPreView(false); setPreView(false);
}else if(res[0].data.root.Shape=='值选择器'){ } else if (res[0].data.root.Shape == '值选择器') {
setRadiostyle(0); setRadiostyle(0);
setCho(false) setCho(false);
form.setFieldsValue({style:0, choose:false}) form.setFieldsValue({ style: 0, choose: false });
}else if(res[0].data.root.Shape=='值复选器'){ } else if (res[0].data.root.Shape == '值复选器') {
setRadiostyle(0); setRadiostyle(0);
setCho(true) setCho(true);
form.setFieldsValue({style:0, choose: true}) form.setFieldsValue({ style: 0, choose: true });
} }
if(res[0].data.root.Shape=='可预览图片'){ if (res[0].data.root.Shape == '可预览图片') {
setShape('图片') setShape('图片');
}else if(res[0].data.root.Shape=='可预览附件'){ } else if (res[0].data.root.Shape == '可预览附件') {
setShape('附件') setShape('附件');
}else if(res[0].data.root.Shape=='平铺值选择器'){ } else if (res[0].data.root.Shape == '平铺值选择器') {
setShape('值选择器') setShape('值选择器');
}else if(res[0].data.root.Shape=='值复选器'){ } else if (res[0].data.root.Shape == '值复选器') {
setShape('值选择器') setShape('值选择器');
}else { } else {
setShape(res[0].data.root.Shape) setShape(res[0].data.root.Shape);
} }
if(!res[0].data.root.Shape){ if (!res[0].data.root.Shape) {
console.log(1111) console.log(1111);
if(res[0].data.root.StoreType=='datetime'){ if (res[0].data.root.StoreType == 'datetime') {
setShape('日期时间'); 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('数值'); setShape('数值');
}else{ } else {
console.log(1111122222) console.log(1111122222);
setShape('文本'); setShape('文本');
} }
} }
...@@ -996,7 +1045,7 @@ const AddModal = props => { ...@@ -996,7 +1045,7 @@ const AddModal = props => {
setCharacterValue(prop.str); setCharacterValue(prop.str);
} }
}; };
const add = aa => { const add1 = aa => {
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
let data = { numerical: '', rule: [] }; let data = { numerical: '', rule: [] };
console.log(obj.ValidationRule, 'ValidationRule'); console.log(obj.ValidationRule, 'ValidationRule');
...@@ -1127,8 +1176,13 @@ const AddModal = props => { ...@@ -1127,8 +1176,13 @@ const AddModal = props => {
Association: '', Association: '',
farter: '', farter: '',
farterData: '', farterData: '',
workOrder: '',
eventOrder: '',
configName: '',
}); });
} }
formAdd.resetFields()
setVisibleChecked(true);
setView(true); setView(true);
setPreView(true); setPreView(true);
setViewMuise(true); setViewMuise(true);
...@@ -1262,7 +1316,7 @@ const AddModal = props => { ...@@ -1262,7 +1316,7 @@ const AddModal = props => {
const mapTree = org => { const mapTree = org => {
const haveChildren = Array.isArray(org.children) && org.children.length > 0; const haveChildren = Array.isArray(org.children) && org.children.length > 0;
if(org.storeType=='datetime'){ if (org.storeType == 'datetime') {
return { return {
title: ( title: (
<span className={styles.titleText}> <span className={styles.titleText}>
...@@ -1296,20 +1350,21 @@ const AddModal = props => { ...@@ -1296,20 +1350,21 @@ const AddModal = props => {
children: haveChildren ? org.children.map(i => mapTree(i)) : [], children: haveChildren ? org.children.map(i => mapTree(i)) : [],
org, org,
}; };
}; };
const onSelect = (i, e) => { const onSelect = (i, e) => {
console.log(i) console.log(i);
console.log(e) console.log(e);
if(e.node.org.storeType&&e.node.org.storeType=='datetime'){ if (e.node.org.storeType && e.node.org.storeType == 'datetime') {
setCharacteristics1([{ setCharacteristics1([
{
name: '时间类', name: '时间类',
ID: 3, ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'], children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
}]) },
}else if(e.node.org.storeType&&e.node.org.storeType!='datetime'){ ]);
setCharacteristics1([{ } else if (e.node.org.storeType && e.node.org.storeType != 'datetime') {
setCharacteristics1([
{
name: '文本类', name: '文本类',
ID: 0, ID: 0,
children: [ children: [
...@@ -1356,10 +1411,15 @@ const AddModal = props => { ...@@ -1356,10 +1411,15 @@ const AddModal = props => {
name: '地图类', name: '地图类',
ID: 4, ID: 4,
children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'], children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'],
}]) },
{
name: '高级控件',
ID: 5,
children: ['关联表单'],
},
]);
} }
if(e && !e.node.org.children){ if (e && !e.node.org.children) {
setKeep(e); setKeep(e);
if (e.node) { if (e.node) {
setCurrentSelectOrg(e.node.org.ID); setCurrentSelectOrg(e.node.org.ID);
...@@ -1379,54 +1439,59 @@ const AddModal = props => { ...@@ -1379,54 +1439,59 @@ const AddModal = props => {
valueData.map(i => { valueData.map(i => {
bb.push(i.ID.toString()); bb.push(i.ID.toString());
}); });
console.log(valueData) console.log(valueData);
console.log(bb) console.log(bb);
console.log(e.node.org.ID) console.log(e.node.org.ID);
if (bb.indexOf(e.node.org.ID) != -1) { if (bb.indexOf(e.node.org.ID) != -1) {
let aa = valueData.find(i => i.ID == e.node.org.ID); let aa = valueData.find(i => i.ID == e.node.org.ID);
Promise.all([req1, req2, req3]).then(res => { Promise.all([req1, req2, req3]).then(res => {
res[1].msg === 'Ok' && setFieldName(res[1].data.root); res[1].msg === 'Ok' && setFieldName(res[1].data.root);
res[2].msg === 'Ok' && setEventList(res[2].data.root); res[2].msg === 'Ok' && setEventList(res[2].data.root);
if (res[0].msg === 'Ok') { if (res[0].msg === 'Ok') {
console.log(aa) console.log(aa);
if(aa.Shape=='可预览图片'){ if (aa.Shape == '可预览图片') {
setView(true); setView(true);
}else if(aa.Shape=='图片'){ } else if (aa.Shape == '图片') {
setView(false) setView(false);
}else if(aa.Shape=='可预览附件'){ } else if (aa.Shape == '可预览附件') {
setPreView(true); setPreView(true);
}else if(aa.Shape=='附件'){ } else if (aa.Shape == '附件') {
setPreView(false) setPreView(false);
}else if(aa.Shape=='值选择器'){ } else if (aa.Shape == '值选择器') {
setRadiostyle(0); setRadiostyle(0);
setCho(false); setCho(false);
form.setFieldsValue({style:0,choose:false}) form.setFieldsValue({ style: 0, choose: false });
}else if(aa.Shape=='值复选器'){ } else if (aa.Shape == '值复选器') {
setRadiostyle(0); setRadiostyle(0);
setCho(true); setCho(true);
form.setFieldsValue({style:0,choose:true}) form.setFieldsValue({ style: 0, choose: true });
} }
if(aa.Shape=='可预览图片'){ if (aa.Shape == '可预览图片') {
setShape('图片'); setShape('图片');
}else if(aa.Shape=='可预览附件'){ } else if (aa.Shape == '可预览附件') {
setShape('附件') setShape('附件');
}else if(aa.Shape=='平铺值选择器'){ } else if (aa.Shape == '平铺值选择器') {
setShape('值选择器') setShape('值选择器');
}else if(aa.Shape=='值复选器'){ } else if (aa.Shape == '值复选器') {
setShape('值选择器') setShape('值选择器');
}else{ } else {
setShape(aa.Shape); setShape(aa.Shape);
} }
console.log(aa) console.log(aa);
if(aa.Shape){ if (!aa.Shape) {
console.log(1111) console.log(1111);
if(aa.StoreType=='datetime'){ if (aa.StoreType == 'datetime') {
setShape('日期时间'); 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('数值'); setShape('数值');
}else{ } else {
console.log(1111122222) console.log(1111122222);
setShape('文本'); setShape('文本');
} }
} }
...@@ -1467,9 +1532,9 @@ const AddModal = props => { ...@@ -1467,9 +1532,9 @@ const AddModal = props => {
} else { } else {
setDetail(''); setDetail('');
} }
let coordinates = false, let coordinates = false;
picture = false, let picture = false;
must = false; let must = false;
switch (aa.Shape) { switch (aa.Shape) {
case '坐标控件': case '坐标控件':
...@@ -1536,9 +1601,9 @@ const AddModal = props => { ...@@ -1536,9 +1601,9 @@ const AddModal = props => {
}); });
if (aa.Config.endsWith('.n')) { if (aa.Config.endsWith('.n')) {
form.setFieldsValue({ form.setFieldsValue({
choose:true, choose: true,
}); });
setCho(true) setCho(true);
} else { } else {
form.setFieldsValue({ form.setFieldsValue({
choose: false, choose: false,
...@@ -1548,7 +1613,7 @@ const AddModal = props => { ...@@ -1548,7 +1613,7 @@ const AddModal = props => {
form.setFieldsValue({ form.setFieldsValue({
style: 1, style: 1,
}); });
setRadiostyle(1) setRadiostyle(1);
break; break;
case '唯一值文本': case '唯一值文本':
let arr = aa.Config.split('.'); let arr = aa.Config.split('.');
...@@ -1576,7 +1641,6 @@ const AddModal = props => { ...@@ -1576,7 +1641,6 @@ const AddModal = props => {
} }
break; break;
case '站点选择器': case '站点选择器':
let site = aa.Config.split('.'); let site = aa.Config.split('.');
if (site[0] == '本人') { if (site[0] == '本人') {
...@@ -1589,8 +1653,7 @@ const AddModal = props => { ...@@ -1589,8 +1653,7 @@ const AddModal = props => {
setPep(true); setPep(true);
setCho(false); setCho(false);
} }
} else { } else if (aa.Config.endsWith('.n')) {
if (aa.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: false, choose: true }); form.setFieldsValue({ pepole: false, choose: true });
setPep(false); setPep(false);
setCho(true); setCho(true);
...@@ -1599,7 +1662,6 @@ const AddModal = props => { ...@@ -1599,7 +1662,6 @@ const AddModal = props => {
setPep(false); setPep(false);
setCho(false); setCho(false);
} }
}
break; break;
case '部门选择器': case '部门选择器':
let department = aa.Config; let department = aa.Config;
...@@ -1616,6 +1678,24 @@ const AddModal = props => { ...@@ -1616,6 +1678,24 @@ const AddModal = props => {
setRadio(0); setRadio(0);
} }
break; 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 '台账选择器': case '台账选择器':
let book = aa.Config.split('.'); let book = aa.Config.split('.');
let ad = book[1].split('?'); let ad = book[1].split('?');
...@@ -1644,7 +1724,6 @@ const AddModal = props => { ...@@ -1644,7 +1724,6 @@ const AddModal = props => {
} }
break; break;
case '选择器': case '选择器':
let sele = aa.Config.split('.'); let sele = aa.Config.split('.');
if (sele[1] && sele[1] != 'n') { if (sele[1] && sele[1] != 'n') {
form.setFieldsValue({ form.setFieldsValue({
...@@ -1654,7 +1733,6 @@ const AddModal = props => { ...@@ -1654,7 +1733,6 @@ const AddModal = props => {
}); });
setCse(true); setCse(true);
} else { } else {
form.setFieldsValue({ form.setFieldsValue({
Association: false, Association: false,
Config: sele[0], Config: sele[0],
...@@ -1756,8 +1834,7 @@ const AddModal = props => { ...@@ -1756,8 +1834,7 @@ const AddModal = props => {
setGl(false); setGl(false);
setCho(true); setCho(true);
} }
} else { } else if (tree[1] == '站点') {
if (tree[1] == '站点') {
form.setFieldsValue({ form.setFieldsValue({
PeShape: '树形模态', PeShape: '树形模态',
All1: true, All1: true,
...@@ -1778,7 +1855,6 @@ const AddModal = props => { ...@@ -1778,7 +1855,6 @@ const AddModal = props => {
setGl(false); setGl(false);
setCho(false); setCho(false);
} }
}
setPopeleShape('树形模态'); setPopeleShape('树形模态');
} else { } else {
setCheckboxAll1(false); setCheckboxAll1(false);
...@@ -1816,46 +1892,49 @@ const AddModal = props => { ...@@ -1816,46 +1892,49 @@ const AddModal = props => {
res[2].msg === 'Ok' && setEventList(res[2].data.root); res[2].msg === 'Ok' && setEventList(res[2].data.root);
if (res[0].msg === 'Ok') { if (res[0].msg === 'Ok') {
console.log(res[0].data.root.Shape); console.log(res[0].data.root.Shape);
if(res[0].data.root.Shape=='可预览图片'){ if (res[0].data.root.Shape == '可预览图片') {
setView(true) setView(true);
}else if(res[0].data.root.Shape=='图片'){ } else if (res[0].data.root.Shape == '图片') {
setView(false) setView(false);
}else if(res[0].data.root.Shape=='可预览附件'){ } else if (res[0].data.root.Shape == '可预览附件') {
setPreView(true) setPreView(true);
}else if(res[0].data.root.Shape=='附件'){ } else if (res[0].data.root.Shape == '附件') {
setPreView(false) setPreView(false);
}else if(res[0].data.root.Shape=='值选择器'){ } else if (res[0].data.root.Shape == '值选择器') {
setRadiostyle(0); setRadiostyle(0);
setCho(false) setCho(false);
form.setFieldsValue({check:0,style:0,choose:false}) form.setFieldsValue({ check: 0, style: 0, choose: false });
}else if(res[0].data.root.Shape=='值复选器'){ } else if (res[0].data.root.Shape == '值复选器') {
setRadiostyle(0); setRadiostyle(0);
setCho(true) setCho(true);
form.setFieldsValue({check:1,style:0,choose:true}) form.setFieldsValue({ check: 1, style: 0, choose: true });
} }
if(res[0].data.root.Shape=='可预览图片'){ if (res[0].data.root.Shape == '可预览图片') {
setShape('图片'); setShape('图片');
}else if(res[0].data.root.Shape=='可预览附件'){ } else if (res[0].data.root.Shape == '可预览附件') {
setShape('附件'); setShape('附件');
} } else if (res[0].data.root.Shape == '平铺值选择器') {
else if(res[0].data.root.Shape=='平铺值选择器'){
setShape('值选择器'); setShape('值选择器');
}else if(res[0].data.root.Shape=='值复选器'){ } else if (res[0].data.root.Shape == '值复选器') {
setShape('值选择器'); setShape('值选择器');
}else{ } else {
setShape(res[0].data.root.Shape) setShape(res[0].data.root.Shape);
} }
console.log(res[0].data.root) console.log(res[0].data.root);
if(!res[0].data.root.Shape){ if (!res[0].data.root.Shape) {
console.log(1111) console.log(1111);
if(res[0].data.root.StoreType=='datetime'){ if (res[0].data.root.StoreType == 'datetime') {
setShape('日期时间'); 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('数值'); setShape('数值');
}else{ } else {
console.log(1111122222)
setShape('文本'); setShape('文本');
} }
} }
...@@ -1877,10 +1956,9 @@ const AddModal = props => { ...@@ -1877,10 +1956,9 @@ const AddModal = props => {
setSynchronization(false); setSynchronization(false);
} }
let coordinates = false;
let coordinates = false, let picture = false;
picture = false, let must = false;
must = false;
switch (res[0].data.root.Shape) { switch (res[0].data.root.Shape) {
case '坐标控件': case '坐标控件':
res[0].data.root.Config === '当前坐标' res[0].data.root.Config === '当前坐标'
...@@ -1949,19 +2027,19 @@ const AddModal = props => { ...@@ -1949,19 +2027,19 @@ const AddModal = props => {
}); });
if (res[0].data.root.Config.endsWith('.n')) { if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({ form.setFieldsValue({
choose:true choose: true,
}); });
setCho(true) setCho(true);
} else { } else {
form.setFieldsValue({ form.setFieldsValue({
choose:false choose: false,
}); });
setCho(false); setCho(false);
} }
form.setFieldsValue({ form.setFieldsValue({
style: 1, style: 1,
}); });
setRadiostyle(1) setRadiostyle(1);
break; break;
case '唯一值文本': case '唯一值文本':
let arr = res[0].data.root.Config.split('.'); let arr = res[0].data.root.Config.split('.');
...@@ -1983,8 +2061,7 @@ const AddModal = props => { ...@@ -1983,8 +2061,7 @@ const AddModal = props => {
setPep(true); setPep(true);
setCho(false); setCho(false);
} }
} else { } else if (res[0].data.root.Config.endsWith('.n')) {
if (res[0].data.root.Config.endsWith('.n')) {
form.setFieldsValue({ pepole: false, choose: true }); form.setFieldsValue({ pepole: false, choose: true });
setPep(false); setPep(false);
setCho(true); setCho(true);
...@@ -1993,7 +2070,6 @@ const AddModal = props => { ...@@ -1993,7 +2070,6 @@ const AddModal = props => {
setPep(false); setPep(false);
setCho(false); setCho(false);
} }
}
break; break;
case '业务选择器': case '业务选择器':
let list = res[0].data.root.Config.split('.'); let list = res[0].data.root.Config.split('.');
...@@ -2029,6 +2105,25 @@ const AddModal = props => { ...@@ -2029,6 +2105,25 @@ const AddModal = props => {
setRadio(0); setRadio(0);
} }
break; 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 '台账选择器': case '台账选择器':
let book = res[0].data.root.Config.split('.'); let book = res[0].data.root.Config.split('.');
let ab = book[1].split('?'); let ab = book[1].split('?');
...@@ -2066,7 +2161,6 @@ const AddModal = props => { ...@@ -2066,7 +2161,6 @@ const AddModal = props => {
}); });
setCse(true); setCse(true);
} else { } else {
form.setFieldsValue({ form.setFieldsValue({
Association: false, Association: false,
Config: sele[0], Config: sele[0],
...@@ -2168,8 +2262,7 @@ const AddModal = props => { ...@@ -2168,8 +2262,7 @@ const AddModal = props => {
setGl(false); setGl(false);
setCho(true); setCho(true);
} }
} else { } else if (tree[1] == '站点') {
if (tree[1] == '站点') {
form.setFieldsValue({ form.setFieldsValue({
PeShape: '树形模态', PeShape: '树形模态',
All1: true, All1: true,
...@@ -2190,7 +2283,6 @@ const AddModal = props => { ...@@ -2190,7 +2283,6 @@ const AddModal = props => {
setGl(false); setGl(false);
setCho(false); setCho(false);
} }
}
setPopeleShape('树形模态'); setPopeleShape('树形模态');
} else { } else {
setCheckboxAll1(false); setCheckboxAll1(false);
...@@ -2216,7 +2308,9 @@ const AddModal = props => { ...@@ -2216,7 +2308,9 @@ const AddModal = props => {
} }
setValue1(); setValue1();
setPramData({ ...res[0].data.root, coordinates, must, picture }); 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); getFieldData(index.TableName);
} }
...@@ -2226,7 +2320,6 @@ const AddModal = props => { ...@@ -2226,7 +2320,6 @@ const AddModal = props => {
} }
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
setLoading(true); setLoading(true);
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
...@@ -2236,7 +2329,7 @@ const AddModal = props => { ...@@ -2236,7 +2329,7 @@ const AddModal = props => {
} else { } else {
aa = 0; aa = 0;
} }
console.log(obj) console.log(obj);
let data = [ let data = [
{ {
Unit: obj.Unit || '', Unit: obj.Unit || '',
...@@ -2259,35 +2352,34 @@ const AddModal = props => { ...@@ -2259,35 +2352,34 @@ const AddModal = props => {
ExceptionEventFields: characterValue, ExceptionEventFields: characterValue,
}, },
]; ];
console.log(Shape) console.log(Shape);
if(Shape=='图片'){ if (Shape == '图片') {
if(view){ if (view) {
data[0].Shape='可预览图片' data[0].Shape = '可预览图片';
}else{ } else {
data[0].Shape='图片' data[0].Shape = '图片';
} }
} }
if(Shape=='附件'){ if (Shape == '附件') {
if(preView){ if (preView) {
data[0].Shape='可预览附件' data[0].Shape = '可预览附件';
}else{ } else {
data[0].Shape='附件' data[0].Shape = '附件';
} }
} }
if(Shape=='值选择器'){ if (Shape == '值选择器') {
if(radiostyle==0){ if (radiostyle == 0) {
if(!cho){ if (!cho) {
data[0].Shape='值选择器' data[0].Shape = '值选择器';
}else{ } else {
data[0].Shape='值复选器' data[0].Shape = '值复选器';
} }
}else{ } else {
data[0].Shape='平铺值选择器' data[0].Shape = '平铺值选择器';
} }
} }
switch (Shape) { switch (Shape) {
case '编码': case '编码':
data[0].Config = `${obj.code}.${obj.prefix ? obj.prefix : ''}`; data[0].Config = `${obj.code}.${obj.prefix ? obj.prefix : ''}`;
...@@ -2305,10 +2397,7 @@ const AddModal = props => { ...@@ -2305,10 +2397,7 @@ const AddModal = props => {
if (obj.Config.endsWith('.n')) { if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config; data[0].Config = obj.Config;
} else { } else {
data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`; data[0].Config = radio == 0 ? `${obj.Config}` : `${obj.Config}.n`;
} }
break; break;
case '唯一值文本': case '唯一值文本':
...@@ -2324,8 +2413,7 @@ const AddModal = props => { ...@@ -2324,8 +2413,7 @@ const AddModal = props => {
data[0].Config = obj.fieldName data[0].Config = obj.fieldName
? `${obj.tableName}.${obj.fieldName}` ? `${obj.tableName}.${obj.fieldName}`
: `${obj.tableName}`; : `${obj.tableName}`;
} else { } else if (obj.fieldName) {
if (obj.fieldName) {
data[0].Config = data[0].Config =
radio == 0 radio == 0
? `${obj.tableName}.${obj.fieldName}` ? `${obj.tableName}.${obj.fieldName}`
...@@ -2333,7 +2421,6 @@ const AddModal = props => { ...@@ -2333,7 +2421,6 @@ const AddModal = props => {
} else { } else {
data[0].Config = radio == 0 ? `${obj.tableName}` : `${obj.tableName}.n`; data[0].Config = radio == 0 ? `${obj.tableName}` : `${obj.tableName}.n`;
} }
}
break; break;
case '部门选择器': case '部门选择器':
if (obj.check == 0) { if (obj.check == 0) {
...@@ -2345,8 +2432,7 @@ const AddModal = props => { ...@@ -2345,8 +2432,7 @@ const AddModal = props => {
case '台账选择器': case '台账选择器':
if (obj.fieldName.endsWith('.n')) { if (obj.fieldName.endsWith('.n')) {
data[0].Config = `${obj.standingBook}.${obj.fieldName}`; data[0].Config = `${obj.standingBook}.${obj.fieldName}`;
} else { } else if (obj.fieldName) {
if (obj.fieldName) {
data[0].Config = data[0].Config =
radio == 0 radio == 0
? `${obj.standingBook}.${obj.fieldName}` ? `${obj.standingBook}.${obj.fieldName}`
...@@ -2354,11 +2440,27 @@ const AddModal = props => { ...@@ -2354,11 +2440,27 @@ const AddModal = props => {
} else { } else {
data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`; data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`;
} }
}
if (obj.filterName) { if (obj.filterName) {
data[0].Config = `${data[0].Config}?${obj.filterName}`; data[0].Config = `${data[0].Config}?${obj.filterName}`;
} }
break; 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 '选择器': case '选择器':
if (cse) { if (cse) {
let str = cho let str = cho
...@@ -2373,14 +2475,11 @@ const AddModal = props => { ...@@ -2373,14 +2475,11 @@ const AddModal = props => {
case '值选择器': case '值选择器':
if (obj.Config.endsWith('.n')) { if (obj.Config.endsWith('.n')) {
data[0].Config = obj.Config; data[0].Config = obj.Config;
} else { } else if (radiostyle == 1) {
if(radiostyle==1){
// 平铺值选择器 // 平铺值选择器
data[0].Config = cho ? `${obj.Config}.n` : `${obj.Config}`; data[0].Config = cho ? `${obj.Config}.n` : `${obj.Config}`;
}else{ } else {
data[0].Config=obj.Config data[0].Config = obj.Config;
}
} }
break; break;
case '人员选择器': case '人员选择器':
...@@ -2393,15 +2492,13 @@ const AddModal = props => { ...@@ -2393,15 +2492,13 @@ const AddModal = props => {
let str = cho ? `全部ID.n` : `全部ID`; let str = cho ? `全部ID.n` : `全部ID`;
data[0].Config = str; data[0].Config = str;
} }
} else { } else if (obj.ConfigName) {
if (obj.ConfigName) {
let str = cho ? `全部.${obj.ConfigName}.n` : `全部.${obj.ConfigName}`; let str = cho ? `全部.${obj.ConfigName}.n` : `全部.${obj.ConfigName}`;
data[0].Config = str; data[0].Config = str;
} else { } else {
let str = cho ? `全部.n` : `全部`; let str = cho ? `全部.n` : `全部`;
data[0].Config = str; data[0].Config = str;
} }
}
} else if (popeleShape == '下拉框') { } else if (popeleShape == '下拉框') {
let str = cho ? `${obj.Config}.n` : `${obj.Config}`; let str = cho ? `${obj.Config}.n` : `${obj.Config}`;
...@@ -2419,9 +2516,9 @@ const AddModal = props => { ...@@ -2419,9 +2516,9 @@ const AddModal = props => {
default: default:
data[0].Config = obj.Config; data[0].Config = obj.Config;
} }
console.log(data[0]) console.log(data[0]);
let aadata = valueData; let aadata = valueData;
console.log(keepTreeFirst) console.log(keepTreeFirst);
// if (keepTreeFirst.indexOf(e.node.org.name) == -1) { // if (keepTreeFirst.indexOf(e.node.org.name) == -1) {
if (aadata.length > 0) { if (aadata.length > 0) {
let aa = []; let aa = [];
...@@ -2441,10 +2538,10 @@ const AddModal = props => { ...@@ -2441,10 +2538,10 @@ const AddModal = props => {
aadata.push(data[0]); aadata.push(data[0]);
} }
// } // }
console.log(valueData) console.log(valueData);
console.log(aadata) console.log(aadata);
setValueData(aadata) setValueData(aadata);
form.setFieldsValue({ form.setFieldsValue({
Association: '', Association: '',
Config: '', Config: '',
...@@ -2467,7 +2564,11 @@ const AddModal = props => { ...@@ -2467,7 +2564,11 @@ const AddModal = props => {
PeShape: '', PeShape: '',
farter: '', farter: '',
farterData: '', farterData: '',
workOrder: '',
eventOrder: '',
configName: '',
}); });
setVisibleChecked(true);
setCse(''); setCse('');
setPopeleShape(''); setPopeleShape('');
setRadio(0); setRadio(0);
...@@ -2513,9 +2614,9 @@ const AddModal = props => { ...@@ -2513,9 +2614,9 @@ const AddModal = props => {
setValue1(); setValue1();
}; };
const onChangestyle = e =>{ const onChangestyle = e => {
setRadiostyle(e.target.value); setRadiostyle(e.target.value);
} };
const timeDataOnVChange = e => { const timeDataOnVChange = e => {
console.log(e.target.value); console.log(e.target.value);
...@@ -2565,43 +2666,33 @@ const AddModal = props => { ...@@ -2565,43 +2666,33 @@ const AddModal = props => {
} else { } else {
form.setFieldsValue({ ShowConfig: `全部ID.${bb}` }); form.setFieldsValue({ ShowConfig: `全部ID.${bb}` });
} }
} else { } else if (ff == 1) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部ID.n` }); form.setFieldsValue({ ShowConfig: `全部ID.n` });
} else { } else {
form.setFieldsValue({ ShowConfig: `全部ID` }); form.setFieldsValue({ ShowConfig: `全部ID` });
} }
} } else if (bb) {
} else {
if (bb) {
if (ff == 1) { if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部.${bb}.n` }); form.setFieldsValue({ ShowConfig: `全部.${bb}.n` });
} else { } else {
form.setFieldsValue({ ShowConfig: `全部.${bb}` }); form.setFieldsValue({ ShowConfig: `全部.${bb}` });
} }
} else { } else if (ff == 1) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部.n` }); form.setFieldsValue({ ShowConfig: `全部.n` });
} else { } else {
form.setFieldsValue({ ShowConfig: `全部` }); form.setFieldsValue({ ShowConfig: `全部` });
} }
} } else if (aa) {
}
} else {
if (aa) {
if (ff == 1) { if (ff == 1) {
form.setFieldsValue({ ShowConfig: `${aa}.n` }); form.setFieldsValue({ ShowConfig: `${aa}.n` });
} else { } else {
form.setFieldsValue({ ShowConfig: `${aa}` }); form.setFieldsValue({ ShowConfig: `${aa}` });
} }
} else { } else if (ff == 1) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `.n` }); form.setFieldsValue({ ShowConfig: `.n` });
} else { } else {
form.setFieldsValue({ ShowConfig: '' }); form.setFieldsValue({ ShowConfig: '' });
} }
}
}
}; };
const setValue1 = () => { const setValue1 = () => {
...@@ -2618,46 +2709,37 @@ const AddModal = props => { ...@@ -2618,46 +2709,37 @@ const AddModal = props => {
} else { } else {
form.setFieldsValue({ ShowConfig: `全部ID.${aa}` }); form.setFieldsValue({ ShowConfig: `全部ID.${aa}` });
} }
} else { } else if (ff == 1) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部ID.n` }); form.setFieldsValue({ ShowConfig: `全部ID.n` });
} else { } else {
form.setFieldsValue({ ShowConfig: `全部ID` }); form.setFieldsValue({ ShowConfig: `全部ID` });
} }
} } else if (aa) {
} else {
if (aa) {
if (ff == 1) { if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部.${aa}.n` }); form.setFieldsValue({ ShowConfig: `全部.${aa}.n` });
} else { } else {
form.setFieldsValue({ ShowConfig: `全部.${aa}` }); form.setFieldsValue({ ShowConfig: `全部.${aa}` });
} }
} else { } else if (ff == 1) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `全部.n` }); form.setFieldsValue({ ShowConfig: `全部.n` });
} else { } else {
form.setFieldsValue({ ShowConfig: `全部` }); form.setFieldsValue({ ShowConfig: `全部` });
} }
} } else if (bb) {
}
} else {
if (bb) {
if (ff == 1) { if (ff == 1) {
form.setFieldsValue({ ShowConfig: `${bb}.n` }); form.setFieldsValue({ ShowConfig: `${bb}.n` });
} else { } else {
form.setFieldsValue({ ShowConfig: `${bb}` }); form.setFieldsValue({ ShowConfig: `${bb}` });
} }
} else { } else if (ff == 1) {
if (ff == 1) {
form.setFieldsValue({ ShowConfig: `.n` }); form.setFieldsValue({ ShowConfig: `.n` });
} else { } else {
form.setFieldsValue({ ShowConfig: '' }); form.setFieldsValue({ ShowConfig: '' });
} }
}
}
}; };
const mapTreeSelect = org => org.children ? ( const mapTreeSelect = org =>
org.children ? (
<TreeNode value={org.name} title={org.name} disabled> <TreeNode value={org.name} title={org.name} disabled>
{org.children.map(item => mapTreeSelect(item))} {org.children.map(item => mapTreeSelect(item))}
</TreeNode> </TreeNode>
...@@ -2826,7 +2908,6 @@ const AddModal = props => { ...@@ -2826,7 +2908,6 @@ const AddModal = props => {
{/* <Col span={1} /> */} {/* <Col span={1} /> */}
<Col span={16}> <Col span={16}>
<Item label="形态" labelCol={{ span: 6 }}> <Item label="形态" labelCol={{ span: 6 }}>
<TreeSelect <TreeSelect
style={{ width: '95%' }} style={{ width: '95%' }}
value={Shape} value={Shape}
...@@ -2844,8 +2925,6 @@ const AddModal = props => { ...@@ -2844,8 +2925,6 @@ const AddModal = props => {
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)} )}
</TreeSelect> </TreeSelect>
</Item> </Item>
</Col> </Col>
...@@ -2939,8 +3018,17 @@ const AddModal = props => { ...@@ -2939,8 +3018,17 @@ const AddModal = props => {
placeholder="用英文逗号分隔自定义的值,勾选,可设置初始值" placeholder="用英文逗号分隔自定义的值,勾选,可设置初始值"
/> />
</Item> </Item>
<Item colon={false} name="style" label="交互方式:" labelCol={{ span: 4 }}> <Item
<Radio.Group onChange={onChangestyle} value={radiostyle} defaultValue={cheestyle}> colon={false}
name="style"
label="交互方式:"
labelCol={{ span: 4 }}
>
<Radio.Group
onChange={onChangestyle}
value={radiostyle}
defaultValue={cheestyle}
>
<Radio value={0}>下拉框</Radio> <Radio value={0}>下拉框</Radio>
<Radio value={1}>平铺</Radio> <Radio value={1}>平铺</Radio>
</Radio.Group> </Radio.Group>
...@@ -2951,7 +3039,7 @@ const AddModal = props => { ...@@ -2951,7 +3039,7 @@ const AddModal = props => {
<Radio value={1}>多选</Radio> <Radio value={1}>多选</Radio>
</Radio.Group> </Radio.Group>
</Item> */} </Item> */}
<Item name="choose" label="配置:" labelCol={{ span: 4 }} > <Item name="choose" label="配置:" labelCol={{ span: 4 }}>
<Checkbox <Checkbox
checked={cho} checked={cho}
onChange={changeChoose} onChange={changeChoose}
...@@ -2967,8 +3055,7 @@ const AddModal = props => { ...@@ -2967,8 +3055,7 @@ const AddModal = props => {
return ( return (
<Item name="ReadOnly" label="配置" labelCol={{ span: 4 }}> <Item name="ReadOnly" label="配置" labelCol={{ span: 4 }}>
<div> <div>
<Checkbox <Checkbox checked={view} onChange={onChangeView}>
checked={view} onChange={onChangeView}>
可预览 可预览
</Checkbox> </Checkbox>
<Checkbox <Checkbox
...@@ -2991,10 +3078,7 @@ const AddModal = props => { ...@@ -2991,10 +3078,7 @@ const AddModal = props => {
return ( return (
<Item label="配置" labelCol={{ span: 4 }}> <Item label="配置" labelCol={{ span: 4 }}>
<div> <div>
<Checkbox <Checkbox checked={preView} onChange={onChangePreView}>
checked={preView}
onChange={onChangePreView}
>
可预览 可预览
</Checkbox> </Checkbox>
</div> </div>
...@@ -3180,6 +3264,144 @@ const AddModal = props => { ...@@ -3180,6 +3264,144 @@ const AddModal = props => {
</div> </div>
</Item> </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 '台账选择器': case '台账选择器':
return ( return (
<> <>
...@@ -3189,7 +3411,7 @@ const AddModal = props => { ...@@ -3189,7 +3411,7 @@ const AddModal = props => {
label="台账名" label="台账名"
name="standingBook" name="standingBook"
labelCol={{ span: 6 }} labelCol={{ span: 6 }}
rules={[{ required: true, message: '请输入台账名' }]} rules={[{ required: true, message: '请选择台账名' }]}
> >
<Select showSearch style={{ width: '95%' }}> <Select showSearch style={{ width: '95%' }}>
{keepStandingBook {keepStandingBook
...@@ -3508,7 +3730,7 @@ const AddModal = props => { ...@@ -3508,7 +3730,7 @@ const AddModal = props => {
<Tooltip title="选择验证规则"> <Tooltip title="选择验证规则">
<PlusSquareOutlined <PlusSquareOutlined
onClick={() => { onClick={() => {
add('rule'); add1('rule');
}} }}
style={{ style={{
fontSize: '24px', fontSize: '24px',
...@@ -3523,7 +3745,6 @@ const AddModal = props => { ...@@ -3523,7 +3745,6 @@ const AddModal = props => {
</Item> </Item>
)} )}
{/* <Item label="异常值"> {/* <Item label="异常值">
<div className={styles.listEvent}> <div className={styles.listEvent}>
<Input <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