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