{"remainingRequest":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\artfess-module\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\artfess-module\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\artfess-module\\src\\components\\common\\Selector.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\artfess-module\\src\\components\\common\\Selector.vue","mtime":1675232038652},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\artfess-module\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\artfess-module\\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/es6.regexp.split\";\nimport \"core-js/modules/web.dom.iterable\";\nimport _toConsumableArray from \"D:/jenkins/workspace/artfess-module/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"D:/jenkins/workspace/artfess-module/node_modules/@babel/runtime/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { 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//\n//\n//\n//\n//\n//\nimport utils from \"@/utils.js\";\nimport { setTimeout } from \"timers\";\nimport Locale from \"@/mixins/locale\";\nexport default {\n name: \"ht-selector\",\n mixins: [Locale],\n props: {\n searchPlaceholder: {\n type: String,\n default: \"\"\n },\n selectLabel: {\n type: String,\n default: \"name\"\n },\n tableColumns: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n value: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n data: Array,\n single: {\n type: Boolean,\n default: false\n },\n //服务端分页\n pagination: {\n type: Object,\n default: function _default() {\n return {\n page: 1,\n pageSize: 10,\n total: 31214,\n showTotal: true\n };\n }\n },\n quickSearchProps: {\n type: [String, Array],\n required: true\n },\n //唯一标识字段\n primaryField: {\n type: String,\n default: \"\"\n }\n },\n data: function data() {\n return {\n sizeType: \"small\",\n loading: false,\n searchWord: null,\n //客户端分页\n paging: {\n page: 1,\n pageSize: 10\n },\n selectedId: null,\n selects: [],\n defaultCheckedKeys: []\n };\n },\n computed: {\n treeProps: function treeProps() {\n return {\n label: this.selectLabel\n };\n }\n },\n watch: {\n data: function data(newVal) {\n if (newVal && newVal.length > 0) {\n this.syncCheckedStatus();\n }\n }\n },\n created: function created() {\n // 组件初始化时,复制一份分页信息\n this.oldPaging = _objectSpread({}, this.paging);\n\n if (this.$smallScreenDialog) {\n this.sizeType = \"mini\";\n }\n },\n methods: {\n hideTip: function hideTip(tipField, val) {\n if (!tipField || !val) {\n return true;\n }\n\n return false;\n },\n // 同步已选行到已选数据中去\n syncSelection2selects: function syncSelection2selects() {\n // 复制一份当前已选数据\n var tmpSelects = _toConsumableArray(this.selects); // 先将当前页中的数据从已选数据中移除\n\n\n this.data.forEach(function (m) {\n tmpSelects.remove(m);\n }); // 将剩余的已选数据与当前页选中的数据合并\n\n tmpSelects = [].concat(_toConsumableArray(tmpSelects), _toConsumableArray(this.$refs.selectorTable.selection)); // 数组去重\n\n this.selects = tmpSelects.unique(this.primaryField ? this.primaryField : \"id\");\n this.defaultCheckedKeys = this.defaultCheckedKeys.concat(this.$refs.selectorTable.selection.extractByKey(\"id\"));\n },\n // 同步已选数据在Table中的选中状态\n syncCheckedStatus: function syncCheckedStatus() {\n var _this = this;\n\n this.selectedId = null;\n\n if (this.single) {\n this.selects.length === 1 && (this.selectedId = this.selects[0].id);\n } else {\n if (!this.$refs.selectorTable || !this.$refs.selectorTable.selection) {\n throw \"未获取到数据列表,无法选择数据。\";\n }\n\n this.$refs.selectorTable.clearSelection();\n this.selects.length > 0 && setTimeout(function () {\n _this.selects.forEach(function (m) {\n if (_this.data.some(function (n) {\n return utils.objectEquals(m, n);\n })) {\n _this.$refs.selectorTable.toggleRowSelection(m);\n }\n });\n });\n }\n },\n onShow: function onShow(initSelectors) {\n // 每一次显示选择器时,重置当前选中数据为外部的v-model对象\n if (!initSelectors) {\n this.selects = _toConsumableArray(this.value);\n } else {\n this.selects = initSelectors;\n }\n\n this.defaultCheckedKeys = this.selects.extractByKey(\"id\");\n this.reset();\n },\n onHide: function onHide(sure) {\n // 在隐藏选择器时,如果点击的是确定按钮,则将当前选中数据更新到外部的v-model对象上\n if (sure) {\n this.$emit(\"input\", this.selects);\n }\n },\n getQueryFilter: function getQueryFilter(isPageChange) {\n var _this2 = this;\n\n var queryFilter = {\n querys: [],\n pageBean: this.paging\n };\n\n if (this.quickSearchProps && this.quickSearchProps.constructor == String && this.searchWord) {\n //有搜索条件并且不是切换分页的时候,重置分页\n if (!isPageChange) {\n queryFilter.pageBean.page = 1;\n }\n\n var props = this.quickSearchProps.split(\",\");\n props.forEach(function (item) {\n var query = {\n property: item,\n value: _this2.searchWord,\n group: \"main\",\n operation: \"LIKE\",\n relation: \"OR\"\n };\n queryFilter.querys.push(query);\n });\n }\n\n return queryFilter;\n },\n // 加载数据,根据当前的搜索关键词及分页条件\n load: function load(isPageChange) {\n var _this3 = this;\n\n this.loading = true;\n this.$emit(\"load\", this.getQueryFilter(isPageChange), function () {\n _this3.loading = false;\n });\n },\n // 搜索事件\n search: function search() {\n if (this.loading) {\n return;\n }\n\n this.paging = this.oldPaging;\n this.load();\n },\n // 重置事件\n reset: function reset() {\n this.$emit(\"reset\");\n this.searchWord = null;\n this.paging = this.oldPaging;\n this.load();\n },\n clear: function clear() {\n this.reset();\n },\n handleRowClick: function handleRowClick(row, column, event) {\n var _this4 = this;\n\n if (this.single) {\n this.selects = [row];\n this.selectedId = row.id;\n this.defaultCheckedKeys = [];\n this.defaultCheckedKeys.push(this.selectedId);\n } else {\n if (!this.$refs.selectorTable || !this.$refs.selectorTable.selection) {\n throw \"未获取到数据列表,无法选择数据。\";\n }\n\n var _tag = true;\n this.$refs.selectorTable.selection.forEach(function (m) {\n if (m === row) {\n // 已选中该行时,取消选中状态\n _this4.$refs.selectorTable.toggleRowSelection(row, false);\n\n _tag = false;\n }\n }); // 非取消选中情况下,将当前行设置为选中状态\n\n _tag && this.$refs.selectorTable.toggleRowSelection(row);\n this.syncSelection2selects();\n }\n },\n handleTableSelect: function handleTableSelect() {\n this.syncSelection2selects();\n },\n handleSizeChange: function handleSizeChange(size) {\n this.paging.pageSize = size;\n this.load();\n },\n handleCurrentChange: function handleCurrentChange(currentPage) {\n this.paging.page = currentPage;\n this.load(true);\n },\n move: function move(direct) {\n var _this5 = this;\n\n var selectedAry = this.$refs.selectTree.getCheckedNodes(); // 将调整顺序之后的数组赋值给Tree\n\n this.selects = utils.arrayMove(this.selects, selectedAry, direct);\n setTimeout(function () {\n // 调整顺序后恢复勾选状态\n _this5.$refs.selectTree.setCheckedNodes(selectedAry);\n });\n },\n removeSelected: function removeSelected() {\n var _this6 = this;\n\n var selectedAry = this.$refs.selectTree.getCheckedNodes();\n selectedAry.forEach(function (item) {\n _this6.selects.remove(item);\n });\n this.syncCheckedStatus();\n },\n clearAllSelects: function clearAllSelects() {\n this.selects = [];\n this.syncCheckedStatus();\n }\n }\n};",null]}