Parcourir la source

feat(upgrade): version release record deletion

daigang il y a 3 ans
Parent
commit
adec5c9ef1

+ 8 - 0
src/api/upgrade.js

@@ -67,3 +67,11 @@ export function deployVersion (version) {
     data: version
   })
 }
+
+export function delVersion ({ id, deviceName, versionName, status }) {
+  return confirmAndSend('删除', `对${deviceName}的${versionName}升级${status === 1 ? '' : '记录'}`, {
+    url: '/apkUpgradePolicy/delBatchByIds',
+    method: 'post',
+    data: [id]
+  })
+}

+ 5 - 1
src/scss/bem/_component.scss

@@ -49,6 +49,10 @@
 
   .el-dialog__footer {
     border-top: 1px solid $gray--light;
+
+    .o-button + .o-button {
+      margin-left: $spacing;
+    }
   }
 }
 
@@ -131,7 +135,7 @@
     }
 
     & + & {
-      margin-top: 20px;
+      margin-top: $spacing;
     }
   }
 

+ 0 - 4
src/scss/bem/_object.scss

@@ -28,10 +28,6 @@
     margin-right: 10px;
   }
 
-  & + & {
-    margin-left: 20px;
-  }
-
   &.cancel {
     color: $gray--dark;
     background-color: $gray--light;

+ 24 - 1
src/views/upgrade/deploy/index.vue

@@ -114,6 +114,20 @@
           </el-tag>
         </template>
       </el-table-column>
+      <el-table-column
+        label="操作"
+        align="center"
+        width="100"
+      >
+        <template v-slot="scope">
+          <div
+            class="c-table__btn u-pointer"
+            @click="del(scope.row)"
+          >
+            删除
+          </div>
+        </template>
+      </el-table-column>
     </c-table>
     <el-dialog
       title="新增升级"
@@ -248,7 +262,8 @@
 import {
   getApks,
   getVersions,
-  deployVersion
+  deployVersion,
+  delVersion
 } from '@/api/upgrade'
 import { createListOptions } from '@/utils'
 import DeviceTree from '@/components/DeviceTree'
@@ -388,6 +403,14 @@ export default {
     onChange (devices) {
       this.$devices = devices
       this.devices = devices.map(device => device.name).join(', ')
+    },
+    del (version) {
+      delVersion(version).then(() => {
+        if (this.options.list.length === 1 && this.options.params.pageNum > 1) {
+          this.options.params.pageNum -= 1
+        }
+        this.getList()
+      })
     }
   }
 }