sf_web_dist/js/channel-risk.1760951900646pPqflZkv.js
2025-10-20 17:19:43 +08:00

2 lines
6.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{D as e,r as l,ag as o,m as a,e as t,w as _,N as n,bq as d,g as m,al as s,O as u,br as p,l as r,am as i,bQ as y,d5 as w,bY as h,c as f,a7 as b,a8 as c,bZ as v,an as V,aX as R,dG as k,aO as x,dn as U}from"./index.1760951900646DOsBAR-m.js";import{E as O}from"./el-time-select.1760951900646CdfsFHTu.js";import{E as g}from"./el-text.1760951900646WtqOMiPo.js";const j={class:"flex"},C={class:"dialog-footer"},N={__name:"channel-risk",props:{showChannelRisk:{type:Boolean,default:!1},currentRow:{type:Object,default:{}}},emits:["update:showChannelRisk","loadData"],setup(N,{emit:J}){const S=N;e(()=>S.showChannelRisk,e=>{var l,o,a,t,_,n,d,m;e&&(q.not_allow_money=(null==(l=S.currentRow)?void 0:l.not_allow_money)?JSON.parse(null==(o=S.currentRow)?void 0:o.not_allow_money).join(","):"",q.min_money=S.currentRow.min_money,q.max_money=S.currentRow.max_money,q.allow_money=(null==(a=S.currentRow)?void 0:a.allow_money)?JSON.parse(null==(t=S.currentRow)?void 0:t.allow_money).join(","):"",q.money_type=S.currentRow.money_type||2,q.start_time=S.currentRow.start_time,q.end_time=S.currentRow.end_time,q.shop_type=S.currentRow.shop_type||0,q.allow_shop_ids=(null==(_=S.currentRow)?void 0:_.allow_shop_ids)?JSON.parse(null==(n=S.currentRow)?void 0:n.allow_shop_ids):[],q.forbid_shop_ids=(null==(d=S.currentRow)?void 0:d.forbid_shop_ids)?JSON.parse(null==(m=S.currentRow)?void 0:m.forbid_shop_ids):[],E())});const D=l([]),E=()=>{D.value=[],U({page:1,saiType:"all"}).then(e=>{Object.keys(e).forEach(l=>{e[l].id&&D.value.push({label:e[l].username,value:e[l].id})})})},q=o({money_type:2,not_allow_money:"",min_money:"",max_money:"",allow_money:"",start_time:"",end_time:"",shop_type:0,allow_shop_ids:[],forbid_shop_ids:[]}),B=()=>{q.money_type=2,q.not_allow_money="",q.min_money="",q.max_money="",q.allow_money="",q.start_time="",q.end_time="",q.shop_type=0},G=l(),Q=J,T=()=>{Q("update:showChannelRisk",!1),B()},X=()=>{G.value.validate(e=>{if(e){let e={not_allow_money:""!=(null==q?void 0:q.not_allow_money)?q.not_allow_money.split(","):[],min_money:q.min_money,max_money:q.max_money,allow_money:""!=q.allow_money?q.allow_money.split(","):[],start_time:q.start_time,end_time:q.end_time,money_type:q.money_type,id:S.currentRow.id,shop_type:q.shop_type,allow_shop_ids:q.allow_shop_ids,forbid_shop_ids:q.forbid_shop_ids};k(e).then(e=>{Q("update:showChannelRisk",!1),x.success("操作成功"),Q("loadData"),B()})}})};return(e,l)=>{const o=g,k=i,x=p,U=w,J=y,S=d,E=O,B=v,Q=h,Y=V,Z=R;return t(),a(Z,{"model-value":N.showChannelRisk,title:"风控",width:"600px","before-close":T},{footer:_(()=>[r("div",C,[n(Y,{type:"primary",onClick:X},{default:_(()=>l[19]||(l[19]=[u(" 提交保存 ")])),_:1,__:[19]})])]),default:_(()=>[n(S,{model:m(q),"label-width":"auto",ref_key:"channelRef",ref:G},{default:_(()=>[n(o,{type:"danger"},{default:_(()=>l[10]||(l[10]=[u("注意不需要风控的实现请默认为0")])),_:1,__:[10]}),n(x,{label:"限额排查",prop:"not_allow_money"},{default:_(()=>[n(k,{modelValue:m(q).not_allow_money,"onUpdate:modelValue":l[0]||(l[0]=e=>m(q).not_allow_money=e)},null,8,["modelValue"]),l[11]||(l[11]=r("span",null,"渠道需要排除的金额,英文,分割",-1))]),_:1,__:[11]}),n(x,{label:"金额模式",prop:"money_type"},{default:_(()=>[n(J,{modelValue:m(q).money_type,"onUpdate:modelValue":l[1]||(l[1]=e=>m(q).money_type=e)},{default:_(()=>[n(U,{value:2},{default:_(()=>l[12]||(l[12]=[u("区间金额")])),_:1,__:[12]}),n(U,{value:1},{default:_(()=>l[13]||(l[13]=[u("固定金额")])),_:1,__:[13]})]),_:1},8,["modelValue"])]),_:1}),2==m(q).money_type?(t(),a(S,{key:0,inline:!0,model:m(q),"label-width":"auto"},{default:_(()=>[n(x,{label:"单笔最小金额",prop:"min_money"},{default:_(()=>[n(k,{modelValue:m(q).min_money,"onUpdate:modelValue":l[2]||(l[2]=e=>m(q).min_money=e),type:"number"},null,8,["modelValue"])]),_:1}),n(x,{label:"单笔最大金额",prop:"max_money"},{default:_(()=>[n(k,{modelValue:m(q).max_money,"onUpdate:modelValue":l[3]||(l[3]=e=>m(q).max_money=e),type:"number"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])):s("",!0),1==m(q).money_type?(t(),a(x,{key:1,label:"固定金额",prop:"allow_money"},{default:_(()=>[n(k,{modelValue:m(q).allow_money,"onUpdate:modelValue":l[4]||(l[4]=e=>m(q).allow_money=e)},null,8,["modelValue"]),l[14]||(l[14]=r("span",null,"渠道可交易的固定金额,英文,分割",-1))]),_:1,__:[14]})):s("",!0),n(x,{label:"交易时间",prop:"start_time"},{default:_(()=>[r("div",j,[n(E,{modelValue:m(q).start_time,"onUpdate:modelValue":l[5]||(l[5]=e=>m(q).start_time=e),class:"mr-4",placeholder:"开始时间",start:"00:00",step:"01:00",end:"23:00"},null,8,["modelValue"]),l[15]||(l[15]=r("span",{style:{"margin-right":"12px"}},"-",-1)),n(E,{modelValue:m(q).end_time,"onUpdate:modelValue":l[6]||(l[6]=e=>m(q).end_time=e),class:"mr-4",placeholder:"结束时间",start:"00:00",step:"01:00",end:"23:00"},null,8,["modelValue"])])]),_:1}),n(x,{label:"商户限制",prop:"shop_type"},{default:_(()=>[n(J,{modelValue:m(q).shop_type,"onUpdate:modelValue":l[7]||(l[7]=e=>m(q).shop_type=e)},{default:_(()=>[n(U,{value:0},{default:_(()=>l[16]||(l[16]=[u("不限制")])),_:1,__:[16]}),n(U,{value:1},{default:_(()=>l[17]||(l[17]=[u("指定商户")])),_:1,__:[17]}),n(U,{value:2},{default:_(()=>l[18]||(l[18]=[u("禁止商户")])),_:1,__:[18]})]),_:1},8,["modelValue"])]),_:1}),1==m(q).shop_type?(t(),a(x,{key:2,label:"指定商户",prop:"allow_shop_ids"},{default:_(()=>[n(Q,{modelValue:m(q).allow_shop_ids,"onUpdate:modelValue":l[8]||(l[8]=e=>m(q).allow_shop_ids=e),multiple:"",placeholder:"请选择商户",filterable:!0,style:{width:"100%"},clearable:"","reserve-keyword":!1},{default:_(()=>[(t(!0),f(b,null,c(m(D),e=>(t(),a(B,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):s("",!0),2==m(q).shop_type?(t(),a(x,{key:3,label:"禁止商户",prop:"forbid_shop_ids"},{default:_(()=>[n(Q,{modelValue:m(q).forbid_shop_ids,"onUpdate:modelValue":l[9]||(l[9]=e=>m(q).forbid_shop_ids=e),multiple:"",placeholder:"请选择商户",filterable:!0,style:{width:"100%"},clearable:"","reserve-keyword":!1},{default:_(()=>[(t(!0),f(b,null,c(m(D),e=>(t(),a(B,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):s("",!0)]),_:1},8,["model"])]),_:1},8,["model-value"])}}};export{N as default};