DYaiu 4 lat temu
rodzic
commit
5b4351f05e

+ 8 - 0
src/api/treeAndTable.js

@@ -125,3 +125,11 @@ export function getUsers(params) {
         params
     })
 }
+
+// 删除用户接口
+export function deleteUser(id) {
+    return request({
+        url: url.User + id + '/',
+        method: 'delete',
+    })
+}

+ 14 - 0
src/views/treeAndTable/tree_and_table.vue

@@ -73,6 +73,7 @@ import {
   deleteJob,
   postUser,
   getUsers,
+  deleteUser,
 } from "@/api/treeAndTable.js";
 
 export default {
@@ -124,6 +125,19 @@ export default {
         }
       });
     },
+    // 人员标签页的删除按钮
+    deleteUser: function (id) {
+      deleteUser(id).then((res) => {
+        console.log(res);
+        if (res.status == 204) {
+          this.$message({
+            message: "删除岗位成功",
+            type: "warning",
+          });
+          this.tabClick({ name: "people" });
+        }
+      });
+    },
     // tabs点击的时候获取当前标签页下的所有信息
     tabClick: function (tabNode) {
       if (tabNode.name == "job") {