mirror of
https://gitee.com/myxzgzs/boyue-kfcode-hasfj.git
synced 2025-06-21 17:29:36 +08:00
2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
![]() |
import{Z as q,r as _,d as _e,O as Ve,S as ye,j as m,H as le,c as k,o as n,F as y,e as l,R as ae,k as o,w as t,I,J as x,h as s,l as D,m as v,P as j,B as te,a6 as we,f as he}from"./index-CrAWI0wi.js";import ce from"./mybatis-input-B14AdjwO.js";import ke from"./online-preview-DxDab4TR.js";function Te(V){return q({url:"/online/mb/list",method:"get",params:V})}function Ie(V){return q({url:"/online/mb/"+V,method:"get"})}function xe(V){return q({url:"/online/mb",method:"post",data:V})}function Ue(V){return q({url:"/online/mb",method:"put",data:V})}function Ce(V){return q({url:"/online/mb/"+V,method:"delete"})}const Se={class:"app-container"},Re={class:"dialog-footer"},$e={__name:"index",setup(V){const H=_(null),P=_(!1),{proxy:w}=_e(),{online_api_method:N,online_api_result:A,online_api_actuator:B,online_api_tag:E}=w.useDict("online_api_method","online_api_result","online_api_actuator","online_api_tag"),J=_([]),T=_(!1),F=_(!0),M=_(!0),K=_([]),O=_(!0),Z=_(!0),z=_(0),L=_(""),oe=Ve({form:{},queryParams:{pageNum:1,pageSize:10,tag:null,tagId:null,parameterType:null,resultMap:null,sqlText:null,path:null,method:null,resultType:null,actuator:null},rules:{path:[{required:!0,message:"请求路径不能为空",trigger:"blur"},{pattern:/^[^<>"' |\\]+$/,message:`不能包含非法字符:< > " ' \\ |`,trigger:"blur"},{validator:(f,a,p)=>{a[0]!=="/"?p(new Error("请以斜杠开头")):p()}}],method:[{required:!0,message:"请求方式不能为空",trigger:"change"}],actuator:[{required:!0,message:"执行器不能为空",trigger:"change"}]}}),{queryParams:r,form:u,rules:ue}=ye(oe);function U(){F.value=!0,Te(r.value).then(f=>{J.value=f.rows,z.value=f.total,F.value=!1})}function ne(){T.value=!1,Q()}function Q(){u.value={mbId:null,tag:null,tagId:null,parameterType:null,resultMap:null,sqlText:null,path:null,method:null,resultType:null,actuator:null},w.resetForm("mbRef")}function S(){r.value.pageNum=1,U()}function re(){w.resetForm("queryRef"),S()}function de(f){K.value=f.map(a=>a.mbId),O.value=f.length!=1,Z.value=!f.length}function pe(){Q(),T.value=!0,L.value="添加mybatis在线接口"}function G(f){Q();const a=f.mbId||K.value;Ie(a).then(p=>{u.value=p.data,T.value=!0,L.value="修改mybatis在线接口"})}function se(){w.$refs.mbRef.validate(f=>{f&&(u.value.mbId!=null?Ue(u.value).then(a=>{w.$modal.msgSuccess("修改成功"),T.value=!1,U()}):xe(u.value).then(a=>{w.$modal.msgSuccess("新增成功"),T.value=!1,U()}))})}function W(f){const a=f.mbId||K.value;w.$modal.confirm('是否确认删除mybatis在线接口编号为"'+a+'"的数据项?').then(function(){return Ce(a)}).then(()=>{U(),w.$modal.msgSuccess("删除成功")}).catch(()=>{})}function ie(){w.download("online/mb/export",{...r.value},`mb_${new Date().getTime()}.xlsx`)}return U(),(f,a)=>{const p=m("el-option"),h=m("el-select"),d=m("el-form-item"),c=m("el-input"),g=m("el-button"),X=m("el-form"),i=m("el-col"),me=m("right-toolbar"),R=m("el-row"),b=m("el-table-column"),$=m("dict-tag"),fe=m("el-table"),be=m("pagination"),Y=m("el-checkbox"),ve=m("el-dialog"),C=le("hasPermi"),ge=le("loading");return n(),k("div",Se,[y(l(X,{model:o(r),ref:"queryRef",inline:"","label-width":"68px"},{default:t(()=>[l(d,{label:"标签名",prop:"tag"},{default:t(()=>[l(h,{modelValue:o(r).tag,"onUpdate:modelValue":a[0]||(a[0]=e=>o(r).tag=e),placeholder:"请选择标签名",clearable:"",style:{width:"200px"}},{default:t(()=>[(n(!0),k(I,null,x(o(E),e=>(n(),s(p,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(d,{label:"标签id",prop:"tagId"},{default:t(()=>[l(c,{modelValue:o(r).tagId,"onUpdate:modelValue":a[1]||(a[1]=e=>o(r).tagId=e),placeholder:"请输入标签id",clearable:"",onKeyup:D(S,["enter"])},null,8,["modelValue"])]),_:1}),l(d,{label:"参数类型",prop:"parameterType"},{default:t(()=>[l(c,{modelValue:o(r).parameterType,"onUpdate:modelValue":a[2]||(a[2]=e=>o(r).parameterType=e),placeholder:"请输入参数类型",clearable:"",onKeyup:D(S,["enter"])},null,8,["modelValue"])]),_:1}),l(d,{label:"结果类型",prop:"resultMap"},{default:t(()=>[l(c,{modelValue:
|