import{_ as e,e as t,K as a,L as n,v as o,C as s,s as l,r,a as u,a9 as m,c as i,w as d,am as c,i as f,o as p,h,j as _,m as b,V as y}from"./index-CS85kPhe.js";import{_ as V}from"./uni-easyinput.DiCyKNZM.js";import{_ as D}from"./uni-forms-item.g4VtziaR.js";import{_ as g}from"./uni-forms.DHOpViDo.js";import{v as j}from"./opendb-search-hot.Bq85PKlV.js";const k=t.database();k.command;function v(e){let t={};for(let a in j)e.includes(a)&&(t[a]=j[a]);return t}const x=e({data(){let e={content:"",count:null,create_date:null};return{formData:e,formOptions:{},rules:{...v(Object.keys(e))}}},onReady(){this.$refs.form.setRules(this.rules)},methods:{submit(){a({mask:!0}),this.$refs.form.validate().then((e=>this.submitForm(e))).catch((()=>{})).finally((()=>{n()}))},submitForm(e){return k.collection("opendb-search-hot").add(e).then((e=>{o({title:"新增成功"}),this.getOpenerEventChannel().emit("refreshData"),setTimeout((()=>s()),500)})).catch((e=>{l({content:e.message||"请求服务失败",showCancel:!1})}))}}},[["render",function(e,t,a,n,o,s){const l=r(u("uni-easyinput"),V),j=r(u("uni-forms-item"),D),k=m("undefined"),v=r(u("uni-datetime-picker"),c),x=b,C=y,w=f,O=r(u("uni-forms"),g);return p(),i(w,{class:"uni-container"},{default:d((()=>[h(O,{ref:"form",model:o.formData,validateTrigger:"bind"},{default:d((()=>[h(j,{name:"content",label:"",required:""},{default:d((()=>[h(l,{placeholder:"搜索内容",modelValue:o.formData.content,"onUpdate:modelValue":t[0]||(t[0]=e=>o.formData.content=e)},null,8,["modelValue"])])),_:1}),h(j,{name:"count",label:"",required:""},{default:d((()=>[h(k,{modelValue:o.formData.count,"onUpdate:modelValue":t[1]||(t[1]=e=>o.formData.count=e)},null,8,["modelValue"])])),_:1}),h(j,{name:"create_date",label:""},{default:d((()=>[h(v,{"return-type":"timestamp",modelValue:o.formData.create_date,"onUpdate:modelValue":t[2]||(t[2]=e=>o.formData.create_date=e)},null,8,["modelValue"])])),_:1}),h(w,{class:"uni-button-group"},{default:d((()=>[h(x,{type:"primary",class:"uni-button",style:{width:"100px"},onClick:s.submit},{default:d((()=>[_("提交")])),_:1},8,["onClick"]),h(C,{"open-type":"navigateBack",style:{"margin-left":"15px"}},{default:d((()=>[h(x,{class:"uni-button",style:{width:"100px"}},{default:d((()=>[_("返回")])),_:1})])),_:1})])),_:1})])),_:1},8,["model"])])),_:1})}]]);export{x as default};