Эх сурвалжийг харах

1、修改轮播图状态启用/停用

41235 1 жил өмнө
parent
commit
d33b674e43

+ 2 - 7
src/views/XMHJC/carousel/index.vue

@@ -308,11 +308,7 @@ const submitForm = () => {
 };
 };
 
 
 const changeStatus = (row) => {
 const changeStatus = (row) => {
-  modalType.value = "edit";
-  let status = row.status == "1" ? 0 : 1;
-  proxy.post("/carouselManager/detail", { id: row.id }).then((res) => {
-    res.status = status;
-    formData.data = res;
+    let status = row.status == "1" ? 0 : 1;
     ElMessageBox.confirm("你是否确认此操作?", "提示", {
     ElMessageBox.confirm("你是否确认此操作?", "提示", {
       confirmButtonText: "确定",
       confirmButtonText: "确定",
       cancelButtonText: "取消",
       cancelButtonText: "取消",
@@ -320,7 +316,7 @@ const changeStatus = (row) => {
     }).then(() => {
     }).then(() => {
       // 更新状态
       // 更新状态
       proxy
       proxy
-        .post("/carouselManager/" + modalType.value, formData.data)
+        .post("/carouselManager/changeStatus", {id:row.id,status:status})
         .then((res) => {
         .then((res) => {
           ElMessage({
           ElMessage({
             message: "操作成功",
             message: "操作成功",
@@ -329,7 +325,6 @@ const changeStatus = (row) => {
           getList();
           getList();
         });
         });
     });
     });
-  });
 };
 };
 
 
 //编辑详情
 //编辑详情