Files
gb-cms/html/js/black.5597915b.js
2025-08-26 17:36:04 +08:00

1 line
18 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

webpackJsonp([10],{"5gxX":function(t,e,r){"use strict";function o(t){r("LbQQ")}Object.defineProperty(e,"__esModule",{value:!0});var a=r("qb8i"),s=r.n(a);for(var i in a)["default","default"].indexOf(i)<0&&function(t){r.d(e,t,function(){return a[t]})}(i);var n=r("lGU5"),l=r("VU/8"),u=o,c=l(s.a,n.a,!1,u,null,null);e.default=c.exports},Hgfw:function(t,e,r){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function a(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,r){function o(a,s){try{var i=e[a](s),n=i.value}catch(t){return void r(t)}if(!i.done)return Promise.resolve(n).then(function(t){o("next",t)},function(t){o("throw",t)});t(n)}return o("next")})}}Object.defineProperty(e,"__esModule",{value:!0});var s=r("A9K1"),i=o(s),n=r("0iPh"),l=o(n);e.default={data:function(){return{form:this.defForm()}},components:{FormDlg:i.default},methods:{defForm:function(){return{oper:"edit",serial:"",description:"",user_agent:"",remote_ip:"",remote_port:""}},onHide:function(){this.form=this.defForm(),this.$emit("hide")},onShow:function(){this.errors.clear(),this.$emit("show"),this.form.serial||(this.form.oper="add",this.$el.querySelector("[name=serial]").focus())},onSubmit:function(){var t=this;return a(regeneratorRuntime.mark(function e(){var r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$validator.validateAll();case 2:if(r=e.sent){e.next=8;break}return o=t.errors.items[0],t.$message({type:"error",message:o.msg}),(0,l.default)("[name="+o.field+"]").focus(),e.abrupt("return");case 8:l.default.post("/api/v1/black/save",t.form).then(function(e){t.$refs.dlg.hide(),t.$emit("submit")});case 9:case"end":return e.stop()}},e,t)}))()},show:function(t){var e=this;this.errors.clear(),t&&Object.assign(this.form,t),this.$nextTick(function(){e.$refs.dlg.show()})}}}},IyMy:function(t,e,r){e=t.exports=r("FZ+f")(!1),e.push([t.i,".opt-group .cell{overflow:visible}",""])},KjS1:function(t,e,r){"use strict";(function(t){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},s=r("5gxX"),i=o(s),n=r("tp7m"),l=o(n),u=r("M4fF"),c=o(u),d=r("NYxO");e.default={data:function(){return{q:"",total:0,pageSize:10,currentPage:1,sort:"Serial",order:"asc",loading:!1,blackList:[]}},components:{UploadDlg:i.default,BlackEditDlg:l.default},computed:a({},(0,d.mapState)(["userInfo","serverInfo"])),mounted:function(){},methods:{ready:function(){this.$watch("q",function(t,e){this.doDelaySearch()}),this.$watch("currentPage",function(t,e){this.doSearch(t)})},download:function(){window.open("/api/v1/black/export")},uploaded:function(){this.$message({type:"success",message:"上传配置成功!"}),this.getBlackList(),this.$refs.uploadDlg.hide()},doSearch:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e={};this.q&&(e.q=this.q),this.$router.replace({path:"/black/"+t,query:e})},doDelaySearch:c.default.debounce(function(){this.doSearch()},800),getBlackList:function(){var e=this;this.loading=!0,t.get("/api/v1/black/list",{q:this.q,start:(this.currentPage-1)*this.pageSize,limit:this.pageSize,sort:this.sort,order:this.order}).then(function(t){e.total=t.BlackCount,e.blackList=t.BlackList}).always(function(){e.$nextTick(function(){e.loading=!1})})},sortChange:function(t){this.sort=t.prop,this.order="ascending"==t.order?"asc":"desc",this.getBlackList()},delBlack:function(e){var r=this;this.$confirm("确认删除 "+e.Serial+" ?","提示",{lockScroll:!1}).then(function(){t.post("/api/v1/black/remove",{serial:e.Serial}).always(function(){r.getBlackList()})}).catch(function(){})},editBlack:function(t){this.$refs.blackEditDlg.show({serial:t.Serial,user_agent:t.UserAgent,remote_ip:t.RemoteIP,remote_port:t.RemotePort||"",description:t.Description})},addBlack:function(t){this.$refs.blackEditDlg.show({serial:"",description:""})},formatRemoteIP:function(t,e,r){return r||""},formatRemotePort:function(t,e,r){return r||""}},beforeRouteEnter:function(t,e,r){r(function(e){e.q=t.query.q||"",e.currentPage=parseInt(t.params.page)||1,e.ready()})},beforeRouteLeave:function(t,e,r){r()},beforeRouteUpdate:function(t,e,r){var o=this;r(),this.$nextTick(function(){o.q=t.query.q||"",o.currentPage=parseInt(t.params.page)||1,o.blackList=[],o.total=0,o.getBlackList()})}}}).call(e,r("0iPh"))},LbQQ:function(t,e,r){var o=r("rF1v");"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);r("rjj0")("080cae9a",o,!0,{})},MFVc:function(t,e,r){"use strict";var o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"box box-primary"},[t._m(0),t._v(" "),r("div",{staticClass:"box-body"},[r("div",{staticClass:"form-inline",attrs:{autocomplete:"off",spellcheck:"false"}},[r("div",{staticClass:"form-group form-group-sm"},[r("button",{staticClass:"btn btn-sm btn-primary",attrs:{type:"button"},on:{click:function(e){e.preventDefault(),t.$router.go(-1)}}},[r("i",{staticClass:"fa fa-chevron-left"}),t._v(" 返回\r\n ")])]),t._v(" "),r("span",{staticClass:"hidden-xs"},[t._v("  ")]),t._v(" "),r("div",{staticClass:"form-group form-group-sm"},[r("div",{staticClass:"input-group input-group-sm"},[r("button",{staticClass:"btn btn-sm btn-primary",attrs:{type:"button"},on:{click:function(e){e.preventDefault(),t.addBlack()}}},[r("i",{staticClass:"fa fa-plus"}),t._v(" 添加黑名单\r\n ")])])]),t._v(" "),r("span",{staticClass:"hidden-xs"},[t._v("  ")]),t._v(" "),r("div",{staticClass:"form-group form-group-sm"},[r("label",[t._v("搜索")]),t._v(" "),t.isMobile()?r("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.q,expression:"q",modifiers:{trim:!0}}],ref:"q",staticClass:"form-control",attrs:{type:"text",placeholder:"关键字"},domProps:{value:t.q},on:{keydown:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key))return null;e.preventDefault()},input:function(e){e.target.composing||(t.q=e.target.value.trim())},blur:function(e){t.$forceUpdate()}}}):r("div",{staticClass:"input-group input-group-sm"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.q,expression:"q",modifiers:{trim:!0}}],ref:"q",staticClass:"form-control",attrs:{type:"text",placeholder:"关键字"},domProps:{value:t.q},on:{keydown:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key))return null;e.preventDefault()},input:function(e){e.target.composing||(t.q=e.target.value.trim())},blur:function(e){t.$forceUpdate()}}}),t._v(" "),r("div",{staticClass:"input-group-btn"},[r("button",{staticClass:"btn btn-sm btn-primary",attrs:{type:"button",title:"导出黑名单数据"},on:{click:function(e){e.preventDefault(),t.download(e)}}},[r("i",{staticClass:"fa fa-download"})]),t._v(" "),r("button",{staticClass:"btn btn-sm btn-primary",attrs:{type:"button",title:"导入黑名单数据"},on:{click:function(e){e.preventDefault(),t.$refs.uploadDlg.show()}}},[r("i",{staticClass:"fa fa-upload"})])])])])]),t._v(" "),r("br"),t._v(" "),r("div",{staticClass:"clearfix"}),t._v(" "),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.blackList,stripe:"","default-sort":{prop:"Serial",order:"ascending"},"element-loading-text":"加载中..."},on:{"sort-change":t.sortChange}},[r("el-table-column",{attrs:{prop:"Serial",label:"设备国标编号","min-width":"200","show-overflow-tooltip":"",sortable:"custom"}}),t._v(" "),r("el-table-column",{attrs:{label:"操作","min-width":"150",fixed:!t.isMobile()&&"right","class-name":"opt-group"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("div",{staticClass:"btn-group btn-group-xs"},[t.userInfo?r("button",{staticClass:"btn btn-warning",attrs:{type:"button"},on:{click:function(r){r.preventDefault(),t.editBlack(e.row)}}},[r("i",{staticClass:"fa fa-edit"}),t._v(" 编辑\r\n ")]):t._e(),t._v(" "),t.userInfo?r("button",{staticClass:"btn btn-danger",attrs:{type:"button"},on:{click:function(r){r.preventDefault(),t.delBlack(e.row)}}},[r("i",{staticClass:"fa fa-remove"}),t._v(" 删除\r\n ")]):t._e()])]}}])}),t._v(" "),r("el-table-column",{attrs:{prop:"UserAgent",label:"UA","min-width":"140","show-overflow-tooltip":"",sortable:"custom"}}),t._v(" "),r("el-table-column",{attrs:{prop:"RemoteIP",label:"IP","min-width":"140",formatter:t.formatRemoteIP,"show-overflow-tooltip":"",sortable:"custom"}}),t._v(" "),r("el-table-column",{attrs:{prop:"RemotePort",label:"端口","min-width":"140",formatter:t.formatRemotePort,"show-overflow-tooltip":"",sortable:"custom"}}),t._v(" "),r("el-table-column",{attrs:{prop:"Description",label:"备注","min-width":"200","show-overflow-tooltip":"",sortable:"custom"}}),t._v(" "),r("el-table-column",{attrs:{prop:"UpdatedAt",label:"更新时间","min-width":"160",sortable:"custom"}}),t._v(" "),r("el-table-column",{attrs:{prop:"CreatedAt",label:"创建时间","min-width":"160",sortable:"custom"}})],1)],1),t._v(" "),t.total>0?r("div",{staticClass:"box-footer"},[r("el-pagination",{staticClass:"pull-right",attrs:{layout:"total,prev,pager,next","pager-count":t.isMobile()?3:5,total:t.total,"page-size":t.pageSize,"current-page":t.currentPage},on:{"update:pageSize":function(e){t.pageSize=e},"update:currentPage":function(e){t.currentPage=e}}})],1):t._e(),t._v(" "),r("UploadDlg",{ref:"uploadDlg",attrs:{title:"上传黑名单",url:"/api/v1/black/import"},on:{uploaded:t.uploaded}}),t._v(" "),r("BlackEditDlg",{ref:"blackEditDlg",on:{submit:t.getBlackList}})],1)])},a=[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"box-header"},[r("h4",{staticClass:"text-primary text-center"},[t._v("黑名单")])])}],s={render:o,staticRenderFns:a};e.a=s},WFah:function(t,e,r){"use strict";function o(t){r("nHWW")}Object.defineProperty(e,"__esModule",{value:!0});var a=r("KjS1"),s=r.n(a);for(var i in a)["default","default"].indexOf(i)<0&&function(t){r.d(e,t,function(){return a[t]})}(i);var n=r("MFVc"),l=r("VU/8"),u=o,c=l(s.a,n.a,!1,u,null,null);e.default=c.exports},lGU5:function(t,e,r){"use strict";var o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"modal fade upload-dlg",attrs:{"data-backdrop":"static","data-keyboard":"true",tabindex:"-1"}},[r("div",{staticClass:"modal-dialog"},[r("div",{staticClass:"modal-content"},[r("div",{staticClass:"modal-header"},[t._m(0),t._v(" "),r("h4",{staticClass:"modal-title text-center text-info"},[r("span",[t._v(t._s(t.title))])])]),t._v(" "),r("div",{staticClass:"modal-body"},[t._t("header"),t._v(" "),r("el-upload",{ref:"uploader",attrs:{drag:t.drag,action:t.url,multiple:t.multiple,"show-file-list":t.showFileList,limit:1,"on-success":t.onSuccess,"on-progress":t.onProgress,"on-error":t.onError,"on-remove":t.onRemove,accept:t.accept,"before-upload":t.beforeUpload,"auto-upload":t.autoUpload}},[r("i",{staticClass:"el-icon-upload"}),t._v(" "),r("div",{staticClass:"el-upload__text"},[t._v("将配置数据拖到此处,或 "),r("em",[t._v("点击上传")])]),t._v(" "),r("div",{staticClass:"el-upload__tip text-center",attrs:{slot:"tip"},slot:"tip"},[t._v(t._s(t.tip)),r("span",{staticStyle:{color:"red"}},[t._v(" *上传成功会自动删除原有数据,请注意导出备份*")])])]),t._v(" "),t._t("footer")],2),t._v(" "),r("div",{staticClass:"modal-footer"},[r("button",{staticClass:"btn btn-default",attrs:{type:"button","data-dismiss":"modal",disabled:t.bProgress}},[t._v("关闭")])])])])])},a=[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[r("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])}],s={render:o,staticRenderFns:a};e.a=s},nHWW:function(t,e,r){var o=r("IyMy");"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);r("rjj0")("46097aea",o,!0,{})},pGoN:function(t,e,r){"use strict";var o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormDlg",{ref:"dlg",attrs:{title:"编辑黑名单",disabled:t.errors.any()},on:{hide:t.onHide,show:t.onShow,submit:t.onSubmit}},[r("div",{class:{"form-group":!0,"has-error":t.errors.has("serial")}},[r("label",{staticClass:"col-sm-4 control-label"},[t._v("设备国标编号\r\n "),r("span",{staticClass:"text-red"},[t._v("*")])]),t._v(" "),r("div",{staticClass:"col-sm-7"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.form.serial,expression:"form.serial",modifiers:{trim:!0}},{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],staticClass:"form-control",attrs:{type:"text",readonly:"edit"==t.form.oper,name:"serial","data-vv-as":"设备编号"},domProps:{value:t.form.serial},on:{input:function(e){e.target.composing||t.$set(t.form,"serial",e.target.value.trim())},blur:function(e){t.$forceUpdate()}}})])]),t._v(" "),r("div",{class:{"form-group":!0,"has-error":t.errors.has("user_agent")}},[r("label",{staticClass:"col-sm-4 control-label"},[t._v("UA\r\n ")]),t._v(" "),r("div",{staticClass:"col-sm-7"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.form.user_agent,expression:"form.user_agent",modifiers:{trim:!0}}],staticClass:"form-control",attrs:{type:"text",name:"user_agent",placeholder:"为空时不限接入UA","data-vv-as":"UA"},domProps:{value:t.form.user_agent},on:{input:function(e){e.target.composing||t.$set(t.form,"user_agent",e.target.value.trim())},blur:function(e){t.$forceUpdate()}}})])]),t._v(" "),r("div",{class:{"form-group":!0,"has-error":t.errors.has("remote_ip")}},[r("label",{staticClass:"col-sm-4 control-label"},[t._v("IP\r\n ")]),t._v(" "),r("div",{staticClass:"col-sm-7"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.form.remote_ip,expression:"form.remote_ip",modifiers:{trim:!0}}],staticClass:"form-control",attrs:{type:"text",name:"remote_ip",placeholder:"为空时不限接入IP","data-vv-as":"IP"},domProps:{value:t.form.remote_ip},on:{input:function(e){e.target.composing||t.$set(t.form,"remote_ip",e.target.value.trim())},blur:function(e){t.$forceUpdate()}}})])]),t._v(" "),r("div",{class:{"form-group":!0,"has-error":t.errors.has("remote_port")}},[r("label",{staticClass:"col-sm-4 control-label"},[t._v("端口\r\n ")]),t._v(" "),r("div",{staticClass:"col-sm-7"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.form.remote_port,expression:"form.remote_port",modifiers:{trim:!0}},{name:"validate",rawName:"v-validate",value:"numeric",expression:"'numeric'"}],staticClass:"form-control",attrs:{type:"text",name:"remote_port",placeholder:"为空时不限接入端口","data-vv-as":"端口"},domProps:{value:t.form.remote_port},on:{input:function(e){e.target.composing||t.$set(t.form,"remote_port",e.target.value.trim())},blur:function(e){t.$forceUpdate()}}})])]),t._v(" "),r("div",{class:{"form-group":!0,"has-error":t.errors.has("description")}},[r("label",{staticClass:"col-sm-4 control-label"},[t._v("备注\r\n ")]),t._v(" "),r("div",{staticClass:"col-sm-7"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.form.description,expression:"form.description",modifiers:{trim:!0}}],staticClass:"form-control",attrs:{type:"text",name:"description","data-vv-as":"描述信息"},domProps:{value:t.form.description},on:{input:function(e){e.target.composing||t.$set(t.form,"description",e.target.value.trim())},blur:function(e){t.$forceUpdate()}}})])])])},a=[],s={render:o,staticRenderFns:a};e.a=s},qb8i:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),r("F8S1");var o=r("0iPh"),a=function(t){return t&&t.__esModule?t:{default:t}}(o);e.default={props:{title:{default:"上传"},url:{type:String,default:""},multiple:{type:Boolean,default:!1},drag:{type:Boolean,default:!0},showFileList:{type:Boolean,default:!0},accept:{default:".xlsx"},tip:{default:"仅限上传.xlsx"},limit:{type:Number,default:0},autoUpload:{type:Boolean,default:!0}},data:function(){return{bShow:!1,bProgress:!1}},mounted:function(){var t=this;(0,a.default)(this.$el).find(".modal-content").draggable({handle:".modal-header",cancel:".modal-title span",addClasses:!1,containment:"document",delay:100,opacity:.5}),(0,a.default)(this.$el).on("shown.bs.modal",function(){t.$emit("show"),t.bShow=!0}).on("hidden.bs.modal",function(){t.$emit("hide"),t.bShow=!1,t.$refs.uploader.clearFiles()}).on("hide.bs.modal",function(){if(t.bProgress)return t.$message({type:"error",message:"正在上传, 请稍后..."}),!1})},methods:{show:function(){(0,a.default)(this.$el).modal("show")},hide:function(){(0,a.default)(this.$el).modal("hide")},beforeUpload:function(t){return!(this.limit&&t.size>this.limit)||(this.$message({type:"error",message:"文件["+t.name+"]大小超过限制["+this.limit+"], 不能上传!"}),!1)},onSuccess:function(t,e,r){var o=!0,a=!1,s=void 0;try{for(var i,n=r[Symbol.iterator]();!(o=(i=n.next()).done);o=!0){var l=i.value;if(100!=l.percentage&&0!==l.percentage)return void(this.bProgress=!0)}}catch(t){a=!0,s=t}finally{try{!o&&n.return&&n.return()}finally{if(a)throw s}}this.bProgress=!1,this.$emit("uploaded",e)},onProgress:function(t,e,r){this.bProgress=!0},onError:function(t,e,r){t&&this.$message({type:"error",message:t+""});var o=!0,a=!1,s=void 0;try{for(var i,n=r[Symbol.iterator]();!(o=(i=n.next()).done);o=!0){var l=i.value;if(100!=l.percentage&&0!==l.percentage)return void(this.bProgress=!0)}}catch(t){a=!0,s=t}finally{try{!o&&n.return&&n.return()}finally{if(a)throw s}}this.bProgress=!1},onRemove:function(t,e){var r=!0,o=!1,a=void 0;try{for(var s,i=e[Symbol.iterator]();!(r=(s=i.next()).done);r=!0){var n=s.value;if(100!=n.percentage&&0!==n.percentage)return void(this.bProgress=!0)}}catch(t){o=!0,a=t}finally{try{!r&&i.return&&i.return()}finally{if(o)throw a}}this.bProgress=!1}}}},rF1v:function(t,e,r){e=t.exports=r("FZ+f")(!1),e.push([t.i,".upload-dlg .modal-dialog .modal-body{overflow:hidden}.upload-dlg .modal-dialog .modal-body .el-upload{display:block}.upload-dlg .modal-dialog .modal-body .el-upload .el-upload-dragger{margin:0 auto}",""])},tp7m:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=r("Hgfw"),a=r.n(o);for(var s in o)["default","default"].indexOf(s)<0&&function(t){r.d(e,t,function(){return o[t]})}(s);var i=r("pGoN"),n=r("VU/8"),l=n(a.a,i.a,!1,null,null,null);e.default=l.exports}});