mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
1 line
9.4 KiB
JavaScript
1 line
9.4 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d221836"],{cb56:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.searchFormData}},[a("el-form-item",{attrs:{label:"appKey"}},[a("el-input",{staticStyle:{width:"250px"},attrs:{clearable:!0,placeholder:"appKey",size:"mini"},model:{value:e.searchFormData.appKey,callback:function(t){e.$set(e.searchFormData,"appKey",t)},expression:"searchFormData.appKey"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.onSearchTable}},[e._v("查询")])],1)],1),e._v(" "),a("el-button",{attrs:{type:"primary",size:"mini",icon:"el-icon-plus"},on:{click:e.onAdd}},[e._v("新增ISV")]),e._v(" "),a("el-table",{staticStyle:{"margin-top":"20px"},attrs:{data:e.pageInfo.list,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"80"}}),e._v(" "),a("el-table-column",{attrs:{prop:"appKey",label:"appKey",width:"250"}}),e._v(" "),a("el-table-column",{attrs:{prop:"secret",label:"secret",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[2===t.row.signType?a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return e.onShowSecret(t.row)}}},[e._v("查看")]):e._e()]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"",label:"公私钥",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===t.row.signType?a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return e.onShowPriPubKey(t.row)}}},[e._v("查看")]):e._e()]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"signType",label:"签名类型",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===t.row.signType?a("span",[e._v("RSA2")]):e._e(),e._v(" "),2===t.row.signType?a("span",[e._v("MD5")]):e._e()]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"roleList",label:"角色"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{domProps:{innerHTML:e._s(e.roleRender(t.row))}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===t.row.status?a("span",{staticStyle:{color:"#67C23A"}},[e._v("已启用")]):e._e(),e._v(" "),2===t.row.status?a("span",{staticStyle:{color:"#F56C6C"}},[e._v("已禁用")]):e._e()]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"gmtCreate",label:"添加时间",width:"160"}}),e._v(" "),a("el-table-column",{attrs:{prop:"gmtModified",label:"修改时间",width:"160"}}),e._v(" "),a("el-table-column",{attrs:{label:"操作",fixed:"right",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return e.onTableUpdate(t.row)}}},[e._v("修改")])]}}])})],1),e._v(" "),a("el-pagination",{staticStyle:{"margin-top":"5px"},attrs:{background:"","current-page":e.pageInfo.pageIndex,"page-sizes":[5,10,20,40],"page-size":e.pageInfo.pageSize,total:e.pageInfo.total,layout:"total, sizes, prev, pager, next"},on:{"size-change":e.onSizeChange,"current-change":e.onPageIndexChange}}),e._v(" "),a("el-dialog",{attrs:{title:e.isvDialogTitle,visible:e.isvDialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.isvDialogVisible=t},close:e.onIsvDialogClose}},[a("el-form",{ref:"isvForm",attrs:{rules:e.rulesIsvForm,model:e.isvDialogFormData}},[a("el-form-item",{attrs:{label:"","label-width":e.formLabelWidth}},[a("el-button",{attrs:{size:"mini"},on:{click:e.onDataGen}},[e._v("一键生成数据")])],1),e._v(" "),a("el-form-item",{attrs:{prop:"appKey",label:"appKey","label-width":e.formLabelWidth}},[a("el-input",{attrs:{size:"mini"},model:{value:e.isvDialogFormData.appKey,callback:function(t){e.$set(e.isvDialogFormData,"appKey",t)},expression:"isvDialogFormData.appKey"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"signType",label:"签名方式","label-width":e.formLabelWidth}},[a("el-radio-group",{model:{value:e.isvDialogFormData.signType,callback:function(t){e.$set(e.isvDialogFormData,"signType",t)},expression:"isvDialogFormData.signType"}},[a("el-radio",{attrs:{label:1,name:"status"}},[e._v("RSA2")]),e._v(" "),a("el-radio",{attrs:{label:2,name:"status"}},[e._v("MD5")])],1)],1),e._v(" "),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:2===e.isvDialogFormData.signType,expression:"isvDialogFormData.signType === 2"}],attrs:{prop:"secret",label:"secret","label-width":e.formLabelWidth}},[a("el-input",{attrs:{size:"mini"},model:{value:e.isvDialogFormData.secret,callback:function(t){e.$set(e.isvDialogFormData,"secret",t)},expression:"isvDialogFormData.secret"}})],1),e._v(" "),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:1===e.isvDialogFormData.signType,expression:"isvDialogFormData.signType === 1"}],attrs:{prop:"pubKey",label:"公钥","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.isvDialogFormData.pubKey,callback:function(t){e.$set(e.isvDialogFormData,"pubKey",t)},expression:"isvDialogFormData.pubKey"}})],1),e._v(" "),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:1===e.isvDialogFormData.signType,expression:"isvDialogFormData.signType === 1"}],attrs:{prop:"priKey",label:"私钥","label-width":e.formLabelWidth}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.isvDialogFormData.priKey,callback:function(t){e.$set(e.isvDialogFormData,"priKey",t)},expression:"isvDialogFormData.priKey"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"角色","label-width":e.formLabelWidth}},[a("el-checkbox-group",{model:{value:e.isvDialogFormData.roleCode,callback:function(t){e.$set(e.isvDialogFormData,"roleCode",t)},expression:"isvDialogFormData.roleCode"}},e._l(e.roles,function(t){return a("el-checkbox",{key:t.roleCode,attrs:{label:t.roleCode}},[e._v(e._s(t.description))])}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"状态","label-width":e.formLabelWidth}},[a("el-radio-group",{model:{value:e.isvDialogFormData.status,callback:function(t){e.$set(e.isvDialogFormData,"status",t)},expression:"isvDialogFormData.status"}},[a("el-radio",{attrs:{label:1,name:"status"}},[e._v("启用")]),e._v(" "),a("el-radio",{attrs:{label:2,name:"status"}},[e._v("禁用")])],1)],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.isvDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.onIsvDialogSave}},[e._v("保 存")])],1)],1)],1)},o=[],l={data:function(){var e=this,t=function(t,a,i){2===e.isvDialogFormData.signType&&(""===a&&i(new Error("不能为空")),a.length>200&&i(new Error("长度不能超过200"))),i()},a=function(t,a,i){1===e.isvDialogFormData.signType&&""===a&&i(new Error("不能为空")),i()};return{formLabelWidth:"120px",searchFormData:{appKey:""},pageInfo:{list:[],pageIndex:1,pageSize:10,total:0},roles:[],isvDialogVisible:!1,isvDialogTitle:"新增ISV",isvDialogFormData:{id:0,appKey:"",secret:"",pubKey:"",priKey:"",signType:1,status:1,roleCode:[]},rulesIsvForm:{appKey:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],secret:[{validator:t,trigger:"blur"}],pubKey:[{validator:a,trigger:"blur"}],priKey:[{validator:a,trigger:"blur"}]}}},created:function(){this.loadTable(),this.loadRouteRole()},methods:{loadTable:function(){this.post("isv.info.page",this.searchFormData,function(e){this.pageInfo=e.data})},loadRouteRole:function(){0===this.roles.length&&this.post("role.listall",{},function(e){this.roles=e.data})},onShowSecret:function(e){this.$alert(e.secret,"secret")},onShowPriPubKey:function(e){var t=e.pubKey,a=e.priKey,i='<div>公钥:<textarea style="width: 380px;height: 100px;" readonly="readonly">'+t+'</textarea><br>私钥:<textarea style="width: 380px;height: 100px;" readonly="readonly">'+a+"</textarea></div>";this.$alert(i,"公私钥",{dangerouslyUseHTMLString:!0})},onSearchTable:function(){this.loadTable()},onTableUpdate:function(e){var t=this;this.isvDialogTitle="修改ISV",this.isvDialogVisible=!0,this.$nextTick(function(){t.post("isv.info.get",{id:e.id},function(e){for(var t=e.data,a=t.roleList,i=[],o=0;o<a.length;o++)i.push(a[o].roleCode);t.roleCode=i,Object.assign(this.isvDialogFormData,t)})})},onSizeChange:function(e){this.searchFormData.pageSize=e,this.loadTable()},onPageIndexChange:function(e){this.searchFormData.pageIndex=e,this.loadTable()},onAdd:function(){this.isvDialogFormData.id=0,this.isvDialogTitle="新增ISV",this.isvDialogVisible=!0},onIsvDialogSave:function(){var e=this,t=this;this.$refs["isvForm"].validate(function(a){if(a){var i=0===e.isvDialogFormData.id?"isv.info.add":"isv.info.update";t.post(i,t.isvDialogFormData,function(){t.isvDialogVisible=!1,t.loadTable()})}})},onIsvDialogClose:function(){this.$refs.isvForm.resetFields(),this.isvDialogVisible=!1},roleRender:function(e){for(var t=[],a=e.roleList,i=0;i<a.length;i++)t.push(a[i].description);return t.join(", ")},onDataGen:function(){this.post("isv.form.gen",{},function(e){var t=e.data;if(0===this.isvDialogFormData.id)Object.assign(this.isvDialogFormData,t);else{var a=this.isvDialogFormData.signType;1===a?Object.assign(this.isvDialogFormData,{pubKey:t.pubKey,priKey:t.priKey}):2===a&&Object.assign(this.isvDialogFormData,{secret:t.secret})}})}}},s=l,r=a("2877"),n=Object(r["a"])(s,i,o,!1,null,null,null);t["default"]=n.exports}}]); |