|
@@ -12,7 +12,7 @@ const route = useRoute()
|
|
|
// 缓存 start
|
|
|
import { EVENT_ENUM, EVENT_BUS, cacheTriggerFunc } from '@/utils/cacheHelper'
|
|
|
const flowStore = useFlowStore()
|
|
|
-const { flowName, flowProcessId } = storeToRefs(flowStore)
|
|
|
+const { flowName, flowProcessId, processForm, modelContent } = storeToRefs(flowStore)
|
|
|
const cacheLoading = ref(false)
|
|
|
const cacheLoadingNum = ref(600)
|
|
|
const cacheLoadingFr = 1000
|
|
@@ -179,25 +179,12 @@ const getGroupList = async () => {
|
|
|
}
|
|
|
|
|
|
const initBaseicInfEv = item => {
|
|
|
- // item = {
|
|
|
- // processId: '1728240012964925441',
|
|
|
- // processForm:yu
|
|
|
- // '[{"type":"input","field":"userName","title":"输入框","info":"","$required":false,"_fc_drag_tag":"input","hidden":false,"display":true}]',
|
|
|
- // processKey: '003key',
|
|
|
- // processName: '003名称',
|
|
|
- // processIcon: 'https://lf3-ea.bytetos.com/obj/goofy/ee/approval/approval-admin/image/iconLib/v5/cart',
|
|
|
- // categoryId: '1725778939021541378',
|
|
|
- // remark: '003说明',
|
|
|
- // useScope: 1,
|
|
|
- // processActorList: [{ actorId: '1705067852272607233', actorName: 'lanceJiang', actorType: 0 }],
|
|
|
- // processPermissionList: [{ userId: '1705067852272607233', userName: 'lanceJiang', operateApproval: 0, operateOwner: 0, operateData: 0 }]
|
|
|
- // }
|
|
|
const { processForm, modelContent, ...rest } = item
|
|
|
flowInfo.value = rest
|
|
|
flowStore.setProcessForm(processForm)
|
|
|
flowStore.setModelContent(modelContent)
|
|
|
- // updateRemoteCache()
|
|
|
- flowProcessId.value = queryObj.value.id // 赋值流程id
|
|
|
+ updateRemoteCache()
|
|
|
+ flowStore.setFlowProcessId(queryObj.value.id)
|
|
|
if (item.useScope === 1) {
|
|
|
nodeRoleList.value = item.processActorList.map(item => {
|
|
|
return {
|
|
@@ -224,9 +211,16 @@ const initBaseicInfEv = item => {
|
|
|
// 更新申请信息缓存
|
|
|
const updateRemoteCache = async () => {
|
|
|
try {
|
|
|
- const params = flowProcessId.value ? { ...flowInfo.value, processId: flowProcessId.value } : flowInfo.value
|
|
|
+ const commonParam = {
|
|
|
+ processForm: processForm.value,
|
|
|
+ modelContent: modelContent.value,
|
|
|
+ ...flowInfo.value
|
|
|
+ }
|
|
|
+ const params = flowProcessId.value ? { processId: flowProcessId.value, ...commonParam } : commonParam
|
|
|
+ console.error(params, 'params=======')
|
|
|
+ // return
|
|
|
const data = await process.progressCreateApi(params)
|
|
|
- flowProcessId.value = data
|
|
|
+ flowStore.setFlowProcessId(data)
|
|
|
Object.keys(flowInfo.value).forEach(key => {
|
|
|
flowStore.setKeysBasicInfo(key, flowInfo.value[key])
|
|
|
})
|
|
@@ -239,7 +233,7 @@ const updateRemoteCache = async () => {
|
|
|
const handleRemoteCacheRefresh = () => {
|
|
|
cacheIndex.value && clearTimeout(cacheIndex.value)
|
|
|
cacheIndex.value = setTimeout(() => {
|
|
|
- // updateRemoteCache()
|
|
|
+ updateRemoteCache()
|
|
|
}, cacheUpdateFr)
|
|
|
}
|
|
|
|
|
@@ -280,7 +274,6 @@ const getCurrentProcessDetailEv = id => {
|
|
|
|
|
|
// icon图标点击保存
|
|
|
const chooseIconEv = item => {
|
|
|
- // flowStore.setKeysBasicInfo('processIcon', item)
|
|
|
flowInfo.value.processIcon = item
|
|
|
visiblePopover.value = !visiblePopover.value
|
|
|
}
|
|
@@ -347,7 +340,7 @@ defineExpose({
|
|
|
|
|
|
<template>
|
|
|
<div class="base-info">
|
|
|
- <div v-if="false" style="font-size: 18px; position: absolute; left: 10px; top: 20px; z-index: 9999; color: red">
|
|
|
+ <div style="font-size: 18px; position: absolute; left: 10px; top: 20px; z-index: 9999; color: red">
|
|
|
{{ cacheLoadingNum }}秒之后开启自动缓存...
|
|
|
</div>
|
|
|
|