Files
2026-03-18 11:22:12 +08:00

2 lines
15 KiB
JavaScript

import{u as c}from"./index-CB_W4Mz-.js";import{c as i,u as d,j as e}from"./index-CP9YHUOF.js";import{f as a,n as b}from"./index-Civcz3u4.js";import{c as p}from"./validate-CsIEl4-L.js";import{a as f}from"./vue-BqYd3Ike.js";const n="/admin/crud.Crud/";function I(l){return i({url:n+"generate",method:"post",data:l},{showSuccessMessage:!0})}function w(l,r=0){return i({url:n+"getFileData",method:"get",params:{table:l,commonModel:r}})}function E(l){return i({url:n+"generateCheck",method:"post",data:l},{showCodeMessage:!1})}function k(l){return i({url:n+"parseFieldData",method:"post",data:l})}function A(l,r){const s={id:l,type:r};if(r=="Cloud history"){const g=c();s.token=g.getToken("auth")}return i({url:n+"logStart",method:"post",data:s})}function x(l){return i({url:n+"delete",method:"post",data:{id:l}})}function R(l,r){return i({url:n+"checkCrudLog",method:"get",params:{table:l,connection:r}})}function L(l){const r=c(),s=d();return i({url:s.apiUrl+"/api/v6.Crud/uploadLog",data:l,method:"post"},{anotherToken:r.getToken("auth")})}function D(l){return i({url:n+"uploadCompleted",data:l,method:"post"})}function U(l={}){const r=c(),s=d();return i({url:s.apiUrl+"/api/v6.Crud/logs",data:l,method:"post"},{anotherToken:r.getToken("auth")})}function C(l={}){const r=c(),s=d();return i({url:s.apiUrl+"/api/v6.Crud/del",data:l,method:"post"},{anotherToken:r.getToken("auth")})}const u=f({step:"Start",type:"",startData:{sql:"",table:"",logId:"",logType:"",databaseConnection:""}}),O=l=>{if(u.type=l,l=="start"){u.step="Start";for(const r in u.startData)u.startData[r]=""}else u.step="Design"},B={common:[{title:e.global.t("crud.state.Primary key"),name:"id",comment:"ID",designType:"pk",formBuildExclude:!0,table:{},form:{},...a.number,defaultType:"NONE",null:!1,primaryKey:!0,unsigned:!0,autoIncrement:!0},{title:e.global.t("crud.state.Primary key (Snowflake ID)"),name:"id",comment:"ID",designType:"spk",formBuildExclude:!0,table:{},form:{},...a.number,type:"bigint",length:20,defaultType:"NONE",null:!1,primaryKey:!0,unsigned:!0},{title:e.global.t("State"),name:"status",comment:e.global.t("crud.state.Status:0=Disabled,1=Enabled"),designType:"switch",table:{},form:{},...a.switch,default:"1",defaultType:"INPUT"},{title:e.global.t("crud.state.remarks"),name:"remark",comment:e.global.t("crud.state.remarks"),designType:"textarea",tableBuildExclude:!0,table:{},form:{},...a.textarea},{title:e.global.t("crud.state.Weight (drag and drop sorting)"),name:"weigh",comment:e.global.t("Weigh"),designType:"weigh",table:{},form:{},...a.number},{title:e.global.t("Update time"),name:"update_time",comment:e.global.t("Update time"),designType:"timestamp",formBuildExclude:!0,table:{},form:{},...a.datetime},{title:e.global.t("Create time"),name:"create_time",comment:e.global.t("Create time"),designType:"timestamp",formBuildExclude:!0,table:{},form:{},...a.datetime},{title:e.global.t("crud.state.Remote Select (association table)"),name:"remote_select",comment:e.global.t("utils.remote select"),designType:"remoteSelect",tableBuildExclude:!0,table:{},form:{},...a.remoteSelect}],base:[{title:e.global.t("utils.string"),name:"string",comment:e.global.t("utils.string"),designType:"string",table:{},form:{},...a.string},{title:e.global.t("utils.image"),name:"image",comment:e.global.t("utils.image"),designType:"image",table:{},form:{},...a.image},{title:e.global.t("utils.file"),name:"file",comment:e.global.t("utils.file"),designType:"file",tableBuildExclude:!0,table:{},form:{},...a.file},{title:e.global.t("utils.radio"),name:"radio",dataType:"enum('opt0','opt1')",comment:e.global.t("crud.state.Radio:opt0=Option1,opt1=Option2"),designType:"radio",table:{},form:{},...a.radio,default:"opt0",defaultType:"INPUT"},{title:e.global.t("utils.checkbox"),name:"checkbox",dataType:"set('opt0','opt1')",comment:e.global.t("crud.state.Checkbox:opt0=Option1,opt1=Option2"),designType:"checkbox",table:{},form:{},...a.checkbox,default:"opt0,opt1",defaultType:"INPUT"},{title:e.global.t("utils.select"),name:"select",dataType:"enum('opt0','opt1')",comment:e.global.t("crud.state.Select:opt0=Option1,opt1=Option2"),designType:"select",table:{},form:{},...a.select,default:"opt0",defaultType:"INPUT"},{title:e.global.t("utils.switch"),name:"switch",comment:e.global.t("crud.state.Switch:0=off,1=on"),designType:"switch",table:{},form:{},...a.switch,default:"1",defaultType:"INPUT"},{title:e.global.t("utils.rich Text"),name:"editor",comment:e.global.t("utils.rich Text"),designType:"editor",tableBuildExclude:!0,table:{},form:{},...a.editor},{title:e.global.t("utils.textarea"),name:"textarea",comment:e.global.t("utils.textarea"),designType:"textarea",tableBuildExclude:!0,table:{},form:{},...a.textarea},{title:e.global.t("utils.number"),name:"number",comment:e.global.t("utils.number"),designType:"number",table:{},form:{},...a.number},{title:e.global.t("utils.float"),name:"float",type:"decimal",length:5,precision:2,defaultType:"NULL",...b(),null:!0,comment:e.global.t("utils.float"),designType:"float",table:{},form:{}},{title:e.global.t("utils.password"),name:"password",comment:e.global.t("utils.password"),designType:"password",tableBuildExclude:!0,table:{},form:{},...a.password},{title:e.global.t("utils.date"),name:"date",comment:e.global.t("utils.date"),designType:"date",table:{},form:{},...a.date},{title:e.global.t("utils.time"),name:"time",comment:e.global.t("utils.time"),designType:"time",table:{},form:{},...a.time},{title:e.global.t("utils.time date"),name:"datetime",type:"datetime",length:0,precision:0,defaultType:"NULL",...b(),null:!0,comment:e.global.t("utils.time date"),designType:"datetime",table:{},form:{}},{title:e.global.t("utils.year"),name:"year",comment:e.global.t("utils.year"),designType:"year",table:{},form:{},...a.year},{title:e.global.t("crud.state.Time date (timestamp storage)"),name:"timestamp",comment:e.global.t("utils.time date"),designType:"timestamp",table:{},form:{},...a.datetime}],senior:[{title:e.global.t("utils.array"),name:"array",comment:e.global.t("utils.array"),designType:"array",tableBuildExclude:!0,table:{},form:{},...a.array},{title:e.global.t("utils.city select"),name:"city",comment:e.global.t("utils.city select"),designType:"city",table:{},form:{},...a.city},{title:e.global.t("utils.icon select"),name:"icon",comment:e.global.t("utils.icon select"),designType:"icon",table:{},form:{},...a.icon},{title:e.global.t("utils.color picker"),name:"color",comment:e.global.t("utils.color picker"),designType:"color",table:{},form:{},...a.color},{title:e.global.t("utils.image")+e.global.t("crud.state.Multi"),name:"images",comment:e.global.t("utils.image"),designType:"images",table:{},form:{},...a.images},{title:e.global.t("utils.file")+e.global.t("crud.state.Multi"),name:"files",comment:e.global.t("utils.file"),designType:"files",tableBuildExclude:!0,table:{},form:{},...a.files},{title:e.global.t("utils.select")+e.global.t("crud.state.Multi"),name:"selects",comment:e.global.t("crud.state.Select:opt0=Option1,opt1=Option2"),designType:"selects",table:{},form:{},...a.selects},{title:e.global.t("crud.state.Remote Select (Multi)"),name:"remote_select",comment:e.global.t("utils.remote select"),designType:"remoteSelects",tableBuildExclude:!0,table:{},form:{},...a.remoteSelects}]},y={render:{type:"select",value:"none",options:{none:e.global.t("None"),icon:"Icon",switch:e.global.t("utils.switch"),image:e.global.t("utils.image"),images:e.global.t("utils.multi image"),tag:"Tag",tags:"Tags",url:"URL",datetime:e.global.t("utils.time date"),color:e.global.t("utils.color")}},operator:{type:"select",value:"eq",options:{false:e.global.t("crud.state.Disable Search"),eq:"eq =",ne:"ne !=",gt:"gt >",egt:"egt >=",lt:"lt <",elt:"elt <=",LIKE:"LIKE","NOT LIKE":"NOT LIKE",IN:"IN","NOT IN":"NOT IN",RANGE:"RANGE","NOT RANGE":"NOT RANGE",NULL:"NULL","NOT NULL":"NOT NULL",FIND_IN_SET:"FIND_IN_SET"}},comSearchRender:{type:"select",value:"string",options:{string:e.global.t("utils.string"),select:e.global.t("utils.select"),remoteSelect:e.global.t("utils.remote select"),time:e.global.t("utils.time")+e.global.t("utils.choice"),date:e.global.t("utils.date")+e.global.t("utils.choice"),datetime:e.global.t("utils.time date")+e.global.t("utils.choice")}},comSearchInputAttr:{type:"textarea",value:"",placeholder:e.global.t("crud.crud.comSearchInputAttrTip"),attr:{rows:3}},sortable:{type:"select",value:"false",options:{false:e.global.t("Disable"),custom:e.global.t("Enable")}}},o={validator:{type:"selects",value:[],options:p},validatorMsg:{type:"textarea",value:"",placeholder:e.global.t("crud.state.If left blank, the verifier title attribute will be filled in automatically"),attr:{rows:3}}},t=(l,r)=>({...y[l],value:r}),m=(l,r)=>({...o[l],value:r}),F={pk:{name:e.global.t("crud.state.Primary key"),table:{width:{type:"number",value:70},operator:t("operator","RANGE"),sortable:t("sortable","custom")},form:{}},spk:{name:e.global.t("crud.state.Primary key (Snowflake ID)"),table:{width:{type:"number",value:180},operator:t("operator","RANGE"),sortable:t("sortable","custom")},form:{}},weigh:{name:e.global.t("crud.state.Weight (automatically generate drag sort button)"),table:{operator:t("operator","RANGE"),sortable:t("sortable","custom")},form:o},timestamp:{name:e.global.t("crud.state.Time date (timestamp storage)"),table:{render:t("render","datetime"),operator:t("operator","RANGE"),comSearchRender:t("comSearchRender","datetime"),comSearchInputAttr:t("comSearchInputAttr",""),sortable:t("sortable","custom"),width:{type:"number",value:160},timeFormat:{type:"string",value:"yyyy-mm-dd hh:MM:ss"}},form:{...o,validator:m("validator",["date"])}},string:{name:e.global.t("utils.string"),table:{render:t("render","none"),sortable:t("sortable","false"),operator:t("operator","LIKE")},form:o},password:{name:e.global.t("utils.password"),table:{operator:t("operator","false")},form:{...o,validator:m("validator",["password"])}},number:{name:e.global.t("utils.number"),table:{render:t("render","none"),sortable:t("sortable","false"),operator:t("operator","RANGE")},form:{...o,validator:m("validator",["number"]),step:{type:"number",value:1}}},float:{name:e.global.t("utils.float"),table:{render:t("render","none"),sortable:t("sortable","false"),operator:t("operator","RANGE")},form:{...o,validator:m("validator",["float"]),step:{type:"number",value:1}}},radio:{name:e.global.t("utils.radio"),table:{operator:t("operator","eq"),sortable:t("sortable","false"),render:t("render","tag")},form:o},checkbox:{name:e.global.t("utils.checkbox"),table:{sortable:t("sortable","false"),render:t("render","tags"),operator:t("operator","FIND_IN_SET")},form:o},switch:{name:e.global.t("utils.switch"),table:{operator:t("operator","eq"),sortable:t("sortable","false"),render:t("render","switch")},form:o},textarea:{name:e.global.t("utils.textarea"),table:{operator:t("operator","false")},form:{...o,rows:{type:"number",value:3}}},array:{name:e.global.t("utils.array"),table:{operator:t("operator","false")},form:o},datetime:{name:e.global.t("utils.time date")+e.global.t("utils.choice"),table:{operator:t("operator","RANGE"),comSearchRender:t("comSearchRender","datetime"),comSearchInputAttr:t("comSearchInputAttr",""),sortable:t("sortable","custom"),width:{type:"number",value:160}},form:{...o,validator:m("validator",["date"])}},year:{name:e.global.t("utils.year")+e.global.t("utils.choice"),table:{operator:t("operator","RANGE"),sortable:t("sortable","custom")},form:{...o,validator:m("validator",["date"])}},date:{name:e.global.t("utils.date")+e.global.t("utils.choice"),table:{operator:t("operator","RANGE"),comSearchRender:t("comSearchRender","date"),comSearchInputAttr:t("comSearchInputAttr",""),sortable:t("sortable","custom")},form:{...o,validator:m("validator",["date"])}},time:{name:e.global.t("utils.time")+e.global.t("utils.choice"),table:{operator:t("operator","RANGE"),comSearchRender:t("comSearchRender","time"),comSearchInputAttr:t("comSearchInputAttr",""),sortable:t("sortable","custom")},form:o},select:{name:e.global.t("utils.select"),table:{operator:t("operator","eq"),sortable:t("sortable","false"),render:t("render","tag")},form:{...o,"select-multi":{type:"switch",value:!1}}},selects:{name:e.global.t("utils.select")+e.global.t("crud.state.Multi"),table:{sortable:t("sortable","false"),render:t("render","tags"),operator:t("operator","FIND_IN_SET")},form:{...o,"select-multi":{type:"switch",value:!0}}},remoteSelect:{name:e.global.t("utils.remote select")+e.global.t("utils.choice"),table:{render:t("render","tags"),operator:t("operator","LIKE"),comSearchRender:t("comSearchRender","string"),comSearchInputAttr:t("comSearchInputAttr","")},form:{...o,"select-multi":{type:"switch",value:!1},"remote-pk":{type:"string",value:"id"},"remote-field":{type:"string",value:"name"},"remote-table":{type:"string",value:""},"remote-controller":{type:"string",value:""},"remote-model":{type:"string",value:""},"relation-fields":{type:"string",value:""},"remote-url":{type:"string",value:"",placeholder:e.global.t("crud.state.If it is not input, it will be automatically analyzed by the controller")},"remote-primary-table-alias":{type:"string",value:""},"remote-source-config-type":{type:"hidden",value:""}}},remoteSelects:{name:e.global.t("utils.remote select")+e.global.t("utils.choice")+e.global.t("crud.state.Multi"),table:{render:t("render","tags"),operator:t("operator","FIND_IN_SET"),comSearchRender:t("comSearchRender","remoteSelect"),comSearchInputAttr:t("comSearchInputAttr","")},form:{...o,"select-multi":{type:"switch",value:!0},"remote-pk":{type:"string",value:"id"},"remote-field":{type:"string",value:"name"},"remote-table":{type:"string",value:""},"remote-controller":{type:"string",value:""},"remote-model":{type:"string",value:""},"relation-fields":{type:"string",value:""},"remote-url":{type:"string",value:"",placeholder:e.global.t("crud.state.If it is not input, it will be automatically analyzed by the controller")},"remote-primary-table-alias":{type:"string",value:""},"remote-source-config-type":{type:"hidden",value:""}}},editor:{name:e.global.t("utils.rich Text"),table:{operator:t("operator","false")},form:{...o,validator:m("validator",["editorRequired"])}},city:{name:e.global.t("utils.city select"),table:{operator:t("operator","false")},form:o},image:{name:e.global.t("utils.image")+e.global.t("Upload"),table:{render:t("render","image"),operator:t("operator","false")},form:{...o,"image-multi":{type:"switch",value:!1}}},images:{name:e.global.t("utils.image")+e.global.t("Upload")+e.global.t("crud.state.Multi"),table:{render:t("render","images"),operator:t("operator","false")},form:{...o,"image-multi":{type:"switch",value:!0}}},file:{name:e.global.t("utils.file")+e.global.t("Upload"),table:{render:t("render","none"),operator:t("operator","false")},form:{...o,"file-multi":{type:"switch",value:!1}}},files:{name:e.global.t("utils.file")+e.global.t("Upload")+e.global.t("crud.state.Multi"),table:{render:t("render","none"),operator:t("operator","false")},form:{...o,"file-multi":{type:"switch",value:!0}}},icon:{name:e.global.t("utils.icon select"),table:{render:t("render","icon"),operator:t("operator","false")},form:o},color:{name:e.global.t("utils.color picker"),table:{render:t("render","color"),operator:t("operator","false")},form:o}},G=["quickSearchField","formFields","columnFields"];export{I as a,D as b,E as c,F as d,O as e,B as f,w as g,t as h,k as i,R as j,x as k,C as l,U as m,A as p,u as s,G as t,L as u};