/**
 * Created by 1 at 2022-07-26 11:11:24
 * 注册事件类【数据字典管理】，参看event.defaultEvent.js
*/
window.$swEvent.setup("bpm.sys.base.dict.dictList", {
  setup(page){
    const { $params,$refs, $widgets, $model, $utils, $tabRouter, $api,$lifecycle } = page || {};
    const { $$message, $$http } = $utils || {};
    // 删除类型之后
    const afterDelDictType = () => {
      $api.loadOne("dictTypeList");
    };
    // 删除字典之后
    const afterDelDict = () => {
      $api.loadOne("dictList");
    };
    const exportExcel = () => {
      $$http.post("bpm/dict/exportExcel").then( (rt) => {
        console.info("exportExcel:",rt);
        const url = $$http.downloadFileUrl(rt.data.filePath,rt.data.fileName,true);
         $$http.downloadFile(url,{fileName: rt.data.fileName});
      });
    }
    return {
      afterDelDictType,
      afterDelDict,
      exportExcel,
    }
  }
});
