فهرست منبع

删除规范接口调用

duy 2 ماه پیش
والد
کامیت
ac46d1ffda
1فایلهای تغییر یافته به همراه26 افزوده شده و 12 حذف شده
  1. 26 12
      src/views/codeRule/ruleManage.vue

+ 26 - 12
src/views/codeRule/ruleManage.vue

@@ -331,7 +331,7 @@
           <el-table-column label="操作" width="200">
             <template slot-scope="scope">
              
-              <el-button type="text" size="small" style="color: rgb(219, 55, 55);" @click="delManange(scope.$index)">删除</el-button>
+              <el-button type="text" size="small" style="color: rgb(219, 55, 55);" @click="delManange(scope.$index,scope.row)">删除</el-button>
             </template>
 
           </el-table-column>
@@ -339,7 +339,7 @@
         </el-table>
           <div slot="footer" class="dialog-footer">
           <el-button @click="manageVisible = false">取 消</el-button>
-          <el-button type="primary" @click="manageVisible = false">确 定</el-button>
+          <el-button type="primary" @click="manageSave" :loading="manageLoad">确 定</el-button>
         </div>
       </el-dialog>
 
@@ -395,7 +395,7 @@ import {getLazytree} from "@/api/manager/wbsprivate";
 import ConditionsSet from './ConditionsSet.vue'
 import LinkEle from "./LinkEle.vue";
 import PreviewResult from './PreviewResult.vue'
-import {getPage,getById,add} from "@/api/ruleManage/fileRule.js";
+import {getPage,getById,add,deleteItem} from "@/api/ruleManage/fileRule.js";
 import { getStore, setStore } from "@/util/store";
   export default {
   components: {
@@ -447,13 +447,8 @@ import { getStore, setStore } from "@/util/store";
         
         },
         manageVisible: false,
-        manageData: [
-          { name: '规范1' },
-          { name: '规范2' },
-          { name: '规范3' },
-          { name: '规范4' },
-          { name: '规范5' }
-        ],
+        manageData: [],
+        manageLoad: false,
         addFileDialogVisible:false,
         fileForm:{},
         fileList:[],
@@ -665,15 +660,30 @@ import { getStore, setStore } from "@/util/store";
     // 管理文件夹
     manageFolder(){
       this.manageVisible = true;
+      this.manageData=JSON.parse(JSON.stringify(this.ruleItemOptions));
     },
-    delManange(index){
+    delManange(index,row){
            this.$confirm('删除后,数据将无法恢复,是否确认删除!', '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             type: 'warning'
           }).then(() => {
-           this.manageData.splice(index, 1);
+          //  this.manageData.splice(index, 1);
+            deleteItem({id:row.id}).then((res) => {
+              if(res.data.code==200){
+                this.$message.success(res.data.msg);
+                this.getRuleItemOptions();
+                this.manageData.splice(index, 1);
+              }else{
+                this.$message.error(res.data.msg);
+              }
+            });
+          }).catch(() => {
+            this.$message.info('已取消删除');
           })
+    },
+    manageSave(){
+
     },
       handleEdit(item, index) {
         // 处理编辑逻辑
@@ -997,4 +1007,8 @@ import { getStore, setStore } from "@/util/store";
 .empty-container{
   height: 600px;
 }
+.dialog-footer{
+  text-align: center;
+
+}
 </style>