import{D as e,ag as a,r as t,m as l,e as o,w as s,N as n,l as d,O as i,an as r,g as p,bb as u,am as m,aX as h,aO as c}from"./index.17564591406745lmpCs6q.js";import{_}from"./index.17564591406749F8tamFh.js";import{E as w}from"./el-text.1756459140674dopA6ZEH.js";/* empty css */import"./el-col.1756459140674Gn9OdUhz.js";const g={__name:"fee-weight",props:{showFeeWeight:{type:Boolean,default:!1},currentRow:{type:Object,default:{}}},emits:["update:showFeeWeight"],setup(g,{emit:f}){const b=g;e(()=>b.showFeeWeight,e=>{e&&U()});const V=a({columns:[{label:"费率起始%",prop:"ID",slot:"fee_start_slot"},{label:"费率结算%",prop:"name",slot:"fee_end_slot"},{label:"权重(1-9)",prop:"name",slot:"weight_slot"},{label:"状态",prop:"name",slot:"status_slot"},{label:"操作",prop:"operate",slot:"operate_slot"}],searchFields:[],tableData:[],selectData:[]}),D=t(),y=f,F=()=>{y("update:showFeeWeight",!1)},U=()=>{V.tableData=[{ID:"1",name:"1",weight:"1",status:!0},{ID:"2",name:"2",weight:"2",status:!0},{ID:"3",name:"3",weight:"3",status:!0}]},k=()=>{V.tableData.push({ID:"",name:"",weight:"",status:!0})};return(e,a)=>{const t=w,f=r,b=m,y=u,x=_,C=h;return o(),l(C,{"model-value":g.showFeeWeight,title:"费率权重",width:"70vw","before-close":F,ref_key:"channelRef",ref:D},{default:s(()=>[n(t,null,{default:s(()=>a[1]||(a[1]=[i("批量权重管理(此处优先级高于户配置得权重)")])),_:1,__:[1]}),d("div",null,[n(f,{type:"primary",onClick:k},{default:s(()=>a[2]||(a[2]=[i("添加")])),_:1,__:[2]}),n(f,{type:"primary",onClick:e.addChannel},{default:s(()=>a[3]||(a[3]=[i("保存")])),_:1,__:[3]},8,["onClick"]),n(f,{type:"primary",onClick:e.addChannel},{default:s(()=>a[4]||(a[4]=[i("适配到批量")])),_:1,__:[4]},8,["onClick"])]),n(x,{type:"export",columns:p(V).columns,searchFields:p(V).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>p(V).searchFields=e),data:p(V).tableData,onGetTableData:U,paginationSlot:!1,loading:p(V).loading,showSelection:!1,showRightRefreshSlot:!1},{fee_start_slot:s(({row:e})=>[n(b,{modelValue:e.weight,"onUpdate:modelValue":a=>e.weight=a,placeholder:"百分比,例如百一输入1"},null,8,["modelValue","onUpdate:modelValue"])]),fee_end_slot:s(({row:e})=>[n(b,{modelValue:e.weight,"onUpdate:modelValue":a=>e.weight=a,placeholder:"百分比,例如百一输入1"},null,8,["modelValue","onUpdate:modelValue"])]),weight_slot:s(({row:e})=>[n(b,{modelValue:e.weight,"onUpdate:modelValue":a=>e.weight=a,placeholder:"权重值"},null,8,["modelValue","onUpdate:modelValue"])]),status_slot:s(({row:e})=>[n(y,{modelValue:e.status,"onUpdate:modelValue":a=>e.status=a,"inline-prompt":"","active-text":"开启","inactive-text":"关闭"},null,8,["modelValue","onUpdate:modelValue"])]),operate_slot:s(({row:e,index:t})=>[n(f,{type:"primary",onClick:e=>((e,a)=>{if(1==V.tableData.length)return c.error("至少保留一条数据");V.tableData.splice(a,1)})(0,t)},{default:s(()=>a[5]||(a[5]=[i("删除")])),_:2,__:[5]},1032,["onClick"])]),_:1},8,["columns","searchFields","data","loading"])]),_:1},8,["model-value"])}}};export{g as default};