Kaynağa Gözat

优化创建流程

hubin 1 yıl önce
ebeveyn
işleme
39ad3c3ede

+ 1 - 9
src/store/modules/flow.ts

@@ -22,15 +22,7 @@ export const useFlowStore = defineStore({
 			// 		actorType: 0 // 参与者类型 0,用户 1,部门 2,用户组
 			// 	}
 			// ], // 流程参与者,当使用范围为指定人员时候设置
-			processPermissionList: [
-				{
-					userId: 0, // 用户ID
-					userName: '', // 用户名
-					operateApproval: 0, // 允许编辑/停用/删除审批 0,否 1,
-					operateOwner: 0, // 允许添加/移除审批负责人 0,否 1,是
-					operateData: 0 // 允许审批数据查询与操作 0,否 1,是
-				}
-			], // 流程定义权限
+			processPermissionList: [], // 流程定义权限
 
 			cacheSwitch: false, // 缓存开关
 			modelContent: '', // 流程模型定义JSON内容

+ 7 - 29
src/views/flow/create/components/BasicInfo.vue

@@ -12,7 +12,6 @@ const visiblePopover = ref(false)
 const selectVisible = ref(false)
 const useSelectRef = ref(null)
 const nodeRoleList = ref([])
-const nodeRoleManageList = ref([])
 const currentNode = ref('nodeRoleList')
 const formRef = ref()
 const options = ref([])
@@ -105,7 +104,7 @@ const selectContentEv = item => {
 	if (currentNode.value === 'nodeRoleList') {
 		nodeRoleList.value = item
 		const flag = !item.length
-		flowInfo.value.useScope = flag ? 0 : 1
+		flowInfo.useScope = flag ? 0 : 1
 		let processActorList = []
 		for (let i in item) {
 			processActorList.push({
@@ -114,7 +113,7 @@ const selectContentEv = item => {
 				actorType: 0
 			})
 		}
-		flowInfo.value.processActorList = processActorList
+		flowInfo.processActorList = processActorList
 	} else {
 		let processPermissionList = []
 		for (let i in item) {
@@ -126,7 +125,6 @@ const selectContentEv = item => {
 				operateData: 0
 			})
 		}
-		nodeRoleManageList.value = item
 		flowInfo.processPermissionList = processPermissionList
 	}
 }
@@ -135,7 +133,7 @@ const delRole = (index, itemName) => {
 	if (itemName === 'nodeRoleList') {
 		nodeRoleList.value.splice(index, 1)
 	} else {
-		nodeRoleManageList.value.splice(index, 1)
+		flowInfo.processPermissionList.splice(index, 1)
 	}
 }
 
@@ -144,26 +142,6 @@ const getGroupList = async () => {
 	options.value = data || []
 }
 
-const initBaseicInfEv = item => {
-	const { processForm, modelContent, ...rest } = item
-	flowInfo.value = rest
-	flowStore.setProcessForm(processForm)
-	flowStore.setModelContent(modelContent)
-	flowProcessId.value = queryObj.value.id // 赋值流程id
-
-	if (item.processPermissionList && item.processPermissionList.length) {
-		nodeRoleManageList.value = item.processPermissionList.map(item => {
-			return {
-				id: item.userId,
-				name: item.userName,
-				operateApproval: 0,
-				operateOwner: 0,
-				operateData: 0
-			}
-		})
-	}
-}
-
 // icon图标点击保存
 const chooseIconEv = item => {
 	value.processIcon = item
@@ -252,14 +230,14 @@ defineExpose({
 					</div>
 					<div class="tags-list" style="margin-top: 15px; width: 100%">
 						<el-tag
-							v-for="(role, index) in nodeRoleManageList"
-							:key="role.id"
+							v-for="(user, index) in flowInfo.processPermissionList"
+							:key="user.userId"
 							type="info"
 							closable
 							style="margin-right: 8px"
 							@close="delRole(index, 'nodeRoleManageList')"
-							>{{ role.name }}</el-tag
-						>
+							>{{ user.userName }}
+						</el-tag>
 					</div>
 				</el-form-item>
 			</el-form>