text: webpackJsonp([8],{"0iJL":function(t,e,o){(t.exports=o("FZ+f")(!1)).push([t.i,"\n.token-con {\n  max-width: 1100px;\n  margin: 0 auto;\n}\n.create-wrapper {\n  max-width: 1100px;\n  margin: 0 auto;\n  padding: 30px 0;\n}\n.create-wrapper .btn-block {\n    width: 100px;\n}\n",""])},RkUW:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o("TIfe"),a=o("E4LH"),r={data:function(){var t=Object(a.a)("15"),e=this;return{tokenErr:"",data:[],createModal:!1,form:{token:"",total:"",pwd:""},rules:{token:[{validator:function(t,e,o){(e=e.trim())?e.match(/^CW/)?o("token名称不能以CWV开头"):e.length>8||e.length<3?o("token名称长度不能超过8位且不小于3位"):e.match(/^[A-Z]{3,8}$/)?o():o("token名称只能包含英文,且需要大写"):o("请输入token名称")},trigger:"blur"}],total:[{validator:function(o,n,a){0==(n=n.split(",").join(""))&&a("请输入大于0的数字"),t.test(n)?(n>1e12&&a("您输入的数值过大"),e.form.total=e.accounting.formatNumber(n),a()):a("请正确输入正整数")},trigger:"change"}],pwd:[{validator:function(t,e,o){e?e.length>20||e.length<6?o("密码不应小于6位，且不应该大于20位"):o():o("请输入密码")},trigger:"blur"}]}}},mounted:function(){this.init()},methods:{init:function(){var t=this,e=Object(n.a)();e&&(this.$loading(),this.$http.post("/node/man/pbgtt.do",{address:e}).then(function(e){t.$loading().close(),e&&"1"==e.retCode?e.tokens&&"function"==typeof e.tokens.join&&(t.data=e.tokens.map(function(e,o){return e.time=t.timeago().format(e.timestamp),e}),t.tokenErr=""):t.tokenErr="没有获取到token"}).catch(function(e){t.$loading().close(),t.tokenErr="没有获取到token"}))},open:function(){this.createModal=!0},inputToken:function(t){this.form.token=t.toUpperCase()},handleClose:function(){this.createModal=!1,this.$refs.form.resetFields(),console.log("close")},create:function(){var t=this;this.$refs.form.validate(function(e){e&&t.doCreate()})},doCreate:function(){var t=this;this.$loading();var e=this.form,o=e.token,n=e.total,a=e.pwd;o=o.trim(),n=n.trim().split(",").join(""),a=a.trim(),this.$http.post("/node/man/pbctt.do",{token:o,total:n,pwd:a}).then(function(e){if(t.$loading().close(),1==e.retCode)t.$message.success("发布成功。"),t.createModal=!1,t.init();else{var o="";e.retMsg&&(o=e.retMsg),t.$message.error((o?o+",":"")+"发布失败，请稍后重试。")}}).catch(function(e){t.$loading().close(),t.$message.error("发布失败，请稍后重试。")})}}},i={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"token"},[o("div",[t._m(0),t._v(" "),o("div",{staticClass:"input-error"},[t._v(t._s(t.tokenErr))]),t._v(" "),o("div",{staticClass:"create-wrapper"},[o("el-button",{staticClass:"btn-block",attrs:{type:"primary"},on:{click:t.open}},[t._v("新建")])],1),t._v(" "),o("div",{staticClass:"token-con"},[o("el-table",{attrs:{data:t.data}},[o("el-table-column",{attrs:{prop:"token",label:"token"}}),t._v(" "),o("el-table-column",{attrs:{prop:"total",label:"total"}}),t._v(" "),o("el-table-column",{attrs:{prop:"time",label:"time"}})],1)],1)]),t._v(" "),o("el-dialog",{attrs:{title:"提示",visible:t.createModal,width:"30%","modal-append-to-body":!1},on:{"update:visible":function(e){t.createModal=e},close:t.handleClose}},[o("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules}},[o("el-form-item",{attrs:{prop:"token"}},[o("el-input",{attrs:{placeholder:"请输入token名称，只能包含大写英文字母"},on:{input:t.inputToken},model:{value:t.form.token,callback:function(e){t.$set(t.form,"token",e)},expression:"form.token"}})],1),t._v(" "),o("el-form-item",{attrs:{prop:"total"}},[o("el-input",{attrs:{maxlength:"15",placeholder:"请输入token总量"},model:{value:t.form.total,callback:function(e){t.$set(t.form,"total",e)},expression:"form.total"}})],1),t._v(" "),o("el-form-item",{attrs:{prop:"pwd"}},[o("el-input",{attrs:{placeholder:"请输入密码",type:"password"},model:{value:t.form.pwd,callback:function(e){t.$set(t.form,"pwd",e)},expression:"form.pwd"}})],1),t._v(" "),o("div",[o("el-button",{staticClass:"btn-block",attrs:{type:"primary"},on:{click:t.create}},[t._v("确定")])],1)],1)],1)],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("h3",{staticClass:"title"},[this._v("发布token")])])}]};var l=o("VU/8")(r,i,!1,function(t){o("ZwNi")},null,null);e.default=l.exports},ZwNi:function(t,e,o){var n=o("0iJL");"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);o("rjj0")("ba239224",n,!0)}});