lex-xin 4 năm trước cách đây
mục cha
commit
e23ee080d6

+ 2 - 1
src/components/wfd/behavior/dragPanelItemAddNode.js

@@ -46,7 +46,8 @@ export default function(G6) {
     onMouseUp(e) {
       if (this.graph.get('onDragAddNode')) {
         const p = this.graph.getPointByClient(e.clientX, e.clientY)
-        if (p.x > 0 && p.y > 0) { this._addNode(p) }
+        // if (p.x > 0 && p.y > 0) { this._addNode(p) }
+        this._addNode(p)
       }
     },
     onMouseLeave(e) {

+ 22 - 0
src/utils/loading.js

@@ -0,0 +1,22 @@
+import { Loading } from 'element-ui'
+let loading
+// 定义loading变量
+
+function startLoading() {
+  // 使用Element loading-start 方法
+  loading = Loading.service({
+    lock: true,
+    fullscreen: true,
+    text: '加载中……',
+    background: 'rgba(0, 0, 0, 0.7)'
+  })
+}
+function endLoading() {
+  // 使用Element loading-close 方法
+  loading.close()
+}
+
+export default {
+  startLoading,
+  endLoading
+}

+ 34 - 31
src/views/process/admin/process-manager.vue

@@ -209,7 +209,7 @@ import { listRole } from '@/api/system/role'
 import { listPost } from '@/api/system/post'
 // import { getOrdinaryDeptList } from '@/api/system/dept'
 import { treeselect } from '@/api/system/dept'
-
+import load from '@/utils/loading'
 export default {
   name: 'Process',
   components: {
@@ -280,16 +280,16 @@ export default {
   },
   methods: {
     // 获取任务列表
-    getTaskList() {
-      taskList({
+    async getTaskList() {
+      await taskList({
         page: 1,
         per_page: 99999
       }).then(response => {
         this.taskListData = response.data.data
       })
     },
-    getProcessList() {
-      processList({
+    async getProcessList() {
+      await processList({
         page: 1,
         per_page: 99999
       }).then(response => {
@@ -300,13 +300,12 @@ export default {
             subList.push(item)
           }
         })
-        console.log(response.data.data)
         this.processData = subList
       })
     },
     // 获取流程分类列表
-    getClassifyList() {
-      classifyList({
+    async getClassifyList() {
+      await classifyList({
         page: 1,
         per_page: 99999
       }).then(response => {
@@ -314,8 +313,8 @@ export default {
       })
     },
     // 获取模版列表
-    getTemplates() {
-      templateList({
+    async getTemplates() {
+      await templateList({
         page: 1,
         per_page: 99999
       }).then(response => {
@@ -323,32 +322,32 @@ export default {
       })
     },
     // 获取用户
-    getUsers() {
-      listUser({
+    async getUsers() {
+      await listUser({
         pageSize: 999999
       }).then(response => {
         this.users = response.data.list
       })
     },
-    getRoles() {
-      listRole({
+    async getRoles() {
+      await listRole({
         pageSize: 999999
       }).then(response => {
         this.roles = response.data.list
       })
     },
     // 获取部门
-    getDepartments() {
+    async getDepartments() {
       // getOrdinaryDeptList().then(response => {
       //   this.departments = response.data
       // })
-      treeselect().then(response => {
+      await treeselect().then(response => {
         this.departments = response.data
       })
     },
     // 获取岗位
-    getPostOptions() {
-      listPost({
+    async getPostOptions() {
+      await listPost({
         page: 1,
         pageSize: 99999
       }).then(response => {
@@ -368,18 +367,20 @@ export default {
         this.loading = false
       })
     },
-    getProcessInitData() {
-      this.getClassifyList()
-      this.getTemplates()
-      this.getUsers()
-      this.getRoles()
-      this.getDepartments()
-      this.getTaskList()
-      this.getProcessList()
-      this.getPostOptions()
+    async getProcessInitData() {
+      await this.getClassifyList()
+      await this.getTemplates()
+      await this.getUsers()
+      await this.getRoles()
+      await this.getDepartments()
+      await this.getTaskList()
+      await this.getProcessList()
+      await this.getPostOptions()
     },
-    handleCreate() {
-      this.getProcessInitData()
+    async handleCreate() {
+      load.startLoading()
+      await this.getProcessInitData()
+      load.endLoading()
       this.ruleForm = {
         id: undefined,
         name: '',
@@ -399,9 +400,11 @@ export default {
         this.wfdDesignRefresh = true
       })
     },
-    handleEdit(row) {
+    async handleEdit(row) {
       this.dialogProcessVisibleName = 2
-      this.getProcessInitData()
+      load.startLoading()
+      await this.getProcessInitData()
+      load.endLoading()
       this.wfdDesignRefresh = false
       this.open = true
       processDetails({