Przeglądaj źródła

feat: 流程发布接口联调完毕

luoyali 1 rok temu
rodzic
commit
4adebbddea

+ 2 - 3
src/api/flow/process.ts

@@ -45,9 +45,8 @@ function launchProcessListApi(data: any): AxiosPromise {
 
 function releaseProcessApi(data: any): AxiosPromise {
 	return request({
-		url: api.releaseProcess,
-		method: 'post',
-		data
+		url: `${api.releaseProcess}?id=${data.id}`,
+		method: 'post'
 	})
 }
 

+ 7 - 7
src/store/modules/flow.ts

@@ -12,13 +12,13 @@ const basicInfo: BasicInfoIndex = {
 	remark: '', // 备注说明
 	createTime: '', // 创建时间
 	useScope: 0, // 使用范围 0,全员 1,指定人员(业务关联) 2,均不可提交
-	processActorList: [
-		{
-			actorId: 0, // 参与者ID
-			actorName: '', // 参与者
-			actorType: 0 // 参与者类型 0,用户 1,部门 2,用户组
-		}
-	], // 流程参与者,当使用范围为指定人员时候设置
+	// processActorList: [
+	// 	{
+	// 		actorId: 0, // 参与者ID
+	// 		actorName: '', // 参与者
+	// 		actorType: 0 // 参与者类型 0,用户 1,部门 2,用户组
+	// 	}
+	// ], // 流程参与者,当使用范围为指定人员时候设置
 	processPermissionList: [
 		{
 			userId: 0, // 用户ID

+ 17 - 18
src/views/flow/create/components/BasicInfo.vue

@@ -34,13 +34,13 @@ const flowInfo = ref({
 	processIcon: 'approval', // 流程图标
 	categoryId: '', // 流程组分类ID
 	// useScope: 0, // 使用范围 0,全员 1,指定人员(业务关联) 2,均不可提交
-	processActorList: [
-		{
-			actorId: 0, // 参与者ID
-			actorName: '', // 参与者
-			actorType: 0 // 参与者类型 0,用户 1,部门 2,用户组
-		}
-	], // 流程参与者,当使用范围为指定人员时候设置
+	// processActorList: [
+	// 	{
+	// 		actorId: 0, // 参与者ID
+	// 		actorName: '', // 参与者
+	// 		actorType: 0 // 参与者类型 0,用户 1,部门 2,用户组
+	// 	}
+	// ], // 流程参与者,当使用范围为指定人员时候设置
 	processPermissionList: [
 		{
 			userId: 0, // 用户ID
@@ -198,15 +198,15 @@ const initBaseicInfEv = item => {
 	flowStore.setModelContent(modelContent)
 	// updateRemoteCache()
 	flowProcessId.value = queryObj.value.id // 赋值流程id
-	if (item.useScope === 1) {
-		nodeRoleList.value = item.processActorList.map(item => {
-			return {
-				id: item.actorId,
-				name: item.actorName,
-				actorType: 0
-			}
-		})
-	}
+	// if (item.useScope === 1) {
+	// 	nodeRoleList.value = item.processActorList.map(item => {
+	// 		return {
+	// 			id: item.actorId,
+	// 			name: item.actorName,
+	// 			actorType: 0
+	// 		}
+	// 	})
+	// }
 
 	if (item.processPermissionList && item.processPermissionList.length) {
 		nodeRoleManageList.value = item.processPermissionList.map(item => {
@@ -287,7 +287,7 @@ const chooseIconEv = item => {
 
 // ----- 缓存相关 start ------
 const flowBaseInfoWatcher = computed(() => {
-	const { processKey, processName, processIcon, categoryId, remark, processActorList, processPermissionList } = flowInfo.value
+	const { processKey, processName, processIcon, categoryId, remark, processPermissionList } = flowInfo.value
 	// 只关注参数相关的数据变更
 	const _s = {
 		processKey, // 流程显示名称
@@ -295,7 +295,6 @@ const flowBaseInfoWatcher = computed(() => {
 		processIcon, // 流程图标
 		categoryId, // 流程组分类ID
 		remark, // 备注说明
-		processActorList, // 流程参与者,当使用范围为指定人员时候设置
 		processPermissionList // 流程定义权限
 	}
 	console.log('第一步:监听的对象属性 ------', _s)

+ 2 - 2
src/views/flow/create/components/FlowDesign.vue

@@ -51,7 +51,7 @@ const saveDesign = async jsonStr => {
 			...basicInfo.value,
 			processId: flowProcessId.value,
 			processForm: processForm.value,
-			modelContent: JSON.stringify(jsonStr)
+			modelContent: JSON.stringify(jsonStr.processConfig)
 		}
 		const res = await process.progressCreateApi(params)
 		flowProcessId.value = res
@@ -67,7 +67,7 @@ const queryObj = computed(() => route.query)
 onMounted(() => {
 	if (queryObj.value.id) {
 		const _val = JSON.parse(modelContent.value || '{}')
-		form.value = Object.assign(_val, {})
+		form.value = Object.assign({ processConfig: _val }, {})
 	}
 })
 

+ 1 - 1
src/views/flow/create/components/FormDesign.vue

@@ -15,9 +15,9 @@ const exportJsonEv = async json => {
 	try {
 		const _json = JSON.stringify(json)
 		const params = {
+			...basicInfo.value,
 			processId: flowProcessId.value,
 			processForm: JSON.stringify(json),
-			...basicInfo.value
 		}
 		const res = await process.progressCreateApi(params)
 		flowStore.setProcessForm(_json)