eoss-ui 0.5.83 → 0.5.85
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 +929 -0
- package/lib/button-group.js +146 -66
- package/lib/button.js +118 -69
- package/lib/checkbox-group.js +64 -46
- package/lib/config/api.js +5 -1
- package/lib/data-table-form.js +64 -46
- package/lib/data-table.js +468 -295
- package/lib/date-picker.js +64 -46
- package/lib/dialog.js +71 -48
- package/lib/eoss-ui.common.js +9188 -15746
- package/lib/flow-group.js +64 -46
- package/lib/flow-list.js +65 -47
- package/lib/flow.js +113 -77
- package/lib/form.js +5708 -13486
- package/lib/handle-user.js +65 -47
- package/lib/handler.js +70 -48
- package/lib/icon.js +64 -46
- package/lib/index.js +1 -1
- package/lib/input-number.js +64 -46
- package/lib/input.js +64 -46
- package/lib/login.js +86 -57
- package/lib/main.js +1435 -483
- package/lib/nav.js +64 -46
- package/lib/notify.js +51 -46
- package/lib/page.js +64 -46
- package/lib/pagination.js +64 -46
- package/lib/player.js +64 -46
- package/lib/qr-code.js +64 -46
- package/lib/radio-group.js +64 -46
- package/lib/retrial-auth.js +64 -46
- package/lib/select-ganged.js +64 -46
- package/lib/select.js +65 -47
- package/lib/selector-panel.js +64 -46
- package/lib/selector.js +64 -46
- package/lib/sizer.js +64 -46
- package/lib/steps.js +64 -46
- package/lib/switch.js +64 -46
- package/lib/table-form.js +64 -46
- package/lib/tabs.js +64 -46
- package/lib/theme-chalk/calendar.css +1 -1
- package/lib/theme-chalk/data-table.css +1 -1
- package/lib/theme-chalk/dialog.css +1 -1
- package/lib/theme-chalk/form.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/simplicity.css +1 -1
- package/lib/tips.js +64 -46
- package/lib/tree-group.js +64 -46
- package/lib/tree.js +64 -46
- package/lib/upload.js +78 -60
- package/lib/utils/util.js +18 -5
- package/lib/wujie.js +64 -46
- package/lib/wxlogin.js +64 -46
- package/package.json +2 -2
- package/packages/button/src/main.vue +88 -55
- package/packages/button-group/src/main.vue +56 -13
- package/packages/data-table/src/children.vue +3 -2
- package/packages/data-table/src/column.vue +6 -4
- package/packages/data-table/src/main.vue +150 -69
- package/packages/data-table/src/sizer.vue +51 -22
- package/packages/dialog/src/main.vue +5 -1
- package/packages/flow/src/main.vue +26 -17
- package/packages/form/src/main.vue +129 -2103
- package/packages/handler/src/main.vue +5 -0
- package/packages/login/src/main.vue +12 -1
- package/packages/login/src/resetPassword.vue +4 -2
- package/packages/main/src/default/index.vue +35 -54
- package/packages/main/src/default/userinfo.vue +2 -1
- package/packages/main/src/public/search.vue +444 -0
- package/packages/main/src/simplicity/apps.vue +20 -2
- package/packages/main/src/simplicity/handler.vue +0 -2
- package/packages/main/src/simplicity/index.vue +97 -32
- package/packages/main/src/simplicity/userinfo.vue +1 -0
- package/packages/select/src/main.vue +1 -1
- package/packages/theme-chalk/lib/calendar.css +1 -1
- package/packages/theme-chalk/lib/data-table.css +1 -1
- package/packages/theme-chalk/lib/dialog.css +1 -1
- package/packages/theme-chalk/lib/form.css +1 -1
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/main.css +1 -1
- package/packages/theme-chalk/lib/simplicity.css +1 -1
- package/packages/theme-chalk/src/calendar.scss +3 -3
- package/packages/theme-chalk/src/data-table.scss +12 -0
- package/packages/theme-chalk/src/dialog.scss +15 -0
- package/packages/theme-chalk/src/form.scss +6 -0
- package/packages/theme-chalk/src/main.scss +2 -1
- package/packages/theme-chalk/src/simplicity.scss +172 -4
- package/packages/upload/src/main.vue +16 -12
- package/src/config/api.js +5 -1
- package/src/index.js +157 -157
- package/src/utils/util.js +18 -5
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
></es-toolbar>
|
|
37
37
|
<p v-if="title" ref="title" class="es-table-title" v-html="title"></p>
|
|
38
38
|
<div
|
|
39
|
-
|
|
39
|
+
v-if="show"
|
|
40
|
+
:style="styles"
|
|
40
41
|
class="es-data-table-content"
|
|
41
42
|
:class="{
|
|
42
43
|
'es-table-border-none': border == 'none',
|
|
43
44
|
'es-table-plus': mode == 'plus'
|
|
44
45
|
}"
|
|
45
46
|
ref="esTableContent"
|
|
46
|
-
v-if="show"
|
|
47
47
|
>
|
|
48
48
|
<el-table
|
|
49
49
|
ref="oaTable"
|
|
@@ -85,39 +85,44 @@
|
|
|
85
85
|
v-if="item.type === 'sort'"
|
|
86
86
|
width="32"
|
|
87
87
|
prop="id"
|
|
88
|
-
:key="item.key || index"
|
|
88
|
+
:key="item.key || item.label || item.title || index"
|
|
89
89
|
label=" "
|
|
90
90
|
>
|
|
91
91
|
<template slot-scope="scope">
|
|
92
|
-
<es-icon
|
|
92
|
+
<es-icon
|
|
93
|
+
v-if="!scope.row.fixed"
|
|
94
|
+
class="es-move"
|
|
95
|
+
:contents="dragSortIcon"
|
|
96
|
+
></es-icon>
|
|
93
97
|
</template>
|
|
94
98
|
</el-table-column>
|
|
95
99
|
<el-table-column
|
|
96
100
|
v-else-if="item.type === 'index' || item.type === 'selection'"
|
|
97
|
-
:key="item.key || index"
|
|
101
|
+
:key="item.key || item.label || item.title || index"
|
|
98
102
|
v-bind="dragSort ? { ...item, fixed: false } : item"
|
|
99
103
|
></el-table-column>
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
104
|
+
<template v-else>
|
|
105
|
+
<children
|
|
106
|
+
:tag="item.tag"
|
|
107
|
+
v-bind="{
|
|
108
|
+
mode: mode,
|
|
109
|
+
name: name,
|
|
110
|
+
indexs: index,
|
|
111
|
+
form: form,
|
|
112
|
+
readonly: readonly,
|
|
113
|
+
optionData: optionDatas,
|
|
114
|
+
dragSort: dragSort,
|
|
115
|
+
key: item.key || item.label || item.title || index,
|
|
116
|
+
...(dragSort ? { ...item, fixed: false } : { ...item })
|
|
117
|
+
}"
|
|
118
|
+
v-on="{
|
|
119
|
+
handleClick: handleClick,
|
|
120
|
+
formBlur: formBlur,
|
|
121
|
+
formFocus: formFocus,
|
|
122
|
+
formChange: formChange
|
|
123
|
+
}"
|
|
124
|
+
></children>
|
|
125
|
+
</template>
|
|
121
126
|
</template>
|
|
122
127
|
</template>
|
|
123
128
|
<slot name="prefix"></slot>
|
|
@@ -172,11 +177,22 @@
|
|
|
172
177
|
<slot name="dialog"></slot>
|
|
173
178
|
<slot name="other"></slot>
|
|
174
179
|
</div>
|
|
175
|
-
<
|
|
180
|
+
<es-dialog v-if="theads.length" title="列表设置" :visible.sync="showSizer">
|
|
181
|
+
<sizer
|
|
182
|
+
v-if="showSizer"
|
|
183
|
+
:data="theads"
|
|
184
|
+
:mode="mode"
|
|
185
|
+
@confirm="mergeThead"
|
|
186
|
+
></sizer>
|
|
187
|
+
</es-dialog>
|
|
176
188
|
</component>
|
|
177
189
|
</template>
|
|
178
190
|
<script>
|
|
179
|
-
import {
|
|
191
|
+
import {
|
|
192
|
+
findSysCode,
|
|
193
|
+
getDictList,
|
|
194
|
+
formContents
|
|
195
|
+
} from 'eoss-ui/src/config/api.js';
|
|
180
196
|
import { debounce } from 'throttle-debounce';
|
|
181
197
|
import children from './children.vue';
|
|
182
198
|
import sizer from './sizer.vue';
|
|
@@ -184,12 +200,13 @@ import util from 'eoss-ui/src/utils/util';
|
|
|
184
200
|
import bus from 'eoss-ui/src/utils/bus';
|
|
185
201
|
import qs from 'qs';
|
|
186
202
|
const systemMode = util.win.top.systemMode || util.win.systemMode || 'default';
|
|
203
|
+
const pageView = util.getParams('pageView');
|
|
187
204
|
export default {
|
|
188
205
|
name: 'EsDataTable',
|
|
189
206
|
inheritAttrs: false,
|
|
190
207
|
components: {
|
|
191
|
-
|
|
192
|
-
|
|
208
|
+
children,
|
|
209
|
+
sizer
|
|
193
210
|
},
|
|
194
211
|
provide() {
|
|
195
212
|
return {
|
|
@@ -209,6 +226,14 @@ export default {
|
|
|
209
226
|
}
|
|
210
227
|
},
|
|
211
228
|
props: {
|
|
229
|
+
viewCode: {
|
|
230
|
+
type: String,
|
|
231
|
+
default: pageView
|
|
232
|
+
},
|
|
233
|
+
contentsUrl: {
|
|
234
|
+
type: String,
|
|
235
|
+
default: formContents
|
|
236
|
+
},
|
|
212
237
|
mode: {
|
|
213
238
|
type: String,
|
|
214
239
|
default: systemMode
|
|
@@ -443,12 +468,14 @@ export default {
|
|
|
443
468
|
type: String,
|
|
444
469
|
default: 'es-icon-caidan'
|
|
445
470
|
},
|
|
446
|
-
|
|
471
|
+
isFieldsEncryption: Boolean
|
|
447
472
|
},
|
|
448
473
|
data() {
|
|
449
474
|
return {
|
|
475
|
+
isEncryption: this.isFieldsEncryption,
|
|
450
476
|
requests: [],
|
|
451
477
|
toolbars: [],
|
|
478
|
+
hasThead: false,
|
|
452
479
|
theadData: [],
|
|
453
480
|
list: [],
|
|
454
481
|
tableLoading: this.loading,
|
|
@@ -474,10 +501,12 @@ export default {
|
|
|
474
501
|
selected: null,
|
|
475
502
|
options: {},
|
|
476
503
|
icon: true,
|
|
477
|
-
show: true,
|
|
478
504
|
sysCodes: [],
|
|
479
505
|
infiniteDisabled: this.infiniteScroll,
|
|
480
|
-
isReload: false
|
|
506
|
+
isReload: false,
|
|
507
|
+
pageView: null,
|
|
508
|
+
showSizer: false,
|
|
509
|
+
show: true
|
|
481
510
|
};
|
|
482
511
|
},
|
|
483
512
|
computed: {
|
|
@@ -499,9 +528,8 @@ export default {
|
|
|
499
528
|
},
|
|
500
529
|
theads: {
|
|
501
530
|
get() {
|
|
502
|
-
let
|
|
503
|
-
|
|
504
|
-
let types = this.theadData
|
|
531
|
+
let types;
|
|
532
|
+
types = this.theadData
|
|
505
533
|
.filter((item) => {
|
|
506
534
|
return (
|
|
507
535
|
item.type == 'selection' ||
|
|
@@ -512,6 +540,8 @@ export default {
|
|
|
512
540
|
.map((item) => {
|
|
513
541
|
return item.type;
|
|
514
542
|
});
|
|
543
|
+
let thead = [];
|
|
544
|
+
let addfilter = false;
|
|
515
545
|
if (this.dragSort && !types.includes('sort')) {
|
|
516
546
|
addfilter = true;
|
|
517
547
|
thead.push({
|
|
@@ -564,7 +594,7 @@ export default {
|
|
|
564
594
|
}
|
|
565
595
|
if (this.theadData.length) {
|
|
566
596
|
thead = [...thead, ...this.theadData];
|
|
567
|
-
} else {
|
|
597
|
+
} else if (this.show) {
|
|
568
598
|
thead = [...thead, ...this.thead];
|
|
569
599
|
}
|
|
570
600
|
return thead;
|
|
@@ -663,6 +693,15 @@ export default {
|
|
|
663
693
|
}
|
|
664
694
|
},
|
|
665
695
|
watch: {
|
|
696
|
+
viewCode: {
|
|
697
|
+
immediate: true,
|
|
698
|
+
handler(val) {
|
|
699
|
+
if (val) {
|
|
700
|
+
this.hasThead = true;
|
|
701
|
+
this.getContents();
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
},
|
|
666
705
|
showToolbar() {
|
|
667
706
|
this.resetHeight();
|
|
668
707
|
this.doLayout();
|
|
@@ -705,13 +744,8 @@ export default {
|
|
|
705
744
|
deep: true,
|
|
706
745
|
handler(val) {
|
|
707
746
|
this.getOptions(val);
|
|
708
|
-
|
|
709
|
-
if (
|
|
710
|
-
Array.isArray(val) &&
|
|
711
|
-
val.length &&
|
|
712
|
-
this.fields &&
|
|
713
|
-
this.datas.length == 0
|
|
714
|
-
) {
|
|
747
|
+
this.chekOpenTotalArea();
|
|
748
|
+
if (Array.isArray(val) && val.length && this.datas.length == 0) {
|
|
715
749
|
this.getTableData();
|
|
716
750
|
}
|
|
717
751
|
}
|
|
@@ -724,7 +758,6 @@ export default {
|
|
|
724
758
|
},
|
|
725
759
|
param: {
|
|
726
760
|
handler(val) {
|
|
727
|
-
console.log(val, 9999);
|
|
728
761
|
this.getTableData();
|
|
729
762
|
}
|
|
730
763
|
},
|
|
@@ -780,18 +813,11 @@ export default {
|
|
|
780
813
|
created() {
|
|
781
814
|
if (Array.isArray(this.thead) && this.thead.length) {
|
|
782
815
|
this.getOptions(this.thead);
|
|
783
|
-
if (this.fields) {
|
|
784
|
-
this.immediate && this.getTableData();
|
|
785
|
-
this.chekOpenTotalArea();
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
if (!this.fields) {
|
|
789
816
|
this.immediate && this.getTableData();
|
|
790
|
-
this.chekOpenTotalArea();
|
|
791
817
|
}
|
|
818
|
+
this.chekOpenTotalArea();
|
|
792
819
|
},
|
|
793
820
|
mounted() {
|
|
794
|
-
console.log(1111111);
|
|
795
821
|
if (this.data.length) {
|
|
796
822
|
this.list = this.setData();
|
|
797
823
|
}
|
|
@@ -826,6 +852,30 @@ export default {
|
|
|
826
852
|
const { method, url, params, data } = config;
|
|
827
853
|
return [method, url, qs.stringify(params), qs.stringify(data)].join('&');
|
|
828
854
|
},
|
|
855
|
+
getContents() {
|
|
856
|
+
util
|
|
857
|
+
.ajax({
|
|
858
|
+
url: this.contentsUrl,
|
|
859
|
+
params: {
|
|
860
|
+
formId: this.viewCode
|
|
861
|
+
}
|
|
862
|
+
})
|
|
863
|
+
.then((res) => {
|
|
864
|
+
if (res.rCode == 0) {
|
|
865
|
+
let {
|
|
866
|
+
results: { eossFormJson }
|
|
867
|
+
} = res;
|
|
868
|
+
eossFormJson = JSON.parse(eossFormJson);
|
|
869
|
+
if (eossFormJson && eossFormJson.table) {
|
|
870
|
+
this.isEncryption = true;
|
|
871
|
+
this.theadData = eossFormJson.table;
|
|
872
|
+
} else {
|
|
873
|
+
this.hasThead = false;
|
|
874
|
+
}
|
|
875
|
+
this.$emit('init-contents', res.results);
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
},
|
|
829
879
|
getOptions(res) {
|
|
830
880
|
let sysCodes = [];
|
|
831
881
|
res.forEach((item) => {
|
|
@@ -912,12 +962,20 @@ export default {
|
|
|
912
962
|
this.showTotal = true;
|
|
913
963
|
return;
|
|
914
964
|
}
|
|
965
|
+
if (!this.theads) {
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
915
968
|
const arr = JSON.parse(JSON.stringify(this.theads));
|
|
969
|
+
let flag = false;
|
|
916
970
|
arr.forEach((item) => {
|
|
917
971
|
if (item.total) {
|
|
972
|
+
flag = true;
|
|
918
973
|
this.showTotal = true;
|
|
919
974
|
}
|
|
920
975
|
});
|
|
976
|
+
if (this.showTotal !== flag) {
|
|
977
|
+
this.showTotal = flag;
|
|
978
|
+
}
|
|
921
979
|
},
|
|
922
980
|
rowClick(row, column, event) {
|
|
923
981
|
this.$emit('click', row, column, event);
|
|
@@ -998,19 +1056,26 @@ export default {
|
|
|
998
1056
|
newVal.forEach((row) => {
|
|
999
1057
|
if (util.isObject(row)) {
|
|
1000
1058
|
this.$refs.oaTable.toggleRowSelection(row, true);
|
|
1001
|
-
} else
|
|
1002
|
-
this.list
|
|
1003
|
-
|
|
1004
|
-
this.$refs.oaTable.toggleRowSelection(item, true);
|
|
1005
|
-
return;
|
|
1006
|
-
}
|
|
1007
|
-
});
|
|
1059
|
+
} else {
|
|
1060
|
+
this.setChecked(this.list, row);
|
|
1061
|
+
}
|
|
1008
1062
|
});
|
|
1009
1063
|
} else if (newVal === true) {
|
|
1010
1064
|
this.toggleAllSelection();
|
|
1011
1065
|
}
|
|
1012
1066
|
});
|
|
1013
1067
|
},
|
|
1068
|
+
setChecked(list, row) {
|
|
1069
|
+
list.forEach((item) => {
|
|
1070
|
+
if (item.children && item.children.length) {
|
|
1071
|
+
this.setChecked(item.children, row);
|
|
1072
|
+
}
|
|
1073
|
+
if (item[this.checkedKey] === row) {
|
|
1074
|
+
this.$refs.oaTable.toggleRowSelection(item, true);
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
},
|
|
1014
1079
|
getTableDatas(res) {
|
|
1015
1080
|
let where;
|
|
1016
1081
|
let first;
|
|
@@ -1038,6 +1103,7 @@ export default {
|
|
|
1038
1103
|
if (where) {
|
|
1039
1104
|
reqData = util.extend({}, reqData, where);
|
|
1040
1105
|
}
|
|
1106
|
+
//if (this.fields)
|
|
1041
1107
|
if (this.retainSearh || first === false) {
|
|
1042
1108
|
reqData = util.extend({}, reqData, this.wheres);
|
|
1043
1109
|
}
|
|
@@ -1048,9 +1114,9 @@ export default {
|
|
|
1048
1114
|
}
|
|
1049
1115
|
}
|
|
1050
1116
|
}
|
|
1051
|
-
if (this.
|
|
1117
|
+
if (this.isEncryption) {
|
|
1052
1118
|
let fields = [];
|
|
1053
|
-
this.
|
|
1119
|
+
this.theads.forEach((item) => {
|
|
1054
1120
|
if (item.field || item.prop) {
|
|
1055
1121
|
fields.push(item.field || item.prop);
|
|
1056
1122
|
}
|
|
@@ -1278,7 +1344,6 @@ export default {
|
|
|
1278
1344
|
return { ...obj, ...item };
|
|
1279
1345
|
},
|
|
1280
1346
|
handleClick(res) {
|
|
1281
|
-
console.log(1212);
|
|
1282
1347
|
let { row, handle } = res;
|
|
1283
1348
|
let rows;
|
|
1284
1349
|
if (handle.checkbox) {
|
|
@@ -1537,7 +1602,7 @@ export default {
|
|
|
1537
1602
|
);
|
|
1538
1603
|
for (let i = 0; i < this.$el.parentNode.childNodes.length; i++) {
|
|
1539
1604
|
let ele = this.$el.parentNode.childNodes[i];
|
|
1540
|
-
if (ele
|
|
1605
|
+
if (ele.offsetHeight !== undefined) {
|
|
1541
1606
|
height =
|
|
1542
1607
|
height -
|
|
1543
1608
|
ele.offsetHeight -
|
|
@@ -1562,6 +1627,9 @@ export default {
|
|
|
1562
1627
|
let emptyText = this.$refs.esTableContent.querySelector(
|
|
1563
1628
|
'.el-table__empty-text'
|
|
1564
1629
|
);
|
|
1630
|
+
if (this.total) {
|
|
1631
|
+
height -= 1;
|
|
1632
|
+
}
|
|
1565
1633
|
let eht = 0;
|
|
1566
1634
|
if (emptyText) {
|
|
1567
1635
|
eht = emptyText.offsetHeight;
|
|
@@ -1597,7 +1665,7 @@ export default {
|
|
|
1597
1665
|
}
|
|
1598
1666
|
},
|
|
1599
1667
|
handleFilterColumn() {
|
|
1600
|
-
this
|
|
1668
|
+
this.showSizer = true;
|
|
1601
1669
|
},
|
|
1602
1670
|
handleSortChange(res) {
|
|
1603
1671
|
if (res.data && res.data.length) {
|
|
@@ -1609,11 +1677,24 @@ export default {
|
|
|
1609
1677
|
this.$emit('update-drag-sort', data, event);
|
|
1610
1678
|
},
|
|
1611
1679
|
mergeThead(res) {
|
|
1612
|
-
this.
|
|
1680
|
+
this.show = false;
|
|
1681
|
+
this.theadData = [];
|
|
1613
1682
|
this.icon = true;
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1683
|
+
this.showSizer = false;
|
|
1684
|
+
// if (!this.showTotal) {
|
|
1685
|
+
// for (let i = 0; i < res.length; i++) {
|
|
1686
|
+
// if (res[i].total) {
|
|
1687
|
+
// this.showTotal = true;
|
|
1688
|
+
// break;
|
|
1689
|
+
// }
|
|
1690
|
+
// }
|
|
1691
|
+
// }
|
|
1692
|
+
this.$nextTick(() => {
|
|
1693
|
+
this.theadData = res;
|
|
1694
|
+
setTimeout(() => {
|
|
1695
|
+
this.show = true;
|
|
1696
|
+
}, 500);
|
|
1697
|
+
});
|
|
1617
1698
|
},
|
|
1618
1699
|
setOptions(val, sysCode) {
|
|
1619
1700
|
this.$set(this.options, sysCode, val);
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<es-
|
|
2
|
+
<div class="es-table-sizer">
|
|
3
|
+
<div class="es-table-sizer-tips">
|
|
4
|
+
提示:锁定的列排序无效,列的内容是数字才能合计
|
|
5
|
+
</div>
|
|
3
6
|
<es-data-table
|
|
4
|
-
|
|
7
|
+
dragSort
|
|
5
8
|
numbers
|
|
6
9
|
form
|
|
7
10
|
row-key="id"
|
|
8
11
|
default-expand-all
|
|
9
|
-
height="
|
|
12
|
+
height="480px"
|
|
10
13
|
:mode="mode"
|
|
11
14
|
:data="theads"
|
|
12
15
|
:thead="thead"
|
|
13
16
|
:tree-props="{ children: 'childHead' }"
|
|
14
17
|
@change="handleChange"
|
|
18
|
+
@update-drag-sort="handleDrag"
|
|
15
19
|
>
|
|
16
20
|
</es-data-table>
|
|
17
21
|
<div class="sizer-btn-box">
|
|
@@ -19,7 +23,7 @@
|
|
|
19
23
|
>确定</el-button
|
|
20
24
|
>
|
|
21
25
|
</div>
|
|
22
|
-
</
|
|
26
|
+
</div>
|
|
23
27
|
</template>
|
|
24
28
|
|
|
25
29
|
<script type="text/babel">
|
|
@@ -34,9 +38,9 @@ export default {
|
|
|
34
38
|
theads: {
|
|
35
39
|
get() {
|
|
36
40
|
if (this.data && this.data.length) {
|
|
37
|
-
let
|
|
38
|
-
this.getThead(this.data,
|
|
39
|
-
return
|
|
41
|
+
let newData = [];
|
|
42
|
+
this.getThead(this.data, newData);
|
|
43
|
+
return newData;
|
|
40
44
|
}
|
|
41
45
|
return [];
|
|
42
46
|
}
|
|
@@ -47,11 +51,11 @@ export default {
|
|
|
47
51
|
visible: false,
|
|
48
52
|
thead: [
|
|
49
53
|
{
|
|
50
|
-
title: '
|
|
54
|
+
title: '名称',
|
|
51
55
|
field: 'title'
|
|
52
56
|
},
|
|
53
57
|
{
|
|
54
|
-
title: '
|
|
58
|
+
title: '锁定列位置',
|
|
55
59
|
field: 'fixed',
|
|
56
60
|
type: 'select',
|
|
57
61
|
clearable: true,
|
|
@@ -68,7 +72,7 @@ export default {
|
|
|
68
72
|
]
|
|
69
73
|
},
|
|
70
74
|
{
|
|
71
|
-
title: '
|
|
75
|
+
title: '列是否显示',
|
|
72
76
|
field: 'hide',
|
|
73
77
|
type: 'switch',
|
|
74
78
|
width: 160,
|
|
@@ -83,10 +87,27 @@ export default {
|
|
|
83
87
|
name: '显示'
|
|
84
88
|
}
|
|
85
89
|
]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
title: '是否开启合计',
|
|
93
|
+
field: 'total',
|
|
94
|
+
type: 'switch',
|
|
95
|
+
width: 160,
|
|
96
|
+
align: 'center',
|
|
97
|
+
data: [
|
|
98
|
+
{
|
|
99
|
+
value: false,
|
|
100
|
+
name: '关闭'
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
value: true,
|
|
104
|
+
name: '开启'
|
|
105
|
+
}
|
|
106
|
+
]
|
|
86
107
|
}
|
|
87
108
|
],
|
|
88
|
-
|
|
89
|
-
|
|
109
|
+
newThead: [],
|
|
110
|
+
nid: 0
|
|
90
111
|
};
|
|
91
112
|
},
|
|
92
113
|
mounted() {
|
|
@@ -97,12 +118,8 @@ export default {
|
|
|
97
118
|
this.visible = true;
|
|
98
119
|
},
|
|
99
120
|
getThead(res, data) {
|
|
100
|
-
res.forEach((item) => {
|
|
101
|
-
if (
|
|
102
|
-
item.type !== 'index' &&
|
|
103
|
-
item.type !== 'selection' &&
|
|
104
|
-
item.type !== 'handle'
|
|
105
|
-
) {
|
|
121
|
+
res.forEach((item, index) => {
|
|
122
|
+
if (item.type !== 'index' && item.type !== 'selection') {
|
|
106
123
|
let { fixed, hide, childHead, children, title, ...other } = item;
|
|
107
124
|
let items = {
|
|
108
125
|
title: title ? title : item.label,
|
|
@@ -113,10 +130,9 @@ export default {
|
|
|
113
130
|
? ''
|
|
114
131
|
: fixed,
|
|
115
132
|
hide: hide ? false : true,
|
|
116
|
-
id:
|
|
133
|
+
id: index,
|
|
117
134
|
...other
|
|
118
135
|
};
|
|
119
|
-
this.id++;
|
|
120
136
|
if (childHead && childHead.length) {
|
|
121
137
|
let childHeads = [];
|
|
122
138
|
this.getThead(childHead, childHeads);
|
|
@@ -128,6 +144,8 @@ export default {
|
|
|
128
144
|
items.children = childHeads;
|
|
129
145
|
}
|
|
130
146
|
data.push(items);
|
|
147
|
+
} else {
|
|
148
|
+
this.nid++;
|
|
131
149
|
}
|
|
132
150
|
});
|
|
133
151
|
},
|
|
@@ -152,10 +170,21 @@ export default {
|
|
|
152
170
|
handleChange(res) {
|
|
153
171
|
this.setThead(res, this.newThead);
|
|
154
172
|
},
|
|
173
|
+
handleDrag(res, evt) {
|
|
174
|
+
let { oldIndex, newIndex } = evt;
|
|
175
|
+
oldIndex += this.nid;
|
|
176
|
+
newIndex += this.nid;
|
|
177
|
+
if (oldIndex > newIndex) {
|
|
178
|
+
this.newThead.splice(newIndex, 0, this.newThead[oldIndex]);
|
|
179
|
+
this.newThead.splice(oldIndex + 1, 1);
|
|
180
|
+
} else {
|
|
181
|
+
this.newThead.splice(newIndex + 1, 0, this.newThead[oldIndex]);
|
|
182
|
+
this.newThead.splice(oldIndex, 1);
|
|
183
|
+
}
|
|
184
|
+
},
|
|
155
185
|
handleConfirm() {
|
|
156
186
|
this.visible = false;
|
|
157
|
-
this.$
|
|
158
|
-
this.$parent.mergeThead(this.newThead);
|
|
187
|
+
this.$emit('confirm', this.newThead);
|
|
159
188
|
}
|
|
160
189
|
}
|
|
161
190
|
};
|
|
@@ -11,7 +11,11 @@
|
|
|
11
11
|
:modal-append-to-body="modalAppendToBody"
|
|
12
12
|
v-bind="$attrs"
|
|
13
13
|
v-on="{ ...$listeners, close: handleClosed, scale: handleScale }"
|
|
14
|
-
:class="{
|
|
14
|
+
:class="{
|
|
15
|
+
'es-dialog-plus': mode == 'plus',
|
|
16
|
+
'is-middle': middle,
|
|
17
|
+
'es-title-hide': !titles
|
|
18
|
+
}"
|
|
15
19
|
:append-to-body="appendToBody"
|
|
16
20
|
:id="wujieName"
|
|
17
21
|
:ref="wujieName"
|