|
|
@ -3,14 +3,22 @@ |
|
|
@ 时间: 2023-10-18 09:02:53 |
|
|
@ 时间: 2023-10-18 09:02:53 |
|
|
@ 备注: 工作流画板 |
|
|
@ 备注: 工作流画板 |
|
|
--> |
|
|
--> |
|
|
<script lang='ts' setup> |
|
|
<script lang="ts" setup> |
|
|
import '@/styles/workflowcss/workflow.scss' |
|
|
import "@/styles/workflowcss/workflow.scss"; |
|
|
|
|
|
|
|
|
import { useStore } from '@/store/workflow/index' |
|
|
import { useStore } from "@/store/workflow/index"; |
|
|
import { flowversion } from '@/api/workflowapi/types' |
|
|
import { flowversion } from "@/api/workflowapi/types"; |
|
|
|
|
|
|
|
|
import { initializeWorkFlow,setWorkFlowData,gainFlowVersionList,saveFlowCont,gainFlowInfo,editFlowCont,saveNewFlow,switchFlowVersion } from '@/api/workflowapi/index' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
initializeWorkFlow, |
|
|
|
|
|
setWorkFlowData, |
|
|
|
|
|
gainFlowVersionList, |
|
|
|
|
|
saveFlowCont, |
|
|
|
|
|
gainFlowInfo, |
|
|
|
|
|
editFlowCont, |
|
|
|
|
|
saveNewFlow, |
|
|
|
|
|
switchFlowVersion, |
|
|
|
|
|
} from "@/api/workflowapi/index"; |
|
|
|
|
|
|
|
|
//引入页面 |
|
|
//引入页面 |
|
|
import errorDialog from "@/components/workflow/dialog/errorDialog.vue"; |
|
|
import errorDialog from "@/components/workflow/dialog/errorDialog.vue"; |
|
|
@ -20,196 +28,190 @@ import copyerDrawer from "@/components/workflow/drwer/copyerDrawer.vue"; |
|
|
import conditionDrawer from "@/components/workflow/drwer/conditionDrawer.vue"; |
|
|
import conditionDrawer from "@/components/workflow/drwer/conditionDrawer.vue"; |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
openDrawer:{ |
|
|
openDrawer: { |
|
|
type:Boolean, |
|
|
type: Boolean, |
|
|
default:true |
|
|
default: true, |
|
|
}, |
|
|
}, |
|
|
drawerWidht:{ |
|
|
drawerWidht: { |
|
|
type:Number, |
|
|
type: Number, |
|
|
default:100 |
|
|
default: 100, |
|
|
}, |
|
|
}, |
|
|
isFormFlow:{ |
|
|
isFormFlow: { |
|
|
type:Boolean, |
|
|
type: Boolean, |
|
|
default:true |
|
|
default: true, |
|
|
}, |
|
|
}, |
|
|
customerFormKey:{ |
|
|
customerFormKey: { |
|
|
type:String, |
|
|
type: String, |
|
|
default:"" |
|
|
default: "", |
|
|
}, |
|
|
}, |
|
|
customerFormName:{ |
|
|
customerFormName: { |
|
|
type:String, |
|
|
type: String, |
|
|
default:"" |
|
|
default: "", |
|
|
}, |
|
|
}, |
|
|
flowKey:{ |
|
|
flowKey: { |
|
|
type:String, |
|
|
type: String, |
|
|
default:"" |
|
|
default: "", |
|
|
} |
|
|
}, |
|
|
}) |
|
|
}); |
|
|
const emits = defineEmits(["update:openDrawer","chanerequest"]); |
|
|
const emits = defineEmits(["update:openDrawer", "chanerequest"]); |
|
|
const isShow = computed({ |
|
|
const isShow = computed({ |
|
|
get: () => props.openDrawer, |
|
|
get: () => props.openDrawer, |
|
|
set: (val) => { |
|
|
set: (val) => { |
|
|
emits("update:openDrawer", val); |
|
|
emits("update:openDrawer", val); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
let { setTableId, setIsTried } = useStore() |
|
|
let { setTableId, setIsTried } = useStore(); |
|
|
|
|
|
|
|
|
let tipList = ref<any>([]); |
|
|
let tipList = ref<any>([]); |
|
|
let tipVisible = ref(false); |
|
|
let tipVisible = ref(false); |
|
|
let nowVal = ref(100); //缩放比例 |
|
|
let nowVal = ref(100); //缩放比例 |
|
|
let processConfig = ref<any>({}); |
|
|
let processConfig = ref<any>({}); |
|
|
let nodeConfig = ref({}); |
|
|
let nodeConfig = ref({}); |
|
|
let workFlowDef = ref({}); |
|
|
let workFlowDef = ref({}); |
|
|
let flowPermission = ref([]); |
|
|
let flowPermission = ref([]); |
|
|
let directorMaxLeveling = ref<number>(0); |
|
|
let directorMaxLeveling = ref<number>(0); |
|
|
const shenPiTitle = ref<string>("") |
|
|
const shenPiTitle = ref<string>(""); |
|
|
const activeTabs = ref<string>(""); //当前版本 |
|
|
const activeTabs = ref<string>(""); //当前版本 |
|
|
|
|
|
|
|
|
const versionList = reactive<flowversion[]>([]); //工作流版本列表 |
|
|
const versionList = reactive<flowversion[]>([]); //工作流版本列表 |
|
|
const enableFlow = ref<any>(); |
|
|
const enableFlow = ref<any>(); |
|
|
const isRead = ref(false) |
|
|
const isRead = ref(false); |
|
|
const enableVersion = ref<string>("1"); |
|
|
const enableVersion = ref<string>("1"); |
|
|
//获取工作流版本列表 |
|
|
//获取工作流版本列表 |
|
|
const getFlowVerList = ()=>{ |
|
|
const getFlowVerList = () => { |
|
|
gainFlowVersionList({id:props.customerFormKey.toString()}) |
|
|
gainFlowVersionList({ id: props.customerFormKey.toString() }) |
|
|
.then(({data})=>{ |
|
|
.then(({ data }) => { |
|
|
// console.log("获取工作流版本列表-->",data) |
|
|
// console.log("获取工作流版本列表-->",data) |
|
|
// versionList = data; |
|
|
// versionList = data; |
|
|
versionList.splice(0,versionList.length) |
|
|
versionList.splice(0, versionList.length); |
|
|
if(data){ |
|
|
if (data) { |
|
|
if(data.length>0){ |
|
|
if (data.length > 0) { |
|
|
|
|
|
data.forEach((item: any) => { |
|
|
data.forEach((item:any)=>{ |
|
|
if (item.state == 1) { |
|
|
|
|
|
activeTabs.value = item.id; |
|
|
|
|
|
enableFlow.value = item; |
|
|
|
|
|
enableVersion.value = item.id; |
|
|
|
|
|
} |
|
|
|
|
|
versionList.push({ |
|
|
|
|
|
id: item.id, |
|
|
|
|
|
key: item.key, |
|
|
|
|
|
state: item.state, |
|
|
|
|
|
version: item.version, |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
if(item.state == 1){ |
|
|
isRead.value = true; |
|
|
activeTabs.value = item.id |
|
|
} else { |
|
|
enableFlow.value = item |
|
|
isRead.value = false; |
|
|
enableVersion.value = item.id |
|
|
} |
|
|
} |
|
|
} |
|
|
versionList.push({ |
|
|
// console.log("获取工作流版本列表---1-->",activeTabs.value); |
|
|
id:item.id, |
|
|
// console.log("获取工作流版本列表---2-->",enableFlow.value); |
|
|
key:item.key, |
|
|
// console.log("获取工作流版本列表---3-->",enableVersion.value); |
|
|
state:item.state, |
|
|
}) |
|
|
version:item.version |
|
|
.finally(() => { |
|
|
}) |
|
|
if (isRead.value == true) { |
|
|
}) |
|
|
gainFlowCont(); |
|
|
|
|
|
} else { |
|
|
isRead.value = true |
|
|
clearCanvas(1); |
|
|
}else{ |
|
|
} |
|
|
isRead.value = false |
|
|
clickOpenOrClose(); |
|
|
|
|
|
}); |
|
|
} |
|
|
}; |
|
|
} |
|
|
|
|
|
// console.log("获取工作流版本列表---1-->",activeTabs.value); |
|
|
|
|
|
// console.log("获取工作流版本列表---2-->",enableFlow.value); |
|
|
|
|
|
// console.log("获取工作流版本列表---3-->",enableVersion.value); |
|
|
|
|
|
}) |
|
|
|
|
|
.finally(()=>{ |
|
|
|
|
|
if(isRead.value == true){ |
|
|
|
|
|
gainFlowCont(); |
|
|
|
|
|
}else{ |
|
|
|
|
|
clearCanvas(1); |
|
|
|
|
|
} |
|
|
|
|
|
clickOpenOrClose(); |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//首次加载页面 |
|
|
//首次加载页面 |
|
|
onMounted(async ()=>{ |
|
|
onMounted(async () => { |
|
|
// getFlowVerList() |
|
|
// getFlowVerList() |
|
|
}) |
|
|
}); |
|
|
//初始化工作流数据 |
|
|
//初始化工作流数据 |
|
|
const initWorkFlowData = async() => { |
|
|
const initWorkFlowData = async () => { |
|
|
let { data } = await initializeWorkFlow({name:props.customerFormName}) |
|
|
let { data } = await initializeWorkFlow({ name: props.customerFormName }); |
|
|
// console.log("data-=------>",data) |
|
|
console.log("data-=------>", data); |
|
|
processConfig.value = data; |
|
|
processConfig.value = data; |
|
|
let { |
|
|
let { |
|
|
nodeConfig:nodes, |
|
|
nodeConfig: nodes, |
|
|
flowPermission:flowPermissiones, |
|
|
flowPermission: flowPermissiones, |
|
|
directorMaxLevel:levels, |
|
|
directorMaxLevel: levels, |
|
|
workFlowDef:workName, |
|
|
workFlowDef: workName, |
|
|
tableId, |
|
|
tableId, |
|
|
} = data; |
|
|
} = data; |
|
|
processConfig.value.workFlowDef.formKey = props.customerFormKey |
|
|
processConfig.value.workFlowDef.formKey = props.customerFormKey; |
|
|
nodeConfig.value = nodes; |
|
|
nodeConfig.value = nodes; |
|
|
flowPermission.value = flowPermissiones; |
|
|
flowPermission.value = flowPermissiones; |
|
|
directorMaxLeveling = levels; |
|
|
directorMaxLeveling = levels; |
|
|
workFlowDef.value = workName; |
|
|
workFlowDef.value = workName; |
|
|
setTableId(tableId); |
|
|
setTableId(tableId); |
|
|
// console.log("max--1->",data) |
|
|
// console.log("max--1->",data) |
|
|
// console.log("max--6->",tableId) |
|
|
// console.log("max--6->",tableId) |
|
|
// console.log("max--2->",flowPermission) |
|
|
// console.log("max--2->",flowPermission) |
|
|
// console.log("max--3->",nodeConfig) |
|
|
// console.log("max--3->",nodeConfig) |
|
|
// console.log("max--4->",directorMaxLevel) |
|
|
// console.log("max--4->",directorMaxLevel) |
|
|
// console.log("max--5->",processConfig) |
|
|
// console.log("max--5->",processConfig) |
|
|
} |
|
|
}; |
|
|
//错误提示 |
|
|
//错误提示 |
|
|
const reErr = ({ childNode }:any) => { |
|
|
const reErr = ({ childNode }: any) => { |
|
|
if (childNode) { |
|
|
if (childNode) { |
|
|
let { type, error, nodeName, conditionNodes } = childNode; |
|
|
let { type, error, nodeName, conditionNodes } = childNode; |
|
|
if (type == 1 || type == 2 || type == 3) { |
|
|
if (type == 1 || type == 2 || type == 3) { |
|
|
if (error) { |
|
|
if (error) { |
|
|
tipList.value.push({ |
|
|
tipList.value.push({ |
|
|
name: nodeName, |
|
|
name: nodeName, |
|
|
type: ["", "审核人", "抄送人", "执行人"][type], |
|
|
type: ["", "审核人", "抄送人", "执行人"][type], |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
reErr(childNode); |
|
|
reErr(childNode); |
|
|
} else if (type == 4) { |
|
|
} else if (type == 4) { |
|
|
reErr(childNode); |
|
|
reErr(childNode); |
|
|
} else if (type == 5) { |
|
|
} else if (type == 5) { |
|
|
reErr(childNode); |
|
|
reErr(childNode); |
|
|
for (var i = 0; i < conditionNodes.length; i++) { |
|
|
for (var i = 0; i < conditionNodes.length; i++) { |
|
|
if (conditionNodes[i].error) { |
|
|
if (conditionNodes[i].error) { |
|
|
tipList.value.push({ name: conditionNodes[i].nodeName, type: "条件" }); |
|
|
tipList.value.push({ name: conditionNodes[i].nodeName, type: "条件" }); |
|
|
} |
|
|
} |
|
|
reErr(conditionNodes[i]); |
|
|
reErr(conditionNodes[i]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
childNode = null; |
|
|
childNode = null; |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
//保存 |
|
|
//保存 |
|
|
const saveSet = async () => { |
|
|
const saveSet = async () => { |
|
|
setIsTried(true); |
|
|
setIsTried(true); |
|
|
tipList.value = []; |
|
|
tipList.value = []; |
|
|
|
|
|
|
|
|
reErr(nodeConfig.value); |
|
|
reErr(nodeConfig.value); |
|
|
if (tipList.value.length != 0) { |
|
|
if (tipList.value.length != 0) { |
|
|
tipVisible.value = true; |
|
|
tipVisible.value = true; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
processConfig.value.flowPermission = flowPermission.value; |
|
|
processConfig.value.flowPermission = flowPermission.value; |
|
|
// eslint-disable-next-line no-console |
|
|
// eslint-disable-next-line no-console |
|
|
// console.log("processConfig",processConfig.value); |
|
|
console.log("processConfig", processConfig.value); |
|
|
// console.log("flowPermission",flowPermission.value); |
|
|
// console.log("flowPermission",flowPermission.value); |
|
|
// console.log("nodeConfig",nodeConfig.value); |
|
|
// console.log("nodeConfig", nodeConfig.value); |
|
|
saveFlowCont(processConfig.value) |
|
|
saveFlowCont(processConfig.value) |
|
|
.then((data:any) => { |
|
|
.then((data: any) => { |
|
|
if(data.code == 0){ |
|
|
if (data.code == 0) { |
|
|
ElMessage.success("设置成功"); |
|
|
ElMessage.success("设置成功"); |
|
|
emits("update:openDrawer", false); |
|
|
emits("update:openDrawer", false); |
|
|
clearCanvas(1); |
|
|
clearCanvas(1); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.finally(()=>{ |
|
|
.finally(() => { |
|
|
emits("chanerequest"); |
|
|
emits("chanerequest"); |
|
|
|
|
|
}); |
|
|
}) |
|
|
// let res = await setWorkFlowData(processConfig.value); |
|
|
// let res = await setWorkFlowData(processConfig.value); |
|
|
// if (res.code == 200) { |
|
|
// if (res.code == 200) { |
|
|
// ElMessage.success("设置成功") |
|
|
// ElMessage.success("设置成功") |
|
|
// setTimeout(function () { |
|
|
// setTimeout(function () { |
|
|
// window.location.href = ""; |
|
|
// window.location.href = ""; |
|
|
// }, 200); |
|
|
// }, 200); |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
//缩放画布 |
|
|
//缩放画布 |
|
|
const zoomSize = (type:number) => { |
|
|
const zoomSize = (type: number) => { |
|
|
if (type == 1) { |
|
|
if (type == 1) { |
|
|
if (nowVal.value == 50) { |
|
|
if (nowVal.value == 50) { |
|
|
return; |
|
|
return; |
|
|
@ -223,267 +225,301 @@ const zoomSize = (type:number) => { |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
//清空画布 |
|
|
//清空画布 |
|
|
const clearCanvas = (isOk?:any) =>{ |
|
|
const clearCanvas = (isOk?: any) => { |
|
|
if(isOk==1){ |
|
|
if (isOk == 1) { |
|
|
initWorkFlowData() |
|
|
initWorkFlowData(); |
|
|
setIsTried(false); |
|
|
setIsTried(false); |
|
|
tipList.value = [] |
|
|
tipList.value = []; |
|
|
}else{ |
|
|
} else { |
|
|
ElMessageBox.confirm('确定要清空画布?') |
|
|
ElMessageBox.confirm("确定要清空画布?").then(() => { |
|
|
.then(() => { |
|
|
initWorkFlowData(); |
|
|
initWorkFlowData() |
|
|
setIsTried(false); |
|
|
setIsTried(false); |
|
|
tipList.value = []; |
|
|
tipList.value = [] |
|
|
}); |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
enableFlow.value = ""; |
|
|
enableFlow.value = "" |
|
|
}; |
|
|
} |
|
|
watch( |
|
|
watch(()=>props.openDrawer,(val)=>{ |
|
|
() => props.openDrawer, |
|
|
// console.log("1111",props.customerFormKey,val) |
|
|
(val) => { |
|
|
if(val){ |
|
|
// console.log("1111",props.customerFormKey,val) |
|
|
if(props.customerFormKey != ""){ |
|
|
if (val) { |
|
|
getFlowVerList() |
|
|
if (props.customerFormKey != "") { |
|
|
}else{ |
|
|
getFlowVerList(); |
|
|
initWorkFlowData() |
|
|
} else { |
|
|
} |
|
|
initWorkFlowData(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
shenPiTitle.value = props.customerFormName |
|
|
shenPiTitle.value = props.customerFormName; |
|
|
}else{ |
|
|
} else { |
|
|
setIsTried(false); |
|
|
setIsTried(false); |
|
|
tipList.value = [] |
|
|
tipList.value = []; |
|
|
enableFlow.value = "" |
|
|
enableFlow.value = ""; |
|
|
isRead.value=false |
|
|
isRead.value = false; |
|
|
} |
|
|
} |
|
|
}) |
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
//选择工作流版本 |
|
|
//选择工作流版本 |
|
|
const clickFormTable = (val:any) =>{ |
|
|
const clickFormTable = (val: any) => { |
|
|
// console.log("切换表单",val,activeTabs.value) |
|
|
// console.log("切换表单",val,activeTabs.value) |
|
|
enableVersion.value = val |
|
|
enableVersion.value = val; |
|
|
gainFlowCont(); |
|
|
gainFlowCont(); |
|
|
clickOpenOrClose(); |
|
|
clickOpenOrClose(); |
|
|
// getTableFieldList(versionIndex.value,val) |
|
|
// getTableFieldList(versionIndex.value,val) |
|
|
} |
|
|
}; |
|
|
//编辑 |
|
|
//编辑 |
|
|
const saveEdit =()=>{ |
|
|
const saveEdit = () => { |
|
|
setIsTried(true); |
|
|
setIsTried(true); |
|
|
tipList.value = []; |
|
|
tipList.value = []; |
|
|
|
|
|
|
|
|
reErr(nodeConfig.value); |
|
|
reErr(nodeConfig.value); |
|
|
if (tipList.value.length != 0) { |
|
|
if (tipList.value.length != 0) { |
|
|
tipVisible.value = true; |
|
|
tipVisible.value = true; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
processConfig.value.flowPermission = flowPermission.value; |
|
|
processConfig.value.flowPermission = flowPermission.value; |
|
|
// eslint-disable-next-line no-console |
|
|
// eslint-disable-next-line no-console |
|
|
// console.log("processConfig",flowPermission); |
|
|
console.log("processConfig", processConfig.value); |
|
|
// console.log("flowPermission",flowPermission.value); |
|
|
// console.log("flowPermission",flowPermission.value); |
|
|
// console.log("activeTabs",enableFlow.value); |
|
|
// console.log("activeTabs",enableFlow.value); |
|
|
let sendCont = { |
|
|
let sendCont = { |
|
|
id:enableVersion.value.toString(), |
|
|
id: enableVersion.value.toString(), |
|
|
flowinfo:processConfig.value |
|
|
flowinfo: processConfig.value, |
|
|
} |
|
|
}; |
|
|
editFlowCont(sendCont) |
|
|
editFlowCont(sendCont) |
|
|
.then((data:any) => { |
|
|
.then((data: any) => { |
|
|
if(data.code == 0){ |
|
|
if (data.code == 0) { |
|
|
ElMessage.success("设置成功"); |
|
|
ElMessage.success("设置成功"); |
|
|
emits("update:openDrawer", false); |
|
|
emits("update:openDrawer", false); |
|
|
clearCanvas(1); |
|
|
clearCanvas(1); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.finally(()=>{ |
|
|
.finally(() => { |
|
|
emits("chanerequest"); |
|
|
emits("chanerequest"); |
|
|
|
|
|
}); |
|
|
}) |
|
|
}; |
|
|
} |
|
|
|
|
|
//另存为新版 |
|
|
//另存为新版 |
|
|
const saveNew = () => { |
|
|
const saveNew = () => { |
|
|
setIsTried(true); |
|
|
setIsTried(true); |
|
|
tipList.value = []; |
|
|
tipList.value = []; |
|
|
|
|
|
|
|
|
reErr(nodeConfig.value); |
|
|
reErr(nodeConfig.value); |
|
|
if (tipList.value.length != 0) { |
|
|
if (tipList.value.length != 0) { |
|
|
tipVisible.value = true; |
|
|
tipVisible.value = true; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
processConfig.value.flowPermission = flowPermission.value; |
|
|
processConfig.value.flowPermission = flowPermission.value; |
|
|
// eslint-disable-next-line no-console |
|
|
// eslint-disable-next-line no-console |
|
|
// console.log("processConfig",flowPermission); |
|
|
// console.log("processConfig",flowPermission); |
|
|
// console.log("flowPermission",flowPermission.value); |
|
|
// console.log("flowPermission",flowPermission.value); |
|
|
// console.log("activeTabs",enableFlow.value); |
|
|
// console.log("activeTabs",enableFlow.value); |
|
|
let sendCont = { |
|
|
let sendCont = { |
|
|
id:enableVersion.value.toString(), |
|
|
id: enableVersion.value.toString(), |
|
|
flowinfo:processConfig.value |
|
|
flowinfo: processConfig.value, |
|
|
} |
|
|
}; |
|
|
saveNewFlow(sendCont) |
|
|
saveNewFlow(sendCont) |
|
|
.then((data:any) => { |
|
|
.then((data: any) => { |
|
|
if(data.code == 0){ |
|
|
if (data.code == 0) { |
|
|
ElMessage.success("设置成功"); |
|
|
ElMessage.success("设置成功"); |
|
|
emits("update:openDrawer", false); |
|
|
emits("update:openDrawer", false); |
|
|
clearCanvas(1); |
|
|
clearCanvas(1); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.finally(()=>{ |
|
|
.finally(() => { |
|
|
emits("chanerequest"); |
|
|
emits("chanerequest"); |
|
|
|
|
|
}); |
|
|
}) |
|
|
}; |
|
|
} |
|
|
|
|
|
//获取流程内容 |
|
|
//获取流程内容 |
|
|
const gainFlowCont = () =>{ |
|
|
const gainFlowCont = () => { |
|
|
gainFlowInfo({id:enableVersion.value.toString()}) |
|
|
gainFlowInfo({ id: enableVersion.value.toString() }).then((data: any) => { |
|
|
.then((data:any)=>{ |
|
|
console.log("获取工作流版本列表-1->", data, enableFlow.value); |
|
|
// console.log("获取工作流版本列表-1->",data,enableFlow.value) |
|
|
if (data.code == 0) { |
|
|
if(data.code == 0){ |
|
|
processConfig.value = data.data; |
|
|
processConfig.value = data.data; |
|
|
processConfig.value.workFlowDef.formKey = props.customerFormKey; |
|
|
processConfig.value.workFlowDef.formKey = props.customerFormKey |
|
|
nodeConfig.value = data.data.nodeConfig; |
|
|
nodeConfig.value = data.data.nodeConfig; |
|
|
flowPermission.value = data.data.flowPermission; |
|
|
flowPermission.value = data.data.flowPermission; |
|
|
directorMaxLeveling = data.data.directorMaxLevel; |
|
|
directorMaxLeveling = data.data.directorMaxLevel; |
|
|
workFlowDef.value = data.data.workFlowDef; |
|
|
workFlowDef.value = data.data.workFlowDef; |
|
|
setTableId(data.data.tableId); |
|
|
setTableId(data.data.tableId); |
|
|
// console.log("max--1->",data) |
|
|
// console.log("max--1->",data) |
|
|
// console.log("max--6->",data.data.tableId) |
|
|
// console.log("max--6->",data.data.tableId) |
|
|
// console.log("max--2->",data.data.flowPermission) |
|
|
// console.log("max--2->",data.data.flowPermission) |
|
|
// console.log("max--3->",nodeConfig) |
|
|
// console.log("max--3->",nodeConfig) |
|
|
// console.log("max--4->",data.data.directorMaxLevel) |
|
|
// console.log("max--4->",data.data.directorMaxLevel) |
|
|
// console.log("max--5->",processConfig.value) |
|
|
// console.log("max--5->",processConfig.value) |
|
|
} else { |
|
|
}else{ |
|
|
clearCanvas(1); |
|
|
clearCanvas(1); |
|
|
} |
|
|
} |
|
|
// initWorkFlowData(); |
|
|
// initWorkFlowData(); |
|
|
}); |
|
|
}) |
|
|
}; |
|
|
} |
|
|
|
|
|
//启用禁用 |
|
|
//启用禁用 |
|
|
const setupState = (val:number) =>{ |
|
|
const setupState = (val: number) => { |
|
|
let sendCont = { |
|
|
let sendCont = { |
|
|
id:enableVersion.value.toString(), |
|
|
id: enableVersion.value.toString(), |
|
|
status:val |
|
|
status: val, |
|
|
} |
|
|
}; |
|
|
switchFlowVersion(sendCont) |
|
|
switchFlowVersion(sendCont) |
|
|
.then((data:any)=>{ |
|
|
.then((data: any) => { |
|
|
ElMessage.success(data.msg); |
|
|
ElMessage.success(data.msg); |
|
|
// activeTabs.value = enableVersion.value |
|
|
// activeTabs.value = enableVersion.value |
|
|
// enableFlow.value.id = enableVersion.value |
|
|
// enableFlow.value.id = enableVersion.value |
|
|
if(versionList.length > 0){ |
|
|
if (versionList.length > 0) { |
|
|
versionList.forEach(item=>{ |
|
|
versionList.forEach((item) => { |
|
|
if(item.id == enableVersion.value){ |
|
|
if (item.id == enableVersion.value) { |
|
|
enableFlow.value = item |
|
|
enableFlow.value = item; |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
}) |
|
|
.finally(() => { |
|
|
.finally(()=>{ |
|
|
clickOpenOrClose(); |
|
|
clickOpenOrClose(); |
|
|
}); |
|
|
}) |
|
|
// console.log("enableFlow.version==activeTabs",enableFlow.version,activeTabs) |
|
|
// console.log("enableFlow.version==activeTabs",enableFlow.version,activeTabs) |
|
|
}; |
|
|
} |
|
|
const openOfClise = ref(false); |
|
|
const openOfClise = ref(false) |
|
|
|
|
|
const clickOpenOrClose = () => { |
|
|
const clickOpenOrClose = () => { |
|
|
if(enableFlow.value.id==activeTabs.value){ |
|
|
if (enableFlow.value.id == activeTabs.value) { |
|
|
openOfClise.value = true |
|
|
openOfClise.value = true; |
|
|
}else{ |
|
|
} else { |
|
|
openOfClise.value = false |
|
|
openOfClise.value = false; |
|
|
} |
|
|
} |
|
|
// console.log("openOfClise",openOfClise.value) |
|
|
// console.log("openOfClise",openOfClise.value) |
|
|
// console.log("enableFlow.version=1=activeTabs",enableFlow.value,activeTabs.value) |
|
|
// console.log("enableFlow.version=1=activeTabs",enableFlow.value,activeTabs.value) |
|
|
} |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
<template> |
|
|
<template> |
|
|
<el-drawer v-model="isShow" :size="props.drawerWidht" :show-close="false"> |
|
|
<el-drawer v-model="isShow" :size="props.drawerWidht" :show-close="false"> |
|
|
<template #header="{ close, titleId, titleClass }"> |
|
|
<template #header="{ close, titleId, titleClass }"> |
|
|
<div style="display: flex; width:50%"> |
|
|
<div style="display: flex; width: 50%"> |
|
|
<div class="right_kongx"><h4 :id="titleId" :class="titleClass">《{{ shenPiTitle }}》审批流程</h4></div> |
|
|
<div class="right_kongx"> |
|
|
|
|
|
<h4 :id="titleId" :class="titleClass">《{{ shenPiTitle }}》审批流程</h4> |
|
|
</div> |
|
|
</div> |
|
|
<el-button type="warning" @click="clearCanvas"> |
|
|
</div> |
|
|
<el-icon class="el-icon--left"><Delete /></el-icon> |
|
|
<el-button type="warning" @click="clearCanvas"> |
|
|
清空 |
|
|
<el-icon class="el-icon--left"><Delete /></el-icon> |
|
|
</el-button> |
|
|
清空 |
|
|
<el-button v-if="!isRead" type="primary" @click="saveSet"> |
|
|
</el-button> |
|
|
<el-icon class="el-icon--left"><Promotion /></el-icon> |
|
|
<el-button v-if="!isRead" type="primary" @click="saveSet"> |
|
|
发布 |
|
|
<el-icon class="el-icon--left"><Promotion /></el-icon> |
|
|
</el-button> |
|
|
发布 |
|
|
<el-button v-if="isRead" type="primary" @click="saveEdit"> |
|
|
</el-button> |
|
|
<el-icon class="fa fa-save" style="margin-right:5px"></el-icon> |
|
|
<el-button v-if="isRead" type="primary" @click="saveEdit"> |
|
|
保存 |
|
|
<el-icon class="fa fa-save" style="margin-right: 5px"></el-icon> |
|
|
</el-button> |
|
|
保存 |
|
|
<el-button v-if="isRead" color="#626aef" @click="saveNew"> |
|
|
</el-button> |
|
|
<el-icon class="el-icon--left"><Share /></el-icon> |
|
|
<el-button v-if="isRead" color="#626aef" @click="saveNew"> |
|
|
另存为新版 |
|
|
<el-icon class="el-icon--left"><Share /></el-icon> |
|
|
</el-button> |
|
|
另存为新版 |
|
|
<el-button type="danger" @click="close"> |
|
|
</el-button> |
|
|
<el-icon class="el-icon--left"><CircleCloseFilled /></el-icon> |
|
|
<el-button type="danger" @click="close"> |
|
|
关闭 |
|
|
<el-icon class="el-icon--left"><CircleCloseFilled /></el-icon> |
|
|
</el-button> |
|
|
关闭 |
|
|
</template> |
|
|
</el-button> |
|
|
|
|
|
</template> |
|
|
<div class="canvas_body"> |
|
|
|
|
|
<el-row v-if="isRead" :gutter="20"> |
|
|
<div class="canvas_body"> |
|
|
<el-col :span="22"> |
|
|
<el-row v-if="isRead" :gutter="20"> |
|
|
<el-tabs v-model="activeTabs" class="flow_version" @tab-change="clickFormTable"> |
|
|
<el-col :span="22"> |
|
|
<el-tab-pane v-for="item in versionList" :key="item.id" :label="item.version" :name="item.id"> |
|
|
<el-tabs v-model="activeTabs" class="flow_version" @tab-change="clickFormTable"> |
|
|
<template #label> |
|
|
<el-tab-pane |
|
|
<span class="custom-tabs-label"> |
|
|
v-for="item in versionList" |
|
|
<span>V{{ item.version }}</span> |
|
|
:key="item.id" |
|
|
</span> |
|
|
:label="item.version" |
|
|
</template> |
|
|
:name="item.id" |
|
|
</el-tab-pane> |
|
|
> |
|
|
</el-tabs> |
|
|
<template #label> |
|
|
</el-col> |
|
|
<span class="custom-tabs-label"> |
|
|
<el-col :span="1" style="text-align: center; display: flex; margin: auto;"> |
|
|
<span>V{{ item.version }}</span> |
|
|
<el-button v-if="openOfClise" type="danger" size="small" round @click="setupState(2)">禁用</el-button> |
|
|
</span> |
|
|
<el-button v-if="!openOfClise" type="success" size="small" round @click="setupState(1)">启用</el-button> |
|
|
</template> |
|
|
</el-col> |
|
|
</el-tab-pane> |
|
|
</el-row> |
|
|
</el-tabs> |
|
|
<div class="fd-nav-content-new"> |
|
|
</el-col> |
|
|
<!--画板--> |
|
|
<el-col :span="1" style="text-align: center; display: flex; margin: auto"> |
|
|
<section class="dingflow-design"> |
|
|
<el-button |
|
|
<div class="zoom"> |
|
|
v-if="openOfClise" |
|
|
<div class="zoom-out" :class="nowVal == 50 && 'disabled'" @click="zoomSize(1)"></div> |
|
|
type="danger" |
|
|
<span>{{ nowVal }}%</span> |
|
|
size="small" |
|
|
<div class="zoom-in" :class="nowVal == 300 && 'disabled'" @click="zoomSize(2)"></div> |
|
|
round |
|
|
</div> |
|
|
@click="setupState(2)" |
|
|
<div class="box-scale" :style="`transform: scale(${ nowVal / 100});`"> |
|
|
>禁用</el-button |
|
|
<nodeWrap v-model:nodeConfig="nodeConfig" v-model:flowPermission="flowPermission" /> |
|
|
> |
|
|
<div class="end-node"> |
|
|
<el-button |
|
|
<div class="end-node-circle"></div> |
|
|
v-if="!openOfClise" |
|
|
<div class="end-node-text">4</div> |
|
|
type="success" |
|
|
</div> |
|
|
size="small" |
|
|
</div> |
|
|
round |
|
|
</section> |
|
|
@click="setupState(1)" |
|
|
</div> |
|
|
>启用</el-button |
|
|
<errorDialog v-model:visible="tipVisible" :list="tipList" /> |
|
|
> |
|
|
<promoterDrawer /> |
|
|
</el-col> |
|
|
<approverDrawer :directormaxlevel="directorMaxLeveling" :node-config="nodeConfig" :is-form-flow="props.isFormFlow" :customer-form-key="props.customerFormKey" /> |
|
|
</el-row> |
|
|
<copyerDrawer /> |
|
|
<div class="fd-nav-content-new"> |
|
|
<conditionDrawer :is-form-flow="props.isFormFlow" :customer-form-key="props.customerFormKey" /> |
|
|
<!--画板--> |
|
|
</div> |
|
|
<section class="dingflow-design"> |
|
|
</el-drawer> |
|
|
<div class="zoom"> |
|
|
|
|
|
<div |
|
|
|
|
|
class="zoom-out" |
|
|
|
|
|
:class="nowVal == 50 && 'disabled'" |
|
|
|
|
|
@click="zoomSize(1)" |
|
|
|
|
|
></div> |
|
|
|
|
|
<span>{{ nowVal }}%</span> |
|
|
|
|
|
<div |
|
|
|
|
|
class="zoom-in" |
|
|
|
|
|
:class="nowVal == 300 && 'disabled'" |
|
|
|
|
|
@click="zoomSize(2)" |
|
|
|
|
|
></div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="box-scale" :style="`transform: scale(${nowVal / 100});`"> |
|
|
|
|
|
<nodeWrap |
|
|
|
|
|
v-model:nodeConfig="nodeConfig" |
|
|
|
|
|
v-model:flowPermission="flowPermission" |
|
|
|
|
|
/> |
|
|
|
|
|
<div class="end-node"> |
|
|
|
|
|
<div class="end-node-circle"></div> |
|
|
|
|
|
<div class="end-node-text">4</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</section> |
|
|
|
|
|
</div> |
|
|
|
|
|
<errorDialog v-model:visible="tipVisible" :list="tipList" /> |
|
|
|
|
|
<promoterDrawer /> |
|
|
|
|
|
<approverDrawer |
|
|
|
|
|
:directormaxlevel="directorMaxLeveling" |
|
|
|
|
|
:node-config="nodeConfig" |
|
|
|
|
|
:is-form-flow="props.isFormFlow" |
|
|
|
|
|
:customer-form-key="props.customerFormKey" |
|
|
|
|
|
/> |
|
|
|
|
|
<copyerDrawer /> |
|
|
|
|
|
<conditionDrawer |
|
|
|
|
|
:is-form-flow="props.isFormFlow" |
|
|
|
|
|
:customer-form-key="props.customerFormKey" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-drawer> |
|
|
</template> |
|
|
</template> |
|
|
<style> |
|
|
<style> |
|
|
.canvas_body{ |
|
|
.canvas_body { |
|
|
height: 100%; |
|
|
height: 100%; |
|
|
width: inherit; |
|
|
width: inherit; |
|
|
} |
|
|
} |
|
|
.flow_version{ |
|
|
.flow_version { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
.flow_version > .el-tabs__content{ |
|
|
.flow_version > .el-tabs__content { |
|
|
padding: 0px; |
|
|
padding: 0px; |
|
|
height:0px; |
|
|
height: 0px; |
|
|
} |
|
|
} |
|
|
.flow_version > .el-tabs__header{ |
|
|
.flow_version > .el-tabs__header { |
|
|
margin:0px; |
|
|
margin: 0px; |
|
|
} |
|
|
} |
|
|
.flow_version .custom-tabs-label span { |
|
|
.flow_version .custom-tabs-label span { |
|
|
padding:0 10px; |
|
|
padding: 0 10px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.right_kongx{ |
|
|
.right_kongx { |
|
|
margin-right:50px |
|
|
margin-right: 50px; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
|