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
13 KiB
1 lines
13 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-457c6204"],{"09de":function(t,e,a){"use strict";a("adb8")},"386d":function(t,e,a){"use strict";var n=a("cb7c"),o=a("83a1"),r=a("5f1b");a("214f")("search",1,(function(t,e,a,i){return[function(a){var n=t(this),o=void 0==a?void 0:a[e];return void 0!==o?o.call(a,n):new RegExp(a)[e](String(n))},function(t){var e=i(a,t,this);if(e.done)return e.value;var s=n(t),p=String(this),l=s.lastIndex;o(l,0)||(s.lastIndex=0);var c=r(s,p);return o(s.lastIndex,l)||(s.lastIndex=l),null===c?-1:c.index}]}))},"83a1":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},adb8:function(t,e,a){},e1af: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("AppId")]),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:"App/add",expression:"'App/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:"app_name"}},[e("Input",{attrs:{placeholder:"请输入应用名称"},model:{value:t.formItem.app_name,callback:function(e){t.$set(t.formItem,"app_name",e)},expression:"formItem.app_name"}})],1),e("FormItem",{attrs:{label:"AppId",prop:"app_id"}},[e("Input",{staticStyle:{width:"300px"},attrs:{disabled:"",placeholder:"请输入AppId"},model:{value:t.formItem.app_id,callback:function(e){t.$set(t.formItem,"app_id",e)},expression:"formItem.app_id"}}),e("Tag",{staticClass:"margin-left-5",attrs:{color:"error"}},[t._v("系统自动生成,不允许修改")])],1),e("FormItem",{attrs:{label:"AppSecret",prop:"app_secret"}},[e("Input",{staticStyle:{width:"300px"},attrs:{disabled:"",placeholder:"请输入AppSecret"},model:{value:t.formItem.app_secret,callback:function(e){t.$set(t.formItem,"app_secret",e)},expression:"formItem.app_secret"}},[e("Button",{attrs:{slot:"append",icon:"md-refresh"},on:{click:t.refreshAppSecret},slot:"append"})],1)],1),e("FormItem",{attrs:{label:"应用分组",prop:"app_group"}},[e("Select",{staticStyle:{width:"200px"},model:{value:t.formItem.app_group,callback:function(e){t.$set(t.formItem,"app_group",e)},expression:"formItem.app_group"}},t._l(t.appGroup,(function(a,n){return e("Option",{key:a.hash,attrs:{value:a.hash,kk:n}},[t._v(" "+t._s(a.name))])})),1)],1),e("FormItem",{attrs:{label:"应用描述",prop:"app_info"}},[e("Input",{attrs:{type:"textarea"},model:{value:t.formItem.app_info,callback:function(e){t.$set(t.formItem,"app_info",e)},expression:"formItem.app_info"}})],1),e("FormItem",{attrs:{label:"接口访问",prop:"app_api"}},[e("div",{staticClass:"api-box"},t._l(t.groupList,(function(a,n){return e("div",{key:n,staticClass:"api-group"},[e("div",{staticStyle:{"border-bottom":"1px solid #e9e9e9","padding-bottom":"6px","margin-bottom":"6px"}},[e("Checkbox",{attrs:{indeterminate:t.checkAllIndeterminate[n],value:t.checkAllStatus[n]},nativeOn:{click:function(e){return e.preventDefault(),t.handleCheckAll(n)}}},[t._v(" "+t._s(t.groupInfo[n])+"\n ")])],1),e("CheckboxGroup",{on:{"on-change":function(e){return t.checkAllGroupChange(n)}},model:{value:t.formItem.app_api[n],callback:function(e){t.$set(t.formItem.app_api,n,e)},expression:"formItem.app_api[groupId]"}},t._l(a,(function(a,n){return e("Checkbox",{key:n,attrs:{label:a.hash}},[t._v("\n "+t._s(a.info)+"\n ")])})),1)],1)})),0)])],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)},o=[],r=(a("ac6a"),a("66df")),i=function(t){return r["b"].request({url:"App/index",method:"get",params:t})},s=function(){return r["b"].request({url:"App/refreshAppSecret",method:"get"})},p=function(t){return r["b"].request({url:"App/getAppInfo",method:"get",params:{id:t}})},l=function(t){return r["b"].request({url:"App/del",method:"get",params:{id:t}})},c=function(t,e){return r["b"].request({url:"App/changeStatus",method:"get",params:{status:t,id:e}})},u=function(t){return r["b"].request({url:"App/add",method:"post",data:t})},d=function(t){return r["b"].request({url:"App/edit",method:"post",data:t})},m=a("e412"),h=function(t,e,a,n){if(t.buttonShow.edit)return e("Button",{props:{type:"primary"},style:{margin:"0 5px"},on:{click:function(){Object(m["e"])().then((function(e){t.appGroup=e.data.data.list,t.formItem.id=a.id,t.formItem.app_name=a.app_name,t.formItem.app_info=a.app_info,t.formItem.app_id=a.app_id,t.formItem.app_secret=a.app_secret,t.formItem.app_group=a.app_group,p(a.id).then((function(e){var a=e.data;for(var n in t.groupInfo=a.data.groupInfo,t.groupList=a.data.apiList,t.groupInfo)if(null===a.data.app_detail||"undefined"===typeof a.data.app_detail[n])t.$set(t.checkAllStatus,n,!1),t.$set(t.checkAllIndeterminate,n,!1),t.$set(t.formItem.app_api,n,[]);else{var o=a.data.app_detail[n].length;0===o?(t.$set(t.checkAllStatus,n,!1),t.$set(t.checkAllIndeterminate,n,!1),t.$set(t.formItem.app_api,n,[])):t.groupList[n].length===o?(t.$set(t.checkAllStatus,n,!0),t.$set(t.checkAllIndeterminate,n,!1),t.$set(t.formItem.app_api,n,a.data.app_detail[n])):(t.$set(t.checkAllStatus,n,!1),t.$set(t.checkAllIndeterminate,n,!0),t.$set(t.formItem.app_api,n,a.data.app_detail[n]))}})),t.modalSetting.show=!0,t.modalSetting.index=n}))}}},t.$t("edit_button"))},f=function(t,e,a,n){if(t.buttonShow.del)return e("Poptip",{props:{confirm:!0,title:"您确定要删除这条数据吗? ",transfer:!0},on:{"on-ok":function(){l(a.id).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"))])},g={name:"interface_list",data:function(){var t=this;return{appGroup:[],columnsList:[{title:"序号",type:"index",width:65,align:"center"},{title:"应用名称",align:"center",key:"app_name",minWidth:130},{title:"AppId",align:"center",key:"app_id",width:120},{title:"AppSecret",align:"center",key:"app_secret",width:310},{title:"应用说明",align:"center",key:"app_info",width:160},{title:"应用状态",align:"center",width:100,render:function(e,a){var n=t;return e("i-switch",{attrs:{size:"large"},props:{"true-value":1,"false-value":0,value:a.row.app_status,disabled:!n.buttonShow.changeStatus},on:{"on-change":function(t){c(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",[h(t,e,a.row,a.index),f(t,e,a.row,a.index)])}}],tableData:[],groupInfo:{},groupList:{},tableShow:{currentPage:1,pageSize:10,listCount:0},searchConf:{type:"",keywords:"",status:""},modalSetting:{show:!1,loading:!1,index:0},formItem:{app_name:"",app_id:"",app_secret:"",app_info:"",app_api:{},app_group:"default",id:0},ruleValidate:{app_name:[{required:!0,message:"应用名称不能为空",trigger:"blur"}]},checkAllStatus:{},checkAllIndeterminate:{},buttonShow:{edit:!0,del:!0,changeStatus:!0},listLoading:!1}},created:function(){var t=this;t.getList(),t.hasRule("App/edit").then((function(e){t.buttonShow.edit=e})),t.hasRule("App/del").then((function(e){t.buttonShow.del=e})),t.hasRule("App/changeStatus").then((function(e){t.buttonShow.changeStatus=e}))},methods:{alertAdd:function(){var t=this;Object(m["e"])().then((function(e){t.appGroup=e.data.data.list})),p().then((function(e){var a=e.data;for(var n in t.formItem.app_id=a.data.app_id,t.formItem.app_secret=a.data.app_secret,t.groupInfo=a.data.groupInfo,t.groupList=a.data.apiList,t.groupInfo)t.$set(t.checkAllStatus,n,!1),t.$set(t.checkAllIndeterminate,n,!1),t.$set(t.formItem.app_api,n,[])})),t.modalSetting.show=!0},submit:function(){var t=this;t.$refs["myForm"].validate((function(e){e&&(t.modalSetting.loading=!0,0===t.formItem.id?u(t.formItem).then((function(e){t.$Message.success(e.data.msg),t.getList(),t.cancel()})).catch((function(){t.modalSetting.loading=!1})):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.formItem.id=0,this.$refs["myForm"].resetFields(),this.modalSetting.show=!1,this.modalSetting.loading=!1,this.modalSetting.index=0},changePage:function(t){this.tableShow.currentPage=t,this.getList()},changeSize:function(t){this.tableShow.pageSize=t,this.getList()},handleCheckAll:function(t){if(this.checkAllStatus[t]?this.checkAllStatus[t]=!1:this.checkAllStatus[t]=!this.checkAllStatus[t],this.checkAllIndeterminate[t]=!1,this.checkAllStatus[t]){var e=this;this.groupList[t].forEach((function(a){e.formItem.app_api[t].push(a.hash)}))}else this.formItem.app_api[t]=[]},checkAllGroupChange:function(t){this.formItem.app_api[t].length===this.groupList[t].length?(this.checkAllIndeterminate[t]=!1,this.checkAllStatus[t]=!0):this.formItem.app_api[t].length>0?(this.checkAllIndeterminate[t]=!0,this.checkAllStatus[t]=!1):(this.checkAllIndeterminate[t]=!1,this.checkAllStatus[t]=!1)},search:function(){this.tableShow.currentPage=1,this.getList()},refreshAppSecret:function(){var t=this;s().then((function(e){t.formItem.app_secret=e.data.data.app_secret}))},getList:function(){var t=this;t.listLoading=!0,i({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}))},doCancel:function(t){t||(this.formItem.id=0,this.$refs["myForm"].resetFields(),this.modalSetting.loading=!1,this.modalSetting.index=0)}}},_=g,b=(a("09de"),a("2877")),I=Object(b["a"])(_,n,o,!1,null,"54743995",null);e["default"]=I.exports},e412:function(t,e,a){"use strict";a.d(e,"f",(function(){return o})),a.d(e,"c",(function(){return r})),a.d(e,"b",(function(){return i})),a.d(e,"a",(function(){return s})),a.d(e,"d",(function(){return p})),a.d(e,"e",(function(){return l}));var n=a("66df"),o=function(t){return n["b"].request({url:"AppGroup/index",method:"get",params:t})},r=function(t){return n["b"].request({url:"AppGroup/del",method:"get",params:{hash:t}})},i=function(t,e){return n["b"].request({url:"AppGroup/changeStatus",method:"get",params:{status:t,id:e}})},s=function(t){return n["b"].request({url:"AppGroup/add",method:"post",data:t})},p=function(t){return n["b"].request({url:"AppGroup/edit",method:"post",data:t})},l=function(){return n["b"].request({url:"AppGroup/getAll",method:"get"})}}}]);
|