Commit 6ff768cb authored by 彭俊龙's avatar 彭俊龙

feat:新增自动化工单配置

parent 48ef909b
Pipeline #96372 failed with stages
...@@ -23,7 +23,7 @@ import styles from './index.less'; ...@@ -23,7 +23,7 @@ import styles from './index.less';
import CardCheck from './CardCheck'; import CardCheck from './CardCheck';
const PeopleSelector = props => { const PeopleSelector = props => {
const { confirmModal, onCancel, visible, onSubumit, userIds, roleIds, env } = props; const { confirmModal, onCancel, visible, onSubumit, userIds, roleIds, env, caseMode } = props;
console.log('props', props) console.log('props', props)
const [allList, setAllist] = useState([]); // 用于展示得数据 const [allList, setAllist] = useState([]); // 用于展示得数据
const [checkListRoles, setCheckListRoles] = useState([]); // 选中得数据集合 const [checkListRoles, setCheckListRoles] = useState([]); // 选中得数据集合
...@@ -551,7 +551,8 @@ const PeopleSelector = props => { ...@@ -551,7 +551,8 @@ const PeopleSelector = props => {
> >
角色 角色
</div> </div>
<div { !caseMode &&
<div
className={classnames({ className={classnames({
[styles.people]: true, [styles.people]: true,
[styles.peoplePick]: type === '环境变量', [styles.peoplePick]: type === '环境变量',
...@@ -564,6 +565,8 @@ const PeopleSelector = props => { ...@@ -564,6 +565,8 @@ const PeopleSelector = props => {
> >
环境变量 环境变量
</div> </div>
}
<Input.Search <Input.Search
value={searchName} value={searchName}
placeholder={type === '人员' ? '请输入部门或用户' : '请输入角色'} placeholder={type === '人员' ? '请输入部门或用户' : '请输入角色'}
...@@ -579,7 +582,8 @@ const PeopleSelector = props => { ...@@ -579,7 +582,8 @@ const PeopleSelector = props => {
<div className={styles.checkList}> <div className={styles.checkList}>
<div className={styles.person} />人员 <div className={styles.person} />人员
<div className={styles.role} />角色 <div className={styles.role} />角色
<div className={styles.env} />环境变量 { !caseMode && <><div className={styles.env} />环境变量</>}
</div> </div>
</div> </div>
<div className={styles.content}> <div className={styles.content}>
......
import React, { useState, useEffect, useRef } from 'react';
import {
Space,
DatePicker,
Radio,
Input,
Button,
Table,
Modal,
Row,
Col,
Select,
InputNumber,
Checkbox,
message,
} from 'antd';
import 'moment/dist/locale/zh-cn';
import locale from 'antd/es/date-picker/locale/zh_CN';
import moment from 'moment/moment';
import RuleConfig from '@/components/RuleConfig';
import PeopleSelector from '@/components/PeopleSelector';
import { WFGetAllFlow, GetFormDataSource } from '@/services/workflow/workflow';
import { GetScheduledConfigFlowNode, GetConditionConfigFlowNode } from '@/services/flow/flow';
import { GetSubEventFlows } from '@/services/workflow/workflow';
const days = moment().daysInMonth();
const allDays = [...Array.from({ length: days + 1 }, (_, i) => i + 1)];
const weeks = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
const weeks1 = ['第一周', '第二周', '第三周', '第四周', '最后一周'];
const CaseModify = props => {
const { visible, mode, onClose, onOk, flowConfigDetail } = props;
const [planType, setPlanType] = useState('ByLoop'); // ByLoop:循环 ByDay:每天 ByWeek:每周 ByMonth:每月
const [timeType, setTimeType] = useState('');
const [showTtype, setShowTtype] = useState('time');
const [showRule, setShowRule] = useState(false);
const [showPersonSelect, setShowPersonSelect] = useState(false);
const [openTeditor, setOpenTeditor] = useState(false);
const [loadding, setloadding] = useState(false);
const [configInfo, setConfigInfo] = useState({
schemeName: '',
schemeNameErrMsg: '', //验证必填提示词
triggerType: '条件触发',
flowId: '',
flowIdErrMsg: '', //验证必填提示词
activityId: '',
activityIdErrMsg: '', //验证必填提示词
userIds: [], //定时触发使用
userIdsErrMsg: '', //定时触发使用
roleIds: [], //定时触发使用
});
const [ruleInfos, setRuleInfos] = useState([
{
id: 1,
userIds: [],
roleIds: [],
tableNames: '',
ruleContent: '',
ruleName: '',
ruleNameErrMsg: '',
userIdsErrMsg: '',
ruleContentErrMsg: '',
},
]);
const [timeValues, setTimeValues] = useState([]); //每天
const [weekValues, setWeekValues] = useState([]); //每周 每月 按周 星期几
const [weekValues1, setWeekValues1] = useState([]); //每月 按周 第几周
const [dayValues, setDayValues] = useState([]); //每月 按日
const [startTime, setStartTime] = useState(moment());
const [endTime, setEndTime] = useState('');
const [tip, setTip] = useState('');
const [num, setNum] = useState(0);
const [flowList, setFlowList] = useState([]);
const [nodeNams, setNodeNames] = useState([]);
const [isPreview, setIsPreView] = useState(false);
const [errorMsg, setErrorMsg] = useState(''); //定时触发下的参数校验
let weekType = useRef(''); //每周 按周 第几周 周几执行
let timeUnit = useRef('hour');
let ruleContent = useRef('');
let userIdsRef = useRef([]);
let roleIdsRef = useRef([]);
let ruleField = useRef([]);
let flowData = useRef([]);
let imgUrl = useRef('');
let postData = useRef({
id: null,
schemeName: '',
triggerMethod: '条件触发',
flowId: null,
flowName: '',
eventId: null,
eventName: '',
activityId: null,
activityName: '',
isEnabled: 1,
conditionConfig: {
ruleList: [],
}, //条件触发
scheduledConfig: {
userIds: [], //用户ID
roleIds: [], //角色ID
agentConfig: '',
}, //定时触发
});
let ruleFileds = useRef([]);
let currentRuleId = useRef(null);
let tableName = useRef(null);
useEffect(() => {
if (planType === 'ByLoop') {
handleTimeInfo(timeUnit.current, num);
} else if (planType === 'ByDay') {
setTip(getNextClosestTime(timeValues));
} else if (planType === 'ByWeek') {
setTip(getNextWeekday(weekValues, timeValues));
} else if (planType === 'ByMonth' && timeType == 'day') {
setTip(getTipByDay(dayValues, timeValues));
} else if (planType === 'ByMonth' && timeType == 'week') {
setTip(getTipByWeek(timeValues, weekValues, weekValues1));
}
}, [timeUnit.current, num, timeValues, weekValues, dayValues]);
useEffect(() => {
if (visible) {
getEventFlow();
if (mode === 'edit' && flowConfigDetail) {
dealPostData(flowConfigDetail);
} else {
init();
}
}
}, [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([]);
};
const dealPostData = async detail => {
const {
ID,
IsEnabled,
TriggerMethod,
SchemeName,
ActivityId,
ActivityName,
EventId,
EventName,
FlowId,
FlowName,
ScheduledConfig,
ConditionConfig,
} = detail;
postData.current.schemeName = SchemeName;
postData.current.id = ID;
postData.current.isEnabled = IsEnabled;
postData.current.flowId = FlowId;
postData.current.flowName = FlowName;
postData.current.activityId = ActivityId;
postData.current.activityName = ActivityName;
postData.current.eventId = EventId;
postData.current.eventName = EventName;
postData.current.triggerMethod = TriggerMethod;
let d;
let activityId = ActivityId;
{
let res;
if (TriggerMethod === '定时触发') {
res = await GetConditionConfigFlowNode({ flowId: FlowId });
} else {
res = await GetScheduledConfigFlowNode({ flowId: FlowId });
}
const { code, msg, data } = res;
if (code === 0) {
if (data.length) {
const nodeNames = data.map(v => {
if (v.ID === ActivityId) {
d = v;
}
return { label: v.Name, value: v.ID };
});
setNodeNames(nodeNames);
activityId = TriggerMethod == '定时触发' ? nodeNames[0].value : ActivityId;
// setConfigInfo({
// ...configInfo,
// activityId: TriggerMethod == '定时触发' ? nodeNames[0].value : ActivityId,
// });
} else {
setNodeNames([]);
}
} else {
message.error(msg);
return;
}
}
setErrorMsg('');
const { UserIds, AgentConfig, RoleIds } = ScheduledConfig
let userIds = []
let roleIds = []
if(UserIds.length > 0){
userIds = UserIds && UserIds.map(v=> {
return {
id: v.ID,
name: v.Name
}
})
}
if(RoleIds.length > 0){
roleIds = RoleIds && RoleIds.map(v=> {
return {
id: v.ID,
name: v.Name
}
})
}
setConfigInfo({
...configInfo,
flowId: FlowId,
activityId: activityId,
triggerType: TriggerMethod,
schemeName: SchemeName,
schemeNameErrMsg: '',
flowIdErrMsg: '',
userIdsErrMsg: '',
activityIdErrMsg: '',
roleIds,
userIds
});
if (TriggerMethod === '条件触发') {
const { code, msg, data } = await GetFormDataSource({ flowId: FlowId });
if (code == 0) {
ruleFileds.current = data;
if (d) {
const nodeName = d.Name;
const dField = ruleFileds.current.find(v => v.NodeName === nodeName);
if (ruleFileds.current && dField) {
const { TableFieldNames, TableName } = dField;
console.log(dField, 'dFielddFielddField');
let rule = {
TableFieldNames: [
'上报人名称',
'上报人部门',
'上报站点',
'处理站点',
'更新时间',
'上报时间',
],
TableName: '内部字段',
};
tableName.current = TableName;
ruleField.current = [rule, { TableFieldNames, TableName }];
}
}
} else {
message.error(msg);
}
const { RuleList } = ConditionConfig;
if (RuleList.length) {
const rules = RuleList.map((v, i) => {
return {
id: i + 1,
ruleContent: v.RuleContent,
ruleName: v.RuleName,
tableNames: v.TableNames,
userIds: v.UserIds.map(v => {
return {
id: v.ID,
name: v.Name,
};
}),
roleIds: v.RoleIds.map(v => {
return {
id: v.ID,
name: v.Name,
};
}),
ruleNameErrMsg: '',
userIdsErrMsg: '',
ruleContentErrMsg: '',
};
});
setRuleInfos(rules);
}
} else {
const {
LoopMode,
LoopUnit,
DayOfMonth,
DayOfWeek,
HourOfDay,
WeekOfMonth,
Interval,
StartFrom,
EndAt,
} = AgentConfig;
setPlanType(LoopMode);
timeUnit.current = LoopUnit;
setNum(Interval * 1);
StartFrom && setStartTime(moment(StartFrom));
EndAt && setEndTime(moment(EndAt));
if (LoopMode === 'ByDay') {
HourOfDay && setTimeValues(HourOfDay.split(',').map(v => v * 1));
}
if (LoopMode === 'ByWeek') {
if (DayOfWeek) {
const wvals = DayOfWeek.split(',').map(v => v * 1);
setWeekValues(weeks.filter((w, i) => wvals.includes(i + 1)));
}
HourOfDay && setTimeValues(HourOfDay.split(',').map(v => v * 1));
}
if (LoopMode === 'ByMonth') {
HourOfDay && setTimeValues(HourOfDay.split(',').map(v => v * 1));
if (DayOfMonth) {
setTimeType('day');
DayOfMonth && setDayValues(DayOfMonth.split(',').map(v => v * 1));
} else {
setTimeType('week');
if (WeekOfMonth) {
const wvals = WeekOfMonth.split(',').map(v => v * 1);
setWeekValues1(weeks1.filter((w, i) => wvals.includes(i + 1)));
}
if (DayOfWeek) {
const wvals = DayOfWeek.split(',').map(v => v * 1);
setWeekValues(weeks.filter((w, i) => wvals.includes(i + 1)));
}
}
}
}
};
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 { code, data, msg } = await GetSubEventFlows();
if (code === 0) {
flowData.current = data;
const list = data.map(v => {
return { value: v.SubFlowId, label: `${v.FlowName}(${v.EventName})` };
});
setFlowList(list);
} else {
message.error(msg);
}
};
const getPrewViewImage = flowId =>
WFGetAllFlow().then(res => {
if (res.code === 0) {
const data = res.data
.map(v => v.children)
.flat()
.find(v => v.FlowID == flowId);
console.log(data, res.data.map(v => v.children).flat(), ' datadatadata');
if (data) {
imgUrl.current = `/PandaOMS/OMS/FileCenter/DownLoadFiles?module=熊猫智慧水务平台\\WorkFlowImage&filePath=${
data.PreviewImage
}`;
setIsPreView(true);
}
}
});
//计算循环的下次执行时间
const handleTimeInfo = (timeUnit, num) => {
if (startTime) {
setTip(startTime.add(num, timeUnit).format('YYYY-MM-DD HH:mm:ss'));
}
};
//计算下次执行时间每月按日
const getTipByDay = (dayVals, timeVals) => {
if (!timeVals.length || !dayVals.length) return;
const times = timeVals.sort((a, b) => a - b);
if (dayVals.length == 1 && dayVals[0] === allDays[allDays.length - 1]) {
return moment()
.endOf('month')
.hour(times[0])
.minute(0)
.second(0)
.format(`YYYY-MM-DD HH:mm:ss`);
}
const dayOfMonth = moment().date(); //当前第几天
const dayvals = dayVals.sort((a, b) => a - b).filter(v => v >= dayOfMonth);
if (dayvals.length > 0) {
return moment()
.hour(times[0])
.minute(0)
.second(0)
.format(`YYYY-MM-${dayvals[0] < 10 ? `0${dayvals[0]}` : dayvals[0]} HH:mm:ss`);
} else {
const days = dayVals.filter(v => v !== allDays[allDays.length - 1]);
return moment()
.add(1, 'month')
.hour(times[0])
.minute(0)
.second(0)
.format(`YYYY-MM-${days[0] < 10 ? `0${days[0]}` : days[0]} HH:mm:ss`);
}
};
//计算下次执行时间每月按周
const getTipByWeek = (timeVals, weekvals, weekvals1) => {
if (!timeVals.length || !weekvals.length || !weekvals1.length) return;
const weekDay = weeks.indexOf(weekvals[0]) + 1; //周几
const tier = weeks1.indexOf(weekvals1[0]) + 1; //第几周
console.log(weekDay, tier, timeVals, 'tiertiertier');
return getNextDateByTierAndWeekday(null, null, tier, weekDay, timeVals);
};
const getNextDateByTierAndWeekday = (y, m, tier, weekday, timeVals) => {
let now = moment();
let year = y || now.year();
let month = m || now.month() + 1; // 获取当前月份(1~12)
let startOfMonth = moment({ year, month: month - 1 }).startOf('month'); // 当月 1 号
let firstMonday = startOfMonth.isoWeekday() === 1 ? startOfMonth : startOfMonth.isoWeekday(8); // 获取本月的第一个周一
let targetDate;
if (tier >= 1 && tier <= 4) {
targetDate = firstMonday
.clone()
.add((tier - 1) * 7, 'days')
.isoWeekday(weekday);
} else if (tier === 5) {
let lastWeekStart = moment({ year, month: month - 1 })
.endOf('month')
.startOf('isoWeek');
targetDate = lastWeekStart.isoWeekday(weekday);
} else {
return '无效的档次,请输入 1~5';
}
// 如果当前时间已经过了计算出的日期,返回下个月的对应时间
if (targetDate.isBefore(now, 'day')) {
return getNextDateByTierAndWeekdayInMonth(year, month + 1, tier, weekday, timeVals);
}
const timeStr = targetDate.hour(timeVals[0]).format('YYYY-MM-DD HH:mm:ss');
console.log(timeStr, 'timeStrtimeStrtimeStr');
return timeStr;
};
// 计算下个月的对应时间
const getNextDateByTierAndWeekdayInMonth = (year, month, tier, weekday, timeVals) => {
if (month > 12) {
year += 1;
month = 1;
}
return getNextDateByTierAndWeekday(year, month, tier, weekday, timeVals);
};
//计算每周的下次执行时间
const getNextWeekday = (weeksList, times) => {
if (weeksList.length < 1) return;
if (times.length < 1) return;
const targetWeekday = weeks.filter(v => weeksList.includes(v))[0];
const weekObj = {};
weeks.forEach((v, i) => (weekObj[v] = i + 1));
const weekNum = weekObj[targetWeekday];
const today = moment();
const nextDay =
today.isoWeekday() < weekNum
? today.isoWeekday(weekNum) // 本周还没到目标周几
: today.add(1, 'weeks').isoWeekday(weekNum); // 目标周几已过,跳到下周
return nextDay.format(`YYYY-MM-DD ${times[0]}:mm:ss`);
};
//计算每天的下次请求时间
const getNextClosestTime = hourArray => {
if (!hourArray.length) return;
const timeArry = hourArray.sort((a, b) => a - b);
const now = moment();
const currentHour = now.hour();
// 找到大于当前小时的最近时间
// const nextHour = timeArry.find(h => h > currentHour);
if (timeArry[0] > currentHour) {
return moment()
.hour(timeArry[0])
.minute(0)
.second(0)
.format('YYYY-MM-DD HH:mm:ss');
} else {
// 如果所有时间都已经过了,返回明天的最早时间
return moment()
.add(1, 'days')
.hour(timeArry[0])
.minute(0)
.second(0)
.format('YYYY-MM-DD HH:mm:ss');
}
};
const timeConfig = value => {
const nums = Array.from({ length: 24 }, (_, i) => i);
const configMap = {
全选: nums,
反选: nums.filter(v => !timeValues.includes(v)).sort((a, b) => a - b),
一天2: [6, 18],
一天3: [0, 8, 16],
一天4: [0, 6, 12, 18],
};
if (configMap[value]) {
setTimeValues(configMap[value]);
}
};
const weekConfig = value => {
const configMap = {
全选: weeks,
反选: weeks.filter(v => !weekValues.includes(v)),
工作日: weeks.filter(v => !['星期六', '星期天'].includes(v)),
周末: weeks.filter(v => ['星期六', '星期天'].includes(v)),
};
if (configMap[value]) {
setWeekValues(configMap[value]);
}
};
const monthConfig = value => {
if (showTtype === 'time') {
return timeConfig(value);
}
if (showTtype === 'day') {
const configMap = {
全选: allDays,
反选: allDays.filter(v => !dayValues.includes(v)),
一月2: allDays.filter(v => [1, 15].includes(v)),
一月3: allDays.filter(v => [1, 11, 21].includes(v)),
};
if (configMap[value]) {
setDayValues(configMap[value]);
}
return;
}
if (showTtype === 'week' && weekType.current === 0) {
const configMap = {
全选: weeks1,
反选: weeks1.filter(v => !weekValues1.includes(v)),
};
if (configMap[value]) {
setWeekValues1(configMap[value]);
}
}
};
const handleChange = e => {
console.log(e, planType, weekType.current, timeType, showTtype, 'eeeeee');
const { value } = e.target;
if (planType === 'ByDay') {
timeConfig(value);
} else if (
planType === 'ByWeek' ||
(planType === 'ByMonth' && timeType === 'week' && weekType.current === 1)
) {
weekConfig(value);
} else if (planType === 'ByMonth') {
monthConfig(value);
}
};
const timeEditor = () => {
if (showTtype === 'day') {
return (
<Space direction={'vertical'}>
<Radio.Group onChange={handleChange}>
{['全选', '反选', '一月2次', '一月3次'].map((v, i) => (
<Radio key={i} value={v}>
{v}
</Radio>
))}
</Radio.Group>
<Checkbox.Group
value={dayValues}
onChange={e => {
setDayValues(e);
}}
>
{allDays.map((v, i) => (
<Checkbox key={i} value={v}>
{i + 1 !== allDays.length ? v : '最后'}
</Checkbox>
))}
</Checkbox.Group>
</Space>
);
} else if (showTtype === 'week') {
if (weekType.current === 0) {
return (
<Space direction={'vertical'}>
<Radio.Group onChange={handleChange}>
{['全选', '反选'].map((v, i) => (
<Radio key={i} value={v}>
{v}
</Radio>
))}
</Radio.Group>
<Checkbox.Group value={weekValues1} onChange={e => setWeekValues1(e)}>
{weeks1.map((v, i) => (
<Checkbox key={i} value={v}>
{v}
</Checkbox>
))}
</Checkbox.Group>
</Space>
);
} else {
return (
<Space direction={'vertical'}>
<Radio.Group onChange={handleChange}>
{['全选', '反选', '工作日', '周末'].map((v, i) => (
<Radio key={i} value={v}>
{v}
</Radio>
))}
</Radio.Group>
<Checkbox.Group value={weekValues} onChange={e => setWeekValues(e)}>
{weeks.map((v, i) => (
<Checkbox key={i} value={v}>
{v}
</Checkbox>
))}
</Checkbox.Group>
</Space>
);
}
} else if (showTtype === 'time') {
return (
<Space direction={'vertical'}>
<Radio.Group onChange={e => timeConfig(e.target.value)}>
{['全选', '反选', '一天2次', '一天3次', '一天4次'].map((v, i) => (
<Radio key={i} value={v}>
{v}
</Radio>
))}
</Radio.Group>
<Checkbox.Group
value={timeValues}
onChange={e => {
setTimeValues(e);
}}
>
{Array.from({ length: 24 }, (_, i) => {
return (
<Checkbox key={i} value={i}>
{i < 10 ? `0${i}` : i}
{':00'}
</Checkbox>
);
})}
</Checkbox.Group>
</Space>
);
}
};
const handleSelectNode = id => {
setConfigInfo({ ...configInfo, activityId: id });
generatePostData({ activityId: id });
const d = nodeNams.find(v => v.value == id);
if (d) {
const nodeName = d.label;
const dField = ruleFileds.current.find(v => v.NodeName === nodeName);
if (ruleFileds.current && dField) {
const { TableFieldNames, TableName } = dField;
console.log(dField, 'dFielddFielddField');
let rule = {
TableFieldNames: [
'上报人名称',
'上报人部门',
'上报站点',
'处理站点',
'更新时间',
'上报时间',
],
TableName: '内部字段',
};
tableName.current = TableName;
ruleField.current = [rule, { TableFieldNames, TableName }];
}
}
};
///构造提交数据体
const generatePostData = formData => {
const {
id,
schemeName,
triggerMethod,
flowId,
flowName,
eventId,
eventName,
activityId,
activityName,
IsEnabled,
conditionConfig,
scheduledConfig,
} = formData;
postData.current = {
...postData.current,
id: id ?? postData.current.id,
schemeName: schemeName ?? postData.current.schemeName,
triggerMethod: triggerMethod ?? postData.current.triggerMethod,
flowId: flowId ?? postData.current.flowId,
flowName: flowName ?? postData.current.flowName,
eventId: eventId ?? postData.current.eventId,
eventName: eventName ?? postData.current.eventName,
activityId: activityId ?? postData.current.activityId,
activityName: activityName ?? postData.current.activityName,
IsEnabled: IsEnabled ?? postData.current.isEnabled,
conditionConfig: conditionConfig ?? postData.current.conditionConfig,
scheduledConfig: scheduledConfig ?? postData.current.scheduledConfig,
};
if (schemeName) {
setConfigInfo({ ...configInfo, schemeName: schemeName });
}
if (flowId) {
const { FlowName, EventName, SubFlowEventConfigID } = flowData.current.find(
v => v.SubFlowId === flowId,
);
postData.current.flowName = FlowName;
postData.current.eventId = SubFlowEventConfigID;
postData.current.eventName = EventName;
}
if (activityId && !activityName) {
postData.current.activityName = nodeNams.find(v => v.value === activityId)?.label;
}
};
const handleSelectFlow = async flowId => {
generatePostData({ flowId });
let getNodeAPI, getRuleConfigAPI;
if (configInfo.triggerType === '条件触发') {
getNodeAPI = GetScheduledConfigFlowNode({ flowId });
getRuleConfigAPI = GetFormDataSource({ flowId });
} else {
getNodeAPI = GetConditionConfigFlowNode({ flowId });
}
Promise.all([getNodeAPI, getRuleConfigAPI && getRuleConfigAPI]).then(res => {
// const res = await getNodeAPI()
const { code, msg, data } = res[0];
if (code == 0) {
if (data.length) {
const nodeNames = data.map(v => {
return { label: v.Name, value: v.ID };
});
setNodeNames(nodeNames);
if (configInfo.triggerType == '定时触发') {
setConfigInfo({ ...configInfo, activityId: nodeNames[0].value, flowId: flowId });
generatePostData({ activityId: nodeNames[0].value, activityName: nodeNames[0].label });
} else {
setConfigInfo({ ...configInfo, flowId: flowId, activityId: '' });
}
} else {
setNodeNames([]);
}
} else {
message.error(msg);
}
if (res.length > 1 && res[1]) {
const configRef = res[1];
if (configRef.code == 0) {
ruleFileds.current = configRef.data;
} else {
message.error(configRef.msg);
}
}
});
};
const handleOpenTimeEditor = (timetype, weektype) => {
weekType.current = timetype === 'week' ? weektype : '';
setShowTtype(timetype);
setOpenTeditor(true);
};
const timeUnitObj = {
seconds: 'Second',
minutes: 'Minute',
hour: 'Hour',
};
const handleChangePlan = e => {
const { value } = e.target;
if (value === 'ByWeek') {
setShowTtype('week');
} else {
setShowTtype('time');
}
timeUnit.current = 'hour';
setTimeValues([]);
setWeekValues([]);
setWeekValues1([]);
setDayValues([]);
setPlanType(value);
};
const addRule = () => {
let length = ruleInfos.length;
if (length > 0) {
//(ruleInfos[length - 1] + 1).id
let addInfo = {
id: ruleInfos[length - 1].id + 1,
userIds: [],
roleIds: [],
tableNames: '',
ruleContent: '',
ruleName: '',
ruleNameErrMsg: '',
userIdsErrMsg: '',
ruleContentErrMsg: '',
};
setRuleInfos([...ruleInfos, addInfo]);
} else {
setRuleInfos([
{
id: 1,
userIds: [],
roleIds: [],
tableNames: '',
ruleContent: '',
ruleName: '',
ruleNameErrMsg: '',
userIdsErrMsg: '',
ruleContentErrMsg: '',
},
]);
}
};
const deleteRule = id => {
setRuleInfos([...ruleInfos.filter(v => v.id !== id)]);
};
const getDayInfo = days => {
if (days.length === allDays.length) {
return '全部';
}
if (days.length === 1 && days[0] === allDays[allDays.length - 1]) {
return '最后一天';
} else {
return days.map(v => (v === allDays[allDays.length - 1] ? '最后一天' : v + '日')).join(',');
}
};
const handleSelectRuleType = (e, type) => {
const { checked } = e.target;
generatePostData({ triggerMethod: type });
if (type === '定时触发') {
generatePostData({});
if (nodeNams.length > 0) {
setConfigInfo({ ...configInfo, triggerType: type, activityId: nodeNams[0].value });
return;
}
setConfigInfo({ ...configInfo, triggerType: type });
} else {
setConfigInfo({ ...configInfo, triggerType: type });
}
};
const handleRuleClick = (fn, id) => {
fn && fn();
currentRuleId.current = id;
const { userIds, roleIds, ruleContent: _ruleContent } = ruleInfos.find(v => v.id == id);
ruleContent.current = _ruleContent;
if (roleIds) {
roleIdsRef.current = roleIds.map(v => {
return { value: v.id || v.iD, label: v.name };
});
} else {
roleIdsRef.current = [];
}
if (userIds) {
userIdsRef.current = userIds.map(v => {
return { value: (v.id || v.iD) + '', label: v.name };
});
} else {
userIdsRef.current = [];
}
};
const saveRuleInfo = (e, type, id) => {
if (type == 'people') {
const { person, role } = e;
if (configInfo.triggerType === '定时触发') {
const userids = person.map(x => {
return { id: Number(x.value), name: x.label };
});
const roleids = role.map(x => {
return { id: Number(x.value), name: x.label };
});
setConfigInfo({
...configInfo,
userIds: userids,
roleIds: roleids,
});
setShowPersonSelect(false);
return;
}
let list = ruleInfos;
if (person.length) {
list = list.map(v =>
v.id === (id || currentRuleId.current)
? {
...v,
userIds: person.map(x => {
return { id: Number(x.value), name: x.label };
}),
}
: v,
);
}
if (role.length) {
list = list.map(v =>
v.id === (id || currentRuleId.current)
? {
...v,
roleIds: role.map(x => {
return { id: x.value, name: x.label };
}),
}
: v,
);
}
setRuleInfos(list);
setShowPersonSelect(false);
} else if (type == 'rule') {
ruleContent.current = e;
const list = ruleInfos.map(v =>
v.id === (id || currentRuleId.current)
? { ...v, ruleContent: e, tableNames: tableName.current }
: v,
);
setRuleInfos(list);
setShowRule(false);
} else if (type == 'ruleName') {
const list = ruleInfos.map(v =>
v.id === (id || currentRuleId.current) ? { ...v, ruleName: e.target.value } : v,
);
setRuleInfos(list);
}
};
const hasValue = field => field !== undefined && field !== null && field.trim?.() !== '';
const isValid = () => {
const { schemeName, flowId, activityId, userIds } = configInfo;
let schemeNameErrMsg = '';
let flowIdErrMsg = '';
let activityIdErrMsg = '';
let userIdsErrMsg = '';
let isOk =
hasValue(schemeName) && hasValue(flowId) && hasValue(activityId);
if (!schemeName) {
schemeNameErrMsg = '方案名称必填';
} else {
schemeNameErrMsg = '';
}
if (!flowId) {
flowIdErrMsg = '流程名称必选';
} else {
flowIdErrMsg = '';
}
if (!activityId) {
activityIdErrMsg = '节点名称必选';
} else {
activityIdErrMsg = '';
}
if (userIds.length < 1) {
userIdsErrMsg = '请选择下一节点办理人';
} else {
userIdsErrMsg = '';
}
setConfigInfo({
...configInfo,
schemeNameErrMsg,
flowIdErrMsg,
activityIdErrMsg,
userIdsErrMsg,
});
if (configInfo.triggerType === '条件触发') {
isOk =
isOk &&
ruleInfos.every(
v => v.userIds.length > 0 && hasValue(v.ruleContent) && hasValue(v.ruleName),
);
let infos = ruleInfos;
for (let i of infos) {
if (!i.ruleName) {
i.ruleNameErrMsg = '规则名称必填';
} else {
i.ruleNameErrMsg = '';
}
if (!i.ruleContent) {
i.ruleContentErrMsg = '设置条件必填';
} else {
i.ruleContentErrMsg = '';
}
if (i.userIds.length < 1) {
i.userIdsErrMsg = '下一节点办理人必填';
} else {
i.userIdsErrMsg = '';
}
}
setRuleInfos(infos);
} else {
isOk = isOk && userIds.length > 0;
let msg = '';
if (planType === 'ByLoop') {
if (!num || num < 0) {
msg = '填写正确的数字间隔范围';
}
}
if (planType === 'ByDay') {
if (timeValues.length < 1) {
msg = '请选择执行的时间段';
isOk = false;
}
}
if (planType === 'ByWeek') {
if (weekValues.length < 1 || timeValues.length < 1) {
msg = `请选择${(weekValues.length < 1 ? '星期几' : '') +
(timeValues.length < 1 ? '几点' : '')}执行`;
isOk = false;
}
}
if (planType === 'ByMonth') {
if (timeType === 'day') {
if (dayValues.length < 1 || timeValues.length < 1) {
msg = `请选择${dayValues.length < 1 ? '几号' : ''}${
timeValues.length < 1 ? '几点' : ''
}执行`;
isOk = false;
}
} else {
if (weekValues.length < 1 || timeValues.length < 1 || weekValues1.length < 1) {
isOk = false;
msg = `请选择${(weekValues1.length < 1 ? '第几周' : '') +
(weekValues.length < 1 ? '星期几' : '') +
(timeValues.length < 1 ? '几点' : '')}执行`;
}
}
}
setErrorMsg(msg);
}
console.log(isOk, configInfo, ruleInfos, '校验是否通过');
return isOk;
};
const handlePreviewImg = () => {
if (configInfo.flowId) {
getPrewViewImage(configInfo.flowId);
}
};
const handleOnOk = () => {
if (!isValid()) {
message.warn('校验未通过,请检查表单填写信息!')
return;
}
setloadding(true)
if (configInfo.triggerType === '条件触发') {
postData.current.conditionConfig = {
ruleList: ruleInfos,
};
} else {
let agentConfig = {
startFrom: startTime && moment(startTime).format('YYYY-MM-DD HH:mm:ss'),
endAt: endTime && moment(endTime).format('YYYY-MM-DD HH:mm:ss'),
loopMode: planType,
loopUnit: timeUnitObj[timeUnit.current],
interval: num,
};
if (planType === 'ByDay') {
agentConfig.hourOfDay = timeValues.join(',');
}
if (planType === 'ByWeek') {
agentConfig.hourOfDay = timeValues.join(',');
agentConfig.dayOfWeek = weekValues.map(v => weeks.indexOf(v) + 1).join(',');
}
if (planType === 'ByMonth') {
agentConfig.hourOfDay = timeValues.join(',');
if (timeType === 'day') {
agentConfig.dayOfMonth = dayValues.map(v => allDays.indexOf(v) + 1).join(',');
} else if (timeType === 'week') {
agentConfig.weekOfMonth = weekValues1.map(v => weeks1.indexOf(v) + 1).join(',');
agentConfig.dayOfWeek = weekValues.map(v => weeks.indexOf(v) + 1).join(',');
}
}
postData.current.scheduledConfig = {
agentConfig,
userIds: configInfo.userIds,
roleIds: configInfo.roleIds,
};
}
const fn = ()=> setloadding(false)
onOk(postData.current, fn);
};
const handleCKPerson = data => {
const { roleIds, userIds } = data;
if (roleIds) {
roleIdsRef.current = roleIds.map(v => {
return { value: v.id || v.iD, label: v.name };
});
} else {
roleIdsRef.current = [];
}
if (userIds) {
userIdsRef.current = userIds.map(v => {
return { value: (v.id || v.iD) + '', label: v.name };
});
} else {
userIdsRef.current = [];
}
setShowPersonSelect(true);
};
const validContent = <span style={{ color: 'red', fontSize: '18px' }}>*</span>;
return (
<Modal
width={700}
maskClosable={false}
bodyStyle={{ height: '70vh', width: '100%', overflow: 'auto' }}
title={`${mode === 'add' ? '新建' : '编辑'}自动化工单方案`}
visible={visible || false}
onCancel={onClose}
destroyOnClose
confirmLoading={loadding}
onOk={handleOnOk}
>
<div style={{}}>
<Row>
<Col span={4} style={{ display: 'flex', justifyContent: 'right', alignItems: 'center' }}>
{validContent}
<span>方案名称:</span>
</Col>
<Col span={18}>
<Input
style={{ width: '450px' }}
value={configInfo.schemeName}
disabled={mode === 'edit'}
onChange={v => generatePostData({ schemeName: v.target.value })}
/>
<p style={{ position: 'absolute', color: 'red' }}>{configInfo.schemeNameErrMsg}</p>
</Col>
</Row>
<Row style={{ marginTop: '20px' }}>
<Col span={4} style={{ display: 'flex', justifyContent: 'right' }}>
<span>触发条件:</span>
</Col>
<Col span={18}>
<Space size={'middle'}>
<Space direction={'vertical'} align={'start'}>
<Radio
checked={configInfo.triggerType === '条件触发'}
onChange={e => handleSelectRuleType(e, '条件触发')}
>
条件触发
</Radio>
<span>(满足规则条件下实现自动派单)</span>
</Space>
<Space direction={'vertical'}>
<Radio
checked={configInfo.triggerType === '定时触发'}
onChange={e => handleSelectRuleType(e, '定时触发')}
>
定时触发
</Radio>
<span>(根据设定的时间实现自动发单)</span>
</Space>
</Space>
</Col>
</Row>
<Row style={{ marginTop: '20px' }}>
<Col span={4} style={{ display: 'flex', justifyContent: 'right', alignItems: 'center' }}>
{validContent}
<span>选择流程:</span>
</Col>
<Col span={18}>
<Space>
<div>
<Select
style={{ width: '160px' }}
options={flowList}
showSearch
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
value={configInfo.flowId}
onChange={e => handleSelectFlow(e)}
/>
<p style={{ position: 'absolute', color: 'red' }}>{configInfo.flowIdErrMsg}</p>
</div>
<div>
<Select
style={{ width: '160px' }}
value={configInfo.activityId}
onChange={e => handleSelectNode(e)}
showSearch
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
disabled={configInfo.triggerType === '定时触发'}
options={nodeNams}
/>
<p style={{ position: 'absolute', color: 'red' }}>{configInfo.activityIdErrMsg}</p>
</div>
{configInfo.triggerType === '定时触发' && (
<div>
<Button
block
style={{ color: '#1890ff', border: '1px solid #1890ff' }}
onClick={() => handleCKPerson(configInfo)}
>
{configInfo.userIds.length > 0 ? '已选下一节点办理人' : '选择下一节点办理人'}
</Button>
<p style={{ position: 'absolute', color: 'red' }}>{configInfo.userIdsErrMsg}</p>
</div>
)}
{configInfo.triggerType === '条件触发' && (
<Button type={'link'} onClick={handlePreviewImg}>
预览流程
</Button>
)}
</Space>
</Col>
</Row>
{configInfo.triggerType === '条件触发' && (
<>
<Row style={{ marginTop: '20px' }}>
<Col
span={4}
style={{ display: 'flex', justifyContent: 'right', alignItems: 'center' }}
>
<span>条件规则:</span>
</Col>
<Col span={18}>
{/* <span>满足下列</span>
<Radio.Group onChange={e => setRuleType(e.target.value)} value={ruleType}>
<Radio.Button value={'any'}>任一</Radio.Button>
<Radio.Button value={'all'}>全部</Radio.Button>
</Radio.Group>
<span>条件时触发</span> */}
<div style={{ width: 450, display: 'flex', justifyContent: 'end' }}>
<Button onClick={addRule}>+ 触发条件</Button>
</div>
</Col>
</Row>
{ruleInfos.map((v, i) => (
<div
key={i}
style={{
width: '480px',
background: 'rgb(243, 243, 243)',
padding: '10px',
margin: '10px auto',
}}
>
<Space direction={'vertical'} style={{ width: '100%' }}>
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
}}
>
<span style={{ color: '#1890ff' }}>规则{i + 1}</span>
<Button type={'link'} onClick={() => deleteRule(v.id)} danger>
删除
</Button>
</div>
<div style={{ display: 'flex', alignItems: 'center' }}>
{validContent}
<span>规则名称:</span>
<Input
placeholder="请输入规则名称"
onChange={e => saveRuleInfo(e, 'ruleName', v.id)}
value={v.ruleName}
style={{ flex: '1' }}
/>
</div>
<span
style={{ display: 'block', color: 'red', position: 'relative', left: '80px' }}
>
{v.ruleNameErrMsg}
</span>
<Button
block
style={{ color: '#1890ff', border: '1px solid #1890ff' }}
onClick={() => handleRuleClick(() => setShowRule(true), v.id)}
>
{v.ruleContent ? v.ruleContent : '点击设置条件'}
</Button>
<span style={{ color: 'red' }}>{v.ruleContentErrMsg}</span>
<Button
block
style={{ color: '#1890ff', border: '1px solid #1890ff' }}
onClick={() => handleRuleClick(() => setShowPersonSelect(true), v.id)}
>
{v.userIds.length ? v.userIds.map(v => v.name).join(',') : '选择下一节点办理人'}
</Button>
<span style={{ color: 'red' }}>{v.userIdsErrMsg}</span>
</Space>
</div>
))}
</>
)}
{configInfo.triggerType === '定时触发' && (
<>
<Row style={{ marginTop: '20px' }}>
<Col span={4} style={{ display: 'flex', justifyContent: 'right' }}>
<span>执行频率:</span>
</Col>
<Col span={18}>
<Radio.Group value={planType} onChange={e => handleChangePlan(e)}>
<Space size={'large'}>
<Radio value={'ByLoop'}>循环</Radio>
<Radio value={'ByDay'}>每天</Radio>
<Radio value={'ByWeek'}>每周</Radio>
<Radio value={'ByMonth'}>每月</Radio>
</Space>
</Radio.Group>
</Col>
</Row>
<div
style={{
width: '500px',
padding: '10px',
margin: '10px auto',
}}
>
<Space>
<span>开始时间:</span>
<DatePicker locale={locale} value={startTime} onChange={t => setStartTime(t)} />
<span>结束时间:</span>
<DatePicker locale={locale} value={endTime} onChange={t => setEndTime(t)} />
</Space>
<div
style={{
width: '500px',
background: 'rgb(243, 243, 243)',
padding: '10px',
margin: '10px auto',
height: '150px',
}}
>
{planType === 'ByLoop' && (
<Space>
<span></span>
<InputNumber value={num} onChange={e => setNum(e)} />
<Select
onChange={e => (timeUnit.current = e)}
defaultValue={timeUnit.current}
options={[
{
label: '秒钟',
value: 'seconds',
},
{
label: '分钟',
value: 'minutes',
},
{
label: '小时',
value: 'hour',
},
]}
/>
<span>执行一次</span>
</Space>
)}
{planType === 'ByDay' && timeEditor()}
{planType === 'ByWeek' && (
<Space direction={'vertical'}>
<Radio.Group onChange={handleChange}>
{['全选', '反选', '工作日', '周末'].map((v, i) => (
<Radio key={i} value={v}>
{v}
</Radio>
))}
</Radio.Group>
<Checkbox.Group value={weekValues} onChange={e => setWeekValues(e)}>
{weeks.map((v, i) => (
<Checkbox key={i} value={v}>
{v}
</Checkbox>
))}
</Checkbox.Group>
<Space>
<span>选择时间:</span>
<Input
style={{ width: '290px' }}
value={timeValues.map(v => v + ':00').join(',')}
onClick={() => handleOpenTimeEditor('time')}
/>
</Space>
</Space>
)}
{planType === 'ByMonth' && (
<Space direction={'vertical'}>
<Space>
<span>每个月份:</span>
<Space direction={'vertical'}>
<Space>
<Radio
checked={timeType === 'day'}
onChange={e => e.target.checked && setTimeType('day')}
>
按日
</Radio>
<Input
disabled={timeType !== 'day'}
style={{ width: '270px' }}
value={getDayInfo(dayValues)}
onClick={() => handleOpenTimeEditor(timeType)}
/>
</Space>
<Space>
<Radio
checked={timeType === 'week'}
onChange={e => e.target.checked && setTimeType('week')}
>
按周
</Radio>
<Input
disabled={timeType !== 'week'}
style={{ width: '80px' }}
value={weekValues1.join(',')}
onClick={() => handleOpenTimeEditor(timeType, 0)}
/>
<Input
disabled={timeType !== 'week'}
value={weekValues.join(',')}
onClick={() => handleOpenTimeEditor(timeType, 1)}
/>
</Space>
</Space>
</Space>
<Space>
<span>选择时间:</span>
<Input
value={timeValues.map(v => v + ':00').join(',')}
style={{ width: '290px' }}
onClick={() => handleOpenTimeEditor('time')}
/>
</Space>
</Space>
)}
</div>
<p style={{ color: 'red' }}>{errorMsg}</p>
<span>下次请求时间:{tip}</span>
<Modal
title="选择时间"
visible={openTeditor}
onOk={() => setOpenTeditor(false)}
onCancel={() => setOpenTeditor(false)}
destroyOnClose
footer={[
<Button type={'primary'} onClick={() => setOpenTeditor(false)}>
确定
</Button>,
]}
>
{timeEditor()}
</Modal>
</div>
</>
)}
<Modal
visible={isPreview}
centered
title="预览流程"
width={'80%'}
bodyStyle={{ width: 'auto' }}
onCancel={() => setIsPreView(false)}
footer={null}
>
<div style={{ width: '100%', height: '100%', textAlign: 'center' }}>
<img src={imgUrl.current} />
</div>
</Modal>
<RuleConfig
RuleContent={ruleContent.current}
fieldList={ruleField.current}
visible={showRule}
handleCancel={() => setShowRule(false)}
onSubumit={e => saveRuleInfo(e, 'rule')}
flag={1}
flowID={postData.current.flowId}
/>
<PeopleSelector
visible={showPersonSelect}
userIds={userIdsRef.current}
roleIds={roleIdsRef.current}
caseMode={true}
onCancel={() => setShowPersonSelect(false)}
onSubumit={e => saveRuleInfo(e, 'people')}
/>
</div>
</Modal>
);
};
export default CaseModify;
import React, { useState, useEffect, useRef } from 'react';
import {
Space,
DatePicker,
Radio,
Input,
Button,
Table,
Modal,
Row,
Col,
Select,
InputNumber,
Checkbox,
Pagination,
message,
Tag
} from 'antd';
import {
GetFlowAutoSchemeLogs
} from '@/services/flow/flow';
import 'moment/dist/locale/zh-cn';
import locale from 'antd/es/date-picker/locale/zh_CN';
import moment from 'moment/moment';
import style from './index.less'
const { RangePicker } = DatePicker;
const { Search } = Input;
const ExcuteLog = props => {
const { onClose, visible, id } = props
const [loadding, setloadding] = useState(false)
const [dataSource, setDataSource] = useState([])
const [total, setTotal] = useState(0)
const [params, setParams] = useState({
id: id || null,
startTime: '',
endTime: '',
result: '',
info: '',
pageIndex: 1,
pageSize: 20
})
const columns = [
{
title: '流程名称',
dataIndex: 'FlowName',
align: 'center',
key: 'FlowName',
width: 150,
},
{
title: '工单编号',
align: 'center',
dataIndex: 'CaseNo',
key: 'CaseNo',
width: 150,
},
{
title: '自动办理节点',
align: 'center',
dataIndex: 'NodeName',
width: 250,
key: 'NodeName',
},
{
title: '下一节点办理人',
align: 'center',
dataIndex: 'NextNodeUserName',
width: 250,
key: 'NextNodeUserName',
},
{
title: '执行结果',
align: 'center',
dataIndex: 'ExecutionResult',
width: 100,
key: 'ExecutionResult',
render: (text, record, i) =>{
return <Tag color={text === '正常'? 'success' : 'error'}>{text}</Tag>
}
},
{
title: '失败原因',
align: 'center',
dataIndex: 'ErrorMsg',
width: 150,
key: 'ErrorMsg',
},
{
title: '触发时间',
align: 'center',
dataIndex: 'ExecutionTime',
width: 150,
key: 'ExecutionTime',
},
];
useEffect(()=> {
if(id && visible){
getData({ ...params, id})
}
}, [visible, params])
const getData = async (params)=>{
setloadding(true)
const { msg, code, data } = await GetFlowAutoSchemeLogs(params)
if(code === 0){
setTotal(data.TotalCount)
setDataSource(data.list || [])
}else{
message.error(msg)
}
setloadding(false)
}
const handleChange = (e, type) =>{
if (type === 'date') {
if (e) {
const dates = e.map(v => v.format('YYYY-MM-DD HH:mm:ss'));
setParams({ ...params, startTime: dates[0], endTime: dates[1] });
} else {
setParams({ ...params, startTime: '', endTime: '' });
}
} else if (type == 'text') {
setParams({ ...params, info: e || '' });
} else if (type == 'status') {
setParams({ ...params, result: e.target.value });
}
}
return (
<Modal
width={1300}
maskClosable={false}
centered
bodyStyle={{ height: '70vh', width: '100%', overflow: 'auto' }}
title={`查看执行日志`}
visible={visible || false}
onCancel={onClose}
destroyOnClose
footer={null}
>
<div className={style.content}>
<div className={style.header}>
<Space size={'middle'}>
<span>触发时间:</span>
<RangePicker showTime locale={locale} onChange={e => handleChange(e, 'date')} />
<span>执行结果:</span>
<Radio.Group defaultValue={''} onChange={e => handleChange(e, 'status')}>
<Radio.Button value={''}>全部</Radio.Button>
<Radio.Button value={'正常'}>正常</Radio.Button>
<Radio.Button value={'失败'}>失败</Radio.Button>
</Radio.Group>
<span>模糊查询:</span>
<Search
placeholder="请输入工单编号、流程名称查询"
onSearch={e => handleChange(e, 'text')}
style={{ width: '300px' }}
allowClear
/>
</Space>
</div>
<div className={style.tableContent}>
<Table
columns={columns}
loading={loadding}
bordered
dataSource={dataSource}
scroll={{ x: '100%', y: 450 }}
pagination={false}
/>
<div className={style.footer}>
<Pagination
showTotal= {(total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`}
pageSizeOptions= {[10, 20, 50, 100]}
total= {total}
pageSize= {params.pageSize}
current= {params.pageIndex}
showQuickJumper= {true}
showSizeChanger= {true}
onChange= {(pageindex, pageSize)=> {
setParams({
...params,
pageIndex: pageindex,
pageSize: pageSize
})
console.log(pageindex, pageSize)
}}
>
</Pagination>
</div>
</div>
</div>
</Modal>)
}
export default ExcuteLog
\ No newline at end of file
.content{
height: 100%;
.header{
width: 100%;
height: 60px;
background-color: white;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0px 20px;
}
.tableContent{
width: 100%;
height: calc(100% - 70px);
background-color: white;
margin-top: 10px;
.footer{
position: absolute;
bottom: 10px;
right: 10px;
}
}
.linkFont{
color: #1890ff;
&:hover{
cursor: pointer;
}
&.danger{
color: red
}
}
}
\ No newline at end of file
import React, { useState, useEffect, useRef } from 'react';
import {
Space,
DatePicker,
Radio,
Input,
Button,
Table,
Modal,
Row,
Col,
Select,
InputNumber,
Checkbox,
Tooltip,
message,
Tag,
Pagination
} from 'antd';
import style from './index.less';
import { PlusOutlined, FileSearchOutlined, EditOutlined, LockOutlined, UnlockOutlined, DeleteOutlined } from '@ant-design/icons';
import CaseModify from './components/CaseModify';
import ExcuteLog from './components/ExcuteLog';
import classNames from 'classnames';
import {
GetFlowAutoConfigPageData,
AddOrEditFlowAutoConfig,
DeleteFlowAutoConfig,
EnableDisableFlowAutoConfig,
GetFlowAutoConfigDetail,
} from '@/services/flow/flow';
import {
GetIISAgentConfig,
} from '@/services/scheduledTasks/api';
import 'moment/dist/locale/zh-cn';
import LookModal from '../../../platformCenter/scheduledTasks/components/LookModal';
import locale from 'antd/es/date-picker/locale/zh_CN';
import moment from 'moment/moment';
const weeks = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
const weeks1 = ['第一周', '第二周', '第三周', '第四周', '最后一周'];
const days = moment().daysInMonth();
const allDays = [...Array.from({ length: days + 1 }, (_, i) => i + 1)];
const { RangePicker } = DatePicker;
const { Search } = Input;
const AutoCase = props => {
const [status, setStatus] = useState(-1);
const [lookVisible, setLookVisible] = useState(false)
const [keepTableList, setKeepTableList] = useState([])
const [params, setParams] = useState({
startTime: '',
endTime: '',
info: '',
pageIndex: 1,
pageSize: 20,
status: -1,
});
const [openEditor, setOpeneditor] = useState(false);
const [showLog, setShowLog] = useState(false);
const [loadding, setloadding] = useState(false);
const [dataSource, setDataSource] = useState([]);
const [total, setTotal] = useState(0)
let flowConfigDetail = useRef(null);
let showlogId = useRef(null);
let planName = useRef(null)
const [refreshKey, setRefreshKey] = useState(0)
let mode = useRef('');
const statusObj = [<Tag color="default">已停用</Tag>, <Tag color="processing">已启用</Tag>];
const columns = [
{
title: '方案名称',
dataIndex: 'SchemeName',
align: 'center',
key: 'SchemeName',
width: 150,
},
{
title: '触发类型',
dataIndex: 'TriggerMethod',
align: 'center',
key: 'TriggerMethod',
width: 150,
render: (text)=>{
return <Tag color={text === '条件触发' ? 'geekblue' : 'cyan'}>{text}</Tag>
}
},
{
title: '流程名称',
dataIndex: 'FlowName',
align: 'center',
key: 'FlowName',
width: 150,
},
{
title: '自动办理节点',
align: 'center',
dataIndex: 'ActivityName',
key: 'ActivityName',
width: 200,
},
{
title: '最近执行时间',
align: 'center',
dataIndex: 'LatestExecutionTime',
width: 150,
key: 'LatestExecutionTime',
},
{
title: '最近执行结果',
align: 'center',
dataIndex: 'LatestExecutionResult',
width: 130,
key: 'LatestExecutionResult',
render: text => {
return text && <Tag color={text === '正常' ? 'success' : 'error'}>{text}</Tag>
},
},
{
title: '启用状态',
align: 'center',
dataIndex: 'IsEnabled',
width: 150,
key: 'IsEnabled',
render: text => {
return statusObj[text];
},
},
{
title: '执行内容',
align: 'center',
dataIndex: '',
width: 350,
ellipsis: {
showTitle: false,
},
key: '',
render: (text, record, i) => {
const txt = getPlanInfo(record);
return <Tooltip title={txt}>{txt}</Tooltip>;
},
},
{
align: 'center',
title: '操作',
render: (text, record, i) => {
return (
<Space size={'middle'} direction={'horizontal'}>
<Tooltip title={'查看执行日志'}>
<FileSearchOutlined className={style.linkFont} onClick={()=>{
if (record.TriggerMethod === '条件触发') {
showlogId.current = record.ID;
setShowLog(true);
}else{
planName.current = record.SchemeName
setLookVisible(true)
}
}}/>
</Tooltip>
<Tooltip title={'编辑'}>
<EditOutlined className={style.linkFont} onClick={()=>{
getDetail(record.ID)
}}/>
</Tooltip>
<Tooltip title={record.IsEnabled === 0 ? '启用' : '禁用'}>
{
record.IsEnabled === 0 ? <UnlockOutlined className={style.linkFont} onClick={()=> enableFlowConfig(record)}/> : <LockOutlined className={style.linkFont} onClick={()=> enableFlowConfig(record)}/>
}
</Tooltip>
<Tooltip title={'删除'}>
<DeleteOutlined className={classNames(style.linkFont, style.danger)} onClick={()=>{
deleteData(record.ID)
}}/>
</Tooltip>
</Space>
);
},
},
];
useEffect(() => {
getData(params);
}, [params]);
useEffect(()=>{
getTableList()
}, [])
const getTableList = () => {
GetIISAgentConfig({ agentName: '' }).then(res => {
if (res.code === 0) {
setKeepTableList(res.data);
} else {
setKeepTableList([]);
message.error(res.msg)
}
});
};
const deleteData = async id => {
Modal.confirm({
title: '提示',
content: '确定要删除吗?',
onOk: async () => {
const res = await DeleteFlowAutoConfig({ id });
if (res.code === 0) {
message.success('删除成功!');
getData();
} else {
message.error(res.msg);
}
},
});
};
const getDetail = async id => {
const res = await GetFlowAutoConfigDetail({ id });
if (res.code === 0) {
flowConfigDetail.current = res.data;
mode.current = 'edit';
setOpeneditor(true);
} else {
message.error(res.msg);
}
};
const timeObj = {
Minute: '分钟',
Hour: '小时',
Second: '秒',
};
const getPlanInfo = rowData => {
const { TriggerMethod, ActivityName, AgentConfig } = rowData;
if (TriggerMethod === '条件触发') {
return `【${ActivityName}】节点流转时按指定规则条件触发自动移交`;
} else if (AgentConfig) {
const {
LoopMode,
LoopUnit,
StartFrom,
HourOfDay,
DayOfMonth,
DayOfWeek,
Interval,
WeekOfMonth,
} = AgentConfig;
if (LoopMode === 'ByLoop') {
return `每${Interval}${timeObj[LoopUnit]}发起工单`;
}
let timeStr, weekValues, dayValues, weekValues1;
if (HourOfDay) {
timeStr = HourOfDay.split(',')
.map(v => (v > 9 ? v + ':00' : `0${v}:00`))
.join('、');
}
if (LoopMode === 'ByDay' && timeStr) {
return `每天${timeStr}发起工单`;
}
if (DayOfWeek) {
const wvals = DayOfWeek.split(',').map(v => v * 1);
weekValues = weeks.filter((w, i) => wvals.includes(i + 1));
}
if (LoopMode === 'ByWeek' && weekValues) {
return `每周${weekValues.join('、')}${timeStr}发起工单`;
}
if (DayOfMonth) {
dayValues = DayOfMonth.split(',').map(v => v * 1);
}
if (WeekOfMonth) {
const wvals = WeekOfMonth.split(',').map(v => v * 1);
weekValues1 = weeks1.filter((w, i) => wvals.includes(i + 1));
}
if (LoopMode === 'ByMonth') {
if (dayValues) {
if (dayValues.length === allDays.length) {
return `每天的${timeValues
.map(v => (v > 9 ? v + ':00' : `0${v}:00`))
.join('、')}发起工单`;
} else {
return `每月的${dayValues
.map(v => (v === allDays[allDays.length - 1] ? '最后一天' : `${v}日`))
.join('、')}${timeStr}发起工单`;
}
}
if (weekValues1 && weekValues) {
return `每月中${weekValues1.join('、')}${weekValues.join(
'、',
)}${timeStr}发起工单`;
}
}
}
};
const enableFlowConfig = async r => {
const { IsEnabled, ID } = r;
Modal.confirm({
title: '提示',
content: `确定要${IsEnabled === 0 ? '启用' : '禁用'}吗?`,
onOk: async () => {
const res = await EnableDisableFlowAutoConfig({
id: ID,
isEnabled: IsEnabled === 0 ? 1 : 0,
});
if (res.code === 0) {
message.success('操作成功!');
getData();
} else {
message.error(res.msg);
}
},
});
};
const getData = async params => {
setloadding(true);
const res = await GetFlowAutoConfigPageData(params);
const { code, data, msg } = res;
if (code == 0) {
const { TotalCount, list } = data;
setTotal(TotalCount)
setDataSource(list);
} else {
message.error(msg);
}
setloadding(false);
};
const handleChange = (e, type) => {
if (type === 'date') {
if (e) {
const dates = e.map(v => v.format('YYYY-MM-DD HH:mm:ss'));
setParams({ ...params, startTime: dates[0], endTime: dates[1] });
} else {
setParams({ ...params, startTime: '', endTime: '' });
}
} else if (type == 'text') {
setParams({ ...params, info: e || '' });
} else if (type == 'status') {
setParams({ ...params, status: e.target.value });
setStatus(e.target.value);
}
};
const onSubmit = async (data, fn) => {
console.log(data, '提交数据体');
if (data.id == null) {
delete data.id;
}
const res = await AddOrEditFlowAutoConfig(data);
if (res.code === 0) {
message.success('新增成功!');
getData();
setOpeneditor(false);
} else {
message.error(res.msg);
}
fn && fn()
};
return (
<div className={style.content}>
<div className={style.header}>
<Space size={'middle'}>
<span>创建时间:</span>
<RangePicker showTime locale={locale} onChange={e => handleChange(e, 'date')} />
<span>方案状态:</span>
<Radio.Group value={status} onChange={e => handleChange(e, 'status')}>
<Radio.Button value={-1}>全部</Radio.Button>
<Radio.Button value={1}>已启用</Radio.Button>
<Radio.Button value={0}>已停用</Radio.Button>
</Radio.Group>
<span>模糊查询:</span>
<Search
placeholder="请输入流程名称、方案名称"
onSearch={e => handleChange(e, 'text')}
style={{ width: '300px' }}
allowClear
/>
</Space>
<Button
type={'primary'}
icon={<PlusOutlined />}
onClick={() => {
mode.current = 'add';
setOpeneditor(true);
}}
>
新建自动化工单方案
</Button>
</div>
<div className={style.tableContent}>
<Table
columns={columns}
loading={loadding}
bordered
dataSource={dataSource}
scroll={{ x: 'max-content', y: 450 }}
pagination={false}
/>
<div className={style.footer}>
<Pagination
showTotal= {(total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`}
pageSizeOptions= {[10, 20, 50, 100]}
total= {total}
pageSize= {params.pageSize}
current= {params.pageIndex}
showQuickJumper= {true}
showSizeChanger= {true}
onChange= {(pageindex, pageSize)=> {
setParams({ ...params, pageIndex: pageindex, pageSize: pageSize })
console.log(pageindex, pageSize)
}}
>
</Pagination>
</div>
</div>
<CaseModify
visible={openEditor}
flowConfigDetail={flowConfigDetail.current}
mode={mode.current}
onClose={() => setOpeneditor(false)}
onOk={onSubmit}
/>
<ExcuteLog visible={showLog} id={showlogId.current} onClose={() => setShowLog(false)} />
<LookModal
visible={lookVisible}
onCancel={() => setLookVisible(false)}
planName={planName.current}
keepTableList={keepTableList}
/>
</div>
);
};
export default AutoCase;
.content{
height: 100%;
.header{
width: 100%;
height: 60px;
background-color: white;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0px 20px;
}
.tableContent{
width: 100%;
height: calc(100% - 70px);
background-color: white;
margin-top: 10px;
position: relative;
.footer{
position: absolute;
bottom: 10px;
right: 10px;
}
}
.linkFont{
color: #1890ff;
&:hover{
cursor: pointer;
}
&.danger{
color: red
}
}
}
\ No newline at end of file
...@@ -46,6 +46,7 @@ const AddModal = props => { ...@@ -46,6 +46,7 @@ const AddModal = props => {
const [isDayLoopShow, setIsDayLoopShow] = useState(false); const [isDayLoopShow, setIsDayLoopShow] = useState(false);
const [isWeekLoopShow, setIsWeekLoopShow] = useState(false); const [isWeekLoopShow, setIsWeekLoopShow] = useState(false);
const [waitCheck, setWaitCheck] = useState(false); const [waitCheck, setWaitCheck] = useState(false);
const [isPostRequest, setIsPostRequest] = useState(false);
const [isUse, setIsUse] = useState(false); const [isUse, setIsUse] = useState(false);
const [interval, setInterval] = useState(1); const [interval, setInterval] = useState(1);
const [loop_unit, setLoop_unit] = useState('Hour'); const [loop_unit, setLoop_unit] = useState('Hour');
...@@ -74,6 +75,7 @@ const AddModal = props => { ...@@ -74,6 +75,7 @@ const AddModal = props => {
is_enable: !record.Enabled, is_enable: !record.Enabled,
url_type: record.Absolute ? true : false, url_type: record.Absolute ? true : false,
url_path: record.Url, url_path: record.Url,
requestBody: record.requestBody,
request_header: record.CustomHeader, request_header: record.CustomHeader,
plan_type: record.LoopMode, plan_type: record.LoopMode,
start_time: record.StartFrom ? moment(record.StartFrom, dateFormat) : startTime, start_time: record.StartFrom ? moment(record.StartFrom, dateFormat) : startTime,
...@@ -106,6 +108,7 @@ const AddModal = props => { ...@@ -106,6 +108,7 @@ const AddModal = props => {
setInterval(record.Interval); setInterval(record.Interval);
setLoop_unit(record.LoopUnit); setLoop_unit(record.LoopUnit);
setWaitCheck(record.UseTimeout || false); setWaitCheck(record.UseTimeout || false);
setIsPostRequest(record.isPostRequest || false);
setTime_out((record.Timeout !== -1 && record.Timeout / 1000) || 30); setTime_out((record.Timeout !== -1 && record.Timeout / 1000) || 30);
if (record.Timeout !== -1) { if (record.Timeout !== -1) {
setWaitCheck(true); setWaitCheck(true);
...@@ -167,6 +170,7 @@ const AddModal = props => { ...@@ -167,6 +170,7 @@ const AddModal = props => {
} }
let data = { let data = {
Url: fv.url_path, Url: fv.url_path,
RequestBody: fv.requestBody,
CustomHeader: fv.request_header || '', CustomHeader: fv.request_header || '',
StartFrom: fv.start_time && fv.start_time.format(dateFormat), StartFrom: fv.start_time && fv.start_time.format(dateFormat),
EndAt: fv.end_time && fv.end_time.format(dateFormat), EndAt: fv.end_time && fv.end_time.format(dateFormat),
...@@ -188,6 +192,7 @@ const AddModal = props => { ...@@ -188,6 +192,7 @@ const AddModal = props => {
Name: fv.name, Name: fv.name,
Tolerate: null, Tolerate: null,
UseTimeout: waitCheck, UseTimeout: waitCheck,
IsPostRequest: isPostRequest
}; };
time_out ? (data.MillisecondsTimeout = parseInt(time_out)) : -1; time_out ? (data.MillisecondsTimeout = parseInt(time_out)) : -1;
if (!waitCheck) { if (!waitCheck) {
...@@ -329,6 +334,12 @@ const AddModal = props => { ...@@ -329,6 +334,12 @@ const AddModal = props => {
const onWait = e => { const onWait = e => {
setWaitCheck(e); setWaitCheck(e);
}; };
const onPost = e => {
setIsPostRequest(e);
};
const changeUnit = e => { const changeUnit = e => {
setLoop_unit(e); setLoop_unit(e);
}; };
...@@ -386,7 +397,17 @@ const AddModal = props => { ...@@ -386,7 +397,17 @@ const AddModal = props => {
<TextArea rows={3} placeholder="请输入URL名称" /> <TextArea rows={3} placeholder="请输入URL名称" />
</Item> </Item>
</Item> </Item>
<Item label="定义请求体" name="requestBody" style={{ marginBottom: '0' }}>
<TextArea rows={3} placeholder="请输入定义请求体" />
</Item>
<Item label="是否使用post" name="isPostRequest" style={{ marginRight: '0.5rem' }}>
<Switch
checkedChildren="是"
unCheckedChildren="否"
onChange={onPost}
checked={isPostRequest}
/>
</Item>
<Item label="请求头" name="request_header"> <Item label="请求头" name="request_header">
<Input placeholder="请求头,选填" /> <Input placeholder="请求头,选填" />
</Item> </Item>
......
...@@ -19,11 +19,12 @@ import { GetIISAgentSite, QueryIISAgentCalllog } from '@/services/scheduledTasks ...@@ -19,11 +19,12 @@ import { GetIISAgentSite, QueryIISAgentCalllog } from '@/services/scheduledTasks
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const LookModal = props => { const LookModal = props => {
const { visible, onCancel, keepTableList } = props; const { visible, onCancel, keepTableList, planName } = props;
const [form] = Form.useForm(null); const [form] = Form.useForm(null);
const [currentTime, setCurrentTime] = useState('昨天'); const [currentTime, setCurrentTime] = useState('昨天');
const [siteData, setSiteData] = useState([]); const [siteData, setSiteData] = useState([]);
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
const [selectValue, setSelectValue] = useState(null)
const tableList = useRef({ const tableList = useRef({
pageSize: 20, pageSize: 20,
pageIndex: 1, pageIndex: 1,
...@@ -43,6 +44,11 @@ const LookModal = props => { ...@@ -43,6 +44,11 @@ const LookModal = props => {
const fixedVariable = useRef(['昨天', '今天', '上周', '本周', '本月', '上月', '自定义']); const fixedVariable = useRef(['昨天', '今天', '上周', '本周', '本月', '上月', '自定义']);
useEffect(() => { useEffect(() => {
console.log(planName, 'wqeqweqwewq')
if(planName){
setSelectValue(planName)
tableList.current.jobName = planName
}
if (visible) { if (visible) {
getSiteList(); getSiteList();
getLogList(); getLogList();
...@@ -287,11 +293,13 @@ const LookModal = props => { ...@@ -287,11 +293,13 @@ const LookModal = props => {
}; };
const planChange = e => { const planChange = e => {
setSelectValue(e)
tableList.current.jobName = e; tableList.current.jobName = e;
getLogList(); getLogList();
}; };
const stateChange = e => { const stateChange = e => {
tableList.current.state = e; tableList.current.state = e;
getLogList(); getLogList();
}; };
...@@ -315,6 +323,7 @@ const LookModal = props => { ...@@ -315,6 +323,7 @@ const LookModal = props => {
))} ))}
</Radio.Group> </Radio.Group>
{currentTime === '自定义' ? <RangePicker showToday onChange={timeChange} /> : ''} {currentTime === '自定义' ? <RangePicker showToday onChange={timeChange} /> : ''}
{ !planName &&
<div className={styles.select}> <div className={styles.select}>
<span>站点名称:</span> <span>站点名称:</span>
<Select <Select
...@@ -325,12 +334,13 @@ const LookModal = props => { ...@@ -325,12 +334,13 @@ const LookModal = props => {
> >
{siteData && siteData.map(v => <Select.Option value={v}>{v}</Select.Option>)} {siteData && siteData.map(v => <Select.Option value={v}>{v}</Select.Option>)}
</Select> </Select>
</div> </div>}
<div className={styles.select}> <div className={styles.select}>
<span>计划名称:</span> <span>计划名称:</span>
<Select <Select
style={{ width: '155px' }} style={{ width: '155px' }}
allowClear allowClear
value={selectValue}
placeholder="请选择任务性质" placeholder="请选择任务性质"
onChange={e => planChange(e)} onChange={e => planChange(e)}
> >
......
...@@ -150,6 +150,7 @@ const IncidentView = asyncComponent(() => ...@@ -150,6 +150,7 @@ const IncidentView = asyncComponent(() =>
import('@/pages/bsmanager/workOrder/incident/incidentView'), import('@/pages/bsmanager/workOrder/incident/incidentView'),
); );
const Flow = asyncComponent(() => import('@/pages/bsmanager/workOrder/workFlow/flow')); const Flow = asyncComponent(() => import('@/pages/bsmanager/workOrder/workFlow/flow'));
const AutoCase = asyncComponent(() => import('@/pages/bsmanager/workOrder/autoCase'));
const FlowNode = asyncComponent(() => const FlowNode = asyncComponent(() =>
import('@/pages/bsmanager/workOrder/workFlow/flowNode/flowNode'), import('@/pages/bsmanager/workOrder/workFlow/flowNode/flowNode'),
); );
...@@ -373,6 +374,11 @@ export default { ...@@ -373,6 +374,11 @@ export default {
name: '流程审查', name: '流程审查',
component: Flow, component: Flow,
}, },
{
path: '/biz/workflow/autoCase',
name: '自动化工单',
component: AutoCase,
},
], ],
}, },
{ {
......
...@@ -122,3 +122,31 @@ export const UpdateFlowNodeOrder = query => get(`${PUBLISH_SERVICE}/WorkOrderCen ...@@ -122,3 +122,31 @@ export const UpdateFlowNodeOrder = query => get(`${PUBLISH_SERVICE}/WorkOrderCen
export const GetAllDeviceDetails = query => get(`${PANDAWORKFLOW}/DevicePatrol/GetAllDeviceDetails`, query); export const GetAllDeviceDetails = query => get(`${PANDAWORKFLOW}/DevicePatrol/GetAllDeviceDetails`, query);
//查询流程自动化方案分页数据
export const GetFlowAutoConfigPageData = query => get(`${PUBLISH_SERVICE}/WorkFlow/GetFlowAutoConfigPageData`, query);
//新增或者修改流程自动化方案
export const AddOrEditFlowAutoConfig = query => post(`${PUBLISH_SERVICE}/WorkFlow/AddOrEditFlowAutoConfig`, query);
//获取条件触发模式下流程节点
export const GetScheduledConfigFlowNode = query => get(`${PUBLISH_SERVICE}/WorkFlow/GetScheduledConfigFlowNode`, query);
//获取定时触发模式下流程节点
export const GetConditionConfigFlowNode = query => get(`${PUBLISH_SERVICE}/WorkFlow/GetConditionConfigFlowNode`, query);
//删除流程自动化方案
export const DeleteFlowAutoConfig = query => get(`${PUBLISH_SERVICE}/WorkFlow/DeleteFlowAutoConfig`, query);
//启用/禁用流程自动化方案
export const EnableDisableFlowAutoConfig = query => get(`${PUBLISH_SERVICE}/WorkFlow/EnableDisableFlowAutoConfig`, query);
//获取流程自动配置详情
export const GetFlowAutoConfigDetail = query => get(`${PUBLISH_SERVICE}/WorkFlow/GetFlowAutoConfigDetail`, query);
//获取流程自动化方案日志
export const GetFlowAutoSchemeLogs = query => get(`${PUBLISH_SERVICE}/WorkFlow/GetFlowAutoSchemeLogs`, 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