canary_fe/dist/js/detail-legacy.446ce2ba.js
2020-12-28 20:41:41 +08:00

1 line
6.8 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["detail"],{"7ddc":function(t,e,n){},d9c0:function(t,e,n){"use strict";var s=n("7ddc"),o=n.n(s);o.a},f574:function(t,e,n){"use strict";n.r(e);var s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"detail"},[n("md-app",{attrs:{"md-waterfall":"","md-mode":"fixed"}},[n("md-app-toolbar",{staticClass:"md-primary toolbar"},[n("div",{staticClass:"md-toolbar-section-start"},[n("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.back()}}},[n("md-icon",[t._v("arrow_back")])],1),n("h3",{staticClass:"md-title",staticStyle:{flex:"1"}},[t._v(t._s(t.content.title))])],1),n("div",{staticClass:"md-toolbar-section-end"},[n("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.turnToEdit()}}},[n("md-icon",[t._v("edit")])],1),n("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.openDelDialog()}}},[n("md-icon",[t._v("delete")])],1)],1)]),n("md-app-content",[n("v-touch",{attrs:{"swipe-options":{direction:"horizontal"}},on:{swiperight:function(e){return t.back()}}},[n("div",{ref:"list_placeholder",staticStyle:{height:"54px"}}),n("md-list",{staticClass:"md-double-line"},[n("md-list-item",[n("label",{staticClass:"md-caption"},[t._v(t._s(t.lang.label[0]))]),n("div",{staticClass:"msg-box"},[n("p",[t._v(t._s(t.content.user_name))]),n("md-button",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:t.content.user_name,expression:"content.user_name",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:t.onCopyUrl,expression:"onCopyUrl",arg:"success"},{name:"clipboard",rawName:"v-clipboard:error",value:t.onErrorUrl,expression:"onErrorUrl",arg:"error"}],staticClass:"md-icon-button"},[n("icon",{staticClass:"icon",class:t.settings.is_dark_mode?"dark-theme-icon":"",attrs:{name:"file_copy"}})],1)],1)]),n("md-list-item",[n("label",{staticClass:"md-caption"},[t._v(t._s(t.lang.label[1]))]),n("div",{staticClass:"msg-box"},[n("p",{staticClass:"password"},[t._v(t._s(t.show_password?t.content.password:t.doitPassword))]),n("md-button",{staticClass:"md-icon-button",on:{click:function(e){t.show_password=!t.show_password}}},[n("md-icon",[t._v("remove_red_eye")])],1),n("md-button",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:t.content.password,expression:"content.password",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:t.onCopyUrl,expression:"onCopyUrl",arg:"success"},{name:"clipboard",rawName:"v-clipboard:error",value:t.onErrorUrl,expression:"onErrorUrl",arg:"error"}],staticClass:"md-icon-button"},[n("icon",{staticClass:"icon",class:t.settings.is_dark_mode?"dark-theme-icon":"",attrs:{name:"file_copy"}})],1)],1)]),n("md-list-item",[n("label",{staticClass:"md-caption"},[t._v(t._s(t.lang.label[2]))]),n("div",{staticClass:"msg-box"},[n("p",[t._v(t._s(t.content.web_address?t.content.web_address:t.lang.empty_placeholder))]),n("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.openUrl()}}},[n("md-icon",[t._v("open_in_new")])],1)],1)]),n("md-list-item",[n("label",{staticClass:"md-caption"},[t._v(t._s(t.lang.label[3]))]),n("div",{staticClass:"msg-box"},[n("p",{staticClass:"node"},[t._v(t._s(t.content.node?t.content.node:t.lang.empty_placeholder))])])])],1),n("md-dialog-confirm",{attrs:{"md-active":t.show_dialog,"md-title":t.lang.dialog.title,"md-content":t.lang.dialog.content,"md-confirm-text":t.lang.dialog.confirm,"md-cancel-text":t.lang.dialog.cancel},on:{"update:mdActive":function(e){t.show_dialog=e},"update:md-active":function(e){t.show_dialog=e},"md-cancel":t.onCancel,"md-confirm":t.delCode}}),n("md-snackbar",{attrs:{"md-position":"center","md-active":t.show_snackbar,"md-persistent":""},on:{"update:mdActive":function(e){t.show_snackbar=e},"update:md-active":function(e){t.show_snackbar=e}}},[n("span",[t._v(t._s(t.snakebar_msg))])])],1)],1)],1)],1)},o=[],a=(n("79dd"),n("b3f9"),n("d780"),n("b54b")),i=n("08c1"),c=n("c71e"),r=n("36f0"),d=n("e6a3"),l=n("bfd3"),m={name:"Add",data:function(){return{show_snackbar:!1,snakebar_msg:"",content:{},show_password:!1,show_dialog:!1,lang:"",clientHeight:""}},computed:Object(a["a"])({},Object(i["c"])(["row_data","row_pwd","settings","user_infos"]),{doitPassword:function(){if(this.content.password){for(var t="",e=0;e<this.content.password.length;e++)t+="*";return t}}}),methods:Object(a["a"])({},Object(i["b"])(["setRowData","setRowPwd","setSettings","setUserInfo"]),{changeFixed:function(t){this.$refs.list_placeholder.parentNode.parentNode.style.maxHeight=t+"px",this.$refs.list_placeholder.parentNode.style.minHeight=t-32+"px",window.document.documentElement.setAttribute("data-theme",this.settings.is_dark_mode?"dark":"light")},init:function(){if(console.log(1),l["a"].call(this),this.$route.params.code_content)if(0!=Object.keys(this.row_pwd).length){var t=(new Date).getTime();t-this.row_pwd.create_time<this.settings.expired_time?(this.initLanguage(),this.content=this.$route.params.code_content,this.addCount()):this.turnToHome("密码超时")}else this.turnToHome("无密码");else this.turnToHome("无参跳转")},initLanguage:function(){this.settings.is_chinese?this.lang=Object(r["a"])().detail.CHS:this.lang=Object(r["a"])().detail.EN,console.log("语言配置完成")},back:function(){this.$router.go(-1)},turnToHome:function(t){console.log(t),this.$router.replace("/")},turnToEdit:function(){this.$router.push({name:"Add",params:{modify_content:this.content}})},onCopyUrl:function(t){this.snakebar_msg=this.lang.copy.successful,this.show_snackbar=!0},onErrorUrl:function(t){this.snakebar_msg=this.lang.copy.failed,this.show_snackbar=!0},openUrl:function(){this.content.web_address?window.open(this.content.web_address):(this.snakebar_msg=this.lang.snakebar_msg_empty,this.show_snackbar=!0)},addCount:function(){var t=Object(c["b"])(this.row_pwd.main_code),e=Object(c["a"])(t,this.row_data),n=JSON.parse(e);for(var s in n)n[s].id==this.content.id&&n[s].open_count++;var o=Object(c["c"])(t,n);this.setRowData([o,this]),console.log("新加密信息覆写成功,增加点击完成")},onCancel:function(){},openDelDialog:function(){this.show_dialog=!0},delCode:function(){var t=Object(c["b"])(this.row_pwd.main_code),e=Object(c["a"])(t,this.row_data),n=JSON.parse(e),s=[];for(var o in n)n[o].id!=this.content.id&&s.push(n[o]);var a=Object(c["c"])(t,s);this.setRowData([a,this]),console.log("新加密信息覆写成功,密码删除完成"),this.back()}}),created:function(){this.lang=Object(r["a"])().detail.CHS,console.log("临时语言系统加载完成"),this.init()},mounted:function(){this.clientHeight="".concat(document.documentElement.clientHeight),window.onresize=function(){this.clientHeight="".concat(document.documentElement.clientHeight),Object(d["a"])()}.bind(this)},watch:{clientHeight:function(){this.changeFixed(this.clientHeight)}},beforeDestroy:function(){},components:{}},u=m,p=(n("d9c0"),n("623f")),h=Object(p["a"])(u,s,o,!1,null,"97960914",null);e["default"]=h.exports}}]);