Commit 3af890d3 authored by 彭俊龙's avatar 彭俊龙

feat:自动化工单测试优化

parent 9c3f424f
Pipeline #96680 canceled with stages
...@@ -36,7 +36,7 @@ import imgStart from '@/assets/images/workFlow/nodeStart.png'; ...@@ -36,7 +36,7 @@ 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 { isObject } from 'lodash';
import { FormRender } from 'panda-xform'; // import { FormRender } from 'panda-xform';
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 = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
...@@ -183,7 +183,7 @@ const CaseModify = props => { ...@@ -183,7 +183,7 @@ const CaseModify = props => {
{ {
let res; let res;
if (TriggerMethod === '定时触发') { if (TriggerMethod === '定时触发') {
setShowForm(ScheduledConfig.Values.length > 0);
getBizMetaData(detail); getBizMetaData(detail);
res = await GetConditionConfigFlowNode({ flowId: FlowId }); res = await GetConditionConfigFlowNode({ flowId: FlowId });
} else { } else {
...@@ -381,6 +381,7 @@ const CaseModify = props => { ...@@ -381,6 +381,7 @@ const CaseModify = props => {
}; };
const getBizMetaData = async detail => { const getBizMetaData = async detail => {
if (!flowCenterData.length) return; if (!flowCenterData.length) return;
const { const {
ID, ID,
...@@ -397,13 +398,14 @@ const CaseModify = props => { ...@@ -397,13 +398,14 @@ const CaseModify = props => {
ConditionConfig, ConditionConfig,
} = detail; } = detail;
let paramObj = flowCenterData.find(v => v.flowName === FlowName && v.eventName === EventName); let paramObj = flowCenterData.find(v => v.flowName === FlowName && v.eventName === EventName);
console.log(paramObj, EventName,FlowName, 'paramObjparamObj')
if (paramObj) { if (paramObj) {
paramObj = { paramObj = {
...paramObj, ...paramObj,
userId: 1, userId: 1,
}; };
const vals = ScheduledConfig.Values const vals = ScheduledConfig.Values
setShowForm(vals.length > 0);
const { code, data, msg } = await GetBizMetaData(paramObj); const { code, data, msg } = await GetBizMetaData(paramObj);
const { formJson, values } = data[0]; const { formJson, values } = data[0];
const jsonObj = JSON.parse(formJson) const jsonObj = JSON.parse(formJson)
...@@ -421,6 +423,9 @@ const CaseModify = props => { ...@@ -421,6 +423,9 @@ const CaseModify = props => {
formJsonRef.current = jsonObj formJsonRef.current = jsonObj
setSchemaValues({ values: formValues, formJson: jsonObj }); setSchemaValues({ values: formValues, formJson: jsonObj });
}else{
formJsonRef.current = null
setSchemaValues({ values: [], formJson: {} });
} }
}; };
...@@ -836,6 +841,7 @@ const CaseModify = props => { ...@@ -836,6 +841,7 @@ const CaseModify = props => {
setNodeNames(nodeNames); setNodeNames(nodeNames);
if (configInfo.triggerType == '定时触发') { if (configInfo.triggerType == '定时触发') {
const d = flowData.current.find(v=> v.SubFlowId == flowId); const d = flowData.current.find(v=> v.SubFlowId == flowId);
console.log(flowData.current, d, 'wwwwww')
if(d){ if(d){
const { FlowName, EventName } = d const { FlowName, EventName } = d
getBizMetaData({ getBizMetaData({
...@@ -1626,21 +1632,9 @@ const CaseModify = props => { ...@@ -1626,21 +1632,9 @@ const CaseModify = props => {
} }
const onOpen = ()=>{ const onOpen = ()=>{
//前段已保存的表单数据 if(Object.keys(schemaValues.formJson).length === 0){
// const vals = postData.current.scheduledConfig.values; message.warn('未获取到表单配置')
// if(vals.length > 0){ }
// const formvals = schemaValues.values(v=> {
// const val = vals.find(x=> x.fieldName === v.fieldName)
// if(val){
// return {
// ...v,
// fieldValue: val.fieldValue
// }
// }
// return v
// })
// setSchemaValues({ ...schemaValues, values: formvals })
// }
setFormVisible(true) setFormVisible(true)
} }
...@@ -1811,7 +1805,7 @@ const CaseModify = props => { ...@@ -1811,7 +1805,7 @@ const CaseModify = props => {
<Input <Input
placeholder="请输入规则名称" placeholder="请输入规则名称"
onChange={e => saveRuleInfo(e, 'ruleName', v.id)} onChange={e => saveRuleInfo(e, 'ruleName', v.id)}
value={v.ruleName} value={v.ruleName}
style={{ flex: '1' }} style={{ flex: '1' }}
/> />
</div> </div>
...@@ -2048,7 +2042,7 @@ const CaseModify = props => { ...@@ -2048,7 +2042,7 @@ const CaseModify = props => {
onOk={onOK} onOk={onOK}
destroyOnClose destroyOnClose
> >
<FormRender schemaValues={schemaValues} ref={formRef} /> {/* <FormRender schemaValues={schemaValues} ref={formRef} /> */}
</Modal> </Modal>
<RuleConfig <RuleConfig
RuleContent={ruleContent.current} RuleContent={ruleContent.current}
......
...@@ -191,7 +191,7 @@ const AutoCase = props => { ...@@ -191,7 +191,7 @@ const AutoCase = props => {
const getFlowCenterData = async () => { const getFlowCenterData = async () => {
const { code, data, msg } = await GetFlowCenterData({ const { code, data, msg } = await GetFlowCenterData({
userID: 1, //userID: 1,
systemType: '业务系统', systemType: '业务系统',
isFilterOrderMode: 0, isFilterOrderMode: 0,
isInternal: 0 isInternal: 0
......
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