Commit ce438be4 authored by 涂伟's avatar 涂伟
parents 1c655002 e2679c15
Pipeline #75279 passed with stages
...@@ -10,7 +10,16 @@ const fnList = [ ...@@ -10,7 +10,16 @@ const fnList = [
{ label: '上报人工单统计', value: '$fn.caseNum()' }, { label: '上报人工单统计', value: '$fn.caseNum()' },
]; ];
const RuleConfig = props => { const RuleConfig = props => {
const { visible, handleCancel, fieldList, onSubumit, RuleContent, flag, flowID } = props; const {
visible,
handleCancel,
fieldList,
onSubumit,
RuleContent,
flag,
flowID,
showInsertFn,
} = props;
const [rule, setRule] = useState([]); const [rule, setRule] = useState([]);
const [expandedKey, setExpandedKey] = useState(''); // 默认展开项 const [expandedKey, setExpandedKey] = useState(''); // 默认展开项
const [currentSelectId, setCurrentSelectId] = useState(''); // 选中得节点 const [currentSelectId, setCurrentSelectId] = useState(''); // 选中得节点
...@@ -109,9 +118,11 @@ const RuleConfig = props => { ...@@ -109,9 +118,11 @@ const RuleConfig = props => {
<div className={styles.rightContent}> <div className={styles.rightContent}>
{flag == 1 && <div className={styles.title}>符合以下条件时工单扭转到对应的节点</div>} {flag == 1 && <div className={styles.title}>符合以下条件时工单扭转到对应的节点</div>}
<div className={styles.textAreaBox}> <div className={styles.textAreaBox}>
{flag == 1 && (
<Dropdown overlay={fnListRender} placement="bottom" arrow> <Dropdown overlay={fnListRender} placement="bottom" arrow>
<div className={styles.insertFn}>插入函数</div> <div className={styles.insertFn}>插入函数</div>
</Dropdown> </Dropdown>
)}
<TextArea <TextArea
id="ruleText" id="ruleText"
......
/* eslint-disable prefer-promise-reject-errors */
/* eslint-disable indent */ /* eslint-disable indent */
/* eslint-disable camelcase */ /* eslint-disable camelcase */
/* eslint-disable no-unused-expressions */ /* eslint-disable no-unused-expressions */
...@@ -18,6 +19,7 @@ import { ...@@ -18,6 +19,7 @@ import {
Radio, Radio,
Switch, Switch,
TreeSelect, TreeSelect,
message,
} from 'antd'; } from 'antd';
import { import {
PlusOutlined, PlusOutlined,
...@@ -28,6 +30,7 @@ import { ...@@ -28,6 +30,7 @@ import {
} from '@ant-design/icons'; } from '@ant-design/icons';
import { setAutoFreeze } from 'immer'; import { setAutoFreeze } from 'immer';
import styles from './maintenance.less'; import styles from './maintenance.less';
import RuleConfig from '@/components/RuleConfig';
import { import {
CM_XWBPlan_AccountTable, CM_XWBPlan_AccountTable,
CM_XWBPlan_feedbackTable, CM_XWBPlan_feedbackTable,
...@@ -35,6 +38,8 @@ import { ...@@ -35,6 +38,8 @@ import {
CM_XWBPlan_DataList, CM_XWBPlan_DataList,
CM_XWBPlan_DeviceAccountTable, CM_XWBPlan_DeviceAccountTable,
GetParentDeviceTemplate, GetParentDeviceTemplate,
GetFeedbackTableFields,
GetAccountConfigInfo,
} from '@/services/maintenance/api'; } from '@/services/maintenance/api';
import { GetTaskSyncField } from '@/services/PatrolFeedback/api'; import { GetTaskSyncField } from '@/services/PatrolFeedback/api';
...@@ -60,7 +65,7 @@ const AddModal = props => { ...@@ -60,7 +65,7 @@ const AddModal = props => {
const [selectValue1, setSelectValue1] = useState(''); const [selectValue1, setSelectValue1] = useState('');
const [treeData, setTreeData] = useState([]); const [treeData, setTreeData] = useState([]);
const [isVisible, setIsVisible] = useState(false); const [isVisible, setIsVisible] = useState(false);
const [filed, setFiled] = useState({}); // 传给子组件列表数据 const [filed, setFiled] = useState([]); // 传给子组件列表数据
const [filed1, setFiled1] = useState({}); // 传给子组件列表数据 const [filed1, setFiled1] = useState({}); // 传给子组件列表数据
const [types, setTypes] = useState(''); // 弹窗类型 const [types, setTypes] = useState(''); // 弹窗类型
const [pickItem, setPickItem] = useState(''); // 复选框数据填入项 const [pickItem, setPickItem] = useState(''); // 复选框数据填入项
...@@ -78,19 +83,12 @@ const AddModal = props => { ...@@ -78,19 +83,12 @@ const AddModal = props => {
const [autoFlag, setAutoFlag] = useState(false); // 禁用自动派发 const [autoFlag, setAutoFlag] = useState(false); // 禁用自动派发
const [keepData, setKeepData] = useState(''); const [keepData, setKeepData] = useState('');
const [parentList, setParentList] = useState([]); const [parentList, setParentList] = useState([]);
const [keep, setKeep] = useState([ const [keep, setKeep] = useState([]); // 保存初始完整任务同步事件字段
'任务编码',
'设备编码',
'计划编码',
'任务类型',
'设备类型',
'坐标位置',
'详细地址',
'执行人',
]); // 保存初始完整任务同步事件字段
const [keepAllData, setKeepAllData] = useState([]); // 保存所有关联事件类型数据 const [keepAllData, setKeepAllData] = useState([]); // 保存所有关联事件类型数据
const [keepTree, setKeepTree] = useState([]); const [keepTree, setKeepTree] = useState([]);
const [keepAll, setKeepAll] = useState([]); // 保存所选关联事件下完整的字段值 const [keepAll, setKeepAll] = useState([]); // 保存所选关联事件下完整的字段值
const [showRule, setShowRule] = useState(false);
const [fieldList, setFieldList] = useState([]);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [formAdd] = Form.useForm(); const [formAdd] = Form.useForm();
...@@ -157,13 +155,14 @@ const AddModal = props => { ...@@ -157,13 +155,14 @@ const AddModal = props => {
} else if (type === 'edit') { } else if (type === 'edit') {
CM_XWBPlan_DataList({ id: formObj.id }).then(res => { CM_XWBPlan_DataList({ id: formObj.id }).then(res => {
let data = res.data[0]; let data = res.data[0];
if (data.isSubmit == '是') { if (data.isSubmit === '是') {
setAutoFlag(true); setAutoFlag(true);
} else { } else {
setAutoFlag(false); setAutoFlag(false);
} }
setVisibleChecked(data.isSubmit == '是'); onChangeFeed(data.feedbackName);
setVisibleChecked1(data.autoAssign == '是'); setVisibleChecked(data.isSubmit === '是');
setVisibleChecked1(data.autoAssign === '是');
console.log(data); console.log(data);
data && form.setFieldsValue({ ...data }); data && form.setFieldsValue({ ...data });
if (data.parentBusinessName) { if (data.parentBusinessName) {
...@@ -188,7 +187,8 @@ const AddModal = props => { ...@@ -188,7 +187,8 @@ const AddModal = props => {
form.resetFields(); form.resetFields();
formAdd.resetFields(); formAdd.resetFields();
setKeepTree([]); setKeepTree([]);
setKeepData(''); setKeepData([]);
setKeep([]);
} }
}, [visible]); }, [visible]);
...@@ -212,8 +212,8 @@ const AddModal = props => { ...@@ -212,8 +212,8 @@ const AddModal = props => {
if (res.code === 0) { if (res.code === 0) {
let aa = []; let aa = [];
let bb = []; let bb = [];
res.data.map(i => { res.data.forEach(i => {
i.root.map(j => { i.root.forEach(j => {
aa.push(j.name); aa.push(j.name);
bb.push(j); bb.push(j);
}); });
...@@ -239,22 +239,29 @@ const AddModal = props => { ...@@ -239,22 +239,29 @@ const AddModal = props => {
if (validate) { if (validate) {
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
let mappingFields = formAdd.getFieldValue('parmars'); let mappingFields = formAdd.getFieldValue('parmars');
// mappingFields &&
// mappingFields.forEach(i => {
// keep.forEach(j => {
// if (j === i.fromField) {
// i.fromField = j;
// }
// });
// });
mappingFields && mappingFields &&
mappingFields.map(i => { mappingFields.forEach(i => {
keep.map(j => { let data = i.fromField.split('%');
if (j === i.fromField) { i.fromField = data[0];
i.fromField = j; i.fromTable = data[1];
}
});
}); });
obj.isSubmit = visibleChecked == true ? '是' : '否'; obj.isSubmit = visibleChecked === true ? '是' : '否';
obj.autoAssign = visibleChecked1 == true ? '是' : '否'; obj.autoAssign = visibleChecked1 === true ? '是' : '否';
if (type == 'add') { if (type === 'add') {
CM_XWBPlan_DataEditORAdd({ CM_XWBPlan_DataEditORAdd({
...obj, ...obj,
mappingFields: mappingFields && JSON.stringify(mappingFields), mappingFields: mappingFields && JSON.stringify(mappingFields),
}).then(res => { }).then(res => {
if (res.msg == '') { if (res.msg === '') {
form.resetFields(); form.resetFields();
callBackSubmit(); callBackSubmit();
notification.success({ notification.success({
...@@ -271,17 +278,17 @@ const AddModal = props => { ...@@ -271,17 +278,17 @@ const AddModal = props => {
} }
}); });
} }
if (type == 'edit') { if (type === 'edit') {
console.log(obj.isSubmit); console.log(obj.isSubmit);
obj.isSubmit = visibleChecked == true ? '是' : '否'; obj.isSubmit = visibleChecked === true ? '是' : '否';
obj.autoAssign = visibleChecked1 == true ? '是' : '否'; obj.autoAssign = visibleChecked1 === true ? '是' : '否';
console.log(obj); console.log(obj);
CM_XWBPlan_DataEditORAdd({ CM_XWBPlan_DataEditORAdd({
...obj, ...obj,
id: formObj.id, id: formObj.id,
mappingFields: mappingFields && JSON.stringify(mappingFields), mappingFields: mappingFields && JSON.stringify(mappingFields),
}).then(res => { }).then(res => {
if (res.msg == '') { if (res.msg === '') {
form.resetFields(); form.resetFields();
callBackSubmit(); callBackSubmit();
notification.success({ notification.success({
...@@ -352,9 +359,9 @@ const AddModal = props => { ...@@ -352,9 +359,9 @@ const AddModal = props => {
const groupArr = (initialArr, name) => { const groupArr = (initialArr, name) => {
let list = {}; let list = {};
initialArr.data.map(i => { initialArr.data.forEach(i => {
let ar = []; let ar = [];
i.root.map(j => { i.root.forEach(j => {
let ss = {}; let ss = {};
ss.label = j.Name; ss.label = j.Name;
ss.value = j.ID.toString(); ss.value = j.ID.toString();
...@@ -369,7 +376,7 @@ const AddModal = props => { ...@@ -369,7 +376,7 @@ const AddModal = props => {
CM_XWBPlan_feedbackTable().then(res => { CM_XWBPlan_feedbackTable().then(res => {
if (res.code === 0) { if (res.code === 0) {
let arr = []; let arr = [];
res.data.map((item, index) => { res.data.forEach((item, index) => {
arr.push(item.accountName); arr.push(item.accountName);
}); });
setFiled(arr); setFiled(arr);
...@@ -381,28 +388,19 @@ const AddModal = props => { ...@@ -381,28 +388,19 @@ const AddModal = props => {
let a1 = []; let a1 = [];
let a2; let a2;
let a3 = []; let a3 = [];
initialArr.data.map(i => { initialArr.data.forEach(i => {
// console.log(i.groupType)
a2 = i.groupType; a2 = i.groupType;
// console.log(a2)
// console.log(i.root)
a1 = i.root; a1 = i.root;
a1.map(j => { a1.forEach(j => {
j.group = a2; j.group = a2;
// console.log(j)
}); });
aa.push(i.root); aa.push(i.root);
}); });
// console.log(aa) aa.forEach(p => {
aa.map(p => { p.forEach(o => {
// console.log(p)
p.map(o => {
// console.log(o)
a3.push(o); a3.push(o);
}); });
}); });
console.log(a3);
// 判定传参是否符合规则 // 判定传参是否符合规则
if (!(a3 instanceof Array)) { if (!(a3 instanceof Array)) {
return '请传入正确格式的数组'; return '请传入正确格式的数组';
...@@ -412,12 +410,11 @@ const AddModal = props => { ...@@ -412,12 +410,11 @@ const AddModal = props => {
} }
// 先获取一下这个数组中有多少个"name" // 先获取一下这个数组中有多少个"name"
let nameArr = []; let nameArr = [];
a3.map(i => { a3.forEach(i => {
if (nameArr.indexOf(i.group) === -1) { if (nameArr.indexOf(i.group) === -1) {
nameArr.push(i.group); nameArr.push(i.group);
} }
}); });
console.log(nameArr);
// 新建一个包含多个list的结果对象 // 新建一个包含多个list的结果对象
let tempObj = {}; let tempObj = {};
// 根据不同的"name"生成多个数组 // 根据不同的"name"生成多个数组
...@@ -430,7 +427,6 @@ const AddModal = props => { ...@@ -430,7 +427,6 @@ const AddModal = props => {
} }
} }
} }
console.log(tempObj);
for (let key in tempObj) { for (let key in tempObj) {
let arr = []; let arr = [];
tempObj[key].map(item => { tempObj[key].map(item => {
...@@ -440,12 +436,7 @@ const AddModal = props => { ...@@ -440,12 +436,7 @@ const AddModal = props => {
} }
return tempObj; return tempObj;
}; };
const changTable = value => {
setSelectValue(value);
};
const changTable1 = value => {
setSelectValue1(value);
};
const onOK = prop => { const onOK = prop => {
setIsVisibleRoles(false); setIsVisibleRoles(false);
let inputText = {}; let inputText = {};
...@@ -470,7 +461,7 @@ const AddModal = props => { ...@@ -470,7 +461,7 @@ const AddModal = props => {
}; };
const change = e => { const change = e => {
if (e == true) { if (e === true) {
setVisibleChecked1(false); setVisibleChecked1(false);
} }
console.log(e); console.log(e);
...@@ -508,33 +499,54 @@ const AddModal = props => { ...@@ -508,33 +499,54 @@ const AddModal = props => {
return <TreeNode value={org} title={org} key={org} />; return <TreeNode value={org} title={org} key={org} />;
}; };
const mapTreeFiled = (org, parent) => {
if (org.TableFields) {
return (
<TreeNode value={org.TableName} title={org.TableName} disabled>
{org.TableFields.map(item => mapTreeFiled(item, org.TableName))}
</TreeNode>
);
}
return (
<TreeNode value={`${org.FieldName}%${parent}`} title={org.FieldName} key={org.FieldName} />
);
};
// 获取字段名数据 // 获取字段名数据
const getGetTaskSyncField = e => { const getGetTaskSyncField = e => {
// 编辑时处理数据为下拉框过滤调已选数据 // 编辑时处理数据为下拉框过滤调已选数据
if (e) { if (e) {
let datalist = [...e]; let datalist = [...e];
datalist.map(i => { // datalist.forEach(i => {
keep.map(j => { // keep.forEach(j => {
if (j === i.fromField) { // if (j === i.fromField) {
i.fromField = j; // i.fromField = j;
// }
// });
// });
let arr = [];
datalist.forEach(i => {
if (i.fromTable) {
arr.push({ fromField: `${i.fromField}%${i.fromTable}`, toField: i.toField });
} else {
arr.push({ fromField: i.fromField, toField: i.toField });
} }
}); });
}); formAdd.setFieldsValue({ parmars: arr }); // 处理数据让下拉框回显title值
formAdd.setFieldsValue({ parmars: datalist }); // 处理数据让下拉框回显title值
let aa = e; let aa = e;
let from = []; let from = [];
aa.map(i => { aa.forEach(i => {
if (i && i.fromField) { if (i && i.fromField) {
from.push(i.fromField); from.push(i.fromField);
} }
}); });
let lastFrom = []; let lastFrom = [];
keep.map(j => { keep.forEach(j => {
if (from.indexOf(j) == -1) { if (from.indexOf(j) === -1) {
lastFrom.push(j); lastFrom.push(j);
} }
}); });
setKeepData(lastFrom); // setKeepData(lastFrom);
} else { } else {
setKeepData(keep); setKeepData(keep);
} }
...@@ -542,13 +554,11 @@ const AddModal = props => { ...@@ -542,13 +554,11 @@ const AddModal = props => {
}; };
const changeValue = () => { const changeValue = () => {
console.log(formAdd.getFieldsValue().parmars);
let aa = formAdd.getFieldsValue().parmars; let aa = formAdd.getFieldsValue().parmars;
if (aa) { if (aa) {
console.log(aa);
let from = []; let from = [];
let to = []; let to = [];
aa.map(i => { aa.forEach(i => {
if (i && i.fromField) { if (i && i.fromField) {
from.push(i.fromField); from.push(i.fromField);
} }
...@@ -556,37 +566,52 @@ const AddModal = props => { ...@@ -556,37 +566,52 @@ const AddModal = props => {
to.push(i.toField); to.push(i.toField);
} }
}); });
let lastFrom = []; let lastFrom = [];
let lastTo = []; let lastTo = [];
keep.map(j => { keep.forEach(j => {
if (from.indexOf(j) == -1) { if (from.indexOf(j) === -1) {
lastFrom.push(j); lastFrom.push(j);
} }
}); });
setKeepData(lastFrom); let bb = detailData(keep, from);
keepAll.map(j => { setKeepData(lastFrom);
if (to.indexOf(j.name) == -1) { keepAll.forEach(j => {
if (to.indexOf(j.name) === -1) {
lastTo.push(j); lastTo.push(j);
} }
}); });
setKeepTree(lastTo); setKeepTree(lastTo);
} }
};
// let data = keepAll; const detailData = (val, from) => {
// data.map(k => { let newKeep = {};
// console.log(k); val.forEach(i => {
// k.children.map((j, h) => { i.TableFields.forEach(j => {
// console.log(j); let data = `${j.FieldName}%${i.TableName}`;
// if (to.indexOf(j.name) != -1) { // if (from.indexOf(data) === -1) {
// console.log(j); // if (!newKeep[i.TableName]) {
// k.children.splice(h, 1); // newKeep[i.TableName] = [j];
// } else {
// newKeep[i.TableName].push(j);
// } // }
// }); // }
// }); if (from.indexOf(data) === -1) {
// console.log(data); if (!newKeep[i.TableName]) {
// setKeepTree(data); newKeep[i.TableName] = [j];
} else {
newKeep[i.TableName].push(j);
}
}
});
});
let arr = [];
let keys = Object.keys(newKeep);
keys.forEach(item => {
arr.push({ TableName: item, TableFields: newKeep[item] });
});
return arr;
}; };
// 改变关联事件类型 // 改变关联事件类型
...@@ -595,7 +620,7 @@ const AddModal = props => { ...@@ -595,7 +620,7 @@ const AddModal = props => {
setKeepData(keep); setKeepData(keep);
formAdd.resetFields(); formAdd.resetFields();
} }
let aa = keepAllData.find(i => i.name === e); let aa = keepAllData.find(item => item.name === e);
if (aa) { if (aa) {
getReloadTableField(aa.tableName, i); // 找到关联事件对应事件表获取对应表的所有字段 getReloadTableField(aa.tableName, i); // 找到关联事件对应事件表获取对应表的所有字段
} }
...@@ -611,14 +636,14 @@ const AddModal = props => { ...@@ -611,14 +636,14 @@ const AddModal = props => {
if (i) { if (i) {
let aa = i; let aa = i;
let to = []; let to = [];
aa.map(j => { aa.forEach(j => {
if (j && j.toField) { if (j && j.toField) {
to.push(j.toField); to.push(j.toField);
} }
}); });
let lastTo = []; let lastTo = [];
res.data.root.map(b => { res.data.root.forEach(b => {
if (to.indexOf(b.name) == -1) { if (to.indexOf(b.name) === -1) {
lastTo.push(b); lastTo.push(b);
} }
}); });
...@@ -627,18 +652,18 @@ const AddModal = props => { ...@@ -627,18 +652,18 @@ const AddModal = props => {
setKeepTree(res.data.root); setKeepTree(res.data.root);
} }
let arrlist = []; let arrList = [];
let data = {}; let data = {};
let listArr = []; let listArr = [];
res.data.root.map(i => { res.data.root.forEach(item => {
arrlist.push(i.name); arrList.push(item.name);
}); });
data.TableFieldNames = arrlist; data.TableFieldNames = arrList;
data.TableName = e; data.TableName = e;
listArr.push(data); listArr.push(data);
let arr = formateArrDataA2(res.data.root, 'group'); let arr = formateArrDataA(res.data.root, 'group');
let newArr = []; let newArr = [];
Object.keys(arr).map((item, index) => { Object.keys(arr).forEach((item, index) => {
newArr.push({ type: item, key: index, id: index }); newArr.push({ type: item, key: index, id: index });
}); });
let aa = []; let aa = [];
...@@ -653,7 +678,7 @@ const AddModal = props => { ...@@ -653,7 +678,7 @@ const AddModal = props => {
} }
}); });
}; };
const formateArrDataA2 = (initialArr, name) => { const formateArrDataA = (initialArr, name) => {
// 判定传参是否符合规则 // 判定传参是否符合规则
if (!(initialArr instanceof Array)) { if (!(initialArr instanceof Array)) {
return '请传入正确格式的数组'; return '请传入正确格式的数组';
...@@ -661,35 +686,47 @@ const AddModal = props => { ...@@ -661,35 +686,47 @@ const AddModal = props => {
if (!name) { if (!name) {
return '请传入对象属性'; return '请传入对象属性';
} }
// 先获取一下这个数组中有多少个"name" let arr = {};
let nameArr = []; initialArr.forEach((item, index) => {
// eslint-disable-next-line no-restricted-syntax let data = item.group;
for (let i in initialArr) { if (!arr[data]) {
if (nameArr.indexOf(initialArr[i][`${name}`]) === -1) { arr[data] = [item];
nameArr.push(initialArr[i][`${name}`]); } else {
} arr[data].push(item);
}
// 新建一个包含多个list的结果对象
let tempObj = {};
// 根据不同的"name"生成多个数组
for (let k in nameArr) {
for (let j in initialArr) {
if (initialArr[j][`${name}`] == nameArr[k]) {
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj[nameArr[k]] = tempObj[nameArr[k]] || [];
tempObj[nameArr[k]].push(initialArr[j]);
}
} }
});
return arr;
};
const onChangeFeed = val => {
GetFeedbackTableFields({ feedbackName: val }).then(res => {
if (res.code === 0) {
let newData = [res.data.DeviceData];
res.data.FeedbackData.length > 0 &&
res.data.FeedbackData.forEach(i => {
newData.push(i);
});
setKeepData(newData);
setKeep(newData);
} }
for (let keys in tempObj) {
let arr = [];
tempObj[keys].map((item, index) => {
tempObj[keys] = arr;
item.key = index;
arr.push(item);
}); });
GetAccountConfigInfo({ accountName: val }).then(res => {
if (res.code === 0) {
let list = res.data.editFieldGroup.split(',');
let newList = list.filter(i => i && i.trim());
let data = [{ TableName: val, TableFieldNames: newList }];
setFieldList(data);
} }
return tempObj; });
};
const saveRule = e => {
form.setFieldsValue({ feedbackRule: e });
setShowRule(false);
};
const editRule = () => {
setShowRule(true);
}; };
return ( return (
...@@ -793,7 +830,7 @@ const AddModal = props => { ...@@ -793,7 +830,7 @@ const AddModal = props => {
}, },
{ {
validator: (rule, value) => { validator: (rule, value) => {
if (form.getFieldsValue().accountName == '') { if (form.getFieldsValue().accountName === '') {
return Promise.reject('维保设备必选'); return Promise.reject('维保设备必选');
} }
return Promise.resolve(); return Promise.resolve();
...@@ -843,7 +880,7 @@ const AddModal = props => { ...@@ -843,7 +880,7 @@ const AddModal = props => {
rules={[ rules={[
{ {
validator: (rule, value) => { validator: (rule, value) => {
if (form.getFieldValue().feedbackName == '') { if (form.getFieldValue().feedbackName === '') {
return Promise.reject('反馈名称必填'); return Promise.reject('反馈名称必填');
} }
return Promise.resolve(); return Promise.resolve();
...@@ -857,14 +894,27 @@ const AddModal = props => { ...@@ -857,14 +894,27 @@ const AddModal = props => {
> >
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<Item name="feedbackName" style={{ marginBottom: 0, width: '100%' }}> <Item name="feedbackName" style={{ marginBottom: 0, width: '100%' }}>
<Input placeholder="请选择反馈名称" allowClear /> <Select
placeholder="请选择反馈名称"
showSearch
allowClear
onChange={e => onChangeFeed(e)}
>
{filed
? filed.map((item, index) => (
<Option key={index} value={item}>
{item}
</Option>
))
: ''}
</Select>
</Item> </Item>
<Button {/* <Button
type="dashed" type="dashed"
onClick={() => pickFiled('feedbackName')} onClick={() => pickFiled('feedbackName')}
icon={<PlusOutlined style={{ marginTop: '5px' }} />} icon={<PlusOutlined style={{ marginTop: '5px' }} />}
style={{ marginLeft: '10px', width: '70px' }} style={{ marginLeft: '10px', width: '70px' }}
/> /> */}
</div> </div>
</Item> </Item>
</Col> </Col>
...@@ -876,7 +926,7 @@ const AddModal = props => { ...@@ -876,7 +926,7 @@ const AddModal = props => {
rules={[ rules={[
{ {
validator: (rule, value) => { validator: (rule, value) => {
if (form.getFieldValue().doRole == '') { if (form.getFieldValue().doRole === '') {
return Promise.reject('执行角色必填'); return Promise.reject('执行角色必填');
} }
return Promise.resolve(); return Promise.resolve();
...@@ -995,6 +1045,28 @@ const AddModal = props => { ...@@ -995,6 +1045,28 @@ const AddModal = props => {
<Input placeholder="例如:and 泵房品牌='熊猫'(SQL表达式)" /> <Input placeholder="例如:and 泵房品牌='熊猫'(SQL表达式)" />
</Item> </Item>
</Col> </Col>
<Col span={24}>
<Item label="反馈联动" name="feedbackRule" labelCol={{ span: 5 }}>
<div
style={{
border: '2px solid #6A98FA',
minHeight: '34px',
lineHeight: '34px',
textAlign: 'center',
}}
onClick={() => {
let obj = form.getFieldsValue().feedbackName;
if (!obj) {
message.warning('请先选择反馈名称!');
} else {
editRule();
}
}}
>
<span>{form.getFieldsValue().feedbackRule}</span>
</div>
</Item>
</Col>
<Col span={24}> <Col span={24}>
<Item label="关联事件" name="relationEvent" labelCol={{ span: 5 }}> <Item label="关联事件" name="relationEvent" labelCol={{ span: 5 }}>
<Select <Select
...@@ -1047,21 +1119,22 @@ const AddModal = props => { ...@@ -1047,21 +1119,22 @@ const AddModal = props => {
validateTrigger={['onChange', 'onBlur']} validateTrigger={['onChange', 'onBlur']}
rules={[{ required: true, message: '请填写字段名' }]} rules={[{ required: true, message: '请填写字段名' }]}
> >
<Select <TreeSelect
placeholder="选择字段名"
// onSelect={changTable}
// optionLabelProp="key"
showSearch showSearch
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择字段名"
treeDefaultExpandAll
style={{ width: '159px' }} style={{ width: '159px' }}
showCheckedStrategy
onFocus={() => {
let obj = form.getFieldsValue().feedbackName;
if (!obj) {
message.warning('请先选择反馈名称!');
}
}}
> >
{keepData {keepData.length > 0 && keepData.map(i => mapTreeFiled(i))}
? keepData.map((item, index) => ( </TreeSelect>
<Option key={item} value={item}>
{item}
</Option>
))
: ''}
</Select>
</Form.Item> </Form.Item>
<img src={logo} style={{ height: '24px' }} alt="" /> <img src={logo} style={{ height: '24px' }} alt="" />
<Form.Item <Form.Item
...@@ -1100,7 +1173,7 @@ const AddModal = props => { ...@@ -1100,7 +1173,7 @@ const AddModal = props => {
block block
icon={<PlusOutlined />} icon={<PlusOutlined />}
style={{ marginLeft: '-2px' }} style={{ marginLeft: '-2px' }}
disabled={keepData && !(keepData.length > 0)} // disabled={keepData && !(keepData.length > 0)}
> >
添加映射 添加映射
</Button> </Button>
...@@ -1137,6 +1210,15 @@ const AddModal = props => { ...@@ -1137,6 +1210,15 @@ const AddModal = props => {
keepFiled={keepFiled} keepFiled={keepFiled}
dataType="name" dataType="name"
/> />
<RuleConfig
RuleContent={form.getFieldsValue().feedbackRule || ''}
tableName={form.getFieldsValue().feedbackName}
fieldList={fieldList}
visible={showRule}
handleCancel={() => setShowRule(false)}
onSubumit={e => saveRule(e)}
flag={2}
/>
</Drawer> </Drawer>
); );
}; };
......
...@@ -155,6 +155,9 @@ const FlowChart = props => { ...@@ -155,6 +155,9 @@ const FlowChart = props => {
delLinks.add(item.data.LineId); delLinks.add(item.data.LineId);
} }
}); });
if (delNodes.size === 0) {
delNode([...delNodeIds], [...delNodes], [...delLinks]);
} else {
CheckDoingFlowNodes({ activityIds: [...delNodes] }).then(res => { CheckDoingFlowNodes({ activityIds: [...delNodes] }).then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data > 0) { if (res.data > 0) {
...@@ -166,6 +169,7 @@ const FlowChart = props => { ...@@ -166,6 +169,7 @@ const FlowChart = props => {
message.error(res.msg); message.error(res.msg);
} }
}); });
}
return false; return false;
}; };
...@@ -1039,9 +1043,11 @@ const FlowChart = props => { ...@@ -1039,9 +1043,11 @@ const FlowChart = props => {
}).then(response => { }).then(response => {
if (response.code === 0) { if (response.code === 0) {
console.log(currentNode.current); console.log(currentNode.current);
let list = JSON.parse(JSON.stringify(currentNode.current)); // let list = JSON.parse(JSON.stringify(currentNode.current));
list.FlowNodeBackfillConfigs = jsonData(list.FlowNodeBackfillConfigs); // list.FlowNodeBackfillConfigs = jsonData(list.FlowNodeBackfillConfigs);
currentNode.current = list; // currentNode.current = list;
let flowNodeBackfillConfigs = currentNode.current.FlowNodeBackfillConfigs;
currentNode.current.FlowNodeBackfillConfigs = jsonData(flowNodeBackfillConfigs);
console.log(currentNode.current); console.log(currentNode.current);
FlowNodeSave({ FlowNodeSave({
PreviewImage: response.data, PreviewImage: response.data,
...@@ -1083,10 +1089,8 @@ const FlowChart = props => { ...@@ -1083,10 +1089,8 @@ const FlowChart = props => {
let listArr = []; let listArr = [];
val.map((item, index) => { val.map((item, index) => {
console.log(item); console.log(item);
debugger;
if (!item.Config) { if (!item.Config) {
console.log(item); console.log(item);
debugger;
let arr = []; let arr = [];
arr.push({ arr.push({
mapServer: item.schemeName, mapServer: item.schemeName,
...@@ -1278,7 +1282,6 @@ const FlowChart = props => { ...@@ -1278,7 +1282,6 @@ const FlowChart = props => {
}), }),
1.2, // 压缩比例 1.2, // 压缩比例
base64 => { base64 => {
console.log(base64);
SaveWorkFlowImage({ SaveWorkFlowImage({
flowName: flowData.flowName, flowName: flowData.flowName,
base64Data: base64, base64Data: base64,
......
...@@ -47,3 +47,9 @@ export const CM_XWBPlan_ChangeOrder = planIds => ...@@ -47,3 +47,9 @@ export const CM_XWBPlan_ChangeOrder = planIds =>
// 获取父级维保模板 // 获取父级维保模板
export const GetParentDeviceTemplate = query => export const GetParentDeviceTemplate = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetParentDeviceTemplate`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetParentDeviceTemplate`, query);
export const GetFeedbackTableFields = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetFeedbackTableFields`, query);
export const GetAccountConfigInfo = query =>
get(`/PandaWorkFlow/WorkFlow/AccountManage/GetAccountConfigInfo`, query);
\ No newline at end of file
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