2 lines
42 KiB
JavaScript
2 lines
42 KiB
JavaScript
import{B as We,a9 as Qe,a8 as Ce,a as ke,o as Xe,n as re,aC as we,I as F,X as ie,C as s,D as y,G as m,H as d,P as c,u as n,O as p,V as w,U as h,W as S,_ as T,Z as C,Y as P,ac as Ze,$ as el,a6 as $,p as j,a7 as ll,as as I,ag as Ve,z as R}from"./vue-Ce7h5hs3.js";import{x as tl,e as al,N as ol,ao as rl,ap as il,a6 as A,aq as Pe,y as nl,_ as dl}from"./index-BQ5jItLS.js";import{S as _e,B as Te}from"./index-CmxJgQ5v.js";import{f as U,s as k,d as Ne,t as D,g as ne,a as sl,u as cl,b as ul,c as ml,e as De,h as fl,p as pl,i as bl}from"./index-BgUrmSig.js";import{F as g}from"./index-DMUx96ts.js";import{u as gl}from"./terminal-q4retXry.js";import{b as x,a as yl}from"./validate-BmIGZnH0.js";import"./index-CTT0ef74.js";import"./index-C9pWMHjm.js";const hl={class:"default-main"},Fl={class:"header-config-box"},vl={class:"header"},Sl={class:"header-item-box"},Cl={class:"header-right"},kl={key:0,class:"header-senior-config-box"},wl={class:"header-senior-config-form"},Vl={class:"default-sort-field-box"},Pl=["onClick","data-id"],_l={class:"design-field"},Tl={class:"design-field"},Nl={class:"design-field-right"},Dl={key:0,class:"design-field-empty"},Ul={class:"field-config ba-scroll-style"},xl={key:0,class:"design-field-empty"},Ll={class:"field-inline"},Il={class:"field-inline"},Rl={class:"field-inline"},Al={class:"ba-operate-form",style:"width: calc(100% - 80px)"},Kl={class:"block-help"},Gl={class:"block-help"},El={style:"width: calc(100% - 88px)"},ql={class:"confirm-generate-dialog-body"},Bl={class:"confirm-generate-dialog-footer"},Ml={class:"design-timeline-box"},$l={class:"design-change-tips"},jl={key:1,class:"design-change-tips"},zl={class:"confirm-generate-dialog-footer"},Ol=We({__name:"design",setup(Hl){Qe(t=>({"1bb2fb2c":e.error.tableName?"70px":"60px","6e828e72":e.draggingField?"1px dashed var(--el-color-primary)":e.fields.length?"none":"1px dashed var(--el-border-color)"}));let de=1;const{t:r}=tl.useI18n(),z=al(),E=gl(),O=Ce("formRef"),q=ol(),se=Ce("designWindowRef"),e=ke({loading:{init:!1,generate:!1,remoteSelect:!1},sync:0,table:{name:"",comment:"",quickSearchField:[],defaultSortField:"",formFields:[],columnFields:[],defaultSortType:"desc",generateRelativePath:"",isCommonModel:0,modelFile:"",controllerFile:"",validateFile:"",webViewsDir:"",databaseConnection:"",designChange:[],rebuild:"No"},fields:[],activateField:-1,fieldCollapseName:["common","base","senior"],remoteSelectPre:{show:!1,index:-1,fieldList:[],modelFileList:[],controllerFileList:[],loading:!1,hideDelField:!1,form:{table:"",pk:"",label:"",joinField:[],sourceConfigType:"crud",remoteUrl:"",modelFile:"",controllerFile:"",primaryTableAlias:""}},showHeaderSeniorConfig:!1,confirmGenerate:{show:!1,menu:!1,table:!1,controller:!1},draggingField:!1,showDesignChangeLog:!1,error:{tableName:"",fieldName:null,fieldNameDuplication:null}}),Ue=t=>{e.activateField=t},xe=t=>{let l=null;for(const i in U){const f=A(U[i],"designType",t);if(f!==!1){l=I(U[i][f]);break}}if(!l||!ce(l,e.activateField))return!1;const o=I(e.fields[e.activateField]);o.designType=t;for(const i in o.table)o.table[i]=o.table[i].value;for(const i in o.form)o.form[i]=o.form[i].value;e.fields[e.activateField]=K(o),e.fields[e.activateField].uuid=o.uuid,Ve.confirm(r("crud.crud.Reset generate type attr"),r("Reminder"),{confirmButtonText:r("Confirm")+r("Reset"),cancelButtonText:r("crud.crud.Design efficiency"),type:"warning",closeOnClickModal:!1}).then(()=>{_(),ue(e.fields[e.activateField].uuid);const i=e.fields[e.activateField].name;e.fields[e.activateField]=K(l),e.fields[e.activateField].name=i,l.primaryKey&&(e.table.quickSearchField.push(e.fields[e.activateField].uuid),e.table.defaultSortField||(e.table.defaultSortField=e.fields[e.activateField].uuid)),l.designType=="weigh"&&(e.table.defaultSortField=e.fields[e.activateField].uuid),["remoteSelect","remoteSelects"].includes(l.designType)&&Y(e.activateField,!0),l.formBuildExclude||e.table.formFields.push(e.fields[e.activateField].uuid),l.tableBuildExclude||e.table.columnFields.push(e.fields[e.activateField].uuid)}).catch(()=>{})},H=(t,l)=>{const o=e.fields[l].name;e.fields[l].name=t,G({type:"change-field-name",index:e.activateField,oldName:o,newName:t})},ce=(t,l=-1)=>t.primaryKey===!0&&e.fields.find((i,f)=>l>-1&&f==l?!1:i.primaryKey)?(R({type:"error",message:r("crud.crud.There can only be one primary key field")}),!1):!0,Le=t=>{e.error.fieldName&&(e.error.fieldName.close(),e.error.fieldName=null);for(const l in e.fields)if(!yl(e.fields[l].name)){let o=r("crud.crud.Field name is invalid It starts with a letter or underscore and cannot contain any character other than letters, digits, or underscores",{field:e.fields[l].name});return R({type:"error",message:o}),!1}return!0},Ie=t=>{e.error.fieldNameDuplication&&(e.error.fieldNameDuplication.close(),e.error.fieldNameDuplication=null);for(const l in e.fields){let o=0;for(const i in e.fields)if(e.fields[l].name==e.fields[i].name&&o++,o>1){let f=r("crud.crud.Field name duplication",{field:e.fields[l].name});return R({type:"error",message:f}),!1}}return!0},_=()=>{G({type:"change-field-attr",index:e.activateField,oldName:e.fields[e.activateField].name,newName:""})},ue=t=>{t==e.table.defaultSortField&&(e.table.defaultSortField="");for(const l in D){const o=e.table[D[l]].findIndex(i=>i==t);o!=-1&&e.table[D[l]].splice(o,1)}},me=t=>{if(e.fields[t]){if(e.activateField=-1,ue(e.fields[t].uuid),G({type:"del-field",oldName:e.fields[t].name,newName:""}),e.fields[t].designType=="weigh"){const l=e.fields.find(o=>["pk","spk"].includes(o.designType));l&&(e.table.defaultSortField=l.uuid)}e.fields.splice(t,1)}},Y=(t,l=!1)=>{e.remoteSelectPre.show=!0,e.remoteSelectPre.loading=!0,e.remoteSelectPre.index=t,e.remoteSelectPre.hideDelField=l,e.fields[t]&&e.fields[t].form["remote-table"].value&&(e.remoteSelectPre.form.table=e.fields[t].form["remote-table"].value,e.remoteSelectPre.form.pk=e.fields[t].form["remote-pk"].value,e.remoteSelectPre.form.label=e.fields[t].form["remote-field"].value,e.remoteSelectPre.form.controllerFile=e.fields[t].form["remote-controller"].value,e.remoteSelectPre.form.modelFile=e.fields[t].form["remote-model"].value,e.remoteSelectPre.form.remoteUrl=e.fields[t].form["remote-url"].value,e.remoteSelectPre.form.sourceConfigType=e.fields[t].form["remote-source-config-type"].value,e.remoteSelectPre.form.primaryTableAlias=e.fields[t].form["remote-primary-table-alias"].value,e.remoteSelectPre.form.joinField=e.fields[t].form["relation-fields"].value.split(","),Pe(e.fields[t].form["remote-table"].value,!0,e.table.databaseConnection).then(o=>{const i={};for(const f in o.data.fieldList)i[f]=(f?f+" - ":"")+o.data.fieldList[f];e.remoteSelectPre.fieldList=i}),(j(e.remoteSelectPre.modelFileList)||j(e.remoteSelectPre.controllerFileList))&&ne(e.fields[t].form["remote-table"].value).then(o=>{e.remoteSelectPre.modelFileList=o.data.modelFileList,e.remoteSelectPre.controllerFileList=o.data.controllerFileList})),e.remoteSelectPre.loading=!1},Re=(t,l)=>{if(["remoteSelect","remoteSelects"].includes(l.designType))return Y(t)},J=()=>{e.confirmGenerate.show=!1},W=()=>{e.loading.generate=!0;const t=I(e.fields);for(const o in t){for(const i in t[o].table)t[o].table[i]=t[o].table[i].value;for(const i in t[o].form)t[o].form[i]=t[o].form[i].value}const l=I(e.table);if(l.defaultSortField){const o=A(e.fields,"uuid",l.defaultSortField);o!==!1&&(l.defaultSortField=e.fields[o].name)}for(const o in D){const i=[],f=l[D[o]];for(const v in f){const b=A(e.fields,"uuid",f[v]);b!==!1&&i.push(e.fields[b].name)}l[D[o]]=i}sl({type:k.type,table:l,fields:t}).then(o=>{const i=()=>{const f=e.table.webViewsDir.replace(/^web/,".");E.toggle(!0),E.addTask("npx.prettier",!1,f,()=>{E.toggle(!1),E.toggleDot(!0),re(()=>{R({type:"error",message:r("crud.crud.Vite hot warning")})})})};e.sync>0&&z.crud.syncedUpdate==="yes"||e.sync==0&&z.crud.syncType=="automatic"?cl({logs:[{...o.data.crudLog,public:z.crud.syncAutoPublic==="yes"?1:0,newLog:1}],save:1}).then(f=>{ul({syncIds:f.data.syncIds}).finally(()=>{i()})}).catch(()=>{i()}):i()}).finally(()=>{e.loading.generate=!1,J()})},Ae=()=>{if(!Le()||!Ie())return;let t="";if(e.fields.findIndex(o=>o.primaryKey)===-1&&(t=r("crud.crud.Please design the primary key field!")),e.table.name||(t=r("crud.crud.Please enter the data table name!")),e.error.tableName&&(t=r("crud.crud.Please enter the correct table name!")),t){R({type:"error",message:t});return}e.loading.generate=!0,ml({table:e.table.name,connection:e.table.databaseConnection,webViewsDir:e.table.webViewsDir,controllerFile:e.table.controllerFile}).then(()=>{W()}).catch(o=>{e.loading.generate=!1,o.code==-1?(e.confirmGenerate.menu=o.data.menu,e.confirmGenerate.table=o.data.table,e.confirmGenerate.controller=o.data.controller,fe()||e.confirmGenerate.controller||e.confirmGenerate.menu?e.confirmGenerate.show=!0:W()):R({type:"error",message:o.msg})})},fe=()=>e.confirmGenerate.table&&(k.type=="create"||e.table.rebuild=="Yes"),Ke=()=>{if(!e.table.name&&!e.table.comment&&!e.fields.length)return De("start");Ve.confirm(r("crud.crud.It is irreversible to give up the design Are you sure you want to give up?"),r("Reminder"),{confirmButtonText:r("crud.crud.give up"),cancelButtonText:r("Cancel"),type:"warning"}).then(()=>{De("start")}).catch(()=>{})},K=t=>{t=I(t);const l=I(Ne[t.designType]);for(const o in t.form)l.form[o]&&(l.form[o].value=t.form[o]),o=="image-multi"&&t.form[o]&&(l.table.render=fl("render","images"));for(const o in t.table)l.table[o]&&(l.table[o].value=t.table[o]);return t.form=l.form,t.table=l.table,t.uuid=nl(),t},pe=t=>{if(_(),["enum","set"].includes(e.fields[e.activateField].type)){if(!t){e.fields[e.activateField].dataType=`${e.fields[e.activateField].type}()`;return}t=t.replaceAll(":",":"),t=t.replaceAll(",",",");let l=t.split(":");l[1]&&(l=l[1].split(","),l=l.map(o=>{if(!o)return"";let i=o.split("=");return i[0]&&i[1]?`'${i[0]}'`:""}).filter(o=>o!=""),e.fields[e.activateField].dataType=`${e.fields[e.activateField].type}(${l.join(",")})`)}},Ge=()=>{if(Q(),!!["db","sql","log"].includes(k.type)){if(e.loading.init=!0,k.type=="log"){pl(k.startData.logId,k.startData.logType).then(t=>{const l=t.data.fields;for(const o in l){const i=K(l[o]);typeof i.defaultType>"u"&&(i.default&&["none","null","empty string"].includes(i.default)?(i.defaultType=i.default.toUpperCase(),i.default=""):i.defaultType="INPUT"),e.fields.push(i)}if(t.data.table.defaultSortField){const o=A(e.fields,"name",t.data.table.defaultSortField);o!==!1&&(t.data.table.defaultSortField=e.fields[o].uuid)}for(const o in D){const i=[],f=t.data.table[D[o]];for(const v in f){const b=A(e.fields,"name",f[v]);b!==!1&&i.push(e.fields[b].uuid)}t.data.table[D[o]]=i}e.sync=t.data.sync,e.table=t.data.table,Q(),t.data.table.empty&&(e.table.rebuild="Yes"),e.table.isCommonModel=parseInt(t.data.table.isCommonModel),e.table.databaseConnection=t.data.table.databaseConnection?t.data.table.databaseConnection:""}).finally(()=>{e.loading.init=!1});return}bl({type:k.type,table:k.startData.table,sql:k.startData.sql,connection:k.startData.databaseConnection}).then(t=>{let l=[];for(const o in t.data.columns){const i=K(t.data.columns[o]);["id","update_time","create_time","updatetime","createtime"].includes(i.name)||e.table.formFields.push(i.uuid),["textarea","file","files","editor","password","array"].includes(i.designType)||e.table.columnFields.push(i.uuid),i.designType=="pk"&&(e.table.defaultSortField=i.uuid,e.table.quickSearchField.push(i.uuid)),i.designType=="weigh"&&(e.table.defaultSortField=i.uuid),l.push(i)}e.fields=l,e.table.comment=t.data.comment,e.table.databaseConnection=k.startData.databaseConnection,t.data.empty&&(e.table.rebuild="Yes"),k.type=="db"&&k.startData.table&&(e.table.name=k.startData.table,B(k.startData.table))}).finally(()=>{e.loading.init=!1})}},be=t=>A(e.fields,"name",t)!==!1?(t+=de,de++,be(t)):t;Xe(()=>{Ge();const t=_e.create(se.value,{group:"design-field",animation:200,filter:".design-field-empty",onAdd:l=>{var f,v;const o=(v=(f=l.originalEvent)==null?void 0:f.dataTransfer)==null?void 0:v.getData("name"),i=U[o];if(i&&i[l.oldIndex]){const b=K(i[l.oldIndex]);if(b.primaryKey)if(ce(b))e.table.quickSearchField.push(b.uuid),e.table.defaultSortField||(e.table.defaultSortField=b.uuid);else return l.item.remove();b.designType=="weigh"&&(e.table.defaultSortField=b.uuid),b.name=be(b.name),e.fields.splice(l.newIndex,0,b),G({type:"add-field",index:l.newIndex,newName:b.name,oldName:"",after:l.newIndex===0?"FIRST FIELD":e.fields[l.newIndex-1].name}),["remoteSelect","remoteSelects"].includes(b.designType)&&Y(l.newIndex,!0),b.formBuildExclude||e.table.formFields.push(b.uuid),b.tableBuildExclude||e.table.columnFields.push(b.uuid)}l.item.remove(),re(()=>{t.sort(we(e.fields.length).map(b=>b.toString()))})},onEnd:l=>{const o=e.fields[l.oldIndex];e.fields.splice(l.oldIndex,1),e.fields.splice(l.newIndex,0,o),G({type:"change-field-order",index:l.newIndex,newName:"",oldName:o.name,after:l.newIndex===0?"FIRST FIELD":e.fields[l.newIndex-1].name}),re(()=>{t.sort(we(e.fields.length).map(i=>i.toString()))})}});q.value.forEach((l,o)=>{_e.create(l,{sort:!1,group:{name:"design-field",pull:"clone",put:!1},animation:200,setData:i=>{i.setData("name",Object.keys(U)[o])},onStart:()=>{e.draggingField=!0},onEnd:()=>{e.draggingField=!1}})})});const Ee=t=>{if(!t)return e.error.tableName="";/^[a-z_][a-z0-9_]*$/.test(t)?(e.error.tableName="",B(t)):e.error.tableName=r("crud.crud.Use lower case underlined for table names"),Q()},Q=()=>{e.table.rebuild="No",e.table.designChange=[]},B=t=>{t&&ne(t,e.table.isCommonModel).then(l=>{e.table.modelFile=l.data.modelFile,e.table.controllerFile=l.data.controllerFile,e.table.validateFile=l.data.validateFile,e.table.webViewsDir=l.data.webViewsDir,e.table.generateRelativePath=t.replaceAll("/","\\")})},qe=()=>{B(e.table.generateRelativePath)},Be=()=>{e.remoteSelectPre.form.table&&(X(["table"]),e.loading.remoteSelect=!0,Pe(e.remoteSelectPre.form.table,!0,e.table.databaseConnection).then(t=>{e.remoteSelectPre.form.pk=t.data.pk;const l=["name","title","username","nickname"];for(const i in t.data.fieldList)if(l.includes(i)){e.remoteSelectPre.form.label=i,e.remoteSelectPre.form.joinField.push(i);break}const o={};for(const i in t.data.fieldList)o[i]=(i?i+" - ":"")+t.data.fieldList[i];e.remoteSelectPre.fieldList=o}).finally(()=>{e.loading.remoteSelect=!1}),ne(e.remoteSelectPre.form.table).then(t=>{e.remoteSelectPre.modelFileList=t.data.modelFileList,e.remoteSelectPre.controllerFileList=t.data.controllerFileList,Object.keys(t.data.modelFileList).includes(t.data.modelFile)&&(e.remoteSelectPre.form.modelFile=t.data.modelFile),Object.keys(t.data.controllerFileList).includes(t.data.controllerFile)&&(e.remoteSelectPre.form.controllerFile=t.data.controllerFile)}))},ge=()=>{const t=()=>{if(e.fields[e.remoteSelectPre.index].name=="remote_select"){const l=e.remoteSelectPre.form.table+(e.fields[e.remoteSelectPre.index].designType=="remoteSelect"?"_id":"_ids");H(l,e.remoteSelectPre.index)}e.fields[e.remoteSelectPre.index].form["remote-table"].value=e.remoteSelectPre.form.table,e.fields[e.remoteSelectPre.index].form["remote-pk"].value=e.remoteSelectPre.form.pk,e.fields[e.remoteSelectPre.index].form["remote-field"].value=e.remoteSelectPre.form.label,e.fields[e.remoteSelectPre.index].form["remote-controller"].value=e.remoteSelectPre.form.controllerFile,e.fields[e.remoteSelectPre.index].form["remote-model"].value=e.remoteSelectPre.form.modelFile,e.fields[e.remoteSelectPre.index].form["remote-url"].value=e.remoteSelectPre.form.remoteUrl,e.fields[e.remoteSelectPre.index].form["remote-source-config-type"].value=e.remoteSelectPre.form.sourceConfigType,e.fields[e.remoteSelectPre.index].form["remote-primary-table-alias"].value=e.remoteSelectPre.form.primaryTableAlias,e.fields[e.remoteSelectPre.index].form["relation-fields"].value=e.fields[e.remoteSelectPre.index].designType=="remoteSelect"?e.remoteSelectPre.form.joinField.join(","):e.remoteSelectPre.form.label,e.remoteSelectPre.index=-1,e.remoteSelectPre.show=!1,X()};O.value&&O.value.validate(l=>{l&&t()})},ye=()=>{e.remoteSelectPre.show=!1,X(),e.remoteSelectPre.index!==-1&&e.remoteSelectPre.hideDelField&&me(e.remoteSelectPre.index)},X=(t=[])=>{for(const l in e.remoteSelectPre.form)t.includes(l)||(l=="joinField"?e.remoteSelectPre.form[l]=[]:l=="sourceConfigType"?e.remoteSelectPre.form[l]="crud":e.remoteSelectPre.form[l]="")},Me=ke({table:[x({name:"required",title:r("crud.crud.remote-table")})],pk:[x({name:"required",title:r("crud.crud.Drop down value field")})],label:[x({name:"required",title:r("crud.crud.Drop down label field")})],joinField:[x({name:"required",title:r("crud.crud.Fields displayed in the table")})],controllerFile:[x({name:"required",title:r("crud.crud.Controller position")})],modelFile:[x({name:"required",title:r("crud.crud.Data Model Location")})],remoteUrl:[x({name:"required",title:r("crud.crud.remote-url")})]}),G=t=>{if(k.type=="create")return;let l=!0;if(t.type=="change-field-name"){for(const o in e.table.designChange)e.table.designChange[o].type=="change-field-attr"&&t.oldName==e.table.designChange[o].oldName&&(e.table.designChange[o].oldName=t.newName),e.table.designChange[o].type=="change-field-order"&&t.oldName==e.table.designChange[o].oldName&&(e.table.designChange[o].oldName=t.newName),e.table.designChange[o].after==t.oldName&&(e.table.designChange[o].after=t.newName);for(const o in e.table.designChange){if(e.table.designChange[o].type=="add-field"&&e.table.designChange[o].newName==t.oldName){e.table.designChange[o].newName=t.newName,l=!1;break}if(e.table.designChange[o].type=="change-field-name"&&e.table.designChange[o].newName==t.oldName){t.oldName=e.table.designChange[o].oldName,e.table.designChange[o]=t,e.table.designChange[o].newName==e.table.designChange[o].oldName&&e.table.designChange.splice(o,1),l=!1;break}}}else if(t.type=="del-field"){let o=!1;e.table.designChange=e.table.designChange.filter(i=>{o=i.type=="add-field"&&i.newName==t.oldName;const f=i.type=="change-field-attr"&&i.oldName==t.oldName,v=i.type=="change-field-order"&&i.oldName==t.oldName;return!o&&!f&&!v}),e.table.designChange=e.table.designChange.filter(i=>{const f=i.type=="change-field-name"&&i.newName==t.oldName;return f&&(t.oldName=i.oldName),!f}),o&&(l=!1);for(const i in e.table.designChange)if(e.table.designChange[i].type=="del-field"&&e.table.designChange[i].oldName==t.oldName){l=!1;break}}else if(t.type=="change-field-attr")for(const o in e.table.designChange){if(e.table.designChange[o].type=="change-field-attr"&&e.table.designChange[o].oldName==t.oldName){l=!1;break}if(e.table.designChange[o].type=="add-field"&&e.table.designChange[o].newName==t.oldName){l=!1;break}}else if(t.type=="change-field-order")for(const o in e.table.designChange){if(e.table.designChange[o].type=="add-field"&&e.table.designChange[o].newName==t.oldName){e.table.designChange[o].after=t.after,l=!1;break}if(e.table.designChange[o].type=="change-field-order"&&e.table.designChange[o].oldName==t.oldName){e.table.designChange[o]=t,l=!1;break}}t.sync=!0,l&&e.table.designChange.push(t)},$e=t=>{switch(t.type){case"add-field":return r("crud.crud.Add field")+" "+t.newName;case"change-field-attr":return r("crud.crud.Modify field properties")+" "+t.oldName;case"change-field-name":return r("crud.crud.Modify field name")+" "+t.oldName+" => "+t.newName;case"del-field":return r("crud.crud.Delete field")+" "+t.oldName;case"change-field-order":return r("crud.crud.Modify field order")+" "+t.oldName+" => "+(t.after=="FIRST FIELD"?r("crud.crud.First field"):t.after+" "+r("crud.crud.After"));default:return r("Unknown")}},je=t=>{let l="";switch(t){case"change-field-name":l="warning";break;case"del-field":l="danger";break;case"add-field":l="primary";break;case"change-field-attr":l="success";break;case"change-field-order":l="info";break;default:l="success";break}return l};return(t,l)=>{const o=F("el-link"),i=F("el-button"),f=F("el-row"),v=F("el-option"),b=F("el-select"),N=F("el-form-item"),he=F("el-checkbox"),Fe=F("el-input"),Z=F("Icon"),ee=F("el-collapse-item"),ze=F("el-collapse"),le=F("el-col"),M=F("el-divider"),ve=F("el-form"),Oe=F("el-text"),Se=F("el-scrollbar"),te=F("el-dialog"),ae=F("el-alert"),He=F("el-timeline-item"),Ye=F("el-timeline"),L=ie("blur"),oe=ie("loading"),Je=ie("drag");return s(),y("div",hl,[m("div",Fl,[d(f,{class:"header-box"},{default:c(()=>[m("div",vl,[m("div",Sl,[d(g,{class:"mr-20 table-name-item",label:n(r)("crud.log.table_name"),modelValue:e.table.name,"onUpdate:modelValue":l[0]||(l[0]=a=>e.table.name=a),type:"string",placeholder:n(r)("crud.crud.Name of the data table"),"input-attr":{onChange:Ee},error:e.error.tableName},null,8,["label","modelValue","placeholder","input-attr","error"]),d(g,{class:"table-comment-item",label:n(r)("crud.crud.Data Table Notes"),modelValue:e.table.comment,"onUpdate:modelValue":l[1]||(l[1]=a=>e.table.comment=a),type:"string",placeholder:n(r)("crud.crud.For example: `user table` will be generated into `user management`")},null,8,["label","modelValue","placeholder"])]),m("div",Cl,[n(k).type!="create"?(s(),p(o,{key:0,onClick:l[2]||(l[2]=a=>e.showDesignChangeLog=!0),class:"design-change-log",type:"primary"},{default:c(()=>[w(h(n(r)("crud.crud.Table design change")),1)]),_:1})):S("",!0),T((s(),p(i,{type:"primary",loading:e.loading.generate,onClick:Ae},{default:c(()=>[w(h(n(r)("crud.crud.Generate CRUD code")),1)]),_:1},8,["loading"])),[[L]]),T((s(),p(i,{onClick:Ke,type:"danger"},{default:c(()=>[w(h(n(r)("crud.crud.give up")),1)]),_:1})),[[L]])])])]),_:1}),d(Ze,{name:e.showHeaderSeniorConfig?"el-zoom-in-top":"el-zoom-in-bottom"},{default:c(()=>[e.showHeaderSeniorConfig?(s(),y("div",kl,[m("div",wl,[d(N,{"label-width":140,label:n(r)("crud.crud.Table Quick Search Fields")},{default:c(()=>[d(b,{clearable:!0,multiple:!0,class:"w100",modelValue:e.table.quickSearchField,"onUpdate:modelValue":l[3]||(l[3]=a=>e.table.quickSearchField=a),placement:"bottom"},{default:c(()=>[(s(!0),y(C,null,P(e.fields,(a,u)=>(s(),p(v,{key:u+a.uuid,label:a.name+(a.comment?"-"+a.comment:a.title),value:a.uuid},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),m("div",Vl,[d(N,{"label-width":140,class:"default-sort-field mr-20",label:n(r)("crud.crud.Table Default Sort Fields")},{default:c(()=>[d(b,{clearable:!0,modelValue:e.table.defaultSortField,"onUpdate:modelValue":l[4]||(l[4]=a=>e.table.defaultSortField=a),placement:"bottom"},{default:c(()=>[(s(!0),y(C,null,P(e.fields,(a,u)=>(s(),p(v,{key:u+a.uuid,label:a.name+(a.comment?"-"+a.comment:a.title),value:a.uuid},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),d(g,{class:"default-sort-field-type",label:n(r)("crud.crud.sort order"),modelValue:e.table.defaultSortType,"onUpdate:modelValue":l[5]||(l[5]=a=>e.table.defaultSortType=a),type:"select","input-attr":{content:{desc:n(r)("crud.crud.sort order desc"),asc:n(r)("crud.crud.sort order asc")}}},null,8,["label","modelValue","input-attr"])]),d(N,{"label-width":140,label:n(r)("crud.crud.Fields as Table Columns")},{default:c(()=>[d(b,{clearable:!0,multiple:!0,class:"w100",modelValue:e.table.columnFields,"onUpdate:modelValue":l[6]||(l[6]=a=>e.table.columnFields=a),placement:"bottom"},{default:c(()=>[(s(!0),y(C,null,P(e.fields,(a,u)=>(s(),p(v,{key:u+a.uuid,label:a.name+(a.comment?"-"+a.comment:a.title),value:a.uuid},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),d(N,{"label-width":140,label:n(r)("crud.crud.Fields as form items")},{default:c(()=>[d(b,{clearable:!0,multiple:!0,class:"w100",modelValue:e.table.formFields,"onUpdate:modelValue":l[7]||(l[7]=a=>e.table.formFields=a),placement:"bottom"},{default:c(()=>[(s(!0),y(C,null,P(e.fields,(a,u)=>(s(),p(v,{key:u+a.uuid,label:a.name+(a.comment?"-"+a.comment:a.title),value:a.uuid},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),d(g,{label:n(r)("crud.crud.The relative path to the generated code"),modelValue:e.table.generateRelativePath,"onUpdate:modelValue":l[8]||(l[8]=a=>e.table.generateRelativePath=a),type:"string","label-width":140,"block-help":n(r)("crud.crud.For quick combination code generation location, please fill in the relative path"),"input-attr":{onChange:B}},null,8,["label","modelValue","block-help","input-attr"]),d(g,{label:n(r)("crud.crud.Generated Controller Location"),modelValue:e.table.controllerFile,"onUpdate:modelValue":l[9]||(l[9]=a=>e.table.controllerFile=a),type:"string","label-width":140},null,8,["label","modelValue"]),d(N,{label:n(r)("crud.crud.Generated Data Model Location"),"label-width":140},{default:c(()=>[d(Fe,{modelValue:e.table.modelFile,"onUpdate:modelValue":l[11]||(l[11]=a=>e.table.modelFile=a),type:"string"},{append:c(()=>[d(he,{onChange:qe,modelValue:e.table.isCommonModel,"onUpdate:modelValue":l[10]||(l[10]=a=>e.table.isCommonModel=a),label:n(r)("crud.crud.Common model"),size:"small","true-value":1,"false-value":0},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1},8,["label"]),d(g,{label:n(r)("crud.crud.Generated Validator Location"),modelValue:e.table.validateFile,"onUpdate:modelValue":l[12]||(l[12]=a=>e.table.validateFile=a),type:"string","label-width":140},null,8,["label","modelValue"]),d(g,{label:n(r)("crud.crud.WEB end view directory"),modelValue:e.table.webViewsDir,"onUpdate:modelValue":l[13]||(l[13]=a=>e.table.webViewsDir=a),type:"string","label-width":140},null,8,["label","modelValue"]),d(g,{label:n(r)("Database connection"),modelValue:e.table.databaseConnection,"onUpdate:modelValue":l[14]||(l[14]=a=>e.table.databaseConnection=a),type:"remoteSelect","label-width":140,"block-help":n(r)("Database connection help"),"input-attr":{pk:"key",field:"key",remoteUrl:n(rl)}},null,8,["label","modelValue","block-help","input-attr"])])])):S("",!0)]),_:1},8,["name"]),m("div",{onClick:l[15]||(l[15]=a=>e.showHeaderSeniorConfig=!e.showHeaderSeniorConfig),class:"header-senior-config"},[m("span",null,h(n(r)("crud.crud.Advanced Configuration")),1),d(Z,{class:"senior-config-arrow-icon",size:"14",color:"var(--el-text-color-primary)",name:e.showHeaderSeniorConfig?"el-icon-ArrowUp":"el-icon-ArrowDown"},null,8,["name"])])]),T((s(),p(f,{class:"fields-box",gutter:20},{default:c(()=>[d(le,{xs:24,span:6},{default:c(()=>[d(ze,{class:"field-collapse",modelValue:e.fieldCollapseName,"onUpdate:modelValue":l[16]||(l[16]=a=>e.fieldCollapseName=a)},{default:c(()=>[d(ee,{title:n(r)("crud.crud.Common Fields"),name:"common"},{default:c(()=>[m("div",{class:"field-box",ref:n(q).set},[(s(!0),y(C,null,P(n(U).common,(a,u)=>(s(),y("div",{key:u,class:"field-item"},[m("span",null,h(a.title),1)]))),128))],512)]),_:1},8,["title"]),d(ee,{title:n(r)("crud.crud.Base Fields"),name:"base"},{default:c(()=>[m("div",{class:"field-box",ref:n(q).set},[(s(!0),y(C,null,P(n(U).base,(a,u)=>(s(),y("div",{key:u,class:"field-item"},[m("span",null,h(a.title),1)]))),128))],512)]),_:1},8,["title"]),d(ee,{title:n(r)("crud.crud.Advanced Fields"),name:"senior"},{default:c(()=>[m("div",{class:"field-box",ref:n(q).set},[(s(!0),y(C,null,P(n(U).senior,(a,u)=>(s(),y("div",{key:u,class:"field-item"},[m("span",null,h(a.title),1)]))),128))],512)]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),d(le,{xs:24,span:12},{default:c(()=>[m("div",{ref_key:"designWindowRef",ref:se,class:"design-window ba-scroll-style"},[(s(!0),y(C,null,P(e.fields,(a,u)=>(s(),y("div",{key:u,class:el([u===e.activateField?"activate":"","design-field-box"]),onClick:V=>Ue(u),"data-id":u},[m("div",_l,[m("span",null,h(n(r)("crud.crud.Field Name"))+":",1),d(Te,{onPointerdown:l[17]||(l[17]=$(()=>{},["stop"])),class:"design-field-name-input","model-value":a.name,type:"string",attr:{size:"small",onInput:V=>H(V,u)}},null,8,["model-value","attr"])]),m("div",Tl,[m("span",null,h(n(r)("crud.crud.field comment"))+":",1),d(Te,{onPointerdown:l[18]||(l[18]=$(()=>{},["stop"])),class:"design-field-name-comment",modelValue:a.comment,"onUpdate:modelValue":V=>a.comment=V,type:"string",attr:{size:"small",onChange:pe}},null,8,["modelValue","onUpdate:modelValue","attr"])]),m("div",Nl,[["remoteSelect","remoteSelects"].includes(a.designType)?T((s(),p(i,{key:0,onClick:$(V=>Re(u,a),["stop"]),type:"primary",size:"small",circle:""},{default:c(()=>[d(Z,{color:"var(--el-color-white)",size:"15",name:"fa fa-pencil icon"})]),_:2},1032,["onClick"])),[[L]]):S("",!0),T((s(),p(i,{onClick:$(V=>me(u),["stop"]),type:"danger",size:"small",circle:""},{default:c(()=>[d(Z,{color:"var(--el-color-white)",size:"15",name:"fa fa-trash"})]),_:2},1032,["onClick"])),[[L]])])],10,Pl))),128)),!e.fields.length&&!e.draggingField?(s(),y("div",Dl,h(n(r)("crud.crud.Drag the left element here to start designing CRUD")),1)):S("",!0)],512)]),_:1}),d(le,{xs:24,span:6},{default:c(()=>[m("div",Ul,[e.activateField===-1?(s(),y("div",xl,h(n(r)("crud.crud.Please select a field from the left first")),1)):(s(),y("div",{key:"activate-field-"+e.activateField},[d(ve,{"label-position":"top"},{default:c(()=>[d(M,{"content-position":"left"},{default:c(()=>[w(h(n(r)("crud.crud.Common")),1)]),_:1}),d(N,{label:n(r)("crud.crud.Generate type")},{default:c(()=>[d(b,{onChange:l[19]||(l[19]=a=>xe(a)),class:"w100","model-value":e.fields[e.activateField].designType,placement:"bottom"},{default:c(()=>[(s(!0),y(C,null,P(n(Ne),(a,u)=>(s(),p(v,{key:u,label:a.name,value:u},null,8,["label","value"]))),128))]),_:1},8,["model-value"])]),_:1},8,["label"]),d(g,{label:n(r)("crud.crud.Field comments (CRUD dictionary)"),type:"textarea","input-attr":{rows:2,onChange:pe},placeholder:n(r)("crud.crud.The field comment will be used as the CRUD dictionary, and will be identified as the field title before the colon, and as the data dictionary after the colon"),modelValue:e.fields[e.activateField].comment,"onUpdate:modelValue":l[20]||(l[20]=a=>e.fields[e.activateField].comment=a)},null,8,["label","input-attr","placeholder","modelValue"]),d(M,{"content-position":"left"},{default:c(()=>[w(h(n(r)("crud.crud.Field Properties")),1)]),_:1}),d(g,{label:n(r)("crud.crud.Field Name"),type:"string","model-value":e.fields[e.activateField].name,"input-attr":{onInput:a=>H(a,e.activateField)}},null,8,["label","model-value","input-attr"]),e.fields[e.activateField].dataType?(s(),p(g,{key:0,label:n(r)("crud.crud.Field Type"),"input-attr":{onChange:_},type:"textarea",modelValue:e.fields[e.activateField].dataType,"onUpdate:modelValue":l[21]||(l[21]=a=>e.fields[e.activateField].dataType=a)},null,8,["label","input-attr","modelValue"])):(s(),y(C,{key:1},[d(g,{label:n(r)("crud.crud.Field Type"),"input-attr":{onChange:_},type:"string",modelValue:e.fields[e.activateField].type,"onUpdate:modelValue":l[22]||(l[22]=a=>e.fields[e.activateField].type=a)},null,8,["label","input-attr","modelValue"]),m("div",Ll,[d(g,{label:n(r)("crud.crud.length"),type:"number",modelValue:e.fields[e.activateField].length,"onUpdate:modelValue":l[23]||(l[23]=a=>e.fields[e.activateField].length=a),"input-attr":{onChange:_}},null,8,["label","modelValue","input-attr"]),d(g,{label:n(r)("crud.crud.decimal point"),type:"number",modelValue:e.fields[e.activateField].precision,"onUpdate:modelValue":l[24]||(l[24]=a=>e.fields[e.activateField].precision=a),"input-attr":{onChange:_}},null,8,["label","modelValue","input-attr"])])],64)),d(N,{label:n(r)("crud.crud.Field Defaults")},{default:c(()=>[d(b,{modelValue:e.fields[e.activateField].defaultType,"onUpdate:modelValue":l[25]||(l[25]=a=>e.fields[e.activateField].defaultType=a)},{default:c(()=>[d(v,{label:"手动输入",value:"INPUT"}),d(v,{label:"EMPTY STRING(空字符串)",value:"EMPTY STRING"}),d(v,{label:"NULL",value:"NULL"}),d(v,{label:"无(不设默认值)",value:"NONE"})]),_:1},8,["modelValue"]),e.fields[e.activateField].defaultType=="INPUT"?(s(),p(Fe,{key:0,placeholder:n(r)("crud.crud.Please input the default value"),type:"text",modelValue:e.fields[e.activateField].default,"onUpdate:modelValue":l[26]||(l[26]=a=>e.fields[e.activateField].default=a),onChange:_,class:"default-input"},null,8,["placeholder","modelValue"])):S("",!0)]),_:1},8,["label"]),m("div",Il,[d(g,{class:"form-item-position-right",label:n(r)("crud.state.Primary key"),type:"switch",modelValue:e.fields[e.activateField].primaryKey,"onUpdate:modelValue":l[27]||(l[27]=a=>e.fields[e.activateField].primaryKey=a),"input-attr":{onChange:_}},null,8,["label","modelValue","input-attr"]),d(g,{class:"form-item-position-right",label:n(r)("crud.crud.Auto increment"),type:"switch",modelValue:e.fields[e.activateField].autoIncrement,"onUpdate:modelValue":l[28]||(l[28]=a=>e.fields[e.activateField].autoIncrement=a),"input-attr":{onChange:_}},null,8,["label","modelValue","input-attr"])]),m("div",Rl,[d(g,{class:"form-item-position-right",label:n(r)("crud.crud.Unsigned"),type:"switch",modelValue:e.fields[e.activateField].unsigned,"onUpdate:modelValue":l[29]||(l[29]=a=>e.fields[e.activateField].unsigned=a),"input-attr":{onChange:_}},null,8,["label","modelValue","input-attr"]),d(g,{class:"form-item-position-right",label:n(r)("crud.crud.Allow NULL"),type:"switch",modelValue:e.fields[e.activateField].null,"onUpdate:modelValue":l[30]||(l[30]=a=>e.fields[e.activateField].null=a),"input-attr":{onChange:_}},null,8,["label","modelValue","input-attr"])]),n(j)(e.fields[e.activateField].table)?S("",!0):(s(),y(C,{key:2},[d(M,{"content-position":"left"},{default:c(()=>[w(h(n(r)("crud.crud.Field Table Properties")),1)]),_:1}),(s(!0),y(C,null,P(e.fields[e.activateField].table,(a,u)=>(s(),p(g,{key:u,label:t.$t("crud.crud."+u),type:a.type,modelValue:e.fields[e.activateField].table[u].value,"onUpdate:modelValue":V=>e.fields[e.activateField].table[u].value=V,placeholder:e.fields[e.activateField].table[u].placeholder??"","input-attr":{content:e.fields[e.activateField].table[u].options??{},...e.fields[e.activateField].table[u].attr??{}}},null,8,["label","type","modelValue","onUpdate:modelValue","placeholder","input-attr"]))),128))],64)),n(j)(e.fields[e.activateField].form)?S("",!0):(s(),y(C,{key:3},[d(M,{"content-position":"left"},{default:c(()=>[w(h(n(r)("crud.crud.Field Form Properties")),1)]),_:1}),(s(!0),y(C,null,P(e.fields[e.activateField].form,(a,u)=>(s(),y(C,{key:u},[a.type!="hidden"?(s(),p(g,{key:0,label:t.$t("crud.crud."+u),type:a.type,modelValue:e.fields[e.activateField].form[u].value,"onUpdate:modelValue":V=>e.fields[e.activateField].form[u].value=V,placeholder:e.fields[e.activateField].form[u].placeholder??"","input-attr":{content:e.fields[e.activateField].form[u].options??{},...e.fields[e.activateField].form[u].attr??{}}},null,8,["label","type","modelValue","onUpdate:modelValue","placeholder","input-attr"])):S("",!0)],64))),128))],64))]),_:1})]))])]),_:1})]),_:1})),[[oe,e.loading.init]]),d(te,{onClose:ye,class:"ba-operate-dialog","model-value":e.remoteSelectPre.show,title:n(r)("crud.crud.Remote drop-down association information"),"close-on-click-modal":!1,"destroy-on-close":!0,onKeyup:ll(ge,["enter"])},{footer:c(()=>[m("div",El,[d(i,{onClick:ye},{default:c(()=>[w(h(t.$t("Cancel")),1)]),_:1}),T((s(),p(i,{onClick:ge,type:"primary"},{default:c(()=>[w(h(t.$t("Save")),1)]),_:1})),[[L]])])]),default:c(()=>[d(Se,{"max-height":"60vh"},{default:c(()=>[m("div",Al,[e.remoteSelectPre.index!=-1&&e.fields[e.remoteSelectPre.index]?T((s(),p(ve,{key:0,ref_key:"formRef",ref:O,model:e.remoteSelectPre.form,rules:Me,"label-position":"right","label-width":"160px"},{default:c(()=>[(s(),p(g,{label:n(r)("crud.crud.Associated Data Table"),modelValue:e.remoteSelectPre.form.table,"onUpdate:modelValue":l[31]||(l[31]=a=>e.remoteSelectPre.form.table=a),type:"remoteSelect",key:e.table.databaseConnection,"input-attr":{pk:"table",field:"comment",params:{connection:e.table.databaseConnection,samePrefix:1,excludeTable:["area","token","captcha","admin_group_access","config","admin_log","user_money_log","user_score_log"]},remoteUrl:n(il),onChange:Be},prop:"table"},null,8,["label","modelValue","input-attr"])),T((s(),y("div",null,[(s(),p(g,{prop:"pk",type:"select",label:n(r)("crud.crud.Drop down value field"),modelValue:e.remoteSelectPre.form.pk,"onUpdate:modelValue":l[32]||(l[32]=a=>e.remoteSelectPre.form.pk=a),placeholder:n(r)("crud.crud.Please select the value field of the select component"),key:"select-value"+JSON.stringify(e.remoteSelectPre.fieldList),"input-attr":{content:e.remoteSelectPre.fieldList}},null,8,["label","modelValue","placeholder","input-attr"])),(s(),p(g,{prop:"label",type:"select",label:n(r)("crud.crud.Drop down label field"),modelValue:e.remoteSelectPre.form.label,"onUpdate:modelValue":l[33]||(l[33]=a=>e.remoteSelectPre.form.label=a),placeholder:n(r)("crud.crud.Please select the label field of the select component"),key:"select-label"+JSON.stringify(e.remoteSelectPre.fieldList),"input-attr":{content:e.remoteSelectPre.fieldList}},null,8,["label","modelValue","placeholder","input-attr"])),e.fields[e.remoteSelectPre.index].designType=="remoteSelect"?(s(),p(g,{prop:"joinField",type:"selects",label:n(r)("crud.crud.Fields displayed in the table"),modelValue:e.remoteSelectPre.form.joinField,"onUpdate:modelValue":l[34]||(l[34]=a=>e.remoteSelectPre.form.joinField=a),placeholder:n(r)("crud.crud.Please select the fields displayed in the table"),key:"join-field"+JSON.stringify(e.remoteSelectPre.fieldList),"input-attr":{content:e.remoteSelectPre.fieldList}},null,8,["label","modelValue","placeholder","input-attr"])):S("",!0),d(g,{label:n(r)("crud.crud.Data source configuration type"),modelValue:e.remoteSelectPre.form.sourceConfigType,"onUpdate:modelValue":l[35]||(l[35]=a=>e.remoteSelectPre.form.sourceConfigType=a),type:"radio","input-attr":{border:!0,content:{crud:n(r)("crud.crud.Fast configuration with generated controllers and models"),custom:n(r)("crud.crud.Custom configuration")}}},null,8,["label","modelValue","input-attr"]),e.remoteSelectPre.form.sourceConfigType=="crud"?(s(),p(g,{prop:"controllerFile",type:"select",label:n(r)("crud.crud.Controller position"),modelValue:e.remoteSelectPre.form.controllerFile,"onUpdate:modelValue":l[36]||(l[36]=a=>e.remoteSelectPre.form.controllerFile=a),placeholder:n(r)("crud.crud.Please select the controller of the data table"),key:"controller-file"+JSON.stringify(e.remoteSelectPre.controllerFileList),"input-attr":{content:e.remoteSelectPre.controllerFileList},"block-help":n(r)("crud.crud.The remote pull-down will request the corresponding controller to obtain data, so it is recommended that you create the CRUD of the associated table")},null,8,["label","modelValue","placeholder","input-attr","block-help"])):S("",!0),(s(),p(g,{prop:e.remoteSelectPre.form.sourceConfigType=="crud"?"modelFile":"",type:"select",label:n(r)("crud.crud.Data Model Location"),modelValue:e.remoteSelectPre.form.modelFile,"onUpdate:modelValue":l[37]||(l[37]=a=>e.remoteSelectPre.form.modelFile=a),placeholder:n(r)("crud.crud.Please select the data model location of the data table"),key:"model-file"+JSON.stringify(e.remoteSelectPre.modelFileList),"input-attr":{content:e.remoteSelectPre.modelFileList},"block-help":e.remoteSelectPre.form.sourceConfigType=="crud"?"":n(r)("crud.crud.If it is left blank, the model of the associated table will be generated automatically If the table already has a model, it is recommended to select it to avoid repeated generation")},null,8,["prop","label","modelValue","placeholder","input-attr","block-help"])),e.table.databaseConnection&&e.remoteSelectPre.form.modelFile?(s(),p(N,{key:2,label:n(r)("Database connection")},{default:c(()=>[d(Oe,{size:"large",type:"danger"},{default:c(()=>[w(h(e.table.databaseConnection),1)]),_:1}),m("div",Kl,[m("div",null,h(n(r)("crud.crud.Check model class",{connection:e.table.databaseConnection})),1),m("div",null,h(n(r)("crud.crud.There is no connection attribute in model class")),1)])]),_:1},8,["label"])):S("",!0),e.remoteSelectPre.form.sourceConfigType=="custom"?(s(),p(g,{key:3,prop:"remoteUrl",label:n(r)("crud.crud.api url"),type:"string",modelValue:e.remoteSelectPre.form.remoteUrl,"onUpdate:modelValue":l[38]||(l[38]=a=>e.remoteSelectPre.form.remoteUrl=a),placeholder:n(r)("crud.crud.api url example")},null,8,["label","modelValue","placeholder"])):S("",!0),e.remoteSelectPre.form.sourceConfigType=="custom"?(s(),p(g,{key:4,label:n(r)("crud.crud.remote-primary-table-alias"),type:"string",modelValue:e.remoteSelectPre.form.primaryTableAlias,"onUpdate:modelValue":l[39]||(l[39]=a=>e.remoteSelectPre.form.primaryTableAlias=a),"block-help":n(r)("crud.crud.If the remote interface query involves associated query of multiple tables, enter the alias of the primary data table here")},{append:c(()=>[w("."+h(e.remoteSelectPre.form.pk),1)]),_:1},8,["label","modelValue","block-help"])):S("",!0),d(N,{label:n(r)("Reminder")},{default:c(()=>[m("div",Gl,h(n(r)("crud.crud.Design remote select tips")),1)]),_:1},8,["label"])])),[[oe,e.loading.remoteSelect]])]),_:1},8,["model","rules"])),[[oe,e.remoteSelectPre.loading]]):S("",!0)])]),_:1})]),_:1},8,["model-value","title"]),d(te,{onClose:J,class:"ba-operate-dialog confirm-generate-dialog","model-value":e.confirmGenerate.show,title:n(r)("crud.crud.Confirm CRUD code generation")},{footer:c(()=>[m("div",Bl,[d(i,{onClick:J},{default:c(()=>[w(h(t.$t("Cancel")),1)]),_:1}),T((s(),p(i,{loading:e.loading.generate,onClick:W,type:"primary"},{default:c(()=>[w(h(n(r)("crud.crud.Continue building")),1)]),_:1},8,["loading"])),[[L]])])]),default:c(()=>[m("div",ql,[e.confirmGenerate.controller?(s(),p(ae,{key:0,title:n(r)("crud.crud.The controller already exists Continuing to generate will automatically overwrite the existing code!"),center:"",type:"error"},null,8,["title"])):S("",!0),fe()?(s(),p(ae,{key:1,title:n(r)("crud.crud.The data table already exists Continuing to generate will automatically delete the original table and create a new one!"),class:"mt-10",center:"",type:"error"},null,8,["title"])):S("",!0),e.confirmGenerate.menu?(s(),p(ae,{key:2,title:n(r)("crud.crud.The menu rule with the same name already exists The menu and permission node will not be created in this generation"),class:"mt-10",center:"",type:"error"},null,8,["title"])):S("",!0)])]),_:1},8,["model-value","title"]),d(te,{class:"ba-operate-dialog design-change-log-dialog",width:"20%",modelValue:e.showDesignChangeLog,"onUpdate:modelValue":l[42]||(l[42]=a=>e.showDesignChangeLog=a)},{header:c(()=>[T((s(),y("div",null,[w(h(n(r)("crud.crud.Data table design changes preview")),1)])),[[Je,[".design-change-log-dialog",".el-dialog__header"]]])]),footer:c(()=>[m("div",zl,[d(i,{onClick:l[41]||(l[41]=a=>e.showDesignChangeLog=!1)},{default:c(()=>[w(h(n(r)("Confirm")),1)]),_:1})])]),default:c(()=>[d(Se,{"max-height":"400px"},{default:c(()=>[e.table.designChange.length?(s(),y(C,{key:0},[d(Ye,{class:"design-change-log-timeline"},{default:c(()=>[(s(!0),y(C,null,P(e.table.designChange,(a,u)=>(s(),p(He,{key:u,type:je(a.type),hollow:!0,"hide-timestamp":!0},{default:c(()=>[m("div",Ml,[d(he,{modelValue:a.sync,"onUpdate:modelValue":V=>a.sync=V,label:$e(a),size:"small"},null,8,["modelValue","onUpdate:modelValue","label"])])]),_:2},1032,["type"]))),128))]),_:1}),m("span",$l,h(n(r)("crud.crud.designChangeTips")),1)],64)):(s(),y("div",jl,"暂无表设计变更")),d(g,{label:n(r)("crud.crud.tableReBuild"),class:"rebuild-form-item",modelValue:e.table.rebuild,"onUpdate:modelValue":l[40]||(l[40]=a=>e.table.rebuild=a),type:"radio","input-attr":{border:!0,content:{No:n(r)("crud.crud.No"),Yes:n(r)("crud.crud.Yes")}},"block-help":n(r)("crud.crud.tableReBuildBlockHelp")},null,8,["label","modelValue","input-attr","block-help"])]),_:1})]),_:1},8,["modelValue"])])}}}),at=dl(Ol,[["__scopeId","data-v-578789f2"]]);export{at as default};
|