1 line
3.6 KiB
JavaScript
1 line
3.6 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-975c61f8"],{6790:function(t,e,n){},"6d01":function(t,e,n){"use strict";n("6790")},dfbe:function(t,e,n){"use strict";n.d(e,"f",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"d",(function(){return a})),n.d(e,"g",(function(){return l})),n.d(e,"h",(function(){return c})),n.d(e,"e",(function(){return u})),n.d(e,"a",(function(){return s})),n.d(e,"i",(function(){return d})),n.d(e,"c",(function(){return f}));var o=n("b775");function r(t){return Object(o["a"])({url:"/note/"+t,method:"get"})}function i(t){return Object(o["a"])({url:"/note",method:"post",data:t})}function a(t){return Object(o["a"])({url:"/note/"+t,method:"delete"})}function l(t){return Object(o["a"])({url:"/note/folder/list",method:"get",params:t})}function c(t){return Object(o["a"])({url:"/note/folder/treeList",method:"get",params:t})}function u(t){return Object(o["a"])({url:"/note/folder/"+t,method:"get"})}function s(t){return Object(o["a"])({url:"/note/folder",method:"post",data:t})}function d(t){return Object(o["a"])({url:"/note/folder",method:"put",data:t})}function f(t){return Object(o["a"])({url:"/note/folder/"+t,method:"delete"})}},fc8e:function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"add-note"},[n("van-nav-bar",{attrs:{fixed:"","left-arrow":"","left-text":"返回","right-text":"保存",title:"新增笔记"},on:{"click-left":function(e){return t.$router.go(-1)},"click-right":t.handleSave}}),n("van-cell-group",{attrs:{inset:""}},[n("van-field",{attrs:{label:"标题",placeholder:"请输入笔记标题"},model:{value:t.note.title,callback:function(e){t.$set(t.note,"title",e)},expression:"note.title"}}),n("van-field",{attrs:{"is-link":"",readonly:"",label:"所属文件夹",placeholder:"请选择所属文件夹"},on:{click:function(e){t.show=!0}},model:{value:t.folderName,callback:function(e){t.folderName=e},expression:"folderName"}}),n("van-field",{attrs:{rows:"5",autosize:"",label:"笔记",type:"textarea",placeholder:"请输入笔记内容","show-word-limit":""},model:{value:t.note.content,callback:function(e){t.$set(t.note,"content",e)},expression:"note.content"}})],1),n("van-popup",{attrs:{round:"",position:"bottom"},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[n("van-cascader",{attrs:{"active-color":"#5A8DEE",title:"请选择所属文件夹",options:t.treeList,"field-names":t.props},on:{close:function(e){t.show=!1},finish:t.onFinish},model:{value:t.folder,callback:function(e){t.folder=e},expression:"folder"}})],1)],1)},r=[],i=(n("b0c0"),n("dfbe")),a={name:"AddNote",data:function(){return{note:{},show:!1,folderName:"",folder:void 0,treeList:[],props:{text:"name",value:"id",children:"children"}}},mounted:function(){var t=this;this.getTreeList(),this.$route.query.folder&&Object(i["e"])(this.$route.query.folder).then((function(e){t.note.folder=e.data.id,t.folderName=e.data.name}))},methods:{handleSave:function(){var t=this;this.note.title?this.note.folder?this.note.content?(this.note.richText=this.note.content,Object(i["b"])(this.note).then((function(e){t.$toast("新增笔记成功"),t.$router.go(-1)}))):this.$toast("请输入笔记内容"):this.$toast("请选择所属文件夹"):this.$toast("请输入笔记标题")},onFinish:function(t){var e=t.selectedOptions;this.show=!1,this.folderName=e[e.length-1].name,this.note.folder=e[e.length-1].id},getTreeList:function(){var t=this;Object(i["h"])().then((function(e){t.treeList=e.data}))}}},l=a,c=(n("6d01"),n("2877")),u=Object(c["a"])(l,o,r,!1,null,"53973b3a",null);e["default"]=u.exports}}]); |