engineering/public/admin/assets/index.32672704.js
2024-03-04 15:04:21 +08:00

2 lines
6.5 KiB
JavaScript

import{I as O,y as H,w as J,D as Q,C as W,L as X,p as Y,q as Z,r as ee,M as te,N as oe}from"./element-plus.258bf9e7.js";import{_ as ne}from"./index.vue_vue_type_script_setup_true_lang.60e89e82.js";import{l as ae,f as E,a as le}from"./index.ec401e3b.js";import{d as S,a0 as A,r as se,a5 as ue,ai as re,o as l,c as h,V as e,M as t,O as r,u as i,L as m,S as ie,aa as P,a as y,k as de,T as u}from"./@vue.ab566ce7.js";import{b as me,c as ce,d as _e,e as pe,s as fe}from"./code.df6ff43d.js";import{u as Fe}from"./usePaging.f6660143.js";import{_ as ge}from"./data-table.vue_vue_type_script_setup_true_lang.f596b780.js";import{_ as he}from"./code-preview.vue_vue_type_script_setup_true_lang.77938060.js";import"./@vueuse.8fcae4c2.js";import"./@element-plus.b89f1627.js";import"./lodash-es.49f4af13.js";import"./dayjs.4afe12d3.js";import"./axios.37fc980d.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.1d82ee7c.js";import"./vue-router.87ebc608.js";import"./pinia.b6700c26.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.d0bec2c9.js";import"./color.ea90db3f.js";import"./clone.cbd692e6.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.ad6bc3c0.js";import"./ms.a9ae1d6d.js";import"./nprogress.bcdf1f46.js";import"./vue-clipboard3.c45111bf.js";import"./clipboard.1cb79a0d.js";import"./echarts.50cbfcc9.js";import"./tslib.60310f1a.js";import"./zrender.a255a587.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.62ff6725.js";import"./index.9492d03b.js";const ye={class:"code-generation"},Ce=u("\u67E5\u8BE2"),be=u("\u91CD\u7F6E"),we={class:"flex"},ve=u(" \u5BFC\u5165\u6570\u636E\u8868 "),Ee=u(" \u5220\u9664 "),ke=u(" \u751F\u6210\u4EE3\u7801 "),De={class:"mt-4"},Be={class:"flex items-center"},Ve=u(" \u9884\u89C8 "),xe=u(" \u7F16\u8F91 "),Ae=u(" \u66F4\u591A "),Pe=u(" \u751F\u6210\u4EE3\u7801 "),Se=u(" \u540C\u6B65 "),Te=u(" \u5220\u9664 "),$e={class:"flex justify-end mt-4"},Ie=S({name:"codeGenerate"}),wt=S({...Ie,setup(Ke){const _=A({table_name:"",table_comment:""}),p=A({show:!1,loading:!1,code:[]}),{pager:f,getLists:g,resetParams:T,resetPage:C}=Fe({fetchFun:me,params:_}),F=se([]),$=n=>{F.value=n.map(({id:o})=>o)},I=async n=>{await E.confirm("\u786E\u5B9A\u8981\u540C\u6B65\u8868\u7ED3\u6784\uFF1F"),await fe({id:n})},k=async n=>{await E.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await ce({id:n}),g()},K=async n=>{const o=await _e({id:n});p.code=o,p.show=!0},N=n=>n.some(o=>o.generate_type==1),D=async n=>{if(N(n))return E.msgError("\u751F\u6210\u65B9\u5F0F\u4E3A\u751F\u6210\u5230\u6A21\u5757\uFF0C\u8BF7\u5728\u524D\u7AEF\u5F00\u53D1\u6A21\u5F0F\u4E0B\u4F7F\u7528\uFF0C\u8BE6\u7EC6\u53C2\u8003\u6587\u6863");const o=await pe({id:n});o.file&&window.open(o.file,"_blank")},L=(n,o)=>{switch(n){case"generate":D([o.id]);break;case"sync":I(o.id);break;case"delete":k(o.id)}};return g(),(n,o)=>{const B=O,b=H,s=J,M=Q,V=W,w=le,c=X,U=ue("router-link"),v=Y,G=Z,q=ee,z=te,R=ne,d=re("perms"),j=oe;return l(),h("div",ye,[e(V,{class:"!border-none",shadow:"never"},{default:t(()=>[e(M,{class:"mb-[-16px]",model:_,inline:""},{default:t(()=>[e(b,{label:"\u8868\u540D\u79F0"},{default:t(()=>[e(B,{class:"w-[280px]",modelValue:_.table_name,"onUpdate:modelValue":o[0]||(o[0]=a=>_.table_name=a),clearable:"",onKeyup:P(i(C),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(b,{label:"\u8868\u63CF\u8FF0"},{default:t(()=>[e(B,{class:"w-[280px]",modelValue:_.table_comment,"onUpdate:modelValue":o[1]||(o[1]=a=>_.table_comment=a),clearable:"",onKeyup:P(i(C),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(b,null,{default:t(()=>[e(s,{type:"primary",onClick:i(C)},{default:t(()=>[Ce]),_:1},8,["onClick"]),e(s,{onClick:i(T)},{default:t(()=>[be]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),r((l(),m(V,{class:"!border-none mt-4",shadow:"never"},{default:t(()=>[y("div",we,[r((l(),m(ge,{class:"inline-block mr-[10px]",onSuccess:i(g)},{default:t(()=>[e(s,{type:"primary"},{icon:t(()=>[e(w,{name:"el-icon-Plus"})]),default:t(()=>[ve]),_:1})]),_:1},8,["onSuccess"])),[[d,["tools.generator/selectTable"]]]),r((l(),m(s,{disabled:!F.value.length,onClick:o[2]||(o[2]=a=>k(F.value)),type:"danger"},{icon:t(()=>[e(w,{name:"el-icon-Delete"})]),default:t(()=>[Ee]),_:1},8,["disabled"])),[[d,["tools.generator/delete"]]]),r((l(),m(s,{disabled:!F.value.length,onClick:o[3]||(o[3]=a=>D(F.value))},{default:t(()=>[ke]),_:1},8,["disabled"])),[[d,["tools.generator/generate"]]])]),y("div",De,[e(z,{data:i(f).lists,size:"large",onSelectionChange:$},{default:t(()=>[e(c,{type:"selection",width:"55"}),e(c,{label:"\u5E8F\u53F7",type:"index",width:"55"}),e(c,{label:"\u8868\u540D\u79F0",prop:"table_name","min-width":"180"}),e(c,{label:"\u8868\u63CF\u8FF0",prop:"table_comment","min-width":"180"}),e(c,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"create_time","min-width":"180"}),e(c,{label:"\u66F4\u65B0\u65F6\u95F4",prop:"update_time","min-width":"180"}),e(c,{label:"\u64CD\u4F5C",width:"160",fixed:"right"},{default:t(({row:a})=>[y("div",Be,[r((l(),m(s,{type:"primary",link:"",onClick:x=>K(a.id)},{default:t(()=>[Ve]),_:2},1032,["onClick"])),[[d,["tools.generator/preview"]]]),e(s,{type:"primary",link:""},{default:t(()=>[r((l(),m(U,{to:{path:i(ae)("tools.generator/edit"),query:{id:a.id}}},{default:t(()=>[xe]),_:2},1032,["to"])),[[d,["tools.generator/edit"]]])]),_:2},1024),r((l(),m(q,{class:"ml-2",onCommand:x=>L(x,a)},{dropdown:t(()=>[e(G,null,{default:t(()=>[r((l(),h("div",null,[e(v,{command:"generate"},{default:t(()=>[e(s,{type:"primary",link:""},{default:t(()=>[Pe]),_:1})]),_:1})])),[[d,["tools.generator/generate"]]]),r((l(),h("div",null,[e(v,{command:"sync"},{default:t(()=>[e(s,{type:"primary",link:""},{default:t(()=>[Se]),_:1})]),_:1})])),[[d,["tools.generator/syncColumn"]]]),r((l(),h("div",null,[e(v,{command:"delete"},{default:t(()=>[e(s,{type:"danger",link:""},{default:t(()=>[Te]),_:1})]),_:1})])),[[d,["tools.generator/delete"]]])]),_:1})]),default:t(()=>[e(s,{type:"primary",link:""},{default:t(()=>[Ae,e(w,{name:"el-icon-ArrowDown",size:14})]),_:1})]),_:2},1032,["onCommand"])),[[d,["tools.generator/generate","tools.generator/syncColumn","tools.generator/delete"]]])])]),_:1})]),_:1},8,["data"])]),y("div",$e,[e(R,{modelValue:i(f),"onUpdate:modelValue":o[4]||(o[4]=a=>de(f)?f.value=a:null),onChange:i(g)},null,8,["modelValue","onChange"])])]),_:1})),[[j,i(f).loading]]),p.show?(l(),m(he,{key:0,modelValue:p.show,"onUpdate:modelValue":o[5]||(o[5]=a=>p.show=a),code:p.code},null,8,["modelValue","code"])):ie("",!0)])}}});export{wt as default};