You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
7.7 KiB
1 lines
7.7 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-97434b7e"],{"0a47":function(t,e,a){},"960a":function(t,e,a){"use strict";a("0a47")},a716:function(t,e,a){"use strict";a.d(e,"f",(function(){return n})),a.d(e,"b",(function(){return i})),a.d(e,"a",(function(){return r})),a.d(e,"c",(function(){return s})),a.d(e,"e",(function(){return l})),a.d(e,"d",(function(){return d}));var o=a("66df"),n=function(t){return o["b"].request({url:"Fields/upload",method:"post",data:t})},i=function(t){return o["b"].request({url:"Fields/del",method:"get",params:{id:t}})},r=function(t){return o["b"].request({url:"Fields/add",method:"post",data:t})},s=function(t){return o["b"].request({url:"Fields/edit",method:"post",data:t})},l=function(t){return o["b"].request({url:"Fields/response",method:"get",params:t})},d=function(t){return o["b"].request({url:"Fields/request",method:"get",params:t})}},e5e5:function(t,e,a){"use strict";a.r(e);a("6b54");var o=function(){var t=this,e=t._self._c;return e("div",[e("Row",[e("Col",{attrs:{span:"24"}},[e("Card",[e("p",{staticStyle:{height:"32px"},attrs:{slot:"title"},slot:"title"},[e("Button",{attrs:{type:"primary",icon:"md-add"},on:{click:t.alertAdd}},[t._v(t._s(t.$t("add_button")))])],1),e("Alert",{attrs:{"show-icon":""}},[t._v("\n "+t._s(t.apiInfo.info)+" | "+t._s(t.apiInfo.hash)+" | "+t._s(t.apiInfo.api_class)+"\n "),e("Icon",{attrs:{slot:"icon",type:"ios-bulb-outline"},slot:"icon"}),e("span",{attrs:{slot:"desc"},slot:"desc"})],1),e("div",[e("Table",{attrs:{loading:t.listLoading,columns:t.columnsList,data:t.tableData,border:"","disabled-hover":""}})],1),e("div",{staticClass:"margin-top-15",staticStyle:{"text-align":"center"}},[e("Page",{attrs:{total:t.tableShow.listCount,current:t.tableShow.currentPage,"page-size":t.tableShow.pageSize,"show-elevator":"","show-sizer":"","show-total":""},on:{"on-change":t.changePage,"on-page-size-change":t.changeSize}})],1)],1)],1)],1),e("Modal",{attrs:{width:"668",styles:{top:"30px"}},on:{"on-visible-change":t.doCancel},model:{value:t.modalSetting.show,callback:function(e){t.$set(t.modalSetting,"show",e)},expression:"modalSetting.show"}},[e("p",{staticStyle:{color:"#2d8cf0"},attrs:{slot:"header"},slot:"header"},[e("Icon",{attrs:{type:"md-alert"}}),e("span",[t._v(t._s(t.formItem.id?"编辑":"新增")+"请求字段")])],1),e("Form",{ref:"myForm",attrs:{rules:t.ruleValidate,model:t.formItem,"label-width":80}},[e("FormItem",{attrs:{label:"字段名称",prop:"field_name"}},[e("Input",{attrs:{placeholder:"请输入字段名称"},model:{value:t.formItem.field_name,callback:function(e){t.$set(t.formItem,"field_name",e)},expression:"formItem.field_name"}})],1),e("FormItem",{attrs:{label:"数据类型",prop:"data_type"}},[e("Select",{staticStyle:{width:"200px"},model:{value:t.formItem.data_type,callback:function(e){t.$set(t.formItem,"data_type",e)},expression:"formItem.data_type"}},t._l(t.tableShow.dataType,(function(a,o){return e("Option",{key:o,attrs:{value:o}},[t._v(" "+t._s(a))])})),1)],1),e("FormItem",{attrs:{label:"是否必填"}},[e("RadioGroup",{model:{value:t.formItem.is_must,callback:function(e){t.$set(t.formItem,"is_must",e)},expression:"formItem.is_must"}},[e("Radio",{attrs:{label:"0"}},[t._v("不必填")]),e("Radio",{attrs:{label:"1"}},[t._v("必填")])],1)],1),"0"===t.formItem.is_must.toString()?e("FormItem",{attrs:{label:"默认值",prop:"default"}},[e("Input",{staticStyle:{width:"300px"},model:{value:t.formItem.defaults,callback:function(e){t.$set(t.formItem,"defaults",e)},expression:"formItem.defaults"}}),e("Tag",{staticClass:"margin-left-5",attrs:{color:"error"}},[t._v(" 仅在字段非必填的情况下生效 ")])],1):t._e(),e("FormItem",{attrs:{label:"规则细节",prop:"range"}},[e("Input",{attrs:{type:"textarea",placeholder:"请输入符合要求的JSON字符串"},model:{value:t.formItem.range,callback:function(e){t.$set(t.formItem,"range",e)},expression:"formItem.range"}})],1),e("FormItem",{attrs:{label:"字段说明",prop:"info"}},[e("Input",{attrs:{type:"textarea",placeholder:"请输入字段描述"},model:{value:t.formItem.info,callback:function(e){t.$set(t.formItem,"info",e)},expression:"formItem.info"}})],1)],1),e("div",{attrs:{slot:"footer"},slot:"footer"},[e("Button",{staticClass:"margin-right-10",attrs:{type:"text"},on:{click:t.cancel}},[t._v("取消")]),e("Button",{attrs:{type:"primary",loading:t.modalSetting.loading},on:{click:t.submit}},[t._v("确定")])],1)],1)],1)},n=[],i=a("a716"),r=function(t,e,a,o){return e("Button",{props:{type:"primary"},style:{margin:"0 5px"},on:{click:function(){t.formItem.id=a.id,t.formItem.field_name=a.field_name,t.formItem.data_type=a.data_type.toString(),t.formItem.defaults=a.default,t.formItem.range=a.range,t.formItem.is_must=a.is_must.toString(),t.formItem.info=a.info,t.modalSetting.show=!0,t.modalSetting.index=o}}},t.$t("edit_button"))},s=function(t,e,a,o){return e("Poptip",{props:{confirm:!0,title:"您确定要删除这条数据吗? ",transfer:!0},on:{"on-ok":function(){Object(i["b"])(a.id).then((function(e){a.loading=!1,t.tableData.splice(o,1),t.$Message.success(e.data.msg)}))}}},[e("Button",{style:{margin:"0 5px"},props:{type:"error",placement:"top",loading:a.isDeleting}},t.$t("delete_button"))])},l={name:"interface_request",data:function(){var t=this;return{hash:"",columnsList:[{title:"序号",type:"index",width:65,align:"center"},{title:"字段名称",align:"left",key:"show_name",width:200},{title:"数据类型",align:"center",width:100,render:function(e,a){var o=a.row.data_type;return e("Tag",{attrs:{color:"primary"}},t.tableShow.dataType[o])}},{title:"是否必须",align:"center",width:100,render:function(t,e){return 1===e.row.is_must?t("Tag",{attrs:{color:"error"}},"必填"):t("Tag",{attrs:{color:"primary"}},"可选")}},{title:"默认值",align:"center",key:"default",width:160},{title:"字段说明",align:"left",key:"info"},{title:"操作",align:"center",width:205,render:function(e,a){return e("div",[r(t,e,a.row,a.index),s(t,e,a.row,a.index)])}}],tableData:[],tableShow:{currentPage:1,pageSize:10,listCount:0,dataType:{}},apiInfo:{},modalSetting:{show:!1,loading:!1,index:0},formItem:{field_name:"",data_type:"2",defaults:"",range:"",is_must:"1",info:"",type:0,id:0},ruleValidate:{field_name:[{required:!0,message:"字段名称不能为空",trigger:"blur"}]},listLoading:!1}},created:function(){this.hash=this.$route.params.hash.toString(),this.getList()},activated:function(){this.hash=this.$route.params.hash.toString(),this.getList()},methods:{alertAdd:function(){this.modalSetting.show=!0},submit:function(){this.formItem.hash=this.hash;var t=this;this.$refs["myForm"].validate((function(e){e&&(t.modalSetting.loading=!0,0===t.formItem.id?Object(i["a"])(t.formItem).then((function(e){t.$Message.success(e.data.msg),t.getList(),t.cancel()})).catch((function(){t.modalSetting.loading=!1})):Object(i["c"])(t.formItem).then((function(e){t.$Message.success(e.data.msg),t.getList(),t.cancel()})).catch((function(){t.modalSetting.loading=!1})))}))},cancel:function(){this.modalSetting.show=!1},changePage:function(t){this.tableShow.currentPage=t,this.getList()},changeSize:function(t){this.tableShow.pageSize=t,this.getList()},search:function(){this.tableShow.currentPage=1,this.getList()},getList:function(){var t=this;t.listLoading=!0,Object(i["d"])({page:t.tableShow.currentPage,size:t.tableShow.pageSize,hash:t.hash}).then((function(e){t.tableData=e.data.data.list,t.tableShow.listCount=e.data.data.count,t.tableShow.dataType=e.data.data.dataType,t.apiInfo=e.data.data.apiInfo,t.listLoading=!1}))},doCancel:function(t){t||(this.formItem.id=0,this.formItem.defaults="",this.formItem.isMust="1",this.$refs["myForm"].resetFields(),this.modalSetting.loading=!1,this.modalSetting.index=0)}}},d=l,m=(a("960a"),a("2877")),c=Object(m["a"])(d,o,n,!1,null,"4880c3a9",null);e["default"]=c.exports}}]);
|