look-ui 1.1.24 → 1.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/look-ui.common.js +1266 -93
- package/dist/look-ui.css +1 -1
- package/dist/look-ui.umd.js +1270 -97
- package/dist/look-ui.umd.min.js +7 -1
- package/package.json +3 -2
- package/src/App.vue +76 -19
package/dist/look-ui.common.js
CHANGED
|
@@ -7700,6 +7700,36 @@ $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
|
|
|
7700
7700
|
});
|
|
7701
7701
|
|
|
7702
7702
|
|
|
7703
|
+
/***/ }),
|
|
7704
|
+
|
|
7705
|
+
/***/ 6699:
|
|
7706
|
+
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
|
7707
|
+
|
|
7708
|
+
"use strict";
|
|
7709
|
+
|
|
7710
|
+
var $ = __webpack_require__(2109);
|
|
7711
|
+
var $includes = (__webpack_require__(1318).includes);
|
|
7712
|
+
var fails = __webpack_require__(7293);
|
|
7713
|
+
var addToUnscopables = __webpack_require__(1223);
|
|
7714
|
+
|
|
7715
|
+
// FF99+ bug
|
|
7716
|
+
var BROKEN_ON_SPARSE = fails(function () {
|
|
7717
|
+
// eslint-disable-next-line es/no-array-prototype-includes -- detection
|
|
7718
|
+
return !Array(1).includes();
|
|
7719
|
+
});
|
|
7720
|
+
|
|
7721
|
+
// `Array.prototype.includes` method
|
|
7722
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
7723
|
+
$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
7724
|
+
includes: function includes(el /* , fromIndex = 0 */) {
|
|
7725
|
+
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
7726
|
+
}
|
|
7727
|
+
});
|
|
7728
|
+
|
|
7729
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
7730
|
+
addToUnscopables('includes');
|
|
7731
|
+
|
|
7732
|
+
|
|
7703
7733
|
/***/ }),
|
|
7704
7734
|
|
|
7705
7735
|
/***/ 2772:
|
|
@@ -10201,6 +10231,35 @@ $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGE
|
|
|
10201
10231
|
});
|
|
10202
10232
|
|
|
10203
10233
|
|
|
10234
|
+
/***/ }),
|
|
10235
|
+
|
|
10236
|
+
/***/ 2023:
|
|
10237
|
+
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
|
10238
|
+
|
|
10239
|
+
"use strict";
|
|
10240
|
+
|
|
10241
|
+
var $ = __webpack_require__(2109);
|
|
10242
|
+
var uncurryThis = __webpack_require__(1702);
|
|
10243
|
+
var notARegExp = __webpack_require__(3929);
|
|
10244
|
+
var requireObjectCoercible = __webpack_require__(4488);
|
|
10245
|
+
var toString = __webpack_require__(1340);
|
|
10246
|
+
var correctIsRegExpLogic = __webpack_require__(4964);
|
|
10247
|
+
|
|
10248
|
+
var stringIndexOf = uncurryThis(''.indexOf);
|
|
10249
|
+
|
|
10250
|
+
// `String.prototype.includes` method
|
|
10251
|
+
// https://tc39.es/ecma262/#sec-string.prototype.includes
|
|
10252
|
+
$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
|
10253
|
+
includes: function includes(searchString /* , position = 0 */) {
|
|
10254
|
+
return !!~stringIndexOf(
|
|
10255
|
+
toString(requireObjectCoercible(this)),
|
|
10256
|
+
toString(notARegExp(searchString)),
|
|
10257
|
+
arguments.length > 1 ? arguments[1] : undefined
|
|
10258
|
+
);
|
|
10259
|
+
}
|
|
10260
|
+
});
|
|
10261
|
+
|
|
10262
|
+
|
|
10204
10263
|
/***/ }),
|
|
10205
10264
|
|
|
10206
10265
|
/***/ 8783:
|
|
@@ -15850,6 +15909,1082 @@ module.exports = function getSideChannel() {
|
|
|
15850
15909
|
|
|
15851
15910
|
/***/ }),
|
|
15852
15911
|
|
|
15912
|
+
/***/ 5137:
|
|
15913
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
15914
|
+
|
|
15915
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = (__webpack_require__(4614)["default"]);
|
|
15916
|
+
__webpack_require__(1550);
|
|
15917
|
+
__webpack_require__(7941);
|
|
15918
|
+
__webpack_require__(2526);
|
|
15919
|
+
__webpack_require__(7327);
|
|
15920
|
+
__webpack_require__(1539);
|
|
15921
|
+
__webpack_require__(5003);
|
|
15922
|
+
__webpack_require__(7658);
|
|
15923
|
+
__webpack_require__(9554);
|
|
15924
|
+
__webpack_require__(4747);
|
|
15925
|
+
__webpack_require__(9337);
|
|
15926
|
+
__webpack_require__(3321);
|
|
15927
|
+
__webpack_require__(9070);
|
|
15928
|
+
__webpack_require__(1703);
|
|
15929
|
+
__webpack_require__(6647);
|
|
15930
|
+
__webpack_require__(9753);
|
|
15931
|
+
__webpack_require__(1817);
|
|
15932
|
+
__webpack_require__(2165);
|
|
15933
|
+
__webpack_require__(6992);
|
|
15934
|
+
__webpack_require__(8783);
|
|
15935
|
+
__webpack_require__(3948);
|
|
15936
|
+
__webpack_require__(1038);
|
|
15937
|
+
__webpack_require__(7042);
|
|
15938
|
+
__webpack_require__(3710);
|
|
15939
|
+
__webpack_require__(9714);
|
|
15940
|
+
__webpack_require__(8309);
|
|
15941
|
+
__webpack_require__(4916);
|
|
15942
|
+
__webpack_require__(7601);
|
|
15943
|
+
__webpack_require__(1532);
|
|
15944
|
+
__webpack_require__(8011);
|
|
15945
|
+
__webpack_require__(6699);
|
|
15946
|
+
__webpack_require__(2023);
|
|
15947
|
+
__webpack_require__(5827);
|
|
15948
|
+
__webpack_require__(9653);
|
|
15949
|
+
__webpack_require__(2564);
|
|
15950
|
+
__webpack_require__(1249);
|
|
15951
|
+
__webpack_require__(2222);
|
|
15952
|
+
__webpack_require__(9601);
|
|
15953
|
+
/*!
|
|
15954
|
+
* vue-virtual-scroll-list v2.3.4
|
|
15955
|
+
* open source under the MIT license
|
|
15956
|
+
* https://github.com/tangbc/vue-virtual-scroll-list#readme
|
|
15957
|
+
*/
|
|
15958
|
+
|
|
15959
|
+
(function (global, factory) {
|
|
15960
|
+
( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? module.exports = factory(__webpack_require__(3797)) : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3797)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
15961
|
+
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
15962
|
+
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
15963
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (0);
|
|
15964
|
+
})(this, function (Vue) {
|
|
15965
|
+
'use strict';
|
|
15966
|
+
|
|
15967
|
+
Vue = Vue && Object.prototype.hasOwnProperty.call(Vue, 'default') ? Vue['default'] : Vue;
|
|
15968
|
+
function ownKeys(object, enumerableOnly) {
|
|
15969
|
+
var keys = Object.keys(object);
|
|
15970
|
+
if (Object.getOwnPropertySymbols) {
|
|
15971
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
15972
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
15973
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
15974
|
+
})), keys.push.apply(keys, symbols);
|
|
15975
|
+
}
|
|
15976
|
+
return keys;
|
|
15977
|
+
}
|
|
15978
|
+
function _objectSpread2(target) {
|
|
15979
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15980
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
15981
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
15982
|
+
_defineProperty(target, key, source[key]);
|
|
15983
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
15984
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
15985
|
+
});
|
|
15986
|
+
}
|
|
15987
|
+
return target;
|
|
15988
|
+
}
|
|
15989
|
+
function _classCallCheck(instance, Constructor) {
|
|
15990
|
+
if (!(instance instanceof Constructor)) {
|
|
15991
|
+
throw new TypeError("Cannot call a class as a function");
|
|
15992
|
+
}
|
|
15993
|
+
}
|
|
15994
|
+
function _defineProperties(target, props) {
|
|
15995
|
+
for (var i = 0; i < props.length; i++) {
|
|
15996
|
+
var descriptor = props[i];
|
|
15997
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
15998
|
+
descriptor.configurable = true;
|
|
15999
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
16000
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
16001
|
+
}
|
|
16002
|
+
}
|
|
16003
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
16004
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
16005
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
16006
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
16007
|
+
writable: false
|
|
16008
|
+
});
|
|
16009
|
+
return Constructor;
|
|
16010
|
+
}
|
|
16011
|
+
function _defineProperty(obj, key, value) {
|
|
16012
|
+
if (key in obj) {
|
|
16013
|
+
Object.defineProperty(obj, key, {
|
|
16014
|
+
value: value,
|
|
16015
|
+
enumerable: true,
|
|
16016
|
+
configurable: true,
|
|
16017
|
+
writable: true
|
|
16018
|
+
});
|
|
16019
|
+
} else {
|
|
16020
|
+
obj[key] = value;
|
|
16021
|
+
}
|
|
16022
|
+
return obj;
|
|
16023
|
+
}
|
|
16024
|
+
function _toConsumableArray(arr) {
|
|
16025
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
16026
|
+
}
|
|
16027
|
+
function _arrayWithoutHoles(arr) {
|
|
16028
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
16029
|
+
}
|
|
16030
|
+
function _iterableToArray(iter) {
|
|
16031
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
16032
|
+
}
|
|
16033
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
16034
|
+
if (!o) return;
|
|
16035
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
16036
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
16037
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
16038
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
16039
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
16040
|
+
}
|
|
16041
|
+
function _arrayLikeToArray(arr, len) {
|
|
16042
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
16043
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
16044
|
+
return arr2;
|
|
16045
|
+
}
|
|
16046
|
+
function _nonIterableSpread() {
|
|
16047
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
16048
|
+
}
|
|
16049
|
+
|
|
16050
|
+
/**
|
|
16051
|
+
* virtual list core calculating center
|
|
16052
|
+
*/
|
|
16053
|
+
|
|
16054
|
+
var DIRECTION_TYPE = {
|
|
16055
|
+
FRONT: 'FRONT',
|
|
16056
|
+
// scroll up or left
|
|
16057
|
+
BEHIND: 'BEHIND' // scroll down or right
|
|
16058
|
+
};
|
|
16059
|
+
|
|
16060
|
+
var CALC_TYPE = {
|
|
16061
|
+
INIT: 'INIT',
|
|
16062
|
+
FIXED: 'FIXED',
|
|
16063
|
+
DYNAMIC: 'DYNAMIC'
|
|
16064
|
+
};
|
|
16065
|
+
var LEADING_BUFFER = 0;
|
|
16066
|
+
var Virtual = /*#__PURE__*/function () {
|
|
16067
|
+
function Virtual(param, callUpdate) {
|
|
16068
|
+
_classCallCheck(this, Virtual);
|
|
16069
|
+
this.init(param, callUpdate);
|
|
16070
|
+
}
|
|
16071
|
+
_createClass(Virtual, [{
|
|
16072
|
+
key: "init",
|
|
16073
|
+
value: function init(param, callUpdate) {
|
|
16074
|
+
// param data
|
|
16075
|
+
this.param = param;
|
|
16076
|
+
this.callUpdate = callUpdate;
|
|
16077
|
+
|
|
16078
|
+
// size data
|
|
16079
|
+
this.sizes = new Map();
|
|
16080
|
+
this.firstRangeTotalSize = 0;
|
|
16081
|
+
this.firstRangeAverageSize = 0;
|
|
16082
|
+
this.fixedSizeValue = 0;
|
|
16083
|
+
this.calcType = CALC_TYPE.INIT;
|
|
16084
|
+
|
|
16085
|
+
// scroll data
|
|
16086
|
+
this.offset = 0;
|
|
16087
|
+
this.direction = '';
|
|
16088
|
+
|
|
16089
|
+
// range data
|
|
16090
|
+
this.range = Object.create(null);
|
|
16091
|
+
if (param) {
|
|
16092
|
+
this.checkRange(0, param.keeps - 1);
|
|
16093
|
+
}
|
|
16094
|
+
|
|
16095
|
+
// benchmark test data
|
|
16096
|
+
// this.__bsearchCalls = 0
|
|
16097
|
+
// this.__getIndexOffsetCalls = 0
|
|
16098
|
+
}
|
|
16099
|
+
}, {
|
|
16100
|
+
key: "destroy",
|
|
16101
|
+
value: function destroy() {
|
|
16102
|
+
this.init(null, null);
|
|
16103
|
+
}
|
|
16104
|
+
|
|
16105
|
+
// return current render range
|
|
16106
|
+
}, {
|
|
16107
|
+
key: "getRange",
|
|
16108
|
+
value: function getRange() {
|
|
16109
|
+
var range = Object.create(null);
|
|
16110
|
+
range.start = this.range.start;
|
|
16111
|
+
range.end = this.range.end;
|
|
16112
|
+
range.padFront = this.range.padFront;
|
|
16113
|
+
range.padBehind = this.range.padBehind;
|
|
16114
|
+
return range;
|
|
16115
|
+
}
|
|
16116
|
+
}, {
|
|
16117
|
+
key: "isBehind",
|
|
16118
|
+
value: function isBehind() {
|
|
16119
|
+
return this.direction === DIRECTION_TYPE.BEHIND;
|
|
16120
|
+
}
|
|
16121
|
+
}, {
|
|
16122
|
+
key: "isFront",
|
|
16123
|
+
value: function isFront() {
|
|
16124
|
+
return this.direction === DIRECTION_TYPE.FRONT;
|
|
16125
|
+
}
|
|
16126
|
+
|
|
16127
|
+
// return start index offset
|
|
16128
|
+
}, {
|
|
16129
|
+
key: "getOffset",
|
|
16130
|
+
value: function getOffset(start) {
|
|
16131
|
+
return (start < 1 ? 0 : this.getIndexOffset(start)) + this.param.slotHeaderSize;
|
|
16132
|
+
}
|
|
16133
|
+
}, {
|
|
16134
|
+
key: "updateParam",
|
|
16135
|
+
value: function updateParam(key, value) {
|
|
16136
|
+
var _this = this;
|
|
16137
|
+
if (this.param && key in this.param) {
|
|
16138
|
+
// if uniqueIds change, find out deleted id and remove from size map
|
|
16139
|
+
if (key === 'uniqueIds') {
|
|
16140
|
+
this.sizes.forEach(function (v, key) {
|
|
16141
|
+
if (!value.includes(key)) {
|
|
16142
|
+
_this.sizes["delete"](key);
|
|
16143
|
+
}
|
|
16144
|
+
});
|
|
16145
|
+
}
|
|
16146
|
+
this.param[key] = value;
|
|
16147
|
+
}
|
|
16148
|
+
}
|
|
16149
|
+
|
|
16150
|
+
// save each size map by id
|
|
16151
|
+
}, {
|
|
16152
|
+
key: "saveSize",
|
|
16153
|
+
value: function saveSize(id, size) {
|
|
16154
|
+
this.sizes.set(id, size);
|
|
16155
|
+
|
|
16156
|
+
// we assume size type is fixed at the beginning and remember first size value
|
|
16157
|
+
// if there is no size value different from this at next comming saving
|
|
16158
|
+
// we think it's a fixed size list, otherwise is dynamic size list
|
|
16159
|
+
if (this.calcType === CALC_TYPE.INIT) {
|
|
16160
|
+
this.fixedSizeValue = size;
|
|
16161
|
+
this.calcType = CALC_TYPE.FIXED;
|
|
16162
|
+
} else if (this.calcType === CALC_TYPE.FIXED && this.fixedSizeValue !== size) {
|
|
16163
|
+
this.calcType = CALC_TYPE.DYNAMIC;
|
|
16164
|
+
// it's no use at all
|
|
16165
|
+
delete this.fixedSizeValue;
|
|
16166
|
+
}
|
|
16167
|
+
|
|
16168
|
+
// calculate the average size only in the first range
|
|
16169
|
+
if (this.calcType !== CALC_TYPE.FIXED && typeof this.firstRangeTotalSize !== 'undefined') {
|
|
16170
|
+
if (this.sizes.size < Math.min(this.param.keeps, this.param.uniqueIds.length)) {
|
|
16171
|
+
this.firstRangeTotalSize = _toConsumableArray(this.sizes.values()).reduce(function (acc, val) {
|
|
16172
|
+
return acc + val;
|
|
16173
|
+
}, 0);
|
|
16174
|
+
this.firstRangeAverageSize = Math.round(this.firstRangeTotalSize / this.sizes.size);
|
|
16175
|
+
} else {
|
|
16176
|
+
// it's done using
|
|
16177
|
+
delete this.firstRangeTotalSize;
|
|
16178
|
+
}
|
|
16179
|
+
}
|
|
16180
|
+
}
|
|
16181
|
+
|
|
16182
|
+
// in some special situation (e.g. length change) we need to update in a row
|
|
16183
|
+
// try goiong to render next range by a leading buffer according to current direction
|
|
16184
|
+
}, {
|
|
16185
|
+
key: "handleDataSourcesChange",
|
|
16186
|
+
value: function handleDataSourcesChange() {
|
|
16187
|
+
var start = this.range.start;
|
|
16188
|
+
if (this.isFront()) {
|
|
16189
|
+
start = start - LEADING_BUFFER;
|
|
16190
|
+
} else if (this.isBehind()) {
|
|
16191
|
+
start = start + LEADING_BUFFER;
|
|
16192
|
+
}
|
|
16193
|
+
start = Math.max(start, 0);
|
|
16194
|
+
this.updateRange(this.range.start, this.getEndByStart(start));
|
|
16195
|
+
}
|
|
16196
|
+
|
|
16197
|
+
// when slot size change, we also need force update
|
|
16198
|
+
}, {
|
|
16199
|
+
key: "handleSlotSizeChange",
|
|
16200
|
+
value: function handleSlotSizeChange() {
|
|
16201
|
+
this.handleDataSourcesChange();
|
|
16202
|
+
}
|
|
16203
|
+
|
|
16204
|
+
// calculating range on scroll
|
|
16205
|
+
}, {
|
|
16206
|
+
key: "handleScroll",
|
|
16207
|
+
value: function handleScroll(offset) {
|
|
16208
|
+
this.direction = offset < this.offset || offset === 0 ? DIRECTION_TYPE.FRONT : DIRECTION_TYPE.BEHIND;
|
|
16209
|
+
this.offset = offset;
|
|
16210
|
+
if (!this.param) {
|
|
16211
|
+
return;
|
|
16212
|
+
}
|
|
16213
|
+
if (this.direction === DIRECTION_TYPE.FRONT) {
|
|
16214
|
+
this.handleFront();
|
|
16215
|
+
} else if (this.direction === DIRECTION_TYPE.BEHIND) {
|
|
16216
|
+
this.handleBehind();
|
|
16217
|
+
}
|
|
16218
|
+
}
|
|
16219
|
+
|
|
16220
|
+
// ----------- public method end -----------
|
|
16221
|
+
}, {
|
|
16222
|
+
key: "handleFront",
|
|
16223
|
+
value: function handleFront() {
|
|
16224
|
+
var overs = this.getScrollOvers();
|
|
16225
|
+
// should not change range if start doesn't exceed overs
|
|
16226
|
+
if (overs > this.range.start) {
|
|
16227
|
+
return;
|
|
16228
|
+
}
|
|
16229
|
+
|
|
16230
|
+
// move up start by a buffer length, and make sure its safety
|
|
16231
|
+
var start = Math.max(overs - this.param.buffer, 0);
|
|
16232
|
+
this.checkRange(start, this.getEndByStart(start));
|
|
16233
|
+
}
|
|
16234
|
+
}, {
|
|
16235
|
+
key: "handleBehind",
|
|
16236
|
+
value: function handleBehind() {
|
|
16237
|
+
var overs = this.getScrollOvers();
|
|
16238
|
+
// range should not change if scroll overs within buffer
|
|
16239
|
+
if (overs < this.range.start + this.param.buffer) {
|
|
16240
|
+
return;
|
|
16241
|
+
}
|
|
16242
|
+
this.checkRange(overs, this.getEndByStart(overs));
|
|
16243
|
+
}
|
|
16244
|
+
|
|
16245
|
+
// return the pass overs according to current scroll offset
|
|
16246
|
+
}, {
|
|
16247
|
+
key: "getScrollOvers",
|
|
16248
|
+
value: function getScrollOvers() {
|
|
16249
|
+
// if slot header exist, we need subtract its size
|
|
16250
|
+
var offset = this.offset - this.param.slotHeaderSize;
|
|
16251
|
+
if (offset <= 0) {
|
|
16252
|
+
return 0;
|
|
16253
|
+
}
|
|
16254
|
+
|
|
16255
|
+
// if is fixed type, that can be easily
|
|
16256
|
+
if (this.isFixedType()) {
|
|
16257
|
+
return Math.floor(offset / this.fixedSizeValue);
|
|
16258
|
+
}
|
|
16259
|
+
var low = 0;
|
|
16260
|
+
var middle = 0;
|
|
16261
|
+
var middleOffset = 0;
|
|
16262
|
+
var high = this.param.uniqueIds.length;
|
|
16263
|
+
while (low <= high) {
|
|
16264
|
+
// this.__bsearchCalls++
|
|
16265
|
+
middle = low + Math.floor((high - low) / 2);
|
|
16266
|
+
middleOffset = this.getIndexOffset(middle);
|
|
16267
|
+
if (middleOffset === offset) {
|
|
16268
|
+
return middle;
|
|
16269
|
+
} else if (middleOffset < offset) {
|
|
16270
|
+
low = middle + 1;
|
|
16271
|
+
} else if (middleOffset > offset) {
|
|
16272
|
+
high = middle - 1;
|
|
16273
|
+
}
|
|
16274
|
+
}
|
|
16275
|
+
return low > 0 ? --low : 0;
|
|
16276
|
+
}
|
|
16277
|
+
|
|
16278
|
+
// return a scroll offset from given index, can efficiency be improved more here?
|
|
16279
|
+
// although the call frequency is very high, its only a superposition of numbers
|
|
16280
|
+
}, {
|
|
16281
|
+
key: "getIndexOffset",
|
|
16282
|
+
value: function getIndexOffset(givenIndex) {
|
|
16283
|
+
if (!givenIndex) {
|
|
16284
|
+
return 0;
|
|
16285
|
+
}
|
|
16286
|
+
var offset = 0;
|
|
16287
|
+
var indexSize = 0;
|
|
16288
|
+
for (var index = 0; index < givenIndex; index++) {
|
|
16289
|
+
// this.__getIndexOffsetCalls++
|
|
16290
|
+
indexSize = this.sizes.get(this.param.uniqueIds[index]);
|
|
16291
|
+
offset = offset + (typeof indexSize === 'number' ? indexSize : this.getEstimateSize());
|
|
16292
|
+
}
|
|
16293
|
+
return offset;
|
|
16294
|
+
}
|
|
16295
|
+
|
|
16296
|
+
// is fixed size type
|
|
16297
|
+
}, {
|
|
16298
|
+
key: "isFixedType",
|
|
16299
|
+
value: function isFixedType() {
|
|
16300
|
+
return this.calcType === CALC_TYPE.FIXED;
|
|
16301
|
+
}
|
|
16302
|
+
|
|
16303
|
+
// return the real last index
|
|
16304
|
+
}, {
|
|
16305
|
+
key: "getLastIndex",
|
|
16306
|
+
value: function getLastIndex() {
|
|
16307
|
+
return this.param.uniqueIds.length - 1;
|
|
16308
|
+
}
|
|
16309
|
+
|
|
16310
|
+
// in some conditions range is broke, we need correct it
|
|
16311
|
+
// and then decide whether need update to next range
|
|
16312
|
+
}, {
|
|
16313
|
+
key: "checkRange",
|
|
16314
|
+
value: function checkRange(start, end) {
|
|
16315
|
+
var keeps = this.param.keeps;
|
|
16316
|
+
var total = this.param.uniqueIds.length;
|
|
16317
|
+
|
|
16318
|
+
// datas less than keeps, render all
|
|
16319
|
+
if (total <= keeps) {
|
|
16320
|
+
start = 0;
|
|
16321
|
+
end = this.getLastIndex();
|
|
16322
|
+
} else if (end - start < keeps - 1) {
|
|
16323
|
+
// if range length is less than keeps, corrent it base on end
|
|
16324
|
+
start = end - keeps + 1;
|
|
16325
|
+
}
|
|
16326
|
+
if (this.range.start !== start) {
|
|
16327
|
+
this.updateRange(start, end);
|
|
16328
|
+
}
|
|
16329
|
+
}
|
|
16330
|
+
|
|
16331
|
+
// setting to a new range and rerender
|
|
16332
|
+
}, {
|
|
16333
|
+
key: "updateRange",
|
|
16334
|
+
value: function updateRange(start, end) {
|
|
16335
|
+
this.range.start = start;
|
|
16336
|
+
this.range.end = end;
|
|
16337
|
+
this.range.padFront = this.getPadFront();
|
|
16338
|
+
this.range.padBehind = this.getPadBehind();
|
|
16339
|
+
this.callUpdate(this.getRange());
|
|
16340
|
+
}
|
|
16341
|
+
|
|
16342
|
+
// return end base on start
|
|
16343
|
+
}, {
|
|
16344
|
+
key: "getEndByStart",
|
|
16345
|
+
value: function getEndByStart(start) {
|
|
16346
|
+
var theoryEnd = start + this.param.keeps - 1;
|
|
16347
|
+
var truelyEnd = Math.min(theoryEnd, this.getLastIndex());
|
|
16348
|
+
return truelyEnd;
|
|
16349
|
+
}
|
|
16350
|
+
|
|
16351
|
+
// return total front offset
|
|
16352
|
+
}, {
|
|
16353
|
+
key: "getPadFront",
|
|
16354
|
+
value: function getPadFront() {
|
|
16355
|
+
if (this.isFixedType()) {
|
|
16356
|
+
return this.fixedSizeValue * this.range.start;
|
|
16357
|
+
} else {
|
|
16358
|
+
return this.getIndexOffset(this.range.start);
|
|
16359
|
+
}
|
|
16360
|
+
}
|
|
16361
|
+
|
|
16362
|
+
// return total behind offset
|
|
16363
|
+
}, {
|
|
16364
|
+
key: "getPadBehind",
|
|
16365
|
+
value: function getPadBehind() {
|
|
16366
|
+
var end = this.range.end;
|
|
16367
|
+
var lastIndex = this.getLastIndex();
|
|
16368
|
+
if (this.isFixedType()) {
|
|
16369
|
+
return (lastIndex - end) * this.fixedSizeValue;
|
|
16370
|
+
}
|
|
16371
|
+
return (lastIndex - end) * this.getEstimateSize();
|
|
16372
|
+
}
|
|
16373
|
+
|
|
16374
|
+
// get the item estimate size
|
|
16375
|
+
}, {
|
|
16376
|
+
key: "getEstimateSize",
|
|
16377
|
+
value: function getEstimateSize() {
|
|
16378
|
+
return this.isFixedType() ? this.fixedSizeValue : this.firstRangeAverageSize || this.param.estimateSize;
|
|
16379
|
+
}
|
|
16380
|
+
}]);
|
|
16381
|
+
return Virtual;
|
|
16382
|
+
}();
|
|
16383
|
+
|
|
16384
|
+
/**
|
|
16385
|
+
* props declaration for default, item and slot component
|
|
16386
|
+
*/
|
|
16387
|
+
|
|
16388
|
+
var VirtualProps = {
|
|
16389
|
+
dataKey: {
|
|
16390
|
+
type: [String, Function],
|
|
16391
|
+
required: true
|
|
16392
|
+
},
|
|
16393
|
+
dataSources: {
|
|
16394
|
+
type: Array,
|
|
16395
|
+
required: true
|
|
16396
|
+
},
|
|
16397
|
+
dataComponent: {
|
|
16398
|
+
type: [Object, Function],
|
|
16399
|
+
required: true
|
|
16400
|
+
},
|
|
16401
|
+
keeps: {
|
|
16402
|
+
type: Number,
|
|
16403
|
+
"default": 30
|
|
16404
|
+
},
|
|
16405
|
+
extraProps: {
|
|
16406
|
+
type: Object
|
|
16407
|
+
},
|
|
16408
|
+
estimateSize: {
|
|
16409
|
+
type: Number,
|
|
16410
|
+
"default": 50
|
|
16411
|
+
},
|
|
16412
|
+
direction: {
|
|
16413
|
+
type: String,
|
|
16414
|
+
"default": 'vertical' // the other value is horizontal
|
|
16415
|
+
},
|
|
16416
|
+
|
|
16417
|
+
start: {
|
|
16418
|
+
type: Number,
|
|
16419
|
+
"default": 0
|
|
16420
|
+
},
|
|
16421
|
+
offset: {
|
|
16422
|
+
type: Number,
|
|
16423
|
+
"default": 0
|
|
16424
|
+
},
|
|
16425
|
+
topThreshold: {
|
|
16426
|
+
type: Number,
|
|
16427
|
+
"default": 0
|
|
16428
|
+
},
|
|
16429
|
+
bottomThreshold: {
|
|
16430
|
+
type: Number,
|
|
16431
|
+
"default": 0
|
|
16432
|
+
},
|
|
16433
|
+
pageMode: {
|
|
16434
|
+
type: Boolean,
|
|
16435
|
+
"default": false
|
|
16436
|
+
},
|
|
16437
|
+
rootTag: {
|
|
16438
|
+
type: String,
|
|
16439
|
+
"default": 'div'
|
|
16440
|
+
},
|
|
16441
|
+
wrapTag: {
|
|
16442
|
+
type: String,
|
|
16443
|
+
"default": 'div'
|
|
16444
|
+
},
|
|
16445
|
+
wrapClass: {
|
|
16446
|
+
type: String,
|
|
16447
|
+
"default": ''
|
|
16448
|
+
},
|
|
16449
|
+
wrapStyle: {
|
|
16450
|
+
type: Object
|
|
16451
|
+
},
|
|
16452
|
+
itemTag: {
|
|
16453
|
+
type: String,
|
|
16454
|
+
"default": 'div'
|
|
16455
|
+
},
|
|
16456
|
+
itemClass: {
|
|
16457
|
+
type: String,
|
|
16458
|
+
"default": ''
|
|
16459
|
+
},
|
|
16460
|
+
itemClassAdd: {
|
|
16461
|
+
type: Function
|
|
16462
|
+
},
|
|
16463
|
+
itemStyle: {
|
|
16464
|
+
type: Object
|
|
16465
|
+
},
|
|
16466
|
+
headerTag: {
|
|
16467
|
+
type: String,
|
|
16468
|
+
"default": 'div'
|
|
16469
|
+
},
|
|
16470
|
+
headerClass: {
|
|
16471
|
+
type: String,
|
|
16472
|
+
"default": ''
|
|
16473
|
+
},
|
|
16474
|
+
headerStyle: {
|
|
16475
|
+
type: Object
|
|
16476
|
+
},
|
|
16477
|
+
footerTag: {
|
|
16478
|
+
type: String,
|
|
16479
|
+
"default": 'div'
|
|
16480
|
+
},
|
|
16481
|
+
footerClass: {
|
|
16482
|
+
type: String,
|
|
16483
|
+
"default": ''
|
|
16484
|
+
},
|
|
16485
|
+
footerStyle: {
|
|
16486
|
+
type: Object
|
|
16487
|
+
},
|
|
16488
|
+
itemScopedSlots: {
|
|
16489
|
+
type: Object
|
|
16490
|
+
}
|
|
16491
|
+
};
|
|
16492
|
+
var ItemProps = {
|
|
16493
|
+
index: {
|
|
16494
|
+
type: Number
|
|
16495
|
+
},
|
|
16496
|
+
event: {
|
|
16497
|
+
type: String
|
|
16498
|
+
},
|
|
16499
|
+
tag: {
|
|
16500
|
+
type: String
|
|
16501
|
+
},
|
|
16502
|
+
horizontal: {
|
|
16503
|
+
type: Boolean
|
|
16504
|
+
},
|
|
16505
|
+
source: {
|
|
16506
|
+
type: Object
|
|
16507
|
+
},
|
|
16508
|
+
component: {
|
|
16509
|
+
type: [Object, Function]
|
|
16510
|
+
},
|
|
16511
|
+
slotComponent: {
|
|
16512
|
+
type: Function
|
|
16513
|
+
},
|
|
16514
|
+
uniqueKey: {
|
|
16515
|
+
type: [String, Number]
|
|
16516
|
+
},
|
|
16517
|
+
extraProps: {
|
|
16518
|
+
type: Object
|
|
16519
|
+
},
|
|
16520
|
+
scopedSlots: {
|
|
16521
|
+
type: Object
|
|
16522
|
+
}
|
|
16523
|
+
};
|
|
16524
|
+
var SlotProps = {
|
|
16525
|
+
event: {
|
|
16526
|
+
type: String
|
|
16527
|
+
},
|
|
16528
|
+
uniqueKey: {
|
|
16529
|
+
type: String
|
|
16530
|
+
},
|
|
16531
|
+
tag: {
|
|
16532
|
+
type: String
|
|
16533
|
+
},
|
|
16534
|
+
horizontal: {
|
|
16535
|
+
type: Boolean
|
|
16536
|
+
}
|
|
16537
|
+
};
|
|
16538
|
+
var Wrapper = {
|
|
16539
|
+
created: function created() {
|
|
16540
|
+
this.shapeKey = this.horizontal ? 'offsetWidth' : 'offsetHeight';
|
|
16541
|
+
},
|
|
16542
|
+
mounted: function mounted() {
|
|
16543
|
+
var _this = this;
|
|
16544
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
16545
|
+
this.resizeObserver = new ResizeObserver(function () {
|
|
16546
|
+
_this.dispatchSizeChange();
|
|
16547
|
+
});
|
|
16548
|
+
this.resizeObserver.observe(this.$el);
|
|
16549
|
+
}
|
|
16550
|
+
},
|
|
16551
|
+
// since componet will be reused, so disptach when updated
|
|
16552
|
+
updated: function updated() {
|
|
16553
|
+
// this.dispatchSizeChange()
|
|
16554
|
+
this.resizeObserver.observe(this.$el);
|
|
16555
|
+
},
|
|
16556
|
+
beforeDestroy: function beforeDestroy() {
|
|
16557
|
+
if (this.resizeObserver) {
|
|
16558
|
+
this.resizeObserver.disconnect();
|
|
16559
|
+
this.resizeObserver = null;
|
|
16560
|
+
}
|
|
16561
|
+
},
|
|
16562
|
+
methods: {
|
|
16563
|
+
getCurrentSize: function getCurrentSize() {
|
|
16564
|
+
return this.$el ? this.$el[this.shapeKey] : 0;
|
|
16565
|
+
},
|
|
16566
|
+
// tell parent current size identify by unqiue key
|
|
16567
|
+
dispatchSizeChange: function dispatchSizeChange() {
|
|
16568
|
+
this.$parent.$emit(this.event, this.uniqueKey, this.getCurrentSize(), this.hasInitial);
|
|
16569
|
+
}
|
|
16570
|
+
}
|
|
16571
|
+
};
|
|
16572
|
+
|
|
16573
|
+
// wrapping for item
|
|
16574
|
+
var Item = Vue.component('virtual-list-item', {
|
|
16575
|
+
mixins: [Wrapper],
|
|
16576
|
+
props: ItemProps,
|
|
16577
|
+
render: function render(h) {
|
|
16578
|
+
var tag = this.tag,
|
|
16579
|
+
component = this.component,
|
|
16580
|
+
_this$extraProps = this.extraProps,
|
|
16581
|
+
extraProps = _this$extraProps === void 0 ? {} : _this$extraProps,
|
|
16582
|
+
index = this.index,
|
|
16583
|
+
source = this.source,
|
|
16584
|
+
_this$scopedSlots = this.scopedSlots,
|
|
16585
|
+
scopedSlots = _this$scopedSlots === void 0 ? {} : _this$scopedSlots,
|
|
16586
|
+
uniqueKey = this.uniqueKey,
|
|
16587
|
+
slotComponent = this.slotComponent;
|
|
16588
|
+
var props = _objectSpread2(_objectSpread2({}, extraProps), {}, {
|
|
16589
|
+
source: source,
|
|
16590
|
+
index: index
|
|
16591
|
+
});
|
|
16592
|
+
return h(tag, {
|
|
16593
|
+
key: uniqueKey,
|
|
16594
|
+
attrs: {
|
|
16595
|
+
role: 'listitem'
|
|
16596
|
+
}
|
|
16597
|
+
}, [slotComponent ? slotComponent({
|
|
16598
|
+
item: source,
|
|
16599
|
+
index: index,
|
|
16600
|
+
scope: props
|
|
16601
|
+
}) : h(component, {
|
|
16602
|
+
props: props,
|
|
16603
|
+
scopedSlots: scopedSlots
|
|
16604
|
+
})]);
|
|
16605
|
+
}
|
|
16606
|
+
});
|
|
16607
|
+
|
|
16608
|
+
// wrapping for slot
|
|
16609
|
+
var Slot = Vue.component('virtual-list-slot', {
|
|
16610
|
+
mixins: [Wrapper],
|
|
16611
|
+
props: SlotProps,
|
|
16612
|
+
render: function render(h) {
|
|
16613
|
+
var tag = this.tag,
|
|
16614
|
+
uniqueKey = this.uniqueKey;
|
|
16615
|
+
return h(tag, {
|
|
16616
|
+
key: uniqueKey,
|
|
16617
|
+
attrs: {
|
|
16618
|
+
role: uniqueKey
|
|
16619
|
+
}
|
|
16620
|
+
}, this.$slots["default"]);
|
|
16621
|
+
}
|
|
16622
|
+
});
|
|
16623
|
+
|
|
16624
|
+
/**
|
|
16625
|
+
* virtual list default component
|
|
16626
|
+
*/
|
|
16627
|
+
var EVENT_TYPE = {
|
|
16628
|
+
ITEM: 'item_resize',
|
|
16629
|
+
SLOT: 'slot_resize'
|
|
16630
|
+
};
|
|
16631
|
+
var SLOT_TYPE = {
|
|
16632
|
+
HEADER: 'thead',
|
|
16633
|
+
// string value also use for aria role attribute
|
|
16634
|
+
FOOTER: 'tfoot'
|
|
16635
|
+
};
|
|
16636
|
+
var VirtualList = Vue.component('virtual-list', {
|
|
16637
|
+
props: VirtualProps,
|
|
16638
|
+
data: function data() {
|
|
16639
|
+
return {
|
|
16640
|
+
range: null
|
|
16641
|
+
};
|
|
16642
|
+
},
|
|
16643
|
+
watch: {
|
|
16644
|
+
'dataSources.length': function dataSourcesLength() {
|
|
16645
|
+
this.virtual.updateParam('uniqueIds', this.getUniqueIdFromDataSources());
|
|
16646
|
+
this.virtual.handleDataSourcesChange();
|
|
16647
|
+
},
|
|
16648
|
+
keeps: function keeps(newValue) {
|
|
16649
|
+
this.virtual.updateParam('keeps', newValue);
|
|
16650
|
+
this.virtual.handleSlotSizeChange();
|
|
16651
|
+
},
|
|
16652
|
+
start: function start(newValue) {
|
|
16653
|
+
this.scrollToIndex(newValue);
|
|
16654
|
+
},
|
|
16655
|
+
offset: function offset(newValue) {
|
|
16656
|
+
this.scrollToOffset(newValue);
|
|
16657
|
+
}
|
|
16658
|
+
},
|
|
16659
|
+
created: function created() {
|
|
16660
|
+
this.isHorizontal = this.direction === 'horizontal';
|
|
16661
|
+
this.directionKey = this.isHorizontal ? 'scrollLeft' : 'scrollTop';
|
|
16662
|
+
this.installVirtual();
|
|
16663
|
+
|
|
16664
|
+
// listen item size change
|
|
16665
|
+
this.$on(EVENT_TYPE.ITEM, this.onItemResized);
|
|
16666
|
+
|
|
16667
|
+
// listen slot size change
|
|
16668
|
+
if (this.$slots.header || this.$slots.footer) {
|
|
16669
|
+
this.$on(EVENT_TYPE.SLOT, this.onSlotResized);
|
|
16670
|
+
}
|
|
16671
|
+
},
|
|
16672
|
+
activated: function activated() {
|
|
16673
|
+
// set back offset when awake from keep-alive
|
|
16674
|
+
this.scrollToOffset(this.virtual.offset);
|
|
16675
|
+
if (this.pageMode) {
|
|
16676
|
+
document.addEventListener('scroll', this.onScroll, {
|
|
16677
|
+
passive: false
|
|
16678
|
+
});
|
|
16679
|
+
}
|
|
16680
|
+
},
|
|
16681
|
+
deactivated: function deactivated() {
|
|
16682
|
+
if (this.pageMode) {
|
|
16683
|
+
document.removeEventListener('scroll', this.onScroll);
|
|
16684
|
+
}
|
|
16685
|
+
},
|
|
16686
|
+
mounted: function mounted() {
|
|
16687
|
+
// set position
|
|
16688
|
+
if (this.start) {
|
|
16689
|
+
this.scrollToIndex(this.start);
|
|
16690
|
+
} else if (this.offset) {
|
|
16691
|
+
this.scrollToOffset(this.offset);
|
|
16692
|
+
}
|
|
16693
|
+
|
|
16694
|
+
// in page mode we bind scroll event to document
|
|
16695
|
+
if (this.pageMode) {
|
|
16696
|
+
this.updatePageModeFront();
|
|
16697
|
+
document.addEventListener('scroll', this.onScroll, {
|
|
16698
|
+
passive: false
|
|
16699
|
+
});
|
|
16700
|
+
}
|
|
16701
|
+
},
|
|
16702
|
+
beforeDestroy: function beforeDestroy() {
|
|
16703
|
+
this.virtual.destroy();
|
|
16704
|
+
if (this.pageMode) {
|
|
16705
|
+
document.removeEventListener('scroll', this.onScroll);
|
|
16706
|
+
}
|
|
16707
|
+
},
|
|
16708
|
+
methods: {
|
|
16709
|
+
// get item size by id
|
|
16710
|
+
getSize: function getSize(id) {
|
|
16711
|
+
return this.virtual.sizes.get(id);
|
|
16712
|
+
},
|
|
16713
|
+
// get the total number of stored (rendered) items
|
|
16714
|
+
getSizes: function getSizes() {
|
|
16715
|
+
return this.virtual.sizes.size;
|
|
16716
|
+
},
|
|
16717
|
+
// return current scroll offset
|
|
16718
|
+
getOffset: function getOffset() {
|
|
16719
|
+
if (this.pageMode) {
|
|
16720
|
+
return document.documentElement[this.directionKey] || document.body[this.directionKey];
|
|
16721
|
+
} else {
|
|
16722
|
+
var root = this.$refs.root;
|
|
16723
|
+
return root ? Math.ceil(root[this.directionKey]) : 0;
|
|
16724
|
+
}
|
|
16725
|
+
},
|
|
16726
|
+
// return client viewport size
|
|
16727
|
+
getClientSize: function getClientSize() {
|
|
16728
|
+
var key = this.isHorizontal ? 'clientWidth' : 'clientHeight';
|
|
16729
|
+
if (this.pageMode) {
|
|
16730
|
+
return document.documentElement[key] || document.body[key];
|
|
16731
|
+
} else {
|
|
16732
|
+
var root = this.$refs.root;
|
|
16733
|
+
return root ? Math.ceil(root[key]) : 0;
|
|
16734
|
+
}
|
|
16735
|
+
},
|
|
16736
|
+
// return all scroll size
|
|
16737
|
+
getScrollSize: function getScrollSize() {
|
|
16738
|
+
var key = this.isHorizontal ? 'scrollWidth' : 'scrollHeight';
|
|
16739
|
+
if (this.pageMode) {
|
|
16740
|
+
return document.documentElement[key] || document.body[key];
|
|
16741
|
+
} else {
|
|
16742
|
+
var root = this.$refs.root;
|
|
16743
|
+
return root ? Math.ceil(root[key]) : 0;
|
|
16744
|
+
}
|
|
16745
|
+
},
|
|
16746
|
+
// set current scroll position to a expectant offset
|
|
16747
|
+
scrollToOffset: function scrollToOffset(offset) {
|
|
16748
|
+
if (this.pageMode) {
|
|
16749
|
+
document.body[this.directionKey] = offset;
|
|
16750
|
+
document.documentElement[this.directionKey] = offset;
|
|
16751
|
+
} else {
|
|
16752
|
+
var root = this.$refs.root;
|
|
16753
|
+
if (root) {
|
|
16754
|
+
root[this.directionKey] = offset;
|
|
16755
|
+
}
|
|
16756
|
+
}
|
|
16757
|
+
},
|
|
16758
|
+
// set current scroll position to a expectant index
|
|
16759
|
+
scrollToIndex: function scrollToIndex(index) {
|
|
16760
|
+
// scroll to bottom
|
|
16761
|
+
if (index >= this.dataSources.length - 1) {
|
|
16762
|
+
this.scrollToBottom();
|
|
16763
|
+
} else {
|
|
16764
|
+
var offset = this.virtual.getOffset(index);
|
|
16765
|
+
this.scrollToOffset(offset);
|
|
16766
|
+
}
|
|
16767
|
+
},
|
|
16768
|
+
// set current scroll position to bottom
|
|
16769
|
+
scrollToBottom: function scrollToBottom() {
|
|
16770
|
+
var _this = this;
|
|
16771
|
+
var shepherd = this.$refs.shepherd;
|
|
16772
|
+
if (shepherd) {
|
|
16773
|
+
var offset = shepherd[this.isHorizontal ? 'offsetLeft' : 'offsetTop'];
|
|
16774
|
+
this.scrollToOffset(offset);
|
|
16775
|
+
|
|
16776
|
+
// check if it's really scrolled to the bottom
|
|
16777
|
+
// maybe list doesn't render and calculate to last range
|
|
16778
|
+
// so we need retry in next event loop until it really at bottom
|
|
16779
|
+
setTimeout(function () {
|
|
16780
|
+
if (_this.getOffset() + _this.getClientSize() + 1 < _this.getScrollSize()) {
|
|
16781
|
+
_this.scrollToBottom();
|
|
16782
|
+
}
|
|
16783
|
+
}, 3);
|
|
16784
|
+
}
|
|
16785
|
+
},
|
|
16786
|
+
// when using page mode we need update slot header size manually
|
|
16787
|
+
// taking root offset relative to the browser as slot header size
|
|
16788
|
+
updatePageModeFront: function updatePageModeFront() {
|
|
16789
|
+
var root = this.$refs.root;
|
|
16790
|
+
if (root) {
|
|
16791
|
+
var rect = root.getBoundingClientRect();
|
|
16792
|
+
var defaultView = root.ownerDocument.defaultView;
|
|
16793
|
+
var offsetFront = this.isHorizontal ? rect.left + defaultView.pageXOffset : rect.top + defaultView.pageYOffset;
|
|
16794
|
+
this.virtual.updateParam('slotHeaderSize', offsetFront);
|
|
16795
|
+
}
|
|
16796
|
+
},
|
|
16797
|
+
// reset all state back to initial
|
|
16798
|
+
reset: function reset() {
|
|
16799
|
+
this.virtual.destroy();
|
|
16800
|
+
this.scrollToOffset(0);
|
|
16801
|
+
this.installVirtual();
|
|
16802
|
+
},
|
|
16803
|
+
// ----------- public method end -----------
|
|
16804
|
+
installVirtual: function installVirtual() {
|
|
16805
|
+
this.virtual = new Virtual({
|
|
16806
|
+
slotHeaderSize: 0,
|
|
16807
|
+
slotFooterSize: 0,
|
|
16808
|
+
keeps: this.keeps,
|
|
16809
|
+
estimateSize: this.estimateSize,
|
|
16810
|
+
buffer: Math.round(this.keeps / 3),
|
|
16811
|
+
// recommend for a third of keeps
|
|
16812
|
+
uniqueIds: this.getUniqueIdFromDataSources()
|
|
16813
|
+
}, this.onRangeChanged);
|
|
16814
|
+
|
|
16815
|
+
// sync initial range
|
|
16816
|
+
this.range = this.virtual.getRange();
|
|
16817
|
+
},
|
|
16818
|
+
getUniqueIdFromDataSources: function getUniqueIdFromDataSources() {
|
|
16819
|
+
var dataKey = this.dataKey;
|
|
16820
|
+
return this.dataSources.map(function (dataSource) {
|
|
16821
|
+
return typeof dataKey === 'function' ? dataKey(dataSource) : dataSource[dataKey];
|
|
16822
|
+
});
|
|
16823
|
+
},
|
|
16824
|
+
// event called when each item mounted or size changed
|
|
16825
|
+
onItemResized: function onItemResized(id, size) {
|
|
16826
|
+
this.virtual.saveSize(id, size);
|
|
16827
|
+
this.$emit('resized', id, size);
|
|
16828
|
+
},
|
|
16829
|
+
// event called when slot mounted or size changed
|
|
16830
|
+
onSlotResized: function onSlotResized(type, size, hasInit) {
|
|
16831
|
+
if (type === SLOT_TYPE.HEADER) {
|
|
16832
|
+
this.virtual.updateParam('slotHeaderSize', size);
|
|
16833
|
+
} else if (type === SLOT_TYPE.FOOTER) {
|
|
16834
|
+
this.virtual.updateParam('slotFooterSize', size);
|
|
16835
|
+
}
|
|
16836
|
+
if (hasInit) {
|
|
16837
|
+
this.virtual.handleSlotSizeChange();
|
|
16838
|
+
}
|
|
16839
|
+
},
|
|
16840
|
+
// here is the rerendering entry
|
|
16841
|
+
onRangeChanged: function onRangeChanged(range) {
|
|
16842
|
+
this.range = range;
|
|
16843
|
+
},
|
|
16844
|
+
onScroll: function onScroll(evt) {
|
|
16845
|
+
var offset = this.getOffset();
|
|
16846
|
+
var clientSize = this.getClientSize();
|
|
16847
|
+
var scrollSize = this.getScrollSize();
|
|
16848
|
+
|
|
16849
|
+
// iOS scroll-spring-back behavior will make direction mistake
|
|
16850
|
+
if (offset < 0 || offset + clientSize > scrollSize + 1 || !scrollSize) {
|
|
16851
|
+
return;
|
|
16852
|
+
}
|
|
16853
|
+
this.virtual.handleScroll(offset);
|
|
16854
|
+
this.emitEvent(offset, clientSize, scrollSize, evt);
|
|
16855
|
+
},
|
|
16856
|
+
// emit event in special position
|
|
16857
|
+
emitEvent: function emitEvent(offset, clientSize, scrollSize, evt) {
|
|
16858
|
+
this.$emit('scroll', evt, this.virtual.getRange());
|
|
16859
|
+
if (this.virtual.isFront() && !!this.dataSources.length && offset - this.topThreshold <= 0) {
|
|
16860
|
+
this.$emit('totop');
|
|
16861
|
+
} else if (this.virtual.isBehind() && offset + clientSize + this.bottomThreshold >= scrollSize) {
|
|
16862
|
+
this.$emit('tobottom');
|
|
16863
|
+
}
|
|
16864
|
+
},
|
|
16865
|
+
// get the real render slots based on range data
|
|
16866
|
+
// in-place patch strategy will try to reuse components as possible
|
|
16867
|
+
// so those components that are reused will not trigger lifecycle mounted
|
|
16868
|
+
getRenderSlots: function getRenderSlots(h) {
|
|
16869
|
+
var slots = [];
|
|
16870
|
+
var _this$range = this.range,
|
|
16871
|
+
start = _this$range.start,
|
|
16872
|
+
end = _this$range.end;
|
|
16873
|
+
var dataSources = this.dataSources,
|
|
16874
|
+
dataKey = this.dataKey,
|
|
16875
|
+
itemClass = this.itemClass,
|
|
16876
|
+
itemTag = this.itemTag,
|
|
16877
|
+
itemStyle = this.itemStyle,
|
|
16878
|
+
isHorizontal = this.isHorizontal,
|
|
16879
|
+
extraProps = this.extraProps,
|
|
16880
|
+
dataComponent = this.dataComponent,
|
|
16881
|
+
itemScopedSlots = this.itemScopedSlots;
|
|
16882
|
+
var slotComponent = this.$scopedSlots && this.$scopedSlots.item;
|
|
16883
|
+
for (var index = start; index <= end; index++) {
|
|
16884
|
+
var dataSource = dataSources[index];
|
|
16885
|
+
if (dataSource) {
|
|
16886
|
+
var uniqueKey = typeof dataKey === 'function' ? dataKey(dataSource) : dataSource[dataKey];
|
|
16887
|
+
if (typeof uniqueKey === 'string' || typeof uniqueKey === 'number') {
|
|
16888
|
+
slots.push(h(Item, {
|
|
16889
|
+
props: {
|
|
16890
|
+
index: index,
|
|
16891
|
+
tag: itemTag,
|
|
16892
|
+
event: EVENT_TYPE.ITEM,
|
|
16893
|
+
horizontal: isHorizontal,
|
|
16894
|
+
uniqueKey: uniqueKey,
|
|
16895
|
+
source: dataSource,
|
|
16896
|
+
extraProps: extraProps,
|
|
16897
|
+
component: dataComponent,
|
|
16898
|
+
slotComponent: slotComponent,
|
|
16899
|
+
scopedSlots: itemScopedSlots
|
|
16900
|
+
},
|
|
16901
|
+
style: itemStyle,
|
|
16902
|
+
"class": "".concat(itemClass).concat(this.itemClassAdd ? ' ' + this.itemClassAdd(index) : '')
|
|
16903
|
+
}));
|
|
16904
|
+
} else {
|
|
16905
|
+
console.warn("Cannot get the data-key '".concat(dataKey, "' from data-sources."));
|
|
16906
|
+
}
|
|
16907
|
+
} else {
|
|
16908
|
+
console.warn("Cannot get the index '".concat(index, "' from data-sources."));
|
|
16909
|
+
}
|
|
16910
|
+
}
|
|
16911
|
+
return slots;
|
|
16912
|
+
}
|
|
16913
|
+
},
|
|
16914
|
+
// render function, a closer-to-the-compiler alternative to templates
|
|
16915
|
+
// https://vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth
|
|
16916
|
+
render: function render(h) {
|
|
16917
|
+
var _this$$slots = this.$slots,
|
|
16918
|
+
header = _this$$slots.header,
|
|
16919
|
+
footer = _this$$slots.footer;
|
|
16920
|
+
var _this$range2 = this.range,
|
|
16921
|
+
padFront = _this$range2.padFront,
|
|
16922
|
+
padBehind = _this$range2.padBehind;
|
|
16923
|
+
var isHorizontal = this.isHorizontal,
|
|
16924
|
+
pageMode = this.pageMode,
|
|
16925
|
+
rootTag = this.rootTag,
|
|
16926
|
+
wrapTag = this.wrapTag,
|
|
16927
|
+
wrapClass = this.wrapClass,
|
|
16928
|
+
wrapStyle = this.wrapStyle,
|
|
16929
|
+
headerTag = this.headerTag,
|
|
16930
|
+
headerClass = this.headerClass,
|
|
16931
|
+
headerStyle = this.headerStyle,
|
|
16932
|
+
footerTag = this.footerTag,
|
|
16933
|
+
footerClass = this.footerClass,
|
|
16934
|
+
footerStyle = this.footerStyle;
|
|
16935
|
+
var paddingStyle = {
|
|
16936
|
+
padding: isHorizontal ? "0px ".concat(padBehind, "px 0px ").concat(padFront, "px") : "".concat(padFront, "px 0px ").concat(padBehind, "px")
|
|
16937
|
+
};
|
|
16938
|
+
var wrapperStyle = wrapStyle ? Object.assign({}, wrapStyle, paddingStyle) : paddingStyle;
|
|
16939
|
+
return h(rootTag, {
|
|
16940
|
+
ref: 'root',
|
|
16941
|
+
on: {
|
|
16942
|
+
'&scroll': !pageMode && this.onScroll
|
|
16943
|
+
}
|
|
16944
|
+
}, [
|
|
16945
|
+
// header slot
|
|
16946
|
+
header ? h(Slot, {
|
|
16947
|
+
"class": headerClass,
|
|
16948
|
+
style: headerStyle,
|
|
16949
|
+
props: {
|
|
16950
|
+
tag: headerTag,
|
|
16951
|
+
event: EVENT_TYPE.SLOT,
|
|
16952
|
+
uniqueKey: SLOT_TYPE.HEADER
|
|
16953
|
+
}
|
|
16954
|
+
}, header) : null,
|
|
16955
|
+
// main list
|
|
16956
|
+
h(wrapTag, {
|
|
16957
|
+
"class": wrapClass,
|
|
16958
|
+
attrs: {
|
|
16959
|
+
role: 'group'
|
|
16960
|
+
},
|
|
16961
|
+
style: wrapperStyle
|
|
16962
|
+
}, this.getRenderSlots(h)),
|
|
16963
|
+
// footer slot
|
|
16964
|
+
footer ? h(Slot, {
|
|
16965
|
+
"class": footerClass,
|
|
16966
|
+
style: footerStyle,
|
|
16967
|
+
props: {
|
|
16968
|
+
tag: footerTag,
|
|
16969
|
+
event: EVENT_TYPE.SLOT,
|
|
16970
|
+
uniqueKey: SLOT_TYPE.FOOTER
|
|
16971
|
+
}
|
|
16972
|
+
}, footer) : null,
|
|
16973
|
+
// an empty element use to scroll to bottom
|
|
16974
|
+
h('div', {
|
|
16975
|
+
ref: 'shepherd',
|
|
16976
|
+
style: {
|
|
16977
|
+
width: isHorizontal ? '0px' : '100%',
|
|
16978
|
+
height: isHorizontal ? '100%' : '0px'
|
|
16979
|
+
}
|
|
16980
|
+
})]);
|
|
16981
|
+
}
|
|
16982
|
+
});
|
|
16983
|
+
return VirtualList;
|
|
16984
|
+
});
|
|
16985
|
+
|
|
16986
|
+
/***/ }),
|
|
16987
|
+
|
|
15853
16988
|
/***/ 619:
|
|
15854
16989
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
15855
16990
|
|
|
@@ -15967,6 +17102,14 @@ module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAB/CAYAAAAQ
|
|
|
15967
17102
|
|
|
15968
17103
|
/***/ }),
|
|
15969
17104
|
|
|
17105
|
+
/***/ 3797:
|
|
17106
|
+
/***/ ((module) => {
|
|
17107
|
+
|
|
17108
|
+
"use strict";
|
|
17109
|
+
module.exports = require("vue");
|
|
17110
|
+
|
|
17111
|
+
/***/ }),
|
|
17112
|
+
|
|
15970
17113
|
/***/ 4654:
|
|
15971
17114
|
/***/ (() => {
|
|
15972
17115
|
|
|
@@ -16276,8 +17419,8 @@ main.install = function (Vue) {
|
|
|
16276
17419
|
Vue.component(main.name, main);
|
|
16277
17420
|
};
|
|
16278
17421
|
/* harmony default export */ const look_empty = (main);
|
|
16279
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/look-dulplicate-checking/src/main.vue?vue&type=template&id=
|
|
16280
|
-
var
|
|
17422
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/look-dulplicate-checking/src/main.vue?vue&type=template&id=56432a78&scoped=true&
|
|
17423
|
+
var mainvue_type_template_id_56432a78_scoped_true_render = function render() {
|
|
16281
17424
|
var _vm = this,
|
|
16282
17425
|
_c = _vm._self._c;
|
|
16283
17426
|
return _c('div', {
|
|
@@ -16527,35 +17670,51 @@ var mainvue_type_template_id_47c92ff8_scoped_true_render = function render() {
|
|
|
16527
17670
|
staticClass: "txt"
|
|
16528
17671
|
}, [_vm._v("查重结果: ")]), _c('span', {
|
|
16529
17672
|
staticClass: "count"
|
|
16530
|
-
}, [_vm._v(" " + _vm._s(_vm.checkingResultList.length))])]),
|
|
17673
|
+
}, [_vm._v(" " + _vm._s(_vm.checkingResultList.length))])]), _c('section', {
|
|
16531
17674
|
directives: [{
|
|
16532
17675
|
name: "loading",
|
|
16533
17676
|
rawName: "v-loading",
|
|
16534
17677
|
value: _vm.loadingCheckResultList,
|
|
16535
17678
|
expression: "loadingCheckResultList"
|
|
16536
17679
|
}],
|
|
17680
|
+
staticClass: "right-container-block"
|
|
17681
|
+
}, [_c('section', {
|
|
17682
|
+
directives: [{
|
|
17683
|
+
name: "show",
|
|
17684
|
+
rawName: "v-show",
|
|
17685
|
+
value: _vm.checkingResultList.length > 0,
|
|
17686
|
+
expression: "checkingResultList.length > 0"
|
|
17687
|
+
}],
|
|
16537
17688
|
staticClass: "right-container-section"
|
|
16538
|
-
},
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16548
|
-
|
|
16549
|
-
|
|
16550
|
-
|
|
16551
|
-
|
|
16552
|
-
|
|
17689
|
+
}, [_c('virtual-list', {
|
|
17690
|
+
staticClass: "rcs-list",
|
|
17691
|
+
staticStyle: {
|
|
17692
|
+
"height": "100%",
|
|
17693
|
+
"overflow-y": "auto"
|
|
17694
|
+
},
|
|
17695
|
+
attrs: {
|
|
17696
|
+
"data-key": 'dataId',
|
|
17697
|
+
"data-sources": _vm.checkingResultList,
|
|
17698
|
+
"data-component": _vm.CheckingResultItem
|
|
17699
|
+
},
|
|
17700
|
+
on: {
|
|
17701
|
+
"subscription-click": _vm.handleSubscribe,
|
|
17702
|
+
"merging-click": _vm.handleMerge,
|
|
17703
|
+
"insertion-click": _vm.handleInsert
|
|
17704
|
+
}
|
|
17705
|
+
})], 1), _c('section', {
|
|
17706
|
+
directives: [{
|
|
17707
|
+
name: "show",
|
|
17708
|
+
rawName: "v-show",
|
|
17709
|
+
value: _vm.checkingResultList.length === 0,
|
|
17710
|
+
expression: "checkingResultList.length === 0"
|
|
17711
|
+
}],
|
|
16553
17712
|
staticClass: "right-container-empty"
|
|
16554
|
-
}, [_c('look-empty')], 1)])]);
|
|
17713
|
+
}, [_c('look-empty')], 1)])])]);
|
|
16555
17714
|
};
|
|
16556
|
-
var
|
|
17715
|
+
var mainvue_type_template_id_56432a78_scoped_true_staticRenderFns = [];
|
|
16557
17716
|
|
|
16558
|
-
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/main.vue?vue&type=template&id=
|
|
17717
|
+
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/main.vue?vue&type=template&id=56432a78&scoped=true&
|
|
16559
17718
|
|
|
16560
17719
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.every.js
|
|
16561
17720
|
var es_array_every = __webpack_require__(6541);
|
|
@@ -20634,9 +21793,9 @@ var mission_item_component = normalizeComponent(
|
|
|
20634
21793
|
)
|
|
20635
21794
|
|
|
20636
21795
|
/* harmony default export */ const mission_item = (mission_item_component.exports);
|
|
20637
|
-
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/look-dulplicate-checking/src/components/checking-result-item.vue?vue&type=template&id=
|
|
21796
|
+
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/look-dulplicate-checking/src/components/checking-result-item.vue?vue&type=template&id=2e07ad88&scoped=true&
|
|
20638
21797
|
|
|
20639
|
-
var
|
|
21798
|
+
var checking_result_itemvue_type_template_id_2e07ad88_scoped_true_render = function render() {
|
|
20640
21799
|
var _vm = this,
|
|
20641
21800
|
_c = _vm._self._c;
|
|
20642
21801
|
return _c('div', {
|
|
@@ -20645,9 +21804,9 @@ var checking_result_itemvue_type_template_id_41c917a8_scoped_true_render = funct
|
|
|
20645
21804
|
staticClass: "content"
|
|
20646
21805
|
}, [_c('div', {
|
|
20647
21806
|
staticClass: "title"
|
|
20648
|
-
}, [_vm._v(_vm._s(_vm.
|
|
21807
|
+
}, [_vm._v(_vm._s(_vm.source.name))]), _c('div', {
|
|
20649
21808
|
staticClass: "tags-wrap"
|
|
20650
|
-
}, _vm._l(_vm.
|
|
21809
|
+
}, _vm._l(_vm.source.feature && _vm.source.feature.split(','), function (tag, tagIndex) {
|
|
20651
21810
|
return _c('div', {
|
|
20652
21811
|
key: tagIndex,
|
|
20653
21812
|
staticClass: "tag-item"
|
|
@@ -20658,7 +21817,7 @@ var checking_result_itemvue_type_template_id_41c917a8_scoped_true_render = funct
|
|
|
20658
21817
|
staticClass: "title"
|
|
20659
21818
|
}, [_vm._v("来源及要求:")]), _c('div', {
|
|
20660
21819
|
staticClass: "text-area"
|
|
20661
|
-
}, [_vm._v(_vm._s(_vm.
|
|
21820
|
+
}, [_vm._v(_vm._s(_vm.source.requirement))])]), _c('div', {
|
|
20662
21821
|
staticClass: "other-info"
|
|
20663
21822
|
}, [_c('div', {
|
|
20664
21823
|
staticClass: "left"
|
|
@@ -20690,7 +21849,7 @@ var checking_result_itemvue_type_template_id_41c917a8_scoped_true_render = funct
|
|
|
20690
21849
|
staticClass: "key"
|
|
20691
21850
|
}, [_vm._v("下达时间:")]), _c('div', {
|
|
20692
21851
|
staticClass: "value"
|
|
20693
|
-
}, [_vm._v(_vm._s(_vm.
|
|
21852
|
+
}, [_vm._v(_vm._s(_vm.source.beginTime))])])])]), _c('div', {
|
|
20694
21853
|
staticClass: "footer"
|
|
20695
21854
|
}, [_vm.isShowSource ? _c('div', {
|
|
20696
21855
|
staticClass: "left"
|
|
@@ -20698,12 +21857,12 @@ var checking_result_itemvue_type_template_id_41c917a8_scoped_true_render = funct
|
|
|
20698
21857
|
staticClass: "key"
|
|
20699
21858
|
}, [_vm._v("推荐依据:")]), _c('div', {
|
|
20700
21859
|
staticClass: "value"
|
|
20701
|
-
}, _vm._l(_vm.recommandTags, function (recommandTag, recommandTagIndex) {
|
|
21860
|
+
}, _vm._l(_vm.recommandTags(), function (recommandTag, recommandTagIndex) {
|
|
20702
21861
|
return _c('span', {
|
|
20703
21862
|
key: recommandTagIndex,
|
|
20704
21863
|
staticClass: "recommand-tag-item"
|
|
20705
21864
|
}, [_vm._v(_vm._s(recommandTag))]);
|
|
20706
|
-
}), 0)]) : _vm._e(), _vm.
|
|
21865
|
+
}), 0)]) : _vm._e(), _vm.isShowBtnsFn() ? _c('div', {
|
|
20707
21866
|
staticClass: "right"
|
|
20708
21867
|
}, [_c('el-button', {
|
|
20709
21868
|
staticClass: "lookui-btn",
|
|
@@ -20731,14 +21890,14 @@ var checking_result_itemvue_type_template_id_41c917a8_scoped_true_render = funct
|
|
|
20731
21890
|
}, [_vm._v("归并")])], 1) : _vm._e()]), _c('img', {
|
|
20732
21891
|
staticClass: "status",
|
|
20733
21892
|
attrs: {
|
|
20734
|
-
"src": _vm.mapStatus(_vm.
|
|
21893
|
+
"src": _vm.mapStatus(_vm.source.status),
|
|
20735
21894
|
"alt": ""
|
|
20736
21895
|
}
|
|
20737
21896
|
})]);
|
|
20738
21897
|
};
|
|
20739
|
-
var
|
|
21898
|
+
var checking_result_itemvue_type_template_id_2e07ad88_scoped_true_staticRenderFns = [];
|
|
20740
21899
|
|
|
20741
|
-
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/components/checking-result-item.vue?vue&type=template&id=
|
|
21900
|
+
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/components/checking-result-item.vue?vue&type=template&id=2e07ad88&scoped=true&
|
|
20742
21901
|
|
|
20743
21902
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/look-dulplicate-checking/src/components/checking-result-item.vue?vue&type=script&lang=js&
|
|
20744
21903
|
/* harmony default export */ const checking_result_itemvue_type_script_lang_js_ = ({
|
|
@@ -20751,34 +21910,23 @@ var checking_result_itemvue_type_template_id_41c917a8_scoped_true_staticRenderFn
|
|
|
20751
21910
|
curId: ''
|
|
20752
21911
|
};
|
|
20753
21912
|
},
|
|
21913
|
+
inject: ['isShowBtnsFn', 'isShowSource', 'recommandTags'],
|
|
20754
21914
|
props: {
|
|
20755
|
-
|
|
20756
|
-
type: Boolean,
|
|
20757
|
-
"default": true
|
|
20758
|
-
},
|
|
20759
|
-
isShowSource: {
|
|
20760
|
-
type: Boolean,
|
|
20761
|
-
"default": true
|
|
20762
|
-
},
|
|
20763
|
-
item: {
|
|
21915
|
+
source: {
|
|
20764
21916
|
type: Object,
|
|
20765
|
-
"default": function _default() {}
|
|
20766
|
-
},
|
|
20767
|
-
recommandTags: {
|
|
20768
|
-
type: Array,
|
|
20769
21917
|
"default": function _default() {
|
|
20770
|
-
return
|
|
21918
|
+
return {};
|
|
20771
21919
|
}
|
|
20772
21920
|
}
|
|
20773
21921
|
},
|
|
20774
21922
|
computed: {
|
|
20775
21923
|
qtOrgs: function qtOrgs() {
|
|
20776
|
-
var _this$
|
|
20777
|
-
return (_this$
|
|
21924
|
+
var _this$source$qtOrgs;
|
|
21925
|
+
return (_this$source$qtOrgs = this.source.qtOrgs) === null || _this$source$qtOrgs === void 0 ? void 0 : _this$source$qtOrgs.split(",");
|
|
20778
21926
|
},
|
|
20779
21927
|
createdOrg: function createdOrg() {
|
|
20780
|
-
var _this$
|
|
20781
|
-
return (_this$
|
|
21928
|
+
var _this$source$createdO;
|
|
21929
|
+
return (_this$source$createdO = this.source.createdOrg) === null || _this$source$createdO === void 0 ? void 0 : _this$source$createdO.split(",");
|
|
20782
21930
|
}
|
|
20783
21931
|
},
|
|
20784
21932
|
created: function created() {},
|
|
@@ -20786,13 +21934,16 @@ var checking_result_itemvue_type_template_id_41c917a8_scoped_true_staticRenderFn
|
|
|
20786
21934
|
methods: {
|
|
20787
21935
|
closeMissionResolve: function closeMissionResolve(val) {},
|
|
20788
21936
|
handleSubscribe: function handleSubscribe() {
|
|
20789
|
-
|
|
21937
|
+
// 使用 vue-virtual-scroll-list 时, 需要通过以下方式才能将事件 emit 出去
|
|
21938
|
+
this.$parent.$parent.$emit('subscription-click', this.source);
|
|
20790
21939
|
},
|
|
20791
21940
|
handleMerge: function handleMerge() {
|
|
20792
|
-
this.$emit('merging-click', this.
|
|
21941
|
+
this.$parent.$parent.$emit('merging-click', this.source);
|
|
21942
|
+
// this.$emit('merging-click', this.item);
|
|
20793
21943
|
},
|
|
20794
21944
|
handleInsert: function handleInsert() {
|
|
20795
|
-
this.$emit('insertion-click', this.
|
|
21945
|
+
this.$parent.$parent.$emit('insertion-click', this.source);
|
|
21946
|
+
// this.$emit('insertion-click', this.item);
|
|
20796
21947
|
},
|
|
20797
21948
|
mapStatus: function mapStatus(status) {
|
|
20798
21949
|
switch (status) {
|
|
@@ -20812,10 +21963,10 @@ var checking_result_itemvue_type_template_id_41c917a8_scoped_true_staticRenderFn
|
|
|
20812
21963
|
});
|
|
20813
21964
|
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/components/checking-result-item.vue?vue&type=script&lang=js&
|
|
20814
21965
|
/* harmony default export */ const components_checking_result_itemvue_type_script_lang_js_ = (checking_result_itemvue_type_script_lang_js_);
|
|
20815
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/look-dulplicate-checking/src/components/checking-result-item.vue?vue&type=style&index=0&id=
|
|
21966
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/look-dulplicate-checking/src/components/checking-result-item.vue?vue&type=style&index=0&id=2e07ad88&prod&scoped=true&lang=scss&
|
|
20816
21967
|
// extracted by mini-css-extract-plugin
|
|
20817
21968
|
|
|
20818
|
-
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/components/checking-result-item.vue?vue&type=style&index=0&id=
|
|
21969
|
+
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/components/checking-result-item.vue?vue&type=style&index=0&id=2e07ad88&prod&scoped=true&lang=scss&
|
|
20819
21970
|
|
|
20820
21971
|
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/components/checking-result-item.vue
|
|
20821
21972
|
|
|
@@ -20828,16 +21979,19 @@ var checking_result_itemvue_type_template_id_41c917a8_scoped_true_staticRenderFn
|
|
|
20828
21979
|
|
|
20829
21980
|
var checking_result_item_component = normalizeComponent(
|
|
20830
21981
|
components_checking_result_itemvue_type_script_lang_js_,
|
|
20831
|
-
|
|
20832
|
-
|
|
21982
|
+
checking_result_itemvue_type_template_id_2e07ad88_scoped_true_render,
|
|
21983
|
+
checking_result_itemvue_type_template_id_2e07ad88_scoped_true_staticRenderFns,
|
|
20833
21984
|
false,
|
|
20834
21985
|
null,
|
|
20835
|
-
"
|
|
21986
|
+
"2e07ad88",
|
|
20836
21987
|
null
|
|
20837
21988
|
|
|
20838
21989
|
)
|
|
20839
21990
|
|
|
20840
21991
|
/* harmony default export */ const checking_result_item = (checking_result_item_component.exports);
|
|
21992
|
+
// EXTERNAL MODULE: ./node_modules/vue-virtual-scroll-list/dist/index.js
|
|
21993
|
+
var dist = __webpack_require__(5137);
|
|
21994
|
+
var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
|
|
20841
21995
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/look-dulplicate-checking/src/main.vue?vue&type=script&lang=js&
|
|
20842
21996
|
|
|
20843
21997
|
|
|
@@ -20856,22 +22010,35 @@ var checking_result_item_component = normalizeComponent(
|
|
|
20856
22010
|
|
|
20857
22011
|
|
|
20858
22012
|
|
|
22013
|
+
|
|
20859
22014
|
/* harmony default export */ const look_dulplicate_checking_src_mainvue_type_script_lang_js_ = ({
|
|
20860
22015
|
name: 'look-dulplicate-checking',
|
|
20861
22016
|
components: {
|
|
20862
22017
|
MissionHeader: mission_header,
|
|
20863
22018
|
MissionItem: mission_item,
|
|
20864
|
-
CheckingResultItem
|
|
22019
|
+
// CheckingResultItem,
|
|
22020
|
+
VirtualList: (dist_default())
|
|
20865
22021
|
},
|
|
20866
22022
|
provide: function provide() {
|
|
22023
|
+
var _this = this;
|
|
20867
22024
|
return {
|
|
20868
22025
|
onCancelBtnClick: this.handleCancelBtnClick,
|
|
20869
|
-
onViewDetailsClick: this.goDetail
|
|
22026
|
+
onViewDetailsClick: this.goDetail,
|
|
22027
|
+
isShowSource: function isShowSource() {
|
|
22028
|
+
return _this.isShowSource;
|
|
22029
|
+
},
|
|
22030
|
+
isShowBtnsFn: function isShowBtnsFn() {
|
|
22031
|
+
return _this.currentMissionType == 0;
|
|
22032
|
+
},
|
|
22033
|
+
recommandTags: function recommandTags() {
|
|
22034
|
+
return _this.checkedTags;
|
|
22035
|
+
}
|
|
20870
22036
|
};
|
|
20871
22037
|
},
|
|
20872
22038
|
data: function data() {
|
|
20873
22039
|
return {
|
|
20874
22040
|
loadingCheckResultList: false,
|
|
22041
|
+
CheckingResultItem: checking_result_item,
|
|
20875
22042
|
SIMILAR: SIMILAR,
|
|
20876
22043
|
DISSIMILAR: DISSIMILAR,
|
|
20877
22044
|
activeDealNames: ['dealSimilar', 'dealDissimilar'],
|
|
@@ -20962,7 +22129,7 @@ var checking_result_item_component = normalizeComponent(
|
|
|
20962
22129
|
keyId: 'taskId',
|
|
20963
22130
|
modelIndex: 'common_task',
|
|
20964
22131
|
modelType: 'task',
|
|
20965
|
-
names: 'name',
|
|
22132
|
+
names: 'name,tenantId',
|
|
20966
22133
|
size: 10000
|
|
20967
22134
|
};
|
|
20968
22135
|
}
|
|
@@ -20987,58 +22154,63 @@ var checking_result_item_component = normalizeComponent(
|
|
|
20987
22154
|
this.$emit('onCancelBtnClick', task);
|
|
20988
22155
|
},
|
|
20989
22156
|
fetchCheckingResultList: function fetchCheckingResultList(index) {
|
|
20990
|
-
var
|
|
22157
|
+
var _this2 = this;
|
|
20991
22158
|
this.paramsData.jsonStr = JSON.stringify(this.data);
|
|
20992
|
-
console.log('npm link');
|
|
20993
22159
|
searchRepeated(this.paramsData).then(function (_ref) {
|
|
20994
22160
|
var _ref$data$data = _ref.data.data,
|
|
20995
22161
|
similarity = _ref$data$data.similarity,
|
|
20996
22162
|
notSimilarity = _ref$data$data.notSimilarity;
|
|
20997
22163
|
// 所有查重结果列表数据
|
|
20998
|
-
|
|
20999
|
-
|
|
21000
|
-
for (var i = 0; i <
|
|
22164
|
+
_this2.allCheckingResultList = similarity;
|
|
22165
|
+
_this2.noDealMission.similar = _this2.data.filter(function (item) {
|
|
22166
|
+
for (var i = 0; i < _this2.data.length; i++) {
|
|
21001
22167
|
var _notSimilarity$i;
|
|
21002
22168
|
return item.taskId != ((_notSimilarity$i = notSimilarity[i]) === null || _notSimilarity$i === void 0 ? void 0 : _notSimilarity$i.taskId);
|
|
21003
22169
|
}
|
|
21004
22170
|
});
|
|
21005
|
-
|
|
21006
|
-
|
|
22171
|
+
_this2.noDealMission.dissimilar = notSimilarity;
|
|
22172
|
+
_this2.hadDealMission.similar = _this2.noDealMission.similar.filter(function (item) {
|
|
21007
22173
|
return item.status;
|
|
21008
22174
|
});
|
|
21009
|
-
|
|
22175
|
+
_this2.noDealMission.similar = _this2.noDealMission.similar.filter(function (item) {
|
|
21010
22176
|
return !item.status;
|
|
21011
22177
|
});
|
|
21012
22178
|
similarity.forEach(function (item) {
|
|
21013
22179
|
// 未处理任务(存在相似任务)中每个任务的查重结果数
|
|
21014
|
-
|
|
22180
|
+
_this2.noDealMission.similar.forEach(function (iten) {
|
|
21015
22181
|
if (item.keyId == iten.taskId) {
|
|
21016
22182
|
iten.checkResultListLength = item.size;
|
|
21017
22183
|
}
|
|
21018
22184
|
});
|
|
21019
22185
|
// 已处理任务(存在相似任务)中每个任务的查重结果数
|
|
21020
|
-
|
|
22186
|
+
_this2.hadDealMission.similar.forEach(function (iten) {
|
|
21021
22187
|
if (item.keyId == iten.taskId) {
|
|
21022
22188
|
iten.checkResultListLength = item.size;
|
|
21023
22189
|
}
|
|
21024
22190
|
});
|
|
21025
22191
|
});
|
|
21026
|
-
|
|
22192
|
+
_this2.getCurrMissionCheckingResultList(index);
|
|
21027
22193
|
});
|
|
21028
22194
|
},
|
|
21029
22195
|
// 获取当前任务的查重结果列表
|
|
21030
22196
|
getCurrMissionCheckingResultList: function getCurrMissionCheckingResultList(index) {
|
|
21031
|
-
var
|
|
22197
|
+
var _this3 = this;
|
|
22198
|
+
var isSimilar = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
21032
22199
|
this.loadingCheckResultList = true;
|
|
21033
22200
|
setTimeout(function () {
|
|
21034
|
-
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
|
|
21038
|
-
|
|
21039
|
-
|
|
21040
|
-
|
|
21041
|
-
|
|
22201
|
+
if (isSimilar) {
|
|
22202
|
+
var _this3$noDealMission$, _this3$hadDealMission;
|
|
22203
|
+
var currentMissionKeyId = _this3.currentMissionType === 0 ? (_this3$noDealMission$ = _this3.noDealMission.similar[index]) === null || _this3$noDealMission$ === void 0 ? void 0 : _this3$noDealMission$.taskId : (_this3$hadDealMission = _this3.hadDealMission.similar[index]) === null || _this3$hadDealMission === void 0 ? void 0 : _this3$hadDealMission.taskId;
|
|
22204
|
+
var resObj = _this3.allCheckingResultList.find(function (item) {
|
|
22205
|
+
return item.keyId == currentMissionKeyId;
|
|
22206
|
+
}) || {};
|
|
22207
|
+
_this3.checkingResultList = resObj.hitRes || [];
|
|
22208
|
+
_this3.loadingCheckResultList = false;
|
|
22209
|
+
} else {
|
|
22210
|
+
_this3.checkingResultList = [];
|
|
22211
|
+
_this3.loadingCheckResultList = false;
|
|
22212
|
+
}
|
|
22213
|
+
}, 600);
|
|
21042
22214
|
},
|
|
21043
22215
|
// 查看详情
|
|
21044
22216
|
goDetail: function goDetail() {
|
|
@@ -21062,21 +22234,22 @@ var checking_result_item_component = normalizeComponent(
|
|
|
21062
22234
|
},
|
|
21063
22235
|
// 切换来源
|
|
21064
22236
|
handleCheckedTagsChange: function handleCheckedTagsChange(val) {
|
|
21065
|
-
var
|
|
22237
|
+
var _this4 = this;
|
|
21066
22238
|
var field = {
|
|
21067
|
-
|
|
21068
|
-
|
|
21069
|
-
|
|
22239
|
+
任务标题: 'name',
|
|
22240
|
+
任务标签: 'feature',
|
|
22241
|
+
事项来源及依据: 'sourceName'
|
|
21070
22242
|
};
|
|
21071
22243
|
var sources = [];
|
|
21072
22244
|
val.forEach(function (item) {
|
|
21073
22245
|
sources.push(field[item]);
|
|
21074
22246
|
});
|
|
22247
|
+
sources.push('tenantId'); // 固定
|
|
21075
22248
|
this.paramsData.names = sources.toString();
|
|
21076
22249
|
this.checkingResultList = [];
|
|
21077
22250
|
// 使用 setTimeout 防止 checkbox 渲染缓慢
|
|
21078
22251
|
setTimeout(function () {
|
|
21079
|
-
|
|
22252
|
+
_this4.fetchCheckingResultList(_this4.currentNoDealSimilarIndex);
|
|
21080
22253
|
}, 0);
|
|
21081
22254
|
},
|
|
21082
22255
|
// 全选未处理任务
|
|
@@ -21152,20 +22325,20 @@ var checking_result_item_component = normalizeComponent(
|
|
|
21152
22325
|
this.currentMissionType = index;
|
|
21153
22326
|
if (index === 0) {
|
|
21154
22327
|
// 获取某个未处理任务的查重列表
|
|
21155
|
-
this.getCurrMissionCheckingResultList(this.currentNoDealSimilarIndex === -1 ? this.currentNoDealDissimilarIndex : this.currentNoDealSimilarIndex);
|
|
22328
|
+
this.getCurrMissionCheckingResultList(this.currentNoDealSimilarIndex === -1 ? this.currentNoDealDissimilarIndex : this.currentNoDealSimilarIndex, this.currentNoDealSimilarIndex !== -1);
|
|
21156
22329
|
} else if (index === 1) {
|
|
21157
22330
|
// 获取某个已处理任务的查重列表
|
|
21158
|
-
this.getCurrMissionCheckingResultList(this.currentDealSimilarIndex === -1 ? this.currentDealDissimilarIndex : this.currentDealSimilarIndex);
|
|
22331
|
+
this.getCurrMissionCheckingResultList(this.currentDealSimilarIndex === -1 ? this.currentDealDissimilarIndex : this.currentDealSimilarIndex, this.currentDealSimilarIndex !== -1);
|
|
21159
22332
|
}
|
|
21160
22333
|
}
|
|
21161
22334
|
}
|
|
21162
22335
|
});
|
|
21163
22336
|
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/main.vue?vue&type=script&lang=js&
|
|
21164
22337
|
/* harmony default export */ const packages_look_dulplicate_checking_src_mainvue_type_script_lang_js_ = (look_dulplicate_checking_src_mainvue_type_script_lang_js_);
|
|
21165
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/look-dulplicate-checking/src/main.vue?vue&type=style&index=0&id=
|
|
22338
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/look-dulplicate-checking/src/main.vue?vue&type=style&index=0&id=56432a78&prod&scoped=true&lang=scss&
|
|
21166
22339
|
// extracted by mini-css-extract-plugin
|
|
21167
22340
|
|
|
21168
|
-
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/main.vue?vue&type=style&index=0&id=
|
|
22341
|
+
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/main.vue?vue&type=style&index=0&id=56432a78&prod&scoped=true&lang=scss&
|
|
21169
22342
|
|
|
21170
22343
|
;// CONCATENATED MODULE: ./packages/look-dulplicate-checking/src/main.vue
|
|
21171
22344
|
|
|
@@ -21178,11 +22351,11 @@ var checking_result_item_component = normalizeComponent(
|
|
|
21178
22351
|
|
|
21179
22352
|
var main_component = normalizeComponent(
|
|
21180
22353
|
packages_look_dulplicate_checking_src_mainvue_type_script_lang_js_,
|
|
21181
|
-
|
|
21182
|
-
|
|
22354
|
+
mainvue_type_template_id_56432a78_scoped_true_render,
|
|
22355
|
+
mainvue_type_template_id_56432a78_scoped_true_staticRenderFns,
|
|
21183
22356
|
false,
|
|
21184
22357
|
null,
|
|
21185
|
-
"
|
|
22358
|
+
"56432a78",
|
|
21186
22359
|
null
|
|
21187
22360
|
|
|
21188
22361
|
)
|