eoss-ui 0.5.12 → 0.5.14
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/button-group.js +1 -13
- package/lib/button.js +3 -15
- package/lib/cascader.js +2 -2
- package/lib/checkbox-group.js +40 -34
- package/lib/data-table-form.js +4 -15
- package/lib/data-table.js +1219 -1529
- package/lib/date-picker.js +3 -15
- package/lib/dialog.js +10 -22
- package/lib/eoss-ui.common.js +1282 -1818
- package/lib/flow-group.js +1 -13
- package/lib/flow-list.js +3 -15
- package/lib/flow.js +43 -54
- package/lib/form.js +5 -22
- package/lib/handle-user.js +1 -13
- package/lib/handler.js +1 -13
- package/lib/icons.js +2 -2
- package/lib/index.js +1 -1
- package/lib/input-number.js +3 -15
- package/lib/input.js +3 -15
- package/lib/label.js +5 -4
- package/lib/layout.js +166 -152
- package/lib/login.js +1 -13
- package/lib/main.js +15 -24
- package/lib/menu.js +2 -2
- package/lib/nav.js +10 -22
- package/lib/notify.js +2 -2
- package/lib/page.js +3 -15
- package/lib/pagination.js +2 -2
- package/lib/player.js +9 -21
- package/lib/qr-code.js +5 -17
- package/lib/radio-group.js +44 -34
- package/lib/retrial-auth.js +3 -15
- package/lib/select-ganged.js +26 -18
- package/lib/select.js +42 -31
- package/lib/selector-panel.js +7 -18
- package/lib/selector.js +5 -17
- package/lib/sizer.js +3 -15
- package/lib/steps.js +10 -22
- package/lib/switch.js +3 -15
- package/lib/table-form.js +3 -15
- package/lib/tabs-panel.js +2 -2
- package/lib/tabs.js +3 -15
- package/lib/theme-chalk/data-table.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/nav.css +1 -1
- package/lib/tips.js +3 -15
- package/lib/toolbar.js +2 -2
- package/lib/tree-group.js +3 -15
- package/lib/tree.js +3 -15
- package/lib/upload.js +4 -16
- package/lib/utils/util.js +1 -10
- package/lib/utils/webSocket.js +0 -3
- package/lib/wujie.js +3 -15
- package/lib/wxlogin.js +3 -15
- package/package.json +1 -1
- package/packages/checkbox-group/src/main.vue +20 -30
- package/packages/data-table/src/children.vue +4 -8
- package/packages/data-table/src/column.vue +522 -575
- package/packages/data-table/src/main.vue +123 -124
- package/packages/flow/src/component/taskUnionExamine.vue +1 -1
- package/packages/flow/src/main.vue +1 -1
- package/packages/flow/src/processForm.vue +1 -1
- package/packages/flow/src/processReject.vue +1 -1
- package/packages/flow/src/startTaskRead.vue +1 -1
- package/packages/form/src/main.vue +2 -7
- package/packages/label/src/main.vue +3 -2
- package/packages/main/src/main.vue +6 -4
- package/packages/radio-group/src/main.vue +20 -30
- package/packages/select/src/main.vue +20 -29
- package/packages/select-ganged/src/main.vue +1 -3
- package/packages/theme-chalk/lib/data-table.css +1 -1
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/nav.css +1 -1
- package/packages/theme-chalk/src/data-table.scss +2 -1
- package/packages/theme-chalk/src/nav.scss +21 -2
- package/src/index.js +1 -1
- package/src/utils/util.js +1 -10
- package/src/utils/webSocket.js +0 -3
- package/packages/data-table/src/mixins/table.js +0 -12
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
3
|
:is="tag"
|
|
4
|
-
ref="esTableForm"
|
|
5
4
|
class="es-data-table"
|
|
6
5
|
label-width="0"
|
|
7
6
|
v-loading="tableLoading"
|
|
@@ -61,85 +60,22 @@
|
|
|
61
60
|
>
|
|
62
61
|
<slot name="prepend"></slot>
|
|
63
62
|
<slot></slot>
|
|
64
|
-
<
|
|
65
|
-
v-if="
|
|
66
|
-
v-bind="{
|
|
67
|
-
type: 'selection',
|
|
68
|
-
width: '55',
|
|
69
|
-
align: 'center',
|
|
70
|
-
fixed: 'left',
|
|
71
|
-
selectable: selectable,
|
|
72
|
-
reserveSelection: reserveSelection,
|
|
73
|
-
filterIcon: getIcon()
|
|
74
|
-
}"
|
|
75
|
-
></el-table-column>
|
|
76
|
-
<el-table-column
|
|
77
|
-
v-if="numbers"
|
|
78
|
-
v-bind="{
|
|
79
|
-
type: 'index',
|
|
80
|
-
label: '序号',
|
|
81
|
-
width: '70',
|
|
82
|
-
align: 'center',
|
|
83
|
-
fixed: 'left',
|
|
84
|
-
index:
|
|
85
|
-
index === true
|
|
86
|
-
? (config.pageNum - 1) * config.pageSize + 1
|
|
87
|
-
: index === false
|
|
88
|
-
? 1
|
|
89
|
-
: index,
|
|
90
|
-
filterIcon: getIcon()
|
|
91
|
-
}"
|
|
92
|
-
></el-table-column>
|
|
93
|
-
<template v-for="(items, indexs) in theads">
|
|
94
|
-
<template v-if="items.hide !== true">
|
|
63
|
+
<template v-for="(item, index) in theads">
|
|
64
|
+
<template v-if="item.hide !== true">
|
|
95
65
|
<el-table-column
|
|
96
|
-
v-if="
|
|
97
|
-
:key="
|
|
98
|
-
v-bind="
|
|
99
|
-
type: 'index',
|
|
100
|
-
label: '序号',
|
|
101
|
-
width: '70',
|
|
102
|
-
align: 'center',
|
|
103
|
-
fixed: 'left',
|
|
104
|
-
index:
|
|
105
|
-
index === true
|
|
106
|
-
? (config.pageNum - 1) * config.pageSize + 1
|
|
107
|
-
: index === false
|
|
108
|
-
? 1
|
|
109
|
-
: index,
|
|
110
|
-
filterIcon: getIcon(),
|
|
111
|
-
...items
|
|
112
|
-
}"
|
|
113
|
-
></el-table-column>
|
|
114
|
-
<el-table-column
|
|
115
|
-
v-else-if="items.type === 'selection'"
|
|
116
|
-
:key="indexs"
|
|
117
|
-
v-bind="{
|
|
118
|
-
type: 'selection',
|
|
119
|
-
width: '55',
|
|
120
|
-
align: 'center',
|
|
121
|
-
fixed: 'left',
|
|
122
|
-
selectable: selectable,
|
|
123
|
-
reserveSelection: reserveSelection,
|
|
124
|
-
filterIcon: getIcon(),
|
|
125
|
-
...items
|
|
126
|
-
}"
|
|
66
|
+
v-if="item.type === 'index' || item.type === 'selection'"
|
|
67
|
+
:key="index"
|
|
68
|
+
v-bind="item"
|
|
127
69
|
></el-table-column>
|
|
128
70
|
<children
|
|
129
71
|
v-else
|
|
130
|
-
:key="
|
|
72
|
+
:key="item.label || item.title"
|
|
131
73
|
v-bind="{
|
|
132
74
|
name: name,
|
|
133
|
-
|
|
134
|
-
width: items.width,
|
|
135
|
-
index: indexs,
|
|
136
|
-
readonly: readonly,
|
|
137
|
-
optionData: optionDatas,
|
|
75
|
+
indexs: index,
|
|
138
76
|
form: form,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
children: items.children,
|
|
142
|
-
childHead: items.childHead
|
|
77
|
+
optionData: optionDatas,
|
|
78
|
+
...item
|
|
143
79
|
}"
|
|
144
80
|
v-on="{
|
|
145
81
|
handleClick: handleClick,
|
|
@@ -204,6 +140,7 @@ import sizer from './sizer.vue';
|
|
|
204
140
|
import util from 'eoss-ui/src/utils/util';
|
|
205
141
|
import bus from 'eoss-ui/src/utils/bus';
|
|
206
142
|
import qs from 'qs';
|
|
143
|
+
import itemVue from '../../layout/src/item.vue';
|
|
207
144
|
export default {
|
|
208
145
|
name: 'EsDataTable',
|
|
209
146
|
inheritAttrs: false,
|
|
@@ -311,10 +248,6 @@ export default {
|
|
|
311
248
|
type: String,
|
|
312
249
|
default: 'id'
|
|
313
250
|
},
|
|
314
|
-
sizer: {
|
|
315
|
-
type: Boolean,
|
|
316
|
-
default: true
|
|
317
|
-
},
|
|
318
251
|
// 无数据时显示的文本
|
|
319
252
|
emptyText: {
|
|
320
253
|
type: String,
|
|
@@ -415,7 +348,13 @@ export default {
|
|
|
415
348
|
type: Boolean,
|
|
416
349
|
default: true
|
|
417
350
|
},
|
|
418
|
-
zoom: false
|
|
351
|
+
zoom: false,
|
|
352
|
+
exportExcludeLabel: {
|
|
353
|
+
type: Array,
|
|
354
|
+
default() {
|
|
355
|
+
return [];
|
|
356
|
+
}
|
|
357
|
+
}
|
|
419
358
|
},
|
|
420
359
|
data() {
|
|
421
360
|
return {
|
|
@@ -442,7 +381,8 @@ export default {
|
|
|
442
381
|
selected: null,
|
|
443
382
|
options: {},
|
|
444
383
|
icon: true,
|
|
445
|
-
show: true
|
|
384
|
+
show: true,
|
|
385
|
+
sysCodes: []
|
|
446
386
|
};
|
|
447
387
|
},
|
|
448
388
|
computed: {
|
|
@@ -451,12 +391,38 @@ export default {
|
|
|
451
391
|
},
|
|
452
392
|
theads: {
|
|
453
393
|
get() {
|
|
394
|
+
let thead = [];
|
|
395
|
+
if (this.checkbox) {
|
|
396
|
+
thead.push({
|
|
397
|
+
type: 'selection',
|
|
398
|
+
width: '55',
|
|
399
|
+
align: 'center',
|
|
400
|
+
fixed: 'left',
|
|
401
|
+
selectable: this.selectable,
|
|
402
|
+
reserveSelection: this.reserveSelection
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
if (this.numbers) {
|
|
406
|
+
thead.push({
|
|
407
|
+
type: 'index',
|
|
408
|
+
label: '序号',
|
|
409
|
+
width: '70',
|
|
410
|
+
align: 'center',
|
|
411
|
+
fixed: 'left',
|
|
412
|
+
index:
|
|
413
|
+
this.index === true
|
|
414
|
+
? (this.config.pageNum - 1) * this.config.pageSize + 1
|
|
415
|
+
: this.index === false
|
|
416
|
+
? 1
|
|
417
|
+
: this.index
|
|
418
|
+
});
|
|
419
|
+
}
|
|
454
420
|
if (this.theadData.length) {
|
|
455
|
-
this.
|
|
456
|
-
|
|
421
|
+
thead = [...thead, ...this.theadData];
|
|
422
|
+
} else {
|
|
423
|
+
thead = [...thead, ...this.thead];
|
|
457
424
|
}
|
|
458
|
-
|
|
459
|
-
return this.thead;
|
|
425
|
+
return thead;
|
|
460
426
|
},
|
|
461
427
|
set(val) {
|
|
462
428
|
return val;
|
|
@@ -514,9 +480,10 @@ export default {
|
|
|
514
480
|
},
|
|
515
481
|
optionDatas: {
|
|
516
482
|
get() {
|
|
517
|
-
|
|
483
|
+
let data = this.optionData
|
|
518
484
|
? { ...this.optionData, ...this.options }
|
|
519
485
|
: this.options;
|
|
486
|
+
return data;
|
|
520
487
|
},
|
|
521
488
|
set(val) {
|
|
522
489
|
return val;
|
|
@@ -578,7 +545,22 @@ export default {
|
|
|
578
545
|
immediate: true,
|
|
579
546
|
deep: true,
|
|
580
547
|
handler(val) {
|
|
581
|
-
|
|
548
|
+
if (typeof val === 'object') {
|
|
549
|
+
this.config = util.extend({}, this.config, val);
|
|
550
|
+
} else {
|
|
551
|
+
this.config = {
|
|
552
|
+
pageNum: 1,
|
|
553
|
+
pageSize: 20,
|
|
554
|
+
totalCount: 0
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
'config.pageNum'() {
|
|
560
|
+
if (this.data.length) {
|
|
561
|
+
this.$refs.oaTable &&
|
|
562
|
+
this.$refs.oaTable.resetScroll &&
|
|
563
|
+
this.$refs.oaTable.resetScroll(0, 0);
|
|
582
564
|
}
|
|
583
565
|
},
|
|
584
566
|
height: {
|
|
@@ -620,38 +602,11 @@ export default {
|
|
|
620
602
|
const { method, url, params, data } = config;
|
|
621
603
|
return [method, url, qs.stringify(params), qs.stringify(data)].join('&');
|
|
622
604
|
},
|
|
623
|
-
getIcon(res) {
|
|
624
|
-
if (
|
|
625
|
-
this.sizer &&
|
|
626
|
-
this.icon &&
|
|
627
|
-
res !== 'right' &&
|
|
628
|
-
!this.$slots.prepend &&
|
|
629
|
-
!this.$slots.append &&
|
|
630
|
-
!this.$slots.default &&
|
|
631
|
-
!this.form
|
|
632
|
-
) {
|
|
633
|
-
this.icon = false;
|
|
634
|
-
return 'es-icon-biao';
|
|
635
|
-
}
|
|
636
|
-
return false;
|
|
637
|
-
},
|
|
638
|
-
setMinWidth(obj) {
|
|
639
|
-
obj.forEach((item) => {
|
|
640
|
-
if (item.childHead && item.childHead.length) {
|
|
641
|
-
this.setMinWidth(item.childHead);
|
|
642
|
-
} else if (item.children && item.children.length) {
|
|
643
|
-
this.setMinWidth(item.children);
|
|
644
|
-
} else if (!item.width && !item.minWidth && item.title) {
|
|
645
|
-
let width = item.title.length * 14 + 20;
|
|
646
|
-
if (width > 80) {
|
|
647
|
-
this.$set(item, 'minWidth', width);
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
},
|
|
652
605
|
getOptions(res) {
|
|
606
|
+
let sysCodes = [];
|
|
653
607
|
res.forEach((item) => {
|
|
654
608
|
if (item.sysCode || item.url) {
|
|
609
|
+
item.sysCode && sysCodes.push(item.sysCode);
|
|
655
610
|
let params = util.extend(
|
|
656
611
|
{},
|
|
657
612
|
item.sysCode ? { sysAppCode: item.sysCode } : {},
|
|
@@ -674,15 +629,29 @@ export default {
|
|
|
674
629
|
.then((res) => {
|
|
675
630
|
if (res.rCode === 0) {
|
|
676
631
|
if (item.type == 'ganged') {
|
|
677
|
-
this.$set(
|
|
678
|
-
|
|
679
|
-
|
|
632
|
+
this.$set(
|
|
633
|
+
this.options,
|
|
634
|
+
item.sysCode || item.field || item.prop,
|
|
635
|
+
[JSON.parse(JSON.stringify(res.results))]
|
|
636
|
+
);
|
|
637
|
+
if (item.sysCode) {
|
|
638
|
+
bus.$emit(
|
|
639
|
+
item.sysCode,
|
|
640
|
+
JSON.parse(JSON.stringify(this.options[item.sysCode]))
|
|
641
|
+
);
|
|
642
|
+
}
|
|
680
643
|
} else {
|
|
681
644
|
this.$set(
|
|
682
645
|
this.options,
|
|
683
|
-
item.field || item.prop,
|
|
646
|
+
item.sysCode || item.field || item.prop,
|
|
684
647
|
JSON.parse(JSON.stringify(res.results))
|
|
685
648
|
);
|
|
649
|
+
if (item.sysCode) {
|
|
650
|
+
bus.$emit(
|
|
651
|
+
item.sysCode,
|
|
652
|
+
JSON.parse(JSON.stringify(res.results))
|
|
653
|
+
);
|
|
654
|
+
}
|
|
686
655
|
}
|
|
687
656
|
this.requests.push(key);
|
|
688
657
|
} else {
|
|
@@ -705,6 +674,9 @@ export default {
|
|
|
705
674
|
}
|
|
706
675
|
}
|
|
707
676
|
});
|
|
677
|
+
this.sysCodes = sysCodes;
|
|
678
|
+
|
|
679
|
+
this.bindEventBus();
|
|
708
680
|
},
|
|
709
681
|
checkObject(item) {
|
|
710
682
|
return util.getObjectType(item) === 'object';
|
|
@@ -822,10 +794,16 @@ export default {
|
|
|
822
794
|
this.config.pageNum = 1;
|
|
823
795
|
}
|
|
824
796
|
this.tableLoadingText = '加载中...';
|
|
825
|
-
let reqData = util.extend(
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
797
|
+
let reqData = util.extend(
|
|
798
|
+
{},
|
|
799
|
+
this.param,
|
|
800
|
+
this.page
|
|
801
|
+
? {
|
|
802
|
+
pageNum: this.config.pageNum,
|
|
803
|
+
pageSize: this.config.pageSize
|
|
804
|
+
}
|
|
805
|
+
: {}
|
|
806
|
+
);
|
|
829
807
|
if (where) {
|
|
830
808
|
reqData = util.extend({}, reqData, where);
|
|
831
809
|
}
|
|
@@ -841,6 +819,7 @@ export default {
|
|
|
841
819
|
.then((res) => {
|
|
842
820
|
this.tableLoading = false;
|
|
843
821
|
if (res.rCode === 0 || res.status === 'success') {
|
|
822
|
+
this.$refs.oaTable.resetScroll(0, 0);
|
|
844
823
|
let results =
|
|
845
824
|
this.parseData !== undefined
|
|
846
825
|
? this.parseData(res.results || res.data || res)
|
|
@@ -1153,9 +1132,14 @@ export default {
|
|
|
1153
1132
|
) {
|
|
1154
1133
|
text = this.theads[this.theads.length - 1].title;
|
|
1155
1134
|
}
|
|
1135
|
+
let type = ['selection', 'index', 'expand'];
|
|
1156
1136
|
thead = thead.map((item) => {
|
|
1157
1137
|
return item.filter((ele) => {
|
|
1158
|
-
return
|
|
1138
|
+
return (
|
|
1139
|
+
!type.includes(ele.type) &&
|
|
1140
|
+
ele.label !== text &&
|
|
1141
|
+
!this.exportExcludeLabel.includes(ele.label)
|
|
1142
|
+
);
|
|
1159
1143
|
});
|
|
1160
1144
|
});
|
|
1161
1145
|
util.exportXls({
|
|
@@ -1313,7 +1297,7 @@ export default {
|
|
|
1313
1297
|
});
|
|
1314
1298
|
},
|
|
1315
1299
|
validate(callback) {
|
|
1316
|
-
let form = this.elForm || this.$
|
|
1300
|
+
let form = this.elForm || this.$el;
|
|
1317
1301
|
form.validate((valid) => {
|
|
1318
1302
|
callback(valid);
|
|
1319
1303
|
});
|
|
@@ -1339,6 +1323,21 @@ export default {
|
|
|
1339
1323
|
setTimeout(() => {
|
|
1340
1324
|
this.show = true;
|
|
1341
1325
|
}, 100);
|
|
1326
|
+
},
|
|
1327
|
+
setOptions(val, sysCode) {
|
|
1328
|
+
this.$set(this.options, sysCode, val);
|
|
1329
|
+
},
|
|
1330
|
+
bindEventBus() {
|
|
1331
|
+
this.sysCodes.forEach((item) => {
|
|
1332
|
+
bus.$on(item, (val) => {
|
|
1333
|
+
this.setOptions(val, item);
|
|
1334
|
+
});
|
|
1335
|
+
});
|
|
1336
|
+
},
|
|
1337
|
+
unbindEventBus() {
|
|
1338
|
+
this.sysCodes.forEach((item) => {
|
|
1339
|
+
bus.$off(item, this.setOptions);
|
|
1340
|
+
});
|
|
1342
1341
|
}
|
|
1343
1342
|
}
|
|
1344
1343
|
};
|
|
@@ -1197,7 +1197,7 @@ export default {
|
|
|
1197
1197
|
util
|
|
1198
1198
|
.ajax({
|
|
1199
1199
|
url: findCodeValues,
|
|
1200
|
-
params: { ccCode: 'notification_type' }
|
|
1200
|
+
params: { ccCode: 'notification_type',userId:util.getStorage('userId') }
|
|
1201
1201
|
})
|
|
1202
1202
|
.then((res) => {
|
|
1203
1203
|
const { status, data } = res;
|
|
@@ -3876,8 +3876,7 @@ export default {
|
|
|
3876
3876
|
inheritAttrs: false,
|
|
3877
3877
|
provide() {
|
|
3878
3878
|
return {
|
|
3879
|
-
esForm: this
|
|
3880
|
-
sysCodes: this.sysCodes
|
|
3879
|
+
esForm: this
|
|
3881
3880
|
};
|
|
3882
3881
|
},
|
|
3883
3882
|
inject: {
|
|
@@ -4051,8 +4050,7 @@ export default {
|
|
|
4051
4050
|
newHeight: null,
|
|
4052
4051
|
uuid: util.uuid(32),
|
|
4053
4052
|
dialog: false,
|
|
4054
|
-
refresh: true
|
|
4055
|
-
sysCodes: {}
|
|
4053
|
+
refresh: true
|
|
4056
4054
|
};
|
|
4057
4055
|
},
|
|
4058
4056
|
computed: {
|
|
@@ -5149,9 +5147,6 @@ export default {
|
|
|
5149
5147
|
data: data,
|
|
5150
5148
|
attrs: attrs
|
|
5151
5149
|
});
|
|
5152
|
-
},
|
|
5153
|
-
setSysCodes(name, value) {
|
|
5154
|
-
this.$set(this.sysCodes, name, value);
|
|
5155
5150
|
}
|
|
5156
5151
|
}
|
|
5157
5152
|
};
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
return '';
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
|
+
text: String,
|
|
13
14
|
rules: {
|
|
14
15
|
type: [Array, Object],
|
|
15
16
|
default() {
|
|
@@ -132,8 +133,8 @@ export default {
|
|
|
132
133
|
doms.push(this.$slots.prepend);
|
|
133
134
|
}
|
|
134
135
|
if (typeof this.contents === 'string') {
|
|
135
|
-
if (this.contents) {
|
|
136
|
-
doms.push(this.contents);
|
|
136
|
+
if (this.contents || this.text) {
|
|
137
|
+
doms.push(this.contents || this.text);
|
|
137
138
|
}
|
|
138
139
|
if (this.icon) {
|
|
139
140
|
if (
|
|
@@ -819,6 +819,9 @@ export default {
|
|
|
819
819
|
this.showSet = !this.showSet;
|
|
820
820
|
},
|
|
821
821
|
setConfig(results, flag) {
|
|
822
|
+
if (this.socket) {
|
|
823
|
+
this.initWebSocket();
|
|
824
|
+
}
|
|
822
825
|
if (flag) {
|
|
823
826
|
sessionStorage.setItem('mainConfig', JSON.stringify(results));
|
|
824
827
|
util.setStorage({
|
|
@@ -934,9 +937,6 @@ export default {
|
|
|
934
937
|
.then((res) => {
|
|
935
938
|
if (res && res.rCode === 0) {
|
|
936
939
|
this.setConfig(res.results, 1);
|
|
937
|
-
if (this.socket) {
|
|
938
|
-
this.initWebSocket();
|
|
939
|
-
}
|
|
940
940
|
if (this.remote) {
|
|
941
941
|
this.getMenu();
|
|
942
942
|
} else {
|
|
@@ -1903,7 +1903,9 @@ export default {
|
|
|
1903
1903
|
}
|
|
1904
1904
|
}
|
|
1905
1905
|
if (this.$store) {
|
|
1906
|
-
|
|
1906
|
+
try {
|
|
1907
|
+
this.$store.commit('websocket', data);
|
|
1908
|
+
} catch (error) {}
|
|
1907
1909
|
}
|
|
1908
1910
|
if (this.$eventBus) {
|
|
1909
1911
|
this.$eventBus.$emit('websocket', data);
|
|
@@ -58,15 +58,13 @@
|
|
|
58
58
|
import { findSysCode } from 'eoss-ui/src/config/api.js';
|
|
59
59
|
import store from 'eoss-ui/src/utils/store';
|
|
60
60
|
import util from 'eoss-ui/src/utils/util';
|
|
61
|
+
import bus from 'eoss-ui/src/utils/bus';
|
|
61
62
|
export default {
|
|
62
63
|
name: 'EsRadioGroup',
|
|
63
64
|
inheritAttrs: false,
|
|
64
65
|
inject: {
|
|
65
66
|
esForm: {
|
|
66
67
|
default: ''
|
|
67
|
-
},
|
|
68
|
-
sysCodes: {
|
|
69
|
-
default: ''
|
|
70
68
|
}
|
|
71
69
|
},
|
|
72
70
|
props: {
|
|
@@ -221,30 +219,11 @@ export default {
|
|
|
221
219
|
handler() {
|
|
222
220
|
this.url && this.getData(this.url);
|
|
223
221
|
}
|
|
224
|
-
},
|
|
225
|
-
sysCodes: {
|
|
226
|
-
deep: true,
|
|
227
|
-
handler(val) {
|
|
228
|
-
if (
|
|
229
|
-
this.canceled &&
|
|
230
|
-
val &&
|
|
231
|
-
((this.sysCode && val[this.sysCode]) ||
|
|
232
|
-
(this.dataKey && val[this.dataKey]))
|
|
233
|
-
) {
|
|
234
|
-
if (this.parseData) {
|
|
235
|
-
this.options = this.parseData(
|
|
236
|
-
JSON.parse(JSON.stringify(val[this.sysCode || this.dataKey]))
|
|
237
|
-
);
|
|
238
|
-
} else {
|
|
239
|
-
this.options = JSON.parse(
|
|
240
|
-
JSON.stringify(val[this.sysCode || this.dataKey])
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
222
|
}
|
|
246
223
|
},
|
|
247
|
-
created() {
|
|
224
|
+
created() {
|
|
225
|
+
this.bindEventBus();
|
|
226
|
+
},
|
|
248
227
|
mounted() {},
|
|
249
228
|
methods: {
|
|
250
229
|
getData(url, sysCode) {
|
|
@@ -278,11 +257,10 @@ export default {
|
|
|
278
257
|
if (res.rCode === 0) {
|
|
279
258
|
this.options = JSON.parse(JSON.stringify(res.results));
|
|
280
259
|
if (sysCode || this.dataKey) {
|
|
281
|
-
|
|
282
|
-
this.
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
);
|
|
260
|
+
bus.$emit(
|
|
261
|
+
sysCode || this.dataKey,
|
|
262
|
+
JSON.parse(JSON.stringify(this.options))
|
|
263
|
+
);
|
|
286
264
|
store.set(sysCode, JSON.parse(JSON.stringify(res.results)));
|
|
287
265
|
}
|
|
288
266
|
}
|
|
@@ -307,7 +285,19 @@ export default {
|
|
|
307
285
|
);
|
|
308
286
|
}
|
|
309
287
|
return util.isObject(res) ? { ...attrs, ...res } : attrs;
|
|
288
|
+
},
|
|
289
|
+
setOptions(val) {
|
|
290
|
+
this.options = val;
|
|
291
|
+
},
|
|
292
|
+
bindEventBus() {
|
|
293
|
+
bus.$on(this.sysCode || this.dataKey, this.setOptions);
|
|
294
|
+
},
|
|
295
|
+
unbindEventBus() {
|
|
296
|
+
bus.$off(this.sysCode || this.dataKey, this.setOptions);
|
|
310
297
|
}
|
|
298
|
+
},
|
|
299
|
+
beforeDestroy() {
|
|
300
|
+
this.unbindEventBus();
|
|
311
301
|
}
|
|
312
302
|
};
|
|
313
303
|
</script>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { findSysCode } from 'eoss-ui/src/config/api.js';
|
|
3
3
|
import store from 'eoss-ui/src/utils/store';
|
|
4
4
|
import util from 'eoss-ui/src/utils/util';
|
|
5
|
+
import bus from 'eoss-ui/src/utils/bus';
|
|
5
6
|
export default {
|
|
6
7
|
name: 'EsSelect',
|
|
7
8
|
componentName: 'EsSelect',
|
|
@@ -14,9 +15,6 @@ export default {
|
|
|
14
15
|
inject: {
|
|
15
16
|
esForm: {
|
|
16
17
|
default: ''
|
|
17
|
-
},
|
|
18
|
-
sysCodes: {
|
|
19
|
-
default: ''
|
|
20
18
|
}
|
|
21
19
|
},
|
|
22
20
|
props: {
|
|
@@ -224,29 +222,11 @@ export default {
|
|
|
224
222
|
this.getData(this.sysCode);
|
|
225
223
|
}
|
|
226
224
|
}
|
|
227
|
-
},
|
|
228
|
-
sysCodes: {
|
|
229
|
-
deep: true,
|
|
230
|
-
handler(val) {
|
|
231
|
-
if (
|
|
232
|
-
this.canceled &&
|
|
233
|
-
val &&
|
|
234
|
-
((this.sysCode && val[this.sysCode]) ||
|
|
235
|
-
(this.dataKey && val[this.dataKey]))
|
|
236
|
-
) {
|
|
237
|
-
if (this.parseData) {
|
|
238
|
-
this.options = this.parseData(
|
|
239
|
-
JSON.parse(JSON.stringify(val[this.sysCode || this.dataKey]))
|
|
240
|
-
);
|
|
241
|
-
} else {
|
|
242
|
-
this.options = JSON.parse(
|
|
243
|
-
JSON.stringify(val[this.sysCode || this.dataKey])
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
225
|
}
|
|
249
226
|
},
|
|
227
|
+
created() {
|
|
228
|
+
this.bindEventBus();
|
|
229
|
+
},
|
|
250
230
|
mounted() {
|
|
251
231
|
if (this.wait) {
|
|
252
232
|
this.getData();
|
|
@@ -362,11 +342,10 @@ export default {
|
|
|
362
342
|
this.options = JSON.parse(JSON.stringify(res.results));
|
|
363
343
|
}
|
|
364
344
|
if (sysCode || this.dataKey) {
|
|
365
|
-
|
|
366
|
-
this.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
);
|
|
345
|
+
bus.$emit(
|
|
346
|
+
sysCode || this.dataKey,
|
|
347
|
+
JSON.parse(JSON.stringify(this.options))
|
|
348
|
+
);
|
|
370
349
|
store.set(sysCode, JSON.parse(JSON.stringify(this.options)));
|
|
371
350
|
}
|
|
372
351
|
} else {
|
|
@@ -593,8 +572,20 @@ export default {
|
|
|
593
572
|
},
|
|
594
573
|
toggleMenu() {
|
|
595
574
|
this.$refs.elSelect.toggleMenu();
|
|
575
|
+
},
|
|
576
|
+
setOptions(val) {
|
|
577
|
+
this.options = val;
|
|
578
|
+
},
|
|
579
|
+
bindEventBus() {
|
|
580
|
+
bus.$on(this.sysCode || this.dataKey, this.setOptions);
|
|
581
|
+
},
|
|
582
|
+
unbindEventBus() {
|
|
583
|
+
bus.$off(this.sysCode || this.dataKey, this.setOptions);
|
|
596
584
|
}
|
|
597
585
|
},
|
|
586
|
+
beforeDestroy() {
|
|
587
|
+
this.unbindEventBus();
|
|
588
|
+
},
|
|
598
589
|
render(h) {
|
|
599
590
|
if (!this.hide) {
|
|
600
591
|
if (this.readonly) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import util from 'eoss-ui/src/utils/util';
|
|
3
|
+
import bus from 'eoss-ui/src/utils/bus';
|
|
3
4
|
export default {
|
|
4
5
|
name: 'EsSelectGanged',
|
|
5
6
|
componentName: 'EsSelectGanged',
|
|
@@ -12,9 +13,6 @@ export default {
|
|
|
12
13
|
inject: {
|
|
13
14
|
esForm: {
|
|
14
15
|
default: ''
|
|
15
|
-
},
|
|
16
|
-
sysCodes: {
|
|
17
|
-
default: ''
|
|
18
16
|
}
|
|
19
17
|
},
|
|
20
18
|
props: {
|