import{h as R,y as w,r as V,p as b,l as U,o as a,V as l,k as e,q as i,N as d,W as n,m as P,a6 as B,M as g,a0 as y,$ as S,a4 as F,J as K,t as c,X as M,Y as Q,a7 as T}from"./vue-a39e6937.js";import{e as D,s as p,g as z}from"./crud-68282d37.js";import{F as J}from"./index-f0d8af94.js";import{b as j}from"./validate-4ecec794.js";import{_ as E}from"./log.vue_vue_type_style_index_0_lang-42ce63a8.js";import{f as O,_ as W}from"./index-ba596ae9.js";import"./index-434d719f.js";import"./controllerUrls-941681c3.js";import"./index-7e56a0fa.js";const X=m=>(M("data-v-7df73f2f"),m=m(),Q(),m),Y={class:"default-main"},A={class:"crud-title"},G={class:"start-opt"},H={class:"start-item-title"},Z={class:"start-item-remark"},ee={class:"start-item suspension"},te={class:"start-item-title"},se={class:"start-item-remark"},ae={class:"start-item suspension"},le={class:"start-item-title"},oe={class:"start-item-remark"},re={target:"_blank",href:"https://wonderful-code.gitee.io/guide/other/developerMustSee.html"},de=X(()=>a("code",null,"test_build",-1)),ie=R({__name:"start",setup(m){const{t}=O(),h=w(),f=w(),o=V({dialog:{type:"",visible:!1,dbList:[]},showLog:!1}),C=u=>{o.dialog.type=u,o.dialog.visible=!0,u=="sql"?setTimeout(()=>{h.value.focus()},200):u=="db"&&z().then(s=>{o.dialog.dbList=s.data.dbs})},q=V({db:[j({name:"required",message:t("crud.crud.Please select a data table")})]}),v=(u=void 0)=>{if(u){if(o.dialog.type=="sql"&&!p.startData.sql){K({type:"error",message:t("crud.crud.Please enter the table creation SQL")});return}u.validate(s=>{s&&D(o.dialog.type)})}};return(u,s)=>{const _=c("el-col"),k=c("el-row"),L=c("el-input"),$=c("el-form"),x=c("el-button"),I=c("el-dialog"),N=T("blur");return b(),U("div",Y,[a("div",A,l(e(t)("crud.crud.start")),1),a("div",G,[i(k,{gutter:20},{default:d(()=>[i(_,{xs:24,span:8},{default:d(()=>[a("div",{onClick:s[0]||(s[0]=r=>e(D)("create")),class:"start-item suspension"},[a("div",H,l(e(t)("crud.crud.create")),1),a("div",Z,l(e(t)("crud.crud.New background CRUD from zero")),1)])]),_:1}),i(_,{onClick:s[1]||(s[1]=r=>C("db")),xs:24,span:8},{default:d(()=>[a("div",ee,[a("div",te,l(e(t)("crud.crud.Select Data Table")),1),a("div",se,l(e(t)("crud.crud.Select a designed data table from the database")),1)])]),_:1}),i(_,{onClick:s[2]||(s[2]=r=>o.showLog=!0),xs:24,span:8},{default:d(()=>[a("div",ae,[a("div",le,l(e(t)("crud.crud.CRUD record")),1),a("div",oe,l(e(t)("crud.crud.Start with previously generated CRUD code")),1)])]),_:1})]),_:1}),i(k,{justify:"center"},{default:d(()=>[i(_,{span:20,class:"ba-markdown crud-tips suspension"},{default:d(()=>[a("b",null,l(e(t)("crud.crud.Fast experience")),1),a("ol",null,[a("li",null,[n(l(e(t)("crud.crud.experience 1 1"))+" ",1),a("a",re,l(e(t)("crud.crud.experience 1 2")),1),n(" "+l(e(t)("crud.crud.experience 1 3")),1)]),a("li",null,[n(l(e(t)("crud.crud.experience 2 1"))+" ",1),a("code",null,l(e(t)("crud.crud.experience 2 2")),1),n(" "+l(e(t)("crud.crud.experience 2 3")),1),de,n(l(e(t)("crud.crud.data sheet")),1)]),a("li",null,[n(l(e(t)("crud.crud.experience 3 1")),1),a("code",null,l(e(t)("crud.crud.experience 3 2")),1),n(" "+l(e(t)("crud.crud.experience 3 3")),1),a("code",null,l(e(t)("crud.crud.experience 3 4")),1)])])]),_:1})]),_:1}),i(I,{class:"ba-operate-dialog select-db-dialog",modelValue:o.dialog.visible,"onUpdate:modelValue":s[10]||(s[10]=r=>o.dialog.visible=r),title:o.dialog.type=="sql"?e(t)("crud.crud.Please enter SQL"):e(t)("crud.crud.Please select a data table")},{footer:d(()=>[a("div",{style:P({width:"calc(100% * 0.9)"})},[i(x,{onClick:s[8]||(s[8]=r=>o.dialog.visible=!1)},{default:d(()=>[n(l(u.$t("Cancel")),1)]),_:1}),B((b(),g(x,{onClick:s[9]||(s[9]=r=>v(f.value)),type:"primary"},{default:d(()=>[n(l(e(t)("Confirm")),1)]),_:1})),[[N]])],4)]),default:d(()=>[i($,{"label-width":140,onKeyup:s[7]||(s[7]=y(r=>v(f.value),["enter"])),ref_key:"formRef",ref:f,model:e(p).startData,rules:q},{default:d(()=>[o.dialog.type=="sql"?(b(),g(L,{key:0,class:"sql-input",prop:"sql",ref_key:"sqlInputRef",ref:h,modelValue:e(p).startData.sql,"onUpdate:modelValue":s[3]||(s[3]=r=>e(p).startData.sql=r),type:"textarea",placeholder:e(t)("crud.crud.table create SQL"),rows:10,onKeyup:[s[4]||(s[4]=y(S(()=>{},["stop"]),["enter"])),s[5]||(s[5]=y(S(r=>v(f.value),["ctrl"]),["enter"]))]},null,8,["modelValue","placeholder"])):o.dialog.type=="db"?(b(),g(J,{label:e(t)("crud.crud.data sheet"),class:"select-db",modelValue:e(p).startData.db,"onUpdate:modelValue":s[6]||(s[6]=r=>e(p).startData.db=r),type:"select",key:JSON.stringify(o.dialog.dbList),placeholder:e(t)("crud.crud.Please select a data table"),data:{content:o.dialog.dbList},attr:{"block-help":e(t)("crud.crud.data sheet help")},prop:"db"},null,8,["label","modelValue","placeholder","data","attr"])):F("",!0)]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"]),i(E,{modelValue:o.showLog,"onUpdate:modelValue":s[11]||(s[11]=r=>o.showLog=r)},null,8,["modelValue"])])])}}});const ge=W(ie,[["__scopeId","data-v-7df73f2f"]]);export{ge as default};
