import{A as w,t as V,B as A,C as F,R as $,v as j}from"./elementPlus.CqHltQSO.js";import{_ as m}from"./index.vue_vue_type_script_setup_true_lang.DfUMpYc_.js";import{g}from"./useTagColor.B-JXlmrE.js";import{h as P}from"./useCopyText.pVj3jbkF.js";import{h as v}from"./hasPermission.lEsua58A.js";import{d as R,ai as c,o as i,c as l,u as e,a as k,U as t,O as o,R as C,T as _,S as a}from"./vue.1RczIYhx.js";const U={class:"font-medium"},Y={key:0},O={class:"flex justify-center gap-2 mb-2"},q={key:0},G={key:1},H={key:2},I={key:1,class:"flex justify-center flex-nowrap"},J={key:2},K={key:3},L={key:4},M={key:5},ne=R({__name:"DataTableSlot",props:{row:{},field:{}},emits:["edit-row","handle-delete","show-sku","release-sku"],setup(x,{emit:N}){const S=x,{row:n,field:d}=S,p=N;function T(){p("edit-row",n)}function z(){p("handle-delete",n)}function B(){p("release-sku",n)}function D(){p("show-sku",n)}return(Q,s)=>{const f=c("el-icon"),r=c("el-button"),h=c("el-popconfirm"),E=c("el-tooltip"),y=c("el-tag");return i(),l("div",U,[e(d)==="operate"?(i(),l("div",Y,[k("div",O,[e(v)("SkuUpdate")?(i(),l("div",q,[t(m,{circle:"",plain:"",type:"warning",onClick:T},{default:o(()=>[t(f,null,{default:o(()=>[t(e(A))]),_:1})]),_:1})])):C("",!0),e(v)("SkuDelete")?(i(),l("div",G,[t(h,{icon:e(w),"icon-color":"#626AEF",title:"你确定要删除此项吗?",width:"220",onConfirm:z},{reference:o(()=>[t(m,{disabled:e(n).status===3,circle:"",plain:"",type:"danger"},{default:o(()=>[t(f,null,{default:o(()=>[t(e(F))]),_:1})]),_:1},8,["disabled"])]),actions:o(({confirm:u,cancel:b})=>[t(r,{size:"small",onClick:b},{default:o(()=>s[2]||(s[2]=[a("No!")])),_:2},1032,["onClick"]),t(r,{size:"small",type:"danger",onClick:u},{default:o(()=>s[3]||(s[3]=[a(" Yes?")])),_:2},1032,["onClick"])]),_:1},8,["icon"])])):C("",!0),e(v)("SkuPublish")?(i(),l("div",H,[t(h,{icon:e(w),"icon-color":"#626AEF",title:"发布后此sku将无法更改, 是否继续?",width:"220",onConfirm:B},{reference:o(()=>[k("div",null,[t(E,{enterable:!1,"show-arrow":!1,content:"发布","hide-after":"0",placement:"top","popper-class":"custom-btn-tooltip-2",disabled:e(n).status===3},{default:o(()=>[t(m,{color:"#6466F1",disabled:e(n).status===3,circle:"",plain:""},{default:o(()=>[t(f,null,{default:o(()=>[t(e($))]),_:1})]),_:1},8,["disabled"])]),_:1},8,["disabled"])])]),actions:o(({confirm:u,cancel:b})=>[t(r,{size:"small",onClick:b},{default:o(()=>s[4]||(s[4]=[a("No!")])),_:2},1032,["onClick"]),t(r,{size:"small",type:"danger",onClick:u},{default:o(()=>s[5]||(s[5]=[a(" Yes?")])),_:2},1032,["onClick"])]),_:1},8,["icon"])])):C("",!0),k("div",null,[t(m,{circle:"",plain:"",type:"success",onClick:s[0]||(s[0]=u=>D())},{default:o(()=>[t(f,null,{default:o(()=>[t(e(j))]),_:1})]),_:1})])])])):e(d)==="sku"?(i(),l("div",I,[k("div",null,_(e(n).sku),1),t(r,{disabled:!e(n).sku,icon:e(V),class:"ml-1 cursor-pointer",link:"",onClick:s[1]||(s[1]=u=>e(P)(e(n).sku||""))},null,8,["disabled","icon"])])):e(d)==="brand"?(i(),l("div",J,[t(y,{"disable-transitions":!0,type:e(g)(e(n).brand.brand_name),effect:"plain",round:""},{default:o(()=>[a(_(e(n).brand.brand_name),1)]),_:1},8,["type"])])):e(d)==="kind"?(i(),l("div",K,[t(y,{"disable-transitions":!0,type:e(g)(e(n).kind.name),effect:"plain",round:""},{default:o(()=>[a(_(e(n).kind.name),1)]),_:1},8,["type"])])):e(d)==="status"?(i(),l("div",L,[t(y,{"disable-transitions":!0,type:e(n).status===1?"warning":"success"},{default:o(()=>[a(_(e(n).status===1?"草稿":"已发布"),1)]),_:1},8,["type"])])):(i(),l("div",M,_(e(n)[e(d)]||"-"),1))])}}});export{ne as _};
