{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\form\\WidgetHottableLayout.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\components\\form\\WidgetHottableLayout.vue","mtime":1675071992038},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import _slicedToArray from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/helpers/esm/slicedToArray\";\nimport \"core-js/modules/web.dom.iterable\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport { HotTable } from \"@handsontable/vue\";\nimport \"handsontable/dist/handsontable.full.css\";\nimport Handsontable from \"handsontable\";\nimport \"handsontable/languages/zh-CN\";\nimport controlsApi from \"@/api/controlsConfig.js\";\nexport default {\n  name: \"widget-hottable-layout\",\n  components: {\n    HotTable: HotTable\n  },\n  props: [\"element\", \"select\", \"index\", \"data\"],\n  data: function data() {\n    return {\n      selectWidget: this.select,\n      root: 'designer-hot',\n      hotSettings: {\n        data: [//数据可以是二维数组，也可以是数组对象\n        {\n          xm: '李四',\n          xb: '男',\n          account: 'lisi',\n          nl: 23\n        }, {\n          xm: '张三',\n          xb: '男',\n          account: 'zhangsan',\n          nl: 22\n        }],\n        // colHeaders: true,\n        startRows: 11,\n        //行列范围\n        startCols: 6,\n        minRows: 1,\n        //最小行列\n        minCols: 0,\n        maxRows: 200,\n        //最大行列\n        maxCols: 200,\n        rowHeights: 25,\n        rowHeaders: true,\n        //行表头，可以使布尔值（行序号），可以使字符串（左侧行表头相同显示内容，可以解析html），也可以是数组（左侧行表头单独显示内容）。\n        colHeaders: ['姓名', '性别', '账号', '年龄'],\n        //自定义列表头or 布尔值\n        minSpareCols: 0,\n        //列留白\n        minSpareRows: 0,\n        //行留白\n        // currentRowClassName: 'currentRow', //为选中行添加类名，可以更改样式\n        // currentColClassName: 'currentCol',//为选中列添加类名\n        autoWrapRow: true,\n        //自动换行\n        contextMenu: {\n          items: {\n            \"row_above\": {\n              name: '上方插入一行'\n            },\n            \"row_below\": {\n              name: '下方插入一行'\n            },\n            \"remove_row\": {\n              name: '删除行'\n            }\n          }\n        },\n        licenseKey: \"non-commercial-and-evaluation\",\n        manualColumnFreeze: true,\n        //手动固定列  ?\n        manualColumnMove: true,\n        //手动移动列\n        manualRowMove: true,\n        //手动移动行\n        manualColumnResize: true,\n        //手工更改列距\n        manualRowResize: true,\n        //手动更改行距\n        comments: true,\n        //添加注释  \n        customBorders: [],\n        //添加边框\n        columnSorting: true,\n        //排序\n        stretchH: 'all',\n        //根据宽度横向扩展，last:只扩展最后一列，none：默认不扩展\n        fillHandle: true,\n        //选中拖拽复制 possible values: true, false, \"horizontal\", \"vertical\"\n        fixedColumnsLeft: 2,\n        //固定左边列数\n        fixedRowsTop: 2,\n        //固定上边列数\n        beforeRemoveRow: this.beforeRemoveRowMe,\n        afterCreateRow: this.afterCreateRow,\n        afterChange: this.afterChangeMe,\n        mergeCells: [//合并\n          // {row: 1, col: 1, rowspan: 3, colspan: 3},  //指定合并，从（1,1）开始行3列3合并成一格\n          // {row: 3, col: 4, rowspan: 2, colspan: 2}\n        ],\n        columns: [{\n          data: 'xm',\n          type: 'text'\n        }, {\n          data: 'xb',\n          type: 'text'\n        }, {\n          data: 'account',\n          type: 'text'\n        }, {\n          data: 'nl',\n          type: 'numeric'\n        }]\n      }\n    };\n  },\n  methods: {\n    handleSelectWidget: function handleSelectWidget(index) {\n      this.selectWidget = this.data.list[index];\n    },\n    handleMoveEnd: function handleMoveEnd(_ref) {\n      var newIndex = _ref.newIndex,\n          oldIndex = _ref.oldIndex;\n      console.log(\"index\", newIndex, oldIndex);\n    },\n    handleWidgetColAdd: function handleWidgetColAdd($event, element) {\n      var newIndex = $event.newIndex;\n      var oldIndex = $event.oldIndex;\n      var item = $event.item;\n\n      if (item.innerText == \"二维码\") {\n        this.$message.error(\"子表不允许存在二维码\");\n        element.list.splice(newIndex, 1);\n        return false;\n      }\n\n      if (item.innerText == \"里程碑\") {\n        this.$message.error(\"子表不允许存在里程碑\");\n        element.list.splice(newIndex, 1);\n        return false;\n      }\n\n      if (item.innerText == \"高德地图\") {\n        this.$message.error(\"子表不允许存在高德地图\");\n        element.list.splice(newIndex, 1);\n        return false;\n      }\n\n      if (item.innerText == \"相关流程\") {\n        this.$message.error(\"子表不允许存在相关流程\");\n        element.list.splice(newIndex, 1);\n        return false;\n      }\n\n      if (!controlsApi.handleLayoutComponents(this)) {\n        return;\n      }\n\n      if (!element.options.boSubEntity) {\n        this.$message.error(\"请先绑定子表\");\n        return false;\n      } // 防止布局元素的嵌套拖拽\n\n\n      if (item.isLayout) {\n        element.list.list.splice(newIndex, 1);\n        return false;\n      }\n\n      this.selectWidget = element.list[newIndex];\n      this.selectWidget.parentNodeType = \"hot\";\n      this.selectWidget.boSubEntity = element.options.boSubEntity;\n    },\n    handleWidgetDelete: function handleWidgetDelete(index) {\n      var _this = this;\n\n      if (this.data.list.length - 1 === index) {\n        if (index === 0) {\n          this.selectWidget = {\n            options: {\n              validateType: \"\"\n            }\n          };\n        } else {\n          this.selectWidget = this.data.list[index - 1];\n        }\n      } else {\n        this.selectWidget = this.data.list[index + 1];\n      }\n\n      this.$nextTick(function () {\n        _this.data.list.splice(index, 1);\n      });\n    },\n    beforeRemoveRowMe: function beforeRemoveRowMe(changes, source) {\n      // 数据改变时触发此方法\n      this.hotSettings.dataList.splice(changes, source);\n    },\n    // 添加行\n    afterCreateRowMe: function afterCreateRowMe(changes) {\n      this.hotSettings.dataList.splice(changes, 0, {\n        region: '',\n        destination: '',\n        firstWeight: '',\n        firstWeightPrice: '',\n        riseWeight: '',\n        riseWeightPrice: ''\n      });\n    },\n    // 新增行时，动态改变值\n    afterChangeMe: function afterChangeMe(changes) {\n      var _this2 = this;\n\n      if (changes) {\n        changes.forEach(function (_ref2) {\n          var _ref3 = _slicedToArray(_ref2, 4),\n              row = _ref3[0],\n              prop = _ref3[1],\n              oldValue = _ref3[2],\n              newValue = _ref3[3];\n\n          console.log(oldValue);\n\n          try {\n            _this2.hotSettings.dataList[row][prop] = newValue;\n          } catch (error) {}\n        });\n      }\n    },\n    // 查看-excel不可编辑\n    excalEdit: function excalEdit() {\n      this.hotSettings.columns.forEach(function (par) {\n        par.readOnly = true;\n      });\n    }\n  },\n  watch: {\n    select: function select(val) {\n      this.selectWidget = val;\n    },\n    selectWidget: {\n      handler: function handler(val, oldVal) {\n        this.$emit(\"update:select\", val);\n      },\n      deep: true\n    },\n    'selectWidget.options.colHeadersRelations': {\n      handler: function handler(val, oldVal) {\n        if (val && val.length > 0) {\n          if (oldVal !== val) {\n            var headers = [];\n            var columns = [];\n            var dataList = [[]];\n\n            if (val.length > 0) {\n              for (var index = 0; index < val.length; index++) {\n                var relation = val[index];\n                headers.push(relation.desc);\n                columns.push(relation.column);\n              }\n            }\n\n            this.hotSettings.colHeaders = headers;\n            this.hotSettings.columns = columns;\n            this.hotSettings.data = dataList;\n\n            if (this.selectWidget.options.initFillbackData && this.selectWidget.options.initFillbackData.length > 0) {\n              this.hotSettings.data = JSON.parse(JSON.stringify(this.selectWidget.options.initFillbackData));\n            }\n          }\n        }\n      },\n      deep: true\n    },\n    'selectWidget.options.initFillbackData': {\n      handler: function handler(val, oldVal) {\n        if (oldVal !== val) {\n          if (val) {\n            this.hotSettings.data = JSON.parse(JSON.stringify(val));\n          } else {\n            this.hotSettings.data = [[]];\n          }\n        }\n      },\n      deep: true\n    }\n  }\n};",null]}