王旭
2022-09-26 0628d060ba7769c7849e7978aabc412487eb74d5
src/views/datamanage/dictionaryManage.vue
@@ -294,12 +294,10 @@
<script>
import {
  insertDict,
  CountDict,
  SelectDict,
  DeletestDict,
  UpdateDict,
  QueryNamesDict,
} from "../../api/api";
import MyBread from "../../components/MyBread.vue";
export default {
@@ -341,9 +339,7 @@
      })
        .then(() => {
          this.dialogFormVisible = false;
          UpdateDict(this.upform).then((res) => {
            console.log(res);
          });
          this.$message({
            message: "修改成功",
            type: "success",
@@ -394,7 +390,7 @@
        type: "warning",
      })
        .then(() => {
          DeletestDict([row.id]);
          this.$message({
            type: "success",
            message: "删除成功!",
@@ -423,34 +419,15 @@
        .then(() => {
          this.InsertFormdialog = false;
          insertDict(this.insertform).then((res) => {
            if ((res.statusText = "OK" && res.data > 0)) {
              this.$message({
                message: "添加成功",
                type: "success",
              });
              this.startFromData();
              this.insertform = {};
            } else {
              this.$message({
                message: "添加失败",
                type: "error",
              });
              this.insertform = {};
            }
          });
        })
        .catch(() => {});
    },
    countFromData(name) {
      CountDict(name).then((res) => {
        this.count = res.data;
      });
    },
    selectFromData(size, index, name) {
      SelectDict(size, index, name).then((res) => {
        this.tableData = res.data;
      });
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
@@ -466,7 +443,7 @@
        type: "warning",
      })
        .then(() => {
          DeletestDict(std);
          this.$message({
            type: "success",
            message: "删除成功!",
@@ -483,15 +460,7 @@
      this.countFromData(this.searchName);
    },
    startQueryNameData() {
      QueryNamesDict().then((res) => {
        console.log(res);
        for (var i in res.data) {
          this.selectName.push({
            value: res.data[i].name,
            label: res.data[i].name,
          });
        }
      });
    },
    changeQueryName(val) {
      this.searchName = val;