mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 04:08:43 +08:00 
			
		
		
		
	v3.8.0 新增通用方法简化模态/缓存使用
This commit is contained in:
		@@ -266,13 +266,13 @@ export default {
 | 
			
		||||
        if (valid) {
 | 
			
		||||
          if (this.form.id !== undefined) {
 | 
			
		||||
            updateData(this.form).then(response => {
 | 
			
		||||
              this.msgSuccess("修改成功");
 | 
			
		||||
              this.$modal.msgSuccess("修改成功");
 | 
			
		||||
              this.open = false;
 | 
			
		||||
              this.getList();
 | 
			
		||||
            });
 | 
			
		||||
          } else {
 | 
			
		||||
            addData(this.form).then(response => {
 | 
			
		||||
              this.msgSuccess("新增成功");
 | 
			
		||||
              this.$modal.msgSuccess("新增成功");
 | 
			
		||||
              this.open = false;
 | 
			
		||||
              this.getList();
 | 
			
		||||
            });
 | 
			
		||||
@@ -283,25 +283,17 @@ export default {
 | 
			
		||||
    /** 删除按钮操作 */
 | 
			
		||||
    handleDelete(row) {
 | 
			
		||||
      const ids = row.id;
 | 
			
		||||
      this.$confirm('是否确认删除字典编码为"' + ids + '"的数据项?', "警告", {
 | 
			
		||||
          confirmButtonText: "确定",
 | 
			
		||||
          cancelButtonText: "取消",
 | 
			
		||||
          type: "warning"
 | 
			
		||||
        }).then(function() {
 | 
			
		||||
      this.$modal.confirm('是否确认删除字典编码为"' + ids + '"的数据项?').then(function() {
 | 
			
		||||
          return delData(ids);
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.msgSuccess("删除成功");
 | 
			
		||||
          this.$modal.msgSuccess("删除成功");
 | 
			
		||||
      }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      const queryParams = this.queryParams;
 | 
			
		||||
      this.$confirm('是否确认导出所有数据项?', "警告", {
 | 
			
		||||
          confirmButtonText: "确定",
 | 
			
		||||
          cancelButtonText: "取消",
 | 
			
		||||
          type: "warning"
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
      this.$modal.confirm('是否确认导出所有数据项?').then(() => {
 | 
			
		||||
          this.exportLoading = true;
 | 
			
		||||
          return exportData(queryParams);
 | 
			
		||||
        }).then(response => {
 | 
			
		||||
 
 | 
			
		||||
@@ -214,13 +214,13 @@ export default {
 | 
			
		||||
        if (valid) {
 | 
			
		||||
          if (this.form.id !== undefined) {
 | 
			
		||||
            updateType(this.form).then(response => {
 | 
			
		||||
              this.msgSuccess("修改成功");
 | 
			
		||||
              this.$modal.msgSuccess("修改成功");
 | 
			
		||||
              this.open = false;
 | 
			
		||||
              this.getList();
 | 
			
		||||
            });
 | 
			
		||||
          } else {
 | 
			
		||||
            addType(this.form).then(response => {
 | 
			
		||||
              this.msgSuccess("新增成功");
 | 
			
		||||
              this.$modal.msgSuccess("新增成功");
 | 
			
		||||
              this.open = false;
 | 
			
		||||
              this.getList();
 | 
			
		||||
            });
 | 
			
		||||
@@ -231,15 +231,11 @@ export default {
 | 
			
		||||
    /** 删除按钮操作 */
 | 
			
		||||
    handleDelete(row) {
 | 
			
		||||
      const ids = row.id || this.ids;
 | 
			
		||||
      this.$confirm('是否确认删除字典编号为"' + ids + '"的数据项?', "警告", {
 | 
			
		||||
          confirmButtonText: "确定",
 | 
			
		||||
          cancelButtonText: "取消",
 | 
			
		||||
          type: "warning"
 | 
			
		||||
        }).then(function() {
 | 
			
		||||
      this.$modal.confirm('是否确认删除字典编号为"' + ids + '"的数据项?').then(function() {
 | 
			
		||||
          return delType(ids);
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.msgSuccess("删除成功");
 | 
			
		||||
          this.$modal.msgSuccess("删除成功");
 | 
			
		||||
      }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
@@ -250,11 +246,7 @@ export default {
 | 
			
		||||
      params.pageSize = undefined;
 | 
			
		||||
      this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
 | 
			
		||||
      // 执行导出
 | 
			
		||||
      this.$confirm('是否确认导出所有字典类型数据项?', "警告", {
 | 
			
		||||
        confirmButtonText: "确定",
 | 
			
		||||
        cancelButtonText: "取消",
 | 
			
		||||
        type: "warning"
 | 
			
		||||
      }).then(() => {
 | 
			
		||||
      this.$modal.confirm('是否确认导出所有字典类型数据项?').then(() => {
 | 
			
		||||
        this.exportLoading = true;
 | 
			
		||||
        return exportType(params);
 | 
			
		||||
      }).then(response => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user