Commit 0269ca50 authored by 涂伟's avatar 涂伟
parents 8e3007d0 baf378c8
Pipeline #96717 failed with stages
...@@ -94,8 +94,8 @@ ...@@ -94,8 +94,8 @@
"@wangeditor/editor-for-react": "^1.0.6", "@wangeditor/editor-for-react": "^1.0.6",
"@wisdom-cesium/cesium": "1.1.12", "@wisdom-cesium/cesium": "1.1.12",
"@wisdom-cesium/krpano": "^1.0.29-60", "@wisdom-cesium/krpano": "^1.0.29-60",
"@wisdom-map/arcgismap":"^2.0.97", "@wisdom-map/arcgismap": "^2.0.97",
"@wisdom-map/basemap":"^2.0.4", "@wisdom-map/basemap": "^2.0.4",
"@wisdom-map/gis-component": "^1.0.46", "@wisdom-map/gis-component": "^1.0.46",
"@wisdom-map/gis-utils": "^1.0.41", "@wisdom-map/gis-utils": "^1.0.41",
"@wisdom-map/pd-map": "^1.0.140", "@wisdom-map/pd-map": "^1.0.140",
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
"jszip": "^3.10.1", "jszip": "^3.10.1",
"lodash": "4.17.11", "lodash": "4.17.11",
"minimist": "1.2.0", "minimist": "1.2.0",
"panda-xform": "6.11.09", "panda-xform": "6.11.19",
"parseForm": "^2.3.8", "parseForm": "^2.3.8",
"prop-types": "15.7.2", "prop-types": "15.7.2",
"qrcode.react": "^3.1.0", "qrcode.react": "^3.1.0",
...@@ -165,7 +165,8 @@ ...@@ -165,7 +165,8 @@
"styled-components": "4.2.0", "styled-components": "4.2.0",
"use-merge-value": "^1.0.2", "use-merge-value": "^1.0.2",
"virtuallist-antd": "^0.8.0-beta.1", "virtuallist-antd": "^0.8.0-beta.1",
"voca": "^1.4.0" "voca": "^1.4.0",
"xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"@ant-design/icons": "^4.0.0", "@ant-design/icons": "^4.0.0",
......
...@@ -13,6 +13,7 @@ import { ...@@ -13,6 +13,7 @@ import {
InputNumber, InputNumber,
Checkbox, Checkbox,
message, message,
Switch
} from 'antd'; } from 'antd';
import 'moment/dist/locale/zh-cn'; import 'moment/dist/locale/zh-cn';
import locale from 'antd/es/date-picker/locale/zh_CN'; import locale from 'antd/es/date-picker/locale/zh_CN';
...@@ -20,7 +21,11 @@ import moment from 'moment/moment'; ...@@ -20,7 +21,11 @@ import moment from 'moment/moment';
import RuleConfig from '@/components/RuleConfig'; import RuleConfig from '@/components/RuleConfig';
import PeopleSelector from '@/components/PeopleSelector'; import PeopleSelector from '@/components/PeopleSelector';
import { WFGetAllFlow, GetFormDataSource, GetFlowNode } from '@/services/workflow/workflow'; import { WFGetAllFlow, GetFormDataSource, GetFlowNode } from '@/services/workflow/workflow';
import { GetScheduledConfigFlowNode, GetConditionConfigFlowNode } from '@/services/flow/flow'; import {
GetScheduledConfigFlowNode,
GetConditionConfigFlowNode,
GetBizMetaData,
} from '@/services/flow/flow';
import { GetSubEventFlows } from '@/services/workflow/workflow'; import { GetSubEventFlows } from '@/services/workflow/workflow';
import imgEnd from '@/assets/images/workFlow/nodeEnd.png'; import imgEnd from '@/assets/images/workFlow/nodeEnd.png';
import gatewayConfluence from '@/assets/images/workFlow/gatewayParallel.png'; import gatewayConfluence from '@/assets/images/workFlow/gatewayParallel.png';
...@@ -28,8 +33,19 @@ import gatewayExclusive from '@/assets/images/workFlow/gatewayCondition.png'; ...@@ -28,8 +33,19 @@ import gatewayExclusive from '@/assets/images/workFlow/gatewayCondition.png';
import gatewayInclude from '@/assets/images/workFlow/gatewayJoin.png'; import gatewayInclude from '@/assets/images/workFlow/gatewayJoin.png';
import imgGeneral from '@/assets/images/workFlow/nodeGeneral.png'; import imgGeneral from '@/assets/images/workFlow/nodeGeneral.png';
import imgStart from '@/assets/images/workFlow/nodeStart.png'; import imgStart from '@/assets/images/workFlow/nodeStart.png';
import styles from './index.less' import styles from './index.less';
import * as go from 'gojs'; import * as go from 'gojs';
import { isObject } from 'lodash';
import { FormRender } from 'panda-xform';
const convertKeysToLowercase = (obj) => {
return Object.fromEntries(
Object.entries(obj).map(([key, value]) => {
const newKey = key.charAt(0).toLowerCase() + key.slice(1);
return [newKey, value];
})
);
};
const days = moment().daysInMonth(); const days = moment().daysInMonth();
const allDays = [...Array.from({ length: days + 1 }, (_, i) => i + 1)]; const allDays = [...Array.from({ length: days + 1 }, (_, i) => i + 1)];
const weeks = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天']; const weeks = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
...@@ -37,7 +53,7 @@ const weeks1 = ['第一周', '第二周', '第三周', '第四周', '最后一 ...@@ -37,7 +53,7 @@ const weeks1 = ['第一周', '第二周', '第三周', '第四周', '最后一
let myDiagram = null; let myDiagram = null;
const CaseModify = props => { const CaseModify = props => {
let _$ = go.GraphObject.make; let _$ = go.GraphObject.make;
const { visible, mode, onClose, onOk, flowConfigDetail } = props; const { visible, mode, onClose, onOk, flowConfigDetail, flowCenterData } = props;
const [planType, setPlanType] = useState('ByLoop'); // ByLoop:循环 ByDay:每天 ByWeek:每周 ByMonth:每月 const [planType, setPlanType] = useState('ByLoop'); // ByLoop:循环 ByDay:每天 ByWeek:每周 ByMonth:每月
const [timeType, setTimeType] = useState(''); const [timeType, setTimeType] = useState('');
const [showTtype, setShowTtype] = useState('time'); const [showTtype, setShowTtype] = useState('time');
...@@ -45,6 +61,7 @@ const CaseModify = props => { ...@@ -45,6 +61,7 @@ const CaseModify = props => {
const [showPersonSelect, setShowPersonSelect] = useState(false); const [showPersonSelect, setShowPersonSelect] = useState(false);
const [openTeditor, setOpenTeditor] = useState(false); const [openTeditor, setOpenTeditor] = useState(false);
const [loadding, setloadding] = useState(false); const [loadding, setloadding] = useState(false);
const [schemaValues, setSchemaValues] = useState({ values: [], formJson: {} });
const [configInfo, setConfigInfo] = useState({ const [configInfo, setConfigInfo] = useState({
schemeName: '', schemeName: '',
schemeNameErrMsg: '', //验证必填提示词 schemeNameErrMsg: '', //验证必填提示词
...@@ -75,14 +92,18 @@ const CaseModify = props => { ...@@ -75,14 +92,18 @@ const CaseModify = props => {
const [weekValues, setWeekValues] = useState([]); //每周 每月 按周 星期几 const [weekValues, setWeekValues] = useState([]); //每周 每月 按周 星期几
const [weekValues1, setWeekValues1] = useState([]); //每月 按周 第几周 const [weekValues1, setWeekValues1] = useState([]); //每月 按周 第几周
const [dayValues, setDayValues] = useState([]); //每月 按日 const [dayValues, setDayValues] = useState([]); //每月 按日
const [startTime, setStartTime] = useState(moment()); const [startTime, setStartTime] = useState(moment(moment().format('YYYY-MM-DD HH:00:00')));
const [endTime, setEndTime] = useState(''); const [endTime, setEndTime] = useState('');
const [tip, setTip] = useState(''); const [tip, setTip] = useState('');
const [num, setNum] = useState(0); const [num, setNum] = useState(0);
const [flowList, setFlowList] = useState([]); const [flowList, setFlowList] = useState([]);
const [nodeNams, setNodeNames] = useState([]); const [nodeNams, setNodeNames] = useState([]);
const [isPreview, setIsPreView] = useState(false); const [isPreview, setIsPreView] = useState(false);
const [formVisible, setFormVisible] = useState(false);
const [showForm, setShowForm] = useState(false);
const [errorMsg, setErrorMsg] = useState(''); //定时触发下的参数校验 const [errorMsg, setErrorMsg] = useState(''); //定时触发下的参数校验
let formRef = useRef(null);
let formJsonRef = useRef({})
let weekType = useRef(''); //每周 按周 第几周 周几执行 let weekType = useRef(''); //每周 按周 第几周 周几执行
let timeUnit = useRef('hour'); let timeUnit = useRef('hour');
let ruleContent = useRef(''); let ruleContent = useRef('');
...@@ -90,9 +111,7 @@ const CaseModify = props => { ...@@ -90,9 +111,7 @@ const CaseModify = props => {
let roleIdsRef = useRef([]); let roleIdsRef = useRef([]);
let ruleField = useRef([]); let ruleField = useRef([]);
let flowData = useRef([]); let flowData = useRef([]);
let imgUrl = useRef(''); let flowDataList = useRef({});
let flowTree = useRef([])
let flowDataList = useRef({})
let postData = useRef({ let postData = useRef({
id: null, id: null,
schemeName: '', schemeName: '',
...@@ -110,6 +129,7 @@ const CaseModify = props => { ...@@ -110,6 +129,7 @@ const CaseModify = props => {
scheduledConfig: { scheduledConfig: {
userIds: [], //用户ID userIds: [], //用户ID
roleIds: [], //角色ID roleIds: [], //角色ID
values: [], //工单模板提交数据
agentConfig: '', agentConfig: '',
}, //定时触发 }, //定时触发
}); });
...@@ -128,13 +148,13 @@ const CaseModify = props => { ...@@ -128,13 +148,13 @@ const CaseModify = props => {
} else if (planType === 'ByMonth' && timeType == 'week') { } else if (planType === 'ByMonth' && timeType == 'week') {
setTip(getTipByWeek(timeValues, weekValues, weekValues1)); setTip(getTipByWeek(timeValues, weekValues, weekValues1));
} }
}, [timeUnit.current, num, timeValues, weekValues, dayValues]); }, [timeUnit.current, num, timeValues, weekValues, dayValues, startTime]);
useEffect(() => { useEffect(() => {
if (visible) { if (visible) {
getEventFlow(); getEventFlow();
if (mode === 'edit' && flowConfigDetail) { if (mode === 'edit' && flowConfigDetail) {
dealPostData(flowConfigDetail); dealPostData(flowConfigDetail);//编辑模式数据回填
} }
// else { // else {
// init(); // init();
...@@ -142,57 +162,6 @@ const CaseModify = props => { ...@@ -142,57 +162,6 @@ const CaseModify = props => {
} }
}, [visible]); }, [visible]);
const init = () => {
postData.current = {
id: null,
schemeName: '',
triggerMethod: '条件触发',
flowId: null,
flowName: '',
eventId: null,
eventName: '',
activityId: null,
activityName: '',
isEnabled: 1,
conditionConfig: {
ruleList: [],
}, //条件触发
scheduledConfig: {
userIds: [], //用户ID
roleIds: [], //角色ID
agentConfig: '',
}, //定时触发
};
setRuleInfos([
{
id: 1,
userIds: [],
userIdsErrMsg: '', //验证必填提示词
roleIds: [],
tableNames: '',
ruleContent: '',
ruleContentErrMsg: '', //验证必填提示词
ruleName: '',
ruleNameErrMsg: '', //验证必填提示词
},
]);
setConfigInfo({
schemeName: '',
schemeNameErrMsg: '', //验证必填提示词
triggerType: '条件触发',
flowId: '',
flowIdErrMsg: '', //验证必填提示词
activityId: '',
activityIdErrMsg: '', //验证必填提示词
userIds: [], //定时触发使用
roleIds: [], //定时触发使用
});
setNodeNames([]);
ruleField.current = []
tableName.current = null
ruleContent.current = ''
};
const dealPostData = async detail => { const dealPostData = async detail => {
const { const {
ID, ID,
...@@ -223,6 +192,9 @@ const CaseModify = props => { ...@@ -223,6 +192,9 @@ const CaseModify = props => {
{ {
let res; let res;
if (TriggerMethod === '定时触发') { if (TriggerMethod === '定时触发') {
setShowForm(ScheduledConfig.Values.length > 0);
postData.current.scheduledConfig.values = ScheduledConfig.Values.map(v=> convertKeysToLowercase(v))
getBizMetaData(detail);
res = await GetConditionConfigFlowNode({ flowId: FlowId }); res = await GetConditionConfigFlowNode({ flowId: FlowId });
} else { } else {
res = await GetScheduledConfigFlowNode({ flowId: FlowId }); res = await GetScheduledConfigFlowNode({ flowId: FlowId });
...@@ -250,24 +222,28 @@ const CaseModify = props => { ...@@ -250,24 +222,28 @@ const CaseModify = props => {
return; return;
} }
} }
const { UserIds, AgentConfig, RoleIds } = ScheduledConfig const { UserIds, AgentConfig, RoleIds } = ScheduledConfig;
let userIds = [] let userIds = [];
let roleIds = [] let roleIds = [];
if(UserIds.length > 0){ if (UserIds.length > 0) {
userIds = UserIds && UserIds.map(v=> { userIds =
UserIds &&
UserIds.map(v => {
return { return {
id: v.ID, id: v.ID,
name: v.Name name: v.Name,
} };
}) });
} }
if(RoleIds.length > 0){ if (RoleIds.length > 0) {
roleIds = RoleIds && RoleIds.map(v=> { roleIds =
RoleIds &&
RoleIds.map(v => {
return { return {
id: v.ID, id: v.ID,
name: v.Name name: v.Name,
} };
}) });
} }
setConfigInfo({ setConfigInfo({
...configInfo, ...configInfo,
...@@ -276,7 +252,7 @@ const CaseModify = props => { ...@@ -276,7 +252,7 @@ const CaseModify = props => {
triggerType: TriggerMethod, triggerType: TriggerMethod,
schemeName: SchemeName, schemeName: SchemeName,
roleIds, roleIds,
userIds userIds,
}); });
if (TriggerMethod === '条件触发') { if (TriggerMethod === '条件触发') {
const { code, msg, data } = await GetFormDataSource({ flowId: FlowId }); const { code, msg, data } = await GetFormDataSource({ flowId: FlowId });
...@@ -334,7 +310,6 @@ const CaseModify = props => { ...@@ -334,7 +310,6 @@ const CaseModify = props => {
setRuleInfos(rules); setRuleInfos(rules);
} }
} else { } else {
const { const {
LoopMode, LoopMode,
LoopUnit, LoopUnit,
...@@ -385,25 +360,12 @@ const CaseModify = props => { ...@@ -385,25 +360,12 @@ const CaseModify = props => {
} }
}; };
const toLowerFirstLetterKeysDeep = obj => {
if (Array.isArray(obj)) {
return obj.map(toLowerFirstLetterKeysDeep);
} else if (obj !== null && typeof obj === 'object') {
return Object.fromEntries(
Object.entries(obj).map(([key, value]) => [
key.charAt(0).toLowerCase() + key.slice(1),
toLowerFirstLetterKeysDeep(value),
]),
);
}
return obj;
};
const getEventFlow = async () => { const getEventFlow = async () => {
const { code, data, msg } = await GetSubEventFlows(); const { code, data, msg } = await GetSubEventFlows();
if (code === 0) { if (code === 0) {
flowData.current = data; const d = data.filter(v=> v.CreateMode === 1);
const list = data.map(v => { flowData.current =d
const list = d.map(v => {
return { value: v.SubFlowId, label: `${v.FlowName}(${v.EventName})` }; return { value: v.SubFlowId, label: `${v.FlowName}(${v.EventName})` };
}); });
setFlowList(list); setFlowList(list);
...@@ -411,54 +373,118 @@ const CaseModify = props => { ...@@ -411,54 +373,118 @@ const CaseModify = props => {
message.error(msg); message.error(msg);
} }
}; };
const getPrewViewImage = async (flowId) =>{ const getPrewViewImage = async flowId => {
let res = await GetFlowNode({ flowID: flowId }); let res = await GetFlowNode({ flowID: flowId });
if (res.code === 0) { if (res.code === 0) {
res.data.Nodes.forEach(item => { res.data.Nodes.forEach(item => {
item.nodeDetail = JSON.stringify(item); item.nodeDetail = JSON.stringify(item);
item.key = item.NodeName item.key = item.NodeName;
}); });
res.data.Lines.forEach(item => { res.data.Lines.forEach(item => {
item.lineDetail = JSON.stringify(item); item.lineDetail = JSON.stringify(item);
}); });
flowDataList.current = { ...res.data, flowName: postData.current.flowName } flowDataList.current = { ...res.data, flowName: postData.current.flowName };
initMap(flowDataList.current) initMap(flowDataList.current);
} else { } else {
message.error(res.msg); message.error(res.msg);
} }
setIsPreView(true) setIsPreView(true);
};
const getBizMetaData = async detail => {
if (!flowCenterData.length) return;
const {
ID,
IsEnabled,
TriggerMethod,
SchemeName,
ActivityId,
ActivityName,
EventId,
EventName,
FlowId,
FlowName,
ScheduledConfig,
ConditionConfig,
} = detail;
let paramObj = flowCenterData.find(v => v.flowName === FlowName && v.eventName === EventName);
console.log(paramObj, EventName,FlowName, 'paramObjparamObj')
if (paramObj) {
paramObj = {
...paramObj,
userId: 1,
};
const vals = ScheduledConfig.Values
const { code, data, msg } = await GetBizMetaData(paramObj);
const { formJson, values } = data[0];
const jsonObj = JSON.parse(formJson)
const formValues =vals.length > 0 ? values.map(v=> {
const d = vals.find(x=> v.fieldName === x.FieldName)
if(d){
return {
...v,
fieldValue: d.FieldValue
}
} }
return v
}) : values
console.log(formValues, 'formValuesformValuesformValues');
formJsonRef.current = jsonObj
setSchemaValues({ values: formValues, formJson: jsonObj });
}else{
formJsonRef.current = null
setSchemaValues({ values: [], formJson: {} });
}
};
const getFormData = (jsonObj) => {
let formData = {};
Object.keys(jsonObj.properties).forEach(v => {
const obj = jsonObj.properties[v];
Object.keys(obj.properties).forEach(x => {
formData[x] = obj.properties[x];
})
})
return formData;
}
//计算循环的下次执行时间 //计算循环的下次执行时间
const handleTimeInfo = (timeUnit, num) => { const handleTimeInfo = (timeUnit, num) => {
if (startTime) { if (startTime) {
setTip(startTime.add(num, timeUnit).format('YYYY-MM-DD HH:mm:ss')); setTip(
moment(startTime)
.add(num, timeUnit)
.format('YYYY-MM-DD HH:mm:ss'),
);
} }
}; };
//计算下次执行时间每月按日 //计算下次执行时间每月按日
const getTipByDay = (dayVals, timeVals) => { const getTipByDay = (dayVals, timeVals) => {
if (!timeVals.length || !dayVals.length) return; if (!timeVals.length || !dayVals.length) return;
const now = moment(startTime);
const times = timeVals.sort((a, b) => a - b); const times = timeVals.sort((a, b) => a - b);
if (dayVals.length == 1 && dayVals[0] === allDays[allDays.length - 1]) { if (dayVals.length == 1 && dayVals[0] === allDays[allDays.length - 1]) {
return moment() return now
.endOf('month') .endOf('month')
.hour(times[0]) .hour(times[0])
.minute(0) .minute(0)
.second(0) .second(0)
.format(`YYYY-MM-DD HH:mm:ss`); .format(`YYYY-MM-DD HH:mm:ss`);
} }
const dayOfMonth = moment().date(); //当前第几天 const dayOfMonth = now.date(); //当前第几天
const dayvals = dayVals.sort((a, b) => a - b).filter(v => v >= dayOfMonth); const dayvals = dayVals.sort((a, b) => a - b).filter(v => v >= dayOfMonth);
if (dayvals.length > 0) { if (dayvals.length > 0) {
return moment() return now
.hour(times[0]) .hour(times[0])
.minute(0) .minute(0)
.second(0) .second(0)
.format(`YYYY-MM-${dayvals[0] < 10 ? `0${dayvals[0]}` : dayvals[0]} HH:mm:ss`); .format(`YYYY-MM-${dayvals[0] < 10 ? `0${dayvals[0]}` : dayvals[0]} HH:mm:ss`);
} else { } else {
const days = dayVals.filter(v => v !== allDays[allDays.length - 1]); const days = dayVals.filter(v => v !== allDays[allDays.length - 1]);
return moment() return now
.add(1, 'month') .add(1, 'month')
.hour(times[0]) .hour(times[0])
.minute(0) .minute(0)
...@@ -478,7 +504,7 @@ const CaseModify = props => { ...@@ -478,7 +504,7 @@ const CaseModify = props => {
}; };
const getNextDateByTierAndWeekday = (y, m, tier, weekday, timeVals) => { const getNextDateByTierAndWeekday = (y, m, tier, weekday, timeVals) => {
let now = moment(); let now = moment(startTime);
let year = y || now.year(); let year = y || now.year();
let month = m || now.month() + 1; // 获取当前月份(1~12) let month = m || now.month() + 1; // 获取当前月份(1~12)
...@@ -526,34 +552,34 @@ const CaseModify = props => { ...@@ -526,34 +552,34 @@ const CaseModify = props => {
const weekObj = {}; const weekObj = {};
weeks.forEach((v, i) => (weekObj[v] = i + 1)); weeks.forEach((v, i) => (weekObj[v] = i + 1));
const weekNum = weekObj[targetWeekday]; const weekNum = weekObj[targetWeekday];
const today = moment(); const today = moment(startTime);
const nextDay = const nextDay =
today.isoWeekday() < weekNum today.isoWeekday() < weekNum
? today.isoWeekday(weekNum) // 本周还没到目标周几 ? today.isoWeekday(weekNum) // 本周还没到目标周几
: today.add(1, 'weeks').isoWeekday(weekNum); // 目标周几已过,跳到下周 : today.add(1, 'weeks').isoWeekday(weekNum); // 目标周几已过,跳到下周
return nextDay.format(`YYYY-MM-DD ${times[0]}:mm:ss`); return nextDay.format(`YYYY-MM-DD ${times[0]}:00:00`);
}; };
//计算每天的下次请求时间 //计算每天的下次请求时间
const getNextClosestTime = hourArray => { const getNextClosestTime = hourArray => {
if (!hourArray.length) return; if (!hourArray.length) return;
const timeArry = hourArray.sort((a, b) => a - b); const timeArry = hourArray.sort((a, b) => a - b);
const now = moment(); const now = moment(startTime);
const currentHour = now.hour(); const currentHour = now.hour();
// 找到大于当前小时的最近时间 // 找到大于当前小时的最近时间
// const nextHour = timeArry.find(h => h > currentHour); // const nextHour = timeArry.find(h => h > currentHour);
if (timeArry[0] > currentHour) { if (timeArry[0] >= currentHour) {
return moment() return now
.hour(timeArry[0]) .hour(timeArry[0])
.minute(0) .minute(0)
.second(0) .second(0)
.format('YYYY-MM-DD HH:mm:ss'); .format('YYYY-MM-DD HH:mm:ss');
} else { } else {
// 如果所有时间都已经过了,返回明天的最早时间 // 如果所有时间都已经过了,返回明天的最早时间
return moment() return now
.add(1, 'days') .add(1, 'days')
.hour(timeArry[0]) .hour(timeArry[0])
.minute(0) .minute(0)
...@@ -812,6 +838,7 @@ const CaseModify = props => { ...@@ -812,6 +838,7 @@ const CaseModify = props => {
getNodeAPI = GetScheduledConfigFlowNode({ flowId }); getNodeAPI = GetScheduledConfigFlowNode({ flowId });
getRuleConfigAPI = GetFormDataSource({ flowId }); getRuleConfigAPI = GetFormDataSource({ flowId });
} else { } else {
getNodeAPI = GetConditionConfigFlowNode({ flowId }); getNodeAPI = GetConditionConfigFlowNode({ flowId });
} }
Promise.all([getNodeAPI, getRuleConfigAPI && getRuleConfigAPI]).then(res => { Promise.all([getNodeAPI, getRuleConfigAPI && getRuleConfigAPI]).then(res => {
...@@ -824,6 +851,17 @@ const CaseModify = props => { ...@@ -824,6 +851,17 @@ const CaseModify = props => {
}); });
setNodeNames(nodeNames); setNodeNames(nodeNames);
if (configInfo.triggerType == '定时触发') { if (configInfo.triggerType == '定时触发') {
const d = flowData.current.find(v=> v.SubFlowId == flowId);
console.log(flowData.current, d, 'wwwwww')
if(d){
const { FlowName, EventName } = d
getBizMetaData({
FlowName,
EventName,
ScheduledConfig: { Values: [] }
})
}
setConfigInfo({ ...configInfo, activityId: nodeNames[0].value, flowId: flowId }); setConfigInfo({ ...configInfo, activityId: nodeNames[0].value, flowId: flowId });
generatePostData({ activityId: nodeNames[0].value, activityName: nodeNames[0].label }); generatePostData({ activityId: nodeNames[0].value, activityName: nodeNames[0].label });
} else { } else {
...@@ -924,7 +962,6 @@ const CaseModify = props => { ...@@ -924,7 +962,6 @@ const CaseModify = props => {
const handleSelectRuleType = (e, type) => { const handleSelectRuleType = (e, type) => {
const { checked } = e.target; const { checked } = e.target;
generatePostData({ triggerMethod: type }); generatePostData({ triggerMethod: type });
if (type === '定时触发') { if (type === '定时触发') {
generatePostData({}); generatePostData({});
if (nodeNams.length > 0) { if (nodeNams.length > 0) {
...@@ -978,32 +1015,52 @@ const CaseModify = props => { ...@@ -978,32 +1015,52 @@ const CaseModify = props => {
return; return;
} }
console.log(e, 'eeeeeeee');
let list = ruleInfos; let list = ruleInfos;
if (person.length) {
list = list.map(v => list = list.map(v =>
v.id === (id || currentRuleId.current) v.id === (id || currentRuleId.current)
? { ? {
...v, ...v,
userIds: person.map(x => { userIds:
person.length > 0
? person.map(x => {
return { id: Number(x.value), name: x.label }; return { id: Number(x.value), name: x.label };
}), })
: [],
userIds:
person.length > 0
? person.map(x => {
return { id: Number(x.value), name: x.label };
})
: [],
} }
: v, : v,
); );
} // if (person.length) {
// list = list.map(v =>
// v.id === (id || currentRuleId.current)
// ? {
// ...v,
// userIds: person.length > 0 ? person.map(x => {
// return { id: Number(x.value), name: x.label };
// }) : [] ,
// }
// : v,
// );
// }
if (role.length) { // if (role.length) {
list = list.map(v => // list = list.map(v =>
v.id === (id || currentRuleId.current) // v.id === (id || currentRuleId.current)
? { // ? {
...v, // ...v,
roleIds: role.map(x => { // roleIds: role.length > 0 ? role.map(x => {
return { id: x.value, name: x.label }; // return { id: x.value, name: x.label };
}), // }) : [],
} // }
: v, // : v,
); // );
} // }
setRuleInfos(list); setRuleInfos(list);
setShowPersonSelect(false); setShowPersonSelect(false);
} else if (type == 'rule') { } else if (type == 'rule') {
...@@ -1024,13 +1081,12 @@ const CaseModify = props => { ...@@ -1024,13 +1081,12 @@ const CaseModify = props => {
}; };
const hasValue = field => field !== undefined && field !== null && field.trim?.() !== ''; const hasValue = field => field !== undefined && field !== null && field.trim?.() !== '';
const isValid = () => { const isValid = () => {
const { schemeName, flowId, activityId, userIds } = configInfo; const { schemeName, flowId, activityId, userIds, roleIds } = configInfo;
let schemeNameErrMsg = ''; let schemeNameErrMsg = '';
let flowIdErrMsg = ''; let flowIdErrMsg = '';
let activityIdErrMsg = ''; let activityIdErrMsg = '';
let userIdsErrMsg = ''; let userIdsErrMsg = '';
let isOk = let isOk = hasValue(schemeName) && hasValue(flowId) && hasValue(activityId);
hasValue(schemeName) && hasValue(flowId) && hasValue(activityId);
if (!schemeName) { if (!schemeName) {
schemeNameErrMsg = '方案名称必填'; schemeNameErrMsg = '方案名称必填';
...@@ -1049,7 +1105,8 @@ const CaseModify = props => { ...@@ -1049,7 +1105,8 @@ const CaseModify = props => {
} else { } else {
activityIdErrMsg = ''; activityIdErrMsg = '';
} }
if (userIds.length < 1) { console.log(userIds, roleIds, 'userIds, roleIdsuserIds, roleIds');
if (userIds.length < 1 && roleIds.length < 1) {
userIdsErrMsg = '请选择下一节点办理人'; userIdsErrMsg = '请选择下一节点办理人';
} else { } else {
userIdsErrMsg = ''; userIdsErrMsg = '';
...@@ -1066,7 +1123,10 @@ const CaseModify = props => { ...@@ -1066,7 +1123,10 @@ const CaseModify = props => {
isOk = isOk =
isOk && isOk &&
ruleInfos.every( ruleInfos.every(
v => v.userIds.length > 0 && hasValue(v.ruleContent) && hasValue(v.ruleName), v =>
(v.userIds.length > 0 || v.roleIds.length > 0) &&
hasValue(v.ruleContent) &&
hasValue(v.ruleName),
); );
let infos = ruleInfos; let infos = ruleInfos;
for (let i of infos) { for (let i of infos) {
...@@ -1081,7 +1141,7 @@ const CaseModify = props => { ...@@ -1081,7 +1141,7 @@ const CaseModify = props => {
i.ruleContentErrMsg = ''; i.ruleContentErrMsg = '';
} }
if (i.userIds.length < 1) { if (i.userIds.length < 1 && i.roleIds.length < 1) {
i.userIdsErrMsg = '下一节点办理人必填'; i.userIdsErrMsg = '下一节点办理人必填';
} else { } else {
i.userIdsErrMsg = ''; i.userIdsErrMsg = '';
...@@ -1089,7 +1149,7 @@ const CaseModify = props => { ...@@ -1089,7 +1149,7 @@ const CaseModify = props => {
} }
setRuleInfos(infos); setRuleInfos(infos);
} else { } else {
isOk = isOk && userIds.length > 0; isOk = isOk && (userIds.length > 0 || roleIds.length > 0);
let msg = ''; let msg = '';
if (planType === 'ByLoop') { if (planType === 'ByLoop') {
if (!num || num < 0) { if (!num || num < 0) {
...@@ -1143,10 +1203,10 @@ const CaseModify = props => { ...@@ -1143,10 +1203,10 @@ const CaseModify = props => {
const handleOnOk = () => { const handleOnOk = () => {
if (!isValid()) { if (!isValid()) {
message.warn('校验未通过,请检查表单填写信息!') message.warn('校验未通过,请检查表单填写信息!');
return; return;
} }
setloadding(true) setloadding(true);
if (configInfo.triggerType === '条件触发') { if (configInfo.triggerType === '条件触发') {
postData.current.conditionConfig = { postData.current.conditionConfig = {
ruleList: ruleInfos, ruleList: ruleInfos,
...@@ -1176,14 +1236,15 @@ const CaseModify = props => { ...@@ -1176,14 +1236,15 @@ const CaseModify = props => {
agentConfig.dayOfWeek = weekValues.map(v => weeks.indexOf(v) + 1).join(','); agentConfig.dayOfWeek = weekValues.map(v => weeks.indexOf(v) + 1).join(',');
} }
} }
console.log(postData.current.scheduledConfig.values, 'postData.current.scheduledConfig.values')
postData.current.scheduledConfig = { postData.current.scheduledConfig = {
agentConfig, agentConfig,
userIds: configInfo.userIds, userIds: configInfo.userIds,
roleIds: configInfo.roleIds, roleIds: configInfo.roleIds,
values: showForm ? postData.current.scheduledConfig.values : []
}; };
} }
const fn = ()=> setloadding(false) const fn = () => setloadding(false);
onOk(postData.current, fn); onOk(postData.current, fn);
}; };
...@@ -1207,8 +1268,7 @@ const CaseModify = props => { ...@@ -1207,8 +1268,7 @@ const CaseModify = props => {
setShowPersonSelect(true); setShowPersonSelect(true);
}; };
const initMap = data => {
const initMap = (data) => {
setTimeout(() => { setTimeout(() => {
if (myDiagram) { if (myDiagram) {
myDiagram.div = null; // 断开现有 Diagram 的 div 绑定 myDiagram.div = null; // 断开现有 Diagram 的 div 绑定
...@@ -1242,9 +1302,7 @@ const CaseModify = props => { ...@@ -1242,9 +1302,7 @@ const CaseModify = props => {
go.Node, go.Node,
'Auto', 'Auto',
// { deletable: false, toolTip: tooltiptemplate }, // { deletable: false, toolTip: tooltiptemplate },
new go.Binding('location', 'points', go.Point.parse).makeTwoWay( new go.Binding('location', 'points', go.Point.parse).makeTwoWay(go.Point.stringify),
go.Point.stringify,
),
// 节点样式配置 // 节点样式配置
_$( _$(
go.Panel, go.Panel,
...@@ -1252,7 +1310,7 @@ const CaseModify = props => { ...@@ -1252,7 +1310,7 @@ const CaseModify = props => {
nodeBoxStyle('height'), nodeBoxStyle('height'),
_$( _$(
go.Picture, go.Picture,
new go.Binding('source', 'nodeDetail', (v) => { new go.Binding('source', 'nodeDetail', v => {
const obj = JSON.parse(v); const obj = JSON.parse(v);
console.log(obj, 'vvvvvvv'); console.log(obj, 'vvvvvvv');
switch (obj.NodeType) { switch (obj.NodeType) {
...@@ -1301,13 +1359,9 @@ const CaseModify = props => { ...@@ -1301,13 +1359,9 @@ const CaseModify = props => {
overflow: go.TextBlock.OverflowEllipsis, overflow: go.TextBlock.OverflowEllipsis,
font: 'normal 12pt Microsoft YaHei', font: 'normal 12pt Microsoft YaHei',
}, },
new go.Binding('text', 'nodeDetail', (v) => { new go.Binding('text', 'nodeDetail', v => {
const obj = JSON.parse(v); const obj = JSON.parse(v);
if ( if (obj.NodeType === '20' || obj.NodeType === '21' || obj.NodeType === '22') {
obj.NodeType === '20' ||
obj.NodeType === '21' ||
obj.NodeType === '22'
) {
return ''; return '';
} }
return obj.NodeName.slice(0, 6); return obj.NodeName.slice(0, 6);
...@@ -1322,22 +1376,14 @@ const CaseModify = props => { ...@@ -1322,22 +1376,14 @@ const CaseModify = props => {
overflow: go.TextBlock.OverflowEllipsis, overflow: go.TextBlock.OverflowEllipsis,
font: 'normal 12pt Microsoft YaHei', font: 'normal 12pt Microsoft YaHei',
}, },
new go.Binding('spacingAbove', 'undertakeman', (v) => new go.Binding('spacingAbove', 'undertakeman', v => (v?.length > 0 ? 5 : 0)),
v?.length > 0 ? 5 : 0, new go.Binding('height', 'undertakeman', v => (v?.length > 0 ? 30 : 0)),
), new go.Binding('margin', 'undertakeman', v =>
new go.Binding('height', 'undertakeman', (v) =>
v?.length > 0 ? 30 : 0,
),
new go.Binding('margin', 'undertakeman', (v) =>
v?.length > 0 ? new go.Margin(10, 10, 0, 10) : 0, v?.length > 0 ? new go.Margin(10, 10, 0, 10) : 0,
), ),
new go.Binding('text', 'nodeDetail', (v) => { new go.Binding('text', 'nodeDetail', v => {
const obj = JSON.parse(v); const obj = JSON.parse(v);
if ( if (obj.NodeType === '20' || obj.NodeType === '21' || obj.NodeType === '22') {
obj.NodeType === '20' ||
obj.NodeType === '21' ||
obj.NodeType === '22'
) {
return ''; return '';
} }
if (obj.RoleList?.length === 0) { if (obj.RoleList?.length === 0) {
...@@ -1356,16 +1402,13 @@ const CaseModify = props => { ...@@ -1356,16 +1402,13 @@ const CaseModify = props => {
mouseEnter(e, node) { mouseEnter(e, node) {
// console.log(e, node); // console.log(e, node);
}, },
mouseLeave(e, node) { }, mouseLeave(e, node) {},
// 处理双击 // 处理双击
doubleClick(e, node) { }, doubleClick(e, node) {},
// define a tooltip for each node that displays the color as text // define a tooltip for each node that displays the color as text
// define a tooltip for each node that displays the color as text // define a tooltip for each node that displays the color as text
toolTip: _$( toolTip: _$('ToolTip', _$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'tip'))), // end of Adornment
'ToolTip',
_$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'tip')),
), // end of Adornment
}, },
); );
// 链接设置 // 链接设置
...@@ -1381,7 +1424,7 @@ const CaseModify = props => { ...@@ -1381,7 +1424,7 @@ const CaseModify = props => {
_$( _$(
go.Shape, // 链接路径形状 go.Shape, // 链接路径形状
{ isPanelMain: true, strokeWidth: 3, stroke: '#1685FF' }, { isPanelMain: true, strokeWidth: 3, stroke: '#1685FF' },
new go.Binding('stroke', 'lineType', (v) => { new go.Binding('stroke', 'lineType', v => {
// 未完成 // 未完成
if (v === 0) { if (v === 0) {
return '#342e2e11'; return '#342e2e11';
...@@ -1392,7 +1435,7 @@ const CaseModify = props => { ...@@ -1392,7 +1435,7 @@ const CaseModify = props => {
} }
return ''; return '';
}), }),
new go.Binding('strokeDashArray', 'lineType', (v) => { new go.Binding('strokeDashArray', 'lineType', v => {
// 未完成 // 未完成
if (v === 0) { if (v === 0) {
return [6, 3]; return [6, 3];
...@@ -1407,7 +1450,7 @@ const CaseModify = props => { ...@@ -1407,7 +1450,7 @@ const CaseModify = props => {
_$( _$(
go.Shape, // 箭头 go.Shape, // 箭头
{ toArrow: 'Standard', stroke: '#1685FF', fill: '#1685FF' }, { toArrow: 'Standard', stroke: '#1685FF', fill: '#1685FF' },
new go.Binding('fill', 'lineType', (v) => { new go.Binding('fill', 'lineType', v => {
// 未完成 // 未完成
if (v === 0) { if (v === 0) {
return '#342e2e11'; return '#342e2e11';
...@@ -1418,7 +1461,7 @@ const CaseModify = props => { ...@@ -1418,7 +1461,7 @@ const CaseModify = props => {
} }
return ''; return '';
}), }),
new go.Binding('stroke', 'lineType', (v) => { new go.Binding('stroke', 'lineType', v => {
// 未完成 // 未完成
if (v === 0) { if (v === 0) {
return '#342e2e11'; return '#342e2e11';
...@@ -1446,7 +1489,7 @@ const CaseModify = props => { ...@@ -1446,7 +1489,7 @@ const CaseModify = props => {
font: '10pt helvetica, arial, Microsoft YaHei', font: '10pt helvetica, arial, Microsoft YaHei',
margin: 4, margin: 4,
}, },
new go.Binding('stroke', 'lineType', (v) => { new go.Binding('stroke', 'lineType', v => {
// 未完成 // 未完成
if (v === 0) { if (v === 0) {
return '#d2d2d2'; return '#d2d2d2';
...@@ -1457,7 +1500,7 @@ const CaseModify = props => { ...@@ -1457,7 +1500,7 @@ const CaseModify = props => {
} }
return ''; return '';
}), }),
new go.Binding('text', 'lineDetail', (v) => lineText(v)), new go.Binding('text', 'lineDetail', v => lineText(v)),
), ),
), ),
); );
...@@ -1471,7 +1514,7 @@ const CaseModify = props => { ...@@ -1471,7 +1514,7 @@ const CaseModify = props => {
const nodeBoxStyle = (atr, classname) => { const nodeBoxStyle = (atr, classname) => {
switch (atr) { switch (atr) {
case 'width': case 'width':
return new go.Binding('width', 'NodeType', (v) => { return new go.Binding('width', 'NodeType', v => {
switch (v) { switch (v) {
case '1': case '1':
return 140; return 140;
...@@ -1494,7 +1537,7 @@ const CaseModify = props => { ...@@ -1494,7 +1537,7 @@ const CaseModify = props => {
} }
}); });
case 'height': case 'height':
return new go.Binding('height', 'NodeType', (v) => { return new go.Binding('height', 'NodeType', v => {
switch (v) { switch (v) {
case '1': case '1':
return 140; return 140;
...@@ -1517,7 +1560,7 @@ const CaseModify = props => { ...@@ -1517,7 +1560,7 @@ const CaseModify = props => {
} }
}); });
case 'stroke': case 'stroke':
return new go.Binding('stroke', 'nodeDetail', (v) => { return new go.Binding('stroke', 'nodeDetail', v => {
const obj = JSON.parse(v); const obj = JSON.parse(v);
switch (obj.NodeType) { switch (obj.NodeType) {
case '1': case '1':
...@@ -1550,16 +1593,65 @@ const CaseModify = props => { ...@@ -1550,16 +1593,65 @@ const CaseModify = props => {
return 'transparent'; return 'transparent';
} }
return 'transparent'; return 'transparent';
}; };
// 线上的文案 // 线上的文案
const lineText = v => { const lineText = v => {
let obj = JSON.parse(v); let obj = JSON.parse(v);
let nodeData = myDiagram.model.findNodeDataForKey(obj.from); let nodeData = myDiagram.model.findNodeDataForKey(obj.from);
if (nodeData.NodeType === '20' || nodeData.NodeType === '21') { if (nodeData.NodeType === '20' || nodeData.NodeType === '21') {
return nodeData.RuleList.find(ele => ele.NextNodeId === obj.to).RuleName; return nodeData.RuleList.find(ele => ele.NextNodeId === obj.to).RuleName;
} }
return ''; return '';
}; };
const loaclPaths = ['【本人姓名】', '【本人电话】', '【本人部门】']
const onOK= async ()=>{
console.log(formJsonRef.current, 'formJsonRef.current');
if(isObject(formJsonRef.current)){
const formJsonData = getFormData(formJsonRef.current);
const { errors, formValue } = await formRef.current.getValues();
if(errors.length > 0){
message.warn('表单校验不通过,请先完善表单')
return;
}
const values = formValue.map(v=> {
if(formJsonData[v.fieldName]){
const { widget, presetValue, isStoreID, isMySite } = formJsonData[v.fieldName]
if(widget === 'TextInput' && loaclPaths.includes(presetValue)){
return {
fieldName: v.fieldName,
fieldValue: '',
presetValue,
isStoreID
}
}else if(widget === 'ComboBox' && isMySite){
return {
fieldName: v.fieldName,
fieldValue: '',
presetValue: '',
isStoreID
}
}
return {
fieldName: v.fieldName,
fieldValue: v.fieldValue,
presetValue: '',
isStoreID
}
}
})
setSchemaValues({ ...schemaValues, values: formValue })
console.log(values, formValue, 'valuesvaluesvalues');
postData.current.scheduledConfig.values = values
}
setFormVisible(false)
}
const onOpen = ()=>{
if(Object.keys(schemaValues.formJson).length === 0){
message.warn('未获取到表单配置')
}
setFormVisible(true)
}
const validContent = <span style={{ color: 'red', fontSize: '18px' }}>*</span>; const validContent = <span style={{ color: 'red', fontSize: '18px' }}>*</span>;
return ( return (
...@@ -1587,7 +1679,7 @@ const lineText = v => { ...@@ -1587,7 +1679,7 @@ const lineText = v => {
disabled={mode === 'edit'} disabled={mode === 'edit'}
onChange={v => { onChange={v => {
setConfigInfo({ ...configInfo, schemeName: v.target.value }); setConfigInfo({ ...configInfo, schemeName: v.target.value });
generatePostData({ schemeName: v.target.value }) generatePostData({ schemeName: v.target.value });
}} }}
/> />
<p style={{ position: 'absolute', color: 'red' }}>{configInfo.schemeNameErrMsg}</p> <p style={{ position: 'absolute', color: 'red' }}>{configInfo.schemeNameErrMsg}</p>
...@@ -1662,7 +1754,9 @@ const lineText = v => { ...@@ -1662,7 +1754,9 @@ const lineText = v => {
style={{ color: '#1890ff', border: '1px solid #1890ff' }} style={{ color: '#1890ff', border: '1px solid #1890ff' }}
onClick={() => handleCKPerson(configInfo)} onClick={() => handleCKPerson(configInfo)}
> >
{configInfo.userIds.length > 0 ? '已选下一节点办理人' : '选择下一节点办理人'} {configInfo.userIds.length > 0 || configInfo.roleIds.length > 0
? '已选下一节点办理人'
: '选择下一节点办理人'}
</Button> </Button>
<p style={{ position: 'absolute', color: 'red' }}>{configInfo.userIdsErrMsg}</p> <p style={{ position: 'absolute', color: 'red' }}>{configInfo.userIdsErrMsg}</p>
</div> </div>
...@@ -1745,10 +1839,12 @@ const lineText = v => { ...@@ -1745,10 +1839,12 @@ const lineText = v => {
<span style={{ color: 'red' }}>{v.ruleContentErrMsg}</span> <span style={{ color: 'red' }}>{v.ruleContentErrMsg}</span>
<Button <Button
block block
style={{ color: '#1890ff', border: '1px solid #1890ff' }} style={{ color: '#1890ff', border: '1px solid #1890ff', overflow: 'hidden' }}
onClick={() => handleRuleClick(() => setShowPersonSelect(true), v.id)} onClick={() => handleRuleClick(() => setShowPersonSelect(true), v.id)}
> >
{v.userIds.length ? v.userIds.map(v => v.name).join(',') : '选择下一节点办理人'} {v.userIds.length || v.roleIds.length
? [...v.userIds, ...v.roleIds].map(v => v.name).join(',')
: '选择下一节点办理人'}
</Button> </Button>
<span style={{ color: 'red' }}>{v.userIdsErrMsg}</span> <span style={{ color: 'red' }}>{v.userIdsErrMsg}</span>
</Space> </Space>
...@@ -1776,20 +1872,28 @@ const lineText = v => { ...@@ -1776,20 +1872,28 @@ const lineText = v => {
</Row> </Row>
<div <div
style={{ style={{
width: '500px', width: '540px',
padding: '10px', padding: '10px',
margin: '10px auto', margin: '10px auto',
}} }}
> >
<Space> <Space>
<span>开始时间:</span> <span>开始时间:</span>
<DatePicker locale={locale} value={startTime} onChange={t => setStartTime(t)} /> <DatePicker
showTime={{
format: 'HH',
}}
locale={locale}
format={'YYYY-MM-DD HH:00'}
value={startTime}
onChange={t => setStartTime(moment(t.format('YYYY-MM-DD HH:00:00')))}
/>
<span>结束时间:</span> <span>结束时间:</span>
<DatePicker locale={locale} value={endTime} onChange={t => setEndTime(t)} /> <DatePicker locale={locale} value={endTime} onChange={t => setEndTime(t)} />
</Space> </Space>
<div <div
style={{ style={{
width: '500px', width: '540px',
background: 'rgb(243, 243, 243)', background: 'rgb(243, 243, 243)',
padding: '10px', padding: '10px',
margin: '10px auto', margin: '10px auto',
...@@ -1903,6 +2007,18 @@ const lineText = v => { ...@@ -1903,6 +2007,18 @@ const lineText = v => {
</div> </div>
<p style={{ color: 'red' }}>{errorMsg}</p> <p style={{ color: 'red' }}>{errorMsg}</p>
<span>下次请求时间:{tip}</span> <span>下次请求时间:{tip}</span>
{configInfo.triggerType == '定时触发' &&
<div style={{ marginTop: '10px' }}>
<Space>
<span>是否填写表单:</span>
<Switch checkedChildren="开启" unCheckedChildren="关闭" checked={showForm} onChange={(e)=> setShowForm(e)}/>
{showForm && <Button onClick={onOpen}>点击查看</Button>}
</Space>
</div>
}
</div>
</>
)}
<Modal <Modal
title="选择时间" title="选择时间"
visible={openTeditor} visible={openTeditor}
...@@ -1917,9 +2033,6 @@ const lineText = v => { ...@@ -1917,9 +2033,6 @@ const lineText = v => {
> >
{timeEditor()} {timeEditor()}
</Modal> </Modal>
</div>
</>
)}
<Modal <Modal
visible={isPreview} visible={isPreview}
centered centered
...@@ -1930,9 +2043,22 @@ const lineText = v => { ...@@ -1930,9 +2043,22 @@ const lineText = v => {
footer={null} footer={null}
> >
<div className={styles.map}> <div className={styles.map}>
{isPreview && <div id="myDiagramDiv" className={styles.diagram}></div>} {isPreview && <div id="myDiagramDiv" className={styles.diagram} />}
</div> </div>
</Modal> </Modal>
<Modal
width={'80%'}
bodyStyle={{ overflow: 'auto', height: 600, padding: '10px' }}
title={'编辑移交模板'}
maskClosable={false}
visible={formVisible}
onCancel={() => setFormVisible(false)}
onOk={onOK}
destroyOnClose
>
<FormRender schemaValues={schemaValues} ref={formRef} />
</Modal>
<RuleConfig <RuleConfig
RuleContent={ruleContent.current} RuleContent={ruleContent.current}
fieldList={ruleField.current} fieldList={ruleField.current}
......
...@@ -28,6 +28,7 @@ import { ...@@ -28,6 +28,7 @@ import {
DeleteFlowAutoConfig, DeleteFlowAutoConfig,
EnableDisableFlowAutoConfig, EnableDisableFlowAutoConfig,
GetFlowAutoConfigDetail, GetFlowAutoConfigDetail,
GetFlowCenterData
} from '@/services/flow/flow'; } from '@/services/flow/flow';
import { import {
GetIISAgentConfig, GetIISAgentConfig,
...@@ -62,6 +63,7 @@ const AutoCase = props => { ...@@ -62,6 +63,7 @@ const AutoCase = props => {
let flowConfigDetail = useRef(null); let flowConfigDetail = useRef(null);
let showlogId = useRef(null); let showlogId = useRef(null);
let planName = useRef(null) let planName = useRef(null)
let flowCenterData = useRef(null);
const [refreshKey, setRefreshKey] = useState(0) const [refreshKey, setRefreshKey] = useState(0)
let mode = useRef(''); let mode = useRef('');
const statusObj = [<Tag color="default">已停用</Tag>, <Tag color="processing">已启用</Tag>]; const statusObj = [<Tag color="default">已停用</Tag>, <Tag color="processing">已启用</Tag>];
...@@ -141,6 +143,7 @@ const AutoCase = props => { ...@@ -141,6 +143,7 @@ const AutoCase = props => {
{ {
align: 'center', align: 'center',
title: '操作', title: '操作',
fixed: 'right',
render: (text, record, i) => { render: (text, record, i) => {
return ( return (
<Space size={'middle'} direction={'horizontal'}> <Space size={'middle'} direction={'horizontal'}>
...@@ -183,8 +186,20 @@ const AutoCase = props => { ...@@ -183,8 +186,20 @@ const AutoCase = props => {
useEffect(()=>{ useEffect(()=>{
getTableList() getTableList()
getFlowCenterData()
}, []) }, [])
const getFlowCenterData = async () => {
const { code, data, msg } = await GetFlowCenterData({
//userID: 1,
systemType: '业务系统',
isFilterOrderMode: 0,
isInternal: 0
});
if(code == 0){
flowCenterData.current = data;
}
}
const getTableList = () => { const getTableList = () => {
GetIISAgentConfig({ agentName: '' }).then(res => { GetIISAgentConfig({ agentName: '' }).then(res => {
...@@ -352,7 +367,7 @@ const AutoCase = props => { ...@@ -352,7 +367,7 @@ const AutoCase = props => {
} }
const res = await AddOrEditFlowAutoConfig(data); const res = await AddOrEditFlowAutoConfig(data);
if (res.code === 0) { if (res.code === 0) {
message.success('新增成功!'); message.success('操作成功!');
getData(); getData();
setOpeneditor(false); setOpeneditor(false);
} else { } else {
...@@ -365,8 +380,8 @@ const AutoCase = props => { ...@@ -365,8 +380,8 @@ const AutoCase = props => {
<div className={style.content}> <div className={style.content}>
<div className={style.header}> <div className={style.header}>
<Space size={'middle'}> <Space size={'middle'}>
<span>创建时间:</span> {/* <span>创建时间:</span>
<RangePicker showTime locale={locale} onChange={e => handleChange(e, 'date')} /> <RangePicker showTime locale={locale} onChange={e => handleChange(e, 'date')} /> */}
<span>方案状态:</span> <span>方案状态:</span>
<Radio.Group value={status} onChange={e => handleChange(e, 'status')}> <Radio.Group value={status} onChange={e => handleChange(e, 'status')}>
<Radio.Button value={-1}>全部</Radio.Button> <Radio.Button value={-1}>全部</Radio.Button>
...@@ -422,6 +437,7 @@ const AutoCase = props => { ...@@ -422,6 +437,7 @@ const AutoCase = props => {
{openEditor && <CaseModify {openEditor && <CaseModify
visible={openEditor} visible={openEditor}
flowConfigDetail={flowConfigDetail.current} flowConfigDetail={flowConfigDetail.current}
flowCenterData={flowCenterData.current}
mode={mode.current} mode={mode.current}
onClose={() => setOpeneditor(false)} onClose={() => setOpeneditor(false)}
onOk={onSubmit} onOk={onSubmit}
......
...@@ -91,7 +91,7 @@ const AddView = props => { ...@@ -91,7 +91,7 @@ const AddView = props => {
const getFormData = () => { const getFormData = () => {
console.log(msg, 'msgmsgmsgmsg'); console.log(msg, 'msgmsgmsgmsg');
if ((msg.WebPage === 'GisGatherProjectView' || msg.WebPage === 'InventoryMaterials' || msg.WebPage === 'RelatedOrder' || msg.WebPage === 'ReturnFeedbackView') && msg.WebParam) { if ((msg.WebPage === 'GisGatherProjectView' || msg.WebPage === 'DataAuditingView' || msg.WebPage === 'AttributeErrorCorrectionView' || msg.WebPage === 'InventoryMaterials' || msg.WebPage === 'RelatedOrder' || msg.WebPage === 'ReturnFeedbackView') && msg.WebParam) {
if (!Array.isArray(msg.WebParam)) { if (!Array.isArray(msg.WebParam)) {
msg.WebParam = msg.WebParam?.split(','); msg.WebParam = msg.WebParam?.split(',');
} }
...@@ -107,7 +107,7 @@ const AddView = props => { ...@@ -107,7 +107,7 @@ const AddView = props => {
const onFinish = () => { const onFinish = () => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
if ((validate.WebPage === 'GisGatherProjectView' || validate.WebPage === 'InventoryMaterials' || validate.WebPage === 'RelatedOrder' || validate.WebPage === 'ReturnFeedbackView') && validate.WebParam) { if ((validate.WebPage === 'GisGatherProjectView' || msg.WebPage === 'DataAuditingView' || msg.WebPage === 'AttributeErrorCorrectionView' || validate.WebPage === 'InventoryMaterials' || validate.WebPage === 'RelatedOrder' || validate.WebPage === 'ReturnFeedbackView') && validate.WebParam) {
validate.WebParam = validate.WebParam.toString(); validate.WebParam = validate.WebParam.toString();
} }
let obj = {}; let obj = {};
......
import React, { useState, useEffect, useMemo } from 'react'; import React, { useState, useEffect, useMemo } from 'react';
import { DatePicker, Table, Row, Col, Button, notification, message, Spin } from 'antd'; import { DatePicker, Table, Row, Col, Button, notification, message, Spin } from 'antd';
import { SwapRightOutlined, SyncOutlined } from '@ant-design/icons'; import { SwapRightOutlined, SyncOutlined, ExportOutlined } from '@ant-design/icons';
import moment from 'moment'; import moment from 'moment';
import 'moment/dist/locale/zh-cn'; import 'moment/dist/locale/zh-cn';
import locale from 'antd/es/date-picker/locale/zh_CN'; import locale from 'antd/es/date-picker/locale/zh_CN';
import ReactEcharts from 'echarts-for-react'; import ReactEcharts from 'echarts-for-react';
import { post, PUBLISH_SERVICE } from '@/services/index'; import { post, PUBLISH_SERVICE } from '@/services/index';
import styles from './index.less'; import styles from './index.less';
import * as XLSX from "xlsx";
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const LoginLog = () => { const LoginLog = () => {
...@@ -108,6 +109,11 @@ const LoginLog = () => { ...@@ -108,6 +109,11 @@ const LoginLog = () => {
key: 'IPTerritory', key: 'IPTerritory',
width: 250, width: 250,
}, },
{
title: '机构名称',
dataIndex: 'GroupName',
key: 'GroupName',
},
{ {
title: '用户名', title: '用户名',
dataIndex: 'ShowName', dataIndex: 'ShowName',
...@@ -212,6 +218,30 @@ const LoginLog = () => { ...@@ -212,6 +218,30 @@ const LoginLog = () => {
setAllTime([moment().startOf('week'), moment(new Date(), 'YYYY-MM-DD HH:mm:ss')]); setAllTime([moment().startOf('week'), moment(new Date(), 'YYYY-MM-DD HH:mm:ss')]);
setFilteredValue([]); setFilteredValue([]);
}; };
const handleExport = ()=>{
const souceData = data0.map(v=>{
let obj = {}
Object.keys(v).forEach(k=>{
const d = columns.find(x=> x.key === k)
if(d){
obj[`${d.title}`] =v[k]
}
})
return obj
})
// 2. 创建工作表
const worksheet = XLSX.utils.json_to_sheet(souceData);
// 3. 创建工作簿
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, "Sheet1");
// 4. 生成 Excel 文件并下载
XLSX.writeFile(workbook, `导出数据_${new Date().toLocaleDateString()}.xlsx`);
}
const onChangeInput = filters => { const onChangeInput = filters => {
// console.log('filters', filters); // console.log('filters', filters);
setFilteredValue(filters.LoginName, filters.ShowName, filters.Client); setFilteredValue(filters.LoginName, filters.ShowName, filters.Client);
...@@ -364,6 +394,17 @@ const LoginLog = () => { ...@@ -364,6 +394,17 @@ const LoginLog = () => {
> >
重置 重置
</Button> */} </Button> */}
<Button
icon={<ExportOutlined className={styles.icon} />}
onClick={handleExport}
style={{
marginLeft: '25px',
verticalAlign: 'middle',
marginTop: '-3px',
}}
>
导出
</Button>
</Col> </Col>
</Row> </Row>
<Spin spinning={loading} tip="loading"> <Spin spinning={loading} tip="loading">
......
...@@ -147,6 +147,12 @@ export const GetFlowAutoConfigDetail = query => get(`${PUBLISH_SERVICE}/WorkFlow ...@@ -147,6 +147,12 @@ export const GetFlowAutoConfigDetail = query => get(`${PUBLISH_SERVICE}/WorkFlow
export const GetFlowAutoSchemeLogs = query => get(`${PUBLISH_SERVICE}/WorkFlow/GetFlowAutoSchemeLogs`, query); export const GetFlowAutoSchemeLogs = query => get(`${PUBLISH_SERVICE}/WorkFlow/GetFlowAutoSchemeLogs`, query);
export const GetBizMetaData = query => post(`${PANDAWORKFLOW}/EventManage/GetBizMetaData`, query);
export const GetFlowCenterData = query => get(`${PANDAWORKFLOW}/EventManage/GetFlowCenterData`, query);
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