Source/plt-web/plt-web-ui/src/components/actions/base/downloadFileAction.js
@@ -5,8 +5,10 @@
import {validatenull} from "@/util/validate";
import Vue from "vue";
import func from "@/util/func";
import {download} from "@/api/base/file";
export const doAction = (options,callback) => {
  console.log(options)
  options.sourceData = options.sourceData || {};
  options.dataStore = options.dataStore || [];
  if (!options.dataStore || options.dataStore.length < 1) {
@@ -21,7 +23,7 @@
  callPreEvent(options, doBefore, function (options) {
    showStartWindow(options, function () {
      callPostEvent(options, doAfter, callback,type);
      callPostEvent(options, doAfter, callback,'downloadfile');
    });
  });
};
@@ -33,10 +35,24 @@
 */
export const showStartWindow = (options,callback)=> {
  const paramVOS = options.paramVOS;
  if (!paramVOS['form'] && !paramVOS['context']) {
    Vue.prototype.$message.error("按钮配置不正确");
    return false;
  }
  const oids = options.dataStore.map(item => item.oid).join(',');
  let data = new FormData();
  data.append('fileOid',oids);
  download(data).then(res => {
    console.log('res',res);
    if (res.data.code == 200) {
      func.downloadFileByBlobHandler(res);
      Vue.prototype.$message.success("下载成功");
    }else {
      Vue.prototype.$message.error("下载失败,请检查网络请求!");
    }
  }).catch(err => {
    console.log(err);
  });
  // if (!paramVOS['form'] && !paramVOS['context']) {
  //   Vue.prototype.$message.error("按钮配置不正确");
  //   return false;
  // }
  // func.downloadFileByBlobHandler();
}