import{a as e,G as a,o as l,e as t,f as o,g as s,w as d,H as n,c as r,I as u,J as c,r as i,L as m,h as p,t as b,p as f,i as g}from"./vendor.347ab8d9.js";import{a as h,g as _,b as v,d as w}from"./risk.666ccd79.js";import{_ as V}from"./index.d59ad4c2.js";import"./request.dc2ccb4c.js";const y={name:"risk-company",setup(){const l=e({subcode:"",page:1,pageSize:10}),t=e([{value:"",label:""}]),o=a(!0),s=a([]),d=a(0),n=()=>{h(l).then((e=>{s.value=e.data.data,d.value=e.data.total||0,o.value=!1}))};n();const r=a(""),i=a(!1),m=e({});return{query:l,loading:o,options:t,tableData:s,pageTotal:d,editVisible:i,form:m,title:r,handleAdd:()=>{console.log(t),_().then((e=>{let a=e.data.data;Object.keys(a).forEach((e=>{t[e].value=a[e].id,t[e].label=a[e].stockjobber+": "+a[e].lid}))})),m.nums="100",m.loss_warn="50",m.loss_close="20",r.value="新增子账号",i.value=!0},handleSearch:()=>{o.value=!0,l.page=1,n()},handlePageChange:e=>{o.value=!0,l.page=e,n()},handleDelete:(a,l)=>{c.confirm("确定要删除吗？","提示",{type:"warning"}).then((()=>{const t=e({id:l.id});w(t).then((e=>{200==e.status?(u.success("删除成功"),s.value.splice(a,1)):u.error(e.msg)}))})).catch((()=>{u.success("删除失败")}))},saveEdit:()=>{v(m).then((e=>{200==e.status?(u.success(e.msg),i.value=!1,n()):u.error(e.msg)}))}}}},k={class:"crumbs"},C=(e=>(f("data-v-6a663ed2"),e=e(),g(),e))((()=>o("i",{class:"el-icon-lx-sort"},null,-1))),x=p(" 证券公司列表 "),j={class:"container"},q={class:"handle-box"},U=p("新增"),D=p("搜索"),z={class:"number"},S=p("删除"),E={class:"pagination"},I={class:"dialog-footer"},T=p("取 消"),A=p("确 定");var P=V(y,[["render",function(e,a,u,c,f,g){const h=i("el-breadcrumb-item"),_=i("el-breadcrumb"),v=i("el-button"),w=i("el-input"),V=i("el-table-column"),y=i("el-tag"),P=i("el-table"),G=i("el-pagination"),H=i("el-form-item"),J=i("el-cascader"),L=i("el-form"),O=i("el-dialog"),$=m("loading");return l(),t("div",null,[o("div",k,[s(_,{separator:"/"},{default:d((()=>[s(h,null,{default:d((()=>[C,x])),_:1})])),_:1})]),o("div",j,[o("div",q,[s(v,{class:"mr10",type:"primary",icon:"el-icon-plus",onClick:a[0]||(a[0]=e=>c.handleAdd())},{default:d((()=>[U])),_:1}),s(w,{modelValue:c.query.subcode,"onUpdate:modelValue":a[1]||(a[1]=e=>c.query.subcode=e),placeholder:"交易账户",class:"handle-input mr10",clearable:""},null,8,["modelValue"]),s(v,{type:"primary",icon:"el-icon-search",onClick:c.handleSearch},{default:d((()=>[D])),_:1},8,["onClick"])]),n((l(),r(P,{data:c.tableData,border:"",class:"table",ref:"multipleTable","header-cell-class-name":"table-header"},{default:d((()=>[s(V,{label:"ID",width:"80",align:"center"},{default:d((e=>[p(b(e.row.id),1)])),_:1}),s(V,{label:"交易账号",align:"center"},{default:d((e=>[p(b(e.row.sub_account),1)])),_:1}),s(V,{label:"对应用户账号",align:"center"},{default:d((e=>[o("div",z,b(e.row.mobile),1)])),_:1}),s(V,{label:"账户模式",align:"center"},{default:d((e=>[p(b(e.row.stockjobber),1)])),_:1}),s(V,{label:"创建时间",align:"center"},{default:d((e=>[p(b(e.row.create_time||"--"),1)])),_:1}),s(V,{label:"状态",align:"center",width:"120"},{default:d((e=>[s(y,{type:1===e.row.status?"warning":0===e.row.status?"success":""},{default:d((()=>[p(b(e.row.status?"已使用":"可用"),1)])),_:2},1032,["type"])])),_:1}),s(V,{label:"操作",align:"center",width:"180"},{default:d((e=>[s(v,{type:"text",icon:"el-icon-close",onClick:a=>c.handleDelete(e.$index,e.row)},{default:d((()=>[S])),_:2},1032,["onClick"])])),_:1})])),_:1},8,["data"])),[[$,c.loading]]),o("div",E,[s(G,{background:"",layout:"total, prev, pager, next","current-page":c.query.page,"page-size":c.query.pageSize,total:c.pageTotal,onCurrentChange:c.handlePageChange},null,8,["current-page","page-size","total","onCurrentChange"])])]),s(O,{title:c.title,modelValue:c.editVisible,"onUpdate:modelValue":a[7]||(a[7]=e=>c.editVisible=e),width:"400px"},{footer:d((()=>[o("span",I,[s(v,{onClick:a[6]||(a[6]=e=>c.editVisible=!1)},{default:d((()=>[T])),_:1}),s(v,{type:"primary",onClick:c.saveEdit},{default:d((()=>[A])),_:1},8,["onClick"])])])),default:d((()=>[s(L,{"label-width":"100px"},{default:d((()=>[s(H,{label:"新增数量"},{default:d((()=>[s(w,{class:"w-220",modelValue:c.form.nums,"onUpdate:modelValue":a[2]||(a[2]=e=>c.form.nums=e),placeholder:"填写数字,每次最多100个"},null,8,["modelValue"])])),_:1}),s(H,{label:"账户类型",prop:"agent_far"},{default:d((()=>[s(J,{class:"w-220",options:c.options,modelValue:c.form.account_id,"onUpdate:modelValue":a[3]||(a[3]=e=>c.form.account_id=e),placeholder:"选择类型"},null,8,["options","modelValue"])])),_:1}),s(H,{label:"预警线(%)"},{default:d((()=>[s(w,{class:"w-220",modelValue:c.form.loss_warn,"onUpdate:modelValue":a[4]||(a[4]=e=>c.form.loss_warn=e),placeholder:"填写数字"},null,8,["modelValue"])])),_:1}),s(H,{label:"平仓线(%)"},{default:d((()=>[s(w,{class:"w-220",modelValue:c.form.loss_close,"onUpdate:modelValue":a[5]||(a[5]=e=>c.form.loss_close=e),placeholder:"填写数字"},null,8,["modelValue"])])),_:1})])),_:1})])),_:1},8,["title","modelValue"])])}],["__scopeId","data-v-6a663ed2"]]);export{P as default};
