import{d as y,u as L,r as c,V as x,D as s,e as B,i as V,o as D,w as r,h as n,p as a,S as d,g as m,q as P,x as R,z as T,P as A}from"./index-5k_MqT6o.js";import{u as E,c as f,C as F}from"./index-Cl9RbTBn.js";import{L as H}from"./index-BDlrU7am.js";import{u as $,C as q}from"./index-BfmhdFfx.js";import"./index-BHx7dntQ.js";import"./index-CAzgmO3A.js";const K=y({__name:"index",setup(z){const{t:p}=L(),t=c("zh"),i=c([]),{register:h,tableActions:u}=E({title:"猜你想问类别",showSelection:!1,showIndex:!0,immediate:!0,showExport:!1,api:s.guessAskTypeList,apiParams:{language_code:t.value},columns:[{prop:"name",label:"名称"}],schema:[],showAction:x(500,510),actionProps:{width:200,btnList:[{perm:500,label:"编辑",click:e=>{g({title:"编辑"},o=>{o.setSchema("language_code","options",f(i.value,"name","code").getEnums()),o.setFormModel(e.row)})}},{perm:510,label:"删除",type:"danger",isPopConfirm:!0,popConfirmEmits:{confirm(e){return s.guessAskTypeDelete({id:e.row.id}).then(()=>{u.reload()}),!0}}}]}}),[C,{open:g,getFormActions:I}]=$({successCallBack(){u.reload()},api:s.guessAskTypeUpdate,formConfig:{schema:[{label:"",prop:"id",type:"input",notShow:!0},{label:"名称",prop:"name",type:"input",props:{maxlength:20,showWordLimit:!0},required:!0},{label:"语种",prop:"language_code",type:"select",options:[]}]}});function v(){g({title:"新增"},e=>{e.setSchema("language_code","options",f(i.value,"name","code").getEnums()),e.setValues("language_code",t.value)})}function _(e){s.categorySetStatus({id:e.id}).then(()=>{u.reload()})}function w(e){u.getData({language_code:t.value})}function k(){s.homeGetLanguageCode().then(e=>{i.value=e})}function S(e){}return k(),(e,o)=>{const b=B("el-popconfirm");return D(),V(A,null,{default:r(()=>[n(a(F),{onRegister:a(h),onSetCallBack:S},{customHeader:r(()=>[o[1]||(o[1]=m("div",null,null,-1)),m("div",null,[R(n(d,{value:"添加分类",onClick:v},null,512),[[T,e.$perm(490)]])])]),formTop:r(()=>[m("div",null,[n(H,{modelValue:a(t),"onUpdate:modelValue":o[0]||(o[0]=l=>P(t)?t.value=l:null),onLanguageChange:w,languages:a(i)},null,8,["modelValue","languages"])])]),hideBtnSlot:r(l=>[n(b,{title:(l.row.status===1?a(p)("确认要隐藏吗"):a(p)("确认显示"))+"?",onConfirm:N=>_(l.row)},{reference:r(()=>[n(d,{value:l.row.status===1?"隐藏":"显示",link:"",style:{margin:"0 10px"}},null,8,["value"])]),_:2},1032,["title","onConfirm"])]),_:1},8,["onRegister"]),n(a(q),{onRegister:a(C)},null,8,["onRegister"])]),_:1})}}});export{K as default};
