|
|
|
@ -3,61 +3,72 @@ |
|
|
|
@ 时间: 2024-03-11 14:46:00 |
|
|
|
@ 备注: 工作流 |
|
|
|
--> |
|
|
|
<script lang='ts' setup> |
|
|
|
import '@/styles/workflowcss/workflow.scss' |
|
|
|
<script lang="ts" setup> |
|
|
|
import "@/styles/workflowcss/workflow.scss"; |
|
|
|
|
|
|
|
import { useStore } from '@/store/workflow/index' |
|
|
|
import { flowversion } from '@/api/workflowapi/types' |
|
|
|
import { initializeWorkFlow,setWorkFlowData,gainFlowVersionList,saveFlowCont,gainFlowInfo,editFlowCont,saveNewFlow,switchFlowVersion,judgeFormFlowIsOpen,openFormFlow } from '@/api/workflowapi/index' |
|
|
|
import { useStore } from "@/store/workflow/index"; |
|
|
|
import { flowversion } from "@/api/workflowapi/types"; |
|
|
|
import { |
|
|
|
initializeWorkFlow, |
|
|
|
setWorkFlowData, |
|
|
|
gainFlowVersionList, |
|
|
|
saveFlowCont, |
|
|
|
gainFlowInfo, |
|
|
|
editFlowCont, |
|
|
|
saveNewFlow, |
|
|
|
switchFlowVersion, |
|
|
|
judgeFormFlowIsOpen, |
|
|
|
openFormFlow, |
|
|
|
} from "@/api/workflowapi/index"; |
|
|
|
|
|
|
|
import FlowImgSrc from '@/assets/images/3.png' |
|
|
|
import FlowImgSrc from "@/assets/images/3.png"; |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
formKey:{ |
|
|
|
type:String, |
|
|
|
default:"" |
|
|
|
formKey: { |
|
|
|
type: String, |
|
|
|
default: "", |
|
|
|
}, |
|
|
|
formVersion: { |
|
|
|
type: String, |
|
|
|
default: "", |
|
|
|
}, |
|
|
|
state: { |
|
|
|
type: Object, |
|
|
|
default() { |
|
|
|
return {}; |
|
|
|
}, |
|
|
|
formVersion:{ |
|
|
|
type:String, |
|
|
|
default:"" |
|
|
|
}, |
|
|
|
state:{ |
|
|
|
type:Object, |
|
|
|
default(){ |
|
|
|
return {} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
const emits = defineEmits<{ |
|
|
|
(e: 'update:state', val: formStruct): void |
|
|
|
(e: 'update:formKey', val: string): void |
|
|
|
(e: 'update:formVersion', val: string): void |
|
|
|
(e: 'judgeFlowIsEdit', val: boolean): void |
|
|
|
(e: 'runNextWindows', val: number): void |
|
|
|
(e: 'closeFormPage'): void |
|
|
|
}>() |
|
|
|
(e: "update:state", val: formStruct): void; |
|
|
|
(e: "update:formKey", val: string): void; |
|
|
|
(e: "update:formVersion", val: string): void; |
|
|
|
(e: "judgeFlowIsEdit", val: boolean): void; |
|
|
|
(e: "runNextWindows", val: number): void; |
|
|
|
(e: "closeFormPage"): void; |
|
|
|
}>(); |
|
|
|
|
|
|
|
const state = computed({ |
|
|
|
get() { |
|
|
|
return props.state |
|
|
|
return props.state; |
|
|
|
}, |
|
|
|
set(val: formStruct) { |
|
|
|
emits('update:state', val) |
|
|
|
} |
|
|
|
emits("update:state", val); |
|
|
|
}, |
|
|
|
}); |
|
|
|
const formKeyVal = computed({ |
|
|
|
get() { |
|
|
|
return props.formKey |
|
|
|
return props.formKey; |
|
|
|
}, |
|
|
|
set(val: formStruct) { |
|
|
|
emits('update:formKey', val) |
|
|
|
} |
|
|
|
emits("update:formKey", val); |
|
|
|
}, |
|
|
|
}); |
|
|
|
let { setTableId, setIsTried } = useStore() |
|
|
|
const flowIsTrue = ref(false) |
|
|
|
const isRead = ref(false) //判断操作功能按钮 |
|
|
|
const openOfClise = ref(false) //当前版本状态 |
|
|
|
let { setTableId, setIsTried } = useStore(); |
|
|
|
const flowIsTrue = ref(false); |
|
|
|
const isRead = ref(false); //判断操作功能按钮 |
|
|
|
const openOfClise = ref(false); //当前版本状态 |
|
|
|
const versionList = reactive<flowversion[]>([]); //工作流版本列表 |
|
|
|
const enableVersion = ref<string>("1"); //流程版本 |
|
|
|
const enableFlow = ref<any>(); |
|
|
|
@ -79,40 +90,40 @@ let oneIsTrue = true; |
|
|
|
@ 时间: 2024-03-11 16:33:49 |
|
|
|
@ 功能: 开启流程 |
|
|
|
*/ |
|
|
|
const createFormFlow = () =>{ |
|
|
|
if(formKeyVal.value == ""){ |
|
|
|
const createFormFlow = () => { |
|
|
|
if (formKeyVal.value == "") { |
|
|
|
flowIsTrue.value = false; |
|
|
|
ElMessageBox.alert('您还未设置表单!请先设置完表单后,在创建流程!','温馨提示!',{ |
|
|
|
confirmButtonText: '确定', |
|
|
|
ElMessageBox.alert("您还未设置表单!请先设置完表单后,在创建流程!", "温馨提示!", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
callback: (action: Action) => { |
|
|
|
emits("runNextWindows",1); |
|
|
|
emits("runNextWindows", 1); |
|
|
|
}, |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
openOrCloseFormFlow(1) |
|
|
|
getFlowVerList() |
|
|
|
flowIsTrue.value = true |
|
|
|
emits('judgeFlowIsEdit', true) |
|
|
|
}); |
|
|
|
} else { |
|
|
|
openOrCloseFormFlow(1); |
|
|
|
getFlowVerList(); |
|
|
|
flowIsTrue.value = true; |
|
|
|
emits("judgeFlowIsEdit", true); |
|
|
|
} |
|
|
|
emits('judgeFlowIsEdit', true) |
|
|
|
emits("judgeFlowIsEdit", true); |
|
|
|
// flowIsTrue.value = true |
|
|
|
} |
|
|
|
const openOrCloseFormFlow = (val:number) => { |
|
|
|
openFormFlow({id:formKeyVal.value.toString(),status:val}) |
|
|
|
} |
|
|
|
}; |
|
|
|
const openOrCloseFormFlow = (val: number) => { |
|
|
|
openFormFlow({ id: formKeyVal.value.toString(), status: val }); |
|
|
|
}; |
|
|
|
//初始化工作流数据 |
|
|
|
const initWorkFlowData = async() => { |
|
|
|
let { data } = await initializeWorkFlow({name:state.value.formData.form.formName}) |
|
|
|
const initWorkFlowData = async () => { |
|
|
|
let { data } = await initializeWorkFlow({ name: state.value.formData.form.formName }); |
|
|
|
// console.log("data-=------>",data) |
|
|
|
processConfig.value = data; |
|
|
|
let { |
|
|
|
nodeConfig:nodes, |
|
|
|
flowPermission:flowPermissiones, |
|
|
|
directorMaxLevel:levels, |
|
|
|
workFlowDef:workName, |
|
|
|
nodeConfig: nodes, |
|
|
|
flowPermission: flowPermissiones, |
|
|
|
directorMaxLevel: levels, |
|
|
|
workFlowDef: workName, |
|
|
|
tableId, |
|
|
|
} = data; |
|
|
|
processConfig.value.workFlowDef.formKey = formKeyVal.value |
|
|
|
processConfig.value.workFlowDef.formKey = formKeyVal.value; |
|
|
|
nodeConfig.value = nodes; |
|
|
|
flowPermission.value = flowPermissiones; |
|
|
|
directorMaxLeveling = levels; |
|
|
|
@ -125,9 +136,9 @@ const initWorkFlowData = async() => { |
|
|
|
// console.log("max--3->",nodeConfig) |
|
|
|
// console.log("max--4->",directorMaxLevel) |
|
|
|
// console.log("max--5->",processConfig) |
|
|
|
} |
|
|
|
}; |
|
|
|
//缩放画布 |
|
|
|
const zoomSize = (type:number) => { |
|
|
|
const zoomSize = (type: number) => { |
|
|
|
if (type == 1) { |
|
|
|
if (nowVal.value == 50) { |
|
|
|
return; |
|
|
|
@ -142,45 +153,42 @@ const zoomSize = (type:number) => { |
|
|
|
}; |
|
|
|
|
|
|
|
//获取工作流版本列表 |
|
|
|
const getFlowVerList = ()=>{ |
|
|
|
gainFlowVersionList({id:formKeyVal.value.toString()}) |
|
|
|
.then(({data})=>{ |
|
|
|
const getFlowVerList = () => { |
|
|
|
gainFlowVersionList({ id: formKeyVal.value.toString() }) |
|
|
|
.then(({ data }) => { |
|
|
|
// console.log("获取工作流版本列表-->",data) |
|
|
|
// versionList = data; |
|
|
|
versionList.splice(0,versionList.length) |
|
|
|
if(data){ |
|
|
|
if(data.length>0){ |
|
|
|
|
|
|
|
data.forEach((item:any)=>{ |
|
|
|
|
|
|
|
if(item.state == 1){ |
|
|
|
activeTabs.value = item.id |
|
|
|
enableFlow.value = item |
|
|
|
enableVersion.value = item.id |
|
|
|
versionList.splice(0, versionList.length); |
|
|
|
if (data) { |
|
|
|
if (data.length > 0) { |
|
|
|
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(versionList.length > 1){ |
|
|
|
closeOrOpenVersion.value = true |
|
|
|
}else{ |
|
|
|
closeOrOpenVersion.value = false |
|
|
|
id: item.id, |
|
|
|
key: item.key, |
|
|
|
state: item.state, |
|
|
|
version: item.version, |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (versionList.length > 1) { |
|
|
|
closeOrOpenVersion.value = true; |
|
|
|
} else { |
|
|
|
closeOrOpenVersion.value = false; |
|
|
|
} |
|
|
|
|
|
|
|
// console.log("获取工作流版本列表--1-1-->",enableFlow.value); |
|
|
|
if(enableFlow.value == "" || enableFlow.value == undefined){ |
|
|
|
enableFlow.value = versionList[0] |
|
|
|
if (enableFlow.value == "" || enableFlow.value == undefined) { |
|
|
|
enableFlow.value = versionList[0]; |
|
|
|
// activeTabs.value = versionList[0].id |
|
|
|
enableVersion.value = versionList[0].id |
|
|
|
enableVersion.value = versionList[0].id; |
|
|
|
} |
|
|
|
isRead.value = true |
|
|
|
}else{ |
|
|
|
isRead.value = false |
|
|
|
|
|
|
|
isRead.value = true; |
|
|
|
} else { |
|
|
|
isRead.value = false; |
|
|
|
} |
|
|
|
} |
|
|
|
// console.log("获取工作流版本列表---1-->",activeTabs.value); |
|
|
|
@ -188,35 +196,33 @@ const getFlowVerList = ()=>{ |
|
|
|
// console.log("获取工作流版本列表---3-->",enableVersion.value); |
|
|
|
// console.log("获取工作流版本列表---3-1->",versionList[0],versionList); |
|
|
|
}) |
|
|
|
.finally(()=>{ |
|
|
|
if(isRead.value == true){ |
|
|
|
.finally(() => { |
|
|
|
if (isRead.value == true) { |
|
|
|
gainFlowCont(); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
clearCanvas(1); |
|
|
|
} |
|
|
|
clickOpenOrClose(); |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
//判断当前工作流版本是否启用 |
|
|
|
const clickOpenOrClose = () => { |
|
|
|
// console.log("判断当前工作流版本是否启用",enableFlow,activeTabs.value) |
|
|
|
if(enableFlow.value.id==activeTabs.value){ |
|
|
|
openOfClise.value = true |
|
|
|
}else{ |
|
|
|
openOfClise.value = false |
|
|
|
if (enableFlow.value.id == activeTabs.value) { |
|
|
|
openOfClise.value = true; |
|
|
|
} else { |
|
|
|
openOfClise.value = false; |
|
|
|
} |
|
|
|
// console.log("openOfClise",openOfClise.value) |
|
|
|
// console.log("enableFlow.version=1=activeTabs",enableFlow.value,activeTabs.value) |
|
|
|
} |
|
|
|
}; |
|
|
|
//获取流程内容 |
|
|
|
const gainFlowCont = () =>{ |
|
|
|
gainFlowInfo({id:enableVersion.value.toString()}) |
|
|
|
.then((data:any)=>{ |
|
|
|
const gainFlowCont = () => { |
|
|
|
gainFlowInfo({ id: enableVersion.value.toString() }).then((data: any) => { |
|
|
|
// console.log("获取工作流版本列表-1->",data,enableFlow.value) |
|
|
|
if(data.code == 0){ |
|
|
|
if (data.code == 0) { |
|
|
|
processConfig.value = data.data; |
|
|
|
processConfig.value.workFlowDef.formKey = formKeyVal.value |
|
|
|
processConfig.value.workFlowDef.formKey = formKeyVal.value; |
|
|
|
nodeConfig.value = data.data.nodeConfig; |
|
|
|
flowPermission.value = data.data.flowPermission; |
|
|
|
directorMaxLeveling = data.data.directorMaxLevel; |
|
|
|
@ -229,31 +235,30 @@ const gainFlowCont = () =>{ |
|
|
|
// console.log("max--3->",nodeConfig) |
|
|
|
// console.log("max--4->",data.data.directorMaxLevel) |
|
|
|
// console.log("max--5->",processConfig.value) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
clearCanvas(1); |
|
|
|
} |
|
|
|
// initWorkFlowData(); |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
//清空画布 |
|
|
|
const clearCanvas = (isOk?:any) =>{ |
|
|
|
if(isOk==1){ |
|
|
|
initWorkFlowData() |
|
|
|
const clearCanvas = (isOk?: any) => { |
|
|
|
if (isOk == 1) { |
|
|
|
initWorkFlowData(); |
|
|
|
setIsTried(false); |
|
|
|
tipList.value = [] |
|
|
|
}else{ |
|
|
|
ElMessageBox.confirm('确定要清空画布?') |
|
|
|
.then(() => { |
|
|
|
initWorkFlowData() |
|
|
|
tipList.value = []; |
|
|
|
} else { |
|
|
|
ElMessageBox.confirm("确定要清空画布?").then(() => { |
|
|
|
initWorkFlowData(); |
|
|
|
setIsTried(false); |
|
|
|
tipList.value = [] |
|
|
|
}) |
|
|
|
tipList.value = []; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
enableFlow.value = "" |
|
|
|
} |
|
|
|
enableFlow.value = ""; |
|
|
|
}; |
|
|
|
//错误提示 |
|
|
|
const reErr = ({ childNode }:any) => { |
|
|
|
const reErr = ({ childNode }: any) => { |
|
|
|
if (childNode) { |
|
|
|
let { type, error, nodeName, conditionNodes } = childNode; |
|
|
|
if (type == 1 || type == 2 || type == 3) { |
|
|
|
@ -280,41 +285,40 @@ const reErr = ({ childNode }:any) => { |
|
|
|
} |
|
|
|
}; |
|
|
|
//选择工作流版本 |
|
|
|
const clickFormTable = (val:any) =>{ |
|
|
|
const clickFormTable = (val: any) => { |
|
|
|
// console.log("切换表单",val,activeTabs.value) |
|
|
|
enableVersion.value = val |
|
|
|
enableVersion.value = val; |
|
|
|
gainFlowCont(); |
|
|
|
clickOpenOrClose(); |
|
|
|
// getTableFieldList(versionIndex.value,val) |
|
|
|
} |
|
|
|
}; |
|
|
|
//流程版本启用禁用 |
|
|
|
const setupState = (val:number) =>{ |
|
|
|
const setupState = (val: number) => { |
|
|
|
let sendCont = { |
|
|
|
id:enableVersion.value.toString(), |
|
|
|
status:val |
|
|
|
} |
|
|
|
if(val == 1){ |
|
|
|
activeTabs.value = enableVersion.value |
|
|
|
id: enableVersion.value.toString(), |
|
|
|
status: val, |
|
|
|
}; |
|
|
|
if (val == 1) { |
|
|
|
activeTabs.value = enableVersion.value; |
|
|
|
} |
|
|
|
switchFlowVersion(sendCont) |
|
|
|
.then((data:any)=>{ |
|
|
|
.then((data: any) => { |
|
|
|
ElMessage.success(data.msg); |
|
|
|
// activeTabs.value = enableVersion.value |
|
|
|
// enableFlow.value.id = enableVersion.value |
|
|
|
if(versionList.length > 0){ |
|
|
|
versionList.forEach(item=>{ |
|
|
|
if(item.id == enableVersion.value){ |
|
|
|
enableFlow.value = item |
|
|
|
if (versionList.length > 0) { |
|
|
|
versionList.forEach((item) => { |
|
|
|
if (item.id == enableVersion.value) { |
|
|
|
enableFlow.value = item; |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
.finally(()=>{ |
|
|
|
.finally(() => { |
|
|
|
clickOpenOrClose(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
// console.log("enableFlow.version==activeTabs",enableFlow.version,activeTabs) |
|
|
|
} |
|
|
|
}; |
|
|
|
//发布新流程 |
|
|
|
const saveSet = async () => { |
|
|
|
setIsTried(true); |
|
|
|
@ -331,18 +335,18 @@ const saveSet = async () => { |
|
|
|
// console.log("flowPermission",flowPermission.value); |
|
|
|
// console.log("nodeConfig",nodeConfig.value); |
|
|
|
saveFlowCont(processConfig.value) |
|
|
|
.then((data:any) => { |
|
|
|
if(data.code == 0){ |
|
|
|
.then((data: any) => { |
|
|
|
if (data.code == 0) { |
|
|
|
ElMessage.success("设置成功"); |
|
|
|
emits('judgeFlowIsEdit', false) |
|
|
|
emits("runNextWindows",3); |
|
|
|
emits("judgeFlowIsEdit", false); |
|
|
|
emits("runNextWindows", 3); |
|
|
|
// clearCanvas(1); |
|
|
|
} |
|
|
|
}) |
|
|
|
.finally(()=>{ |
|
|
|
.finally(() => { |
|
|
|
// emits("chanerequest"); |
|
|
|
getFlowVerList() |
|
|
|
}) |
|
|
|
getFlowVerList(); |
|
|
|
}); |
|
|
|
// let res = await setWorkFlowData(processConfig.value); |
|
|
|
// if (res.code == 200) { |
|
|
|
// ElMessage.success("设置成功") |
|
|
|
@ -350,10 +354,9 @@ const saveSet = async () => { |
|
|
|
// window.location.href = ""; |
|
|
|
// }, 200); |
|
|
|
// } |
|
|
|
|
|
|
|
}; |
|
|
|
//编辑当前版本流程 |
|
|
|
const saveEdit =()=>{ |
|
|
|
const saveEdit = () => { |
|
|
|
setIsTried(true); |
|
|
|
tipList.value = []; |
|
|
|
|
|
|
|
@ -364,28 +367,28 @@ const saveEdit =()=>{ |
|
|
|
} |
|
|
|
processConfig.value.flowPermission = flowPermission.value; |
|
|
|
// eslint-disable-next-line no-console |
|
|
|
// console.log("processConfig",flowPermission); |
|
|
|
console.log("processConfig------------------->", processConfig.value); |
|
|
|
// console.log("flowPermission",flowPermission.value); |
|
|
|
// console.log("activeTabs",enableFlow.value); |
|
|
|
let sendCont = { |
|
|
|
id:enableVersion.value.toString(), |
|
|
|
flowinfo:processConfig.value |
|
|
|
} |
|
|
|
id: enableVersion.value.toString(), |
|
|
|
flowinfo: processConfig.value, |
|
|
|
}; |
|
|
|
editFlowCont(sendCont) |
|
|
|
.then((data:any) => { |
|
|
|
if(data.code == 0){ |
|
|
|
.then((data: any) => { |
|
|
|
if (data.code == 0) { |
|
|
|
ElMessage.success("设置成功"); |
|
|
|
// emits("update:openDrawer", false); |
|
|
|
// clearCanvas(1); |
|
|
|
emits('judgeFlowIsEdit', false) |
|
|
|
emits("runNextWindows",3); |
|
|
|
emits("judgeFlowIsEdit", false); |
|
|
|
emits("runNextWindows", 3); |
|
|
|
} |
|
|
|
}) |
|
|
|
.finally(()=>{ |
|
|
|
.finally(() => { |
|
|
|
// emits("chanerequest"); |
|
|
|
getFlowVerList() |
|
|
|
}) |
|
|
|
} |
|
|
|
getFlowVerList(); |
|
|
|
}); |
|
|
|
}; |
|
|
|
//另存为新版 |
|
|
|
const saveNew = () => { |
|
|
|
setIsTried(true); |
|
|
|
@ -402,34 +405,36 @@ const saveNew = () => { |
|
|
|
// console.log("flowPermission",flowPermission.value); |
|
|
|
// console.log("activeTabs",enableFlow.value); |
|
|
|
let sendCont = { |
|
|
|
id:enableVersion.value.toString(), |
|
|
|
flowinfo:processConfig.value |
|
|
|
} |
|
|
|
id: enableVersion.value.toString(), |
|
|
|
flowinfo: processConfig.value, |
|
|
|
}; |
|
|
|
saveNewFlow(sendCont) |
|
|
|
.then((data:any) => { |
|
|
|
if(data.code == 0){ |
|
|
|
.then((data: any) => { |
|
|
|
if (data.code == 0) { |
|
|
|
ElMessage.success("设置成功"); |
|
|
|
emits('judgeFlowIsEdit', false) |
|
|
|
emits("runNextWindows",3); |
|
|
|
emits("judgeFlowIsEdit", false); |
|
|
|
emits("runNextWindows", 3); |
|
|
|
} |
|
|
|
}) |
|
|
|
.finally(()=>{ |
|
|
|
getFlowVerList() |
|
|
|
}) |
|
|
|
} |
|
|
|
watch(()=>nodeConfig,()=>{ |
|
|
|
.finally(() => { |
|
|
|
getFlowVerList(); |
|
|
|
}); |
|
|
|
}; |
|
|
|
watch( |
|
|
|
() => nodeConfig, |
|
|
|
() => { |
|
|
|
// console.log("变动流程") |
|
|
|
if(oneIsTrue){ |
|
|
|
if (oneIsTrue) { |
|
|
|
oneIsTrue = false; |
|
|
|
emits('judgeFlowIsEdit', false) |
|
|
|
}else{ |
|
|
|
emits('judgeFlowIsEdit', true) |
|
|
|
emits("judgeFlowIsEdit", false); |
|
|
|
} else { |
|
|
|
emits("judgeFlowIsEdit", true); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
deep: true |
|
|
|
}) |
|
|
|
}, |
|
|
|
{ |
|
|
|
deep: true, |
|
|
|
} |
|
|
|
); |
|
|
|
/** |
|
|
|
@ 作者: 秦东 |
|
|
|
@ 时间: 2024-03-12 15:49:35 |
|
|
|
@ -437,32 +442,31 @@ watch(()=>nodeConfig,()=>{ |
|
|
|
*/ |
|
|
|
const closwFormFlow = () => { |
|
|
|
flowIsTrue.value = false; |
|
|
|
emits('judgeFlowIsEdit', false) |
|
|
|
openOrCloseFormFlow(2) |
|
|
|
} |
|
|
|
onMounted(()=>{ |
|
|
|
emits("judgeFlowIsEdit", false); |
|
|
|
openOrCloseFormFlow(2); |
|
|
|
}; |
|
|
|
onMounted(() => { |
|
|
|
// console.log("判断是否已经存在工作流以及是否开启",formKeyVal.value) |
|
|
|
if(formKeyVal.value == ""){ |
|
|
|
if (formKeyVal.value == "") { |
|
|
|
flowIsTrue.value = false; |
|
|
|
}else{ |
|
|
|
judgeFormFlowIsOpen({id:formKeyVal.value.toString()}) |
|
|
|
.then((data)=>{ |
|
|
|
} else { |
|
|
|
judgeFormFlowIsOpen({ id: formKeyVal.value.toString() }).then((data) => { |
|
|
|
// console.log("判断是否已经存在工作流以及是否开启",data) |
|
|
|
if(data.data.isOpen == 1){ |
|
|
|
if (data.data.isOpen == 1) { |
|
|
|
flowIsTrue.value = true; |
|
|
|
emits('judgeFlowIsEdit', false) |
|
|
|
getFlowVerList() |
|
|
|
}else{ |
|
|
|
emits("judgeFlowIsEdit", false); |
|
|
|
getFlowVerList(); |
|
|
|
} else { |
|
|
|
flowIsTrue.value = false; |
|
|
|
emits('judgeFlowIsEdit', false) |
|
|
|
emits("judgeFlowIsEdit", false); |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
</script> |
|
|
|
<template> |
|
|
|
<div class="design_flow_work"> |
|
|
|
<el-row v-if="flowIsTrue" style="height: 100%;"> |
|
|
|
<el-row v-if="flowIsTrue" style="height: 100%"> |
|
|
|
<el-col :span="24"> |
|
|
|
<table class="table_box"> |
|
|
|
<tr> |
|
|
|
@ -473,19 +477,30 @@ onMounted(()=>{ |
|
|
|
<el-tab-pane v-for="item in versionList" :key="item.id" :name="item.id"> |
|
|
|
<template #label> |
|
|
|
<el-icon><Share /></el-icon> |
|
|
|
<span class="my-label">V{{item.version}}</span> |
|
|
|
<span class="my-label">V{{ item.version }}</span> |
|
|
|
</template> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="but_box"> |
|
|
|
<el-button v-if="isRead && !openOfClise && closeOrOpenVersion" type="success" size="small" plain @click="setupState(1)"> |
|
|
|
<el-button |
|
|
|
v-if="isRead && !openOfClise && closeOrOpenVersion" |
|
|
|
type="success" |
|
|
|
size="small" |
|
|
|
plain |
|
|
|
@click="setupState(1)" |
|
|
|
> |
|
|
|
<el-icon class="el-icon--left"><Delete /></el-icon> |
|
|
|
启用 |
|
|
|
</el-button> |
|
|
|
<el-button v-if="isRead && openOfClise && closeOrOpenVersion" type="warning" size="small" plain @click="setupState(2)"> |
|
|
|
<el-button |
|
|
|
v-if="isRead && openOfClise && closeOrOpenVersion" |
|
|
|
type="warning" |
|
|
|
size="small" |
|
|
|
plain |
|
|
|
@click="setupState(2)" |
|
|
|
> |
|
|
|
<el-icon class="el-icon--left"><Delete /></el-icon> |
|
|
|
禁用 |
|
|
|
</el-button> |
|
|
|
@ -498,7 +513,7 @@ onMounted(()=>{ |
|
|
|
发布 |
|
|
|
</el-button> |
|
|
|
<el-button v-if="isRead" size="small" plain @click="saveEdit"> |
|
|
|
<el-icon class="fa fa-save" style="margin-right:5px"></el-icon> |
|
|
|
<el-icon class="fa fa-save" style="margin-right: 5px"></el-icon> |
|
|
|
保存 |
|
|
|
</el-button> |
|
|
|
<el-button v-if="isRead" type="warning" size="small" @click="saveNew"> |
|
|
|
@ -515,16 +530,25 @@ onMounted(()=>{ |
|
|
|
</table> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
|
|
|
|
|
|
|
|
<section class="dingflow-design" style="top:40px"> |
|
|
|
<section class="dingflow-design" style="top: 40px"> |
|
|
|
<div class="zoom"> |
|
|
|
<div class="zoom-out" :class="nowVal == 50 && 'disabled'" @click="zoomSize(1)"></div> |
|
|
|
<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 |
|
|
|
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="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">流程结束2</div> |
|
|
|
@ -532,8 +556,19 @@ onMounted(()=>{ |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
<errorDialog v-model:visible="tipVisible" :list="tipList" /> |
|
|
|
<promoterDrawer v-model:form-data="state.formData" :form-key="formKeyVal" :form-version="formVersion" /> |
|
|
|
<approverDrawer :directormaxlevel="directorMaxLeveling" :node-config="nodeConfig" :is-form-flow="isFormFlow" :customer-form-key="formKeyVal" v-model:form-data="state.formData" :form-version="formVersion" /> |
|
|
|
<promoterDrawer |
|
|
|
v-model:form-data="state.formData" |
|
|
|
:form-key="formKeyVal" |
|
|
|
:form-version="formVersion" |
|
|
|
/> |
|
|
|
<approverDrawer |
|
|
|
:directormaxlevel="directorMaxLeveling" |
|
|
|
:node-config="nodeConfig" |
|
|
|
:is-form-flow="isFormFlow" |
|
|
|
:customer-form-key="formKeyVal" |
|
|
|
v-model:form-data="state.formData" |
|
|
|
:form-version="formVersion" |
|
|
|
/> |
|
|
|
<copyerDrawer /> |
|
|
|
<conditionDrawer :is-form-flow="isFormFlow" :customer-form-key="formKeyVal" /> |
|
|
|
</el-col> |
|
|
|
@ -541,33 +576,29 @@ onMounted(()=>{ |
|
|
|
<div v-else class="flow_work_begin"> |
|
|
|
<el-result title="" sub-title=""> |
|
|
|
<template #icon> |
|
|
|
流程可实现需要多人流转的业务场景。<br>绘制流程图,设定数据流转方式,即可搭建线上工作流。<br><br> |
|
|
|
<el-image |
|
|
|
class="imgBox" |
|
|
|
:src="FlowImgSrc" |
|
|
|
/> |
|
|
|
流程可实现需要多人流转的业务场景。<br />绘制流程图,设定数据流转方式,即可搭建线上工作流。<br /><br /> |
|
|
|
<el-image class="imgBox" :src="FlowImgSrc" /> |
|
|
|
</template> |
|
|
|
<template #extra> |
|
|
|
<el-button type="primary" @click="createFormFlow">开启流程</el-button> |
|
|
|
</template> |
|
|
|
</el-result> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<style lang='scss' scoped> |
|
|
|
.design_flow_work{ |
|
|
|
<style lang="scss" scoped> |
|
|
|
.design_flow_work { |
|
|
|
height: calc(100vh - 40px); |
|
|
|
width: inherit; |
|
|
|
overflow: hidden; |
|
|
|
overflow-y: auto; |
|
|
|
} |
|
|
|
.flow_work_begin{ |
|
|
|
.flow_work_begin { |
|
|
|
height: calc(100vh - 40px); |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
.imgBox{ |
|
|
|
.imgBox { |
|
|
|
height: calc(100vh - 400px); |
|
|
|
// height: 10%; |
|
|
|
} |
|
|
|
@ -577,37 +608,37 @@ onMounted(()=>{ |
|
|
|
position: static !important; |
|
|
|
/* background-color: #fff; */ |
|
|
|
} |
|
|
|
::v-deep .el-tabs__item{ |
|
|
|
padding:0 10px; |
|
|
|
::v-deep .el-tabs__item { |
|
|
|
padding: 0 10px; |
|
|
|
} |
|
|
|
.version_but{ |
|
|
|
.version_but { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
} |
|
|
|
.tabs_box{ |
|
|
|
.tabs_box { |
|
|
|
max-width: 60%; |
|
|
|
min-width:30% |
|
|
|
min-width: 30%; |
|
|
|
} |
|
|
|
.but_box{ |
|
|
|
.but_box { |
|
|
|
max-width: 50%; |
|
|
|
min-width: 40%; |
|
|
|
overflow: hidden; |
|
|
|
overflow-x: auto; |
|
|
|
padding:5px 10px 5px 0; |
|
|
|
padding: 5px 10px 5px 0; |
|
|
|
text-align: right; |
|
|
|
} |
|
|
|
|
|
|
|
.table_box{ |
|
|
|
.table_box { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
.table_td_title{ |
|
|
|
.table_td_title { |
|
|
|
width: 60px; |
|
|
|
text-align: right; |
|
|
|
align-items: center; |
|
|
|
vertical-align: middle; |
|
|
|
} |
|
|
|
.table_td_info{ |
|
|
|
.table_td_info { |
|
|
|
display: flex; |
|
|
|
// width: calc(100% - 100px); |
|
|
|
align-items: center; |
|
|
|
@ -615,26 +646,24 @@ onMounted(()=>{ |
|
|
|
} |
|
|
|
</style> |
|
|
|
<style> |
|
|
|
.canvas_body{ |
|
|
|
.canvas_body { |
|
|
|
height: 100%; |
|
|
|
width: inherit; |
|
|
|
} |
|
|
|
.flow_version{ |
|
|
|
|
|
|
|
.flow_version { |
|
|
|
} |
|
|
|
.flow_version > .el-tabs__content{ |
|
|
|
.flow_version > .el-tabs__content { |
|
|
|
padding: 0px; |
|
|
|
height:0px; |
|
|
|
height: 0px; |
|
|
|
} |
|
|
|
.flow_version > .el-tabs__header{ |
|
|
|
margin:0px; |
|
|
|
.flow_version > .el-tabs__header { |
|
|
|
margin: 0px; |
|
|
|
} |
|
|
|
.flow_version .custom-tabs-label span { |
|
|
|
padding:0 10px; |
|
|
|
padding: 0 10px; |
|
|
|
} |
|
|
|
|
|
|
|
.right_kongx{ |
|
|
|
margin-right:50px |
|
|
|
|
|
|
|
.right_kongx { |
|
|
|
margin-right: 50px; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|