소스 검색

feat: 审批流添加字段审批权限

luoyali 11 달 전
부모
커밋
2bc0291b5c
2개의 변경된 파일12개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 3
      src/views/flow/create/components/BasicInfo.vue
  2. 9 2
      src/views/flow/create/index.vue

+ 3 - 3
src/views/flow/create/components/BasicInfo.vue

@@ -114,9 +114,9 @@ const selectContentEv = item => {
 			processPermissionList.push({
 				userId: item[i].id,
 				userName: item[i].name,
-				operateApproval: 0,
-				operateOwner: 0,
-				operateData: 0,
+				operateApproval: 1,
+				operateOwner: 1,
+				operateData: 1,
 				id: item[i].id,
 				name: item[i].name
 			})

+ 9 - 2
src/views/flow/create/index.vue

@@ -48,7 +48,8 @@ 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({})
 const componentsArr = [
@@ -119,7 +120,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('操作成功')
@@ -194,6 +196,11 @@ const getCurrentProcessDetailEv = () => {
 			modelContent.value = JSON.stringify(nodeConfig)
 			processForm.value = res.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++) {