pnkx-admin-mongo/pnkx-app-apk/unpackage/cache/wgt/H5A8E5E14/static/js/chunk-7f8d5b97.1f6b876f.js

1 line
5.4 KiB
JavaScript
Raw Normal View History

2024-01-13 13:29:20 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7f8d5b97"],{5787:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"note"},[n("van-nav-bar",{attrs:{fixed:"","left-arrow":"","left-text":"返回","right-text":"新增",title:"笔记"},on:{"click-left":t.handleBack,"click-right":function(e){t.addFlag=!0}}}),n("van-search",{attrs:{placeholder:"请输入搜索关键词"},on:{input:t.handleSearch},model:{value:t.searchCode,callback:function(e){t.searchCode=e},expression:"searchCode"}}),n("van-list",{on:{load:t.getFolderList}},[t.list.length<1?n("van-empty",{attrs:{description:"暂无内容"}}):t._l(t.list,(function(e){return n("van-cell-group",{key:e.id,attrs:{inset:""},on:{click:function(n){return t.handleOpen(e)}}},[n("van-swipe-cell",{scopedSlots:t._u([{key:"right",fn:function(){return["folder"===e.type?n("van-button",{attrs:{square:"",text:"编辑",type:"primary"},on:{click:function(n){return t.$router.push("/addFolder?id="+e.id)}}}):t._e(),n("van-button",{attrs:{square:"",text:"删除",type:"danger"},on:{click:function(n){return t.handleDelete(e)}}})]},proxy:!0}],null,!0)},[n("van-cell",{attrs:{center:""}},[n("van-row",{attrs:{align:"center",type:"flex"}},["folder"===e.type?n("div",{staticClass:"folder"},[n("div",{staticClass:"name"},[n("div",[n("svg-icon",{attrs:{"icon-class":"文件夹"}}),n("span",[t._v(t._s(e.name))])],1),n("div",{staticClass:"time"},[t._v(t._s(e.updateTime||e.createTime))])]),n("div",{staticClass:"password"},[e.password?n("svg-icon",{staticClass:"password",attrs:{"icon-class":"验证码"}}):t._e()],1)]):t._e(),"note"===e.type?n("div",{staticClass:"note"},[n("div",{staticClass:"name"},[n("svg-icon",{attrs:{"icon-class":"编辑02"}}),t._v(" "+t._s(e.title)+" ")],1),n("div",{staticClass:"content"},[t._v(t._s(e.content&&e.content.replace(t.regex,"")))]),n("div",{staticClass:"create-time"},[t._v(t._s(e.updateTime||e.createTime))])]):t._e()])],1)],1)],1)}))],2),n("van-popup",{staticClass:"add-popup",attrs:{round:"",position:"top"},model:{value:t.addFlag,callback:function(e){t.addFlag=e},expression:"addFlag"}},[n("van-button",{attrs:{type:"info"},on:{click:function(e){return t.handleAdd(!0)}}},[t._v("新增笔记")]),n("van-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleAdd(!1)}}},[t._v("新增文件夹")])],1)],1)},r=[],o=(n("b0c0"),n("d81d"),n("dfbe")),i={name:"Note",data:function(){return{addFlag:!1,list:[],params:this.getLocal("noteFolder")||[{parentId:0}],searchCode:"",regex:/(<([^>]+)>)/gi}},mounted:function(){},watch:{params:function(t){this.setLocal("noteFolder",t)}},methods:{handleAdd:function(t){t?this.$router.push("/addNote?folder="+this.params[this.params.length-1].parentId):this.$router.push("/addFolder?parentId="+this.params[this.params.length-1].parentId)},handleBack:function(){this.params.length>1?(this.params.pop(),this.getFolderList()):this.$router.go(-1)},handleOpen:function(t){"folder"===t.type?(this.params.push({parentId:t.id}),this.getFolderList()):"note"===t.type&&this.$router.push("/noteDetails?id="+t.id)},handleDelete:function(t){var e=this;"folder"===t.type?this.$dialog.confirm({message:"确认删除《".concat(t.name,"》文件夹?"),title:"删除"}).then((function(){Object(o["c"])(t.id).then((function(){e.getFolderList(),e.$toast("删除成功")}))})).catch((function(){})):"note"===t.type&&this.$dialog.confirm({message:"确认删除《".concat(t.title,"》笔记?"),title:"删除"}).then((function(){Object(o["d"])(t.id).then((function(){e.getFolderList(),e.$toast("删除成功")}))})).catch((function(){}))},handleSearch:function(){var t=this;this.searchTimer?(clearTimeout(this.searchTimer),this.searchTimer=setTimeout((function(){t.searchCode?(t.params.push({name:t.searchCode}),t.getFolderList()):(t.params=[{parentId:0}],t.getFolderList())}),500)):this.searchTimer=setTimeout((function(){t.searchCode?(t.params.push({name:t.searchCode}),t.getFolderList()):(t.params=[{parentId:0}],t.getFolderList())}),500)},getFolderList:function(){var t=this;this.listLoading=!0,Object(