suyuan-breed/public/admin/assets/index.6909be2a.js

2 lines
6.5 KiB
JavaScript

import{B as J,C as Q,w as H,D as O,J as W,K as X,p as Y,q as Z,r as ee,M as te,N as oe}from"./element-plus.ae8e286c.js";import{_ as ne}from"./index.vue_vue_type_script_setup_true_lang.4acf6c9d.js";import{k as ae,f as E,b as le}from"./index.fccb4ef5.js";import{d as P,_ as A,r as se,a3 as ue,ae as re,o as l,c as h,T as e,K as t,L as r,u as i,J as m,Q as ie,a8 as K,a as C,j as de,R as u}from"./@vue.108c970a.js";import{b as me,c as ce,d as _e,e as pe,s as fe}from"./code.6bdc004e.js";import{u as Fe}from"./usePaging.2a59f422.js";import{_ as ge}from"./data-table.vue_vue_type_script_setup_true_lang.6d4408fb.js";import{_ as he}from"./code-preview.vue_vue_type_script_setup_true_lang.aba46b0b.js";import"./@vueuse.d3d080b7.js";import"./@element-plus.d6eabd08.js";import"./lodash-es.29c53eac.js";import"./dayjs.664390f6.js";import"./axios.4ebfdb3f.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.e92d81a1.js";import"./vue-router.ed788fee.js";import"./pinia.eff1ffd5.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.dbf33394.js";import"./color.e1b5fced.js";import"./clone.0a4e8ac3.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.f174a91e.js";import"./ms.a9ae1d6d.js";import"./nprogress.d7c3ab1b.js";import"./vue-clipboard3.add720e2.js";import"./clipboard.01ea18f5.js";import"./echarts.8d7a50ae.js";import"./zrender.1084fa23.js";import"./tslib.60310f1a.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.241b9b5d.js";import"./index.0d3bed35.js";const Ce={class:"code-generation"},be=u("\u67E5\u8BE2"),we=u("\u91CD\u7F6E"),ye={class:"flex"},ve=u(" \u5BFC\u5165\u6570\u636E\u8868 "),Ee=u(" \u5220\u9664 "),ke=u(" \u751F\u6210\u4EE3\u7801 "),Be={class:"mt-4"},De={class:"flex items-center"},Ve=u(" \u9884\u89C8 "),xe=u(" \u7F16\u8F91 "),Ae=u(" \u66F4\u591A "),Ke=u(" \u751F\u6210\u4EE3\u7801 "),Pe=u(" \u540C\u6B65 "),Te=u(" \u5220\u9664 "),$e={class:"flex justify-end mt-4"},Se=P({name:"codeGenerate"}),vt=P({...Se,setup(Ne){const c=A({table_name:"",table_comment:""}),_=A({show:!1,loading:!1,code:[]}),{pager:f,getLists:g,resetParams:T,resetPage:b}=Fe({fetchFun:me,params:c}),F=se([]),$=n=>{F.value=n.map(({id:o})=>o)},S=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()},N=async n=>{const o=await _e({id:n});_.code=o,_.show=!0},I=n=>n.some(o=>o.generate_type==1),B=async n=>{if(I(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")},U=(n,o)=>{switch(n){case"generate":B([o.id]);break;case"sync":S(o.id);break;case"delete":k(o.id)}};return g(),(n,o)=>{const D=J,w=Q,s=H,G=O,V=W,y=le,p=X,L=ue("router-link"),v=Y,M=Z,R=ee,j=te,q=ne,d=re("perms"),z=oe;return l(),h("div",Ce,[e(V,{class:"!border-none",shadow:"never"},{default:t(()=>[e(G,{class:"mb-[-16px]",model:c,inline:""},{default:t(()=>[e(w,{label:"\u8868\u540D\u79F0"},{default:t(()=>[e(D,{class:"w-[280px]",modelValue:c.table_name,"onUpdate:modelValue":o[0]||(o[0]=a=>c.table_name=a),clearable:"",onKeyup:K(i(b),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(w,{label:"\u8868\u63CF\u8FF0"},{default:t(()=>[e(D,{class:"w-[280px]",modelValue:c.table_comment,"onUpdate:modelValue":o[1]||(o[1]=a=>c.table_comment=a),clearable:"",onKeyup:K(i(b),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(w,null,{default:t(()=>[e(s,{type:"primary",onClick:i(b)},{default:t(()=>[be]),_:1},8,["onClick"]),e(s,{onClick:i(T)},{default:t(()=>[we]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),r((l(),m(V,{class:"!border-none mt-4",shadow:"never"},{default:t(()=>[C("div",ye,[r((l(),m(ge,{class:"inline-block mr-[10px]",onSuccess:i(g)},{default:t(()=>[e(s,{type:"primary"},{icon:t(()=>[e(y,{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(y,{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=>B(F.value))},{default:t(()=>[ke]),_:1},8,["disabled"])),[[d,["tools.generator/generate"]]])]),C("div",Be,[e(j,{data:i(f).lists,size:"large",onSelectionChange:$},{default:t(()=>[e(p,{type:"selection",width:"55"}),e(p,{label:"\u8868\u540D\u79F0",prop:"table_name","min-width":"180"}),e(p,{label:"\u8868\u63CF\u8FF0",prop:"table_comment","min-width":"180"}),e(p,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"create_time","min-width":"180"}),e(p,{label:"\u66F4\u65B0\u65F6\u95F4",prop:"update_time","min-width":"180"}),e(p,{label:"\u64CD\u4F5C",width:"160",fixed:"right"},{default:t(({row:a})=>[C("div",De,[r((l(),m(s,{type:"primary",link:"",onClick:x=>N(a.id)},{default:t(()=>[Ve]),_:2},1032,["onClick"])),[[d,["tools.generator/preview"]]]),e(s,{type:"primary",link:""},{default:t(()=>[r((l(),m(L,{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(R,{class:"ml-2",onCommand:x=>U(x,a)},{dropdown:t(()=>[e(M,null,{default:t(()=>[r((l(),h("div",null,[e(v,{command:"generate"},{default:t(()=>[e(s,{type:"primary",link:""},{default:t(()=>[Ke]),_:1})]),_:1})])),[[d,["tools.generator/generate"]]]),r((l(),h("div",null,[e(v,{command:"sync"},{default:t(()=>[e(s,{type:"primary",link:""},{default:t(()=>[Pe]),_: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(y,{name:"el-icon-ArrowDown",size:14})]),_:1})]),_:2},1032,["onCommand"])),[[d,["tools.generator/generate","tools.generator/syncColumn","tools.generator/delete"]]])])]),_:1})]),_:1},8,["data"])]),C("div",$e,[e(q,{modelValue:i(f),"onUpdate:modelValue":o[4]||(o[4]=a=>de(f)?f.value=a:null),onChange:i(g)},null,8,["modelValue","onChange"])])]),_:1})),[[z,i(f).loading]]),_.show?(l(),m(he,{key:0,modelValue:_.show,"onUpdate:modelValue":o[5]||(o[5]=a=>_.show=a),code:_.code},null,8,["modelValue","code"])):ie("",!0)])}}});export{vt as default};