1 line
6.6 KiB
JavaScript
1 line
6.6 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["detail"],{"70d6":function(t,e,s){"use strict";s("fb27")},f574:function(t,e,s){"use strict";s.r(e);var o=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)},n=[],a=(s("9b42"),s("cf6b")),i=s("c71e"),c=s("36f0"),r=s("e6a3"),l=s("bfd3"),d={name:"Add",data(){return{show_snackbar:!1,snakebar_msg:"",content:{},show_password:!1,show_dialog:!1,lang:"",clientHeight:""}},computed:{...Object(a["c"])(["row_data","row_pwd","settings","user_infos"]),doitPassword(){if(this.content.password){let t="";for(let e=0;e<this.content.password.length;e++)t+="*";return t}}},methods:{...Object(a["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){let 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(c["a"])().detail.CHS:this.lang=Object(c["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(){let t=Object(i["b"])(this.row_pwd.main_code),e=Object(i["a"])(t,this.row_data),s=JSON.parse(e);for(let n in s)s[n].id==this.content.id&&s[n].open_count++;let o=Object(i["c"])(t,s);this.setRowData([o,this]),console.log("新加密信息覆写成功,增加点击完成")},onCancel(){},openDelDialog(){this.show_dialog=!0},delCode(){let t=Object(i["b"])(this.row_pwd.main_code),e=Object(i["a"])(t,this.row_data),s=JSON.parse(e),o=[];for(let a in s)s[a].id!=this.content.id&&o.push(s[a]);let n=Object(i["c"])(t,o);this.setRowData([n,this]),console.log("新加密信息覆写成功,密码删除完成"),this.back()}},created(){this.lang=Object(c["a"])().detail.CHS,console.log("临时语言系统加载完成"),this.init()},mounted(){this.clientHeight=""+document.documentElement.clientHeight,window.onresize=function(){this.clientHeight=""+document.documentElement.clientHeight,Object(r["a"])()}.bind(this)},watch:{clientHeight:function(){this.changeFixed(this.clientHeight)}},beforeDestroy(){},components:{}},m=d,p=(s("70d6"),s("5d22")),h=Object(p["a"])(m,o,n,!1,null,"45fe0f52",null);e["default"]=h.exports},fb27:function(t,e,s){}}]); |