疯狂的狮子li
2021-11-17 2781655b0a965e1a5c39a24d06369c7dc87159ef
ruoyi-ui/src/views/demo/demo/index.vue
@@ -77,7 +77,6 @@
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleExport"
          v-hasPermi="['demo:demo:export']"
        >导出</el-button>
@@ -170,7 +169,6 @@
<script>
import { listDemo, pageDemo, getDemo, delDemo, addDemo, updateDemo } from "@/api/demo/demo";
import { downLoadExcel } from "@/utils/download";
export default {
  name: "Demo",
@@ -182,8 +180,6 @@
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
@@ -325,7 +321,7 @@
          this.buttonLoading = true;
          if (this.form.id != null) {
            updateDemo(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
@@ -333,7 +329,7 @@
            });
          } else {
            addDemo(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).finally(() => {
@@ -346,22 +342,22 @@
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm('是否确认删除测试单表编号为"' + ids + '"的数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
      this.$modal.confirm('是否确认删除测试单表编号为"' + ids + '"的数据项?').then(() => {
        this.loading = true;
        return delDemo(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.msgSuccess("删除成功");
      })
        this.$modal.msgSuccess("删除成功");
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      downLoadExcel('/demo/demo/export', this.queryParams);
      this.download('demo/demo/export', {
        ...this.queryParams
      }, `demo_${new Date().getTime()}.xlsx`)
    }
  }
};