{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\AtTable.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\AtTable.vue","mtime":1667327528887},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\babel.config.js","mtime":1667327525434},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\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/web.dom.iterable\";\nimport _defineProperty from \"D:/jenkins/workspace/xq-web-fvue/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"core-js/modules/es6.number.constructor\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\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 },\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 };\n },\n mounted: function mounted() {\n var _this2 = this;\n\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\n if (this.isDrag) {\n this.rowDrop();\n }\n\n this.$watch('pageResult', function (n, o) {\n if (n !== o) {\n _this2.pagination = _objectSpread({}, n);\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\n this.$on('advance-search', function (data) {\n return _this3.advanceSearch(data);\n });\n },\n methods: {\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\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\n if (rowIndex === 0) {\n return 'tableStyle';\n }\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\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\n if (isSortLoad) {\n this.load();\n }\n\n this.$emit('sort-change', column);\n },\n handleFilterChange: function handleFilterChange(m) {\n var _this4 = this;\n\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\n this.$bus.$emit('handleAsideBtn', true);\n },\n handleDialogClose: function handleDialogClose(done) {\n this.$emit('handleDialogClose', done);\n /* 发送一个事件用于侧边栏按钮监听是否显示 */\n\n this.$bus.$emit('handleAsideBtn', true);\n },\n handleDialogExport: function handleDialogExport() {\n this.$emit('handleDialogExport');\n /* 发送一个事件用于侧边栏按钮监听是否显示 */\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\n this.$bus.$emit('handleAsideBtn', false);\n },\n advanceSearch: function advanceSearch(data) {\n var _this5 = this;\n\n if (this.loading || !this.showAdvancedSearch) {\n return;\n }\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\n this.loading = true; // 默认重置页码为第一页\n\n if (!doNotResetPage) {\n this.pagination.page = 1;\n }\n\n var param = {\n pageBean: this.pagination\n };\n\n if (this.sorter && this.sorter.length > 0) {\n param.sorter = this.sorter;\n } // 处理排序字段\n\n\n if (this.defaultSorter.length > 0) {\n if (!param.sorter) {\n param.sorter = [];\n }\n\n this.defaultSorter.forEach(function (item) {\n param.sorter.remove(item);\n });\n param.sorter = param.sorter.concat(this.defaultSorter);\n } // 处理过滤条件\n\n\n this.handleFilters();\n\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\n this.calDefaultQuerys.forEach(function (item) {\n param.querys.remove(item);\n });\n param.querys = param.querys.concat(this.calDefaultQuerys);\n }\n\n var me = this; // 防止外部没有回调,设置10秒后自动取消加载中的状态\n\n var finalTickCB = setTimeout(function () {\n me.loading = false;\n }, 10000);\n\n if (this.nopagination) {\n param.pageBean = {};\n }\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 // 待删除的查询条件\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\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\n if (filter.length == 1) {\n query.operation = 'EQUAL';\n\n _this8.querys.push(query);\n } else if (filter.length > 1) {\n query.operation = 'IN';\n query.value = filter;\n\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\n var _this = this;\n\n Sortable.create(tbody, {\n onEnd: function onEnd(_ref3) {\n var newIndex = _ref3.newIndex,\n oldIndex = _ref3.oldIndex;\n\n var currRow = _this.data.splice(oldIndex, 1)[0];\n\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 // 动态计算表格的高度,自适应当前容器\n setTimeout(function () {\n if (!_this9.$refs.tablePanel) {\n return;\n }\n\n var tablePanelHeight;\n var tabPanHeight = _this9.$parent.$parent.$el.clientHeight;\n\n if (tabPanHeight) {\n tablePanelHeight = tabPanHeight;\n } else {\n tablePanelHeight = _this9.$refs.tablePanel.$el.clientHeight;\n }\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 clearSelection: function clearSelection() {\n this.$refs.table.clearSelection();\n },\n toggleRowSelection: function toggleRowSelection(row, selected) {\n this.$refs.table.toggleRowSelection(row, selected);\n },\n getSelection: function getSelection() {\n return this.$refs.table.selection;\n }\n }\n};",null]}