疯狂的狮子li
2021-10-20 82f1f5d0cf1b51a5d81915e842e01760f404fa74
ruoyi-ui/src/views/demo/demo/index.vue
@@ -169,7 +169,7 @@
</template>
<script>
import { listDemo, pageDemo, getDemo, delDemo, addDemo, updateDemo, exportDemo } from "@/api/demo/demo";
import { listDemo, pageDemo, getDemo, delDemo, addDemo, updateDemo } from "@/api/demo/demo";
export default {
  name: "Demo",
@@ -324,7 +324,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(() => {
@@ -332,7 +332,7 @@
            });
          } else {
            addDemo(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).finally(() => {
@@ -345,33 +345,20 @@
    /** 删除按钮操作 */
    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() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有测试单表数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.exportLoading = true;
        return exportDemo(queryParams);
      }).then(response => {
        this.download(response.msg);
        this.exportLoading = false;
      })
      this.$download.excel('/demo/demo/export', this.queryParams);
    }
  }
};