@leevan/jtui 2.0.45 → 2.0.46
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/lib/jtui.common.js +45 -41
- package/lib/jtui.umd.js +45 -41
- package/lib/jtui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/jt-table/index.vue +9 -7
package/lib/jtui.common.js
CHANGED
|
@@ -250035,7 +250035,7 @@ var es_function_name = __webpack_require__("b0c0");
|
|
|
250035
250035
|
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
|
|
250036
250036
|
var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
|
|
250037
250037
|
|
|
250038
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"09b5e250-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/jt-table/index.vue?vue&type=template&id=
|
|
250038
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"09b5e250-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/jt-table/index.vue?vue&type=template&id=f923a0f6&
|
|
250039
250039
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"tableStyle-2",class:_vm.isWrap ? 'isWrap' : '',staticStyle:{"position":"absolute","top":"1px","left":"1px","right":"1px","bottom":"1px"}},[(_vm.isTool)?_c('div',{staticStyle:{"position":"relative"}},[_c('vxe-toolbar',{staticClass:"jt-toolbar",attrs:{"custom":{ icon: 'jtIcon iconpeizhi41 colStyle' }}})],1):_vm._e(),_c('div',{staticStyle:{"width":"100%","height":"100%","position":"relative"}},[(_vm.isShowEmpty)?_c('div',{staticClass:"cus-empty-box"},[_c('el-empty',{attrs:{"image-size":200},scopedSlots:_vm._u([{key:"description",fn:function(){return [_c('p',{staticStyle:{"font-size":"30px"}},[_vm._v("暂无数据")])]},proxy:true}],null,false,1618345459)})],1):_vm._e(),(_vm.tableType === 'default')?_c('vxe-table',{ref:_vm.id,staticClass:"jt-table-class-only",attrs:{"height":"auto","size":"mini","show-overflow":"","show-header-overflow":"","auto-resize":"","resizable":"","highlight-current-row":"","highlight-current-column":"","keep-source":"","empty-text":" ","id":_vm.id,"data":_vm.data.DataArray,"stripe":_vm.stripe,"border":_vm.border,"max-height":_vm.maxHeight,"show-footer":_vm.isFooter,"footer-method":_vm.footerMethod,"footer-span-method":_vm.footerColspanMethod,"footer-cell-class-name":_vm.footerCellClassName,"loading":_vm.loading,"row-style":_vm.rowStyle,"cell-style":_vm.cellStyle_m,"header-cell-class-name":_vm.headerClass,"span-method":_vm.spanMethod,"scroll-y":{ mode: 'wheel' },"sort-config":{ sortMethod: _vm.sortMethod },"radio-config":{ checkRowKey: null },"keyboard-config":{ isArrow: true },"checkbox-config":{ highlight: true },"export-config":{
|
|
250040
250040
|
type: 'xlsx',
|
|
250041
250041
|
types: ['xlsx', 'csv', 'html', 'xml', 'txt'],
|
|
@@ -250135,7 +250135,7 @@ return [(_vm.handlerConfig.btnGroup)?_c('el-dropdown',[_c('el-button',{attrs:{"s
|
|
|
250135
250135
|
var staticRenderFns = []
|
|
250136
250136
|
|
|
250137
250137
|
|
|
250138
|
-
// CONCATENATED MODULE: ./packages/jt-table/index.vue?vue&type=template&id=
|
|
250138
|
+
// CONCATENATED MODULE: ./packages/jt-table/index.vue?vue&type=template&id=f923a0f6&
|
|
250139
250139
|
|
|
250140
250140
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
|
|
250141
250141
|
var es_array_concat = __webpack_require__("99af");
|
|
@@ -251575,18 +251575,22 @@ var component = normalizeComponent(
|
|
|
251575
251575
|
loading: {
|
|
251576
251576
|
deep: true,
|
|
251577
251577
|
handler: function handler(n) {
|
|
251578
|
+
var _this = this;
|
|
251579
|
+
|
|
251578
251580
|
if (this.$refs[this.id]) {
|
|
251579
|
-
|
|
251581
|
+
setTimeout(function () {
|
|
251582
|
+
var temp = _this.$refs[_this.id].getTableData();
|
|
251580
251583
|
|
|
251581
|
-
|
|
251582
|
-
|
|
251583
|
-
} else {
|
|
251584
|
-
if (n) {
|
|
251585
|
-
this.isShowEmpty = false;
|
|
251584
|
+
if (temp.fullData.length > 0) {
|
|
251585
|
+
_this.isShowEmpty = false;
|
|
251586
251586
|
} else {
|
|
251587
|
-
|
|
251587
|
+
if (n) {
|
|
251588
|
+
_this.isShowEmpty = false;
|
|
251589
|
+
} else {
|
|
251590
|
+
_this.isShowEmpty = true;
|
|
251591
|
+
}
|
|
251588
251592
|
}
|
|
251589
|
-
}
|
|
251593
|
+
}, 1000);
|
|
251590
251594
|
} else {
|
|
251591
251595
|
this.isShowEmpty = false;
|
|
251592
251596
|
}
|
|
@@ -251838,7 +251842,7 @@ var component = normalizeComponent(
|
|
|
251838
251842
|
},
|
|
251839
251843
|
//表尾统计,(计算平均值和求和)
|
|
251840
251844
|
footerMethod: function footerMethod(_ref4) {
|
|
251841
|
-
var
|
|
251845
|
+
var _this2 = this;
|
|
251842
251846
|
|
|
251843
251847
|
var columns = _ref4.columns,
|
|
251844
251848
|
data = _ref4.data;
|
|
@@ -251852,7 +251856,7 @@ var component = normalizeComponent(
|
|
|
251852
251856
|
var meanCell = null;
|
|
251853
251857
|
var sumCell = null;
|
|
251854
251858
|
|
|
251855
|
-
|
|
251859
|
+
_this2.footConfig.filed.forEach(function (i) {
|
|
251856
251860
|
switch (column.property) {
|
|
251857
251861
|
case i:
|
|
251858
251862
|
meanCell = parseInt(xe_utils_default.a.mean(data, column.property));
|
|
@@ -251966,7 +251970,7 @@ var component = normalizeComponent(
|
|
|
251966
251970
|
},
|
|
251967
251971
|
//滚动到底事件派发
|
|
251968
251972
|
scroll: function scroll(param) {
|
|
251969
|
-
var
|
|
251973
|
+
var _this3 = this;
|
|
251970
251974
|
|
|
251971
251975
|
var scrollTop = param.scrollTop,
|
|
251972
251976
|
$event = param.$event;
|
|
@@ -251976,7 +251980,7 @@ var component = normalizeComponent(
|
|
|
251976
251980
|
var sh = $event.target.scrollHeight;
|
|
251977
251981
|
|
|
251978
251982
|
if (Math.ceil(scrollTop + ch) >= sh && scrollTop != 0) {
|
|
251979
|
-
|
|
251983
|
+
_this3.$emit("scrollBottom", ++_this3.pageIndex);
|
|
251980
251984
|
}
|
|
251981
251985
|
}, 200);
|
|
251982
251986
|
},
|
|
@@ -252075,20 +252079,20 @@ var component = normalizeComponent(
|
|
|
252075
252079
|
},
|
|
252076
252080
|
//普通表格转树表(仅支持一层)
|
|
252077
252081
|
default2tree: function default2tree(data, field) {
|
|
252078
|
-
var
|
|
252082
|
+
var _this4 = this;
|
|
252079
252083
|
|
|
252080
252084
|
var result = [];
|
|
252081
252085
|
this.treeField = this.data.retjson.header[0].prop;
|
|
252082
252086
|
xe_utils_default.a.each(xe_utils_default.a.groupBy(data, field), function (childs, key) {
|
|
252083
252087
|
var _result$push;
|
|
252084
252088
|
|
|
252085
|
-
result.push((_result$push = {}, _defineProperty(_result$push,
|
|
252089
|
+
result.push((_result$push = {}, _defineProperty(_result$push, _this4.treeField, key + "\uFF08 ".concat(childs.length, " \uFF09")), _defineProperty(_result$push, "children", childs), _result$push));
|
|
252086
252090
|
});
|
|
252087
252091
|
this.data.DataArray = result;
|
|
252088
252092
|
|
|
252089
252093
|
if (this.isExpand) {
|
|
252090
252094
|
this.$nextTick(function () {
|
|
252091
|
-
|
|
252095
|
+
_this4.setAllTreeExpand();
|
|
252092
252096
|
});
|
|
252093
252097
|
}
|
|
252094
252098
|
},
|
|
@@ -252165,7 +252169,7 @@ var component = normalizeComponent(
|
|
|
252165
252169
|
},
|
|
252166
252170
|
//树表滚动分页+性能优化
|
|
252167
252171
|
scroll1: function scroll1(param) {
|
|
252168
|
-
var
|
|
252172
|
+
var _this5 = this;
|
|
252169
252173
|
|
|
252170
252174
|
var scrollTop = param.scrollTop,
|
|
252171
252175
|
$event = param.$event;
|
|
@@ -252173,24 +252177,24 @@ var component = normalizeComponent(
|
|
|
252173
252177
|
this.timeOut = setTimeout(function () {
|
|
252174
252178
|
var ch = $event.target.clientHeight;
|
|
252175
252179
|
var sh = $event.target.scrollHeight;
|
|
252176
|
-
var temp = scrollTop -
|
|
252177
|
-
|
|
252180
|
+
var temp = scrollTop - _this5.sp;
|
|
252181
|
+
_this5.sp = scrollTop;
|
|
252178
252182
|
|
|
252179
252183
|
if (temp < 0 && scrollTop <= 0) {
|
|
252180
|
-
if (
|
|
252181
|
-
|
|
252184
|
+
if (_this5.tPageIndex > 1) {
|
|
252185
|
+
_this5.tPageIndex--;
|
|
252182
252186
|
|
|
252183
|
-
|
|
252187
|
+
_this5.dataSliceUp(_this5.tPageIndex);
|
|
252184
252188
|
|
|
252185
|
-
|
|
252189
|
+
_this5.$refs[_this5.id].scrollTo(null, (sh - ch) / 2);
|
|
252186
252190
|
}
|
|
252187
252191
|
} else if (temp >= 0 && scrollTop + ch >= sh) {
|
|
252188
|
-
if (
|
|
252189
|
-
|
|
252192
|
+
if (_this5.tPageIndex < _this5.pageTotal) {
|
|
252193
|
+
_this5.tPageIndex++;
|
|
252190
252194
|
|
|
252191
|
-
|
|
252195
|
+
_this5.dataSliceDown(_this5.tPageIndex);
|
|
252192
252196
|
|
|
252193
|
-
|
|
252197
|
+
_this5.$refs[_this5.id].scrollTo(null, (sh - ch) / 2);
|
|
252194
252198
|
}
|
|
252195
252199
|
}
|
|
252196
252200
|
}, 200);
|
|
@@ -252221,12 +252225,12 @@ var component = normalizeComponent(
|
|
|
252221
252225
|
// },
|
|
252222
252226
|
//树 懒加载方法
|
|
252223
252227
|
loadChildrenMethod: function loadChildrenMethod(_ref20) {
|
|
252224
|
-
var
|
|
252228
|
+
var _this6 = this;
|
|
252225
252229
|
|
|
252226
252230
|
var row = _ref20.row;
|
|
252227
252231
|
return new Promise( /*#__PURE__*/function () {
|
|
252228
252232
|
var _ref21 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve) {
|
|
252229
|
-
var _yield$
|
|
252233
|
+
var _yield$_this6$$axios$, data, tempObj;
|
|
252230
252234
|
|
|
252231
252235
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
252232
252236
|
while (1) {
|
|
@@ -252238,17 +252242,17 @@ var component = normalizeComponent(
|
|
|
252238
252242
|
}
|
|
252239
252243
|
|
|
252240
252244
|
delete row.activeValue;
|
|
252241
|
-
resolve(
|
|
252245
|
+
resolve(_this6.treeTempData);
|
|
252242
252246
|
_context.next = 10;
|
|
252243
252247
|
break;
|
|
252244
252248
|
|
|
252245
252249
|
case 5:
|
|
252246
252250
|
_context.next = 7;
|
|
252247
|
-
return
|
|
252251
|
+
return _this6.$axios.post(_this6.treeTypeConfig.path + row.path, _this6.lazyLoadParams);
|
|
252248
252252
|
|
|
252249
252253
|
case 7:
|
|
252250
|
-
_yield$
|
|
252251
|
-
data = _yield$
|
|
252254
|
+
_yield$_this6$$axios$ = _context.sent;
|
|
252255
|
+
data = _yield$_this6$$axios$.data;
|
|
252252
252256
|
|
|
252253
252257
|
if (data[0].Result > 0) {
|
|
252254
252258
|
resolve(data[0].DataArray);
|
|
@@ -252278,10 +252282,10 @@ var component = normalizeComponent(
|
|
|
252278
252282
|
}());
|
|
252279
252283
|
},
|
|
252280
252284
|
setTreeTempData: function setTreeTempData(data) {
|
|
252281
|
-
var
|
|
252285
|
+
var _this7 = this;
|
|
252282
252286
|
|
|
252283
252287
|
return new Promise(function (resolve) {
|
|
252284
|
-
|
|
252288
|
+
_this7.treeTempData = data;
|
|
252285
252289
|
setTimeout(function () {
|
|
252286
252290
|
resolve();
|
|
252287
252291
|
}, 0);
|
|
@@ -252318,13 +252322,13 @@ var component = normalizeComponent(
|
|
|
252318
252322
|
},
|
|
252319
252323
|
//初始化隐藏列
|
|
252320
252324
|
hideColumn: function hideColumn(arr) {
|
|
252321
|
-
var
|
|
252325
|
+
var _this8 = this;
|
|
252322
252326
|
|
|
252323
252327
|
this.$nextTick(function () {
|
|
252324
252328
|
arr.forEach(function (item) {
|
|
252325
|
-
var col =
|
|
252329
|
+
var col = _this8.$refs[_this8.id].getColumnByField(item);
|
|
252326
252330
|
|
|
252327
|
-
|
|
252331
|
+
_this8.$refs[_this8.id].hideColumn(col);
|
|
252328
252332
|
});
|
|
252329
252333
|
});
|
|
252330
252334
|
},
|
|
@@ -252389,11 +252393,11 @@ var component = normalizeComponent(
|
|
|
252389
252393
|
},
|
|
252390
252394
|
//树添加数据方法
|
|
252391
252395
|
treeAdd: function treeAdd(id, obj) {
|
|
252392
|
-
var
|
|
252396
|
+
var _this9 = this;
|
|
252393
252397
|
|
|
252394
252398
|
var xTree = this.$refs[this.id];
|
|
252395
252399
|
xTree.createRow(obj).then(function (newRow) {
|
|
252396
|
-
var matchObj = xe_utils_default.a.findTree(
|
|
252400
|
+
var matchObj = xe_utils_default.a.findTree(_this9.data.DataArray, function (item) {
|
|
252397
252401
|
return item.pkid === id;
|
|
252398
252402
|
}, {
|
|
252399
252403
|
children: "children"
|
package/lib/jtui.umd.js
CHANGED
|
@@ -250044,7 +250044,7 @@ var es_function_name = __webpack_require__("b0c0");
|
|
|
250044
250044
|
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
|
|
250045
250045
|
var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
|
|
250046
250046
|
|
|
250047
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"09b5e250-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/jt-table/index.vue?vue&type=template&id=
|
|
250047
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"09b5e250-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/jt-table/index.vue?vue&type=template&id=f923a0f6&
|
|
250048
250048
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"tableStyle-2",class:_vm.isWrap ? 'isWrap' : '',staticStyle:{"position":"absolute","top":"1px","left":"1px","right":"1px","bottom":"1px"}},[(_vm.isTool)?_c('div',{staticStyle:{"position":"relative"}},[_c('vxe-toolbar',{staticClass:"jt-toolbar",attrs:{"custom":{ icon: 'jtIcon iconpeizhi41 colStyle' }}})],1):_vm._e(),_c('div',{staticStyle:{"width":"100%","height":"100%","position":"relative"}},[(_vm.isShowEmpty)?_c('div',{staticClass:"cus-empty-box"},[_c('el-empty',{attrs:{"image-size":200},scopedSlots:_vm._u([{key:"description",fn:function(){return [_c('p',{staticStyle:{"font-size":"30px"}},[_vm._v("暂无数据")])]},proxy:true}],null,false,1618345459)})],1):_vm._e(),(_vm.tableType === 'default')?_c('vxe-table',{ref:_vm.id,staticClass:"jt-table-class-only",attrs:{"height":"auto","size":"mini","show-overflow":"","show-header-overflow":"","auto-resize":"","resizable":"","highlight-current-row":"","highlight-current-column":"","keep-source":"","empty-text":" ","id":_vm.id,"data":_vm.data.DataArray,"stripe":_vm.stripe,"border":_vm.border,"max-height":_vm.maxHeight,"show-footer":_vm.isFooter,"footer-method":_vm.footerMethod,"footer-span-method":_vm.footerColspanMethod,"footer-cell-class-name":_vm.footerCellClassName,"loading":_vm.loading,"row-style":_vm.rowStyle,"cell-style":_vm.cellStyle_m,"header-cell-class-name":_vm.headerClass,"span-method":_vm.spanMethod,"scroll-y":{ mode: 'wheel' },"sort-config":{ sortMethod: _vm.sortMethod },"radio-config":{ checkRowKey: null },"keyboard-config":{ isArrow: true },"checkbox-config":{ highlight: true },"export-config":{
|
|
250049
250049
|
type: 'xlsx',
|
|
250050
250050
|
types: ['xlsx', 'csv', 'html', 'xml', 'txt'],
|
|
@@ -250144,7 +250144,7 @@ return [(_vm.handlerConfig.btnGroup)?_c('el-dropdown',[_c('el-button',{attrs:{"s
|
|
|
250144
250144
|
var staticRenderFns = []
|
|
250145
250145
|
|
|
250146
250146
|
|
|
250147
|
-
// CONCATENATED MODULE: ./packages/jt-table/index.vue?vue&type=template&id=
|
|
250147
|
+
// CONCATENATED MODULE: ./packages/jt-table/index.vue?vue&type=template&id=f923a0f6&
|
|
250148
250148
|
|
|
250149
250149
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.concat.js
|
|
250150
250150
|
var es_array_concat = __webpack_require__("99af");
|
|
@@ -251584,18 +251584,22 @@ var component = normalizeComponent(
|
|
|
251584
251584
|
loading: {
|
|
251585
251585
|
deep: true,
|
|
251586
251586
|
handler: function handler(n) {
|
|
251587
|
+
var _this = this;
|
|
251588
|
+
|
|
251587
251589
|
if (this.$refs[this.id]) {
|
|
251588
|
-
|
|
251590
|
+
setTimeout(function () {
|
|
251591
|
+
var temp = _this.$refs[_this.id].getTableData();
|
|
251589
251592
|
|
|
251590
|
-
|
|
251591
|
-
|
|
251592
|
-
} else {
|
|
251593
|
-
if (n) {
|
|
251594
|
-
this.isShowEmpty = false;
|
|
251593
|
+
if (temp.fullData.length > 0) {
|
|
251594
|
+
_this.isShowEmpty = false;
|
|
251595
251595
|
} else {
|
|
251596
|
-
|
|
251596
|
+
if (n) {
|
|
251597
|
+
_this.isShowEmpty = false;
|
|
251598
|
+
} else {
|
|
251599
|
+
_this.isShowEmpty = true;
|
|
251600
|
+
}
|
|
251597
251601
|
}
|
|
251598
|
-
}
|
|
251602
|
+
}, 1000);
|
|
251599
251603
|
} else {
|
|
251600
251604
|
this.isShowEmpty = false;
|
|
251601
251605
|
}
|
|
@@ -251847,7 +251851,7 @@ var component = normalizeComponent(
|
|
|
251847
251851
|
},
|
|
251848
251852
|
//表尾统计,(计算平均值和求和)
|
|
251849
251853
|
footerMethod: function footerMethod(_ref4) {
|
|
251850
|
-
var
|
|
251854
|
+
var _this2 = this;
|
|
251851
251855
|
|
|
251852
251856
|
var columns = _ref4.columns,
|
|
251853
251857
|
data = _ref4.data;
|
|
@@ -251861,7 +251865,7 @@ var component = normalizeComponent(
|
|
|
251861
251865
|
var meanCell = null;
|
|
251862
251866
|
var sumCell = null;
|
|
251863
251867
|
|
|
251864
|
-
|
|
251868
|
+
_this2.footConfig.filed.forEach(function (i) {
|
|
251865
251869
|
switch (column.property) {
|
|
251866
251870
|
case i:
|
|
251867
251871
|
meanCell = parseInt(xe_utils_default.a.mean(data, column.property));
|
|
@@ -251975,7 +251979,7 @@ var component = normalizeComponent(
|
|
|
251975
251979
|
},
|
|
251976
251980
|
//滚动到底事件派发
|
|
251977
251981
|
scroll: function scroll(param) {
|
|
251978
|
-
var
|
|
251982
|
+
var _this3 = this;
|
|
251979
251983
|
|
|
251980
251984
|
var scrollTop = param.scrollTop,
|
|
251981
251985
|
$event = param.$event;
|
|
@@ -251985,7 +251989,7 @@ var component = normalizeComponent(
|
|
|
251985
251989
|
var sh = $event.target.scrollHeight;
|
|
251986
251990
|
|
|
251987
251991
|
if (Math.ceil(scrollTop + ch) >= sh && scrollTop != 0) {
|
|
251988
|
-
|
|
251992
|
+
_this3.$emit("scrollBottom", ++_this3.pageIndex);
|
|
251989
251993
|
}
|
|
251990
251994
|
}, 200);
|
|
251991
251995
|
},
|
|
@@ -252084,20 +252088,20 @@ var component = normalizeComponent(
|
|
|
252084
252088
|
},
|
|
252085
252089
|
//普通表格转树表(仅支持一层)
|
|
252086
252090
|
default2tree: function default2tree(data, field) {
|
|
252087
|
-
var
|
|
252091
|
+
var _this4 = this;
|
|
252088
252092
|
|
|
252089
252093
|
var result = [];
|
|
252090
252094
|
this.treeField = this.data.retjson.header[0].prop;
|
|
252091
252095
|
xe_utils_default.a.each(xe_utils_default.a.groupBy(data, field), function (childs, key) {
|
|
252092
252096
|
var _result$push;
|
|
252093
252097
|
|
|
252094
|
-
result.push((_result$push = {}, _defineProperty(_result$push,
|
|
252098
|
+
result.push((_result$push = {}, _defineProperty(_result$push, _this4.treeField, key + "\uFF08 ".concat(childs.length, " \uFF09")), _defineProperty(_result$push, "children", childs), _result$push));
|
|
252095
252099
|
});
|
|
252096
252100
|
this.data.DataArray = result;
|
|
252097
252101
|
|
|
252098
252102
|
if (this.isExpand) {
|
|
252099
252103
|
this.$nextTick(function () {
|
|
252100
|
-
|
|
252104
|
+
_this4.setAllTreeExpand();
|
|
252101
252105
|
});
|
|
252102
252106
|
}
|
|
252103
252107
|
},
|
|
@@ -252174,7 +252178,7 @@ var component = normalizeComponent(
|
|
|
252174
252178
|
},
|
|
252175
252179
|
//树表滚动分页+性能优化
|
|
252176
252180
|
scroll1: function scroll1(param) {
|
|
252177
|
-
var
|
|
252181
|
+
var _this5 = this;
|
|
252178
252182
|
|
|
252179
252183
|
var scrollTop = param.scrollTop,
|
|
252180
252184
|
$event = param.$event;
|
|
@@ -252182,24 +252186,24 @@ var component = normalizeComponent(
|
|
|
252182
252186
|
this.timeOut = setTimeout(function () {
|
|
252183
252187
|
var ch = $event.target.clientHeight;
|
|
252184
252188
|
var sh = $event.target.scrollHeight;
|
|
252185
|
-
var temp = scrollTop -
|
|
252186
|
-
|
|
252189
|
+
var temp = scrollTop - _this5.sp;
|
|
252190
|
+
_this5.sp = scrollTop;
|
|
252187
252191
|
|
|
252188
252192
|
if (temp < 0 && scrollTop <= 0) {
|
|
252189
|
-
if (
|
|
252190
|
-
|
|
252193
|
+
if (_this5.tPageIndex > 1) {
|
|
252194
|
+
_this5.tPageIndex--;
|
|
252191
252195
|
|
|
252192
|
-
|
|
252196
|
+
_this5.dataSliceUp(_this5.tPageIndex);
|
|
252193
252197
|
|
|
252194
|
-
|
|
252198
|
+
_this5.$refs[_this5.id].scrollTo(null, (sh - ch) / 2);
|
|
252195
252199
|
}
|
|
252196
252200
|
} else if (temp >= 0 && scrollTop + ch >= sh) {
|
|
252197
|
-
if (
|
|
252198
|
-
|
|
252201
|
+
if (_this5.tPageIndex < _this5.pageTotal) {
|
|
252202
|
+
_this5.tPageIndex++;
|
|
252199
252203
|
|
|
252200
|
-
|
|
252204
|
+
_this5.dataSliceDown(_this5.tPageIndex);
|
|
252201
252205
|
|
|
252202
|
-
|
|
252206
|
+
_this5.$refs[_this5.id].scrollTo(null, (sh - ch) / 2);
|
|
252203
252207
|
}
|
|
252204
252208
|
}
|
|
252205
252209
|
}, 200);
|
|
@@ -252230,12 +252234,12 @@ var component = normalizeComponent(
|
|
|
252230
252234
|
// },
|
|
252231
252235
|
//树 懒加载方法
|
|
252232
252236
|
loadChildrenMethod: function loadChildrenMethod(_ref20) {
|
|
252233
|
-
var
|
|
252237
|
+
var _this6 = this;
|
|
252234
252238
|
|
|
252235
252239
|
var row = _ref20.row;
|
|
252236
252240
|
return new Promise( /*#__PURE__*/function () {
|
|
252237
252241
|
var _ref21 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve) {
|
|
252238
|
-
var _yield$
|
|
252242
|
+
var _yield$_this6$$axios$, data, tempObj;
|
|
252239
252243
|
|
|
252240
252244
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
252241
252245
|
while (1) {
|
|
@@ -252247,17 +252251,17 @@ var component = normalizeComponent(
|
|
|
252247
252251
|
}
|
|
252248
252252
|
|
|
252249
252253
|
delete row.activeValue;
|
|
252250
|
-
resolve(
|
|
252254
|
+
resolve(_this6.treeTempData);
|
|
252251
252255
|
_context.next = 10;
|
|
252252
252256
|
break;
|
|
252253
252257
|
|
|
252254
252258
|
case 5:
|
|
252255
252259
|
_context.next = 7;
|
|
252256
|
-
return
|
|
252260
|
+
return _this6.$axios.post(_this6.treeTypeConfig.path + row.path, _this6.lazyLoadParams);
|
|
252257
252261
|
|
|
252258
252262
|
case 7:
|
|
252259
|
-
_yield$
|
|
252260
|
-
data = _yield$
|
|
252263
|
+
_yield$_this6$$axios$ = _context.sent;
|
|
252264
|
+
data = _yield$_this6$$axios$.data;
|
|
252261
252265
|
|
|
252262
252266
|
if (data[0].Result > 0) {
|
|
252263
252267
|
resolve(data[0].DataArray);
|
|
@@ -252287,10 +252291,10 @@ var component = normalizeComponent(
|
|
|
252287
252291
|
}());
|
|
252288
252292
|
},
|
|
252289
252293
|
setTreeTempData: function setTreeTempData(data) {
|
|
252290
|
-
var
|
|
252294
|
+
var _this7 = this;
|
|
252291
252295
|
|
|
252292
252296
|
return new Promise(function (resolve) {
|
|
252293
|
-
|
|
252297
|
+
_this7.treeTempData = data;
|
|
252294
252298
|
setTimeout(function () {
|
|
252295
252299
|
resolve();
|
|
252296
252300
|
}, 0);
|
|
@@ -252327,13 +252331,13 @@ var component = normalizeComponent(
|
|
|
252327
252331
|
},
|
|
252328
252332
|
//初始化隐藏列
|
|
252329
252333
|
hideColumn: function hideColumn(arr) {
|
|
252330
|
-
var
|
|
252334
|
+
var _this8 = this;
|
|
252331
252335
|
|
|
252332
252336
|
this.$nextTick(function () {
|
|
252333
252337
|
arr.forEach(function (item) {
|
|
252334
|
-
var col =
|
|
252338
|
+
var col = _this8.$refs[_this8.id].getColumnByField(item);
|
|
252335
252339
|
|
|
252336
|
-
|
|
252340
|
+
_this8.$refs[_this8.id].hideColumn(col);
|
|
252337
252341
|
});
|
|
252338
252342
|
});
|
|
252339
252343
|
},
|
|
@@ -252398,11 +252402,11 @@ var component = normalizeComponent(
|
|
|
252398
252402
|
},
|
|
252399
252403
|
//树添加数据方法
|
|
252400
252404
|
treeAdd: function treeAdd(id, obj) {
|
|
252401
|
-
var
|
|
252405
|
+
var _this9 = this;
|
|
252402
252406
|
|
|
252403
252407
|
var xTree = this.$refs[this.id];
|
|
252404
252408
|
xTree.createRow(obj).then(function (newRow) {
|
|
252405
|
-
var matchObj = xe_utils_default.a.findTree(
|
|
252409
|
+
var matchObj = xe_utils_default.a.findTree(_this9.data.DataArray, function (item) {
|
|
252406
252410
|
return item.pkid === id;
|
|
252407
252411
|
}, {
|
|
252408
252412
|
children: "children"
|