ScopeSentry/static/assets/Search-B1ZPttXo.js

2 lines
6.0 KiB
JavaScript

import{_ as e}from"./ContentWrap.vue_vue_type_script_setup_true_lang-BgCcO80c.js";import{d as o,l,s as t,r as a,C as i,o as r,c as s,e as n,w as m,y as p,t as c,a as u,F as d,_ as f}from"./index-B4Nyjh3H.js";import{u as h,_ as v}from"./useSearch-BpRjd7KR.js";import{g as b}from"./index-DbrBYmwv.js";import"./el-card-wk8kGoMw.js";import"./el-tooltip-l0sNRNKZ.js";import"./el-popper-DBt0ZFPB.js";import"./useForm-BP9LKBVW.js";import"./el-form-DDCfLIJB.js";import"./castArray-BrlE0VBR.js";import"./el-col-ChTZtubL.js";import"./el-tag-DS_6W9-f.js";import"./el-checkbox-DAPJr8Xi.js";import"./isEqual-DFD3TClT.js";import"./index-ThnV7dxG.js";import"./el-radio-group-exGM2d1B.js";/* empty css */import"./el-input-number-CzlgwRVT.js";import"./el-select-ErNzBCXo.js";import"./useInput-Drsa8fv-.js";import"./debounce-4WtFbZlf.js";import"./el-select-v2-DYay7EKY.js";import"./raf-jjs8tbGM.js";import"./el-switch-Cn0FzV_x.js";import"./el-tree-select-C06mNOXK.js";import"./index-CdW5lxxY.js";import"./el-divider-C1wqG4VS.js";import"./el-upload-CSzzt7Od.js";import"./el-progress-Ci66xlfW.js";import"./InputPassword-B-8gPnNl.js";import"./style.css_vue_type_style_index_0_src_true_lang-BTn9l6mG.js";import"./JsonEditor.vue_vue_type_script_setup_true_lang-D8YydEhg.js";import"./IconPicker-BDQ9q7AT.js";import"./el-tab-pane-Dsdbtla6.js";import"./isArrayLikeObject-CWayLN3s.js";import"./tsxHelper-TQdELaO0.js";import"./useIcon-DitchYFS.js";import"./index-CdbOSPly.js";const D=f(o({__name:"Search",setup(o){const{t:f}=l(),{searchRegister:D,searchMethods:_}=h(),{setSchema:j,setProps:g,setValues:k}=_,I=[{value:"1",label:"Level one 1",children:[{value:"1-1",label:"Level two 1-1",children:[{value:"1-1-1",label:"Level three 1-1-1"}]}]},{value:"2",label:"Level one 2",children:[{value:"2-1",label:"Level two 2-1",children:[{value:"2-1-1",label:"Level three 2-1-1"}]},{value:"2-2",label:"Level two 2-2",children:[{value:"2-2-1",label:"Level three 2-2-1"}]}]},{value:"3",label:"Level one 3",children:[{value:"3-1",label:"Level two 3-1",children:[{value:"3-1-1",label:"Level three 3-1-1"}]},{value:"3-2",label:"Level two 3-2",children:[{value:"3-2-1",label:"Level three 3-2-1"}]}]}],y=t([{field:"field1",label:f("formDemo.input"),component:"Input"},{field:"field2",label:f("formDemo.select"),component:"Select",componentProps:{options:[{label:"option1",value:"1"},{label:"option2",value:"2"}],on:{change:e=>{}}}},{field:"field3",label:f("formDemo.radio"),component:"RadioGroup",componentProps:{options:[{label:"option-1",value:"1"},{label:"option-2",value:"2"}]}},{field:"field5",component:"DatePicker",label:f("formDemo.datePicker"),componentProps:{type:"date"}},{field:"field6",component:"TimeSelect",label:f("formDemo.timeSelect")},{field:"field8",label:f("formDemo.input"),component:"Input"},{field:"field9",label:f("formDemo.input"),component:"Input"},{field:"field10",label:f("formDemo.input"),component:"Input"},{field:"field11",label:f("formDemo.input"),component:"Input"},{field:"field12",label:f("formDemo.input"),component:"Input"},{field:"field13",label:f("formDemo.input"),component:"Input"},{field:"field14",label:f("formDemo.input"),component:"Input"},{field:"field15",label:f("formDemo.input"),component:"Input"},{field:"field16",label:f("formDemo.input"),component:"Input"},{field:"field17",label:f("formDemo.input"),component:"Input"},{field:"field18",label:f("formDemo.input"),component:"Input"},{field:"field19",label:`${f("formDemo.treeSelect")}`,component:"TreeSelect",optionApi:async()=>await new Promise((e=>{setTimeout((()=>{e(I)}),3e3)}))}]),C=a(!1),L=e=>{g({isCol:e})},w=a("inline"),x=()=>{w.value="inline"===u(w)?"bottom":"inline"},P=a("left"),S=e=>{w.value="bottom",P.value=e},R=async()=>{const e=await b();e&&j([{field:"field2",path:"componentProps.options",value:e.data}])},T=e=>{},A=()=>{j([{field:"field3",path:"remove",value:!0}])},B=()=>{j([{field:"field3",path:"remove",value:!1}])},E=()=>{k({field1:"Joy"})},F=a(!1),J=()=>{F.value=!0,setTimeout((()=>{F.value=!1}),2e3)},V=a(!1),$=()=>{V.value=!0,setTimeout((()=>{V.value=!1}),2e3)};return(o,l)=>{const t=i("BaseButton");return r(),s(d,null,[n(u(e),{title:`${u(f)("searchDemo.search")} ${u(f)("searchDemo.operate")}`,style:{"margin-bottom":"20px"}},{default:m((()=>[n(t,{onClick:l[0]||(l[0]=e=>L(!0))},{default:m((()=>[p(c(u(f)("searchDemo.grid")),1)])),_:1}),n(t,{onClick:l[1]||(l[1]=e=>L(!1))},{default:m((()=>[p(c(u(f)("searchDemo.restore"))+" "+c(u(f)("searchDemo.grid")),1)])),_:1}),n(t,{onClick:x},{default:m((()=>[p(c(u(f)("searchDemo.button"))+" "+c(u(f)("searchDemo.position")),1)])),_:1}),n(t,{onClick:l[2]||(l[2]=e=>S("left"))},{default:m((()=>[p(c(u(f)("searchDemo.bottom"))+" "+c(u(f)("searchDemo.position"))+"-"+c(u(f)("searchDemo.left")),1)])),_:1}),n(t,{onClick:l[3]||(l[3]=e=>S("center"))},{default:m((()=>[p(c(u(f)("searchDemo.bottom"))+" "+c(u(f)("searchDemo.position"))+"-"+c(u(f)("searchDemo.center")),1)])),_:1}),n(t,{onClick:l[4]||(l[4]=e=>S("right"))},{default:m((()=>[p(c(u(f)("searchDemo.bottom"))+" "+c(u(f)("searchDemo.position"))+"-"+c(u(f)("searchDemo.right")),1)])),_:1}),n(t,{onClick:R},{default:m((()=>[p(c(u(f)("formDemo.select"))+" "+c(u(f)("searchDemo.dynamicOptions")),1)])),_:1}),n(t,{onClick:A},{default:m((()=>[p(c(u(f)("searchDemo.deleteRadio")),1)])),_:1}),n(t,{onClick:B},{default:m((()=>[p(c(u(f)("searchDemo.restoreRadio")),1)])),_:1}),n(t,{onClick:E},{default:m((()=>[p(c(u(f)("formDemo.setValue")),1)])),_:1}),n(t,{onClick:J},{default:m((()=>[p(c(u(f)("searchDemo.search"))+" "+c(u(f)("searchDemo.loading")),1)])),_:1}),n(t,{onClick:$},{default:m((()=>[p(c(u(f)("searchDemo.reset"))+" "+c(u(f)("searchDemo.loading")),1)])),_:1})])),_:1},8,["title"]),n(u(e),{title:u(f)("searchDemo.search"),message:u(f)("searchDemo.searchDes")},{default:m((()=>[n(u(v),{schema:y,"is-col":C.value,layout:w.value,"button-position":P.value,"search-loading":F.value,"reset-loading":V.value,"show-expand":"","expand-field":"field6",onSearch:T,onReset:T,onRegister:u(D)},null,8,["schema","is-col","layout","button-position","search-loading","reset-loading","onRegister"])])),_:1},8,["title","message"])],64)}}}),[["__scopeId","data-v-f1ee1ca7"]]);export{D as default};