xusl 7 місяців тому
батько
коміт
e8feffc26d

+ 3 - 3
cpp-admin/src/main/java/com/cpp/web/controller/configManager/InverterInfoController.java

@@ -102,9 +102,9 @@ public class InverterInfoController {
      * @return R
      */
     @ApiOperation(value = "通过id删除idp_inverter_info", notes = "通过id删除idp_inverter_info")
-    @DeleteMapping("/{id}")
-    public R removeById(@PathVariable String id) {
-        return R.ok(inverterInfoService.removeById(id));
+    @PostMapping("/remove")
+    public R remove(@RequestBody InverterInfo inverterInfo) {
+        return R.ok(inverterInfoService.removeById(inverterInfo.getId()));
     }
 
     /**

+ 33 - 2
cpp-ui/src/views/configManager/inverterinfo/index.vue

@@ -47,7 +47,6 @@
             plain
             icon="el-icon-delete"
             size="mini"
-            :disabled="multiple"
             @click="handleDelete"
             v-hasPermi="['system:user:remove']"
         >删除
@@ -110,7 +109,7 @@
       </vxe-pager>
     </div>
 
-    <el-dialog :title="title" :visible.sync="open" width="750px" height="600px">
+    <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="750px" height="600px">
       <el-form ref="form" :model="form" :rules="rules" width="730px" label-width="130px">
         <el-row class="mb4">
           <el-col :span="12">
@@ -303,6 +302,38 @@ export default {
         }
       });
     },
+    /** 删除按钮操作 */
+    handleDelete() {
+      const _selectData = this.$refs.xTable.getRadioRecord(true)
+      if (_selectData == null) {
+        this.$message({
+          type: 'warning',
+          message: '请选择记录!'
+        });
+        return
+      }
+
+      this.$confirm('是否确认删除?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.doDelete(_selectData)
+      }).catch(() => {
+      });
+    },
+    /**
+     * 删除提交
+     */
+    doDelete(row) {
+      this.$request.post('/inverterinfo/remove', row).then((res) => {
+        this.$message.success('删除成功!')
+        this.stationChange()
+        this.dataQuery()
+      }).catch((error) => {
+      })
+      this.loading = false
+    },
     stationChange() {
       this.currentPage = 1
       this.pageSize = 10