moreShopAdmin/build/admin/assets/index.cd47d4b2.js

2 lines
6.7 KiB
JavaScript

import{C as O,D as Q,w as Z,F as H,L as J,M as W,p as X,q as Y,r as ee,N as te,O as oe}from"./element-plus.91c68cc0.js";import{_ as ne}from"./index.vue_vue_type_script_setup_true_lang.863ae816.js";import{e as ae,f as k,b as le}from"./index.e9c2eb26.js";import{d as h,Z as P,r as re,af as ue,ap as se,o as r,c as C,U as t,L as o,u as n,aa as $,R as s,M as i,K as d,a as b,j as ie,Q as me}from"./@vue.76ce7aa3.js";import{b as de,c as pe,d as _e,e as ce,s as fe}from"./code.e8297c28.js";import{u as Fe}from"./usePaging.f8c888e4.js";import{_ as ge}from"./data-table.vue_vue_type_script_setup_true_lang.8c8c6ff4.js";import{_ as Ce}from"./code-preview.vue_vue_type_script_setup_true_lang.f8b5ed66.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.4e6d2a38.js";import"./axios.cffda5ac.js";import"./jspdf.6c61b9d3.js";import"./fflate.0418c72f.js";import"./vue-router.10bd5b90.js";import"./pinia.f3529286.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";import"./index.d78ce335.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.cf0d972e.js";const be={class:"code-generation"},we={class:"flex"},ye={class:"mt-4"},Ee={class:"flex items-center"},ve={class:"flex justify-end mt-4"},ke=h({name:"codeGenerate"}),_t=h({...ke,setup(De){const p=P({table_name:"",table_comment:""}),_=P({show:!1,loading:!1,code:[]}),{pager:f,getLists:g,resetParams:K,resetPage:w}=Fe({fetchFun:ce,params:p}),F=re([]),S=a=>{F.value=a.map(({id:e})=>e)},T=async a=>{await k.confirm("\u786E\u5B9A\u8981\u540C\u6B65\u8868\u7ED3\u6784\uFF1F"),await fe({id:a})},D=async a=>{await k.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await de({id:a}),g()},N=async a=>{const e=await pe({id:a});_.code=e,_.show=!0},U=a=>a.some(e=>e.generate_type==1),B=async a=>{if(U(a))return k.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 e=await _e({id:a});e.file&&window.open(e.file,"_blank")},I=(a,e)=>{switch(a){case"generate":B([e.id]);break;case"sync":T(e.id);break;case"delete":D(e.id)}};return g(),(a,e)=>{const V=O,y=Q,u=Z,L=H,x=J,E=le,c=W,M=ue("router-link"),v=X,G=Y,R=ee,j=te,q=ne,m=se("perms"),z=oe;return r(),C("div",be,[t(x,{class:"!border-none",shadow:"never"},{default:o(()=>[t(L,{class:"mb-[-16px]",model:n(p),inline:""},{default:o(()=>[t(y,{label:"\u8868\u540D\u79F0"},{default:o(()=>[t(V,{class:"w-[280px]",modelValue:n(p).table_name,"onUpdate:modelValue":e[0]||(e[0]=l=>n(p).table_name=l),clearable:"",onKeyup:$(n(w),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),t(y,{label:"\u8868\u63CF\u8FF0"},{default:o(()=>[t(V,{class:"w-[280px]",modelValue:n(p).table_comment,"onUpdate:modelValue":e[1]||(e[1]=l=>n(p).table_comment=l),clearable:"",onKeyup:$(n(w),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),t(y,null,{default:o(()=>[t(u,{type:"primary",onClick:n(w)},{default:o(()=>e[6]||(e[6]=[s("\u67E5\u8BE2")])),_:1},8,["onClick"]),t(u,{onClick:n(K)},{default:o(()=>e[7]||(e[7]=[s("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),i((r(),d(x,{class:"!border-none mt-4",shadow:"never"},{default:o(()=>[b("div",we,[i((r(),d(ge,{class:"inline-block mr-[10px]",onSuccess:n(g)},{default:o(()=>[t(u,{type:"primary"},{icon:o(()=>[t(E,{name:"el-icon-Plus"})]),default:o(()=>[e[8]||(e[8]=s(" \u5BFC\u5165\u6570\u636E\u8868 "))]),_:1})]),_:1},8,["onSuccess"])),[[m,["tools.generator/selectTable"]]]),i((r(),d(u,{disabled:!n(F).length,onClick:e[2]||(e[2]=l=>D(n(F))),type:"danger"},{icon:o(()=>[t(E,{name:"el-icon-Delete"})]),default:o(()=>[e[9]||(e[9]=s(" \u5220\u9664 "))]),_:1},8,["disabled"])),[[m,["tools.generator/delete"]]]),i((r(),d(u,{disabled:!n(F).length,onClick:e[3]||(e[3]=l=>B(n(F)))},{default:o(()=>e[10]||(e[10]=[s(" \u751F\u6210\u4EE3\u7801 ")])),_:1},8,["disabled"])),[[m,["tools.generator/generate"]]])]),b("div",ye,[t(j,{data:n(f).lists,size:"large",onSelectionChange:S},{default:o(()=>[t(c,{type:"selection",width:"55"}),t(c,{label:"\u8868\u540D\u79F0",prop:"table_name","min-width":"180"}),t(c,{label:"\u8868\u63CF\u8FF0",prop:"table_comment","min-width":"180"}),t(c,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"create_time","min-width":"180"}),t(c,{label:"\u66F4\u65B0\u65F6\u95F4",prop:"update_time","min-width":"180"}),t(c,{label:"\u64CD\u4F5C",width:"160",fixed:"right"},{default:o(({row:l})=>[b("div",Ee,[i((r(),d(u,{type:"primary",link:"",onClick:A=>N(l.id)},{default:o(()=>e[11]||(e[11]=[s(" \u9884\u89C8 ")])),_:2},1032,["onClick"])),[[m,["tools.generator/preview"]]]),t(u,{type:"primary",link:""},{default:o(()=>[i((r(),d(M,{to:{path:n(ae)("tools.generator/edit"),query:{id:l.id}}},{default:o(()=>e[12]||(e[12]=[s(" \u7F16\u8F91 ")])),_:2},1032,["to"])),[[m,["tools.generator/edit"]]])]),_:2},1024),i((r(),d(R,{class:"ml-2",onCommand:A=>I(A,l)},{dropdown:o(()=>[t(G,null,{default:o(()=>[i((r(),C("div",null,[t(v,{command:"generate"},{default:o(()=>[t(u,{type:"primary",link:""},{default:o(()=>e[14]||(e[14]=[s(" \u751F\u6210\u4EE3\u7801 ")])),_:1})]),_:1})])),[[m,["tools.generator/generate"]]]),i((r(),C("div",null,[t(v,{command:"sync"},{default:o(()=>[t(u,{type:"primary",link:""},{default:o(()=>e[15]||(e[15]=[s(" \u540C\u6B65 ")])),_:1})]),_:1})])),[[m,["tools.generator/syncColumn"]]]),i((r(),C("div",null,[t(v,{command:"delete"},{default:o(()=>[t(u,{type:"danger",link:""},{default:o(()=>e[16]||(e[16]=[s(" \u5220\u9664 ")])),_:1})]),_:1})])),[[m,["tools.generator/delete"]]])]),_:1})]),default:o(()=>[t(u,{type:"primary",link:""},{default:o(()=>[e[13]||(e[13]=s(" \u66F4\u591A ")),t(E,{name:"el-icon-ArrowDown",size:14})]),_:1})]),_:2},1032,["onCommand"])),[[m,["tools.generator/generate","tools.generator/syncColumn","tools.generator/delete"]]])])]),_:1})]),_:1},8,["data"])]),b("div",ve,[t(q,{modelValue:n(f),"onUpdate:modelValue":e[4]||(e[4]=l=>ie(f)?f.value=l:null),onChange:n(g)},null,8,["modelValue","onChange"])])]),_:1})),[[z,n(f).loading]]),n(_).show?(r(),d(Ce,{key:0,modelValue:n(_).show,"onUpdate:modelValue":e[5]||(e[5]=l=>n(_).show=l),code:n(_).code},null,8,["modelValue","code"])):me("",!0)])}}});export{_t as default};