{"remainingRequest":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xypm-web\\src\\components\\AtTable.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xypm-web\\src\\components\\AtTable.vue","mtime":1723543352497},{"path":"D:\\jenkins\\workspace\\xypm-web\\babel.config.js","mtime":1675214572901},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xypm-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.search\";\nimport _defineProperty from \"D:/jenkins/workspace/xypm-web/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"core-js/modules/es6.number.constructor\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport Sortable from 'sortablejs';\nexport default {\n  name: 'AtTable',\n  props: {\n    data: Array,\n    showHeader: {\n      type: Boolean,\n      default: true\n    },\n    defaultQuerys: {\n      type: Array,\n      default: function _default() {\n        return [];\n      }\n    },\n    pageResult: {\n      type: Object,\n      default: function _default() {\n        return {\n          page: 1,\n          pageSize: 50,\n          total: 0\n        };\n      }\n    },\n    paginationJustify: {\n      type: String,\n      default: 'end',\n      validator: function validator(value) {\n        return ['start', 'end', 'center', 'space-around', 'space-between'].indexOf(value) !== -1;\n      }\n    },\n    pageSizes: {\n      type: Array,\n      default: function _default() {\n        return [10, 20, 50, 100, 200, 300, 500];\n      }\n    },\n    pagerCount: {\n      type: Number,\n      default: 11\n    },\n    defaultSorter: {\n      type: Array,\n      default: function _default() {\n        return [];\n      }\n    },\n    dialogTitle: {\n      type: String,\n      default: '添加'\n    },\n    dialogVisible: {\n      type: Boolean,\n      default: false\n    },\n    dialogTop: {\n      type: String,\n      default: '8vh'\n    },\n    isDrag: {\n      type: Boolean,\n      default: false\n    },\n    isShowFooter: {\n      type: Boolean,\n      default: true\n    },\n    dialogWidth: {\n      type: String,\n      default: '1000px'\n    },\n    stripe: {\n      type: Boolean,\n      default: true\n    },\n    defaultExpandAll: {\n      type: Boolean,\n      default: false\n    },\n    isShowPagination: {\n      type: Boolean,\n      default: true\n    },\n    expandRowKeys: {\n      type: Array,\n      default: function _default() {\n        return [];\n      }\n    },\n    isSortLoad: {\n      type: Boolean,\n      default: true\n    },\n    exportText: {\n      type: String,\n      default: ''\n    },\n    justShowSearch: {\n      //为true时只显示高级搜索中的查询条件\n      type: Boolean,\n      default: false\n    },\n    showAdvancedSearchText: {\n      type: String,\n      default: '基础搜索'\n    },\n    hideAdvancedSearchText: {\n      type: String,\n      default: '高级搜索'\n    },\n    elAuth: {\n      type: String,\n      default: ''\n    },\n    cellClassNameFn: {\n      type: Function,\n      default: function _default() {}\n    }\n  },\n  data: function data() {\n    return {\n      filters: {},\n      querys: [],\n      sorter: null,\n      tableMaxHeight: 400,\n      pagination: _objectSpread({}, this.pageResult),\n      loading: false,\n      selection: [],\n      showAdvancedSearch: false,\n      hasSearchPanel: false\n    };\n  },\n  watch: {\n    justShowSearch: {\n      handler: function handler(val) {\n        if (val) {\n          this.showAdvancedSearch = true;\n        }\n      },\n      immediate: true\n    }\n  },\n  mounted: function mounted() {\n    var _this2 = this;\n    this.calcTableHeight();\n    this.$root.$on('resize', function () {\n      _this2.calcTableHeight(500);\n    });\n    this.$bus.$on('reHeight', function () {\n      _this2.calcTableHeight();\n    });\n    this.load();\n    if (this.isDrag) {\n      this.rowDrop();\n    }\n    // 判断是否有高级搜索面板\n    this.hasSearchPanel = !!this.$scopedSlots.search;\n    this.$watch('pageResult', function (n, o) {\n      if (n !== o) {\n        _this2.pagination = _objectSpread({}, n);\n      }\n    });\n    this.$watch('showAdvancedSearch', function (n, o) {\n      if (n !== o) {\n        // if (n) {\n        //   this.quickSearchWord = null;\n        // }\n        // 显示或收起搜索面板时，重新计算表格高度\n        _this2.calcTableHeight(500);\n      }\n    });\n  },\n  computed: {\n    calDefaultQuerys: function calDefaultQuerys() {\n      var calQuerys = [];\n      var query = {\n        group: 'defaultQueryGroup',\n        operation: 'EQUAL',\n        relation: 'AND'\n      };\n      this.defaultQuerys.forEach(function (c) {\n        calQuerys.push(_objectSpread(_objectSpread({}, query), c));\n      });\n      return calQuerys;\n    }\n  },\n  created: function created() {\n    var _this3 = this;\n    this.$on('advance-search', function (data) {\n      return _this3.advanceSearch(data);\n    });\n  },\n  methods: {\n    handleScroll: function handleScroll() {\n      console.dir(this.$refs.table.$el.children[2].scrollTop);\n    },\n    //返回一个boolean类型，是否显示列表按钮\n    getMethodauth: function getMethodauth(elAuth) {\n      if (!elAuth) return true;\n      var allMethod = window.sessionStorage.allMethod;\n      var methodAuth = window.sessionStorage.methodAuth;\n      var allMethodArray = allMethod && allMethod.split(',');\n      var methodAuthArray = methodAuth && methodAuth.split(',');\n      // 无权限则隐藏按钮\n      if (methodAuthArray && methodAuthArray.includes(elAuth) && allMethodArray && allMethodArray.includes(elAuth)) {\n        return true;\n      } else {\n        return false;\n      }\n    },\n    // 高级搜索展开或关闭时，清空表单数据\n    showAdvanced: function showAdvanced() {\n      this.showAdvancedSearch = !this.showAdvancedSearch;\n      this.$parent.searchForm = {};\n      this.$parent.$refs.projectInfo.getProjectData();\n    },\n    handleClearFilter: function handleClearFilter() {\n      this.$refs.table.clearFilter();\n      this.filters = {};\n      this.clearQueryByGroupName('quick');\n      this.clearQueryByGroupName('advance');\n      this.load();\n    },\n    setClassName: function setClassName(_ref) {\n      var row = _ref.row,\n        index = _ref.index;\n      // 通过自己的逻辑返回一个class或者空\n      if (row.hasChildren) {\n        return JSON.parse(row.hasChildren) ? '' : 'expand';\n      }\n    },\n    tableRowClassName: function tableRowClassName(_ref2) {\n      var row = _ref2.row,\n        rowIndex = _ref2.rowIndex;\n      if (rowIndex === 0) {\n        return 'tableStyle';\n      }\n      return '';\n    },\n    handleRowClick: function handleRowClick(row, column, event) {\n      this.$emit('row-click', row, column, event);\n    },\n    handleRowDBClick: function handleRowDBClick(row, column, event) {\n      this.$emit('row-dblclick', row, column, event);\n    },\n    handleExpandChange: function handleExpandChange(row) {\n      this.$emit('expand-change', row);\n    },\n    handleTableSelect: function handleTableSelect(selection, row) {\n      this.selection = selection;\n      if (row) {\n        this.$emit('select', selection, row);\n      } else {\n        this.$emit('select-all', selection);\n      }\n    },\n    handleSortChange: function handleSortChange(column) {\n      if (!column.order) {\n        this.sorter = null;\n      } else {\n        this.sorter = [{\n          property: column.prop,\n          direction: column.order == 'ascending' ? 'ASC' : 'DESC'\n        }];\n      }\n      if (isSortLoad) {\n        this.load();\n      }\n      this.$emit('sort-change', column);\n    },\n    handleFilterChange: function handleFilterChange(m) {\n      var _this4 = this;\n      this.filters = _objectSpread(_objectSpread({}, this.filters), m);\n      Object.keys(this.filters).forEach(function (k) {\n        if (!_this4.filters[k] || _this4.filters[k].length == 0) {\n          delete _this4.filters[k];\n        }\n      });\n      this.load();\n      this.$emit('filter-change', m);\n    },\n    handleDialogCancel: function handleDialogCancel() {\n      this.$emit('handleDialogCancel');\n      /* 发送一个事件用于侧边栏按钮监听是否显示 */\n      this.$bus.$emit('handleAsideBtn', true);\n    },\n    handleDialogClose: function handleDialogClose(done) {\n      this.$emit('handleDialogClose', done);\n      /* 发送一个事件用于侧边栏按钮监听是否显示 */\n      this.$bus.$emit('handleAsideBtn', true);\n    },\n    handleDialogExport: function handleDialogExport() {\n      this.$emit('handleDialogExport');\n      /* 发送一个事件用于侧边栏按钮监听是否显示 */\n      this.$bus.$emit('handleAsideBtn', true);\n    },\n    handleDialogSubmit: function handleDialogSubmit(formName) {\n      this.$emit('handleDialogSubmit', formName);\n    },\n    handleDialogOpen: function handleDialogOpen() {\n      this.$emit('handleDialogOpen');\n      /* 发送一个事件用于侧边栏按钮监听是否显示 */\n      this.$bus.$emit('handleAsideBtn', false);\n    },\n    advanceSearch: function advanceSearch(data) {\n      var _this5 = this;\n      if (this.loading || !this.showAdvancedSearch) {\n        return;\n      }\n      this.clearQueryByGroupName('quick');\n      this.clearQueryByGroupName('advance');\n      data && data.forEach(function (d) {\n        var query = {\n          property: d.prop,\n          value: d.value,\n          group: 'advance',\n          relation: d.relation,\n          operation: d.operation\n        };\n        query.value && _this5.querys.push(query);\n      });\n      this.load();\n    },\n    load: function load(doNotResetPage) {\n      var _this6 = this;\n      this.loading = true;\n      // 默认重置页码为第一页\n      if (!doNotResetPage) {\n        this.pagination.page = 1;\n      }\n      var param = {\n        pageBean: this.pagination\n      };\n      if (this.sorter && this.sorter.length > 0) {\n        param.sorter = this.sorter;\n      }\n      // 处理排序字段\n      if (this.defaultSorter.length > 0) {\n        if (!param.sorter) {\n          param.sorter = [];\n        }\n        this.defaultSorter.forEach(function (item) {\n          param.sorter.remove(item);\n        });\n        param.sorter = param.sorter.concat(this.defaultSorter);\n      }\n      // 处理过滤条件\n      this.handleFilters();\n      if (this.querys && this.querys.length > 0) {\n        param.querys = this.querys;\n      }\n\n      // 处理查询条件\n      if (this.calDefaultQuerys.length > 0) {\n        if (!param.querys) {\n          param.querys = [];\n        }\n        this.calDefaultQuerys.forEach(function (item) {\n          param.querys.remove(item);\n        });\n        param.querys = param.querys.concat(this.calDefaultQuerys);\n      }\n      var me = this;\n      // 防止外部没有回调，设置10秒后自动取消加载中的状态\n      var finalTickCB = setTimeout(function () {\n        me.loading = false;\n      }, 10000);\n      if (this.nopagination) {\n        param.pageBean = {};\n      }\n      this.$emit('load', _objectSpread({}, param), function () {\n        // 外部已经回调的情况下，取消倒计时\n        clearTimeout(finalTickCB);\n        me.loading = false;\n        _this6.isReset = false;\n        setTimeout(function () {\n          me.$refs.quickSearch && me.$refs.quickSearch.$children[0].$el.children[0].focus();\n        });\n      });\n    },\n    // 通过分组名称清除对应查询条件\n    clearQueryByGroupName: function clearQueryByGroupName(groupName) {\n      var _this7 = this;\n      // 待删除的查询条件\n      var toDelete = [];\n      this.querys && this.querys.forEach(function (query) {\n        if (query.group == groupName) {\n          toDelete.push(query);\n        }\n      });\n      toDelete.forEach(function (d) {\n        _this7.querys.remove(d);\n      });\n    },\n    handleFilters: function handleFilters() {\n      var _this8 = this;\n      this.clearQueryByGroupName('filter');\n      // 将过滤条件添加查询参数数组中\n      if (this.filters && Object.keys(this.filters).length > 0) {\n        Object.keys(this.filters).forEach(function (k) {\n          var filter = _this8.filters[k];\n          var query = {\n            property: k,\n            value: filter[0],\n            group: 'filter',\n            relation: 'AND'\n          };\n          if (filter.length == 1) {\n            query.operation = 'EQUAL';\n            _this8.querys.push(query);\n          } else if (filter.length > 1) {\n            query.operation = 'IN';\n            query.value = filter;\n            _this8.querys.push(query);\n          }\n        });\n      }\n    },\n    handleSizeChange: function handleSizeChange(pageSize) {\n      this.pagination = _objectSpread(_objectSpread({}, this.pagination), {}, {\n        pageSize: pageSize\n      });\n      this.load();\n    },\n    handleCurrentChange: function handleCurrentChange(page) {\n      this.pagination = _objectSpread(_objectSpread({}, this.pagination), {}, {\n        page: page\n      });\n      // 翻页时不重置页码\n      this.load(true);\n    },\n    //行拖拽\n    rowDrop: function rowDrop() {\n      var tbody = document.getElementById('AtTable').querySelector('.el-table__body-wrapper tbody');\n      var _this = this;\n      Sortable.create(tbody, {\n        onEnd: function onEnd(_ref3) {\n          var newIndex = _ref3.newIndex,\n            oldIndex = _ref3.oldIndex;\n          var currRow = _this.data.splice(oldIndex, 1)[0];\n          _this.data.splice(newIndex, 0, currRow);\n        }\n      });\n    },\n    doLayout: function doLayout() {\n      this.$refs.table.doLayout();\n    },\n    calcTableHeight: function calcTableHeight(delay) {\n      var _this9 = this;\n      // 动态计算表格的高度，自适应当前容器\n      setTimeout(function () {\n        if (!_this9.$refs.tablePanel) {\n          return;\n        }\n        var tablePanelHeight;\n        var tabPanHeight = _this9.$parent.$parent.$el.clientHeight;\n        if (tabPanHeight) {\n          tablePanelHeight = tabPanHeight;\n        } else {\n          tablePanelHeight = _this9.$refs.tablePanel.$el.clientHeight;\n        }\n        var toolbarPanelHeight = _this9.$refs.toolbarPanel.clientHeight || 0;\n        var searchPanelHeight = _this9.$refs.searchPanel && _this9.$refs.searchPanel.clientHeight ? _this9.$refs.searchPanel.clientHeight : 0;\n        var paginationPanelHeight = _this9.$refs.paginationPanel && _this9.$refs.paginationPanel.clientHeight || 0;\n        _this9.tableMaxHeight = tablePanelHeight - (searchPanelHeight > 0 ? 45 : 5) - toolbarPanelHeight - searchPanelHeight - paginationPanelHeight;\n      }, delay || 0);\n    }\n  }\n};",null]}