| 1 |
- import{d as S,u as k,r as c,W as L,G as r,e as B,j as E,o as x,w as s,i as t,q as a,T as d,g as R,s as P,y as V,A as D,P as T}from"./index-LEAY956U.js";import{u as q,S as F,a as A,c as g,C as H}from"./index-D3H5duk3.js";import{L as N}from"./index-Cpe7QOgN.js";import{u as $,C as G}from"./index-C5ZSFcL3.js";import"./index-DphDQAri.js";import"./index-BPM1ZaKB.js";const Q=S({__name:"index",setup(I){const{t:p}=k(),o=c("zh"),i=c([]),{register:f,tableActions:u}=q({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:A}],schema:[{prop:"name",label:"关键词",type:"input"},{prop:"order",label:"排序方式",type:"select",options:F}],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}}}]}}),[h,{open:m,getFormActions:U}]=$({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 y(e){}return b(),(e,n)=>{const v=B("el-popconfirm");return x(),E(T,null,{default:s(()=>[t(a(H),{onRegister:a(f),onSetCallBack:y},{searchRight:s(()=>[V(t(d,{value:"添加关键词",onClick:_},null,512),[[D,e.$perm(250)]])]),formTop:s(()=>[R("div",null,[t(N,{modelValue:a(o),"onUpdate:modelValue":n[0]||(n[0]=l=>P(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:W=>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(G),{onRegister:a(h)},null,8,["onRegister"])]),_:1})}}});export{Q as default};
|