import{h as x}from"./hasPermission.lEsua58A.js";import{A as U,B as j,C as J}from"./elementPlus.CqHltQSO.js";import{_ as w}from"./index.vue_vue_type_script_setup_true_lang.DfUMpYc_.js";import{u as L}from"./countryInfo.Df1X6FZ-.js";import{d as O,k as g,ai as u,o as n,c as r,u as e,a as Y,U as t,O as s,R as I,T as a,J as D,S as m}from"./vue.1RczIYhx.js";const $={class:"font-semibold"},q={key:0},G={class:"flex justify-center gap-2"},H={key:0},K={key:1},M={key:1},Q={key:2},W={key:3},X={key:4},Z={key:5},ee={key:6},ie=O({__name:"DataTableSlot",props:{row:{},field:{}},emits:["edit-row","handle-delete","handle-manage","show-detail"],setup(S,{emit:T}){const A=S,{row:o,field:i}=A,C=T,h=L(),c=h.Countries.find(f=>f.code==o.country_code),k=c?c.color:"#626AEF",l=h.CurrencyCodes.find(f=>f.code==o.currency_code),v=l?l.color:"#626AEF",N=parseFloat(o.export_tax)+parseFloat(o.first_cost)+parseFloat(o.final_cost)+parseFloat(o.forwarding_fee)+parseFloat(o.ad_budget)+parseFloat(o.return_or_refurbishment)+parseFloat(o.storage_charges)+parseFloat(o.brokerage),_=g(()=>o.price_daily_rmb-N),d=g(()=>_.value/o.price_daily_rmb),y=g(()=>.8*d.value+.2*o.gross_profit_margin);function R(){C("edit-row",o)}function B(){C("handle-delete",o)}return(f,p)=>{const F=u("el-icon"),b=u("el-button"),P=u("el-popconfirm"),E=u("el-tag");return n(),r("div",$,[e(i)==="operate"?(n(),r("div",q,[Y("div",G,[e(x)("PRICE_DIRECT_UPDATE")?(n(),r("div",H,[t(w,{circle:"",plain:"",type:"warning",onClick:R},{default:s(()=>[t(F,null,{default:s(()=>[t(e(j))]),_:1})]),_:1})])):I("",!0),e(x)("PRICE_DIRECT_DEL")?(n(),r("div",K,[t(P,{icon:e(U),"icon-color":"#626AEF",title:"你确定要删除此项吗?",width:"220",onConfirm:B},{reference:s(()=>[t(w,{circle:"",plain:"",type:"danger"},{default:s(()=>[t(F,null,{default:s(()=>[t(e(J))]),_:1})]),_:1})]),actions:s(({confirm:V,cancel:z})=>[t(b,{size:"small",onClick:z},{default:s(()=>p[0]||(p[0]=[m("No!")])),_:2},1032,["onClick"]),t(b,{size:"small",type:"danger",onClick:V},{default:s(()=>p[1]||(p[1]=[m(" Yes?")])),_:2},1032,["onClick"])]),_:1},8,["icon"])])):I("",!0)])])):e(i)==="average_gross_profit"?(n(),r("div",M,a(e(y)&&e(y)!==-1/0?e(y).toFixed(2):"-"),1)):e(i)==="routine_activity_profit"?(n(),r("div",Q,a(e(_)&&e(_)!==-1/0?e(_).toFixed(2):"-"),1)):e(i)==="gross_margin_daily"?(n(),r("div",W,a(e(d)&&e(d)!==-1/0?e(d).toFixed(2):"-"),1)):e(i)==="country_code"?(n(),r("div",X,[t(E,{"disable-transitions":!0,style:D({color:e(k),borderColor:e(k)}),effect:"plain",round:""},{default:s(()=>[m(a(e(c)?e(c).name:"-"),1)]),_:1},8,["style"])])):e(i)==="currency_code"?(n(),r("div",Z,[t(E,{"disable-transitions":!0,style:D({color:e(v),borderColor:e(v)}),effect:"plain",round:""},{default:s(()=>[m(a(e(l)?e(l).code:"-"),1)]),_:1},8,["style"])])):(n(),r("div",ee,a(e(o)[e(i)]||"-"),1))])}}});export{ie as _};
