فهرست منبع

复制流程增加

duy 2 هفته پیش
والد
کامیت
74cd616f83
2فایلهای تغییر یافته به همراه28 افزوده شده و 0 حذف شده
  1. 8 0
      src/api/modules/tasks/flow.js
  2. 20 0
      src/views/tasks/flow.vue

+ 8 - 0
src/api/modules/tasks/flow.js

@@ -67,4 +67,12 @@ export default {
             },
         })
     },
+    //复制流程
+    async copyFixedFlowData(form) {
+        return HcApi({
+            url: '/api/blade-business/fixedFlow/copy',
+            method: 'post',
+            params: form,
+        })
+    },
 }

+ 20 - 0
src/views/tasks/flow.vue

@@ -21,6 +21,9 @@
                     <hc-tooltip keys="tasks_flow_del">
                         <el-button v-del-com:[handleTableDel]="row" plain size="small" type="danger" :disabled="!row.deletedIs">删除</el-button>
                     </hc-tooltip>
+                    <hc-tooltip keys="tasks_flow_copy">
+                        <el-button plain size="small" type="warning" @click="handleCopyEdit(row)">复制</el-button>
+                    </hc-tooltip>
                 </template>
             </hc-table>
             <template #action>
@@ -89,6 +92,7 @@ import { nextTick, onMounted, ref } from 'vue'
 import { useAppStore } from '~src/store'
 import { getArrValue, getObjValue } from 'js-fast-way'
 import tasksFlowApi from '~api/tasks/flow'
+import { isInDestructureAssignment } from '@vue/compiler-sfc'
 
 
 //变量
@@ -356,6 +360,22 @@ const sortModalSave = async () => {
 const sortModalClose = () => {
     sortModal.value = false
 }
+//复制流程
+const handleCopyEditLoad = ref(false)
+const handleCopyEdit = async (row) => {
+    handleCopyEditLoad.value = true
+
+    const { error, code, msg } = await tasksFlowApi.copyFixedFlowData(
+        {   
+            ids: row.id,
+        },
+    )
+        handleCopyEditLoad.value = false
+    if (!error && code === 200) {
+        window.$message?.success(msg)
+        getTableData().then()
+    } 
+}
 </script>
 
 <style lang="scss" scoped>