mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
2 lines
6.2 KiB
JavaScript
Vendored
2 lines
6.2 KiB
JavaScript
Vendored
import{I as o}from"./IFrame.0163e5e4.js";import{n as s}from"./app.49f07a13.js";var c=function(){var e=this,i=e.$createElement,t=e._self._c||i;return t("div",{staticClass:"minder-editor-container"},[t("div",{staticClass:"quickbar"},[t("ETooltip",{attrs:{placement:"top",effect:"light"}},[t("div",[t("i",{staticClass:"ft icon",attrs:{title:e.$L("\u7F29\u653E")}},[e._v("\uE7B3")])]),t("div",{staticClass:"minder-editor-slider",attrs:{slot:"content"},slot:"content"},[t("Slider",{attrs:{min:10,max:300},model:{value:e.zoom,callback:function(n){e.zoom=n},expression:"zoom"}})],1)]),e.readOnly!==!0?t("ETooltip",{attrs:{placement:"top",effect:"light"}},[t("div",[t("i",{staticClass:"ft icon",attrs:{title:e.$L("\u56FE\u5F62")}},[e._v("\uE621")])]),t("div",{attrs:{slot:"content"},slot:"content"},[t("ul",{staticClass:"minder-editor-quickul mold"},[t("li",{on:{click:function(n){return e.execCommand("template","default")}}},[t("span",{staticClass:"default"})]),t("li",{on:{click:function(n){return e.execCommand("template","structure")}}},[t("span",{staticClass:"structure"})]),t("li",{on:{click:function(n){return e.execCommand("template","filetree")}}},[t("span",{staticClass:"filetree"})]),t("li",{on:{click:function(n){return e.execCommand("template","right")}}},[t("span",{staticClass:"right"})]),t("li",{on:{click:function(n){return e.execCommand("template","fish-bone")}}},[t("span",{staticClass:"fish-bone"})]),t("li",{on:{click:function(n){return e.execCommand("template","tianpan")}}},[t("span",{staticClass:"tianpan"})])])])]):e._e(),e.readOnly!==!0?t("ETooltip",{attrs:{placement:"top",effect:"light"}},[t("div",[t("i",{staticClass:"ft icon",attrs:{title:e.$L("\u6837\u5F0F")}},[e._v("\uE678")])]),t("div",{attrs:{slot:"content"},slot:"content"},[t("ul",{staticClass:"minder-editor-quickul"},[t("li",{on:{click:function(n){return e.execCommand("theme","fresh-blue")}}},[e._v(e._s(e.$L("\u5929\u7A7A\u84DD")))]),t("li",{on:{click:function(n){return e.execCommand("theme","wire")}}},[e._v(e._s(e.$L("\u7EBF\u6846")))]),t("li",{on:{click:function(n){return e.execCommand("theme","fish")}}},[e._v(e._s(e.$L("\u9C7C\u9AA8\u56FE")))]),t("li",{on:{click:function(n){return e.execCommand("theme","classic")}}},[e._v(e._s(e.$L("\u8111\u56FE\u7ECF\u5178")))]),t("li",{on:{click:function(n){return e.execCommand("theme","classic-compact")}}},[e._v(e._s(e.$L("\u7D27\u51D1\u7ECF\u5178")))]),t("li",{on:{click:function(n){return e.execCommand("theme","snow")}}},[e._v(e._s(e.$L("\u6E29\u67D4\u51B7\u5149")))]),t("li",{on:{click:function(n){return e.execCommand("theme","snow-compact")}}},[e._v(e._s(e.$L("\u7D27\u51D1\u51B7\u5149")))]),t("li",{on:{click:function(n){return e.execCommand("theme","tianpan")}}},[e._v(e._s(e.$L("\u7ECF\u5178\u5929\u76D8")))]),t("li",{on:{click:function(n){return e.execCommand("theme","tianpan-compact")}}},[e._v(e._s(e.$L("\u7D27\u51D1\u5929\u76D8")))])])])]):e._e(),t("ETooltip",{attrs:{placement:"top",effect:"light"}},[t("div",[t("i",{staticClass:"ft icon",attrs:{title:e.$L("\u6298\u53E0")}},[e._v("\uE779")])]),t("div",{attrs:{slot:"content"},slot:"content"},[t("ul",{staticClass:"minder-editor-quickul"},[t("li",{on:{click:function(n){return e.execCommand("ExpandToLevel",1)}}},[e._v(e._s(e.$L("\u5C55\u5F00\u5230\u4E00\u7EA7\u8282\u70B9")))]),t("li",{on:{click:function(n){return e.execCommand("ExpandToLevel",2)}}},[e._v(e._s(e.$L("\u5C55\u5F00\u5230\u4E8C\u7EA7\u8282\u70B9")))]),t("li",{on:{click:function(n){return e.execCommand("ExpandToLevel",3)}}},[e._v(e._s(e.$L("\u5C55\u5F00\u5230\u4E09\u7EA7\u8282\u70B9")))]),t("li",{on:{click:function(n){return e.execCommand("ExpandToLevel",4)}}},[e._v(e._s(e.$L("\u5C55\u5F00\u5230\u56DB\u7EA7\u8282\u70B9")))]),t("li",{on:{click:function(n){return e.execCommand("ExpandToLevel",5)}}},[e._v(e._s(e.$L("\u5C55\u5F00\u5230\u4E94\u7EA7\u8282\u70B9")))]),t("li",{on:{click:function(n){return e.execCommand("ExpandToLevel",99)}}},[e._v(e._s(e.$L("\u5C55\u5F00\u5168\u90E8\u8282\u70B9")))])])])]),t("ETooltip",{attrs:{placement:"top",content:e.$L("\u5C45\u4E2D")}},[t("div",{on:{click:function(n){return e.execCommand("goCenter")}}},[t("i",{staticClass:"ft icon"},[e._v("\uE61F")])])]),t("ETooltip",{attrs:{placement:"top",content:e.$L("\u79FB\u52A8")}},[t("div",{on:{click:e.onHand}},[t("i",{staticClass:"ft icon",class:{active:e.isHand}},[e._v("\uE6CF")])])])],1),t("div",{staticClass:"minder-content"},[t("IFrame",{ref:"frame",staticClass:"minder-iframe",attrs:{src:e.url},on:{"on-message":e.onMessage}}),e.loadIng?t("div",{staticClass:"minder-loading"},[t("Loading")],1):e._e()],1)])},r=[];const l={name:"mind-editor",components:{IFrame:o},props:{value:{type:Object,default:function(){return{}}},readOnly:{type:Boolean,default:!1}},data(){return{loadIng:!0,isHand:this.readOnly,zoom:100,backup:null}},mounted(){window.addEventListener("message",this.handleMessage)},beforeDestroy(){window.removeEventListener("message",this.handleMessage)},methods:{onMessage(e){if(e.app==="minder")switch(e.action){case"ready":this.loadIng=!1,this.rendData();break;case"content":this.backup=JSON.stringify(e.content),this.$emit("input",e.content);break;case"save":this.$emit("saveData");break}},onHand(){if(this.readOnly){this.execCommand("removeAllSelected");return}this.execCommand("Hand"),this.isHand=!this.isHand},execCommand(e,i){this.$refs.frame.postMessage({app:"minder",action:"command",command:e,value:i})},exportHandle(e,i){this.$refs.frame.postMessage({app:"minder",action:"export",type:e,name:i||this.value.root.data.text||this.$L("\u65E0\u6807\u9898")})},rendData(){this.loadIng||this.backup!==JSON.stringify(this.value)&&this.$refs.frame.postMessage({app:"minder",action:"setContent",content:this.value})}},computed:{url(){return $A.apiUrl(`../minder/index.html?type=manual&readonly=${this.readOnly?"yes":"no"}`)}},watch:{value:{handler:function(e){(typeof e!="object"||e===null)&&(e={root:e,theme:"fresh-blue",template:"default"}),(typeof e.root!="object"||e.root===null||e.root.length==0)&&(e.root={data:{id:$A.randomString(12),text:this.$L("\u9ED8\u8BA4\u8282\u70B9")},children:[]}),typeof e.theme!="string"&&(e.theme="fresh-blue"),typeof e.template!="string"&&(e.template="default"),this.rendData()},deep:!0,immediate:!0},zoom(e){this.execCommand("Zoom",e)}}},a={};var m=s(l,c,r,!1,d,"e160012c",null,null);function d(e){for(let i in a)this[i]=a[i]}var f=function(){return m.exports}();export{f as default};
|