"use strict";(self.webpackChunkmy_package_ext=self.webpackChunkmy_package_ext||[]).push([[1907],{91907:function(e,t,i){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)),n}function o(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?l(Object(i),!0).forEach((function(t){var l,o;l=e,o=i[t],(t=function(e){return e=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return String(e);if("object"!==n(i=i.call(e,"string")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),"symbol"===n(e)?e:String(e)}(t))in l?Object.defineProperty(l,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):l[t]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}i.r(t),i.d(t,{default:function(){return a}}),t={inject:["home"],props:{iframe:{default:null}},data:function(){return{controlTypes:[{value:"pm-select",label:"下拉"},{value:"pm-select-user",label:"人员选择"},{value:"pm-select-org",label:"机构选择"}],bindFieldData:{},bindFieldVisible:!1}},methods:{openBindField:function(e){e=e.cell;var t=this.iframe.contentWindow.getCellFormat(e.rowIndex,e.columnIndex);t&&t.config&&(this.bindFieldData=o({},t.config)),this.bindFieldData.rowIndex=e.rowIndex,this.bindFieldData.columnIndex=e.columnIndex,this.bindFieldVisible=!0},cancelBindField:function(){this.bindFieldData={rowIndex:this.bindFieldData.rowIndex,columnIndex:this.bindFieldData.columnIndex}},saveBindField:function(){console.log(this.bindFieldData),this.iframe.contentWindow.luckysheet.setCellFormat(this.bindFieldData.rowIndex,this.bindFieldData.columnIndex,"config",o({},this.bindFieldData)),this.iframe.contentWindow.luckysheet.setCellFormat(this.bindFieldData.rowIndex,this.bindFieldData.columnIndex,"bg","rgb(233, 233, 233)"),this.closeBindField()},closeBindField:function(){this.bindFieldData={},this.bindFieldVisible=!1},changeControlType:function(e){this.$set(this.bindFieldData,"control",e),"pm-select"===e?(this.$set(this.bindFieldData,"datasource",{type:"dict",options:null}),this.$set(this.bindFieldData,"editType","open")):"pm-select-user"===e||"pm-select-org"===e?(this.$set(this.bindFieldData,"optionsRange",[]),this.$set(this.bindFieldData,"selectTypes",[]),this.$set(this.bindFieldData,"isOrgRoot",[]),this.$set(this.bindFieldData,"editType","open")):this.$set(this.bindFieldData,"editType",null)}}};var a=(0,i(51900).Z)(t,(function(){var e=this,t=e._self._c;return t("div",[t("el-dialog",{attrs:{modal:!1,"append-to-body":!0,visible:e.bindFieldVisible,title:"绑定字段",width:"800px"},on:{"update:visible":function(t){e.bindFieldVisible=t}}},[t("div",[t("el-form",{ref:"bindFieldForm",attrs:{"label-width":"80px",model:e.bindFieldData}},[t("el-form-item",{attrs:{label:"字段"}},[t("SelectEntityField",{staticStyle:{width:"300px"},attrs:{"show-children":!0,"label-is-formatted":!0,"entity-name":e.home.formConf.entityName,fieldType:e.bindFieldData.fieldType},on:{"update:fieldType":function(t){return e.$set(e.bindFieldData,"fieldType",t)},"update:field-type":function(t){return e.$set(e.bindFieldData,"fieldType",t)}},model:{value:e.bindFieldData.field,callback:function(t){e.$set(e.bindFieldData,"field",t)},expression:"bindFieldData.field"}}),e._v(" "),t("el-button",{attrs:{disabled:!e.bindFieldData.field},on:{click:e.cancelBindField}},[e._v("取消绑定")])],1),e._v(" "),t("el-form-item",{attrs:{label:"控件类型"}},[t("el-select",{on:{change:e.changeControlType},model:{value:e.bindFieldData.controlType,callback:function(t){e.$set(e.bindFieldData,"controlType",t)},expression:"bindFieldData.controlType"}},e._l(e.controlTypes,(function(e){return t("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1),e._v(" "),"pm-select"===e.bindFieldData.control?t("el-form-item",[t("ComponentDataSource",{attrs:{"active-data":e.bindFieldData}})],1):e._e()],1)],1),e._v(" "),t("div",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeBindField}},[e._v("取消")]),e._v(" "),t("el-button",{attrs:{type:"primary"},on:{click:e.saveBindField}},[e._v("保存")])],1)])],1)}),[],!1,null,null,null).exports}}]);