eoss-ui 0.4.85 → 0.4.86
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 +4 -0
- package/lib/button.js +4 -0
- package/lib/checkbox-group.js +4 -0
- package/lib/data-table-form.js +4 -0
- package/lib/data-table.js +63 -33
- package/lib/date-picker.js +4 -0
- package/lib/dialog.js +4 -0
- package/lib/eoss-ui.common.js +128 -90
- package/lib/flow-group.js +4 -0
- package/lib/flow-list.js +4 -0
- package/lib/flow.js +7 -3
- package/lib/form.js +4 -0
- package/lib/handle-user.js +4 -0
- package/lib/handler.js +4 -0
- package/lib/index.js +1 -1
- package/lib/input-number.js +4 -0
- package/lib/input.js +4 -0
- package/lib/login.js +4 -0
- package/lib/main.js +4 -0
- package/lib/nav.js +7 -4
- package/lib/page.js +4 -0
- package/lib/player.js +4 -0
- package/lib/qr-code.js +4 -0
- package/lib/radio-group.js +4 -0
- package/lib/retrial-auth.js +4 -0
- package/lib/select-ganged.js +4 -0
- package/lib/select.js +4 -0
- package/lib/selector-panel.js +4 -0
- package/lib/selector.js +4 -0
- package/lib/sizer.js +4 -0
- package/lib/steps.js +4 -0
- package/lib/switch.js +4 -0
- package/lib/table-form.js +4 -0
- package/lib/tabs.js +4 -0
- package/lib/tips.js +4 -0
- package/lib/tree-group.js +4 -0
- package/lib/tree.js +4 -0
- package/lib/upload.js +75 -27
- package/lib/utils/util.js +4 -0
- package/lib/wujie.js +4 -0
- package/lib/wxlogin.js +4 -0
- package/package.json +1 -1
- package/packages/data-table/src/main.vue +58 -40
- package/packages/flow/src/main.vue +1 -1
- package/packages/nav/src/main.vue +1 -2
- package/packages/upload/src/main.vue +43 -29
- package/src/index.js +1 -1
- package/src/utils/util.js +4 -0
|
@@ -202,6 +202,7 @@ import children from './children.vue';
|
|
|
202
202
|
import sizer from './sizer.vue';
|
|
203
203
|
import util from 'eoss-ui/src/utils/util';
|
|
204
204
|
import bus from 'eoss-ui/src/utils/bus';
|
|
205
|
+
import qs from 'qs';
|
|
205
206
|
export default {
|
|
206
207
|
name: 'EsDataTable',
|
|
207
208
|
inheritAttrs: false,
|
|
@@ -416,6 +417,7 @@ export default {
|
|
|
416
417
|
},
|
|
417
418
|
data() {
|
|
418
419
|
return {
|
|
420
|
+
requests: [],
|
|
419
421
|
theadData: [],
|
|
420
422
|
list: null,
|
|
421
423
|
tableLoading: this.loading,
|
|
@@ -447,7 +449,7 @@ export default {
|
|
|
447
449
|
},
|
|
448
450
|
theads: {
|
|
449
451
|
get() {
|
|
450
|
-
return this.
|
|
452
|
+
return typeof this.thead === 'string' ? this.theadData : this.thead;
|
|
451
453
|
},
|
|
452
454
|
set(val) {
|
|
453
455
|
return val;
|
|
@@ -544,20 +546,19 @@ export default {
|
|
|
544
546
|
this.datas.length && this.checkSelect(newVal);
|
|
545
547
|
},
|
|
546
548
|
thead: {
|
|
547
|
-
|
|
549
|
+
deep: true,
|
|
548
550
|
handler(val) {
|
|
549
551
|
if (typeof val === 'string') {
|
|
550
552
|
this.getTheads();
|
|
553
|
+
} else {
|
|
554
|
+
this.getOptions(val);
|
|
551
555
|
}
|
|
552
556
|
}
|
|
553
557
|
},
|
|
554
558
|
theads: {
|
|
555
|
-
|
|
556
|
-
handler(
|
|
559
|
+
deep: true,
|
|
560
|
+
handler() {
|
|
557
561
|
this.chekOpenTotalArea();
|
|
558
|
-
if (val && val.length) {
|
|
559
|
-
this.getOptions(val);
|
|
560
|
-
}
|
|
561
562
|
}
|
|
562
563
|
},
|
|
563
564
|
param: {
|
|
@@ -597,6 +598,9 @@ export default {
|
|
|
597
598
|
}
|
|
598
599
|
},
|
|
599
600
|
created() {
|
|
601
|
+
if (Array.isArray(this.thead) && this.thead.length) {
|
|
602
|
+
this.getOptions(this.thead);
|
|
603
|
+
}
|
|
600
604
|
this.immediate && this.getTableData();
|
|
601
605
|
},
|
|
602
606
|
mounted() {
|
|
@@ -604,6 +608,10 @@ export default {
|
|
|
604
608
|
this.resetHeight();
|
|
605
609
|
},
|
|
606
610
|
methods: {
|
|
611
|
+
getRequestKey(config) {
|
|
612
|
+
const { method, url, params, data } = config;
|
|
613
|
+
return [method, url, qs.stringify(params), qs.stringify(data)].join('&');
|
|
614
|
+
},
|
|
607
615
|
getIcon(res) {
|
|
608
616
|
if (
|
|
609
617
|
this.sizer &&
|
|
@@ -627,36 +635,45 @@ export default {
|
|
|
627
635
|
item.sysCode ? { sysAppCode: item.sysCode } : {},
|
|
628
636
|
item.param ? item.param : {}
|
|
629
637
|
);
|
|
630
|
-
|
|
631
|
-
.
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
638
|
+
let key = this.getRequestKey({
|
|
639
|
+
method: this.method,
|
|
640
|
+
url: item.sysCode ? findSysCode : item.url,
|
|
641
|
+
params: params,
|
|
642
|
+
data: {}
|
|
643
|
+
});
|
|
644
|
+
if (!this.requests.includes(key)) {
|
|
645
|
+
util
|
|
646
|
+
.ajax({
|
|
647
|
+
url: item.sysCode ? findSysCode : item.url,
|
|
648
|
+
method: this.method,
|
|
649
|
+
params: params,
|
|
650
|
+
data: params
|
|
651
|
+
})
|
|
652
|
+
.then((res) => {
|
|
653
|
+
if (res.rCode === 0) {
|
|
654
|
+
if (item.type == 'ganged') {
|
|
655
|
+
this.$set(this.options, item.field || item.prop, [
|
|
656
|
+
JSON.parse(JSON.stringify(res.results))
|
|
657
|
+
]);
|
|
658
|
+
} else {
|
|
659
|
+
this.$set(
|
|
660
|
+
this.options,
|
|
661
|
+
item.field || item.prop,
|
|
662
|
+
JSON.parse(JSON.stringify(res.results))
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
this.requests.push(key);
|
|
643
666
|
} else {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
item.field || item.prop,
|
|
647
|
-
JSON.parse(JSON.stringify(res.results))
|
|
648
|
-
);
|
|
667
|
+
let msg = res.msg || '系统错误,请联系管理员!';
|
|
668
|
+
this.$message.error(msg);
|
|
649
669
|
}
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
this.$message.error(err.message);
|
|
658
|
-
}
|
|
659
|
-
});
|
|
670
|
+
})
|
|
671
|
+
.catch((err) => {
|
|
672
|
+
if (err.message && err.message !== 'canceled') {
|
|
673
|
+
this.$message.error(err.message);
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
}
|
|
660
677
|
} else {
|
|
661
678
|
if (item.childHead && item.childHead.length) {
|
|
662
679
|
this.getOptions(item.childHead);
|
|
@@ -675,7 +692,7 @@ export default {
|
|
|
675
692
|
this.showTotal = true;
|
|
676
693
|
return;
|
|
677
694
|
}
|
|
678
|
-
const arr = JSON.parse(JSON.stringify(this.
|
|
695
|
+
const arr = JSON.parse(JSON.stringify(this.theads));
|
|
679
696
|
arr.forEach((item) => {
|
|
680
697
|
if (item.total) {
|
|
681
698
|
this.showTotal = true;
|
|
@@ -748,6 +765,7 @@ export default {
|
|
|
748
765
|
this.list = results.data || results.records || [];
|
|
749
766
|
this.config.totalCount =
|
|
750
767
|
results.count || results.total || results.totalCount;
|
|
768
|
+
this.getOptions(this.theadData);
|
|
751
769
|
}
|
|
752
770
|
} else {
|
|
753
771
|
this.theadData = [];
|
|
@@ -991,7 +1009,7 @@ export default {
|
|
|
991
1009
|
} else if (row) {
|
|
992
1010
|
rows = JSON.parse(JSON.stringify(row));
|
|
993
1011
|
}
|
|
994
|
-
let thead = this.
|
|
1012
|
+
let thead = this.theads;
|
|
995
1013
|
if (this.$refs.oaTable) {
|
|
996
1014
|
thead = this.$refs.oaTable.getThead();
|
|
997
1015
|
}
|
|
@@ -1102,10 +1120,10 @@ export default {
|
|
|
1102
1120
|
if (handle.exportXls) {
|
|
1103
1121
|
let text = '操作';
|
|
1104
1122
|
if (
|
|
1105
|
-
this.
|
|
1106
|
-
this.
|
|
1123
|
+
this.theads[this.theads.length - 1] &&
|
|
1124
|
+
this.theads[this.theads.length - 1].type === 'handle'
|
|
1107
1125
|
) {
|
|
1108
|
-
text = this.
|
|
1126
|
+
text = this.theads[this.theads.length - 1].title;
|
|
1109
1127
|
}
|
|
1110
1128
|
thead = thead.map((item) => {
|
|
1111
1129
|
return item.filter((ele) => {
|
|
@@ -190,6 +190,7 @@ import {
|
|
|
190
190
|
} from 'eoss-ui/src/config/api.js';
|
|
191
191
|
import util from 'eoss-ui/src/utils/util.js';
|
|
192
192
|
import picture from './picture.js';
|
|
193
|
+
import store from 'eoss-ui/src/utils/store';
|
|
193
194
|
export default {
|
|
194
195
|
name: 'EsUpload',
|
|
195
196
|
components: {
|
|
@@ -694,37 +695,50 @@ export default {
|
|
|
694
695
|
//根据code获取附件参数配置
|
|
695
696
|
getAdjunctPropertie() {
|
|
696
697
|
if (this.code !== undefined) {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
698
|
+
let config = store.get(this.code);
|
|
699
|
+
if (config) {
|
|
700
|
+
this.fileAccept = config.accept;
|
|
701
|
+
this.fileSize = config.size;
|
|
702
|
+
this.fileTotalSize = config.totalSize;
|
|
703
|
+
} else {
|
|
704
|
+
util
|
|
705
|
+
.ajax({
|
|
706
|
+
method: this.method,
|
|
707
|
+
url: this.properties,
|
|
708
|
+
data: { code: this.code, ...this.param },
|
|
709
|
+
params: { code: this.code, ...this.param }
|
|
710
|
+
})
|
|
711
|
+
.then((res) => {
|
|
712
|
+
if (res.rCode === 0) {
|
|
713
|
+
if (res.results) {
|
|
714
|
+
this.excludeNames = res.results.excludeName;
|
|
715
|
+
if (res.results.fileTypeExtName) {
|
|
716
|
+
let fileTypeExtName =
|
|
717
|
+
res.results.fileTypeExtName.split(';');
|
|
718
|
+
this.fileAccept = fileTypeExtName
|
|
719
|
+
.filter((item) => {
|
|
720
|
+
return item;
|
|
721
|
+
})
|
|
722
|
+
.join(',');
|
|
723
|
+
}
|
|
724
|
+
this.fileSize = res.results.limitFileSize
|
|
725
|
+
? res.results.limitFileSize
|
|
726
|
+
: 0;
|
|
727
|
+
this.fileTotalSize = res.results.limitTotalSize;
|
|
728
|
+
store.set(this.code, {
|
|
729
|
+
accept: this.fileAccept,
|
|
730
|
+
size: this.fileSize,
|
|
731
|
+
totalSize: this.fileTotalSize
|
|
732
|
+
});
|
|
715
733
|
}
|
|
716
|
-
this.fileSize = res.results.limitFileSize
|
|
717
|
-
? res.results.limitFileSize
|
|
718
|
-
: 0;
|
|
719
|
-
this.fileTotalSize = res.results.limitTotalSize;
|
|
720
734
|
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}
|
|
727
|
-
|
|
735
|
+
})
|
|
736
|
+
.catch((err) => {
|
|
737
|
+
if (err.message && err.message !== 'canceled') {
|
|
738
|
+
this.$message.error(err.message);
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
}
|
|
728
742
|
}
|
|
729
743
|
},
|
|
730
744
|
getFiles(params) {
|
package/src/index.js
CHANGED
package/src/utils/util.js
CHANGED
|
@@ -396,6 +396,10 @@ const ajax = function ({
|
|
|
396
396
|
if (!header['content-type']) {
|
|
397
397
|
header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
|
|
398
398
|
}
|
|
399
|
+
} else {
|
|
400
|
+
if (!header['content-type']) {
|
|
401
|
+
header['content-type'] = 'application/json;charset=UTF-8';
|
|
402
|
+
}
|
|
399
403
|
}
|
|
400
404
|
return http({
|
|
401
405
|
method,
|