"use strict";(self.webpackChunkmy_package_ext=self.webpackChunkmy_package_ext||[]).push([[4304],{14304:function(e,t,n){n.r(t),n.d(t,{default:function(){return i}}),t={name:"pm-sheet",components:{ImportExcel:function(){return n.e(8152).then(n.bind(n,28152))},Config:function(){return n.e(1907).then(n.bind(n,91907))},InputProxy:function(){return Promise.all([n.e(3974),n.e(3074)]).then(n.bind(n,83074))}},props:{value:{default:{},type:Object},sheetConfig:{default:[{name:"Cell"}]}},computed:{isDesigner:function(){return"designer"===this.$attrs._source}},data:function(){return{iframe:null,inputProxyData:null,inputValue:null}},mounted:function(){console.log(this.$parent.conf.sheetConfig)},methods:{importExcel:function(e){this.iframe.contentWindow.postMessage({source:"run",data:[e[0]]},"*"),Object.assign(this.$parent.conf.sheetConfig[0],e[0])},autoSaveConfig:function(){},acceptMessage:function(e){"clickCell"===e.data.type?this.isDesigner?console.log("clickCell",e.data.position):"openInputComponent"===e.data.command&&(this.inputProxyData=e.data.data,this.inputValue=this.getCellValueRich(e.data.data.cell.rowIndex,e.data.data.cell.columnIndex)):"clickMenu"===e.data.type?this.$refs.config[e.data.command](e.data.data):this.isDesigner&&this.$parent.conf&&this.$parent.conf.sheetConfig&&this.$parent.conf.sheetConfig[0]&&Object.assign(this.$parent.conf.sheetConfig[0],e.data[0])},getSheetData:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;return this.iframe.contentWindow.luckysheet.getAllSheets()[e].data},getCellValue:function(e,t){return this.iframe.contentWindow.luckysheet.getCellValue(e,t)},setCellValue:function(e,t,n){return this.iframe.contentWindow.luckysheet.setCellValue(e,t,n)},setCellValueRich:function(e,t,n,i){this.setCellValue(e,t,i),this.iframe.contentWindow.luckysheet.setCellFormat(e,t,"realValue",n)},getCellValueRich:function(e,t){return this.iframe.contentWindow.getCellFormat(e,t).realValue||this.getCellValue(e,t)},onLoad:function(){this.iframe=document.getElementById("myIframe"),this.isDesigner?this.iframe.contentWindow.postMessage({source:"designer",data:this.$parent.conf.sheetConfig},"*"):(this.iframe.contentWindow.postMessage({source:"run",data:this.sheetConfig},"*"),console.log(this.sheetConfig)),window.addEventListener("message",this.acceptMessage)}},beforeDestroy:function(){window.removeEventListener("message",this.acceptMessage)}};var i=(0,n(51900).Z)(t,(function(){var e=this,t=e._self._c;return t("div",[e.isDesigner?t("ImportExcel",{on:{importExcel:e.importExcel}}):e._e(),e._v(" "),t("InputProxy",{attrs:{inputValue:e.inputValue,data:e.inputProxyData},on:{"update:data":function(t){e.inputProxyData=t},save:e.setCellValueRich}}),e._v(" "),e.isDesigner?t("Config",{ref:"config",attrs:{iframe:e.iframe}}):e._e(),e._v(" "),t("iframe",{style:{height:e.isDesigner?"calc(100vh - 120px)":"calc(100vh - 200px)"},attrs:{id:"myIframe",src:"/components/sheet/index.html",frameborder:"0"},on:{load:e.onLoad}})],1)}),[],!1,null,"d37ab70e",null).exports},51900:function(e,t,n){function i(e,t,n,i,o,a,s,r){var c,l,u="function"==typeof e?e.options:e;return t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),a&&(u._scopeId="data-v-"+a),s?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=c):o&&(c=r?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),c&&(u.functional?(u._injectStyles=c,l=u.render,u.render=function(e,t){return c.call(t),l(e,t)}):(t=u.beforeCreate,u.beforeCreate=t?[].concat(t,c):[c])),{exports:e,options:u}}n.d(t,{Z:function(){return i}})}}]);