config-9c004f0c.js 1.78 KB
var i=(e,s,t)=>new Promise((r,n)=>{var l=o=>{try{c(t.next(o))}catch(u){n(u)}},p=o=>{try{c(t.throw(o))}catch(u){n(u)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(l,p);c((t=t.apply(e,s)).next())});import{d as a}from"./index.js";function f(e,s="modal"){return i(this,null,function*(){const t=yield a.post({url:"/order/erp/system_setting/query_list",params:e},{errorMessageMode:s});return new Promise(r=>{r({items:(t==null?void 0:t.sort((n,l)=>n.settingValue.localeCompare(l.settingValue)))||[]})})})}function _(e){return a.post({url:"/order/erp/system_setting/edit",params:e},{message:"保存成功"})}function y(e){return a.post({url:"/order/erp/system_setting/add",params:e},{message:"新建成功"})}function v(e){return a.post({url:"/order/erp/system_setting/delete_by_id",params:e},{message:"删除成功"})}const V=e=>i(void 0,null,function*(){const s=yield a.post({url:"/order/erp/receive_email_mapping/list",params:e}),t=m(s.records);return t.sort((r,n)=>r.enableFlag===n.enableFlag?r.typeValue<n.typeValue?-1:r.typeValue>n.typeValue?1:0:r.enableFlag===10?-1:1),t});function m(e){for(const s of e){const t=JSON.parse(s.configInfos);s.configInfos=t;for(const r of s.configInfos){const n=r.fieldValue,p=r.emails.join(",");s[n]=p}}return e}const C=e=>i(void 0,null,function*(){return a.post({url:"/order/erp/receive_email_mapping/opt",params:e},{message:"操作成功"})}),b=e=>i(void 0,null,function*(){return a.post({url:"/order/erp/receive_email_mapping/delete_by_id",params:e})}),w=e=>i(void 0,null,function*(){return a.post({url:"/order/erp/receive_email_mapping/edit",params:e},{message:"保存成功"})}),E=e=>i(void 0,null,function*(){return a.post({url:"/order/erp/receive_email_mapping/add",params:e},{message:"保存成功"})});export{E as a,b,C as c,v as d,w as e,V as f,f as g,y as h,_ as s};