eoss-ui 0.4.69 → 0.4.70
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/data-table.js +15 -9
- package/lib/eoss-ui.common.js +79 -71
- package/lib/flow-group.js +10 -7
- package/lib/form.js +2 -29
- package/lib/index.js +1 -1
- package/lib/tree.js +34 -8
- package/package.json +1 -1
- package/packages/data-table/src/main.vue +6 -2
- package/packages/flow-group/src/main.vue +8 -5
- package/packages/form/src/main.vue +0 -10
- package/packages/tree/src/main.vue +34 -6
- package/src/index.js +1 -1
package/lib/tree.js
CHANGED
|
@@ -2886,7 +2886,7 @@ module.exports = require("json-bigint");
|
|
|
2886
2886
|
// ESM COMPAT FLAG
|
|
2887
2887
|
__webpack_require__.r(__webpack_exports__);
|
|
2888
2888
|
|
|
2889
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/main.vue?vue&type=template&id=
|
|
2889
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/main.vue?vue&type=template&id=1caf3025&
|
|
2890
2890
|
var render = function () {
|
|
2891
2891
|
var _vm = this
|
|
2892
2892
|
var _h = _vm.$createElement
|
|
@@ -3034,6 +3034,7 @@ var render = function () {
|
|
|
3034
3034
|
"expand-on-click-node": false,
|
|
3035
3035
|
"highlight-current": true,
|
|
3036
3036
|
"show-checkbox": _vm.showCheckbox,
|
|
3037
|
+
"default-checked-keys": _vm.defaultCheckeds,
|
|
3037
3038
|
"current-node-key": _vm.currentNodeKey,
|
|
3038
3039
|
},
|
|
3039
3040
|
scopedSlots: _vm._u([
|
|
@@ -3079,7 +3080,7 @@ var staticRenderFns = []
|
|
|
3079
3080
|
render._withStripped = true
|
|
3080
3081
|
|
|
3081
3082
|
|
|
3082
|
-
// CONCATENATED MODULE: ./packages/tree/src/main.vue?vue&type=template&id=
|
|
3083
|
+
// CONCATENATED MODULE: ./packages/tree/src/main.vue?vue&type=template&id=1caf3025&
|
|
3083
3084
|
|
|
3084
3085
|
// EXTERNAL MODULE: ./src/config/api.js
|
|
3085
3086
|
var api = __webpack_require__(2);
|
|
@@ -3172,6 +3173,7 @@ var util = __webpack_require__(0);
|
|
|
3172
3173
|
//
|
|
3173
3174
|
//
|
|
3174
3175
|
//
|
|
3176
|
+
//
|
|
3175
3177
|
|
|
3176
3178
|
|
|
3177
3179
|
|
|
@@ -3232,7 +3234,9 @@ var util = __webpack_require__(0);
|
|
|
3232
3234
|
},
|
|
3233
3235
|
// 选择项本地数据
|
|
3234
3236
|
data: Array,
|
|
3237
|
+
//是否选中首级节点
|
|
3235
3238
|
currentFirst: Boolean,
|
|
3239
|
+
//当前选中的节点
|
|
3236
3240
|
currentNodeKey: [String, Number],
|
|
3237
3241
|
icon: {
|
|
3238
3242
|
type: Boolean,
|
|
@@ -3312,10 +3316,20 @@ var util = __webpack_require__(0);
|
|
|
3312
3316
|
return {};
|
|
3313
3317
|
}
|
|
3314
3318
|
},
|
|
3319
|
+
//节点是否可被选择
|
|
3315
3320
|
showCheckbox: {
|
|
3316
3321
|
type: Boolean,
|
|
3317
3322
|
default: false
|
|
3318
3323
|
},
|
|
3324
|
+
//是否勾选首级节点
|
|
3325
|
+
checkedFirst: Boolean,
|
|
3326
|
+
//默认勾选的节点的 key 的数组
|
|
3327
|
+
defaultCheckedKeys: {
|
|
3328
|
+
type: Array,
|
|
3329
|
+
default: function _default() {
|
|
3330
|
+
return [];
|
|
3331
|
+
}
|
|
3332
|
+
},
|
|
3319
3333
|
multiple: {
|
|
3320
3334
|
type: Boolean,
|
|
3321
3335
|
default: false
|
|
@@ -3383,7 +3397,8 @@ var util = __webpack_require__(0);
|
|
|
3383
3397
|
loading: false,
|
|
3384
3398
|
searchValue: '',
|
|
3385
3399
|
expandedKeys: [],
|
|
3386
|
-
treeList: []
|
|
3400
|
+
treeList: [],
|
|
3401
|
+
checkedKeys: this.defaultCheckedKeys
|
|
3387
3402
|
};
|
|
3388
3403
|
},
|
|
3389
3404
|
|
|
@@ -3410,6 +3425,9 @@ var util = __webpack_require__(0);
|
|
|
3410
3425
|
return false;
|
|
3411
3426
|
}
|
|
3412
3427
|
return this.remote;
|
|
3428
|
+
},
|
|
3429
|
+
defaultCheckeds: function defaultCheckeds() {
|
|
3430
|
+
return [].concat(this.defaultCheckedKeys, this.checkedKeys);
|
|
3413
3431
|
}
|
|
3414
3432
|
},
|
|
3415
3433
|
watch: {
|
|
@@ -3458,21 +3476,28 @@ var util = __webpack_require__(0);
|
|
|
3458
3476
|
}).then(function (res) {
|
|
3459
3477
|
_this.loading = false;
|
|
3460
3478
|
if (res.rCode === 0) {
|
|
3461
|
-
|
|
3479
|
+
var treeList = JSON.parse(JSON.stringify(res.results));
|
|
3480
|
+
_this.$emit('results', treeList);
|
|
3462
3481
|
if (_this.currentFirst) {
|
|
3463
|
-
var currentNode =
|
|
3464
|
-
_this
|
|
3465
|
-
if (!_this.currentNodeKey) {
|
|
3482
|
+
var currentNode = treeList[0].id;
|
|
3483
|
+
if (!_this.currentNodeKey && _this.currentNodeKey != 0) {
|
|
3466
3484
|
_this.$nextTick(function () {
|
|
3467
3485
|
_this.$refs.oaTree.setCurrentKey(currentNode);
|
|
3468
3486
|
});
|
|
3469
3487
|
}
|
|
3470
3488
|
}
|
|
3471
|
-
|
|
3489
|
+
if (_this.checkedFirst) {
|
|
3490
|
+
var checkedNode = treeList[0].id;
|
|
3491
|
+
if (_this.defaultCheckedKeys && _this.defaultCheckedKeys.indexOf(checkedNode) == -1) {
|
|
3492
|
+
_this.checkedKeys = [checkedNode];
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3495
|
+
_this.expandedKeys = treeList.filter(function (item) {
|
|
3472
3496
|
if (item.open) {
|
|
3473
3497
|
return item.id;
|
|
3474
3498
|
}
|
|
3475
3499
|
});
|
|
3500
|
+
_this.treeList = treeList;
|
|
3476
3501
|
}
|
|
3477
3502
|
}).catch(function (err) {
|
|
3478
3503
|
if (err.message && err.message !== 'canceled') {
|
|
@@ -3510,6 +3535,7 @@ var util = __webpack_require__(0);
|
|
|
3510
3535
|
if (res.rCode === 0) {
|
|
3511
3536
|
_this2.loading = false;
|
|
3512
3537
|
var results = JSON.parse(JSON.stringify(res.results));
|
|
3538
|
+
_this2.$emit('sub-results', results);
|
|
3513
3539
|
if (Array.isArray(results)) {
|
|
3514
3540
|
if (data.id === results[0].id) {
|
|
3515
3541
|
_this2.$set(data, 'children', results[0].children);
|
package/package.json
CHANGED
|
@@ -1206,7 +1206,7 @@ export default {
|
|
|
1206
1206
|
this.getTableData({ where: obj && obj.where ? obj.where : {}, first });
|
|
1207
1207
|
}
|
|
1208
1208
|
},
|
|
1209
|
-
resetHeight() {
|
|
1209
|
+
resetHeight(warn) {
|
|
1210
1210
|
if (this.full && !this.height && !this.maxHeight) {
|
|
1211
1211
|
let height = parseInt(util.getStyle(this.$el.parentNode, 'height'), 10);
|
|
1212
1212
|
height =
|
|
@@ -1246,8 +1246,12 @@ export default {
|
|
|
1246
1246
|
}
|
|
1247
1247
|
if (height > 1 && height - eht > 1) {
|
|
1248
1248
|
this.tableHeight = height;
|
|
1249
|
-
} else {
|
|
1249
|
+
} else if (warn) {
|
|
1250
1250
|
console.warn(this.$el.parentNode, `获取不到高度!`);
|
|
1251
|
+
} else {
|
|
1252
|
+
this.$nextTick(() => {
|
|
1253
|
+
this.resetHeight(true);
|
|
1254
|
+
});
|
|
1251
1255
|
}
|
|
1252
1256
|
}
|
|
1253
1257
|
},
|
|
@@ -399,8 +399,7 @@
|
|
|
399
399
|
<es-flow
|
|
400
400
|
v-if="isShow"
|
|
401
401
|
class="es-group-flow"
|
|
402
|
-
|
|
403
|
-
v-bind="flow"
|
|
402
|
+
v-bind="_flow"
|
|
404
403
|
:style="{ width: _width }"
|
|
405
404
|
:before-submit="handleSubmit"
|
|
406
405
|
:businessId="businessId"
|
|
@@ -486,6 +485,11 @@ export default {
|
|
|
486
485
|
},
|
|
487
486
|
_width() {
|
|
488
487
|
return parseInt(this.width, 10) + 'px';
|
|
488
|
+
},
|
|
489
|
+
_flow() {
|
|
490
|
+
return !this.flow.pendingId
|
|
491
|
+
? { ...this.flow, pendingId: this.pendingId }
|
|
492
|
+
: this.flow;
|
|
489
493
|
}
|
|
490
494
|
},
|
|
491
495
|
watch: {
|
|
@@ -497,9 +501,8 @@ export default {
|
|
|
497
501
|
}
|
|
498
502
|
},
|
|
499
503
|
created() {
|
|
500
|
-
if (this.flow.businessId || this.
|
|
501
|
-
this.businessId =
|
|
502
|
-
this.flow.businessId || this.pendingId || this.flow.pendingId;
|
|
504
|
+
if (this.flow.businessId || this.flow.pendingId) {
|
|
505
|
+
this.businessId = this.flow.businessId || this.flow.pendingId;
|
|
503
506
|
}
|
|
504
507
|
},
|
|
505
508
|
mounted() {},
|
|
@@ -357,16 +357,6 @@
|
|
|
357
357
|
v-model="models[item.name]"
|
|
358
358
|
:plain="item.plain || item.name === undefined"
|
|
359
359
|
:readonly="readonly ? readonly : item.readonly"
|
|
360
|
-
@blur="
|
|
361
|
-
(event) => {
|
|
362
|
-
handleBlur(item, event);
|
|
363
|
-
}
|
|
364
|
-
"
|
|
365
|
-
@focus="
|
|
366
|
-
(event) => {
|
|
367
|
-
handleFocus(item, event);
|
|
368
|
-
}
|
|
369
|
-
"
|
|
370
360
|
@change="
|
|
371
361
|
(val) => {
|
|
372
362
|
handleChange(item, val);
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
:expand-on-click-node="false"
|
|
62
62
|
:highlight-current="true"
|
|
63
63
|
:show-checkbox="showCheckbox"
|
|
64
|
+
:default-checked-keys="defaultCheckeds"
|
|
64
65
|
:current-node-key="currentNodeKey"
|
|
65
66
|
v-on="{
|
|
66
67
|
...$listeners,
|
|
@@ -160,7 +161,9 @@ export default {
|
|
|
160
161
|
},
|
|
161
162
|
// 选择项本地数据
|
|
162
163
|
data: Array,
|
|
164
|
+
//是否选中首级节点
|
|
163
165
|
currentFirst: Boolean,
|
|
166
|
+
//当前选中的节点
|
|
164
167
|
currentNodeKey: [String, Number],
|
|
165
168
|
icon: {
|
|
166
169
|
type: Boolean,
|
|
@@ -240,10 +243,20 @@ export default {
|
|
|
240
243
|
return {};
|
|
241
244
|
}
|
|
242
245
|
},
|
|
246
|
+
//节点是否可被选择
|
|
243
247
|
showCheckbox: {
|
|
244
248
|
type: Boolean,
|
|
245
249
|
default: false
|
|
246
250
|
},
|
|
251
|
+
//是否勾选首级节点
|
|
252
|
+
checkedFirst: Boolean,
|
|
253
|
+
//默认勾选的节点的 key 的数组
|
|
254
|
+
defaultCheckedKeys: {
|
|
255
|
+
type: Array,
|
|
256
|
+
default() {
|
|
257
|
+
return [];
|
|
258
|
+
}
|
|
259
|
+
},
|
|
247
260
|
multiple: {
|
|
248
261
|
type: Boolean,
|
|
249
262
|
default: false
|
|
@@ -311,7 +324,8 @@ export default {
|
|
|
311
324
|
loading: false,
|
|
312
325
|
searchValue: '',
|
|
313
326
|
expandedKeys: [],
|
|
314
|
-
treeList: []
|
|
327
|
+
treeList: [],
|
|
328
|
+
checkedKeys: this.defaultCheckedKeys
|
|
315
329
|
};
|
|
316
330
|
},
|
|
317
331
|
computed: {
|
|
@@ -337,6 +351,9 @@ export default {
|
|
|
337
351
|
return false;
|
|
338
352
|
}
|
|
339
353
|
return this.remote;
|
|
354
|
+
},
|
|
355
|
+
defaultCheckeds() {
|
|
356
|
+
return [...this.defaultCheckedKeys, ...this.checkedKeys];
|
|
340
357
|
}
|
|
341
358
|
},
|
|
342
359
|
watch: {
|
|
@@ -383,21 +400,31 @@ export default {
|
|
|
383
400
|
.then((res) => {
|
|
384
401
|
this.loading = false;
|
|
385
402
|
if (res.rCode === 0) {
|
|
386
|
-
|
|
403
|
+
let treeList = JSON.parse(JSON.stringify(res.results));
|
|
404
|
+
this.$emit('results', treeList);
|
|
387
405
|
if (this.currentFirst) {
|
|
388
|
-
let currentNode =
|
|
389
|
-
this
|
|
390
|
-
if (!this.currentNodeKey) {
|
|
406
|
+
let currentNode = treeList[0].id;
|
|
407
|
+
if (!this.currentNodeKey && this.currentNodeKey != 0) {
|
|
391
408
|
this.$nextTick(() => {
|
|
392
409
|
this.$refs.oaTree.setCurrentKey(currentNode);
|
|
393
410
|
});
|
|
394
411
|
}
|
|
395
412
|
}
|
|
396
|
-
|
|
413
|
+
if (this.checkedFirst) {
|
|
414
|
+
let checkedNode = treeList[0].id;
|
|
415
|
+
if (
|
|
416
|
+
this.defaultCheckedKeys &&
|
|
417
|
+
this.defaultCheckedKeys.indexOf(checkedNode) == -1
|
|
418
|
+
) {
|
|
419
|
+
this.checkedKeys = [checkedNode];
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
this.expandedKeys = treeList.filter((item) => {
|
|
397
423
|
if (item.open) {
|
|
398
424
|
return item.id;
|
|
399
425
|
}
|
|
400
426
|
});
|
|
427
|
+
this.treeList = treeList;
|
|
401
428
|
}
|
|
402
429
|
})
|
|
403
430
|
.catch((err) => {
|
|
@@ -437,6 +464,7 @@ export default {
|
|
|
437
464
|
if (res.rCode === 0) {
|
|
438
465
|
this.loading = false;
|
|
439
466
|
let results = JSON.parse(JSON.stringify(res.results));
|
|
467
|
+
this.$emit('sub-results', results);
|
|
440
468
|
if (Array.isArray(results)) {
|
|
441
469
|
if (data.id === results[0].id) {
|
|
442
470
|
this.$set(data, 'children', results[0].children);
|