Browse Source

feat: processPermissionList属性在业务流程和子流程中添加

luoyali 8 months ago
parent
commit
357ac457bb
2 changed files with 28 additions and 4 deletions
  1. 20 2
      src/views/flow/create/business.vue
  2. 8 2
      src/views/flow/create/child.vue

+ 20 - 2
src/views/flow/create/business.vue

@@ -54,7 +54,19 @@ const { tagsView } = useStore()
 const router = useRouter()
 const route = useRoute()
 const flowStore = useFlowStore()
-const { categoryId, formId, processId, processIcon, processKey, processName, remark, modelContent, businessForm, processSetting } = storeToRefs(flowStore)
+const {
+	categoryId,
+	formId,
+	processId,
+	processIcon,
+	processKey,
+	processName,
+	remark,
+	modelContent,
+	businessForm,
+	processSetting,
+	processPermissionList
+} = storeToRefs(flowStore)
 
 const compRefs = ref() // 实例化子组件
 const cache_components = ref({})
@@ -121,7 +133,8 @@ const submitHandler = async () => {
 			name: processName.value,
 			nodeConfig: JSON.parse(modelContent.value || '{}')
 		}),
-		processSetting: processSetting.value
+		processSetting: processSetting.value,
+		processPermissionList: processPermissionList.value
 	}
 	const res = await process.progressCreateApi(params)
 	ElMessage.success('操作成功')
@@ -197,6 +210,11 @@ const getCurrentProcessDetailEv = () => {
 			businessForm.value = JSON.parse(res.businessForm || '{}') || {}
 			// flowStore.setProcessForm(processForm)
 			flowStore.setProcessSetting(res.processSetting)
+			processPermissionList.value = (res.processPermissionList || []).map(i => ({
+				...i,
+				id: i.userId,
+				name: i.userName
+			}))
 			// 默认执行一次保存
 			const _refs = compRefs.value
 			for (let i = 0; i < _refs.length; i++) {

+ 8 - 2
src/views/flow/create/child.vue

@@ -46,7 +46,7 @@ const { tagsView } = useStore()
 const router = useRouter()
 const route = useRoute()
 const flowStore = useFlowStore()
-const { categoryId, processId, processIcon, processKey, processName, remark, modelContent, processForm, processSetting } = storeToRefs(flowStore)
+const { categoryId, processId, processIcon, processKey, processName, remark, modelContent, processForm, processSetting, processPermissionList } = storeToRefs(flowStore)
 
 const compRefs = ref() // 实例化子组件
 const cache_components = ref({})
@@ -106,7 +106,8 @@ const submitHandler = async () => {
 			name: processName.value,
 			nodeConfig: JSON.parse(modelContent.value || '{}')
 		}),
-		processSetting: processSetting.value
+		processSetting: processSetting.value,
+		processPermissionList: processPermissionList.value
 	}
 	const res = await process.progressCreateApi(params)
 	ElMessage.success('操作成功')
@@ -182,6 +183,11 @@ const getCurrentProcessDetailEv = () => {
 			processForm.value = JSON.parse(res.processForm) || {}
 			// flowStore.setProcessForm(processForm)
 			flowStore.setProcessSetting(res.processSetting)
+			processPermissionList.value = (res.processPermissionList || []).map(i => ({
+				...i,
+				id: i.userId,
+				name: i.userName
+			}))
 			// 默认执行一次保存
 			const _refs = compRefs.value
 			for (let i = 0; i < _refs.length; i++) {