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

1 line
6.7 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["detail"],{"7ddc":function(t,e,s){},d9c0:function(t,e,s){"use strict";var a=s("7ddc"),o=s.n(a);o.a},f574:function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"detail"},[s("md-app",{attrs:{"md-waterfall":"","md-mode":"fixed"}},[s("md-app-toolbar",{staticClass:"md-primary toolbar"},[s("div",{staticClass:"md-toolbar-section-start"},[s("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.back()}}},[s("md-icon",[t._v("arrow_back")])],1),s("h3",{staticClass:"md-title",staticStyle:{flex:"1"}},[t._v(t._s(t.content.title))])],1),s("div",{staticClass:"md-toolbar-section-end"},[s("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.turnToEdit()}}},[s("md-icon",[t._v("edit")])],1),s("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.openDelDialog()}}},[s("md-icon",[t._v("delete")])],1)],1)]),s("md-app-content",[s("v-touch",{attrs:{"swipe-options":{direction:"horizontal"}},on:{swiperight:function(e){return t.back()}}},[s("div",{ref:"list_placeholder",staticStyle:{height:"54px"}}),s("md-list",{staticClass:"md-double-line"},[s("md-list-item",[s("label",{staticClass:"md-caption"},[t._v(t._s(t.lang.label[0]))]),s("div",{staticClass:"msg-box"},[s("p",[t._v(t._s(t.content.user_name))]),s("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"},[s("icon",{staticClass:"icon",class:t.settings.is_dark_mode?"dark-theme-icon":"",attrs:{name:"file_copy"}})],1)],1)]),s("md-list-item",[s("label",{staticClass:"md-caption"},[t._v(t._s(t.lang.label[1]))]),s("div",{staticClass:"msg-box"},[s("p",{staticClass:"password"},[t._v(t._s(t.show_password?t.content.password:t.doitPassword))]),s("md-button",{staticClass:"md-icon-button",on:{click:function(e){t.show_password=!t.show_password}}},[s("md-icon",[t._v("remove_red_eye")])],1),s("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"},[s("icon",{staticClass:"icon",class:t.settings.is_dark_mode?"dark-theme-icon":"",attrs:{name:"file_copy"}})],1)],1)]),s("md-list-item",[s("label",{staticClass:"md-caption"},[t._v(t._s(t.lang.label[2]))]),s("div",{staticClass:"msg-box"},[s("p",[t._v(t._s(t.content.web_address?t.content.web_address:t.lang.empty_placeholder))]),s("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.openUrl()}}},[s("md-icon",[t._v("open_in_new")])],1)],1)]),s("md-list-item",[s("label",{staticClass:"md-caption"},[t._v(t._s(t.lang.label[3]))]),s("div",{staticClass:"msg-box"},[s("p",{staticClass:"node"},[t._v(t._s(t.content.node?t.content.node:t.lang.empty_placeholder))])])])],1),s("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}}),s("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}}},[s("span",[t._v(t._s(t.snakebar_msg))])])],1)],1)],1)],1)},o=[],n=(s("d780"),s("b54b")),i=s("08c1"),c=s("c71e"),r=s("36f0"),d=s("e6a3"),l=s("bfd3"),m={name:"Add",data(){return{show_snackbar:!1,snakebar_msg:"",content:{},show_password:!1,show_dialog:!1,lang:"",clientHeight:""}},computed:Object(n["a"])({},Object(i["c"])(["row_data","row_pwd","settings","user_infos"]),{doitPassword(){if(this.content.password){for(var t="",e=0;e<this.content.password.length;e++)t+="*";return t}}}),methods:Object(n["a"])({},Object(i["b"])(["setRowData","setRowPwd","setSettings","setUserInfo"]),{changeFixed(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(){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(){this.settings.is_chinese?this.lang=Object(r["a"])().detail.CHS:this.lang=Object(r["a"])().detail.EN,console.log("语言配置完成")},back(){this.$router.go(-1)},turnToHome(t){console.log(t),this.$router.replace("/")},turnToEdit(){this.$router.push({name:"Add",params:{modify_content:this.content}})},onCopyUrl(t){this.snakebar_msg=this.lang.copy.successful,this.show_snackbar=!0},onErrorUrl(t){this.snakebar_msg=this.lang.copy.failed,this.show_snackbar=!0},openUrl(){this.content.web_address?window.open(this.content.web_address):(this.snakebar_msg=this.lang.snakebar_msg_empty,this.show_snackbar=!0)},addCount(){var t=Object(c["b"])(this.row_pwd.main_code),e=Object(c["a"])(t,this.row_data),s=JSON.parse(e);for(var a in s)s[a].id==this.content.id&&s[a].open_count++;var o=Object(c["c"])(t,s);this.setRowData([o,this]),console.log("新加密信息覆写成功,增加点击完成")},onCancel(){},openDelDialog(){this.show_dialog=!0},delCode(){var t=Object(c["b"])(this.row_pwd.main_code),e=Object(c["a"])(t,this.row_data),s=JSON.parse(e),a=[];for(var o in s)s[o].id!=this.content.id&&a.push(s[o]);var n=Object(c["c"])(t,a);this.setRowData([n,this]),console.log("新加密信息覆写成功,密码删除完成"),this.back()}}),created(){this.lang=Object(r["a"])().detail.CHS,console.log("临时语言系统加载完成"),this.init()},mounted(){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(){},components:{}},p=m,h=(s("d9c0"),s("623f")),b=Object(h["a"])(p,a,o,!1,null,"97960914",null);e["default"]=b.exports}}]);