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