|
|
@ -3,74 +3,85 @@ |
|
|
@ 时间: 2024-05-07 15:07:51 |
|
|
@ 时间: 2024-05-07 15:07:51 |
|
|
@ 备注: 表单流程 |
|
|
@ 备注: 表单流程 |
|
|
--> |
|
|
--> |
|
|
<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,judgeFormFlowIsOpen,openFormFlow } from '@/api/workflowapi/index' |
|
|
import { |
|
|
import FlowImgSrc from '@/assets/images/3.png' |
|
|
initializeWorkFlow, |
|
|
|
|
|
setWorkFlowData, |
|
|
|
|
|
gainFlowVersionList, |
|
|
|
|
|
saveFlowCont, |
|
|
|
|
|
gainFlowInfo, |
|
|
|
|
|
editFlowCont, |
|
|
|
|
|
saveNewFlow, |
|
|
|
|
|
switchFlowVersion, |
|
|
|
|
|
judgeFormFlowIsOpen, |
|
|
|
|
|
openFormFlow, |
|
|
|
|
|
} from "@/api/workflowapi/index"; |
|
|
|
|
|
import FlowImgSrc from "@/assets/images/3.png"; |
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
appCont:{ |
|
|
appCont: { |
|
|
type:Object, |
|
|
type: Object, |
|
|
default(){ |
|
|
default() { |
|
|
return {} |
|
|
return {}; |
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
formKey:{ |
|
|
|
|
|
type:String, |
|
|
|
|
|
default:"" |
|
|
|
|
|
}, |
|
|
}, |
|
|
groupKey:{ |
|
|
formKey: { |
|
|
type:String, |
|
|
type: String, |
|
|
default:"" |
|
|
default: "", |
|
|
}, |
|
|
}, |
|
|
menuId:{ |
|
|
groupKey: { |
|
|
type:String, |
|
|
type: String, |
|
|
default:"" |
|
|
default: "", |
|
|
}, |
|
|
}, |
|
|
appPageKey:{ |
|
|
menuId: { |
|
|
type:String, |
|
|
type: String, |
|
|
default:"" |
|
|
default: "", |
|
|
|
|
|
}, |
|
|
|
|
|
appPageKey: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: "", |
|
|
|
|
|
}, |
|
|
|
|
|
formVersion: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: "", |
|
|
|
|
|
}, |
|
|
|
|
|
state: { |
|
|
|
|
|
type: Object, |
|
|
|
|
|
default() { |
|
|
|
|
|
return {}; |
|
|
}, |
|
|
}, |
|
|
formVersion:{ |
|
|
|
|
|
type:String, |
|
|
|
|
|
default:"" |
|
|
|
|
|
}, |
|
|
}, |
|
|
state:{ |
|
|
|
|
|
type:Object, |
|
|
|
|
|
default(){ |
|
|
|
|
|
return {} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}); |
|
|
const emits = defineEmits<{ |
|
|
const emits = defineEmits<{ |
|
|
(e: 'update:state', val: formStruct): void |
|
|
(e: "update:state", val: formStruct): void; |
|
|
(e: 'update:formKey', val: string): void |
|
|
(e: "update:formKey", val: string): void; |
|
|
(e: 'update:appPageKey', val: string): void |
|
|
(e: "update:appPageKey", val: string): void; |
|
|
// (e: 'judgeFlowIsEdit', val: boolean): void |
|
|
// (e: 'judgeFlowIsEdit', val: boolean): void |
|
|
// (e: 'runNextWindows', val: number): void |
|
|
// (e: 'runNextWindows', val: number): void |
|
|
// (e: 'closeFormPage'): void |
|
|
// (e: 'closeFormPage'): void |
|
|
}>() |
|
|
}>(); |
|
|
const state = computed({ |
|
|
const state = computed({ |
|
|
get() { |
|
|
get() { |
|
|
return props.state |
|
|
return props.state; |
|
|
}, |
|
|
}, |
|
|
set(val: formStruct) { |
|
|
set(val: formStruct) { |
|
|
emits('update:state', val) |
|
|
emits("update:state", val); |
|
|
} |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
const appPageKey = computed({ |
|
|
const appPageKey = computed({ |
|
|
get() { |
|
|
get() { |
|
|
return props.appPageKey |
|
|
return props.appPageKey; |
|
|
}, |
|
|
}, |
|
|
set(val: formStruct) { |
|
|
set(val: formStruct) { |
|
|
emits('update:appPageKey', val) |
|
|
emits("update:appPageKey", val); |
|
|
} |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
let { setTableId, setIsTried } = useStore() |
|
|
let { setTableId, setIsTried } = useStore(); |
|
|
const openOfClise = ref(false) //当前版本状态 |
|
|
const openOfClise = ref(false); //当前版本状态 |
|
|
const flowIsTrue = ref(false) //判断流程是否使用 |
|
|
const flowIsTrue = ref(false); //判断流程是否使用 |
|
|
const isRead = ref(false) //判断操作功能按钮 |
|
|
const isRead = ref(false); //判断操作功能按钮 |
|
|
const activeTabs = ref<string>(""); //当前工作流版本 |
|
|
const activeTabs = ref<string>(""); //当前工作流版本 |
|
|
const versionList = reactive<flowversion[]>([]); //工作流版本列表 |
|
|
const versionList = reactive<flowversion[]>([]); //工作流版本列表 |
|
|
const nowVal = ref(100); //缩放比例 |
|
|
const nowVal = ref(100); //缩放比例 |
|
|
@ -86,7 +97,7 @@ let tipVisible = ref(false); |
|
|
const closeOrOpenVersion = ref(false); //判断是否显示版本启用与关闭 |
|
|
const closeOrOpenVersion = ref(false); //判断是否显示版本启用与关闭 |
|
|
let oneIsTrue = true; |
|
|
let oneIsTrue = true; |
|
|
//缩放画布 |
|
|
//缩放画布 |
|
|
const zoomSize = (type:number) => { |
|
|
const zoomSize = (type: number) => { |
|
|
if (type == 1) { |
|
|
if (type == 1) { |
|
|
if (nowVal.value == 50) { |
|
|
if (nowVal.value == 50) { |
|
|
return; |
|
|
return; |
|
|
@ -104,67 +115,64 @@ const zoomSize = (type:number) => { |
|
|
@ 时间: 2024-03-11 16:33:49 |
|
|
@ 时间: 2024-03-11 16:33:49 |
|
|
@ 功能: 开启流程 |
|
|
@ 功能: 开启流程 |
|
|
*/ |
|
|
*/ |
|
|
const createFormFlow = () =>{ |
|
|
const createFormFlow = () => { |
|
|
if(appPageKey.value == ""){ |
|
|
if (appPageKey.value == "") { |
|
|
flowIsTrue.value = false; |
|
|
flowIsTrue.value = false; |
|
|
ElMessageBox.alert('您还未设置表单!请先设置完表单后,在创建流程!','温馨提示!',{ |
|
|
ElMessageBox.alert("您还未设置表单!请先设置完表单后,在创建流程!", "温馨提示!", { |
|
|
confirmButtonText: '确定', |
|
|
confirmButtonText: "确定", |
|
|
callback: (action: Action) => { |
|
|
callback: (action: Action) => { |
|
|
// emits("runNextWindows",1); |
|
|
// emits("runNextWindows",1); |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}); |
|
|
}else{ |
|
|
} else { |
|
|
openOrCloseFormFlow(1) |
|
|
openOrCloseFormFlow(1); |
|
|
flowIsTrue.value = true |
|
|
flowIsTrue.value = true; |
|
|
getFlowVerList() |
|
|
getFlowVerList(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// flowIsTrue.value = true |
|
|
// flowIsTrue.value = true |
|
|
} |
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 11:29:46 |
|
|
@ 时间: 2024-05-21 11:29:46 |
|
|
@ 功能: 获取工作流版本列表 |
|
|
@ 功能: 获取工作流版本列表 |
|
|
*/ |
|
|
*/ |
|
|
const getFlowVerList = ()=>{ |
|
|
const getFlowVerList = () => { |
|
|
gainFlowVersionList({id:appPageKey.value.toString()}) |
|
|
gainFlowVersionList({ id: appPageKey.value.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; |
|
|
if(item.state == 1){ |
|
|
enableFlow.value = item; |
|
|
activeTabs.value = item.id |
|
|
enableVersion.value = item.id; |
|
|
enableFlow.value = item |
|
|
|
|
|
enableVersion.value = item.id |
|
|
|
|
|
} |
|
|
} |
|
|
versionList.push({ |
|
|
versionList.push({ |
|
|
id:item.id, |
|
|
id: item.id, |
|
|
key:item.key, |
|
|
key: item.key, |
|
|
state:item.state, |
|
|
state: item.state, |
|
|
version:item.version |
|
|
version: item.version, |
|
|
}) |
|
|
}); |
|
|
}) |
|
|
}); |
|
|
if(versionList.length > 1){ |
|
|
if (versionList.length > 1) { |
|
|
closeOrOpenVersion.value = true |
|
|
closeOrOpenVersion.value = true; |
|
|
}else{ |
|
|
} else { |
|
|
closeOrOpenVersion.value = false |
|
|
closeOrOpenVersion.value = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// console.log("获取工作流版本列表--1-1-->",enableFlow.value); |
|
|
// console.log("获取工作流版本列表--1-1-->",enableFlow.value); |
|
|
if(enableFlow.value == "" || enableFlow.value == undefined){ |
|
|
if (enableFlow.value == "" || enableFlow.value == undefined) { |
|
|
enableFlow.value = versionList[0] |
|
|
enableFlow.value = versionList[0]; |
|
|
// activeTabs.value = versionList[0].id |
|
|
// activeTabs.value = versionList[0].id |
|
|
enableVersion.value = versionList[0].id |
|
|
enableVersion.value = versionList[0].id; |
|
|
} |
|
|
} |
|
|
isRead.value = true |
|
|
isRead.value = true; |
|
|
}else{ |
|
|
} else { |
|
|
isRead.value = false |
|
|
isRead.value = false; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// console.log("获取工作流版本列表---4-->",isRead.value); |
|
|
// console.log("获取工作流版本列表---4-->",isRead.value); |
|
|
@ -173,17 +181,15 @@ const getFlowVerList = ()=>{ |
|
|
// console.log("获取工作流版本列表---3-->",enableVersion.value); |
|
|
// console.log("获取工作流版本列表---3-->",enableVersion.value); |
|
|
// console.log("获取工作流版本列表---3-1->",versionList[0],versionList); |
|
|
// console.log("获取工作流版本列表---3-1->",versionList[0],versionList); |
|
|
}) |
|
|
}) |
|
|
.finally(()=>{ |
|
|
.finally(() => { |
|
|
|
|
|
if (isRead.value == true) { |
|
|
if(isRead.value == true){ |
|
|
|
|
|
gainFlowCont(); |
|
|
gainFlowCont(); |
|
|
}else{ |
|
|
} else { |
|
|
clearCanvas(1); |
|
|
clearCanvas(1); |
|
|
} |
|
|
} |
|
|
clickOpenOrClose(); |
|
|
clickOpenOrClose(); |
|
|
|
|
|
}); |
|
|
}) |
|
|
}; |
|
|
} |
|
|
|
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 11:40:34 |
|
|
@ 时间: 2024-05-21 11:40:34 |
|
|
@ -191,52 +197,51 @@ const getFlowVerList = ()=>{ |
|
|
*/ |
|
|
*/ |
|
|
const clickOpenOrClose = () => { |
|
|
const clickOpenOrClose = () => { |
|
|
// console.log("判断当前工作流版本是否启用",enableFlow,activeTabs.value) |
|
|
// console.log("判断当前工作流版本是否启用",enableFlow,activeTabs.value) |
|
|
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) |
|
|
} |
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 11:37:19 |
|
|
@ 时间: 2024-05-21 11:37:19 |
|
|
@ 功能: 清空画布 |
|
|
@ 功能: 清空画布 |
|
|
*/ |
|
|
*/ |
|
|
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 = ""; |
|
|
} |
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 11:37:46 |
|
|
@ 时间: 2024-05-21 11:37:46 |
|
|
@ 功能: 初始化工作流数据 |
|
|
@ 功能: 初始化工作流数据 |
|
|
*/ |
|
|
*/ |
|
|
const initWorkFlowData = async() => { |
|
|
const initWorkFlowData = async () => { |
|
|
let { data } = await initializeWorkFlow({name:state.value.formData.form.formName}) |
|
|
let { data } = await initializeWorkFlow({ name: state.value.formData.form.formName }); |
|
|
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 = appPageKey.value |
|
|
processConfig.value.workFlowDef.formKey = appPageKey.value; |
|
|
nodeConfig.value = nodes; |
|
|
nodeConfig.value = nodes; |
|
|
flowPermission.value = flowPermissiones; |
|
|
flowPermission.value = flowPermissiones; |
|
|
directorMaxLeveling = levels; |
|
|
directorMaxLeveling = levels; |
|
|
@ -249,72 +254,70 @@ const initWorkFlowData = async() => { |
|
|
// 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) |
|
|
} |
|
|
}; |
|
|
//缩放画布 |
|
|
//缩放画布 |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 11:26:41 |
|
|
@ 时间: 2024-05-21 11:26:41 |
|
|
@ 功能: 编辑表单流程状态 |
|
|
@ 功能: 编辑表单流程状态 |
|
|
*/ |
|
|
*/ |
|
|
const openOrCloseFormFlow = (val:number) => { |
|
|
const openOrCloseFormFlow = (val: number) => { |
|
|
openFormFlow({id:appPageKey.value.toString(),status:val}) |
|
|
openFormFlow({ id: appPageKey.value.toString(), status: val }); |
|
|
} |
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 10:10:46 |
|
|
@ 时间: 2024-05-21 10:10:46 |
|
|
@ 功能: 组件加载完毕执行数据初始化 |
|
|
@ 功能: 组件加载完毕执行数据初始化 |
|
|
*/ |
|
|
*/ |
|
|
onMounted(()=>{ |
|
|
onMounted(() => { |
|
|
// console.log("判断是否已经存在工作流以及是否开启",appPageKey.value) |
|
|
// console.log("判断是否已经存在工作流以及是否开启",appPageKey.value) |
|
|
if(appPageKey.value == ""){ |
|
|
if (appPageKey.value == "") { |
|
|
flowIsTrue.value = false; |
|
|
flowIsTrue.value = false; |
|
|
}else{ |
|
|
} else { |
|
|
judgeFormFlowIsOpen({id:appPageKey.value.toString()}) |
|
|
judgeFormFlowIsOpen({ id: appPageKey.value.toString() }).then((data) => { |
|
|
.then((data)=>{ |
|
|
|
|
|
// console.log("判断是否已经存在工作流以及是否开启",data) |
|
|
// console.log("判断是否已经存在工作流以及是否开启",data) |
|
|
if(data.data.isOpen == 1){ |
|
|
if (data.data.isOpen == 1) { |
|
|
flowIsTrue.value = true; |
|
|
flowIsTrue.value = true; |
|
|
// emits('judgeFlowIsEdit', false) |
|
|
// emits('judgeFlowIsEdit', false) |
|
|
getFlowVerList() |
|
|
getFlowVerList(); |
|
|
}else{ |
|
|
} else { |
|
|
flowIsTrue.value = false; |
|
|
flowIsTrue.value = false; |
|
|
// emits('judgeFlowIsEdit', false) |
|
|
// emits('judgeFlowIsEdit', false) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 13:57:13 |
|
|
@ 时间: 2024-05-21 13:57:13 |
|
|
@ 功能: 流程版本启用禁用 |
|
|
@ 功能: 流程版本启用禁用 |
|
|
*/ |
|
|
*/ |
|
|
const setupState = (val:number) =>{ |
|
|
const setupState = (val: number) => { |
|
|
let sendCont = { |
|
|
let sendCont = { |
|
|
id:enableVersion.value.toString(), |
|
|
id: enableVersion.value.toString(), |
|
|
status:val |
|
|
status: val, |
|
|
} |
|
|
}; |
|
|
if(val == 1){ |
|
|
if (val == 1) { |
|
|
activeTabs.value = enableVersion.value |
|
|
activeTabs.value = enableVersion.value; |
|
|
} |
|
|
} |
|
|
// console.log("流程版本启用禁用",sendCont) |
|
|
// console.log("流程版本启用禁用",sendCont) |
|
|
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(); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 13:59:44 |
|
|
@ 时间: 2024-05-21 13:59:44 |
|
|
@ -334,25 +337,25 @@ const saveSet = async () => { |
|
|
// 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('judgeFlowIsEdit', false) |
|
|
// emits('judgeFlowIsEdit', false) |
|
|
// emits("runNextWindows",3); |
|
|
// emits("runNextWindows",3); |
|
|
// clearCanvas(1); |
|
|
// clearCanvas(1); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.finally(()=>{ |
|
|
.finally(() => { |
|
|
// emits("chanerequest"); |
|
|
// emits("chanerequest"); |
|
|
getFlowVerList() |
|
|
getFlowVerList(); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 14:01:22 |
|
|
@ 时间: 2024-05-21 14:01:22 |
|
|
@ 功能: 错误提示 |
|
|
@ 功能: 错误提示 |
|
|
*/ |
|
|
*/ |
|
|
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) { |
|
|
@ -383,13 +386,12 @@ const reErr = ({ childNode }:any) => { |
|
|
@ 时间: 2024-05-21 14:11:28 |
|
|
@ 时间: 2024-05-21 14:11:28 |
|
|
@ 功能: 获取流程内容 |
|
|
@ 功能: 获取流程内容 |
|
|
*/ |
|
|
*/ |
|
|
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 = appPageKey.value |
|
|
processConfig.value.workFlowDef.formKey = appPageKey.value; |
|
|
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; |
|
|
@ -402,30 +404,30 @@ const gainFlowCont = () =>{ |
|
|
// 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(); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 14:12:43 |
|
|
@ 时间: 2024-05-21 14:12:43 |
|
|
@ 功能: 选择工作流版本 |
|
|
@ 功能: 选择工作流版本 |
|
|
*/ |
|
|
*/ |
|
|
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) |
|
|
} |
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 14:21:06 |
|
|
@ 时间: 2024-05-21 14:21:06 |
|
|
@ 功能: 编辑当前版本流程 |
|
|
@ 功能: 编辑当前版本流程 |
|
|
*/ |
|
|
*/ |
|
|
const saveEdit =()=>{ |
|
|
const saveEdit = () => { |
|
|
setIsTried(true); |
|
|
setIsTried(true); |
|
|
tipList.value = []; |
|
|
tipList.value = []; |
|
|
|
|
|
|
|
|
@ -436,16 +438,17 @@ const saveEdit =()=>{ |
|
|
} |
|
|
} |
|
|
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----------123--------->", processConfig.value); |
|
|
// 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, |
|
|
} |
|
|
}; |
|
|
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); |
|
|
@ -453,11 +456,11 @@ const saveEdit =()=>{ |
|
|
// emits("runNextWindows",3); |
|
|
// emits("runNextWindows",3); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.finally(()=>{ |
|
|
.finally(() => { |
|
|
// emits("chanerequest"); |
|
|
// emits("chanerequest"); |
|
|
getFlowVerList() |
|
|
getFlowVerList(); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 14:34:45 |
|
|
@ 时间: 2024-05-21 14:34:45 |
|
|
@ -478,39 +481,41 @@ const saveNew = () => { |
|
|
// 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('judgeFlowIsEdit', false) |
|
|
// emits('judgeFlowIsEdit', false) |
|
|
// emits("runNextWindows",3); |
|
|
// emits("runNextWindows",3); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.finally(()=>{ |
|
|
.finally(() => { |
|
|
getFlowVerList() |
|
|
getFlowVerList(); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 14:35:06 |
|
|
@ 时间: 2024-05-21 14:35:06 |
|
|
@ 功能: 监听流程节点变动 |
|
|
@ 功能: 监听流程节点变动 |
|
|
*/ |
|
|
*/ |
|
|
watch(()=>nodeConfig,()=>{ |
|
|
watch( |
|
|
|
|
|
() => nodeConfig, |
|
|
|
|
|
() => { |
|
|
// console.log("变动流程") |
|
|
// console.log("变动流程") |
|
|
if(oneIsTrue){ |
|
|
if (oneIsTrue) { |
|
|
oneIsTrue = false; |
|
|
oneIsTrue = false; |
|
|
// emits('judgeFlowIsEdit', false) |
|
|
// emits('judgeFlowIsEdit', false) |
|
|
}else{ |
|
|
} else { |
|
|
// emits('judgeFlowIsEdit', true) |
|
|
// emits('judgeFlowIsEdit', true) |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
deep: true, |
|
|
deep: true |
|
|
} |
|
|
}) |
|
|
); |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2024-05-21 14:37:22 |
|
|
@ 时间: 2024-05-21 14:37:22 |
|
|
@ -519,30 +524,41 @@ watch(()=>nodeConfig,()=>{ |
|
|
const closwFormFlow = () => { |
|
|
const closwFormFlow = () => { |
|
|
flowIsTrue.value = false; |
|
|
flowIsTrue.value = false; |
|
|
// emits('judgeFlowIsEdit', false) |
|
|
// emits('judgeFlowIsEdit', false) |
|
|
openOrCloseFormFlow(2) |
|
|
openOrCloseFormFlow(2); |
|
|
} |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
<template> |
|
|
<template> |
|
|
<el-main class="mainBox"> |
|
|
<el-main class="mainBox"> |
|
|
<div v-if="flowIsTrue" style="height: 100%;"> |
|
|
<div v-if="flowIsTrue" style="height: 100%"> |
|
|
|
|
|
|
|
|
<div class="flowVersionBox"> |
|
|
<div class="flowVersionBox"> |
|
|
<div class="tabs_box"> |
|
|
<div class="tabs_box"> |
|
|
<el-tabs v-if="isRead" v-model="activeTabs" @tab-change="clickFormTable"> |
|
|
<el-tabs v-if="isRead" v-model="activeTabs" @tab-change="clickFormTable"> |
|
|
<el-tab-pane v-for="item in versionList" :key="item.id" :name="item.id"> |
|
|
<el-tab-pane v-for="item in versionList" :key="item.id" :name="item.id"> |
|
|
<template #label> |
|
|
<template #label> |
|
|
<el-icon><Share /></el-icon> |
|
|
<el-icon><Share /></el-icon> |
|
|
<span class="my-label">V{{item.version}}</span> |
|
|
<span class="my-label">V{{ item.version }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-tab-pane> |
|
|
</el-tab-pane> |
|
|
</el-tabs> |
|
|
</el-tabs> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flowButBox"> |
|
|
<div class="flowButBox"> |
|
|
<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-icon class="el-icon--left"><Delete /></el-icon> |
|
|
启用 |
|
|
启用 |
|
|
</el-button> |
|
|
</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-icon class="el-icon--left"><Delete /></el-icon> |
|
|
禁用 |
|
|
禁用 |
|
|
</el-button> |
|
|
</el-button> |
|
|
@ -555,7 +571,7 @@ const closwFormFlow = () => { |
|
|
发布 |
|
|
发布 |
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-button v-if="isRead" size="small" plain @click="saveEdit"> |
|
|
<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> |
|
|
<el-button v-if="isRead" type="warning" size="small" @click="saveNew"> |
|
|
<el-button v-if="isRead" type="warning" size="small" @click="saveNew"> |
|
|
@ -568,16 +584,26 @@ const closwFormFlow = () => { |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div > |
|
|
<div> |
|
|
|
|
|
<section class="dingflow-design" style="top: 80px"> |
|
|
<section class="dingflow-design" style="top:80px"> |
|
|
|
|
|
<div class="zoom"> |
|
|
<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> |
|
|
<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> |
|
|
<div class="box-scale" :style="`transform: scale(${ nowVal / 100});`"> |
|
|
<div class="box-scale" :style="`transform: scale(${nowVal / 100});`"> |
|
|
<nodeWrap v-model:nodeConfig="nodeConfig" v-model:flowPermission="flowPermission" /> |
|
|
<nodeWrap |
|
|
|
|
|
v-model:nodeConfig="nodeConfig" |
|
|
|
|
|
v-model:flowPermission="flowPermission" |
|
|
|
|
|
/> |
|
|
<div class="end-node"> |
|
|
<div class="end-node"> |
|
|
<div class="end-node-circle"></div> |
|
|
<div class="end-node-circle"></div> |
|
|
<div class="end-node-text">流程结束5</div> |
|
|
<div class="end-node-text">流程结束5</div> |
|
|
@ -586,8 +612,20 @@ const closwFormFlow = () => { |
|
|
</section> |
|
|
</section> |
|
|
|
|
|
|
|
|
<errorDialog v-model:visible="tipVisible" :list="tipList" /> |
|
|
<errorDialog v-model:visible="tipVisible" :list="tipList" /> |
|
|
<promoterDrawer v-model:form-data="state.formData" :form-key="appPageKey" :form-version="formVersion" :node-config="nodeConfig" /> |
|
|
<promoterDrawer |
|
|
<approverDrawer :directormaxlevel="directorMaxLeveling" :node-config="nodeConfig" :is-form-flow="isFormFlow" :customer-form-key="appPageKey" v-model:form-data="state.formData" :form-version="formVersion" /> |
|
|
v-model:form-data="state.formData" |
|
|
|
|
|
:form-key="appPageKey" |
|
|
|
|
|
:form-version="formVersion" |
|
|
|
|
|
:node-config="nodeConfig" |
|
|
|
|
|
/> |
|
|
|
|
|
<approverDrawer |
|
|
|
|
|
:directormaxlevel="directorMaxLeveling" |
|
|
|
|
|
:node-config="nodeConfig" |
|
|
|
|
|
:is-form-flow="isFormFlow" |
|
|
|
|
|
:customer-form-key="appPageKey" |
|
|
|
|
|
v-model:form-data="state.formData" |
|
|
|
|
|
:form-version="formVersion" |
|
|
|
|
|
/> |
|
|
<copyerDrawer /> |
|
|
<copyerDrawer /> |
|
|
<conditionDrawer :is-form-flow="isFormFlow" :customer-form-key="appPageKey" /> |
|
|
<conditionDrawer :is-form-flow="isFormFlow" :customer-form-key="appPageKey" /> |
|
|
</div> |
|
|
</div> |
|
|
@ -595,66 +633,62 @@ const closwFormFlow = () => { |
|
|
<div v-else class="flow_work_begin"> |
|
|
<div v-else class="flow_work_begin"> |
|
|
<el-result title="" sub-title=""> |
|
|
<el-result title="" sub-title=""> |
|
|
<template #icon> |
|
|
<template #icon> |
|
|
流程可实现需要多人流转的业务场景。<br>绘制流程图,设定数据流转方式,即可搭建线上工作流。<br><br> |
|
|
流程可实现需要多人流转的业务场景。<br />绘制流程图,设定数据流转方式,即可搭建线上工作流。<br /><br /> |
|
|
<el-image |
|
|
<el-image class="imgBox" :src="FlowImgSrc" /> |
|
|
class="imgBox" |
|
|
|
|
|
:src="FlowImgSrc" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
<template #extra> |
|
|
<template #extra> |
|
|
<el-button type="primary" @click="createFormFlow">开启流程</el-button> |
|
|
<el-button type="primary" @click="createFormFlow">开启流程</el-button> |
|
|
</template> |
|
|
</template> |
|
|
</el-result> |
|
|
</el-result> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</el-main> |
|
|
</el-main> |
|
|
</template> |
|
|
</template> |
|
|
<style lang='scss' scoped> |
|
|
<style lang="scss" scoped> |
|
|
.mainBox{ |
|
|
.mainBox { |
|
|
padding: 0; |
|
|
padding: 0; |
|
|
overflow-y : auto; |
|
|
overflow-y: auto; |
|
|
height: calc(100vh - 40px); |
|
|
height: calc(100vh - 40px); |
|
|
background-color: #f5f5f7; |
|
|
background-color: #f5f5f7; |
|
|
} |
|
|
} |
|
|
.flow_work_begin{ |
|
|
.flow_work_begin { |
|
|
height: calc(100vh - 40px); |
|
|
height: calc(100vh - 40px); |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
background-color: #FFFFFF; |
|
|
background-color: #ffffff; |
|
|
.imgBox{ |
|
|
.imgBox { |
|
|
height: calc(100vh - 400px); |
|
|
height: calc(100vh - 400px); |
|
|
// height: 10%; |
|
|
// height: 10%; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.flowVersionBox{ |
|
|
.flowVersionBox { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: space-between; |
|
|
justify-content: space-between; |
|
|
background-color: #FFFFFF; |
|
|
background-color: #ffffff; |
|
|
.flowVerLeft{ |
|
|
.flowVerLeft { |
|
|
max-width: 50%; |
|
|
max-width: 50%; |
|
|
padding-left: 10px; |
|
|
padding-left: 10px; |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.tabs_box{ |
|
|
.tabs_box { |
|
|
max-width: 50%; |
|
|
max-width: 50%; |
|
|
min-width:30%; |
|
|
min-width: 30%; |
|
|
::v-deep .el-tabs__nav-wrap::after { |
|
|
::v-deep .el-tabs__nav-wrap::after { |
|
|
position: static !important; |
|
|
position: static !important; |
|
|
/* background-color: #fff; */ |
|
|
/* background-color: #fff; */ |
|
|
} |
|
|
} |
|
|
::v-deep .el-tabs__item{ |
|
|
::v-deep .el-tabs__item { |
|
|
padding:0 10px; |
|
|
padding: 0 10px; |
|
|
} |
|
|
} |
|
|
::v-deep .el-tabs__header{ |
|
|
::v-deep .el-tabs__header { |
|
|
margin:0; |
|
|
margin: 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.flowButBox{ |
|
|
.flowButBox { |
|
|
padding: 7px 0; |
|
|
padding: 7px 0; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
|