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
11 KiB
1 lines
11 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-17b43862"],{"19ce":function(t,e,a){"use strict";a.d(e,"f",(function(){return r})),a.d(e,"c",(function(){return o})),a.d(e,"b",(function(){return s})),a.d(e,"e",(function(){return i})),a.d(e,"a",(function(){return c})),a.d(e,"d",(function(){return l}));var n=a("66df"),r=function(t){return n["b"].request({url:"InterfaceGroup/index",method:"get",params:t})},o=function(t){return n["b"].request({url:"InterfaceGroup/del",method:"get",params:{hash:t}})},s=function(t,e){return n["b"].request({url:"InterfaceGroup/changeStatus",method:"get",params:{status:t,id:e}})},i=function(){return n["b"].request({url:"InterfaceGroup/getAll",method:"get"})},c=function(t){return n["b"].request({url:"InterfaceGroup/add",method:"post",data:t})},l=function(t){return n["b"].request({url:"InterfaceGroup/edit",method:"post",data:t})}},"1a2d":function(t,e,a){},"1e39":function(t,e,a){"use strict";a.r(e);a("7f7f"),a("386d");var n=function(){var t=this,e=t._self._c;return e("div",[e("Row",[e("Col",{attrs:{span:"24"}},[e("Card",{staticClass:"margin-bottom-10"},[e("Form",{attrs:{inline:""}},[e("FormItem",{staticClass:"margin-bottom-0"},[e("Select",{staticStyle:{width:"120px"},attrs:{clearable:"",placeholder:"请选择状态"},model:{value:t.searchConf.status,callback:function(e){t.$set(t.searchConf,"status",e)},expression:"searchConf.status"}},[e("Option",{attrs:{value:1}},[t._v("启用")]),e("Option",{attrs:{value:0}},[t._v("禁用")])],1)],1),e("FormItem",{staticClass:"margin-bottom-0"},[e("Select",{staticStyle:{width:"120px"},attrs:{clearable:"",placeholder:"请选择类别"},model:{value:t.searchConf.type,callback:function(e){t.$set(t.searchConf,"type",e)},expression:"searchConf.type"}},[e("Option",{attrs:{value:1}},[t._v("接口组标识")]),e("Option",{attrs:{value:2}},[t._v("接口组名称")])],1)],1),e("FormItem",{staticClass:"margin-bottom-0"},[e("Input",{attrs:{placeholder:""},model:{value:t.searchConf.keywords,callback:function(e){t.$set(t.searchConf,"keywords",e)},expression:"searchConf.keywords"}})],1),e("FormItem",{staticClass:"margin-bottom-0"},[e("Button",{attrs:{type:"primary"},on:{click:t.search}},[t._v(t._s(t.$t("find_button"))+"/"+t._s(t.$t("refresh_button")))])],1)],1)],1)],1)],1),e("Row",[e("Col",{attrs:{span:"24"}},[e("Card",[e("div",{staticClass:"margin-bottom-15"},[e("Button",{directives:[{name:"has",rawName:"v-has",value:"InterfaceGroup/add",expression:"'InterfaceGroup/add'"}],attrs:{type:"primary",icon:"md-add"},on:{click:t.alertAdd}},[t._v(t._s(t.$t("add_button")))])],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),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:"name"}},[e("Input",{attrs:{placeholder:"请输入接口组名称"},model:{value:t.formItem.name,callback:function(e){t.$set(t.formItem,"name",e)},expression:"formItem.name"}})],1),e("FormItem",{attrs:{label:"组头像",prop:"image"}},[t.formItem.image?e("div",{staticClass:"demo-upload-list"},[e("img",{attrs:{src:t.formItem.image}}),e("div",{staticClass:"demo-upload-list-cover"},[e("Icon",{attrs:{type:"ios-trash-outline"},nativeOn:{click:function(e){return t.handleImgRemove()}}})],1)]):t._e(),t.formItem.image?e("input",{directives:[{name:"model",rawName:"v-model",value:t.formItem.image,expression:"formItem.image"}],attrs:{type:"hidden",name:"image"},domProps:{value:t.formItem.image},on:{input:function(e){e.target.composing||t.$set(t.formItem,"image",e.target.value)}}}):t._e(),t.formItem.image?t._e():e("Upload",{staticStyle:{display:"inline-block",width:"58px"},attrs:{type:"drag",action:t.uploadUrl,headers:t.uploadHeader,format:["jpg","jpeg","png"],"max-size":5120,"on-success":t.handleImgSuccess,"on-format-error":t.handleImgFormatError,"on-exceeded-size":t.handleImgMaxSize}},[e("div",{staticStyle:{width:"58px",height:"58px","line-height":"58px"}},[e("Icon",{attrs:{type:"md-camera",size:"20"}})],1)])],1),e("FormItem",{attrs:{label:"组标识",prop:"hash"}},[e("Input",{staticStyle:{width:"300px"},attrs:{disabled:""},model:{value:t.formItem.hash,callback:function(e){t.$set(t.formItem,"hash",e)},expression:"formItem.hash"}}),e("Tag",{staticClass:"margin-left-5",attrs:{color:"error"}},[t._v("系统自动生成,不允许修改")])],1),e("FormItem",{attrs:{label:"组描述",prop:"description"}},[e("Input",{attrs:{autosize:{maxRows:10,minRows:4},type:"textarea",placeholder:"请输入接口组描述"},model:{value:t.formItem.description,callback:function(e){t.$set(t.formItem,"description",e)},expression:"formItem.description"}})],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)},r=[],o=a("19ce"),s=a("66df"),i=a("c276"),c=a("2226"),l=function(t,e,a,n){if(t.buttonShow.edit)return e("Button",{props:{type:"primary"},style:{margin:"0 5px"},on:{click:function(){t.formItem.id=a.id,t.formItem.name=a.name,t.formItem.hash=a.hash,t.formItem.image=a.image,t.formItem.description=a.description,t.modalSetting.show=!0,t.modalSetting.index=n}}},t.$t("edit_button"))},u=function(t,e,a,n){if(t.buttonShow.del)return e("Poptip",{props:{confirm:!0,title:"您确定要删除此接口分组么? 如当前分组下仍有接口,将自动划归于默认分组!",transfer:!0},on:{"on-ok":function(){Object(o["c"])(a.hash).then((function(e){t.tableData.splice(n,1),t.$Message.success(e.data.msg)})),a.loading=!1}}},[e("Button",{style:{margin:"0 5px"},props:{type:"error",placement:"top",loading:a.isDeleting}},t.$t("delete_button"))])},d={name:"interface_group",data:function(){var t=this;return{uploadUrl:s["a"]+"Index/upload",uploadHeader:{"Api-Auth":Object(i["i"])()},columnsList:[{title:"序号",type:"index",width:65,align:"center"},{title:"接口组名称",align:"center",key:"name"},{title:"接口组描述",align:"center",key:"description"},{title:"接口组热度",align:"center",width:120,render:function(t,e){if(e.row.hot>1e4){var a=(parseInt(e.row.hot)/1e4).toFixed(1)+"万";return t("span",a)}return t("span",e.row.hot)}},{title:"接口组标识",align:"center",key:"hash",width:140},{title:"接口组状态",align:"center",width:110,render:function(e,a){var n=t;return e("i-switch",{attrs:{size:"large"},props:{"true-value":1,"false-value":0,value:a.row.status,disabled:!n.buttonShow.changeStatus},on:{"on-change":function(t){Object(o["b"])(t,a.row.id).then((function(t){n.$Message.success(t.data.msg),n.getList()}))}}},[e("span",{slot:"open"},n.$t("open_choose")),e("span",{slot:"close"},n.$t("close_choose"))])}},{title:"操作",align:"center",width:200,render:function(e,a){return e("div",[l(t,e,a.row,a.index),u(t,e,a.row,a.index)])}}],tableData:[],tableShow:{currentPage:1,pageSize:10,listCount:0},searchConf:{type:"",keywords:"",status:""},modalSetting:{show:!1,loading:!1,index:0},formItem:{description:"",name:"",hash:"",image:"",id:0},ruleValidate:{name:[{required:!0,message:"接口组名称不能为空",trigger:"blur"}]},buttonShow:{edit:!0,del:!0,changeStatus:!0},listLoading:!1}},created:function(){var t=this;t.getList(),t.hasRule("InterfaceGroup/edit").then((function(e){t.buttonShow.edit=e})),t.hasRule("InterfaceGroup/del").then((function(e){t.buttonShow.del=e})),t.hasRule("InterfaceGroup/changeStatus").then((function(e){t.buttonShow.changeStatus=e}))},methods:{alertAdd:function(){var t=this;Object(c["e"])().then((function(e){t.formItem.hash=e.data.data.hash})),t.modalSetting.show=!0},submit:function(){var t=this;this.$refs["myForm"].validate((function(e){e&&(t.modalSetting.loading=!0,0===t.formItem.id?Object(o["a"])(t.formItem).then((function(e){t.$Message.success(e.data.msg),t.getList(),t.cancel()})).catch((function(){t.modalSetting.loading=!1})):Object(o["d"])(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(o["f"])({page:t.tableShow.currentPage,size:t.tableShow.pageSize,type:t.searchConf.type,keywords:t.searchConf.keywords,status:t.searchConf.status}).then((function(e){t.tableData=e.data.data.list,t.tableShow.listCount=e.data.data.count,t.listLoading=!1}))},handleImgFormatError:function(t){this.$Notice.warning({title:"文件类型不合法",desc:t.name+"的文件类型不正确,请上传jpg或者png图片。"})},handleImgRemove:function(){this.formItem.image=""},handleImgSuccess:function(t){1===t.code?(this.$Message.success(t.msg),this.formItem.image=t.data.fileUrl):this.$Message.error(t.msg)},handleImgMaxSize:function(t){this.$Notice.warning({title:"文件大小不合法",desc:t.name+"太大啦请上传小于5M的文件。"})},doCancel:function(t){t||(this.formItem.id=0,this.formItem.image="",this.$refs["myForm"].resetFields(),this.modalSetting.loading=!1,this.modalSetting.index=0)}}},m=d,h=(a("4466"),a("2877")),f=Object(h["a"])(m,n,r,!1,null,"01b70a15",null);e["default"]=f.exports},2226:function(t,e,a){"use strict";a.d(e,"e",(function(){return r})),a.d(e,"g",(function(){return o})),a.d(e,"f",(function(){return s})),a.d(e,"c",(function(){return i})),a.d(e,"b",(function(){return c})),a.d(e,"a",(function(){return l})),a.d(e,"d",(function(){return u}));var n=a("66df"),r=function(){return n["b"].request({url:"InterfaceList/getHash",method:"get"})},o=function(){return n["b"].request({url:"InterfaceList/refresh",method:"get"})},s=function(t){return n["b"].request({url:"InterfaceList/index",method:"get",params:t})},i=function(t){return n["b"].request({url:"InterfaceList/del",method:"get",params:{hash:t}})},c=function(t,e){return n["b"].request({url:"InterfaceList/changeStatus",method:"get",params:{status:t,hash:e}})},l=function(t){return n["b"].request({url:"InterfaceList/add",method:"post",data:t})},u=function(t){return n["b"].request({url:"InterfaceList/edit",method:"post",data:t})}},"386d":function(t,e,a){"use strict";var n=a("cb7c"),r=a("83a1"),o=a("5f1b");a("214f")("search",1,(function(t,e,a,s){return[function(a){var n=t(this),r=void 0==a?void 0:a[e];return void 0!==r?r.call(a,n):new RegExp(a)[e](String(n))},function(t){var e=s(a,t,this);if(e.done)return e.value;var i=n(t),c=String(this),l=i.lastIndex;r(l,0)||(i.lastIndex=0);var u=o(i,c);return r(i.lastIndex,l)||(i.lastIndex=l),null===u?-1:u.index}]}))},4466:function(t,e,a){"use strict";a("1a2d")},"83a1":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}}}]);
|