沙钢智慧能源系统前端代码
houzhongjian
2024-10-09 314507f8ddadd9c66e98d260c3b2a5dad1a04015
1
import{d as B,Q as J,J as O,u as Q,r as c,A as W,b as X,a1 as Z,o as d,c as j,k as e,B as l,a as t,a2 as F,O as n,P as u,g as f,D as E,F as G,a7 as L,S as $,T as ee,U as ae,V as le,W as te,X as oe,Y as re,Z as ie}from"./index-BP6bNRoi.js";import{_ as ne}from"./index.vue_vue_type_script_setup_true_lang-sJUY8qtC.js";import{_ as me}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{d as I}from"./formatTime-DwR9f7DP.js";import{d as de}from"./download-e0EdwhTv.js";import{d as se,e as pe,s as ce,f as ue}from"./index-BtTbjW0J.js";import{g as fe}from"./index-BX1jjyoD.js";import{_ as ge}from"./ImportTable.vue_vue_type_script_setup_true_lang-BrGeogSa.js";import{_ as we}from"./PreviewCode.vue_vue_type_style_index_0_lang-Hb1VU02G.js";import"./index-BZESAUPP.js";import"./el-card-bU92WWV4.js";import"./Dialog.vue_vue_type_style_index_0_lang-DFckl8Er.js";import"./tree-BBZY150N.js";import"./java-Dj9vEU5d.js";const ye=B({name:"InfraCodegen",__name:"index",setup(_e){const y=J(),{t:x}=O(),{push:K}=Q(),k=c(!0),N=c(0),V=c([]),r=W({pageNo:1,pageSize:10,tableName:void 0,tableComment:void 0,createTime:[]}),S=c(),T=c([]),w=async()=>{k.value=!0;try{const C=await se(r);V.value=C.list,N.value=C.total}finally{k.value=!1}},_=()=>{r.pageNo=1,w()},P=()=>{S.value.resetFields(),_()},U=c(),z=c();return X(async()=>{await w(),T.value=await fe()}),(C,i)=>{const D=L,b=$,R=ee,h=ae,m=le,H=te,Y=me,s=oe,M=re,q=ne,g=Z("hasPermi"),A=ie;return d(),j(G,null,[e(Y,null,{default:l(()=>[e(H,{ref_key:"queryFormRef",ref:S,inline:!0,model:t(r),class:"-mb-15px","label-width":"68px"},{default:l(()=>[e(b,{label:"\u8868\u540D\u79F0",prop:"tableName"},{default:l(()=>[e(D,{modelValue:t(r).tableName,"onUpdate:modelValue":i[0]||(i[0]=a=>t(r).tableName=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8868\u540D\u79F0",onKeyup:F(_,["enter"])},null,8,["modelValue"])]),_:1}),e(b,{label:"\u8868\u63CF\u8FF0",prop:"tableComment"},{default:l(()=>[e(D,{modelValue:t(r).tableComment,"onUpdate:modelValue":i[1]||(i[1]=a=>t(r).tableComment=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8868\u63CF\u8FF0",onKeyup:F(_,["enter"])},null,8,["modelValue"])]),_:1}),e(b,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime"},{default:l(()=>[e(R,{modelValue:t(r).createTime,"onUpdate:modelValue":i[2]||(i[2]=a=>t(r).createTime=a),"default-time":[new Date("1 00:00:00"),new Date("1 23:59:59")],class:"!w-240px","end-placeholder":"\u7ED3\u675F\u65E5\u671F","start-placeholder":"\u5F00\u59CB\u65E5\u671F",type:"daterange","value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue","default-time"])]),_:1}),e(b,null,{default:l(()=>[e(m,{onClick:_},{default:l(()=>[e(h,{class:"mr-5px",icon:"ep:search"}),n(" \u641C\u7D22 ")]),_:1}),e(m,{onClick:P},{default:l(()=>[e(h,{class:"mr-5px",icon:"ep:refresh"}),n(" \u91CD\u7F6E ")]),_:1}),u((d(),f(m,{type:"primary",onClick:i[3]||(i[3]=a=>{U.value.open()})},{default:l(()=>[e(h,{class:"mr-5px",icon:"ep:zoom-in"}),n(" \u5BFC\u5165 ")]),_:1})),[[g,["infra:codegen:create"]]])]),_:1})]),_:1},8,["model"])]),_:1}),e(Y,null,{default:l(()=>[u((d(),f(M,{data:t(V)},{default:l(()=>[e(s,{align:"center",label:"\u6570\u636E\u6E90"},{default:l(a=>{var p;return[n(E((p=t(T).find(o=>o.id===a.row.dataSourceConfigId))==null?void 0:p.name),1)]}),_:1}),e(s,{align:"center",label:"\u8868\u540D\u79F0",prop:"tableName",width:"200"}),e(s,{"show-overflow-tooltip":!0,align:"center",label:"\u8868\u63CF\u8FF0",prop:"tableComment",width:"200"}),e(s,{align:"center",label:"\u5B9E\u4F53",prop:"className",width:"200"}),e(s,{formatter:t(I),align:"center",label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:"180"},null,8,["formatter"]),e(s,{formatter:t(I),align:"center",label:"\u66F4\u65B0\u65F6\u95F4",prop:"createTime",width:"180"},null,8,["formatter"]),e(s,{align:"center",fixed:"right",label:"\u64CD\u4F5C",width:"300px"},{default:l(a=>[u((d(),f(m,{link:"",type:"primary",onClick:p=>{return o=a.row,void z.value.open(o.id);var o}},{default:l(()=>[n(" \u9884\u89C8 ")]),_:2},1032,["onClick"])),[[g,["infra:codegen:preview"]]]),u((d(),f(m,{link:"",type:"primary",onClick:p=>{return o=a.row.id,void K("/codegen/edit?id="+o);var o}},{default:l(()=>[n(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[g,["infra:codegen:update"]]]),u((d(),f(m,{link:"",type:"danger",onClick:p=>(async o=>{try{await y.delConfirm(),await pe(o),y.success(x("common.delSuccess")),await w()}catch{}})(a.row.id)},{default:l(()=>[n(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[g,["infra:codegen:delete"]]]),u((d(),f(m,{link:"",type:"primary",onClick:p=>(async o=>{const v=o.tableName;try{await y.confirm("\u786E\u8BA4\u8981\u5F3A\u5236\u540C\u6B65"+v+"\u8868\u7ED3\u6784\u5417?",x("common.reminder")),await ce(o.id),y.success("\u540C\u6B65\u6210\u529F")}catch{}})(a.row)},{default:l(()=>[n(" \u540C\u6B65 ")]),_:2},1032,["onClick"])),[[g,["infra:codegen:update"]]]),u((d(),f(m,{link:"",type:"primary",onClick:p=>(async o=>{const v=await ue(o.id);de.zip(v,"codegen-"+o.className+".zip")})(a.row)},{default:l(()=>[n(" \u751F\u6210\u4EE3\u7801 ")]),_:2},1032,["onClick"])),[[g,["infra:codegen:download"]]])]),_:1})]),_:1},8,["data"])),[[A,t(k)]]),e(q,{limit:t(r).pageSize,"onUpdate:limit":i[4]||(i[4]=a=>t(r).pageSize=a),page:t(r).pageNo,"onUpdate:page":i[5]||(i[5]=a=>t(r).pageNo=a),total:t(N),onPagination:w},null,8,["limit","page","total"])]),_:1}),e(ge,{ref_key:"importRef",ref:U,onSuccess:w},null,512),e(we,{ref_key:"previewRef",ref:z},null,512)],64)}}});export{ye as default};