| 1 |
- import{d as y,u as k,r as c,V as L,D as r,e as x,i as B,o as E,w as s,h as t,p as a,S as d,g as R,q as V,x as D,z as P,P as q}from"./index-5k_MqT6o.js";import{u as F,a as T,S as H,c as g,C as N}from"./index-Cl9RbTBn.js";import{L as $}from"./index-BDlrU7am.js";import{u as z,C as A}from"./index-BfmhdFfx.js";import"./index-BHx7dntQ.js";import"./index-CAzgmO3A.js";const Q=y({__name:"index",setup(I){const{t:p}=k(),o=c("zh"),i=c([]),{register:h,tableActions:u}=F({title:"关键词",showSelection:!1,showIndex:!0,immediate:!0,showExport:!1,api:r.keywordList,apiParams:{language_code:o.value,field:"question_num"},columns:[{prop:"name",label:"关键词"},{prop:"question_num",label:"对应问题数"},{prop:"all_match_num",label:"完全匹配次数"},{prop:"match_num",label:"模糊匹配次数"},{prop:"status",label:"状态",tagEnums:H}],schema:[{prop:"name",label:"关键词",type:"input"},{prop:"order",label:"排序方式",type:"select",options:T}],showAction:L(260,270,280),actionProps:{width:200,btnList:[{perm:260,label:"编辑",click:e=>{m({title:"编辑"},n=>{n.setSchema("language_code","options",g(i.value,"name","code").getEnums()),n.setFormModel(e.row)})}},{perm:270,slotName:"hideBtnSlot"},{perm:280,label:"删除",type:"danger",isPopConfirm:!0,popConfirmEmits:{confirm(e){return r.keywordDelete({id:e.row.id}).then(()=>{u.reload()}),!0}}}]}}),[f,{open:m,getFormActions:U}]=z({successCallBack(){u.reload()},api:r.keywordUpdate,formConfig:{schema:[{label:"",prop:"id",type:"input",notShow:!0},{label:"",prop:"keyword_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 _(){m({title:"添加问题"},e=>{e.setSchema("language_code","options",g(i.value,"name","code").getEnums()),e.setValues("language_code",o.value)})}function w(e){r.keywordSetStatus({id:e.id}).then(()=>{u.reload()})}function C(e){u.getData({language_code:o.value})}function b(){r.homeGetLanguageCode().then(e=>{i.value=e})}function S(e){}return b(),(e,n)=>{const v=x("el-popconfirm");return E(),B(q,null,{default:s(()=>[t(a(N),{onRegister:a(h),onSetCallBack:S},{searchRight:s(()=>[D(t(d,{value:"添加关键词",onClick:_},null,512),[[P,e.$perm(250)]])]),formTop:s(()=>[R("div",null,[t($,{modelValue:a(o),"onUpdate:modelValue":n[0]||(n[0]=l=>V(o)?o.value=l:null),onLanguageChange:C,languages:a(i)},null,8,["modelValue","languages"])])]),hideBtnSlot:s(l=>[t(v,{title:(l.row.status===1?a(p)("确认要隐藏吗"):a(p)("确认显示"))+"?",onConfirm:G=>w(l.row)},{reference:s(()=>[t(d,{value:l.row.status===1?"隐藏":"显示",link:"",style:{margin:"0 10px"}},null,8,["value"])]),_:2},1032,["title","onConfirm"])]),_:1},8,["onRegister"]),t(a(A),{onRegister:a(f)},null,8,["onRegister"])]),_:1})}}});export{Q as default};
|