eoss-ui 0.5.81-beta8 → 0.5.82
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 +82 -55
- package/lib/button.js +57 -48
- package/lib/checkbox-group.js +55 -47
- package/lib/clients.js +4 -3
- package/lib/config/api.js +3 -1
- package/lib/data-table-form.js +55 -47
- package/lib/data-table.js +473 -276
- package/lib/date-picker.js +69 -59
- package/lib/dialog.js +77 -72
- package/lib/eoss-ui.common.js +4299 -3288
- package/lib/flow-group.js +102 -65
- package/lib/flow-list.js +56 -48
- package/lib/flow.js +158 -85
- package/lib/form.js +88 -59
- package/lib/handle-user.js +66 -51
- package/lib/handler.js +69 -50
- package/lib/icon.js +55 -47
- package/lib/index.js +1 -1
- package/lib/input-number.js +55 -47
- package/lib/input.js +55 -47
- package/lib/login.js +104 -85
- package/lib/main.js +1684 -1158
- package/lib/menu.js +1 -1
- package/lib/nav.js +55 -47
- package/lib/notify.js +54 -50
- package/lib/page.js +55 -47
- package/lib/pagination.js +3723 -3
- package/lib/player.js +60 -52
- package/lib/qr-code.js +55 -47
- package/lib/radio-group.js +55 -47
- package/lib/retrial-auth.js +56 -48
- package/lib/select-ganged.js +55 -47
- package/lib/select.js +55 -47
- package/lib/selector-panel.js +69 -60
- package/lib/selector.js +495 -424
- package/lib/sizer.js +55 -47
- package/lib/steps.js +55 -47
- package/lib/switch.js +55 -47
- package/lib/table-form.js +55 -47
- package/lib/tabs.js +1532 -1480
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/button-group.css +1 -1
- package/lib/theme-chalk/data-table.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/menu.css +1 -1
- package/lib/theme-chalk/pagination.css +1 -1
- package/lib/theme-chalk/simplicity.css +1 -1
- package/lib/theme-chalk/sizer.css +1 -1
- package/lib/theme-chalk/tabs.css +1 -1
- package/lib/theme-chalk/toolbar.css +1 -1
- package/lib/theme-chalk/tree-group.css +1 -1
- package/lib/theme-chalk/tree.css +1 -1
- package/lib/theme-chalk/upload.css +1 -1
- package/lib/tips.js +55 -47
- package/lib/tree-group.js +79 -50
- package/lib/tree.js +55 -47
- package/lib/upload.js +59 -51
- package/lib/utils/util.js +6 -2
- package/lib/wujie.js +55 -47
- package/lib/wxlogin.js +55 -47
- package/package.json +3 -3
- package/packages/button/src/main.vue +2 -1
- package/packages/button-group/src/main.vue +8 -6
- package/packages/clients/src/main.vue +2 -1
- package/packages/data-table/src/column.vue +137 -54
- package/packages/data-table/src/main.vue +77 -68
- package/packages/data-table/src/sizer.vue +2 -0
- package/packages/date-picker/src/main.vue +22 -14
- package/packages/dialog/src/main.vue +17 -23
- package/packages/flow/src/main.vue +32 -17
- package/packages/flow-group/src/main.vue +18 -11
- package/packages/form/src/main.vue +21 -10
- package/packages/handle-user/src/main.vue +5 -1
- package/packages/handler/src/main.vue +7 -3
- package/packages/login/src/main.vue +22 -15
- package/packages/main/src/default/index.vue +111 -179
- package/packages/main/src/main.vue +233 -4
- package/packages/main/src/public/online.vue +89 -0
- package/packages/main/src/simplicity/apps.vue +3 -3
- package/packages/main/src/simplicity/avatar.vue +16 -5
- package/packages/main/src/simplicity/handler.vue +6 -2
- package/packages/main/src/simplicity/index.vue +314 -238
- package/packages/main/src/simplicity/menu-list.vue +22 -74
- package/packages/main/src/simplicity/router-page.vue +5 -14
- package/packages/main/src/simplicity/sub-menu.vue +111 -7
- package/packages/main/src/simplicity/user.vue +5 -1
- package/packages/menu/src/main.vue +4 -3
- package/packages/pagination/src/main.vue +20 -1
- package/packages/selector/src/main.vue +147 -135
- package/packages/selector-panel/src/main.vue +3 -2
- package/packages/selector-panel/src/selection.vue +2 -2
- package/packages/tabs/src/main.vue +25 -15
- package/packages/theme-chalk/lib/base.css +1 -1
- package/packages/theme-chalk/lib/button-group.css +1 -1
- package/packages/theme-chalk/lib/data-table.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/menu.css +1 -1
- package/packages/theme-chalk/lib/pagination.css +1 -1
- package/packages/theme-chalk/lib/simplicity.css +1 -1
- package/packages/theme-chalk/lib/sizer.css +1 -1
- package/packages/theme-chalk/lib/tabs.css +1 -1
- package/packages/theme-chalk/lib/toolbar.css +1 -1
- package/packages/theme-chalk/lib/tree-group.css +1 -1
- package/packages/theme-chalk/lib/tree.css +1 -1
- package/packages/theme-chalk/lib/upload.css +1 -1
- package/packages/theme-chalk/src/base.scss +39 -0
- package/packages/theme-chalk/src/button-group.scss +16 -2
- package/packages/theme-chalk/src/common/var.scss +7 -2
- package/packages/theme-chalk/src/data-table.scss +60 -23
- package/packages/theme-chalk/src/form.scss +42 -40
- package/packages/theme-chalk/src/main.scss +11 -0
- package/packages/theme-chalk/src/pagination.scss +7 -0
- package/packages/theme-chalk/src/simplicity.scss +108 -40
- package/packages/theme-chalk/src/tabs.scss +24 -28
- package/packages/theme-chalk/src/toolbar.scss +16 -4
- package/packages/theme-chalk/src/tree-group.scss +8 -0
- package/packages/theme-chalk/src/tree.scss +19 -6
- package/packages/tree-group/src/main.vue +16 -7
- package/src/config/api.js +3 -1
- package/src/index.js +157 -157
- package/src/utils/util.js +6 -1
- package/CHANGELOG.md +0 -929
|
@@ -10,10 +10,49 @@
|
|
|
10
10
|
:rules="isNotRule(scope) ? [] : rules"
|
|
11
11
|
:index="scope.$index"
|
|
12
12
|
>
|
|
13
|
+
<component
|
|
14
|
+
v-if="getType(scope.row.formConfigs, 'component')"
|
|
15
|
+
:is="tag"
|
|
16
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
17
|
+
v-model="scope.row[field || prop]"
|
|
18
|
+
:data="getData(scope.row.formOptions)"
|
|
19
|
+
@blur="
|
|
20
|
+
(event) => {
|
|
21
|
+
handleBlur({
|
|
22
|
+
item: config,
|
|
23
|
+
event: event,
|
|
24
|
+
data: scope.row,
|
|
25
|
+
scope: scope
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
"
|
|
29
|
+
@focus="
|
|
30
|
+
(event) => {
|
|
31
|
+
handleFocus({
|
|
32
|
+
item: config,
|
|
33
|
+
event: event,
|
|
34
|
+
data: scope.row,
|
|
35
|
+
scope: scope
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
"
|
|
39
|
+
@change="
|
|
40
|
+
(value) => {
|
|
41
|
+
handleChange({
|
|
42
|
+
item: config,
|
|
43
|
+
name: field || prop,
|
|
44
|
+
value: value,
|
|
45
|
+
data: scope.row,
|
|
46
|
+
scope: scope
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
"
|
|
50
|
+
></component>
|
|
13
51
|
<es-select
|
|
14
|
-
v-if="
|
|
15
|
-
v-bind="
|
|
52
|
+
v-else-if="getType(scope.row.formConfigs, 'select')"
|
|
53
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
16
54
|
v-model="scope.row[field || prop]"
|
|
55
|
+
:data="getData(scope.row.formOptions)"
|
|
17
56
|
@blur="
|
|
18
57
|
(event) => {
|
|
19
58
|
handleBlur({
|
|
@@ -45,11 +84,13 @@
|
|
|
45
84
|
});
|
|
46
85
|
}
|
|
47
86
|
"
|
|
48
|
-
|
|
87
|
+
>
|
|
88
|
+
</es-select>
|
|
49
89
|
<es-cascader
|
|
50
|
-
v-else-if="
|
|
51
|
-
v-bind="
|
|
90
|
+
v-else-if="getType(scope.row.formConfigs, 'cascader')"
|
|
91
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
52
92
|
v-model="scope.row[field || prop]"
|
|
93
|
+
:data="getData(scope.row.formOptions)"
|
|
53
94
|
@blur="
|
|
54
95
|
(event) => {
|
|
55
96
|
handleBlur({
|
|
@@ -84,10 +125,10 @@
|
|
|
84
125
|
>
|
|
85
126
|
</es-cascader>
|
|
86
127
|
<es-select-ganged
|
|
87
|
-
v-else-if="
|
|
88
|
-
v-bind="
|
|
128
|
+
v-else-if="getType(scope.row.formConfigs, 'ganged')"
|
|
129
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
89
130
|
v-model="scope.row[field || prop]"
|
|
90
|
-
:data="init(
|
|
131
|
+
:data="init(getData(scope.row.formOptions), config)"
|
|
91
132
|
@change="
|
|
92
133
|
(value) => {
|
|
93
134
|
handleChange({
|
|
@@ -98,11 +139,13 @@
|
|
|
98
139
|
});
|
|
99
140
|
}
|
|
100
141
|
"
|
|
101
|
-
|
|
142
|
+
>
|
|
143
|
+
</es-select-ganged>
|
|
102
144
|
<es-radio-group
|
|
103
|
-
v-else-if="
|
|
104
|
-
v-bind="
|
|
145
|
+
v-else-if="getType(scope.row.formConfigs, 'radio')"
|
|
146
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
105
147
|
v-model="scope.row[field || prop]"
|
|
148
|
+
:data="getData(scope.row.formOptions)"
|
|
106
149
|
@change="
|
|
107
150
|
(value) => {
|
|
108
151
|
handleChange({
|
|
@@ -113,11 +156,13 @@
|
|
|
113
156
|
});
|
|
114
157
|
}
|
|
115
158
|
"
|
|
116
|
-
|
|
159
|
+
>
|
|
160
|
+
</es-radio-group>
|
|
117
161
|
<es-checkbox-group
|
|
118
|
-
v-else-if="
|
|
119
|
-
v-bind="
|
|
162
|
+
v-else-if="getType(scope.row.formConfigs, 'checkbox')"
|
|
163
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
120
164
|
v-model="scope.row[field || prop]"
|
|
165
|
+
:data="getData(scope.row.formOptions)"
|
|
121
166
|
@change="
|
|
122
167
|
(value) => {
|
|
123
168
|
handleChange({
|
|
@@ -128,11 +173,13 @@
|
|
|
128
173
|
});
|
|
129
174
|
}
|
|
130
175
|
"
|
|
131
|
-
|
|
176
|
+
>
|
|
177
|
+
</es-checkbox-group>
|
|
132
178
|
<es-switch
|
|
133
|
-
v-else-if="
|
|
134
|
-
v-bind="
|
|
179
|
+
v-else-if="getType(scope.row.formConfigs, 'switch')"
|
|
180
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
135
181
|
v-model="scope.row[field || prop]"
|
|
182
|
+
:data="getData(scope.row.formOptions)"
|
|
136
183
|
@change="
|
|
137
184
|
(value) => {
|
|
138
185
|
handleChange({
|
|
@@ -143,24 +190,27 @@
|
|
|
143
190
|
});
|
|
144
191
|
}
|
|
145
192
|
"
|
|
146
|
-
|
|
193
|
+
>
|
|
194
|
+
</es-switch>
|
|
147
195
|
<es-date-picker
|
|
148
196
|
v-else-if="
|
|
149
197
|
config.date ||
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
198
|
+
getType(scope.row.formConfigs, [
|
|
199
|
+
'date',
|
|
200
|
+
'year',
|
|
201
|
+
'month',
|
|
202
|
+
'date',
|
|
203
|
+
'dates',
|
|
204
|
+
'week',
|
|
205
|
+
'datetime',
|
|
206
|
+
'datetimerange',
|
|
207
|
+
'daterange',
|
|
208
|
+
'monthrange',
|
|
209
|
+
'quarter',
|
|
210
|
+
'halfyear'
|
|
211
|
+
])
|
|
162
212
|
"
|
|
163
|
-
v-bind="
|
|
213
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
164
214
|
v-model="scope.row[field || prop]"
|
|
165
215
|
:type="type"
|
|
166
216
|
@blur="
|
|
@@ -194,10 +244,11 @@
|
|
|
194
244
|
});
|
|
195
245
|
}
|
|
196
246
|
"
|
|
197
|
-
|
|
247
|
+
>
|
|
248
|
+
</es-date-picker>
|
|
198
249
|
<es-input-number
|
|
199
|
-
v-else-if="
|
|
200
|
-
v-bind="
|
|
250
|
+
v-else-if="getType(scope.row.formConfigs, 'number')"
|
|
251
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
201
252
|
v-model="scope.row[field || prop]"
|
|
202
253
|
@blur="
|
|
203
254
|
(event) => {
|
|
@@ -230,10 +281,11 @@
|
|
|
230
281
|
});
|
|
231
282
|
}
|
|
232
283
|
"
|
|
233
|
-
|
|
284
|
+
>
|
|
285
|
+
</es-input-number>
|
|
234
286
|
<es-selector
|
|
235
|
-
v-else-if="
|
|
236
|
-
v-bind="
|
|
287
|
+
v-else-if="getType(scope.row.formConfigs, 'selector')"
|
|
288
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
237
289
|
v-model="scope.row[field || prop]"
|
|
238
290
|
v-on="
|
|
239
291
|
exclAttribute({
|
|
@@ -251,17 +303,18 @@
|
|
|
251
303
|
});
|
|
252
304
|
}
|
|
253
305
|
"
|
|
254
|
-
|
|
306
|
+
>
|
|
307
|
+
</es-selector>
|
|
255
308
|
<template
|
|
256
309
|
v-else-if="
|
|
257
|
-
|
|
310
|
+
getType(scope.row.formConfigs, ['text', 'input', 'textarea'])
|
|
258
311
|
"
|
|
259
312
|
>
|
|
260
313
|
<template v-if="config.lazy">
|
|
261
314
|
<input
|
|
262
|
-
v-if="
|
|
315
|
+
v-if="getType(scope.row.formConfigs, ['text', 'input'])"
|
|
263
316
|
class="el-input__inner"
|
|
264
|
-
v-bind="
|
|
317
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
265
318
|
v-model.lazy="scope.row[field]"
|
|
266
319
|
@blur="
|
|
267
320
|
(event) => {
|
|
@@ -298,7 +351,7 @@
|
|
|
298
351
|
<textarea
|
|
299
352
|
v-else
|
|
300
353
|
class="el-textarea__inner"
|
|
301
|
-
v-bind="
|
|
354
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
302
355
|
v-model.lazy="scope.row[field]"
|
|
303
356
|
@blur="
|
|
304
357
|
(event) => {
|
|
@@ -335,7 +388,7 @@
|
|
|
335
388
|
</template>
|
|
336
389
|
<es-input
|
|
337
390
|
v-else
|
|
338
|
-
v-bind="
|
|
391
|
+
v-bind="getOptions(scope.row.formConfigs)"
|
|
339
392
|
:type="type"
|
|
340
393
|
:scope="scope"
|
|
341
394
|
v-model="scope.row[field || prop]"
|
|
@@ -370,7 +423,8 @@
|
|
|
370
423
|
});
|
|
371
424
|
}
|
|
372
425
|
"
|
|
373
|
-
|
|
426
|
+
>
|
|
427
|
+
</es-input>
|
|
374
428
|
</template>
|
|
375
429
|
</el-form-item>
|
|
376
430
|
</template>
|
|
@@ -402,6 +456,7 @@
|
|
|
402
456
|
})
|
|
403
457
|
"
|
|
404
458
|
stop
|
|
459
|
+
:mode="mode"
|
|
405
460
|
:contents="contents || events"
|
|
406
461
|
:data="scope"
|
|
407
462
|
@handleClick="handleClick"
|
|
@@ -459,6 +514,8 @@ export default {
|
|
|
459
514
|
}
|
|
460
515
|
},
|
|
461
516
|
props: {
|
|
517
|
+
tag: String,
|
|
518
|
+
mode: String,
|
|
462
519
|
service: String,
|
|
463
520
|
form: Boolean,
|
|
464
521
|
readonly: Boolean,
|
|
@@ -484,6 +541,10 @@ export default {
|
|
|
484
541
|
contents: Array,
|
|
485
542
|
events: [Array, Object],
|
|
486
543
|
dateFormat: String,
|
|
544
|
+
dateValue: {
|
|
545
|
+
type: String,
|
|
546
|
+
default: ''
|
|
547
|
+
},
|
|
487
548
|
styles: [Array, Object],
|
|
488
549
|
sysCode: String,
|
|
489
550
|
valueToString: Boolean,
|
|
@@ -582,8 +643,7 @@ export default {
|
|
|
582
643
|
: this.valueKey,
|
|
583
644
|
rules: this.rules,
|
|
584
645
|
events: this.events,
|
|
585
|
-
...this.$attrs
|
|
586
|
-
data: this.option
|
|
646
|
+
...this.$attrs
|
|
587
647
|
};
|
|
588
648
|
return config;
|
|
589
649
|
},
|
|
@@ -725,6 +785,25 @@ export default {
|
|
|
725
785
|
}
|
|
726
786
|
return data;
|
|
727
787
|
},
|
|
788
|
+
getType(config, types) {
|
|
789
|
+
let type =
|
|
790
|
+
config && config[this.field || this.prop]
|
|
791
|
+
? config[this.field || this.prop]['type'] ||
|
|
792
|
+
config[this.field || this.prop]
|
|
793
|
+
: this.type;
|
|
794
|
+
return Array.isArray(types) ? types.includes(type) : type == types;
|
|
795
|
+
},
|
|
796
|
+
getOptions(config) {
|
|
797
|
+
let option = config && config[this.field || this.prop];
|
|
798
|
+
return option && typeof option == 'object'
|
|
799
|
+
? { ...this.formOption, ...option }
|
|
800
|
+
: this.formOption;
|
|
801
|
+
},
|
|
802
|
+
getData(res) {
|
|
803
|
+
return res && res[this.field || this.prop]
|
|
804
|
+
? res[this.field || this.prop]
|
|
805
|
+
: this.option;
|
|
806
|
+
},
|
|
728
807
|
exclAttribute({ data, attrs }) {
|
|
729
808
|
return util.exclAttribute({ data, attrs });
|
|
730
809
|
},
|
|
@@ -824,10 +903,14 @@ export default {
|
|
|
824
903
|
this.$emit('formFocus', data);
|
|
825
904
|
this.$emit('form-focus', data);
|
|
826
905
|
},
|
|
827
|
-
handleChange(
|
|
828
|
-
let { item } =
|
|
829
|
-
if (
|
|
830
|
-
|
|
906
|
+
handleChange(datas) {
|
|
907
|
+
let { item, name, data } = datas;
|
|
908
|
+
if (
|
|
909
|
+
item &&
|
|
910
|
+
((data.formConfigs && data.formConfigs[name] == 'ganged') ||
|
|
911
|
+
this.type == 'ganged')
|
|
912
|
+
) {
|
|
913
|
+
let { index, value } = datas.value;
|
|
831
914
|
if (
|
|
832
915
|
(item.url || this.sysCode) &&
|
|
833
916
|
((item.ganged && index > item.ganged - 1) || value.hasSub)
|
|
@@ -888,16 +971,16 @@ export default {
|
|
|
888
971
|
}
|
|
889
972
|
}
|
|
890
973
|
}
|
|
891
|
-
this.events && this.events.change && this.events.change(
|
|
892
|
-
this.$emit('formChange',
|
|
893
|
-
this.$emit('form-change',
|
|
974
|
+
this.events && this.events.change && this.events.change(datas);
|
|
975
|
+
this.$emit('formChange', datas);
|
|
976
|
+
this.$emit('form-change', datas);
|
|
894
977
|
},
|
|
895
978
|
handleClick(data) {
|
|
896
979
|
this.$emit('handleClick', data);
|
|
897
980
|
this.$emit('handle-click', data);
|
|
898
981
|
},
|
|
899
982
|
formatDate(date, fmt) {
|
|
900
|
-
return util.formatDate(date, fmt);
|
|
983
|
+
return date ? util.formatDate(date, fmt) : this.dateValue;
|
|
901
984
|
}
|
|
902
985
|
}
|
|
903
986
|
};
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
<es-toolbar
|
|
13
13
|
v-if="showToolbar"
|
|
14
14
|
ref="toolbar"
|
|
15
|
+
:class="{
|
|
16
|
+
'es-table-toolbar-plus': mode == 'plus'
|
|
17
|
+
}"
|
|
15
18
|
v-bind="{
|
|
16
19
|
contents: toolbars,
|
|
17
20
|
showLabel: showLabel,
|
|
@@ -35,7 +38,10 @@
|
|
|
35
38
|
<div
|
|
36
39
|
style="styles"
|
|
37
40
|
class="es-data-table-content"
|
|
38
|
-
:class="
|
|
41
|
+
:class="{
|
|
42
|
+
'es-table-border-none': border == 'none',
|
|
43
|
+
'es-table-plus': mode == 'plus'
|
|
44
|
+
}"
|
|
39
45
|
ref="esTableContent"
|
|
40
46
|
v-if="show"
|
|
41
47
|
>
|
|
@@ -71,11 +77,6 @@
|
|
|
71
77
|
(theadBorder && border != 'none' ? ' es-thead-border' : '')
|
|
72
78
|
"
|
|
73
79
|
>
|
|
74
|
-
<!-- <el-table-column v-if="dragSort" width="32" fixed>
|
|
75
|
-
<template slot-scope="scope">
|
|
76
|
-
<es-icon :contents="dragSortIcon"></es-icon>
|
|
77
|
-
</template>
|
|
78
|
-
</el-table-column> -->
|
|
79
80
|
<slot name="prepend"></slot>
|
|
80
81
|
<slot></slot>
|
|
81
82
|
<template v-for="(item, index) in theads">
|
|
@@ -99,7 +100,9 @@
|
|
|
99
100
|
<children
|
|
100
101
|
v-else
|
|
101
102
|
:key="item.label || item.title"
|
|
103
|
+
:tag="item.tag"
|
|
102
104
|
v-bind="{
|
|
105
|
+
mode: mode,
|
|
103
106
|
name: name,
|
|
104
107
|
indexs: index,
|
|
105
108
|
form: form,
|
|
@@ -153,9 +156,11 @@
|
|
|
153
156
|
</div>
|
|
154
157
|
<es-pagination
|
|
155
158
|
v-else-if="page"
|
|
159
|
+
ref="pagination"
|
|
156
160
|
v-bind="config"
|
|
157
161
|
class="es-table-page"
|
|
158
|
-
:
|
|
162
|
+
:position="page.position"
|
|
163
|
+
:style="{ 'text-align': page.position }"
|
|
159
164
|
v-on="{
|
|
160
165
|
change: sizeChange,
|
|
161
166
|
current: currentChange,
|
|
@@ -166,7 +171,7 @@
|
|
|
166
171
|
<slot name="dialog"></slot>
|
|
167
172
|
<slot name="other"></slot>
|
|
168
173
|
</div>
|
|
169
|
-
<sizer ref="sizer" :data="theads"></sizer>
|
|
174
|
+
<sizer ref="sizer" :data="theads" :mode="mode"></sizer>
|
|
170
175
|
</component>
|
|
171
176
|
</template>
|
|
172
177
|
<script>
|
|
@@ -177,6 +182,8 @@ import sizer from './sizer.vue';
|
|
|
177
182
|
import util from 'eoss-ui/src/utils/util';
|
|
178
183
|
import bus from 'eoss-ui/src/utils/bus';
|
|
179
184
|
import qs from 'qs';
|
|
185
|
+
const dataTableMode =
|
|
186
|
+
util.win.top.dataTableMode || util.win.dataTableMode || 'default';
|
|
180
187
|
export default {
|
|
181
188
|
name: 'EsDataTable',
|
|
182
189
|
inheritAttrs: false,
|
|
@@ -202,6 +209,10 @@ export default {
|
|
|
202
209
|
}
|
|
203
210
|
},
|
|
204
211
|
props: {
|
|
212
|
+
mode: {
|
|
213
|
+
type: String,
|
|
214
|
+
default: dataTableMode
|
|
215
|
+
},
|
|
205
216
|
service: String,
|
|
206
217
|
loading: {
|
|
207
218
|
type: Boolean,
|
|
@@ -340,7 +351,7 @@ export default {
|
|
|
340
351
|
},
|
|
341
352
|
// 单元格配置
|
|
342
353
|
thead: {
|
|
343
|
-
type:
|
|
354
|
+
type: Array,
|
|
344
355
|
default() {
|
|
345
356
|
return [];
|
|
346
357
|
}
|
|
@@ -431,11 +442,13 @@ export default {
|
|
|
431
442
|
dragSortIcon: {
|
|
432
443
|
type: String,
|
|
433
444
|
default: 'es-icon-caidan'
|
|
434
|
-
}
|
|
445
|
+
},
|
|
446
|
+
fields: Boolean
|
|
435
447
|
},
|
|
436
448
|
data() {
|
|
437
449
|
return {
|
|
438
450
|
requests: [],
|
|
451
|
+
toolbars: [],
|
|
439
452
|
theadData: [],
|
|
440
453
|
list: [],
|
|
441
454
|
tableLoading: this.loading,
|
|
@@ -445,11 +458,14 @@ export default {
|
|
|
445
458
|
editValue: {},
|
|
446
459
|
restotalRow: null,
|
|
447
460
|
showTotal: false,
|
|
448
|
-
toolbars: [],
|
|
449
461
|
config: {
|
|
450
462
|
pageNum: 1,
|
|
451
463
|
pageSize: 20,
|
|
452
|
-
totalCount: 0
|
|
464
|
+
totalCount: 0,
|
|
465
|
+
layout:
|
|
466
|
+
this.mode == 'plus'
|
|
467
|
+
? 'total, sizes, prev, pager, next, jumper'
|
|
468
|
+
: undefined
|
|
453
469
|
},
|
|
454
470
|
searchWhere: {},
|
|
455
471
|
advanceWhere: {},
|
|
@@ -586,7 +602,6 @@ export default {
|
|
|
586
602
|
this.$nextTick(() => {
|
|
587
603
|
this.list = val;
|
|
588
604
|
});
|
|
589
|
-
console.log(val, 7777788);
|
|
590
605
|
}
|
|
591
606
|
this.$emit('update:data', val);
|
|
592
607
|
return val;
|
|
@@ -658,10 +673,6 @@ export default {
|
|
|
658
673
|
this.list = this.setData();
|
|
659
674
|
}
|
|
660
675
|
},
|
|
661
|
-
page() {
|
|
662
|
-
this.resetHeight();
|
|
663
|
-
this.doLayout();
|
|
664
|
-
},
|
|
665
676
|
scale: {
|
|
666
677
|
deep: true,
|
|
667
678
|
handler(val) {
|
|
@@ -676,7 +687,7 @@ export default {
|
|
|
676
687
|
}
|
|
677
688
|
},
|
|
678
689
|
zoom: {
|
|
679
|
-
handler(
|
|
690
|
+
handler() {
|
|
680
691
|
if (
|
|
681
692
|
this.tableHeight != 'auto' &&
|
|
682
693
|
this.tableHeight !== false &&
|
|
@@ -693,10 +704,15 @@ export default {
|
|
|
693
704
|
thead: {
|
|
694
705
|
deep: true,
|
|
695
706
|
handler(val) {
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
707
|
+
this.getOptions(val);
|
|
708
|
+
|
|
709
|
+
if (
|
|
710
|
+
Array.isArray(val) &&
|
|
711
|
+
val.length &&
|
|
712
|
+
this.fields &&
|
|
713
|
+
this.datas.length == 0
|
|
714
|
+
) {
|
|
715
|
+
this.getTableData();
|
|
700
716
|
}
|
|
701
717
|
}
|
|
702
718
|
},
|
|
@@ -708,7 +724,7 @@ export default {
|
|
|
708
724
|
},
|
|
709
725
|
param: {
|
|
710
726
|
deep: true,
|
|
711
|
-
handler(
|
|
727
|
+
handler() {
|
|
712
728
|
this.getTableData();
|
|
713
729
|
}
|
|
714
730
|
},
|
|
@@ -716,14 +732,12 @@ export default {
|
|
|
716
732
|
immediate: true,
|
|
717
733
|
deep: true,
|
|
718
734
|
handler(val) {
|
|
735
|
+
if (this.$el) {
|
|
736
|
+
this.resetHeight();
|
|
737
|
+
this.doLayout();
|
|
738
|
+
}
|
|
719
739
|
if (typeof val === 'object') {
|
|
720
740
|
this.config = util.extend({}, this.config, val);
|
|
721
|
-
} else {
|
|
722
|
-
this.config = {
|
|
723
|
-
pageNum: 1,
|
|
724
|
-
pageSize: 20,
|
|
725
|
-
totalCount: 0
|
|
726
|
-
};
|
|
727
741
|
}
|
|
728
742
|
}
|
|
729
743
|
},
|
|
@@ -766,9 +780,15 @@ export default {
|
|
|
766
780
|
created() {
|
|
767
781
|
if (Array.isArray(this.thead) && this.thead.length) {
|
|
768
782
|
this.getOptions(this.thead);
|
|
783
|
+
if (this.fields) {
|
|
784
|
+
this.immediate && this.getTableData();
|
|
785
|
+
this.chekOpenTotalArea();
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
if (!this.fields) {
|
|
789
|
+
this.immediate && this.getTableData();
|
|
790
|
+
this.chekOpenTotalArea();
|
|
769
791
|
}
|
|
770
|
-
this.immediate && this.getTableData();
|
|
771
|
-
this.chekOpenTotalArea();
|
|
772
792
|
},
|
|
773
793
|
mounted() {
|
|
774
794
|
if (this.data.length) {
|
|
@@ -776,6 +796,9 @@ export default {
|
|
|
776
796
|
}
|
|
777
797
|
this.list.length && this.checkSelect(this.checked);
|
|
778
798
|
this.resetHeight();
|
|
799
|
+
if (util.win.top != util.win.self) {
|
|
800
|
+
util.win.onresize = debounce(500, this.resetHeight);
|
|
801
|
+
}
|
|
779
802
|
},
|
|
780
803
|
methods: {
|
|
781
804
|
setData() {
|
|
@@ -987,40 +1010,6 @@ export default {
|
|
|
987
1010
|
}
|
|
988
1011
|
});
|
|
989
1012
|
},
|
|
990
|
-
getTheads() {
|
|
991
|
-
util
|
|
992
|
-
.ajax({
|
|
993
|
-
url: this.thead,
|
|
994
|
-
method: this.method,
|
|
995
|
-
format: this.format,
|
|
996
|
-
params: this.param,
|
|
997
|
-
data: this.param
|
|
998
|
-
})
|
|
999
|
-
.then((res) => {
|
|
1000
|
-
if (res.rCode === 0) {
|
|
1001
|
-
let results = res.results;
|
|
1002
|
-
if (Array.isArray(results)) {
|
|
1003
|
-
this.theadData = results;
|
|
1004
|
-
} else {
|
|
1005
|
-
this.theadData = results.theadData || [];
|
|
1006
|
-
this.list = results.data || results.records || [];
|
|
1007
|
-
this.config.totalCount =
|
|
1008
|
-
results.count || results.total || results.totalCount;
|
|
1009
|
-
this.getOptions(this.theadData);
|
|
1010
|
-
}
|
|
1011
|
-
} else {
|
|
1012
|
-
this.theadData = [];
|
|
1013
|
-
let msg = res.msg || '系统错误,请联系管理员!';
|
|
1014
|
-
this.$message.error(msg);
|
|
1015
|
-
}
|
|
1016
|
-
this.$emit('success', res);
|
|
1017
|
-
})
|
|
1018
|
-
.catch((err) => {
|
|
1019
|
-
if (err.message && err.message !== 'canceled') {
|
|
1020
|
-
this.$message.error(err.message);
|
|
1021
|
-
}
|
|
1022
|
-
});
|
|
1023
|
-
},
|
|
1024
1013
|
getTableDatas(res) {
|
|
1025
1014
|
let where;
|
|
1026
1015
|
let first;
|
|
@@ -1058,6 +1047,22 @@ export default {
|
|
|
1058
1047
|
}
|
|
1059
1048
|
}
|
|
1060
1049
|
}
|
|
1050
|
+
if (this.fields) {
|
|
1051
|
+
let fields = [];
|
|
1052
|
+
this.thead.forEach((item) => {
|
|
1053
|
+
if (item.field || item.prop) {
|
|
1054
|
+
fields.push(item.field || item.prop);
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
let initLogin = util.getStorage('initLogin');
|
|
1058
|
+
initLogin && (initLogin = JSON.parse(initLogin));
|
|
1059
|
+
reqData['fields'] = initLogin.secret
|
|
1060
|
+
? util.esmEncrypt({
|
|
1061
|
+
data: fields.join(','),
|
|
1062
|
+
key: initLogin.secret
|
|
1063
|
+
})
|
|
1064
|
+
: fields.join(',');
|
|
1065
|
+
}
|
|
1061
1066
|
this.tableLoading = true;
|
|
1062
1067
|
util
|
|
1063
1068
|
.ajax({
|
|
@@ -1094,6 +1099,7 @@ export default {
|
|
|
1094
1099
|
}
|
|
1095
1100
|
this.config.totalCount =
|
|
1096
1101
|
results.count || results.total || results.totalCount;
|
|
1102
|
+
this.config.pageCount = results.pageCount;
|
|
1097
1103
|
this.checked &&
|
|
1098
1104
|
this.$nextTick(() => {
|
|
1099
1105
|
this.checkSelect(this.checked);
|
|
@@ -1147,7 +1153,7 @@ export default {
|
|
|
1147
1153
|
this.$refs.oaTable.clearFilter(columnKey);
|
|
1148
1154
|
},
|
|
1149
1155
|
doLayout() {
|
|
1150
|
-
this.$refs.oaTable.doLayout();
|
|
1156
|
+
this.$refs.oaTable && this.$refs.oaTable.doLayout();
|
|
1151
1157
|
},
|
|
1152
1158
|
sort(prop, order) {
|
|
1153
1159
|
this.$refs.oaTable.sort(prop, order);
|
|
@@ -1537,8 +1543,11 @@ export default {
|
|
|
1537
1543
|
parseInt(util.getStyle(ele, 'margin-bottom'), 10);
|
|
1538
1544
|
}
|
|
1539
1545
|
}
|
|
1540
|
-
height -= this.showToolbar
|
|
1541
|
-
|
|
1546
|
+
height -= this.showToolbar
|
|
1547
|
+
? this.$refs.toolbar.$el.offsetHeight
|
|
1548
|
+
: 0;
|
|
1549
|
+
height -=
|
|
1550
|
+
this.page === false ? 0 : this.$refs.pagination.$el.offsetHeight;
|
|
1542
1551
|
height -= this.title ? this.$refs.title.offsetHeight : 0;
|
|
1543
1552
|
height -= parseInt(
|
|
1544
1553
|
util.getStyle(this.$refs.esTableContent, 'padding-top'),
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
row-key="id"
|
|
8
8
|
default-expand-all
|
|
9
9
|
height="500px"
|
|
10
|
+
:mode="mode"
|
|
10
11
|
:data="theads"
|
|
11
12
|
:thead="thead"
|
|
12
13
|
:tree-props="{ children: 'childHead' }"
|
|
@@ -26,6 +27,7 @@ import util from 'eoss-ui/src/utils/util';
|
|
|
26
27
|
export default {
|
|
27
28
|
name: 'Sizer',
|
|
28
29
|
props: {
|
|
30
|
+
mode: String,
|
|
29
31
|
data: Array
|
|
30
32
|
},
|
|
31
33
|
computed: {
|