wzy 2 روز پیش
والد
کامیت
2252eae8bb
2فایلهای تغییر یافته به همراه52 افزوده شده و 45 حذف شده
  1. 30 28
      src/views/rm-bank/classify/index.vue
  2. 22 17
      src/views/rm-bank/tab/index.vue

+ 30 - 28
src/views/rm-bank/classify/index.vue

@@ -17,10 +17,11 @@
 
       <el-table :data="tableData.list" :preserve-expanded-content="preserveExpanded" border row-key="id">
         <!-- <el-table-column type="selection" width="55" :selectable="selectable" /> -->
+        <el-table-column type="index" width="50" label="序号" />
         <el-table-column prop="name" label="名字" />
         <el-table-column prop="id" label="标签id" />
         <el-table-column prop="updateTime" label="创建时间" />
-        <!-- <el-table-column prop="sort" label="Address" /> -->
+        <el-table-column prop="sort" label="排序值" />
         <el-table-column prop="status" label="操作">
           <template slot-scope="scope">
             <!-- <el-button type="text" @click="checkRow(scope.row)">查看</el-button> -->
@@ -66,7 +67,7 @@
 </template>
 
 <script>
-import { pageLabelsApi, labelByIdApi, deleteByIdApi, saveLabelApi, getTypesApi,updateByIdApi } from '@/api/rm-bank'
+import { pageLabelsApi, labelByIdApi, deleteByIdApi, saveLabelApi, getTypesApi, updateByIdApi } from '@/api/rm-bank'
 export default {
   data() {
     return {
@@ -79,7 +80,7 @@ export default {
       },
       tableData: [],
       dialogVisible: false,
-      updataType:false,
+      updataType: false,
       //分类
       classifyDetail: {
         "parentId": 0,
@@ -125,7 +126,7 @@ export default {
     },
     // 修改信息
     async updateRow(e) {
-      
+
       const res = await labelByIdApi({ id: e.id })
       // console.log(res.data);
       this.classifyDetail = res.data
@@ -145,42 +146,43 @@ export default {
         "type": 2
       }
     },
-    deleteWindow(){
-     
+    deleteWindow() {
+
     },
- 
-    closeUpdata(){
-      this.updataType=false
+
+    closeUpdata() {
+      this.updataType = false
       this.classifyDetail = {
         "parentId": 0,
         "name": '',
         "sort": '',
         "type": 2
       }
-    },  
+    },
     // 删除信息
-    async deleteRow(row) {
+    deleteRow(row) {
       // this.deleteWindow()
       const deleteId = { id: row.id }
       // const res = await deleteByIdApi(deleteId)
       this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          deleteByIdApi(deleteId)
-          this.$message({
-            type: 'success',
-            message: '删除成功!',
-          });
-      this.getTypes()
-
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });          
-        }); 
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async() => {
+        const res = await deleteByIdApi(deleteId)
+        if(res.code == 200){
+        this.$message({
+          type: 'success',
+          message: '删除成功!',
+        });
+        this.getTypes()
+      }
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
 
     },
     async search() {

+ 22 - 17
src/views/rm-bank/tab/index.vue

@@ -18,10 +18,12 @@
       <el-table :data="tableData" :preserve-expanded-content="preserveExpanded" border
         :tree-props="{ children: 'children', checkStrictly: false }" row-key="id">
         <!-- <el-table-column type="selection" width="55" :selectable="selectable" /> -->
+        <el-table-column type="index" width="50" label="序号" />
         <el-table-column prop="name" width="600" label="名字" />
         <el-table-column width="100px" prop="id" label="标签id" />
         <el-table-column prop="updateTime" label="创建时间" />
         <!-- <el-table-column prop="sort" label="Address" /> -->
+        <el-table-column prop="sort" label="排序值" />
         <el-table-column prop="status" label="操作">
           <template slot-scope="scope">
             <!-- <el-button type="text" @click="checkRow(scope.row)">查看</el-button> -->
@@ -153,25 +155,28 @@ export default {
     },
     // 删除信息
     async deleteRow(row) {
+      // this.deleteWindow()
       const deleteId = { id: row.id }
-
+      // const res = await deleteByIdApi(deleteId)
       this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          deleteByIdApi(deleteId)
-      this.getTypes()
-          this.$message({
-            type: 'success',
-            message: '删除成功!'
-          });
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });          
-        });      
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async() => {
+        const res = await deleteByIdApi(deleteId)
+        if(res.code == 200){
+        this.$message({
+          type: 'success',
+          message: '删除成功!',
+        });
+        this.getTypes()
+      }
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
     },
     async search() {
       const res = await getTypesApi(this.tabQuery)