"use strict";(self["webpackChunkantgo_web"]=self["webpackChunkantgo_web"]||[]).push([[880],{5880:function(t,e,a){a.r(e),a.d(e,{default:function(){return p}});var n=function(){var t=this,e=t._self._c;return e("b-container",{staticStyle:{"margin-top":"30px"}},[e("b-row",[e("b-col",[e("b-card",{staticClass:"mt-6",attrs:{header:"输入信息"}},[e("b-container",t._l(t.input_info,(function(a,n){return e("b-row",{key:n},["image"==a["type"]?e("b-col",{staticStyle:{"margin-top":"20px"}},[e("h5",[t._v(t._s(a["name"]))]),e("b-form-file",{attrs:{state:Boolean("finish"==a["status"]),placeholder:"拖拽文件至此...","drop-placeholder":"Drop file here...",accept:".jpg, .png, .jpeg","browse-text":"打开"},on:{input:function(e){return t.uploadfile(n)}},model:{value:a["value"],callback:function(e){t.$set(a,"value",e)},expression:"input['value']"}}),e("div",{staticClass:"mt-3"},[t._v("上传文件: "+t._s("finish"==a["status"]?a["value"].name+" 完成":""))])],1):t._e(),"video"==a["type"]?e("b-col",{staticStyle:{"margin-top":"20px"}},[e("h5",[t._v(t._s(a["name"]))]),e("b-form-file",{attrs:{state:Boolean("finish"==a["status"]),placeholder:"拖拽文件至此...","drop-placeholder":"Drop file here...",accept:".jpg, .png, .jpeg","browse-text":"打开"},on:{input:function(e){return t.uploadfile(n)}},model:{value:a["value"],callback:function(e){t.$set(a,"value",e)},expression:"input['value']"}}),e("div",{staticClass:"mt-3"},[t._v("上传文件: "+t._s("finish"==a["status"]?a["value"].name+" 完成":""))])],1):t._e(),"text"==a["type"]?e("b-col",[e("b-input-group",{staticClass:"mt-3",attrs:{prepend:a["name"]}},[e("b-form-input",{model:{value:a["value"],callback:function(e){t.$set(a,"value",e)},expression:"input['value']"}})],1)],1):t._e(),"slider"==a["type"]?e("b-col",{staticStyle:{"margin-top":"20px"}},[e("h5",[t._v(t._s(a["name"])+" "+t._s(a["value"]))]),e("b-input-group",{staticClass:"mt-3",attrs:{prepend:a["min"],append:a["max"]}},[e("b-form-input",{attrs:{type:"range",min:a["min"],max:a["max"]},model:{value:a["value"],callback:function(e){t.$set(a,"value",e)},expression:"input['value']"}})],1)],1):t._e(),"checkbox"==a["type"]?e("b-col",{staticStyle:{"margin-top":"20px"}},[e("b-form-checkbox",{attrs:{value:"1","unchecked-value":"0"},model:{value:a["value"],callback:function(e){t.$set(a,"value",e)},expression:"input['value']"}},[t._v(t._s(a["name"]))])],1):t._e(),"select"==a["type"]?e("b-col",{staticStyle:{"margin-top":"20px"}},[e("h5",[t._v(t._s(a["name"]))]),e("b-form-select",{attrs:{options:a["options"]},model:{value:a["value"],callback:function(e){t.$set(a,"value",e)},expression:"input['value']"}})],1):t._e()],1)})),1)],1)],1),e("b-col",[e("b-card",{staticClass:"mt-6",attrs:{header:"输出信息"}},[e("b-container",t._l(t.output_info,(function(a,n){return e("b-row",{key:n},["image"==a["type"]?e("b-col",{staticStyle:{"margin-top":"20px"}},[e("div",{staticStyle:{"margin-top":"20px"}},[e("h5",[t._v(t._s(a["name"]))]),e("b-img",{staticStyle:{"max-width":"512px"},attrs:{src:a["value"]}})],1)]):t._e(),"text"==a["type"]?e("b-col",[e("b-input-group",{staticClass:"mt-3",attrs:{prepend:a["name"]}},[e("b-form-input",{model:{value:a["value"],callback:function(e){t.$set(a,"value",e)},expression:"output['value']"}})],1)],1):t._e(),"number"==a["type"]?e("b-col",[e("b-input-group",{staticClass:"mt-3",attrs:{prepend:a["name"]}},[e("b-form-input",{attrs:{type:"number"},model:{value:a["value"],callback:function(e){t.$set(a,"value",e)},expression:"output['value']"}})],1)],1):t._e()],1)})),1)],1)],1)],1),e("b-row",{staticStyle:{"margin-top":"50px"}},[e("b-button",{staticStyle:{width:"100px"},attrs:{variant:"primary"},on:{click:function(e){return t.submit()}}},[t._v("提交")])],1)],1)},i=[],o={name:"Demo",data(){return{input_info:[],output_info:[]}},mounted:function(){var t=this;t.axios.get("/antgo/api/demo/query_config/").then((function(e){t.input_info=e.data})).catch((function(t){console.log(t)}))},methods:{uploadfile:function(t){this.input_info[t]["status"]="uploading";var e=new FormData;e.append("file",this.input_info[t].value),e.append("filename",this.input_info[t].value.name);var a=this;a.axios.post("/antgo/api/demo/upload/",e).then((e=>{a.input_info[t]["status"]="finish",a.$forceUpdate()}))},submit:function(){var t=[];for(var e in this.input_info)"image"==this.input_info[e]["type"]||"video"==this.input_info[e]["type"]?t.push(this.input_info[e]["value"].name):t.push(this.input_info[e]["value"]);var a=this;let n=new FormData;n.append("query",JSON.stringify(t)),a.axios.post("/antgo/api/demo/submit/",n).then((function(t){a.output_info=t.data}))}}},u=o,s=a(1001),l=(0,s.Z)(u,n,i,!1,null,"6affb261",null),p=l.exports}}]);
//# sourceMappingURL=880.cba02e88.js.map