Browse Source

feat: bpm 添加流程模型复制功能

zws 7 months ago
parent
commit
b117431318

+ 1 - 1
src/router/modules/remaining.ts

@@ -344,7 +344,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
         }
       },
       {
-        path: 'manager/model/update/:id',
+        path: 'manager/model/:type/:id',
         component: () => import('@/views/bpm/model/form/index.vue'),
         name: 'BpmModelUpdate',
         meta: {

+ 10 - 1
src/views/bpm/model/CategoryDraggableModel.vue

@@ -163,6 +163,15 @@
             >
               修改
             </el-button>
+            <el-button
+              link
+              type="primary"
+              @click="openModelForm('copy', scope.row.id)"
+              v-hasPermi="['bpm:model:update']"
+              :disabled="!isManagerUser(scope.row)"
+            >
+              复制
+            </el-button>
             <el-button
               link
               class="!ml-5px"
@@ -473,7 +482,7 @@ const openModelForm = (type: string, id?: number) => {
   } else {
     push({
       name: 'BpmModelUpdate',
-      params: { id }
+      params: { id, type }
     })
   }
 }

+ 4 - 1
src/views/bpm/model/form/index.vue

@@ -162,7 +162,10 @@ const initData = async () => {
   if (modelId) {
     // 修改场景
     formData.value = await ModelApi.getModel(modelId)
-
+    // 复制场景
+    if (route.params.type === 'copy') {
+      delete formData.value.id
+    }
   } else {
     // 新增场景
     formData.value.managerUserIds.push(userStore.getUser.id)