"use strict";var base={data:{call:{method:void 0,endpoint:void 0}},methods:{onPrepare:function(){console.groupCollapsed("onPrepare"),console.warn(JSON.stringify(this.$data)),console.groupEnd()},onLoadSuccess:function(t,o){console.warn("请覆写 onLoadSuccess")},onLoadFailure:function(t,o){showAlert(t,o)},back:function(){history.back()},request:function(t){var n=this;httpUtilrequest(this.call.method,this.call.endpoint,t,function(t,o){n.onLoadSuccess(t,o)},function(t,o){n.onLoadFailure(t,o)})}}},get={mounted:function(){this.call.method="GET",this.onPrepare(),this.refresh()},methods:{refresh:function(t){this.call.endpoint&&this.call.endpoint.trim()&&(this.isLoading=!0,this.request())}}},post={data:{params:{},next:""},mounted:function(){this.call.method="POST",this.onPrepare()},methods:{onSubmit:function(){},onLoadSuccess:function(t,o){var n=new URL(document.URL).searchParams.get("next");n&&(location=n)},submit:function(t){this.onSubmit(),this.request(this.params)}}},patch={data:{params:{}},mounted:function(){this.call.method="PATCH",this.onPrepare()},methods:{onSubmit:function(){},submit:function(t){this.onSubmit(),this.request(this.params)}}};