import{b as J,u as K,r as g,ah as Q,e as W,cD as X,cE as Y,o as p,c as h,p as s,q as l,aH as b,y as i,P as r,x as d,n,F as B,A as V,aj as Z,l as x,k as ee,E as ae,i as te,m as le,D as oe}from"./index.8d733f79.js";import ne from"./faultType.39fc688e.js";import{g as se,o as pe,p as ue,q as ie,r as re}from"./faultType.8bb3732b.js";import{u as E}from"./searchStore.0c98fb50.js";import"./el-text.54dc8292.js";import"./addFaultType.2270a683.js";const de={class:"page-content"},Ce={__name:"index",setup(ce){const{t:F}=J(),C=K(),P={checkStrictly:!0,value:"label",label:"label"},T=g([]),k=g([]),w=g([]),c=Q({total:0,tableData:[],columns:[{prop:"name",label:"faultCaseName"},{prop:"faultType",label:"faultType"},{prop:"faultComponent",label:"faultComponent"},{prop:"deviceTypeName",label:"deviceType"},{label:"action",type:"action",width:250,fixed:"right"}]}),$={faultType:[],faultComponent:"",deviceTypeName:"",pageNo:1,pageSize:10},t=g({...$}),{proxy:_}=oe(),L=g();W(()=>{const e=E().getSearchCondition("faultCaseLib",$);t.value={...e},q(),z(),R(),f()});const q=()=>{se().then(e=>{T.value=e.data})},z=()=>{pe().then(e=>{k.value=e.data})},R=async()=>{const e=await ue();e.data.length&&(w.value=e.data)},f=async()=>{const e={...t.value,faultType:t.value.faultType?t.value.faultType.length>1?t.value.faultType.join("-"):t.value.faultType[0]:""},o=await ie(e);c.total=o.data.totalElements,c.tableData=o.data.content,E().setSearchCondition("faultCaseLib",t.value)},v=()=>{t.value.pageNo=1,f()},U=()=>{var e;(e=L.value)==null||e.resetFields(),f()},I=()=>{C.push({path:"/knowledgeBase/faultLib/add"})},M=e=>{C.push({path:"/knowledgeBase/faultLib/edit",query:{id:e.id}})},j=e=>{C.push({path:"/knowledgeBase/faultLib/view",query:{id:e.id,type:"view"}})},O=async e=>{_.$modal.confirm(F("confirmDelete")).then(()=>{re({id:e.id}).then(o=>{_.$modal.msgSuccess(o.msg),f()})}).catch(()=>{})},A=()=>{_.$refs.faultTypeRef.showModal()};return(e,o)=>{const u=x,m=ee,H=X,N=ae,S=te,G=le,y=Y("hasPermi");return p(),h("div",de,[s(G,{ref_key:"formRef",ref:L,model:n(t),inline:""},{default:l(()=>[s(m,null,{default:l(()=>[b((p(),i(u,{type:"primary",onClick:I},{default:l(()=>[r(d(e.$t("addFaultCase")),1)]),_:1})),[[y,["knowledgeBase_faultLib_add"]]])]),_:1}),s(m,{label:e.$t("faultType"),prop:"faultType"},{default:l(()=>[s(H,{modelValue:n(t).faultType,"onUpdate:modelValue":o[0]||(o[0]=a=>n(t).faultType=a),options:n(T),props:P,separator:"-",clearable:"",filterable:"",onChange:v,placeholder:e.$t("faultTypeP")},null,8,["modelValue","options","placeholder"])]),_:1},8,["label"]),s(m,{label:e.$t("faultComponent"),prop:"faultComponent"},{default:l(()=>[s(S,{modelValue:n(t).faultComponent,"onUpdate:modelValue":o[1]||(o[1]=a=>n(t).faultComponent=a),filterable:"",placeholder:e.$t("faultComponentP"),clearable:"",onChange:v},{default:l(()=>[(p(!0),h(B,null,V(n(k),a=>(p(),i(N,{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),s(m,{label:e.$t("deviceType"),prop:"deviceTypeName"},{default:l(()=>[s(S,{modelValue:n(t).deviceTypeName,"onUpdate:modelValue":o[2]||(o[2]=a=>n(t).deviceTypeName=a),filterable:"",placeholder:e.$t("deviceTypeP"),clearable:"",onChange:v},{default:l(()=>[(p(!0),h(B,null,V(n(w),a=>(p(),i(N,{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),s(m,null,{default:l(()=>[s(u,{type:"primary",onClick:v},{default:l(()=>[r(d(e.$t("query")),1)]),_:1}),s(u,{onClick:U},{default:l(()=>[r(d(e.$t("reset")),1)]),_:1}),b((p(),i(u,{type:"primary",onClick:A},{default:l(()=>[r(d(e.$t("faultTypeManage")),1)]),_:1})),[[y,["knowledgeBase_faultLib_type"]]])]),_:1})]),_:1},8,["model"]),s(n(Z),{class:"f-h",columns:c.columns,tableData:c.tableData,total:c.total,pageNum:n(t).pageNo,"onUpdate:pageNum":o[3]||(o[3]=a=>n(t).pageNo=a),pageSize:n(t).pageSize,"onUpdate:pageSize":o[4]||(o[4]=a=>n(t).pageSize=a),onPagination:f},{action:l(({scope:a})=>[b((p(),i(u,{link:"",type:"primary",onClick:D=>j(a.row)},{default:l(()=>[r(d(e.$t("view")),1)]),_:2},1032,["onClick"])),[[y,["knowledgeBase_faultLib_view"]]]),b((p(),i(u,{link:"",type:"primary",onClick:D=>M(a.row)},{default:l(()=>[r(d(e.$t("edit")),1)]),_:2},1032,["onClick"])),[[y,["knowledgeBase_faultLib_edit"]]]),b((p(),i(u,{link:"",type:"danger",onClick:D=>O(a.row)},{default:l(()=>[r(d(e.$t("delete")),1)]),_:2},1032,["onClick"])),[[y,["knowledgeBase_faultLib_delete"]]])]),_:1},8,["columns","tableData","total","pageNum","pageSize"]),s(ne,{ref:"faultTypeRef"},null,512)])}}};export{Ce as default};
