田源
2023-10-16 740eb602148bf4c89d526a39c8bd93eaa5a16a04
相似项查重规则-增删改查刷新 完善
已修改2个文件
73 ■■■■■ 文件已修改
Source/UBCS-WEB/src/api/code/codeMatch.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/code/Match.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/code/codeMatch.js
@@ -39,5 +39,5 @@
    url: '/api/ubcs-code/resembleRuleController/deleteData',
    method: 'delete',
    data:formData
  })
  });
}
Source/UBCS-WEB/src/views/code/Match.vue
@@ -1,11 +1,11 @@
<template>
<basic-container>
  <avue-crud :option="option"
             :table-loading="loading"
             :data="data"
             ref="crud"
    <avue-crud ref="crud"
             v-model="form"
               :data="data"
               :option="option"
             :page.sync="page"
               :table-loading="loading"
             @row-del="rowDel"
             @row-update="rowUpdate"
             @row-save="rowSave"
@@ -14,28 +14,28 @@
             @size-change="sizeChange"
             @refresh-change="refreshChange"
             @on-load="onLoad">
    <template slot="menuLeft">
      <el-button type="primary"
      <template slot="menuLeft" slot-scope="scope">
        <el-button icon="el-icon-search"
                   plain
                 size="small"
                 icon="el-icon-search"
                 plain @click="searchHandler">查 询
                   type="primary" @click="searchHandler">查 询
      </el-button>
      <advanced-query :options="options" :visible.sync="findvisible"
                      @echoContion="echoContion"></advanced-query>
      <el-button type="danger"
        <el-button icon="el-icon-delete"
                   plain
                 size="small"
                 icon="el-icon-delete"
                 plain @click="deleteHandler">删 除
                   type="danger" @click="deleteHandler">删 除
      </el-button>
      <el-button type="success"
        <el-button icon="el-icon-edit"
                   plain
                 size="small"
                 icon="el-icon-edit"
                 plain>修 改
                   type="success" @click="editHandler">修 改
      </el-button>
      <el-button type="primary"
        <el-button icon="el-icon-refresh-right"
                   plain
                 size="small"
                 icon="el-icon-refresh-right"
                 plain>刷 新
                   type="primary" @click="onLoad">刷 新
      </el-button>
    </template>
  </avue-crud>
@@ -44,6 +44,7 @@
<script>
import {getList,add,editSave,deleteData} from "@/api/code/codeMatch";
export default {
name: "Match",
  data(){
@@ -219,17 +220,22 @@
    },
    deleteHandler(){
      if(this.selectRow.length <= 0){
        this.$message.warning('请选择一条数据')
      }else {
      const length = this.selectRow.length;
      if (length > 1) {
        this.$message.warning('只能选择一条数据!');
        return;
      }
      if (length <= 0) {
        this.$message.warning('请选择一条数据! ');
        return;
      }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            const Obj = [...this.selectRow];
            return deleteData(item);
          return deleteData(this.selectRow[0])
          })
          .then(() => {
            this.onLoad(this.page);
@@ -238,7 +244,19 @@
              message: "操作成功!"
            });
          });
    },
    editHandler() {
      const length = this.selectRow.length;
      if (length > 1) {
        this.$message.warning('只能选择一条数据!');
        return;
      }
      if (length <= 0) {
        this.$message.warning('请选择一条数据! ');
        return;
      }
      this.$refs.crud.rowEdit(this.selectRow[0]);
    },
    rowDel(row){
      this.$confirm("确定将选择数据删除?", {
@@ -285,7 +303,7 @@
      });
    },
    selectionChange(row){
      console.log(row)
      // console.log(row)
      this.selectRow=row;
    },
    currentChange(currentPage) {
@@ -298,12 +316,15 @@
      this.onLoad( this.page.currentPage,this.page.pageSize);
    },
    onLoad(page){
      this.loading = true;
      getList( this.page.currentPage,this.page.pageSize).then(res=>{
        if (res.data && res.data.data.length > 0) {
        this.page.total = res.data.total;
        this.data = res.data.data;
        }
        this.loading = false;
      })
    },
      });
    }
  }
}
</script>