@idooel/components 0.0.1-beta.2 → 0.0.1-beta.21
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/dist/@idooel/components.esm.js +2173 -708
- package/dist/@idooel/components.umd.js +2180 -714
- package/package.json +6 -5
- package/packages/alert/index.js +5 -0
- package/packages/alert/src/index.vue +46 -0
- package/packages/batch-export/src/index.vue +97 -5
- package/packages/composite-components/modal-import/index.js +5 -0
- package/packages/composite-components/modal-import/src/index.vue +28 -0
- package/packages/composite-components/search-area/src/index.vue +19 -0
- package/packages/date-range/index.js +5 -0
- package/packages/date-range/src/index.vue +47 -0
- package/packages/form/src/index.vue +106 -12
- package/packages/form-group-model/index.js +5 -0
- package/packages/form-group-model/src/index.vue +274 -0
- package/packages/form-model/src/index.vue +42 -15
- package/packages/index.js +17 -6
- package/packages/input/src/index.vue +9 -1
- package/packages/modal/src/index.vue +15 -2
- package/packages/radio/src/index.vue +5 -1
- package/packages/select/src/index.vue +60 -2
- package/packages/step-model/index.js +5 -0
- package/packages/step-model/src/index.vue +173 -0
- package/packages/tabs/index.js +5 -0
- package/packages/tabs/src/index.vue +55 -0
- package/packages/textarea/src/index.vue +10 -1
- package/packages/theme/form.scss +2 -4
- package/packages/theme/index.scss +4 -0
- package/packages/tpl/src/index.vue +7 -1
- package/packages/upload/src/index.vue +8 -10
- package/packages/utils/index.js +21 -1
- package/packages/text/index.js +0 -5
- package/packages/text/src/index.vue +0 -15
- /package/packages/{attachment → composite-components/attachment}/index.js +0 -0
- /package/packages/{attachment → composite-components/attachment}/src/index.vue +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type,
|
|
1
|
+
import { type, net, route } from '@idooel/shared';
|
|
2
2
|
import moment from 'moment';
|
|
3
3
|
import FileUpload from 'vue-upload-component';
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ import FileUpload from 'vue-upload-component';
|
|
|
20
20
|
//
|
|
21
21
|
//
|
|
22
22
|
|
|
23
|
-
var script$
|
|
23
|
+
var script$s = {
|
|
24
24
|
name: 'ele-button',
|
|
25
25
|
props: {
|
|
26
26
|
record: {
|
|
@@ -138,10 +138,10 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
/* script */
|
|
141
|
-
const __vue_script__$
|
|
141
|
+
const __vue_script__$s = script$s;
|
|
142
142
|
|
|
143
143
|
/* template */
|
|
144
|
-
var __vue_render__$
|
|
144
|
+
var __vue_render__$s = function () {
|
|
145
145
|
var _vm = this;
|
|
146
146
|
var _h = _vm.$createElement;
|
|
147
147
|
var _c = _vm._self._c || _h;
|
|
@@ -187,17 +187,17 @@ var __vue_render__$n = function () {
|
|
|
187
187
|
2
|
|
188
188
|
)
|
|
189
189
|
};
|
|
190
|
-
var __vue_staticRenderFns__$
|
|
191
|
-
__vue_render__$
|
|
190
|
+
var __vue_staticRenderFns__$s = [];
|
|
191
|
+
__vue_render__$s._withStripped = true;
|
|
192
192
|
|
|
193
193
|
/* style */
|
|
194
|
-
const __vue_inject_styles__$
|
|
194
|
+
const __vue_inject_styles__$s = undefined;
|
|
195
195
|
/* scoped */
|
|
196
|
-
const __vue_scope_id__$
|
|
196
|
+
const __vue_scope_id__$s = undefined;
|
|
197
197
|
/* module identifier */
|
|
198
|
-
const __vue_module_identifier__$
|
|
198
|
+
const __vue_module_identifier__$s = undefined;
|
|
199
199
|
/* functional template */
|
|
200
|
-
const __vue_is_functional_template__$
|
|
200
|
+
const __vue_is_functional_template__$s = false;
|
|
201
201
|
/* style inject */
|
|
202
202
|
|
|
203
203
|
/* style inject SSR */
|
|
@@ -206,20 +206,20 @@ __vue_render__$n._withStripped = true;
|
|
|
206
206
|
|
|
207
207
|
|
|
208
208
|
|
|
209
|
-
const __vue_component__$
|
|
210
|
-
{ render: __vue_render__$
|
|
211
|
-
__vue_inject_styles__$
|
|
212
|
-
__vue_script__$
|
|
213
|
-
__vue_scope_id__$
|
|
214
|
-
__vue_is_functional_template__$
|
|
215
|
-
__vue_module_identifier__$
|
|
209
|
+
const __vue_component__$s = /*#__PURE__*/normalizeComponent(
|
|
210
|
+
{ render: __vue_render__$s, staticRenderFns: __vue_staticRenderFns__$s },
|
|
211
|
+
__vue_inject_styles__$s,
|
|
212
|
+
__vue_script__$s,
|
|
213
|
+
__vue_scope_id__$s,
|
|
214
|
+
__vue_is_functional_template__$s,
|
|
215
|
+
__vue_module_identifier__$s,
|
|
216
216
|
false,
|
|
217
217
|
undefined,
|
|
218
218
|
undefined,
|
|
219
219
|
undefined
|
|
220
220
|
);
|
|
221
221
|
|
|
222
|
-
__vue_component__$
|
|
222
|
+
__vue_component__$s.install = Vue => Vue.component(__vue_component__$s.name, __vue_component__$s);
|
|
223
223
|
|
|
224
224
|
//
|
|
225
225
|
//
|
|
@@ -234,7 +234,7 @@ __vue_component__$n.install = Vue => Vue.component(__vue_component__$n.name, __v
|
|
|
234
234
|
//
|
|
235
235
|
//
|
|
236
236
|
|
|
237
|
-
var script$
|
|
237
|
+
var script$r = {
|
|
238
238
|
name: 'ele-date',
|
|
239
239
|
props: {
|
|
240
240
|
value: {
|
|
@@ -262,10 +262,10 @@ var script$m = {
|
|
|
262
262
|
};
|
|
263
263
|
|
|
264
264
|
/* script */
|
|
265
|
-
const __vue_script__$
|
|
265
|
+
const __vue_script__$r = script$r;
|
|
266
266
|
|
|
267
267
|
/* template */
|
|
268
|
-
var __vue_render__$
|
|
268
|
+
var __vue_render__$r = function () {
|
|
269
269
|
var _vm = this;
|
|
270
270
|
var _h = _vm.$createElement;
|
|
271
271
|
var _c = _vm._self._c || _h;
|
|
@@ -280,17 +280,17 @@ var __vue_render__$m = function () {
|
|
|
280
280
|
on: { focus: _vm.onFocus, panelChange: _vm.onPanelChange },
|
|
281
281
|
})
|
|
282
282
|
};
|
|
283
|
-
var __vue_staticRenderFns__$
|
|
284
|
-
__vue_render__$
|
|
283
|
+
var __vue_staticRenderFns__$r = [];
|
|
284
|
+
__vue_render__$r._withStripped = true;
|
|
285
285
|
|
|
286
286
|
/* style */
|
|
287
|
-
const __vue_inject_styles__$
|
|
287
|
+
const __vue_inject_styles__$r = undefined;
|
|
288
288
|
/* scoped */
|
|
289
|
-
const __vue_scope_id__$
|
|
289
|
+
const __vue_scope_id__$r = undefined;
|
|
290
290
|
/* module identifier */
|
|
291
|
-
const __vue_module_identifier__$
|
|
291
|
+
const __vue_module_identifier__$r = undefined;
|
|
292
292
|
/* functional template */
|
|
293
|
-
const __vue_is_functional_template__$
|
|
293
|
+
const __vue_is_functional_template__$r = false;
|
|
294
294
|
/* style inject */
|
|
295
295
|
|
|
296
296
|
/* style inject SSR */
|
|
@@ -299,29 +299,37 @@ __vue_render__$m._withStripped = true;
|
|
|
299
299
|
|
|
300
300
|
|
|
301
301
|
|
|
302
|
-
const __vue_component__$
|
|
303
|
-
{ render: __vue_render__$
|
|
304
|
-
__vue_inject_styles__$
|
|
305
|
-
__vue_script__$
|
|
306
|
-
__vue_scope_id__$
|
|
307
|
-
__vue_is_functional_template__$
|
|
308
|
-
__vue_module_identifier__$
|
|
302
|
+
const __vue_component__$r = /*#__PURE__*/normalizeComponent(
|
|
303
|
+
{ render: __vue_render__$r, staticRenderFns: __vue_staticRenderFns__$r },
|
|
304
|
+
__vue_inject_styles__$r,
|
|
305
|
+
__vue_script__$r,
|
|
306
|
+
__vue_scope_id__$r,
|
|
307
|
+
__vue_is_functional_template__$r,
|
|
308
|
+
__vue_module_identifier__$r,
|
|
309
309
|
false,
|
|
310
310
|
undefined,
|
|
311
311
|
undefined,
|
|
312
312
|
undefined
|
|
313
313
|
);
|
|
314
314
|
|
|
315
|
-
__vue_component__$
|
|
315
|
+
__vue_component__$r.install = Vue => Vue.component(__vue_component__$r.name, __vue_component__$r);
|
|
316
316
|
|
|
317
317
|
//
|
|
318
318
|
//
|
|
319
319
|
//
|
|
320
320
|
//
|
|
321
321
|
|
|
322
|
-
var script$
|
|
322
|
+
var script$q = {
|
|
323
323
|
name: 'ele-input',
|
|
324
|
+
model: {
|
|
325
|
+
prop: 'value',
|
|
326
|
+
event: 'change'
|
|
327
|
+
},
|
|
324
328
|
props: {
|
|
329
|
+
disabled: {
|
|
330
|
+
type: Boolean,
|
|
331
|
+
default: false
|
|
332
|
+
},
|
|
325
333
|
maxLength: {
|
|
326
334
|
type: Number,
|
|
327
335
|
default: 125
|
|
@@ -383,66 +391,66 @@ function addStyle(id, css) {
|
|
|
383
391
|
}
|
|
384
392
|
|
|
385
393
|
/* script */
|
|
386
|
-
const __vue_script__$
|
|
394
|
+
const __vue_script__$q = script$q;
|
|
387
395
|
|
|
388
396
|
/* template */
|
|
389
|
-
var __vue_render__$
|
|
397
|
+
var __vue_render__$q = function () {
|
|
390
398
|
var _vm = this;
|
|
391
399
|
var _h = _vm.$createElement;
|
|
392
400
|
var _c = _vm._self._c || _h;
|
|
393
401
|
return _c("a-input", {
|
|
394
|
-
attrs: {
|
|
402
|
+
attrs: {
|
|
403
|
+
value: _vm.value,
|
|
404
|
+
disabled: _vm.disabled,
|
|
405
|
+
"max-length": _vm.maxLength,
|
|
406
|
+
},
|
|
395
407
|
on: { change: _vm.onChange },
|
|
396
408
|
})
|
|
397
409
|
};
|
|
398
|
-
var __vue_staticRenderFns__$
|
|
399
|
-
__vue_render__$
|
|
410
|
+
var __vue_staticRenderFns__$q = [];
|
|
411
|
+
__vue_render__$q._withStripped = true;
|
|
400
412
|
|
|
401
413
|
/* style */
|
|
402
|
-
const __vue_inject_styles__$
|
|
414
|
+
const __vue_inject_styles__$q = function (inject) {
|
|
403
415
|
if (!inject) return
|
|
404
|
-
inject("data-v-
|
|
416
|
+
inject("data-v-2dfc23ac_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
405
417
|
|
|
406
418
|
};
|
|
407
419
|
/* scoped */
|
|
408
|
-
const __vue_scope_id__$
|
|
420
|
+
const __vue_scope_id__$q = "data-v-2dfc23ac";
|
|
409
421
|
/* module identifier */
|
|
410
|
-
const __vue_module_identifier__$
|
|
422
|
+
const __vue_module_identifier__$q = undefined;
|
|
411
423
|
/* functional template */
|
|
412
|
-
const __vue_is_functional_template__$
|
|
424
|
+
const __vue_is_functional_template__$q = false;
|
|
413
425
|
/* style inject SSR */
|
|
414
426
|
|
|
415
427
|
/* style inject shadow dom */
|
|
416
428
|
|
|
417
429
|
|
|
418
430
|
|
|
419
|
-
const __vue_component__$
|
|
420
|
-
{ render: __vue_render__$
|
|
421
|
-
__vue_inject_styles__$
|
|
422
|
-
__vue_script__$
|
|
423
|
-
__vue_scope_id__$
|
|
424
|
-
__vue_is_functional_template__$
|
|
425
|
-
__vue_module_identifier__$
|
|
431
|
+
const __vue_component__$q = /*#__PURE__*/normalizeComponent(
|
|
432
|
+
{ render: __vue_render__$q, staticRenderFns: __vue_staticRenderFns__$q },
|
|
433
|
+
__vue_inject_styles__$q,
|
|
434
|
+
__vue_script__$q,
|
|
435
|
+
__vue_scope_id__$q,
|
|
436
|
+
__vue_is_functional_template__$q,
|
|
437
|
+
__vue_module_identifier__$q,
|
|
426
438
|
false,
|
|
427
439
|
createInjector,
|
|
428
440
|
undefined,
|
|
429
441
|
undefined
|
|
430
442
|
);
|
|
431
443
|
|
|
432
|
-
__vue_component__$
|
|
444
|
+
__vue_component__$q.install = Vue => Vue.component(__vue_component__$q.name, __vue_component__$q);
|
|
433
445
|
|
|
434
446
|
//
|
|
435
|
-
|
|
436
|
-
//
|
|
437
|
-
//
|
|
438
|
-
//
|
|
439
|
-
//
|
|
440
|
-
//
|
|
441
|
-
//
|
|
442
|
-
|
|
443
|
-
var script$k = {
|
|
447
|
+
var script$p = {
|
|
444
448
|
name: 'ele-select',
|
|
445
449
|
props: {
|
|
450
|
+
disabled: {
|
|
451
|
+
type: Boolean,
|
|
452
|
+
default: false
|
|
453
|
+
},
|
|
446
454
|
value: {
|
|
447
455
|
type: [String, Array, Number]
|
|
448
456
|
},
|
|
@@ -452,9 +460,67 @@ var script$k = {
|
|
|
452
460
|
dataSource: {
|
|
453
461
|
type: Array,
|
|
454
462
|
default: () => []
|
|
463
|
+
},
|
|
464
|
+
url: {
|
|
465
|
+
type: String,
|
|
466
|
+
default: 'api-basic/workbench/dicttype/enum/selectList'
|
|
467
|
+
},
|
|
468
|
+
code: {
|
|
469
|
+
type: String
|
|
470
|
+
},
|
|
471
|
+
params: {
|
|
472
|
+
type: Object,
|
|
473
|
+
default: () => ({})
|
|
474
|
+
},
|
|
475
|
+
mode: {
|
|
476
|
+
type: String
|
|
477
|
+
},
|
|
478
|
+
multiple: {
|
|
479
|
+
type: Boolean,
|
|
480
|
+
default: false
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
data() {
|
|
484
|
+
return {
|
|
485
|
+
innerDataSource: []
|
|
486
|
+
};
|
|
487
|
+
},
|
|
488
|
+
computed: {
|
|
489
|
+
getMode() {
|
|
490
|
+
if (this.multiple) {
|
|
491
|
+
return 'multiple';
|
|
492
|
+
}
|
|
493
|
+
return this.mode;
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
watch: {
|
|
497
|
+
dataSource: {
|
|
498
|
+
handler(dataSource) {
|
|
499
|
+
this.innerDataSource = dataSource;
|
|
500
|
+
},
|
|
501
|
+
immediate: true
|
|
455
502
|
}
|
|
456
503
|
},
|
|
504
|
+
created() {
|
|
505
|
+
(this.code || !type.isEmpty(this.params)) && this.fetchDataSourceByUrl();
|
|
506
|
+
},
|
|
457
507
|
methods: {
|
|
508
|
+
fetchDataSourceByUrl() {
|
|
509
|
+
net.get(this.url, {
|
|
510
|
+
code: this.code,
|
|
511
|
+
...this.params
|
|
512
|
+
}).then(resp => {
|
|
513
|
+
const {
|
|
514
|
+
data
|
|
515
|
+
} = resp;
|
|
516
|
+
this.innerDataSource = data.map(item => {
|
|
517
|
+
return {
|
|
518
|
+
label: item.name,
|
|
519
|
+
value: item.code
|
|
520
|
+
};
|
|
521
|
+
});
|
|
522
|
+
});
|
|
523
|
+
},
|
|
458
524
|
onChange(value) {
|
|
459
525
|
this.$emit('change', value);
|
|
460
526
|
this.$emit('input', value);
|
|
@@ -463,10 +529,10 @@ var script$k = {
|
|
|
463
529
|
};
|
|
464
530
|
|
|
465
531
|
/* script */
|
|
466
|
-
const __vue_script__$
|
|
532
|
+
const __vue_script__$p = script$p;
|
|
467
533
|
|
|
468
534
|
/* template */
|
|
469
|
-
var __vue_render__$
|
|
535
|
+
var __vue_render__$p = function () {
|
|
470
536
|
var _vm = this;
|
|
471
537
|
var _h = _vm.$createElement;
|
|
472
538
|
var _c = _vm._self._c || _h;
|
|
@@ -474,10 +540,10 @@ var __vue_render__$k = function () {
|
|
|
474
540
|
"a-select",
|
|
475
541
|
{
|
|
476
542
|
staticStyle: { width: "100%" },
|
|
477
|
-
attrs: { value: _vm.value },
|
|
543
|
+
attrs: { disabled: _vm.disabled, mode: _vm.getMode, value: _vm.value },
|
|
478
544
|
on: { change: _vm.onChange },
|
|
479
545
|
},
|
|
480
|
-
_vm._l(_vm.
|
|
546
|
+
_vm._l(_vm.innerDataSource, function (item) {
|
|
481
547
|
return _c(
|
|
482
548
|
"a-select-option",
|
|
483
549
|
{ key: item.value, attrs: { value: item.value } },
|
|
@@ -487,41 +553,41 @@ var __vue_render__$k = function () {
|
|
|
487
553
|
1
|
|
488
554
|
)
|
|
489
555
|
};
|
|
490
|
-
var __vue_staticRenderFns__$
|
|
491
|
-
__vue_render__$
|
|
556
|
+
var __vue_staticRenderFns__$p = [];
|
|
557
|
+
__vue_render__$p._withStripped = true;
|
|
492
558
|
|
|
493
559
|
/* style */
|
|
494
|
-
const __vue_inject_styles__$
|
|
560
|
+
const __vue_inject_styles__$p = function (inject) {
|
|
495
561
|
if (!inject) return
|
|
496
|
-
inject("data-v-
|
|
562
|
+
inject("data-v-ccfe5f1e_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
497
563
|
|
|
498
564
|
};
|
|
499
565
|
/* scoped */
|
|
500
|
-
const __vue_scope_id__$
|
|
566
|
+
const __vue_scope_id__$p = "data-v-ccfe5f1e";
|
|
501
567
|
/* module identifier */
|
|
502
|
-
const __vue_module_identifier__$
|
|
568
|
+
const __vue_module_identifier__$p = undefined;
|
|
503
569
|
/* functional template */
|
|
504
|
-
const __vue_is_functional_template__$
|
|
570
|
+
const __vue_is_functional_template__$p = false;
|
|
505
571
|
/* style inject SSR */
|
|
506
572
|
|
|
507
573
|
/* style inject shadow dom */
|
|
508
574
|
|
|
509
575
|
|
|
510
576
|
|
|
511
|
-
const __vue_component__$
|
|
512
|
-
{ render: __vue_render__$
|
|
513
|
-
__vue_inject_styles__$
|
|
514
|
-
__vue_script__$
|
|
515
|
-
__vue_scope_id__$
|
|
516
|
-
__vue_is_functional_template__$
|
|
517
|
-
__vue_module_identifier__$
|
|
577
|
+
const __vue_component__$p = /*#__PURE__*/normalizeComponent(
|
|
578
|
+
{ render: __vue_render__$p, staticRenderFns: __vue_staticRenderFns__$p },
|
|
579
|
+
__vue_inject_styles__$p,
|
|
580
|
+
__vue_script__$p,
|
|
581
|
+
__vue_scope_id__$p,
|
|
582
|
+
__vue_is_functional_template__$p,
|
|
583
|
+
__vue_module_identifier__$p,
|
|
518
584
|
false,
|
|
519
585
|
createInjector,
|
|
520
586
|
undefined,
|
|
521
587
|
undefined
|
|
522
588
|
);
|
|
523
589
|
|
|
524
|
-
__vue_component__$
|
|
590
|
+
__vue_component__$p.install = Vue => Vue.component(__vue_component__$p.name, __vue_component__$p);
|
|
525
591
|
|
|
526
592
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
527
593
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
@@ -1155,7 +1221,7 @@ const parse = (expression, props = {}) => {
|
|
|
1155
1221
|
|
|
1156
1222
|
//
|
|
1157
1223
|
const MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002';
|
|
1158
|
-
var script$
|
|
1224
|
+
var script$o = {
|
|
1159
1225
|
props: {
|
|
1160
1226
|
record: {
|
|
1161
1227
|
type: Object
|
|
@@ -1253,10 +1319,10 @@ var script$j = {
|
|
|
1253
1319
|
};
|
|
1254
1320
|
|
|
1255
1321
|
/* script */
|
|
1256
|
-
const __vue_script__$
|
|
1322
|
+
const __vue_script__$o = script$o;
|
|
1257
1323
|
|
|
1258
1324
|
/* template */
|
|
1259
|
-
var __vue_render__$
|
|
1325
|
+
var __vue_render__$o = function () {
|
|
1260
1326
|
var _vm = this;
|
|
1261
1327
|
var _h = _vm.$createElement;
|
|
1262
1328
|
var _c = _vm._self._c || _h;
|
|
@@ -1356,34 +1422,34 @@ var __vue_render__$j = function () {
|
|
|
1356
1422
|
0
|
|
1357
1423
|
)
|
|
1358
1424
|
};
|
|
1359
|
-
var __vue_staticRenderFns__$
|
|
1360
|
-
__vue_render__$
|
|
1425
|
+
var __vue_staticRenderFns__$o = [];
|
|
1426
|
+
__vue_render__$o._withStripped = true;
|
|
1361
1427
|
|
|
1362
1428
|
/* style */
|
|
1363
|
-
const __vue_inject_styles__$
|
|
1429
|
+
const __vue_inject_styles__$o = function (inject) {
|
|
1364
1430
|
if (!inject) return
|
|
1365
1431
|
inject("data-v-572820bc_0", { source: ".g-table__action[data-v-572820bc] {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item[data-v-572820bc] {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item[data-v-572820bc]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\table\\src\\action.vue","action.vue"],"names":[],"mappings":"AAsHA;EACA,aAAA;EACA,mBAAA;ACrHA;ADsHA;EACA,eAAA;EACA,cAAA;EACA,iBAAA;EACA,eAAA;ACpHA;ADqHA;EACA,cAAA;ACnHA;;AAEA,qCAAqC","file":"action.vue","sourcesContent":["<template>\r\n <div class=\"g-table__action\">\r\n <div class=\"table-action__item\" v-for=\"(item, idx) in execOperationExpression(dataSource)\" :key=\"idx\">\r\n <template v-if=\"item.type == 'text'\">\r\n <span @click=\"handleClickText(item)\">{{ item.label }}</span>\r\n </template>\r\n <template v-else-if=\"item.type == 'dropdown'\">\r\n <a-dropdown>\r\n <a-menu slot=\"overlay\" @click=\"handleDropdownClick\">\r\n <a-menu-item :key=\"`${item.key || ''}${menuKeyDelimiter}${opt.value || ''}`\" v-for=\"opt in execOperationExpression(item.optionList)\">\r\n <template v-if=\"opt.type == 'confirm'\">\r\n <a-popconfirm :title=\"opt.message\" @confirm=\"handleClickConfirm(opt)\">\r\n {{ opt.label }}\r\n </a-popconfirm>\r\n </template>\r\n <template v-else>\r\n {{ opt.label }}\r\n </template>\r\n </a-menu-item>\r\n </a-menu>\r\n <span>{{ item.label }}</span>\r\n </a-dropdown>\r\n </template>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { v5 as uuidv5 } from 'uuid'\r\nimport { type, route } from '@idooel/shared'\r\nimport { parse } from '@idooel/expression'\r\nconst MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002'\r\nexport default {\r\n props: {\r\n record: {\r\n type: Object\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n }\r\n },\r\n inject: {\r\n requestTreeData: {\r\n default: void 0\r\n },\r\n requestTableData: {\r\n default: void 0\r\n }\r\n },\r\n computed: {\r\n menuKeyDelimiter () {\r\n return uuidv5('_', MENU_KEY_NAMESPACE)\r\n },\r\n builtInMethods () {\r\n return { \r\n requestTreeData: this.requestTreeData, \r\n requestTableData: this.requestTableData \r\n }\r\n }\r\n },\r\n methods: {\r\n execOperationExpression (dataSource = []) {\r\n const ret = dataSource.map(item => {\r\n const { show } = item\r\n if (type.isUndefined(show)) {\r\n return item\r\n } else if (type.isBool(show)) {\r\n if (show) return item\r\n } else if (type.isStr(show)) {\r\n const parseRet = parse(show, { \r\n ...this.record, \r\n _route: route.searchToQueryParams(window.location.search) \r\n })\r\n if (parseRet) return item\r\n }\r\n }).filter(item => item)\r\n return ret\r\n },\r\n handleClickConfirm (props) {\r\n //TODO generate event by special rule\r\n const { eventName, value } = props\r\n this.$emit(eventName, { \r\n key: value, \r\n record: this.record,\r\n builtInMethods: this.builtInMethods \r\n })\r\n },\r\n handleDropdownClick (props) {\r\n const { key } = props\r\n const [parent, child] = key.split(this.menuKeyDelimiter)\r\n if (!parent || !child) {\r\n throw new Error('key is required')\r\n }\r\n const currentDropdown = this.dataSource.find(item => item.key === parent)\r\n const currentClickTarget = currentDropdown.optionList.find(item => item.value === child)\r\n const { eventName, type } = currentClickTarget\r\n //TODO generate event by special rule\r\n if (type === 'confirm') return\r\n this.$emit(eventName, { \r\n key: child, \r\n record: this.record, \r\n builtInMethods: this.builtInMethods \r\n })\r\n },\r\n handleClickText (props) {\r\n const { eventName, key } = props\r\n this.$emit(eventName, { \r\n key, \r\n record: this.record, \r\n builtInMethods: this.builtInMethods \r\n })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-table__action {\r\n display: flex;\r\n flex-direction: row;\r\n .table-action__item {\r\n font-size: 14px;\r\n color: #409EFF;\r\n margin-left: 16px;\r\n cursor: pointer;\r\n &:first-child {\r\n margin-left: 0;\r\n }\r\n }\r\n}\r\n</style>",".g-table__action {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */"]}, media: undefined });
|
|
1366
1432
|
|
|
1367
1433
|
};
|
|
1368
1434
|
/* scoped */
|
|
1369
|
-
const __vue_scope_id__$
|
|
1435
|
+
const __vue_scope_id__$o = "data-v-572820bc";
|
|
1370
1436
|
/* module identifier */
|
|
1371
|
-
const __vue_module_identifier__$
|
|
1437
|
+
const __vue_module_identifier__$o = undefined;
|
|
1372
1438
|
/* functional template */
|
|
1373
|
-
const __vue_is_functional_template__$
|
|
1439
|
+
const __vue_is_functional_template__$o = false;
|
|
1374
1440
|
/* style inject SSR */
|
|
1375
1441
|
|
|
1376
1442
|
/* style inject shadow dom */
|
|
1377
1443
|
|
|
1378
1444
|
|
|
1379
1445
|
|
|
1380
|
-
const __vue_component__$
|
|
1381
|
-
{ render: __vue_render__$
|
|
1382
|
-
__vue_inject_styles__$
|
|
1383
|
-
__vue_script__$
|
|
1384
|
-
__vue_scope_id__$
|
|
1385
|
-
__vue_is_functional_template__$
|
|
1386
|
-
__vue_module_identifier__$
|
|
1446
|
+
const __vue_component__$o = /*#__PURE__*/normalizeComponent(
|
|
1447
|
+
{ render: __vue_render__$o, staticRenderFns: __vue_staticRenderFns__$o },
|
|
1448
|
+
__vue_inject_styles__$o,
|
|
1449
|
+
__vue_script__$o,
|
|
1450
|
+
__vue_scope_id__$o,
|
|
1451
|
+
__vue_is_functional_template__$o,
|
|
1452
|
+
__vue_module_identifier__$o,
|
|
1387
1453
|
false,
|
|
1388
1454
|
createInjector,
|
|
1389
1455
|
undefined,
|
|
@@ -1391,10 +1457,10 @@ __vue_render__$j._withStripped = true;
|
|
|
1391
1457
|
);
|
|
1392
1458
|
|
|
1393
1459
|
//
|
|
1394
|
-
var script$
|
|
1460
|
+
var script$n = {
|
|
1395
1461
|
name: 'ele-table',
|
|
1396
1462
|
components: {
|
|
1397
|
-
Actions: __vue_component__$
|
|
1463
|
+
Actions: __vue_component__$o
|
|
1398
1464
|
},
|
|
1399
1465
|
props: {
|
|
1400
1466
|
actions: {
|
|
@@ -1437,10 +1503,10 @@ var script$i = {
|
|
|
1437
1503
|
};
|
|
1438
1504
|
|
|
1439
1505
|
/* script */
|
|
1440
|
-
const __vue_script__$
|
|
1506
|
+
const __vue_script__$n = script$n;
|
|
1441
1507
|
|
|
1442
1508
|
/* template */
|
|
1443
|
-
var __vue_render__$
|
|
1509
|
+
var __vue_render__$n = function () {
|
|
1444
1510
|
var _vm = this;
|
|
1445
1511
|
var _h = _vm.$createElement;
|
|
1446
1512
|
var _c = _vm._self._c || _h;
|
|
@@ -1499,41 +1565,41 @@ var __vue_render__$i = function () {
|
|
|
1499
1565
|
1
|
|
1500
1566
|
)
|
|
1501
1567
|
};
|
|
1502
|
-
var __vue_staticRenderFns__$
|
|
1503
|
-
__vue_render__$
|
|
1568
|
+
var __vue_staticRenderFns__$n = [];
|
|
1569
|
+
__vue_render__$n._withStripped = true;
|
|
1504
1570
|
|
|
1505
1571
|
/* style */
|
|
1506
|
-
const __vue_inject_styles__$
|
|
1572
|
+
const __vue_inject_styles__$n = function (inject) {
|
|
1507
1573
|
if (!inject) return
|
|
1508
1574
|
inject("data-v-6f3faf52_0", { source: ".g-table__wrapper[data-v-6f3faf52] {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table {\n border-width: calc(var(--idooel-border-width) * 1px);\n border-style: solid;\n border-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-header .ant-table-fixed {\n /* border-bottom: 2px solid #53a8ff !important; */\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-tbody tr td {\n border-color: var(--idooel-column-border-color);\n border-width: calc(var(--idooel-column-border-width) * 1px);\n border-style: solid;\n border-top: unset;\n border-left: unset;\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-body {\n border-top-width: calc(var(--idooel-border-width) * 1px);\n border-top-style: solid;\n border-top-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-left {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-left .ant-table-header {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-left .ant-table-body-inner {\n border-right-width: calc(var(--idooel-border-width) * 1px);\n border-right-style: solid;\n border-right-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-left .ant-table-fixed {\n border-right-width: calc(var(--idooel-border-width) * 1px);\n border-right-color: var(--idooel-border-color);\n border-right-style: solid;\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-right {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-right .ant-table-header {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-color: var(--idooel-border-color);\n border-bottom-style: solid;\n}\n.g-table__wrapper[data-v-6f3faf52] .ant-table-wrapper .ant-table-fixed-right .ant-table-fixed {\n border-left-width: calc(var(--idooel-border-width) * 1px);\n border-left-style: solid;\n border-left-color: var(--idooel-border-color);\n}\n.g-table__wrapper .g-table__pagination[data-v-6f3faf52] {\n /* margin-top: 8px; */\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-width: calc(var(--idooel-border-width) * 1px);\n border-color: var(--idooel-border-color);\n border-style: solid;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\table\\src\\index.vue","index.vue"],"names":[],"mappings":"AA4EA;EAgEA,aAAA;EACA,kBAAA;AC1IA;AD2EA;EACA,oDAAA;EACA,mBAAA;EACA,wCAAA;ACzEA;AD4EA;EACA,iDAAA;AC1EA;AD+EA;EACA,+CAAA;EACA,2DAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;AC7EA;ADiFA;EACA,wDAAA;EACA,uBAAA;EACA,4CAAA;AC/EA;ADiFA;EACA,2DAAA;EACA,0BAAA;EACA,+CAAA;AC/EA;ADgFA;EACA,2DAAA;EACA,0BAAA;EACA,+CAAA;AC9EA;ADgFA;EACA,0DAAA;EACA,yBAAA;EACA,8CAAA;AC9EA;ADgFA;EACA,0DAAA;EACA,8CAAA;EACA,yBAAA;AC9EA;ADiFA;EAMA,2DAAA;EACA,0BAAA;EACA,+CAAA;ACpFA;AD6EA;EACA,2DAAA;EACA,+CAAA;EACA,0BAAA;AC3EA;ADgFA;EACA,yDAAA;EACA,wBAAA;EACA,6CAAA;AC9EA;ADsFA;EACA,qBAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;EACA,oDAAA;EACA,wCAAA;EACA,mBAAA;EACA,iBAAA;EACA,gBAAA;EACA,mBAAA;ACpFA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-table__wrapper\">\r\n <a-table\r\n :pagination=\"false\"\r\n :loading=\"loading\"\r\n :columns=\"columns\"\r\n :row-class-name=\"setRowClassName\"\r\n :data-source=\"dataSource\"\r\n :scroll=\"{ x: 1500, y: 500 }\">\r\n <template slot=\"action\" slot-scope=\"record\">\r\n <Actions v-on=\"$listeners\" :data-source=\"actions\" :record=\"record\"></Actions>\r\n </template>\r\n </a-table>\r\n <div class=\"g-table__pagination\">\r\n <a-pagination\r\n :show-total=\"total => `共 ${total} 条数据`\"\r\n show-size-changer \r\n show-quick-jumper\r\n :pageSize=\"pageSize\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n @change=\"onChangePagination\" \r\n :total=\"total\">\r\n </a-pagination>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Actions from './action.vue'\r\nexport default {\r\n name: 'ele-table',\r\n components: {\r\n Actions\r\n },\r\n props: {\r\n actions: {\r\n type: Array,\r\n default: () => []\r\n },\r\n total: {\r\n type: Number,\r\n default: 0\r\n },\r\n loading: {\r\n type: Boolean,\r\n default: false\r\n },\r\n columns: {\r\n type: Array,\r\n default: () => []\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n pageSize: {\r\n type: Number,\r\n default: 10\r\n },\r\n pageSizeOptions: {\r\n type: Array,\r\n default: () => ['10', '20', '30', '40']\r\n }\r\n },\r\n methods: {\r\n setRowClassName (record, idx) {\r\n return idx % 2 === 0 ? 'g-table__row--even' : 'g-table__row--odd'\r\n },\r\n onChangePagination (page, pagrSize) {\r\n this.$emit('change-page', page, pagrSize)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-table__wrapper {\r\n ::v-deep .ant-table-wrapper {\r\n .ant-table {\r\n border-width: calc(var(--idooel-border-width) * 1px);\r\n border-style: solid;\r\n border-color: var(--idooel-border-color);\r\n }\r\n .ant-table-header {\r\n .ant-table-fixed {\r\n /* border-bottom: 2px solid #53a8ff !important; */\r\n }\r\n }\r\n .ant-table-tbody {\r\n tr {\r\n td {\r\n border-color: var(--idooel-column-border-color);\r\n border-width: calc(var(--idooel-column-border-width) * 1px);;\r\n border-style: solid;\r\n border-top: unset;\r\n border-left: unset;\r\n }\r\n }\r\n }\r\n .ant-table-body {\r\n border-top-width: calc(var(--idooel-border-width) * 1px);\r\n border-top-style: solid;\r\n border-top-color: var(--idooel-border-color);\r\n }\r\n .ant-table-fixed-left {\r\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\r\n border-bottom-style: solid;\r\n border-bottom-color: var(--idooel-border-color);\r\n .ant-table-header {\r\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\r\n border-bottom-style: solid;\r\n border-bottom-color: var(--idooel-border-color);\r\n }\r\n .ant-table-body-inner {\r\n border-right-width: calc(var(--idooel-border-width) * 1px);\r\n border-right-style: solid;\r\n border-right-color: var(--idooel-border-color);\r\n }\r\n .ant-table-fixed {\r\n border-right-width: calc(var(--idooel-border-width) * 1px);\r\n border-right-color: var(--idooel-border-color);\r\n border-right-style: solid;\r\n }\r\n }\r\n .ant-table-fixed-right {\r\n .ant-table-header {\r\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\r\n border-bottom-color: var(--idooel-border-color);\r\n border-bottom-style: solid;\r\n }\r\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\r\n border-bottom-style: solid;\r\n border-bottom-color: var(--idooel-border-color);\r\n .ant-table-fixed {\r\n border-left-width: calc(var(--idooel-border-width) * 1px);\r\n border-left-style: solid;\r\n border-left-color: var(--idooel-border-color);\r\n }\r\n }\r\n }\r\n padding: 16px;\r\n padding-top: unset;\r\n .g-table__row--even {}\r\n .g-table__row--odd {}\r\n .g-table__pagination {\r\n /* margin-top: 8px; */\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: end;\r\n border-width: calc(var(--idooel-border-width) * 1px);\r\n border-color: var(--idooel-border-color);\r\n border-style: solid;\r\n border-top: unset;\r\n padding-top: 8px;\r\n padding-bottom: 8px;\r\n }\r\n}\r\n</style>",".g-table__wrapper {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table {\n border-width: calc(var(--idooel-border-width) * 1px);\n border-style: solid;\n border-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-header .ant-table-fixed {\n /* border-bottom: 2px solid #53a8ff !important; */\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-tbody tr td {\n border-color: var(--idooel-column-border-color);\n border-width: calc(var(--idooel-column-border-width) * 1px);\n border-style: solid;\n border-top: unset;\n border-left: unset;\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-body {\n border-top-width: calc(var(--idooel-border-width) * 1px);\n border-top-style: solid;\n border-top-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-left {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-left .ant-table-header {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-left .ant-table-body-inner {\n border-right-width: calc(var(--idooel-border-width) * 1px);\n border-right-style: solid;\n border-right-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-left .ant-table-fixed {\n border-right-width: calc(var(--idooel-border-width) * 1px);\n border-right-color: var(--idooel-border-color);\n border-right-style: solid;\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-right {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-style: solid;\n border-bottom-color: var(--idooel-border-color);\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-right .ant-table-header {\n border-bottom-width: calc(var(--idooel-border-width) * 1px);\n border-bottom-color: var(--idooel-border-color);\n border-bottom-style: solid;\n}\n.g-table__wrapper ::v-deep .ant-table-wrapper .ant-table-fixed-right .ant-table-fixed {\n border-left-width: calc(var(--idooel-border-width) * 1px);\n border-left-style: solid;\n border-left-color: var(--idooel-border-color);\n}\n.g-table__wrapper .g-table__pagination {\n /* margin-top: 8px; */\n display: flex;\n flex-direction: row;\n justify-content: end;\n border-width: calc(var(--idooel-border-width) * 1px);\n border-color: var(--idooel-border-color);\n border-style: solid;\n border-top: unset;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
1509
1575
|
|
|
1510
1576
|
};
|
|
1511
1577
|
/* scoped */
|
|
1512
|
-
const __vue_scope_id__$
|
|
1578
|
+
const __vue_scope_id__$n = "data-v-6f3faf52";
|
|
1513
1579
|
/* module identifier */
|
|
1514
|
-
const __vue_module_identifier__$
|
|
1580
|
+
const __vue_module_identifier__$n = undefined;
|
|
1515
1581
|
/* functional template */
|
|
1516
|
-
const __vue_is_functional_template__$
|
|
1582
|
+
const __vue_is_functional_template__$n = false;
|
|
1517
1583
|
/* style inject SSR */
|
|
1518
1584
|
|
|
1519
1585
|
/* style inject shadow dom */
|
|
1520
1586
|
|
|
1521
1587
|
|
|
1522
1588
|
|
|
1523
|
-
const __vue_component__$
|
|
1524
|
-
{ render: __vue_render__$
|
|
1525
|
-
__vue_inject_styles__$
|
|
1526
|
-
__vue_script__$
|
|
1527
|
-
__vue_scope_id__$
|
|
1528
|
-
__vue_is_functional_template__$
|
|
1529
|
-
__vue_module_identifier__$
|
|
1589
|
+
const __vue_component__$n = /*#__PURE__*/normalizeComponent(
|
|
1590
|
+
{ render: __vue_render__$n, staticRenderFns: __vue_staticRenderFns__$n },
|
|
1591
|
+
__vue_inject_styles__$n,
|
|
1592
|
+
__vue_script__$n,
|
|
1593
|
+
__vue_scope_id__$n,
|
|
1594
|
+
__vue_is_functional_template__$n,
|
|
1595
|
+
__vue_module_identifier__$n,
|
|
1530
1596
|
false,
|
|
1531
1597
|
createInjector,
|
|
1532
1598
|
undefined,
|
|
1533
1599
|
undefined
|
|
1534
1600
|
);
|
|
1535
1601
|
|
|
1536
|
-
__vue_component__$
|
|
1602
|
+
__vue_component__$n.install = Vue => Vue.component(__vue_component__$n.name, __vue_component__$n);
|
|
1537
1603
|
|
|
1538
1604
|
//
|
|
1539
1605
|
//
|
|
@@ -1559,7 +1625,7 @@ __vue_component__$i.install = Vue => Vue.component(__vue_component__$i.name, __v
|
|
|
1559
1625
|
//
|
|
1560
1626
|
//
|
|
1561
1627
|
|
|
1562
|
-
var script$
|
|
1628
|
+
var script$m = {
|
|
1563
1629
|
name: 'ele-tree',
|
|
1564
1630
|
props: {
|
|
1565
1631
|
treeData: {
|
|
@@ -1622,10 +1688,10 @@ var script$h = {
|
|
|
1622
1688
|
};
|
|
1623
1689
|
|
|
1624
1690
|
/* script */
|
|
1625
|
-
const __vue_script__$
|
|
1691
|
+
const __vue_script__$m = script$m;
|
|
1626
1692
|
|
|
1627
1693
|
/* template */
|
|
1628
|
-
var __vue_render__$
|
|
1694
|
+
var __vue_render__$m = function () {
|
|
1629
1695
|
var _vm = this;
|
|
1630
1696
|
var _h = _vm.$createElement;
|
|
1631
1697
|
var _c = _vm._self._c || _h;
|
|
@@ -1682,41 +1748,41 @@ var __vue_render__$h = function () {
|
|
|
1682
1748
|
1
|
|
1683
1749
|
)
|
|
1684
1750
|
};
|
|
1685
|
-
var __vue_staticRenderFns__$
|
|
1686
|
-
__vue_render__$
|
|
1751
|
+
var __vue_staticRenderFns__$m = [];
|
|
1752
|
+
__vue_render__$m._withStripped = true;
|
|
1687
1753
|
|
|
1688
1754
|
/* style */
|
|
1689
|
-
const __vue_inject_styles__$
|
|
1755
|
+
const __vue_inject_styles__$m = function (inject) {
|
|
1690
1756
|
if (!inject) return
|
|
1691
1757
|
inject("data-v-cc99bbf0_0", { source: ".g-tree__wrapper[data-v-cc99bbf0] {\n overflow: hidden;\n}\n.g-tree__wrapper[data-v-cc99bbf0] .ant-tree .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.g-tree__wrapper[data-v-cc99bbf0] .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\tree\\src\\index.vue","index.vue"],"names":[],"mappings":"AAwFA;EACA,gBAAA;ACvFA;ADyFA;EACA,uBAAA;EACA,gBAAA;EACA,mBAAA;ACvFA;ADyFA;EACA,WAAA;ACvFA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-tree__wrapper\">\r\n <a-tree\r\n v-if=\"innerTreeData.length\"\r\n :tree-data=\"innerTreeData\"\r\n @select=\"selectTreeNode\"\r\n :replaceFields=\"replaceFields\"\r\n :default-expanded-keys=\"defaultExpandedKeys\"\r\n :default-selected-keys=\"defaultSelectedKeys\"\r\n blockNode \r\n :show-icon=\"showIcon\">\r\n <template #title=\"{ title }\">\r\n <span :title=\"title\" class=\"tree-node__title\">\r\n {{ title }}\r\n </span>\r\n </template>\r\n <template slot=\"custom\" slot-scope=\"{ scopedSlots }\">\r\n <a-icon :type=\"scopedSlots.iconName\"></a-icon>\r\n </template>\r\n </a-tree>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-tree',\r\n props: {\r\n treeData: {\r\n type: Array,\r\n default: () => []\r\n },\r\n replaceFields: {\r\n type: Object,\r\n default: () => ({\r\n title: 'title',\r\n key: 'id',\r\n children: 'children'\r\n })\r\n },\r\n defaultExpandedKeys: {\r\n type: Array\r\n },\r\n defaultSelectedKeys: {\r\n type: Array\r\n },\r\n showIcon: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data () {\r\n return {}\r\n },\r\n computed: {\r\n innerTreeData () {\r\n return this.treeData\r\n // return [\r\n // {\r\n // title: 'parent 1',\r\n // key: 1,\r\n // scopedSlots: {\r\n // icon: 'custom',\r\n // iconName: 'smile-o'\r\n // },\r\n // children: [\r\n // {\r\n // title: '2',\r\n // key: 2,\r\n // scopedSlots: {\r\n // icon: 'custom',\r\n // iconName: 'frown-o'\r\n // }\r\n // }\r\n // ]\r\n // }\r\n // ]\r\n }\r\n },\r\n methods: {\r\n refreshTreeStatus (props = {}) {},\r\n selectTreeNode (selectedKeys, e) {\r\n this.$emit('select', selectedKeys, e)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-tree__wrapper {\r\n overflow: hidden;\r\n ::v-deep .ant-tree {\r\n .ant-tree-node-content-wrapper {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n }\r\n .ant-tree-node-selected {\r\n color: #fff;\r\n }\r\n }\r\n}\r\n</style>",".g-tree__wrapper {\n overflow: hidden;\n}\n.g-tree__wrapper ::v-deep .ant-tree .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.g-tree__wrapper ::v-deep .ant-tree .ant-tree-node-selected {\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
1692
1758
|
|
|
1693
1759
|
};
|
|
1694
1760
|
/* scoped */
|
|
1695
|
-
const __vue_scope_id__$
|
|
1761
|
+
const __vue_scope_id__$m = "data-v-cc99bbf0";
|
|
1696
1762
|
/* module identifier */
|
|
1697
|
-
const __vue_module_identifier__$
|
|
1763
|
+
const __vue_module_identifier__$m = undefined;
|
|
1698
1764
|
/* functional template */
|
|
1699
|
-
const __vue_is_functional_template__$
|
|
1765
|
+
const __vue_is_functional_template__$m = false;
|
|
1700
1766
|
/* style inject SSR */
|
|
1701
1767
|
|
|
1702
1768
|
/* style inject shadow dom */
|
|
1703
1769
|
|
|
1704
1770
|
|
|
1705
1771
|
|
|
1706
|
-
const __vue_component__$
|
|
1707
|
-
{ render: __vue_render__$
|
|
1708
|
-
__vue_inject_styles__$
|
|
1709
|
-
__vue_script__$
|
|
1710
|
-
__vue_scope_id__$
|
|
1711
|
-
__vue_is_functional_template__$
|
|
1712
|
-
__vue_module_identifier__$
|
|
1772
|
+
const __vue_component__$m = /*#__PURE__*/normalizeComponent(
|
|
1773
|
+
{ render: __vue_render__$m, staticRenderFns: __vue_staticRenderFns__$m },
|
|
1774
|
+
__vue_inject_styles__$m,
|
|
1775
|
+
__vue_script__$m,
|
|
1776
|
+
__vue_scope_id__$m,
|
|
1777
|
+
__vue_is_functional_template__$m,
|
|
1778
|
+
__vue_module_identifier__$m,
|
|
1713
1779
|
false,
|
|
1714
1780
|
createInjector,
|
|
1715
1781
|
undefined,
|
|
1716
1782
|
undefined
|
|
1717
1783
|
);
|
|
1718
1784
|
|
|
1719
|
-
__vue_component__$
|
|
1785
|
+
__vue_component__$m.install = Vue => Vue.component(__vue_component__$m.name, __vue_component__$m);
|
|
1720
1786
|
|
|
1721
1787
|
//
|
|
1722
1788
|
//
|
|
@@ -1726,7 +1792,7 @@ __vue_component__$h.install = Vue => Vue.component(__vue_component__$h.name, __v
|
|
|
1726
1792
|
//
|
|
1727
1793
|
//
|
|
1728
1794
|
|
|
1729
|
-
var script$
|
|
1795
|
+
var script$l = {
|
|
1730
1796
|
props: {
|
|
1731
1797
|
label: {
|
|
1732
1798
|
type: String
|
|
@@ -1735,10 +1801,10 @@ var script$g = {
|
|
|
1735
1801
|
};
|
|
1736
1802
|
|
|
1737
1803
|
/* script */
|
|
1738
|
-
const __vue_script__$
|
|
1804
|
+
const __vue_script__$l = script$l;
|
|
1739
1805
|
|
|
1740
1806
|
/* template */
|
|
1741
|
-
var __vue_render__$
|
|
1807
|
+
var __vue_render__$l = function () {
|
|
1742
1808
|
var _vm = this;
|
|
1743
1809
|
var _h = _vm.$createElement;
|
|
1744
1810
|
var _c = _vm._self._c || _h;
|
|
@@ -1748,34 +1814,34 @@ var __vue_render__$g = function () {
|
|
|
1748
1814
|
_c("span", { staticClass: "label__suffix" }, [_vm._v(":")]),
|
|
1749
1815
|
])
|
|
1750
1816
|
};
|
|
1751
|
-
var __vue_staticRenderFns__$
|
|
1752
|
-
__vue_render__$
|
|
1817
|
+
var __vue_staticRenderFns__$l = [];
|
|
1818
|
+
__vue_render__$l._withStripped = true;
|
|
1753
1819
|
|
|
1754
1820
|
/* style */
|
|
1755
|
-
const __vue_inject_styles__$
|
|
1821
|
+
const __vue_inject_styles__$l = function (inject) {
|
|
1756
1822
|
if (!inject) return
|
|
1757
1823
|
inject("data-v-40e71716_0", { source: ".g-search__label[data-v-40e71716] {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title[data-v-40e71716], .g-search__label .label__suffix[data-v-40e71716] {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix[data-v-40e71716] {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\composite-components\\search-area\\src\\label.vue","label.vue"],"names":[],"mappings":"AAkBA;EACA,iBAAA;EACA,gBAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;ACjBA;ADkBA;EACA,eAAA;EACA,0BAAA;EACA,mBAAA;AChBA;ADkBA;EACA,gBAAA;AChBA;;AAEA,oCAAoC","file":"label.vue","sourcesContent":["<template>\r\n <div class=\"g-search__label\">\r\n <span class=\"label__title\">{{ label }}</span>\r\n <span class=\"label__suffix\">:</span>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n props: {\r\n label: {\r\n type: String\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-search__label {\r\n /* width: 69px; */\r\n flex-basis: 69px;\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n .label__title, .label__suffix {\r\n font-size: 14px;\r\n color: rgba(0, 0, 0, 0.88);\r\n white-space: nowrap;\r\n }\r\n .label__suffix {\r\n margin-left: 4px;\r\n }\r\n}\r\n</style>",".g-search__label {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title, .g-search__label .label__suffix {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */"]}, media: undefined });
|
|
1758
1824
|
|
|
1759
1825
|
};
|
|
1760
1826
|
/* scoped */
|
|
1761
|
-
const __vue_scope_id__$
|
|
1827
|
+
const __vue_scope_id__$l = "data-v-40e71716";
|
|
1762
1828
|
/* module identifier */
|
|
1763
|
-
const __vue_module_identifier__$
|
|
1829
|
+
const __vue_module_identifier__$l = undefined;
|
|
1764
1830
|
/* functional template */
|
|
1765
|
-
const __vue_is_functional_template__$
|
|
1831
|
+
const __vue_is_functional_template__$l = false;
|
|
1766
1832
|
/* style inject SSR */
|
|
1767
1833
|
|
|
1768
1834
|
/* style inject shadow dom */
|
|
1769
1835
|
|
|
1770
1836
|
|
|
1771
1837
|
|
|
1772
|
-
const __vue_component__$
|
|
1773
|
-
{ render: __vue_render__$
|
|
1774
|
-
__vue_inject_styles__$
|
|
1775
|
-
__vue_script__$
|
|
1776
|
-
__vue_scope_id__$
|
|
1777
|
-
__vue_is_functional_template__$
|
|
1778
|
-
__vue_module_identifier__$
|
|
1838
|
+
const __vue_component__$l = /*#__PURE__*/normalizeComponent(
|
|
1839
|
+
{ render: __vue_render__$l, staticRenderFns: __vue_staticRenderFns__$l },
|
|
1840
|
+
__vue_inject_styles__$l,
|
|
1841
|
+
__vue_script__$l,
|
|
1842
|
+
__vue_scope_id__$l,
|
|
1843
|
+
__vue_is_functional_template__$l,
|
|
1844
|
+
__vue_module_identifier__$l,
|
|
1779
1845
|
false,
|
|
1780
1846
|
createInjector,
|
|
1781
1847
|
undefined,
|
|
@@ -1783,14 +1849,14 @@ __vue_render__$g._withStripped = true;
|
|
|
1783
1849
|
);
|
|
1784
1850
|
|
|
1785
1851
|
//
|
|
1786
|
-
var script$
|
|
1852
|
+
var script$k = {
|
|
1787
1853
|
name: 'ele-search-area',
|
|
1788
1854
|
components: {
|
|
1789
|
-
EleInput: __vue_component__$
|
|
1790
|
-
EleSelect: __vue_component__$
|
|
1791
|
-
ELeButton: __vue_component__$
|
|
1792
|
-
Label: __vue_component__$
|
|
1793
|
-
EleDate: __vue_component__$
|
|
1855
|
+
EleInput: __vue_component__$q,
|
|
1856
|
+
EleSelect: __vue_component__$p,
|
|
1857
|
+
ELeButton: __vue_component__$s,
|
|
1858
|
+
Label: __vue_component__$l,
|
|
1859
|
+
EleDate: __vue_component__$r
|
|
1794
1860
|
},
|
|
1795
1861
|
props: {
|
|
1796
1862
|
gutter: {
|
|
@@ -1865,6 +1931,14 @@ var script$f = {
|
|
|
1865
1931
|
const querys = this.extractValues();
|
|
1866
1932
|
this.$emit('search', querys);
|
|
1867
1933
|
},
|
|
1934
|
+
buildMapto(mapTo = [], dataSource) {
|
|
1935
|
+
const [startField, endField] = mapTo;
|
|
1936
|
+
const [startValue, endValue] = dataSource || [null, null];
|
|
1937
|
+
return {
|
|
1938
|
+
[startField]: startValue,
|
|
1939
|
+
[endField]: endValue
|
|
1940
|
+
};
|
|
1941
|
+
},
|
|
1868
1942
|
extractValues() {
|
|
1869
1943
|
let ret = {};
|
|
1870
1944
|
this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {
|
|
@@ -1872,6 +1946,9 @@ var script$f = {
|
|
|
1872
1946
|
case 'DatePicker':
|
|
1873
1947
|
ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format);
|
|
1874
1948
|
break;
|
|
1949
|
+
case 'ele-date-range':
|
|
1950
|
+
Object.assign(ret, this.buildMapto(item.mapTo, item._value));
|
|
1951
|
+
break;
|
|
1875
1952
|
default:
|
|
1876
1953
|
ret[item.name] = item._value;
|
|
1877
1954
|
break;
|
|
@@ -1893,6 +1970,10 @@ var script$f = {
|
|
|
1893
1970
|
defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue));
|
|
1894
1971
|
!defaultValue && this.$set(item, '_value', undefined);
|
|
1895
1972
|
break;
|
|
1973
|
+
case 'ele-date-picker':
|
|
1974
|
+
defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue));
|
|
1975
|
+
!defaultValue && this.$set(item, '_value', []);
|
|
1976
|
+
break;
|
|
1896
1977
|
default:
|
|
1897
1978
|
defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue));
|
|
1898
1979
|
!defaultValue && this.$set(item, '_value', null);
|
|
@@ -1910,10 +1991,10 @@ var script$f = {
|
|
|
1910
1991
|
};
|
|
1911
1992
|
|
|
1912
1993
|
/* script */
|
|
1913
|
-
const __vue_script__$
|
|
1994
|
+
const __vue_script__$k = script$k;
|
|
1914
1995
|
|
|
1915
1996
|
/* template */
|
|
1916
|
-
var __vue_render__$
|
|
1997
|
+
var __vue_render__$k = function () {
|
|
1917
1998
|
var _vm = this;
|
|
1918
1999
|
var _h = _vm.$createElement;
|
|
1919
2000
|
var _c = _vm._self._c || _h;
|
|
@@ -2049,50 +2130,70 @@ var __vue_render__$f = function () {
|
|
|
2049
2130
|
},
|
|
2050
2131
|
}),
|
|
2051
2132
|
]
|
|
2052
|
-
:
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2133
|
+
: item.type == "ele-date-range"
|
|
2134
|
+
? [
|
|
2135
|
+
_c("Label", {
|
|
2136
|
+
attrs: { label: item.label },
|
|
2137
|
+
}),
|
|
2138
|
+
_vm._v(" "),
|
|
2139
|
+
_c("ele-date-range", {
|
|
2140
|
+
attrs: {
|
|
2141
|
+
format: item.format,
|
|
2142
|
+
"show-time": item.showTime,
|
|
2143
|
+
},
|
|
2144
|
+
model: {
|
|
2145
|
+
value: item._value,
|
|
2146
|
+
callback: function ($$v) {
|
|
2147
|
+
_vm.$set(item, "_value", $$v);
|
|
2148
|
+
},
|
|
2149
|
+
expression: "item._value",
|
|
2150
|
+
},
|
|
2151
|
+
}),
|
|
2152
|
+
]
|
|
2153
|
+
: _vm._e(),
|
|
2154
|
+
],
|
|
2155
|
+
2
|
|
2156
|
+
),
|
|
2157
|
+
]
|
|
2158
|
+
)
|
|
2159
|
+
: _vm._e(),
|
|
2160
|
+
]
|
|
2161
|
+
}),
|
|
2162
|
+
],
|
|
2163
|
+
2
|
|
2164
|
+
),
|
|
2064
2165
|
],
|
|
2065
2166
|
1
|
|
2066
2167
|
)
|
|
2067
2168
|
};
|
|
2068
|
-
var __vue_staticRenderFns__$
|
|
2069
|
-
__vue_render__$
|
|
2169
|
+
var __vue_staticRenderFns__$k = [];
|
|
2170
|
+
__vue_render__$k._withStripped = true;
|
|
2070
2171
|
|
|
2071
2172
|
/* style */
|
|
2072
|
-
const __vue_inject_styles__$
|
|
2173
|
+
const __vue_inject_styles__$k = function (inject) {
|
|
2073
2174
|
if (!inject) return
|
|
2074
|
-
inject("data-v-5a224358_0", { source: ".search-area__wrapper[data-v-5a224358] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-5a224358] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-5a224358] {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action[data-v-5a224358] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-5a224358] {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text[data-v-5a224358] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-5a224358] {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\composite-components\\search-area\\src\\index.vue","index.vue"],"names":[],"mappings":"AAyKA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;ACxKA;AD0KA;EACA,YAAA;ACxKA;AD2KA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACzKA;AD0KA;EACA,oBAAA;ACxKA;AD0KA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;ACxKA;ADyKA;EACA,eAAA;ACvKA;ADyKA;EACA,eAAA;EACA,gBAAA;ACvKA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"search-area__wrapper\">\r\n <a-row :gutter=\"gutter\">\r\n <template v-for=\"(item, idx) in innerDataSource\">\r\n <a-col v-if=\"item._show\" :span=\"item.span || span\" :key=\"idx\">\r\n <div v-if=\"item.type == '_action'\" class=\"search-area__item search-area--action\">\r\n <ele-button icon=\"search\" type=\"primary\" @click=\"handleClickSearch\">查询</ele-button>\r\n <ele-button style=\"margin-left:8px;\" icon=\"reload\" @click=\"handleClickReset\">重置</ele-button>\r\n <div class=\"expand-collapse\" @click=\"handleClickExpandCollapse\">\r\n <span class=\"expand-collapse__text\">{{ isExpand ? '收起' : '展开' }}</span>\r\n <span class=\"expand-collapse__icon\">\r\n <a-icon v-if=\"isExpand\" type=\"up\" />\r\n <a-icon v-else type=\"down\" />\r\n </span>\r\n </div>\r\n </div>\r\n <div v-else class=\"search-area__item\">\r\n <template v-if=\"item.type == 'Input'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-input v-model=\"item._value\"></ele-input>\r\n </template>\r\n <template v-else-if=\"item.type == 'Select'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-select v-model=\"item._value\" :data-source=\"item.optionList\"></ele-select>\r\n </template>\r\n <template v-else-if=\"item.type == 'DatePicker'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date v-model=\"item._value\" :format=\"item.format\"></ele-date>\r\n </template>\r\n </div>\r\n </a-col>\r\n </template>\r\n </a-row>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleInput from '../../../input/src/index.vue'\r\nimport EleSelect from '../../../select/src/index.vue'\r\nimport ELeButton from '../../../button/src/index.vue'\r\nimport EleDate from '../../../date/src/index.vue'\r\nimport Label from './label.vue'\r\nimport moment from 'moment'\r\nimport { parse } from '@idooel/expression'\r\nexport default {\r\n name: 'ele-search-area',\r\n components: {\r\n EleInput,\r\n EleSelect,\r\n ELeButton,\r\n Label,\r\n EleDate\r\n },\r\n props: {\r\n gutter: {\r\n type: [Number, Array, Object],\r\n default: () => ([\r\n 16, 8\r\n ])\r\n },\r\n span: {\r\n type: Number,\r\n default: 8\r\n },\r\n dataSource: {\r\n type: Array,\r\n required: true\r\n }\r\n },\r\n data() {\r\n return {\r\n isExpand: false\r\n }\r\n },\r\n computed: {\r\n cuttingFormula () {\r\n return (24 / this.span - 1)\r\n },\r\n buildDataSource () {\r\n return this.controlDisplayByFormula(this.mapDefaultValueToValue())\r\n },\r\n innerDataSource () {\r\n return [ ...this.buildDataSource, { type: '_action', _show: true }]\r\n }\r\n },\r\n created() {},\r\n methods: {\r\n controlDisplayByFormula (dataSource = []) {\r\n if (this.isExpand) {\r\n dataSource.forEach(item => {\r\n this.$set(item, '_show', true)\r\n })\r\n } else {\r\n dataSource.forEach((item, idx) => {\r\n if (idx < this.cuttingFormula) {\r\n this.$set(item, '_show', true)\r\n } else {\r\n this.$set(item, '_show', false)\r\n }\r\n })\r\n }\r\n return dataSource\r\n },\r\n buildDefaultValue (arg) {\r\n if (!arg || arg.charAt(0) !== '_') return arg\r\n return parse(arg, {\r\n _route: this.$route.query\r\n })\r\n },\r\n mapDefaultValueToValue () {\r\n this.dataSource.forEach(props => {\r\n this.$set(props, '_show', this.isExpand)\r\n if (props.defaultValue) {\r\n this.$set(props, '_value', this.buildDefaultValue(props.defaultValue))\r\n }\r\n })\r\n return this.dataSource\r\n },\r\n handleClickExpandCollapse () {\r\n this.isExpand = !this.isExpand\r\n },\r\n handleClickSearch () {\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n extractValues () {\r\n let ret = {}\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n switch (item.type) {\r\n case 'DatePicker':\r\n ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format)\r\n break\r\n default:\r\n ret[item.name] = item._value\r\n break\r\n }\r\n })\r\n return ret\r\n },\r\n handleClickReset () {\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n const { defaultValue } = item\r\n switch (item.type) {\r\n case 'Select':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n case 'DatePicker':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', undefined)\r\n break\r\n default:\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n }\r\n })\r\n //TODO defaultValue\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n onChangeSelect (value, props) {\r\n this.$set(props, '_value', value)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.search-area__wrapper {\r\n padding-top: 16px;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n ::v-deep .ant-col {\r\n &:last-child {\r\n float: right;\r\n }\r\n }\r\n .search-area__item {\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &.search-area--action {\r\n justify-content: end;\r\n }\r\n .expand-collapse {\r\n margin-left: 8px;\r\n height: 32px;\r\n padding: 4px 16px;\r\n color: var(--idooel-primary-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: pointer;\r\n .expand-collapse__text {\r\n font-size: 14px;\r\n }\r\n .expand-collapse__icon {\r\n font-size: 16px;\r\n margin-left: 8px;\r\n }\r\n }\r\n }\r\n}\r\n</style>",".search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper ::v-deep .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2175
|
+
inject("data-v-4cecf96f_0", { source: ".search-area__wrapper[data-v-4cecf96f] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-4cecf96f] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-4cecf96f] {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action[data-v-4cecf96f] {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse[data-v-4cecf96f] {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text[data-v-4cecf96f] {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon[data-v-4cecf96f] {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\composite-components\\search-area\\src\\index.vue","index.vue"],"names":[],"mappings":"AA4LA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;AC3LA;AD6LA;EACA,YAAA;AC3LA;AD8LA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AC5LA;AD6LA;EACA,oBAAA;AC3LA;AD6LA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,kCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;AC3LA;AD4LA;EACA,eAAA;AC1LA;AD4LA;EACA,eAAA;EACA,gBAAA;AC1LA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"search-area__wrapper\">\r\n <a-row :gutter=\"gutter\">\r\n <template v-for=\"(item, idx) in innerDataSource\">\r\n <a-col v-if=\"item._show\" :span=\"item.span || span\" :key=\"idx\">\r\n <div v-if=\"item.type == '_action'\" class=\"search-area__item search-area--action\">\r\n <ele-button icon=\"search\" type=\"primary\" @click=\"handleClickSearch\">查询</ele-button>\r\n <ele-button style=\"margin-left:8px;\" icon=\"reload\" @click=\"handleClickReset\">重置</ele-button>\r\n <div class=\"expand-collapse\" @click=\"handleClickExpandCollapse\">\r\n <span class=\"expand-collapse__text\">{{ isExpand ? '收起' : '展开' }}</span>\r\n <span class=\"expand-collapse__icon\">\r\n <a-icon v-if=\"isExpand\" type=\"up\" />\r\n <a-icon v-else type=\"down\" />\r\n </span>\r\n </div>\r\n </div>\r\n <div v-else class=\"search-area__item\">\r\n <template v-if=\"item.type == 'Input'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-input v-model=\"item._value\"></ele-input>\r\n </template>\r\n <template v-else-if=\"item.type == 'Select'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-select v-model=\"item._value\" :data-source=\"item.optionList\"></ele-select>\r\n </template>\r\n <template v-else-if=\"item.type == 'DatePicker'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date v-model=\"item._value\" :format=\"item.format\"></ele-date>\r\n </template>\r\n <template v-else-if=\"item.type == 'ele-date-range'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date-range v-model=\"item._value\" :format=\"item.format\" :show-time=\"item.showTime\"></ele-date-range>\r\n </template>\r\n </div>\r\n </a-col>\r\n </template>\r\n </a-row>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleInput from '../../../input/src/index.vue'\r\nimport EleSelect from '../../../select/src/index.vue'\r\nimport ELeButton from '../../../button/src/index.vue'\r\nimport EleDate from '../../../date/src/index.vue'\r\nimport Label from './label.vue'\r\nimport moment from 'moment'\r\nimport { parse } from '@idooel/expression'\r\nexport default {\r\n name: 'ele-search-area',\r\n components: {\r\n EleInput,\r\n EleSelect,\r\n ELeButton,\r\n Label,\r\n EleDate\r\n },\r\n props: {\r\n gutter: {\r\n type: [Number, Array, Object],\r\n default: () => ([\r\n 16, 8\r\n ])\r\n },\r\n span: {\r\n type: Number,\r\n default: 8\r\n },\r\n dataSource: {\r\n type: Array,\r\n required: true\r\n }\r\n },\r\n data() {\r\n return {\r\n isExpand: false\r\n }\r\n },\r\n computed: {\r\n cuttingFormula () {\r\n return (24 / this.span - 1)\r\n },\r\n buildDataSource () {\r\n return this.controlDisplayByFormula(this.mapDefaultValueToValue())\r\n },\r\n innerDataSource () {\r\n return [ ...this.buildDataSource, { type: '_action', _show: true }]\r\n }\r\n },\r\n created() {},\r\n methods: {\r\n controlDisplayByFormula (dataSource = []) {\r\n if (this.isExpand) {\r\n dataSource.forEach(item => {\r\n this.$set(item, '_show', true)\r\n })\r\n } else {\r\n dataSource.forEach((item, idx) => {\r\n if (idx < this.cuttingFormula) {\r\n this.$set(item, '_show', true)\r\n } else {\r\n this.$set(item, '_show', false)\r\n }\r\n })\r\n }\r\n return dataSource\r\n },\r\n buildDefaultValue (arg) {\r\n if (!arg || arg.charAt(0) !== '_') return arg\r\n return parse(arg, {\r\n _route: this.$route.query\r\n })\r\n },\r\n mapDefaultValueToValue () {\r\n this.dataSource.forEach(props => {\r\n this.$set(props, '_show', this.isExpand)\r\n if (props.defaultValue) {\r\n this.$set(props, '_value', this.buildDefaultValue(props.defaultValue))\r\n }\r\n })\r\n return this.dataSource\r\n },\r\n handleClickExpandCollapse () {\r\n this.isExpand = !this.isExpand\r\n },\r\n handleClickSearch () {\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n buildMapto (mapTo = [], dataSource) {\r\n const [ startField, endField ] = mapTo\r\n const [ startValue, endValue ] = dataSource || [null, null]\r\n return {\r\n [startField]: startValue,\r\n [endField]: endValue\r\n }\r\n },\r\n extractValues () {\r\n let ret = {}\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n switch (item.type) {\r\n case 'DatePicker':\r\n ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format)\r\n break\r\n case 'ele-date-range':\r\n Object.assign(ret, this.buildMapto(item.mapTo, item._value))\r\n break\r\n default:\r\n ret[item.name] = item._value\r\n break\r\n }\r\n })\r\n return ret\r\n },\r\n handleClickReset () {\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n const { defaultValue } = item\r\n switch (item.type) {\r\n case 'Select':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n case 'DatePicker':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', undefined)\r\n break\r\n case 'ele-date-picker':\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', [])\r\n break\r\n default:\r\n defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue))\r\n !defaultValue && this.$set(item, '_value', null)\r\n break\r\n }\r\n })\r\n //TODO defaultValue\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n onChangeSelect (value, props) {\r\n this.$set(props, '_value', value)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.search-area__wrapper {\r\n padding-top: 16px;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n ::v-deep .ant-col {\r\n &:last-child {\r\n float: right;\r\n }\r\n }\r\n .search-area__item {\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n &.search-area--action {\r\n justify-content: end;\r\n }\r\n .expand-collapse {\r\n margin-left: 8px;\r\n height: 32px;\r\n padding: 4px 16px;\r\n color: var(--idooel-primary-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n cursor: pointer;\r\n .expand-collapse__text {\r\n font-size: 14px;\r\n }\r\n .expand-collapse__icon {\r\n font-size: 16px;\r\n margin-left: 8px;\r\n }\r\n }\r\n }\r\n}\r\n</style>",".search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper ::v-deep .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.search-area__wrapper .search-area__item.search-area--action {\n justify-content: end;\n}\n.search-area__wrapper .search-area__item .expand-collapse {\n margin-left: 8px;\n height: 32px;\n padding: 4px 16px;\n color: var(--idooel-primary-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__text {\n font-size: 14px;\n}\n.search-area__wrapper .search-area__item .expand-collapse .expand-collapse__icon {\n font-size: 16px;\n margin-left: 8px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2075
2176
|
|
|
2076
2177
|
};
|
|
2077
2178
|
/* scoped */
|
|
2078
|
-
const __vue_scope_id__$
|
|
2179
|
+
const __vue_scope_id__$k = "data-v-4cecf96f";
|
|
2079
2180
|
/* module identifier */
|
|
2080
|
-
const __vue_module_identifier__$
|
|
2181
|
+
const __vue_module_identifier__$k = undefined;
|
|
2081
2182
|
/* functional template */
|
|
2082
|
-
const __vue_is_functional_template__$
|
|
2183
|
+
const __vue_is_functional_template__$k = false;
|
|
2083
2184
|
/* style inject SSR */
|
|
2084
2185
|
|
|
2085
2186
|
/* style inject shadow dom */
|
|
2086
2187
|
|
|
2087
2188
|
|
|
2088
2189
|
|
|
2089
|
-
const __vue_component__$
|
|
2090
|
-
{ render: __vue_render__$
|
|
2091
|
-
__vue_inject_styles__$
|
|
2092
|
-
__vue_script__$
|
|
2093
|
-
__vue_scope_id__$
|
|
2094
|
-
__vue_is_functional_template__$
|
|
2095
|
-
__vue_module_identifier__$
|
|
2190
|
+
const __vue_component__$k = /*#__PURE__*/normalizeComponent(
|
|
2191
|
+
{ render: __vue_render__$k, staticRenderFns: __vue_staticRenderFns__$k },
|
|
2192
|
+
__vue_inject_styles__$k,
|
|
2193
|
+
__vue_script__$k,
|
|
2194
|
+
__vue_scope_id__$k,
|
|
2195
|
+
__vue_is_functional_template__$k,
|
|
2196
|
+
__vue_module_identifier__$k,
|
|
2096
2197
|
false,
|
|
2097
2198
|
createInjector,
|
|
2098
2199
|
undefined,
|
|
@@ -2100,10 +2201,10 @@ __vue_render__$f._withStripped = true;
|
|
|
2100
2201
|
);
|
|
2101
2202
|
|
|
2102
2203
|
//
|
|
2103
|
-
var script$
|
|
2204
|
+
var script$j = {
|
|
2104
2205
|
name: 'ele-button-group',
|
|
2105
2206
|
components: {
|
|
2106
|
-
EleButton: __vue_component__$
|
|
2207
|
+
EleButton: __vue_component__$s
|
|
2107
2208
|
},
|
|
2108
2209
|
props: {
|
|
2109
2210
|
dataSource: {
|
|
@@ -2114,10 +2215,10 @@ var script$e = {
|
|
|
2114
2215
|
};
|
|
2115
2216
|
|
|
2116
2217
|
/* script */
|
|
2117
|
-
const __vue_script__$
|
|
2218
|
+
const __vue_script__$j = script$j;
|
|
2118
2219
|
|
|
2119
2220
|
/* template */
|
|
2120
|
-
var __vue_render__$
|
|
2221
|
+
var __vue_render__$j = function () {
|
|
2121
2222
|
var _vm = this;
|
|
2122
2223
|
var _h = _vm.$createElement;
|
|
2123
2224
|
var _c = _vm._self._c || _h;
|
|
@@ -2147,34 +2248,34 @@ var __vue_render__$e = function () {
|
|
|
2147
2248
|
1
|
|
2148
2249
|
)
|
|
2149
2250
|
};
|
|
2150
|
-
var __vue_staticRenderFns__$
|
|
2151
|
-
__vue_render__$
|
|
2251
|
+
var __vue_staticRenderFns__$j = [];
|
|
2252
|
+
__vue_render__$j._withStripped = true;
|
|
2152
2253
|
|
|
2153
2254
|
/* style */
|
|
2154
|
-
const __vue_inject_styles__$
|
|
2255
|
+
const __vue_inject_styles__$j = function (inject) {
|
|
2155
2256
|
if (!inject) return
|
|
2156
2257
|
inject("data-v-de67e2d2_0", { source: ".button-group__wrapper[data-v-de67e2d2] {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn[data-v-de67e2d2] {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn[data-v-de67e2d2]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\composite-components\\button-group\\src\\index.vue","index.vue"],"names":[],"mappings":"AAkCA;EACA,aAAA;EACA,kBAAA;EACA,mBAAA;ACjCA;ADkCA;EACA,gBAAA;AChCA;ADiCA;EACA,cAAA;AC/BA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"button-group__wrapper\">\r\n <ele-button \r\n v-for=\"(item, idx) in dataSource\" \r\n :type=\"item.type\"\r\n :icon=\"item.icon\"\r\n :mode=\"item.mode\"\r\n :data-source=\"item.optionList\"\r\n :event-name=\"item.eventName\"\r\n :record=\"item\"\r\n v-on=\"$listeners\"\r\n :key=\"idx\">\r\n {{ item.label }}\r\n </ele-button>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleButton from '../../../button/src/index.vue'\r\nexport default {\r\n name: 'ele-button-group',\r\n components: {\r\n EleButton\r\n },\r\n props: {\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.button-group__wrapper {\r\n display: flex;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n .ant-btn {\r\n margin-left: 8px;\r\n &:first-child {\r\n margin-left: 0;\r\n }\r\n }\r\n}\r\n</style>",".button-group__wrapper {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2157
2258
|
|
|
2158
2259
|
};
|
|
2159
2260
|
/* scoped */
|
|
2160
|
-
const __vue_scope_id__$
|
|
2261
|
+
const __vue_scope_id__$j = "data-v-de67e2d2";
|
|
2161
2262
|
/* module identifier */
|
|
2162
|
-
const __vue_module_identifier__$
|
|
2263
|
+
const __vue_module_identifier__$j = undefined;
|
|
2163
2264
|
/* functional template */
|
|
2164
|
-
const __vue_is_functional_template__$
|
|
2265
|
+
const __vue_is_functional_template__$j = false;
|
|
2165
2266
|
/* style inject SSR */
|
|
2166
2267
|
|
|
2167
2268
|
/* style inject shadow dom */
|
|
2168
2269
|
|
|
2169
2270
|
|
|
2170
2271
|
|
|
2171
|
-
const __vue_component__$
|
|
2172
|
-
{ render: __vue_render__$
|
|
2173
|
-
__vue_inject_styles__$
|
|
2174
|
-
__vue_script__$
|
|
2175
|
-
__vue_scope_id__$
|
|
2176
|
-
__vue_is_functional_template__$
|
|
2177
|
-
__vue_module_identifier__$
|
|
2272
|
+
const __vue_component__$j = /*#__PURE__*/normalizeComponent(
|
|
2273
|
+
{ render: __vue_render__$j, staticRenderFns: __vue_staticRenderFns__$j },
|
|
2274
|
+
__vue_inject_styles__$j,
|
|
2275
|
+
__vue_script__$j,
|
|
2276
|
+
__vue_scope_id__$j,
|
|
2277
|
+
__vue_is_functional_template__$j,
|
|
2278
|
+
__vue_module_identifier__$j,
|
|
2178
2279
|
false,
|
|
2179
2280
|
createInjector,
|
|
2180
2281
|
undefined,
|
|
@@ -2182,13 +2283,13 @@ __vue_render__$e._withStripped = true;
|
|
|
2182
2283
|
);
|
|
2183
2284
|
|
|
2184
2285
|
//
|
|
2185
|
-
var script$
|
|
2286
|
+
var script$i = {
|
|
2186
2287
|
name: 'ele-tree-table-model',
|
|
2187
2288
|
components: {
|
|
2188
|
-
EleTree: __vue_component__$
|
|
2189
|
-
EleTable: __vue_component__$
|
|
2190
|
-
EleSearchArea: __vue_component__$
|
|
2191
|
-
EleButtonGroup: __vue_component__$
|
|
2289
|
+
EleTree: __vue_component__$m,
|
|
2290
|
+
EleTable: __vue_component__$n,
|
|
2291
|
+
EleSearchArea: __vue_component__$k,
|
|
2292
|
+
EleButtonGroup: __vue_component__$j
|
|
2192
2293
|
},
|
|
2193
2294
|
props: {
|
|
2194
2295
|
treeMeta: {
|
|
@@ -2467,10 +2568,10 @@ var script$d = {
|
|
|
2467
2568
|
};
|
|
2468
2569
|
|
|
2469
2570
|
/* script */
|
|
2470
|
-
const __vue_script__$
|
|
2571
|
+
const __vue_script__$i = script$i;
|
|
2471
2572
|
|
|
2472
2573
|
/* template */
|
|
2473
|
-
var __vue_render__$
|
|
2574
|
+
var __vue_render__$i = function () {
|
|
2474
2575
|
var _vm = this;
|
|
2475
2576
|
var _h = _vm.$createElement;
|
|
2476
2577
|
var _c = _vm._self._c || _h;
|
|
@@ -2550,34 +2651,34 @@ var __vue_render__$d = function () {
|
|
|
2550
2651
|
]),
|
|
2551
2652
|
])
|
|
2552
2653
|
};
|
|
2553
|
-
var __vue_staticRenderFns__$
|
|
2554
|
-
__vue_render__$
|
|
2654
|
+
var __vue_staticRenderFns__$i = [];
|
|
2655
|
+
__vue_render__$i._withStripped = true;
|
|
2555
2656
|
|
|
2556
2657
|
/* style */
|
|
2557
|
-
const __vue_inject_styles__$
|
|
2658
|
+
const __vue_inject_styles__$i = function (inject) {
|
|
2558
2659
|
if (!inject) return
|
|
2559
2660
|
inject("data-v-fe2ee33e_0", { source: ".ele.model__tree-table[data-v-fe2ee33e] {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.ele.model__tree-table .model__tree-table--container .model__tree--wrapper[data-v-fe2ee33e] {\n width: 240px;\n background: #fff;\n flex-shrink: 0;\n padding: 16px;\n box-sizing: border-box;\n margin-right: 16px;\n overflow-y: auto;\n}\n.ele.model__tree-table .model__table--container[data-v-fe2ee33e] {\n width: 100%;\n min-width: 0;\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper[data-v-fe2ee33e] {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\tree-table-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AAgSA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;AC/RA;ADiSA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;AC/RA;ADkSA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;AChSA;ADiSA;EACA,gBAAA;AC/RA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <section class=\"ele model__tree-table\">\r\n <section class=\"model__tree-table--container\" v-if=\"showTree\">\r\n <div class=\"model__tree--title\"></div>\r\n <section :ref=\"modelTreeWrapper\" class=\"model__tree--wrapper\">\r\n <ele-tree \r\n :tree-data=\"treeData\"\r\n :defaultExpandedKeys=\"defaultExpandedKeys\"\r\n :defaultSelectedKeys=\"defaultSelectedKeys\"\r\n @select=\"selectTreeNode\"\r\n :replace-fields=\"treeMeta.replaceFields || replaceFields\">\r\n </ele-tree>\r\n </section>\r\n </section>\r\n <section class=\"model__table--container\">\r\n <div class=\"model__table--title\"></div>\r\n <section :ref=\"modelTableWrapper\" class=\"model__table--wrapper\">\r\n <ele-search-area :ref=\"searchArea\" @search=\"onSearch\" :data-source=\"searchMeta.elements\"></ele-search-area>\r\n <ele-button-group v-on=\"$listeners\" :ref=\"buttonGroup\" @click=\"handleClickButtonGroup\" style=\"margin-top: 16px\" :data-source=\"getButtonGroupElements\"></ele-button-group>\r\n <ele-table\r\n v-on=\"$listeners\"\r\n :loading=\"loading\" \r\n :columns=\"columns\"\r\n :total=\"total\"\r\n :actions=\"actions\"\r\n :pageSize=\"pageSize\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n :data-source=\"tableData\"\r\n @change-page=\"onChangePage\" \r\n style=\"margin-top: 8px;\"\r\n ></ele-table>\r\n </section>\r\n </section>\r\n </section>\r\n</template>\r\n\r\n<script>\r\nimport EleTree from '../../tree/src/index.vue'\r\nimport EleTable from '../../table/src/index.vue'\r\nimport EleSearchArea from '../../composite-components/search-area/src/index.vue'\r\nimport EleButtonGroup from '../../composite-components/button-group/src/index.vue'\r\nimport { type, net } from '@idooel/shared'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nexport default {\r\n name: 'ele-tree-table-model',\r\n components: {\r\n EleTree,\r\n EleTable,\r\n EleSearchArea,\r\n EleButtonGroup\r\n },\r\n props: {\r\n treeMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n searchMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n buttonGroupMeta: {\r\n typeof: Object,\r\n default: () => ({})\r\n },\r\n tableMeta: {\r\n type: Object,\r\n default: () => ({})\r\n }\r\n },\r\n provide () {\r\n return {\r\n requestTreeData: this.requestTreeData,\r\n requestTableData: this.requestTableData\r\n }\r\n },\r\n data () {\r\n return {\r\n treeData: [],\r\n tableData: [],\r\n defaultExpandedKeys: [],\r\n defaultSelectedKeys: [],\r\n replaceFields: {\r\n title: 'title',\r\n children: 'children',\r\n key: 'id'\r\n },\r\n loading: false,\r\n total: 0,\r\n tableQuerys: {},\r\n resizeObserverModelTableWrapper: null,\r\n modelTableWrapperHeight: 0,\r\n currentTreeNodeData: {}\r\n }\r\n },\r\n computed: {\r\n showTree () {\r\n return !!Object.keys(this.treeMeta).length\r\n },\r\n buttonGroup () {\r\n return uuidv4()\r\n },\r\n searchArea () {\r\n return uuidv4()\r\n },\r\n modelTreeWrapper () {\r\n return uuidv4()\r\n },\r\n modelTableWrapper () {\r\n return uuidv4()\r\n },\r\n actions () {\r\n const { operations } = this.tableMeta\r\n return operations.elements\r\n },\r\n pageSize () {\r\n const { page = {} } = this.tableMeta\r\n return page.pageSize || 10\r\n },\r\n pageSizeOptions () {\r\n const { page = {} } = this.tableMeta\r\n return page.pageSizeOptions || ['10', '20', '30', '40']\r\n },\r\n columns () {\r\n const { columns, operations } = this.tableMeta\r\n if (type.get(columns) === 'array') {\r\n const columnsOptions = columns.map(item => {\r\n if (item.render) {\r\n return {\r\n title: item.title,\r\n dataIndex: item.dataIndex,\r\n width: item.width,\r\n align: item.align,\r\n fixed: item.fixed,\r\n customRender: (text, record, index) => {\r\n const { $createElement } = this\r\n return item.render.call(this, { h: $createElement, ctx: this }, typeof text == 'string' ? text : text[item.dataIndex], record, index)\r\n }\r\n }\r\n }\r\n return {\r\n title: item.title,\r\n dataIndex: item.dataIndex,\r\n width: item.width,\r\n align: item.align,\r\n fixed: item.fixed\r\n }\r\n })\r\n if (operations) {\r\n return [\r\n ...columnsOptions,\r\n {\r\n title: '操作',\r\n width: operations.width,\r\n key: 'action',\r\n fixed: 'right',\r\n scopedSlots: { customRender: 'action' }\r\n }\r\n ]\r\n }\r\n return columnsOptions\r\n } else {\r\n console.error('Error: columns is invalid, please check it')\r\n return []\r\n }\r\n },\r\n getButtonGroupElements () {\r\n const { elements } = this.buttonGroupMeta\r\n if (type.get(elements) === 'function') {\r\n return elements.call(this)\r\n } else if (type.get(elements) === 'array') {\r\n return elements\r\n } else {\r\n return []\r\n }\r\n }\r\n },\r\n async created () {\r\n if (this.showTree) {\r\n this.treeData = await this.requestTreeData()\r\n const [defaultTreeNode = {}] = this.treeData\r\n this.defaultExpandedKeys = [defaultTreeNode[this.replaceFields.key]]\r\n this.defaultSelectedKeys = [defaultTreeNode[this.replaceFields.key]]\r\n this.currentTreeNodeData = defaultTreeNode\r\n }\r\n const { fieldMap } = this.tableMeta\r\n this.tableData = await this.requestTableData(this.execTableFieldMap(fieldMap, this.currentTreeNodeData))\r\n },\r\n methods: {\r\n handleClickButtonGroup (props) {\r\n const { eventName } = props\r\n this.$emit(eventName, { currentTreeNode: this.currentTreeNodeData })\r\n },\r\n watchViewPort () {\r\n const modelTableWrapper = this.$refs[this.modelTableWrapper]\r\n console.log(modelTableWrapper.getBoundingClientRect())\r\n const { top } = modelTableWrapper.getBoundingClientRect()\r\n this.$refs[this.modelTreeWrapper].style.height = `calc(100vh - ${top}px)`\r\n },\r\n async onSearch (props) {\r\n this.tableQuerys = Object.assign(this.tableQuerys, props)\r\n this.tableData = await this.requestTableData()\r\n },\r\n execTableFieldMap (fieldMap = {}, props) {\r\n let ret = {}\r\n const keys = Object.keys(fieldMap)\r\n keys.forEach(key => {\r\n const field = fieldMap[key]\r\n ret[field] = props[key]\r\n })\r\n return ret\r\n },\r\n async selectTreeNode (selectedKeys, e) {\r\n const { fieldMap } = this.tableMeta\r\n this.currentTreeNodeData = e.node.$vnode.data.props.dataRef\r\n const execFieldMapRet = this.execTableFieldMap(fieldMap, e.node.$vnode.data.props.dataRef)\r\n this.tableData = await this.requestTableData(execFieldMapRet)\r\n },\r\n async requestTreeData () {\r\n const { url, requestType } = this.treeMeta\r\n const ret = await net.get(\r\n url\r\n ).then(resp => {\r\n const { data } = resp || {}\r\n return data\r\n })\r\n return ret\r\n },\r\n async onChangePage (page, pageSize) {\r\n this.tableData = await this.requestTableData({ currentPage: page, pageSize })\r\n },\r\n async requestTableData (props = {}) {\r\n const { url, requestType, page = {} } = this.tableMeta\r\n const { pageSize = 10 } = page\r\n this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: 1, pageSize }, props)\r\n const ret = await net.get(\r\n url,\r\n this.tableQuerys\r\n ).then(resp => {\r\n const { data = [], count } = resp || {}\r\n this.total = count\r\n return data.map(item => {\r\n return {\r\n key: uuidv4(),\r\n ...item\r\n }\r\n })\r\n })\r\n return ret\r\n },\r\n refreshTreeStatus (props = {}) {},\r\n refreshTableStatus (props = {}) {},\r\n getModelTableWrapperHeight () {},\r\n setModelTreeWrapperHeight (height) {\r\n this.$refs[this.modelTreeWrapper].style.height = height\r\n },\r\n setModelTableWrapperHeight () {\r\n const { top } = this.$refs[this.modelTableWrapper].getBoundingClientRect()\r\n const height = `calc(100vh - ${top}px)`\r\n this.$refs[this.modelTableWrapper].style.height = height\r\n this.setModelTreeWrapperHeight(height)\r\n },\r\n getSearchAreaHeight () {\r\n return this.$refs[this.searchArea].$el.clientHeight\r\n },\r\n getButtonGroupHeight () {\r\n return this.$refs[this.buttonGroup].$el.clientHeight\r\n }\r\n },\r\n mounted () {\r\n //TODO\r\n // this.setModelTableWrapperHeight()\r\n // this.resizeObserverModelTableWrapper = new ResizeObserver(entries => {\r\n // for (let entry of entries) {\r\n // this.modelTableWrapperHeight = entry.contentRect.height\r\n // console.log('this.modelTableWrapperHeight:', this.modelTableWrapperHeight)\r\n // console.log('getSearchAreaHeight', this.getSearchAreaHeight())\r\n // console.log('getButtonGroupHeight', this.getButtonGroupHeight())\r\n // const tableHeight = this.modelTableWrapperHeight - this.getSearchAreaHeight() - this.getButtonGroupHeight()\r\n // console.log('tableHeight', tableHeight)\r\n // }\r\n // })\r\n // this.resizeObserverModelTableWrapper.observe(this.$refs[this.modelTableWrapper])\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele {\r\n &.model__tree-table {\r\n background: transparent; \r\n display: flex;\r\n flex-direction: row;\r\n width: 100%;\r\n .model__tree-table--container {\r\n .model__tree--wrapper {\r\n width: 240px;\r\n background: #fff;\r\n flex-shrink: 0;\r\n padding: 16px;\r\n box-sizing: border-box;\r\n margin-right: 16px;\r\n overflow-y: auto;\r\n }\r\n }\r\n .model__table--container {\r\n width: 100%;\r\n min-width: 0;\r\n background: #fff;\r\n .model__table--wrapper {\r\n background: #fff;\r\n }\r\n }\r\n }\r\n}\r\n</style>",".ele.model__tree-table {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.ele.model__tree-table .model__tree-table--container .model__tree--wrapper {\n width: 240px;\n background: #fff;\n flex-shrink: 0;\n padding: 16px;\n box-sizing: border-box;\n margin-right: 16px;\n overflow-y: auto;\n}\n.ele.model__tree-table .model__table--container {\n width: 100%;\n min-width: 0;\n background: #fff;\n}\n.ele.model__tree-table .model__table--container .model__table--wrapper {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2560
2661
|
|
|
2561
2662
|
};
|
|
2562
2663
|
/* scoped */
|
|
2563
|
-
const __vue_scope_id__$
|
|
2664
|
+
const __vue_scope_id__$i = "data-v-fe2ee33e";
|
|
2564
2665
|
/* module identifier */
|
|
2565
|
-
const __vue_module_identifier__$
|
|
2666
|
+
const __vue_module_identifier__$i = undefined;
|
|
2566
2667
|
/* functional template */
|
|
2567
|
-
const __vue_is_functional_template__$
|
|
2668
|
+
const __vue_is_functional_template__$i = false;
|
|
2568
2669
|
/* style inject SSR */
|
|
2569
2670
|
|
|
2570
2671
|
/* style inject shadow dom */
|
|
2571
2672
|
|
|
2572
2673
|
|
|
2573
2674
|
|
|
2574
|
-
const __vue_component__$
|
|
2575
|
-
{ render: __vue_render__$
|
|
2576
|
-
__vue_inject_styles__$
|
|
2577
|
-
__vue_script__$
|
|
2578
|
-
__vue_scope_id__$
|
|
2579
|
-
__vue_is_functional_template__$
|
|
2580
|
-
__vue_module_identifier__$
|
|
2675
|
+
const __vue_component__$i = /*#__PURE__*/normalizeComponent(
|
|
2676
|
+
{ render: __vue_render__$i, staticRenderFns: __vue_staticRenderFns__$i },
|
|
2677
|
+
__vue_inject_styles__$i,
|
|
2678
|
+
__vue_script__$i,
|
|
2679
|
+
__vue_scope_id__$i,
|
|
2680
|
+
__vue_is_functional_template__$i,
|
|
2681
|
+
__vue_module_identifier__$i,
|
|
2581
2682
|
false,
|
|
2582
2683
|
createInjector,
|
|
2583
2684
|
undefined,
|
|
@@ -2585,113 +2686,6 @@ __vue_render__$d._withStripped = true;
|
|
|
2585
2686
|
);
|
|
2586
2687
|
|
|
2587
2688
|
//
|
|
2588
|
-
var script$c = {
|
|
2589
|
-
name: 'ele-tpl',
|
|
2590
|
-
props: {
|
|
2591
|
-
modelName: {
|
|
2592
|
-
type: String
|
|
2593
|
-
}
|
|
2594
|
-
},
|
|
2595
|
-
components: {
|
|
2596
|
-
[__vue_component__$d.name]: __vue_component__$d
|
|
2597
|
-
},
|
|
2598
|
-
computed: {
|
|
2599
|
-
modelNameValidator() {
|
|
2600
|
-
const target = models.find(model => model.name === this.modelName);
|
|
2601
|
-
return {
|
|
2602
|
-
existed: !!target,
|
|
2603
|
-
message: !!target ? '' : `Model <span style="color:red;">${this.modelName}</span> not found`
|
|
2604
|
-
};
|
|
2605
|
-
},
|
|
2606
|
-
genModelRef() {
|
|
2607
|
-
return v4();
|
|
2608
|
-
}
|
|
2609
|
-
},
|
|
2610
|
-
methods: {
|
|
2611
|
-
getModel() {
|
|
2612
|
-
return this.$refs[this.genModelRef];
|
|
2613
|
-
}
|
|
2614
|
-
}
|
|
2615
|
-
};
|
|
2616
|
-
|
|
2617
|
-
/* script */
|
|
2618
|
-
const __vue_script__$c = script$c;
|
|
2619
|
-
|
|
2620
|
-
/* template */
|
|
2621
|
-
var __vue_render__$c = function () {
|
|
2622
|
-
var _vm = this;
|
|
2623
|
-
var _h = _vm.$createElement;
|
|
2624
|
-
var _c = _vm._self._c || _h;
|
|
2625
|
-
return _vm.modelNameValidator.existed
|
|
2626
|
-
? _c(
|
|
2627
|
-
_vm.modelName,
|
|
2628
|
-
_vm._g(
|
|
2629
|
-
_vm._b(
|
|
2630
|
-
{
|
|
2631
|
-
ref: _vm.genModelRef,
|
|
2632
|
-
tag: "component",
|
|
2633
|
-
scopedSlots: _vm._u(
|
|
2634
|
-
[
|
|
2635
|
-
_vm._l(_vm.$scopedSlots, function (idx, name) {
|
|
2636
|
-
return {
|
|
2637
|
-
key: name,
|
|
2638
|
-
fn: function (data) {
|
|
2639
|
-
return [_vm._t(name, null, null, data)]
|
|
2640
|
-
},
|
|
2641
|
-
}
|
|
2642
|
-
}),
|
|
2643
|
-
],
|
|
2644
|
-
null,
|
|
2645
|
-
true
|
|
2646
|
-
),
|
|
2647
|
-
},
|
|
2648
|
-
"component",
|
|
2649
|
-
_vm.$attrs,
|
|
2650
|
-
false
|
|
2651
|
-
),
|
|
2652
|
-
_vm.$listeners
|
|
2653
|
-
)
|
|
2654
|
-
)
|
|
2655
|
-
: _c("div", {
|
|
2656
|
-
domProps: { innerHTML: _vm._s(_vm.modelNameValidator.message) },
|
|
2657
|
-
})
|
|
2658
|
-
};
|
|
2659
|
-
var __vue_staticRenderFns__$c = [];
|
|
2660
|
-
__vue_render__$c._withStripped = true;
|
|
2661
|
-
|
|
2662
|
-
/* style */
|
|
2663
|
-
const __vue_inject_styles__$c = function (inject) {
|
|
2664
|
-
if (!inject) return
|
|
2665
|
-
inject("data-v-7b13873a_0", { source: ".has-error .ele-upload__wrapper .file-uploads label {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-008: rgba(0, 0, 0, 0.88);\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;AACzC;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .file-uploads label {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .file-uploads .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-008: rgba(0, 0, 0, 0.88);\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2666
|
-
|
|
2667
|
-
};
|
|
2668
|
-
/* scoped */
|
|
2669
|
-
const __vue_scope_id__$c = undefined;
|
|
2670
|
-
/* module identifier */
|
|
2671
|
-
const __vue_module_identifier__$c = undefined;
|
|
2672
|
-
/* functional template */
|
|
2673
|
-
const __vue_is_functional_template__$c = false;
|
|
2674
|
-
/* style inject SSR */
|
|
2675
|
-
|
|
2676
|
-
/* style inject shadow dom */
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
const __vue_component__$c = /*#__PURE__*/normalizeComponent(
|
|
2681
|
-
{ render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c },
|
|
2682
|
-
__vue_inject_styles__$c,
|
|
2683
|
-
__vue_script__$c,
|
|
2684
|
-
__vue_scope_id__$c,
|
|
2685
|
-
__vue_is_functional_template__$c,
|
|
2686
|
-
__vue_module_identifier__$c,
|
|
2687
|
-
false,
|
|
2688
|
-
createInjector,
|
|
2689
|
-
undefined,
|
|
2690
|
-
undefined
|
|
2691
|
-
);
|
|
2692
|
-
|
|
2693
|
-
__vue_component__$c.install = Vue => Vue.component(__vue_component__$c.name, __vue_component__$c);
|
|
2694
|
-
|
|
2695
2689
|
//
|
|
2696
2690
|
//
|
|
2697
2691
|
//
|
|
@@ -2704,8 +2698,12 @@ __vue_component__$c.install = Vue => Vue.component(__vue_component__$c.name, __v
|
|
|
2704
2698
|
//
|
|
2705
2699
|
//
|
|
2706
2700
|
|
|
2707
|
-
var script$
|
|
2701
|
+
var script$h = {
|
|
2708
2702
|
name: 'ele-textarea',
|
|
2703
|
+
model: {
|
|
2704
|
+
prop: 'value',
|
|
2705
|
+
event: 'change'
|
|
2706
|
+
},
|
|
2709
2707
|
props: {
|
|
2710
2708
|
maxLength: {
|
|
2711
2709
|
type: Number
|
|
@@ -2726,28 +2724,33 @@ var script$b = {
|
|
|
2726
2724
|
},
|
|
2727
2725
|
value: {
|
|
2728
2726
|
type: String
|
|
2727
|
+
},
|
|
2728
|
+
disabled: {
|
|
2729
|
+
type: Boolean,
|
|
2730
|
+
default: false
|
|
2729
2731
|
}
|
|
2730
2732
|
},
|
|
2731
2733
|
methods: {
|
|
2732
2734
|
onChange(e) {
|
|
2733
2735
|
const value = e.target.value;
|
|
2734
|
-
this.$emit('
|
|
2736
|
+
this.$emit('change', value);
|
|
2735
2737
|
this.$emit('input', value);
|
|
2736
2738
|
}
|
|
2737
2739
|
}
|
|
2738
2740
|
};
|
|
2739
2741
|
|
|
2740
2742
|
/* script */
|
|
2741
|
-
const __vue_script__$
|
|
2743
|
+
const __vue_script__$h = script$h;
|
|
2742
2744
|
|
|
2743
2745
|
/* template */
|
|
2744
|
-
var __vue_render__$
|
|
2746
|
+
var __vue_render__$h = function () {
|
|
2745
2747
|
var _vm = this;
|
|
2746
2748
|
var _h = _vm.$createElement;
|
|
2747
2749
|
var _c = _vm._self._c || _h;
|
|
2748
2750
|
return _c("a-textarea", {
|
|
2749
2751
|
attrs: {
|
|
2750
2752
|
value: _vm.value,
|
|
2753
|
+
disabled: _vm.disabled,
|
|
2751
2754
|
"auto-size": _vm.autosize,
|
|
2752
2755
|
"max-length": _vm.maxLength,
|
|
2753
2756
|
placeholder: _vm.placeholder,
|
|
@@ -2756,34 +2759,34 @@ var __vue_render__$b = function () {
|
|
|
2756
2759
|
on: { change: _vm.onChange },
|
|
2757
2760
|
})
|
|
2758
2761
|
};
|
|
2759
|
-
var __vue_staticRenderFns__$
|
|
2760
|
-
__vue_render__$
|
|
2762
|
+
var __vue_staticRenderFns__$h = [];
|
|
2763
|
+
__vue_render__$h._withStripped = true;
|
|
2761
2764
|
|
|
2762
2765
|
/* style */
|
|
2763
|
-
const __vue_inject_styles__$
|
|
2766
|
+
const __vue_inject_styles__$h = function (inject) {
|
|
2764
2767
|
if (!inject) return
|
|
2765
|
-
inject("data-v-
|
|
2768
|
+
inject("data-v-416114ba_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
2766
2769
|
|
|
2767
2770
|
};
|
|
2768
2771
|
/* scoped */
|
|
2769
|
-
const __vue_scope_id__$
|
|
2772
|
+
const __vue_scope_id__$h = "data-v-416114ba";
|
|
2770
2773
|
/* module identifier */
|
|
2771
|
-
const __vue_module_identifier__$
|
|
2774
|
+
const __vue_module_identifier__$h = undefined;
|
|
2772
2775
|
/* functional template */
|
|
2773
|
-
const __vue_is_functional_template__$
|
|
2776
|
+
const __vue_is_functional_template__$h = false;
|
|
2774
2777
|
/* style inject SSR */
|
|
2775
2778
|
|
|
2776
2779
|
/* style inject shadow dom */
|
|
2777
2780
|
|
|
2778
2781
|
|
|
2779
2782
|
|
|
2780
|
-
const __vue_component__$
|
|
2781
|
-
{ render: __vue_render__$
|
|
2782
|
-
__vue_inject_styles__$
|
|
2783
|
-
__vue_script__$
|
|
2784
|
-
__vue_scope_id__$
|
|
2785
|
-
__vue_is_functional_template__$
|
|
2786
|
-
__vue_module_identifier__$
|
|
2783
|
+
const __vue_component__$h = /*#__PURE__*/normalizeComponent(
|
|
2784
|
+
{ render: __vue_render__$h, staticRenderFns: __vue_staticRenderFns__$h },
|
|
2785
|
+
__vue_inject_styles__$h,
|
|
2786
|
+
__vue_script__$h,
|
|
2787
|
+
__vue_scope_id__$h,
|
|
2788
|
+
__vue_is_functional_template__$h,
|
|
2789
|
+
__vue_module_identifier__$h,
|
|
2787
2790
|
false,
|
|
2788
2791
|
createInjector,
|
|
2789
2792
|
undefined,
|
|
@@ -2800,7 +2803,7 @@ __vue_render__$b._withStripped = true;
|
|
|
2800
2803
|
//
|
|
2801
2804
|
//
|
|
2802
2805
|
|
|
2803
|
-
var script$
|
|
2806
|
+
var script$g = {
|
|
2804
2807
|
name: 'ele-icon',
|
|
2805
2808
|
props: {
|
|
2806
2809
|
type: {
|
|
@@ -2823,10 +2826,10 @@ var script$a = {
|
|
|
2823
2826
|
};
|
|
2824
2827
|
|
|
2825
2828
|
/* script */
|
|
2826
|
-
const __vue_script__$
|
|
2829
|
+
const __vue_script__$g = script$g;
|
|
2827
2830
|
|
|
2828
2831
|
/* template */
|
|
2829
|
-
var __vue_render__$
|
|
2832
|
+
var __vue_render__$g = function () {
|
|
2830
2833
|
var _vm = this;
|
|
2831
2834
|
var _h = _vm.$createElement;
|
|
2832
2835
|
var _c = _vm._self._c || _h;
|
|
@@ -2834,17 +2837,17 @@ var __vue_render__$a = function () {
|
|
|
2834
2837
|
? _c("a-icon", { attrs: { type: _vm.type, theme: _vm.theme } })
|
|
2835
2838
|
: _c("i", { class: ["iconfont", _vm.type] })
|
|
2836
2839
|
};
|
|
2837
|
-
var __vue_staticRenderFns__$
|
|
2838
|
-
__vue_render__$
|
|
2840
|
+
var __vue_staticRenderFns__$g = [];
|
|
2841
|
+
__vue_render__$g._withStripped = true;
|
|
2839
2842
|
|
|
2840
2843
|
/* style */
|
|
2841
|
-
const __vue_inject_styles__$
|
|
2844
|
+
const __vue_inject_styles__$g = undefined;
|
|
2842
2845
|
/* scoped */
|
|
2843
|
-
const __vue_scope_id__$
|
|
2846
|
+
const __vue_scope_id__$g = undefined;
|
|
2844
2847
|
/* module identifier */
|
|
2845
|
-
const __vue_module_identifier__$
|
|
2848
|
+
const __vue_module_identifier__$g = undefined;
|
|
2846
2849
|
/* functional template */
|
|
2847
|
-
const __vue_is_functional_template__$
|
|
2850
|
+
const __vue_is_functional_template__$g = false;
|
|
2848
2851
|
/* style inject */
|
|
2849
2852
|
|
|
2850
2853
|
/* style inject SSR */
|
|
@@ -2853,13 +2856,13 @@ __vue_render__$a._withStripped = true;
|
|
|
2853
2856
|
|
|
2854
2857
|
|
|
2855
2858
|
|
|
2856
|
-
const __vue_component__$
|
|
2857
|
-
{ render: __vue_render__$
|
|
2858
|
-
__vue_inject_styles__$
|
|
2859
|
-
__vue_script__$
|
|
2860
|
-
__vue_scope_id__$
|
|
2861
|
-
__vue_is_functional_template__$
|
|
2862
|
-
__vue_module_identifier__$
|
|
2859
|
+
const __vue_component__$g = /*#__PURE__*/normalizeComponent(
|
|
2860
|
+
{ render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g },
|
|
2861
|
+
__vue_inject_styles__$g,
|
|
2862
|
+
__vue_script__$g,
|
|
2863
|
+
__vue_scope_id__$g,
|
|
2864
|
+
__vue_is_functional_template__$g,
|
|
2865
|
+
__vue_module_identifier__$g,
|
|
2863
2866
|
false,
|
|
2864
2867
|
undefined,
|
|
2865
2868
|
undefined,
|
|
@@ -2867,11 +2870,11 @@ __vue_render__$a._withStripped = true;
|
|
|
2867
2870
|
);
|
|
2868
2871
|
|
|
2869
2872
|
//
|
|
2870
|
-
var script$
|
|
2873
|
+
var script$f = {
|
|
2871
2874
|
name: 'ele-upload',
|
|
2872
2875
|
components: {
|
|
2873
2876
|
FileUpload,
|
|
2874
|
-
EleIcon: __vue_component__$
|
|
2877
|
+
EleIcon: __vue_component__$g
|
|
2875
2878
|
},
|
|
2876
2879
|
model: {
|
|
2877
2880
|
prop: 'value',
|
|
@@ -3101,10 +3104,10 @@ var script$9 = {
|
|
|
3101
3104
|
};
|
|
3102
3105
|
|
|
3103
3106
|
/* script */
|
|
3104
|
-
const __vue_script__$
|
|
3107
|
+
const __vue_script__$f = script$f;
|
|
3105
3108
|
|
|
3106
3109
|
/* template */
|
|
3107
|
-
var __vue_render__$
|
|
3110
|
+
var __vue_render__$f = function () {
|
|
3108
3111
|
var _vm = this;
|
|
3109
3112
|
var _h = _vm.$createElement;
|
|
3110
3113
|
var _c = _vm._self._c || _h;
|
|
@@ -3242,34 +3245,34 @@ var __vue_render__$9 = function () {
|
|
|
3242
3245
|
1
|
|
3243
3246
|
)
|
|
3244
3247
|
};
|
|
3245
|
-
var __vue_staticRenderFns__$
|
|
3246
|
-
__vue_render__$
|
|
3248
|
+
var __vue_staticRenderFns__$f = [];
|
|
3249
|
+
__vue_render__$f._withStripped = true;
|
|
3247
3250
|
|
|
3248
3251
|
/* style */
|
|
3249
|
-
const __vue_inject_styles__$
|
|
3252
|
+
const __vue_inject_styles__$f = function (inject) {
|
|
3250
3253
|
if (!inject) return
|
|
3251
|
-
inject("data-v-29bc9f58_0", { source: "[data-v-29bc9f58] .file-uploads label {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n border-radius: var(--idooel-form-border-radius);\n}\n[data-v-29bc9f58] .file-uploads label:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n.ele-upload__wrapper[data-v-29bc9f58] {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area[data-v-29bc9f58] {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload[data-v-29bc9f58] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text[data-v-29bc9f58] {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message[data-v-29bc9f58] {\n font-size: 16px;\n color: var(--idoole-black-008);\n text-align: left;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__ext[data-v-29bc9f58] {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item[data-v-29bc9f58] {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name[data-v-29bc9f58] {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name .ele-file__inner[data-v-29bc9f58] {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete[data-v-29bc9f58] {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon[data-v-29bc9f58] {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\upload\\src\\index.vue","index.vue"],"names":[],"mappings":"AAqRA;EACA,qBAAA;EACA,eAAA;EACA,wDAAA;EACA,yDAAA;EAIA,+CAAA;ACvRA;ADoRA;EACA,0DAAA;AClRA;ADuRA;EACA,WAAA;ACpRA;ADqRA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;ACnRA;ADqRA;EACA,eAAA;EACA,kCAAA;ACnRA;ADsRA;EACA,iBAAA;ACpRA;ADqRA;EACA,eAAA;EACA,8BAAA;EACA,gBAAA;ACnRA;ADqRA;EACA,gBAAA;EACA,eAAA;EACA,6BAAA;ACnRA;ADwRA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;EACA,+CAAA;EACA,8CAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACtRA;ADwRA;EACA,OAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;ACtRA;ADuRA;EACA,gBAAA;EACA,uBAAA;ACrRA;ADwRA;EACA,gBAAA;ACtRA;ADuRA;EACA,gBAAA;EACA,eAAA;ACrRA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele-upload__wrapper\">\r\n <FileUpload\r\n class=\"ele-upload__inner\"\r\n v-show=\"isShowUploadContainer\"\r\n v-model=\"files\"\r\n :ref=\"uploadRef\"\r\n :drop=\"drop\"\r\n :chunk-enabled=\"chunkEnabled\"\r\n :chunk=\"chunkConfig\"\r\n :accept=\"accept\"\r\n :size=\"fileSizeLimit\"\r\n :post-action=\"postAction\"\r\n :multiple=\"multiple\"\r\n :maximum=\"getMaximum\"\r\n @input-file=\"onWatchInputFiles\"\r\n @input=\"onWatchFiles\"\r\n style=\"width: 100%;\">\r\n <section class=\"ele-upload__area\">\r\n <div class=\"ele-upload__area--icon\">\r\n <ele-icon type=\"cloud-upload\"></ele-icon>\r\n </div>\r\n <div class=\"ele-upload__area--text\">\r\n <div class=\"ele-upload__message\">单击或拖动文件到该区域以上传</div>\r\n <div class=\"ele-upload__ext\">文件小于{{ size }}M</div>\r\n </div>\r\n </section>\r\n </FileUpload>\r\n <section class=\"ele-files__wrapper\">\r\n <div class=\"ele-file__item\" v-for=\"(file, idx) in files\" :key=\"idx\">\r\n <div class=\"ele-file__suffix--icon\">\r\n <ele-icon type=\"icon-doc\"></ele-icon>\r\n </div>\r\n <div class=\"ele-file__name\">\r\n <div class=\"ele-file__inner\" @click=\"handleClickDownload(file)\">{{ file.name }}</div>\r\n <div v-if=\"!file.success\" class=\"ele-uplpad__progress\">\r\n <a-progress :strokeWidth=\"2\" :percent=\"Number(file.progress)\" size=\"small\" />\r\n </div>\r\n </div>\r\n <div class=\"ele-file__delete\" v-if=\"file.success || file.error\">\r\n <span class=\"ele-file__size\">{{ (file.size / byteConversion).toFixed(2) }}M</span>\r\n <span class=\"ele-file__delete--icon\" @click=\"handleClickDelete(file)\">\r\n <ele-icon type=\"delete\"></ele-icon>\r\n </span>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport FileUpload from 'vue-upload-component'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { route, net } from '@idooel/shared'\r\nimport EleIcon from '../../icon/src/index.vue'\r\nexport default {\r\n name: 'ele-upload',\r\n components: {\r\n FileUpload,\r\n EleIcon\r\n },\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n url: {\r\n type: String,\r\n default: '/zuul/api-file/workbench/file'\r\n },\r\n size: {\r\n type: Number,\r\n default: 100\r\n },\r\n accept: {\r\n type: String\r\n },\r\n maximum: {\r\n type: Number,\r\n default: 10\r\n },\r\n multiple: {\r\n type: Boolean,\r\n default: false\r\n },\r\n drop: {\r\n type: Boolean,\r\n default: true\r\n },\r\n value: {\r\n type: [String, Array]\r\n },\r\n querys: {\r\n type: Object,\r\n default: () => ({\r\n _csrf: 'c81f993f-f044-45bb-b3af-2977d335042d',\r\n _t: new Date().valueOf()\r\n })\r\n },\r\n headers: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n byteConversion: {\r\n type: Number,\r\n default: 1024 * 1024\r\n },\r\n chunkEnabled: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data() {\r\n return {\r\n files: [],\r\n saveToServerAsyncPageTimer: null\r\n }\r\n },\r\n computed: {\r\n getPayloads () {\r\n return {\r\n override: false\r\n }\r\n },\r\n chunkConfig () {\r\n const ret = route.toQueryString(this.querys)\r\n return {\r\n action: `${window.prefixPath}/zuul/api-file/workbench/file/temp/chunk/vue`,\r\n headers: {\r\n 'X-XSRF-TOKEN': localStorage.getItem('token')\r\n },\r\n minSize: 3 * this.byteConversion,\r\n maxActive: 3,\r\n maxRetries: 5,\r\n startBody: {\r\n override: true,\r\n path: '/cw'\r\n },\r\n uploadBody: {\r\n override: true,\r\n path: '/cw'\r\n },\r\n finishBody: {\r\n override: true,\r\n path: '/cw'\r\n }\r\n }\r\n },\r\n isFileUploadSuccessed () {\r\n return this.files.every(file => file.success)\r\n },\r\n isShowUploadContainer () {\r\n if (this.multiple) {\r\n if (this.isFileUploadSuccessed && this.files.length >= this.maximum) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n } else {\r\n if (this.isFileUploadSuccessed && this.files.length >= 1) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n }\r\n },\r\n getMaximum () {\r\n return this.multiple ? this.maximum : 1\r\n },\r\n fileSizeLimit () {\r\n return this.size * this.byteConversion\r\n },\r\n postAction () {\r\n const ret = route.toQueryString(this.querys)\r\n return `${window.prefixPath}${this.url}?${ret}`\r\n },\r\n uploadRef () {\r\n return uuidv4()\r\n },\r\n fileSuffixIcon () {\r\n return {\r\n 'doc': { name: 'icon-doc' },\r\n }\r\n },\r\n fileIds () {\r\n const fileIds = this.files.map(file => {\r\n return file.response.data.fileID\r\n })\r\n return this.multiple ? fileIds : fileIds[0]\r\n }\r\n },\r\n methods: {\r\n handleClickDownload (file) {\r\n console.log('download file', file)\r\n },\r\n handleClickDelete (file) {\r\n this.$refs[this.uploadRef].remove(file)\r\n this.$emit('change', this.fileIds)\r\n },\r\n onWatchFiles (files) {\r\n this.files = files\r\n if (this.isFileUploadSuccessed) {\r\n this.$emit('change', this.fileIds)\r\n }\r\n },\r\n async saveToServerAsyncPage (payloads = {}) {\r\n net.post('zuul/api-file/workbench/file/temp/saveToServerAsyncPage', payloads, { \r\n headers: {\r\n 'Content-Type': 'multipart/form-data'\r\n }\r\n }).then(resp =>{\r\n const { data } = resp\r\n if (data !== 'saveToServerAsyncPage') {\r\n clearInterval(this.saveToServerAsyncPageTimer)\r\n }\r\n })\r\n // const ret = await net.post({\r\n // url: 'zuul/api-file/workbench/file/temp/saveToServerAsyncPage',\r\n // method: 'POST',\r\n // data: { ...payloads }\r\n // }).then(resp => {\r\n // const { data: { data, code, message } } = resp\r\n // if (code !== '2000') {\r\n // this.$Message.error(message)\r\n // return\r\n // }\r\n // if (data !== 'saveToServerAsyncPage') {\r\n // clearInterval(timer)\r\n // const { fileID, size } = data\r\n // this.$emit('on-success', { ...data, fileId: fileID })\r\n // this.$Message.success('同步成功')\r\n // return { fileId: fileID, size }\r\n // }\r\n // })\r\n // return ret\r\n },\r\n onWatchInputFiles (newFile, oldFile) {\r\n if (newFile && !oldFile) {\r\n // add file\r\n console.log('add', newFile)\r\n }\r\n if (newFile && oldFile) {\r\n // update file\r\n console.log('update', newFile)\r\n const { success, active, chunk, response } = newFile\r\n if (chunk && success && !active) {\r\n console.log('chunk end')\r\n const { data: { file, type } } = response\r\n const payloads = {\r\n filePath: file.match(/\\/cw(.*)/)[0],\r\n asyncID: uuidv4(),\r\n isDeleteOrigin: false,\r\n toImage: type === 'pdf' ? true : false,\r\n unzip: type === 'zip' ? true : false,\r\n _csrf: localStorage.getItem('token')\r\n }\r\n this.saveToServerAsyncPageTimer = setInterval(() => {\r\n this.saveToServerAsyncPage(payloads)\r\n }, 2000)\r\n }\r\n }\r\n if (!newFile && oldFile) {\r\n // delete file\r\n console.log('delete')\r\n }\r\n if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) {\r\n if (!this.$refs[this.uploadRef].active) {\r\n this.$refs[this.uploadRef].active = true\r\n }\r\n }\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n::v-deep .file-uploads {\r\n label {\r\n opacity: 1 !important;\r\n cursor: pointer;\r\n border: 1px dashed var(--idooel-form-title-border-color);\r\n background: var(--idooel-form-upload-bg-color) !important;\r\n &:hover {\r\n border-color: var(--idooel-form-upload-border-hover-color);\r\n }\r\n border-radius: var(--idooel-form-border-radius);\r\n }\r\n}\r\n.ele-upload__wrapper {\r\n width: 100%;\r\n .ele-upload__area {\r\n padding: 16px;\r\n width: 100%;\r\n height: 80px;\r\n display: flex;\r\n flex-direction: row;\r\n .ele-upload__area--icon {\r\n .anticon-cloud-upload {\r\n font-size: 48px;\r\n color: var(--idooel-primary-color);\r\n }\r\n }\r\n .ele-upload__area--text {\r\n margin-left: 16px;\r\n .ele-upload__message {\r\n font-size: 16px;\r\n color: var(--idoole-black-008);\r\n text-align: left;\r\n }\r\n .ele-upload__ext {\r\n text-align: left;\r\n font-size: 14px;\r\n color: var(--idoole-black-06);\r\n }\r\n }\r\n }\r\n .ele-files__wrapper {\r\n .ele-file__item {\r\n width: 100%;\r\n margin-top: 8px;\r\n padding: 8px 12px;\r\n border-radius: var(--idooel-form-border-radius);\r\n background: var(--idooel-form-upload-bg-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n .ele-file__suffix--icon {}\r\n .ele-file__name {\r\n flex: 1;\r\n text-align: left;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n font-size: 14px;\r\n margin-left: 8px;\r\n cursor: pointer;\r\n .ele-file__inner {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n }\r\n .ele-file__delete {\r\n margin-left: 8px;\r\n .ele-file__delete--icon {\r\n margin-left: 8px;\r\n cursor: pointer;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n</style>","::v-deep .file-uploads label {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n border-radius: var(--idooel-form-border-radius);\n}\n::v-deep .file-uploads label:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n\n.ele-upload__wrapper {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message {\n font-size: 16px;\n color: var(--idoole-black-008);\n text-align: left;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name .ele-file__inner {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3254
|
+
inject("data-v-7a628fc7_0", { source: "[data-v-7a628fc7] .ele-upload__inner {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n border-radius: var(--idooel-form-border-radius);\n}\n[data-v-7a628fc7] .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n.ele-upload__wrapper[data-v-7a628fc7] {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area[data-v-7a628fc7] {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload[data-v-7a628fc7] {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text[data-v-7a628fc7] {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message[data-v-7a628fc7] {\n font-size: 16px;\n color: var(--idoole-black-008);\n text-align: left;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__ext[data-v-7a628fc7] {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item[data-v-7a628fc7] {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name[data-v-7a628fc7] {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name .ele-file__inner[data-v-7a628fc7] {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete[data-v-7a628fc7] {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon[data-v-7a628fc7] {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\upload\\src\\index.vue","index.vue"],"names":[],"mappings":"AAoRA;EACA,qBAAA;EACA,eAAA;EACA,wDAAA;EACA,yDAAA;EAIA,+CAAA;ACtRA;ADmRA;EACA,0DAAA;ACjRA;ADqRA;EACA,WAAA;AClRA;ADmRA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;ACjRA;ADmRA;EACA,eAAA;EACA,kCAAA;ACjRA;ADoRA;EACA,iBAAA;AClRA;ADmRA;EACA,eAAA;EACA,8BAAA;EACA,gBAAA;ACjRA;ADmRA;EACA,gBAAA;EACA,eAAA;EACA,6BAAA;ACjRA;ADsRA;EACA,WAAA;EACA,eAAA;EACA,iBAAA;EACA,+CAAA;EACA,8CAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;ACpRA;ADsRA;EACA,OAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;ACpRA;ADqRA;EACA,gBAAA;EACA,uBAAA;ACnRA;ADsRA;EACA,gBAAA;ACpRA;ADqRA;EACA,gBAAA;EACA,eAAA;ACnRA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele-upload__wrapper\">\r\n <FileUpload\r\n class=\"ele-upload__inner\"\r\n v-show=\"isShowUploadContainer\"\r\n v-model=\"files\"\r\n :ref=\"uploadRef\"\r\n :drop=\"drop\"\r\n :chunk-enabled=\"chunkEnabled\"\r\n :chunk=\"chunkConfig\"\r\n :accept=\"accept\"\r\n :size=\"fileSizeLimit\"\r\n :post-action=\"postAction\"\r\n :multiple=\"multiple\"\r\n :maximum=\"getMaximum\"\r\n @input-file=\"onWatchInputFiles\"\r\n @input=\"onWatchFiles\"\r\n style=\"width: 100%;\">\r\n <section class=\"ele-upload__area\">\r\n <div class=\"ele-upload__area--icon\">\r\n <ele-icon type=\"cloud-upload\"></ele-icon>\r\n </div>\r\n <div class=\"ele-upload__area--text\">\r\n <div class=\"ele-upload__message\">单击或拖动文件到该区域以上传</div>\r\n <div class=\"ele-upload__ext\">文件小于{{ size }}M</div>\r\n </div>\r\n </section>\r\n </FileUpload>\r\n <section class=\"ele-files__wrapper\">\r\n <div class=\"ele-file__item\" v-for=\"(file, idx) in files\" :key=\"idx\">\r\n <div class=\"ele-file__suffix--icon\">\r\n <ele-icon type=\"icon-doc\"></ele-icon>\r\n </div>\r\n <div class=\"ele-file__name\">\r\n <div class=\"ele-file__inner\" @click=\"handleClickDownload(file)\">{{ file.name }}</div>\r\n <div v-if=\"!file.success\" class=\"ele-uplpad__progress\">\r\n <a-progress :strokeWidth=\"2\" :percent=\"Number(file.progress)\" size=\"small\" />\r\n </div>\r\n </div>\r\n <div class=\"ele-file__delete\" v-if=\"file.success || file.error\">\r\n <span class=\"ele-file__size\">{{ (file.size / byteConversion).toFixed(2) }}M</span>\r\n <span class=\"ele-file__delete--icon\" @click=\"handleClickDelete(file)\">\r\n <ele-icon type=\"delete\"></ele-icon>\r\n </span>\r\n </div>\r\n </div>\r\n </section>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport FileUpload from 'vue-upload-component'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { route, net } from '@idooel/shared'\r\nimport EleIcon from '../../icon/src/index.vue'\r\nexport default {\r\n name: 'ele-upload',\r\n components: {\r\n FileUpload,\r\n EleIcon\r\n },\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n url: {\r\n type: String,\r\n default: '/zuul/api-file/workbench/file'\r\n },\r\n size: {\r\n type: Number,\r\n default: 100\r\n },\r\n accept: {\r\n type: String\r\n },\r\n maximum: {\r\n type: Number,\r\n default: 10\r\n },\r\n multiple: {\r\n type: Boolean,\r\n default: false\r\n },\r\n drop: {\r\n type: Boolean,\r\n default: true\r\n },\r\n value: {\r\n type: [String, Array]\r\n },\r\n querys: {\r\n type: Object,\r\n default: () => ({\r\n _csrf: 'c81f993f-f044-45bb-b3af-2977d335042d',\r\n _t: new Date().valueOf()\r\n })\r\n },\r\n headers: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n byteConversion: {\r\n type: Number,\r\n default: 1024 * 1024\r\n },\r\n chunkEnabled: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data() {\r\n return {\r\n files: [],\r\n saveToServerAsyncPageTimer: null\r\n }\r\n },\r\n computed: {\r\n getPayloads () {\r\n return {\r\n override: false\r\n }\r\n },\r\n chunkConfig () {\r\n const ret = route.toQueryString(this.querys)\r\n return {\r\n action: `${window.prefixPath}/zuul/api-file/workbench/file/temp/chunk/vue`,\r\n headers: {\r\n 'X-XSRF-TOKEN': localStorage.getItem('token')\r\n },\r\n minSize: 3 * this.byteConversion,\r\n maxActive: 3,\r\n maxRetries: 5,\r\n startBody: {\r\n override: true,\r\n path: '/cw'\r\n },\r\n uploadBody: {\r\n override: true,\r\n path: '/cw'\r\n },\r\n finishBody: {\r\n override: true,\r\n path: '/cw'\r\n }\r\n }\r\n },\r\n isFileUploadSuccessed () {\r\n return this.files.every(file => file.success)\r\n },\r\n isShowUploadContainer () {\r\n if (this.multiple) {\r\n if (this.isFileUploadSuccessed && this.files.length >= this.maximum) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n } else {\r\n if (this.isFileUploadSuccessed && this.files.length >= 1) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n }\r\n },\r\n getMaximum () {\r\n return this.multiple ? this.maximum : 1\r\n },\r\n fileSizeLimit () {\r\n return this.size * this.byteConversion\r\n },\r\n postAction () {\r\n const ret = route.toQueryString(this.querys)\r\n return `${window.prefixPath}${this.url}?${ret}`\r\n },\r\n uploadRef () {\r\n return uuidv4()\r\n },\r\n fileSuffixIcon () {\r\n return {\r\n 'doc': { name: 'icon-doc' },\r\n }\r\n },\r\n fileIds () {\r\n const fileIds = this.files.map(file => {\r\n return file.response.data.fileID\r\n })\r\n return this.multiple ? fileIds : fileIds[0]\r\n }\r\n },\r\n methods: {\r\n handleClickDownload (file) {\r\n console.log('download file', file)\r\n },\r\n handleClickDelete (file) {\r\n this.$refs[this.uploadRef].remove(file)\r\n this.$emit('change', this.fileIds)\r\n },\r\n onWatchFiles (files) {\r\n this.files = files\r\n if (this.isFileUploadSuccessed) {\r\n this.$emit('change', this.fileIds)\r\n }\r\n },\r\n async saveToServerAsyncPage (payloads = {}) {\r\n net.post('zuul/api-file/workbench/file/temp/saveToServerAsyncPage', payloads, { \r\n headers: {\r\n 'Content-Type': 'multipart/form-data'\r\n }\r\n }).then(resp =>{\r\n const { data } = resp\r\n if (data !== 'saveToServerAsyncPage') {\r\n clearInterval(this.saveToServerAsyncPageTimer)\r\n }\r\n })\r\n // const ret = await net.post({\r\n // url: 'zuul/api-file/workbench/file/temp/saveToServerAsyncPage',\r\n // method: 'POST',\r\n // data: { ...payloads }\r\n // }).then(resp => {\r\n // const { data: { data, code, message } } = resp\r\n // if (code !== '2000') {\r\n // this.$Message.error(message)\r\n // return\r\n // }\r\n // if (data !== 'saveToServerAsyncPage') {\r\n // clearInterval(timer)\r\n // const { fileID, size } = data\r\n // this.$emit('on-success', { ...data, fileId: fileID })\r\n // this.$Message.success('同步成功')\r\n // return { fileId: fileID, size }\r\n // }\r\n // })\r\n // return ret\r\n },\r\n onWatchInputFiles (newFile, oldFile) {\r\n if (newFile && !oldFile) {\r\n // add file\r\n console.log('add', newFile)\r\n }\r\n if (newFile && oldFile) {\r\n // update file\r\n console.log('update', newFile)\r\n const { success, active, chunk, response } = newFile\r\n if (chunk && success && !active) {\r\n console.log('chunk end')\r\n const { data: { file, type } } = response\r\n const payloads = {\r\n filePath: file.match(/\\/cw(.*)/)[0],\r\n asyncID: uuidv4(),\r\n isDeleteOrigin: false,\r\n toImage: type === 'pdf' ? true : false,\r\n unzip: type === 'zip' ? true : false,\r\n _csrf: localStorage.getItem('token')\r\n }\r\n this.saveToServerAsyncPageTimer = setInterval(() => {\r\n this.saveToServerAsyncPage(payloads)\r\n }, 2000)\r\n }\r\n }\r\n if (!newFile && oldFile) {\r\n // delete file\r\n console.log('delete')\r\n }\r\n if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) {\r\n if (!this.$refs[this.uploadRef].active) {\r\n this.$refs[this.uploadRef].active = true\r\n }\r\n }\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n::v-deep .ele-upload__inner {\r\n opacity: 1 !important;\r\n cursor: pointer;\r\n border: 1px dashed var(--idooel-form-title-border-color);\r\n background: var(--idooel-form-upload-bg-color) !important;\r\n &:hover {\r\n border-color: var(--idooel-form-upload-border-hover-color);\r\n }\r\n border-radius: var(--idooel-form-border-radius);\r\n}\r\n.ele-upload__wrapper {\r\n width: 100%;\r\n .ele-upload__area {\r\n padding: 16px;\r\n width: 100%;\r\n height: 80px;\r\n display: flex;\r\n flex-direction: row;\r\n .ele-upload__area--icon {\r\n .anticon-cloud-upload {\r\n font-size: 48px;\r\n color: var(--idooel-primary-color);\r\n }\r\n }\r\n .ele-upload__area--text {\r\n margin-left: 16px;\r\n .ele-upload__message {\r\n font-size: 16px;\r\n color: var(--idoole-black-008);\r\n text-align: left;\r\n }\r\n .ele-upload__ext {\r\n text-align: left;\r\n font-size: 14px;\r\n color: var(--idoole-black-06);\r\n }\r\n }\r\n }\r\n .ele-files__wrapper {\r\n .ele-file__item {\r\n width: 100%;\r\n margin-top: 8px;\r\n padding: 8px 12px;\r\n border-radius: var(--idooel-form-border-radius);\r\n background: var(--idooel-form-upload-bg-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n .ele-file__suffix--icon {}\r\n .ele-file__name {\r\n flex: 1;\r\n text-align: left;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n font-size: 14px;\r\n margin-left: 8px;\r\n cursor: pointer;\r\n .ele-file__inner {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n }\r\n .ele-file__delete {\r\n margin-left: 8px;\r\n .ele-file__delete--icon {\r\n margin-left: 8px;\r\n cursor: pointer;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n</style>","::v-deep .ele-upload__inner {\n opacity: 1 !important;\n cursor: pointer;\n border: 1px dashed var(--idooel-form-title-border-color);\n background: var(--idooel-form-upload-bg-color) !important;\n border-radius: var(--idooel-form-border-radius);\n}\n::v-deep .ele-upload__inner:hover {\n border-color: var(--idooel-form-upload-border-hover-color);\n}\n\n.ele-upload__wrapper {\n width: 100%;\n}\n.ele-upload__wrapper .ele-upload__area {\n padding: 16px;\n width: 100%;\n height: 80px;\n display: flex;\n flex-direction: row;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n font-size: 48px;\n color: var(--idooel-primary-color);\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text {\n margin-left: 16px;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__message {\n font-size: 16px;\n color: var(--idoole-black-008);\n text-align: left;\n}\n.ele-upload__wrapper .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n text-align: left;\n font-size: 14px;\n color: var(--idoole-black-06);\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item {\n width: 100%;\n margin-top: 8px;\n padding: 8px 12px;\n border-radius: var(--idooel-form-border-radius);\n background: var(--idooel-form-upload-bg-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name {\n flex: 1;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n font-size: 14px;\n margin-left: 8px;\n cursor: pointer;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__name .ele-file__inner {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete {\n margin-left: 8px;\n}\n.ele-upload__wrapper .ele-files__wrapper .ele-file__item .ele-file__delete .ele-file__delete--icon {\n margin-left: 8px;\n cursor: pointer;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3252
3255
|
|
|
3253
3256
|
};
|
|
3254
3257
|
/* scoped */
|
|
3255
|
-
const __vue_scope_id__$
|
|
3258
|
+
const __vue_scope_id__$f = "data-v-7a628fc7";
|
|
3256
3259
|
/* module identifier */
|
|
3257
|
-
const __vue_module_identifier__$
|
|
3260
|
+
const __vue_module_identifier__$f = undefined;
|
|
3258
3261
|
/* functional template */
|
|
3259
|
-
const __vue_is_functional_template__$
|
|
3262
|
+
const __vue_is_functional_template__$f = false;
|
|
3260
3263
|
/* style inject SSR */
|
|
3261
3264
|
|
|
3262
3265
|
/* style inject shadow dom */
|
|
3263
3266
|
|
|
3264
3267
|
|
|
3265
3268
|
|
|
3266
|
-
const __vue_component__$
|
|
3267
|
-
{ render: __vue_render__$
|
|
3268
|
-
__vue_inject_styles__$
|
|
3269
|
-
__vue_script__$
|
|
3270
|
-
__vue_scope_id__$
|
|
3271
|
-
__vue_is_functional_template__$
|
|
3272
|
-
__vue_module_identifier__$
|
|
3269
|
+
const __vue_component__$f = /*#__PURE__*/normalizeComponent(
|
|
3270
|
+
{ render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f },
|
|
3271
|
+
__vue_inject_styles__$f,
|
|
3272
|
+
__vue_script__$f,
|
|
3273
|
+
__vue_scope_id__$f,
|
|
3274
|
+
__vue_is_functional_template__$f,
|
|
3275
|
+
__vue_module_identifier__$f,
|
|
3273
3276
|
false,
|
|
3274
3277
|
createInjector,
|
|
3275
3278
|
undefined,
|
|
@@ -3295,7 +3298,7 @@ __vue_render__$9._withStripped = true;
|
|
|
3295
3298
|
//
|
|
3296
3299
|
//
|
|
3297
3300
|
|
|
3298
|
-
var script$
|
|
3301
|
+
var script$e = {
|
|
3299
3302
|
name: 'ele-select-entity',
|
|
3300
3303
|
props: {
|
|
3301
3304
|
value: {
|
|
@@ -3352,10 +3355,10 @@ var script$8 = {
|
|
|
3352
3355
|
};
|
|
3353
3356
|
|
|
3354
3357
|
/* script */
|
|
3355
|
-
const __vue_script__$
|
|
3358
|
+
const __vue_script__$e = script$e;
|
|
3356
3359
|
|
|
3357
3360
|
/* template */
|
|
3358
|
-
var __vue_render__$
|
|
3361
|
+
var __vue_render__$e = function () {
|
|
3359
3362
|
var _vm = this;
|
|
3360
3363
|
var _h = _vm.$createElement;
|
|
3361
3364
|
var _c = _vm._self._c || _h;
|
|
@@ -3405,34 +3408,34 @@ var __vue_render__$8 = function () {
|
|
|
3405
3408
|
2
|
|
3406
3409
|
)
|
|
3407
3410
|
};
|
|
3408
|
-
var __vue_staticRenderFns__$
|
|
3409
|
-
__vue_render__$
|
|
3411
|
+
var __vue_staticRenderFns__$e = [];
|
|
3412
|
+
__vue_render__$e._withStripped = true;
|
|
3410
3413
|
|
|
3411
3414
|
/* style */
|
|
3412
|
-
const __vue_inject_styles__$
|
|
3415
|
+
const __vue_inject_styles__$e = function (inject) {
|
|
3413
3416
|
if (!inject) return
|
|
3414
3417
|
inject("data-v-328544bb_0", { source: ".g-select-entity__wrapper[data-v-328544bb] {\n font-size: 14px;\n line-height: 30px;\n position: relative;\n width: 100%;\n display: flex;\n color: var(--idoole-black-07);\n border-radius: 4px;\n border: 1px solid var(--idooel-form-title-border-color);\n}\n.g-select-entity__wrapper[data-v-328544bb]:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input[data-v-328544bb] {\n padding: 0 11px;\n background-color: #fff;\n border-radius: 4px;\n flex-grow: 1;\n min-height: 30px;\n text-align: left;\n}\n.g-select-entity__wrapper .select-entity__addon[data-v-328544bb] {\n padding: 0 11px;\n color: var(--idoole-black-07);\n background-color: var(--idoole-black-02);\n border-left: 1px solid var(--idooel-form-title-border-color);\n cursor: pointer;\n min-height: 30px;\n white-space: nowrap;\n}\n.has-error .g-select-entity__wrapper[data-v-328544bb] {\n border-color: var(--idooel-form-border-err-color);\n}\n.g-select-entity__disabled .select-entity__input[data-v-328544bb] {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\select-entity\\src\\index.vue","index.vue"],"names":[],"mappings":"AA6EA;EACA,eAAA;EACA,iBAAA;EACA,kBAAA;EACA,WAAA;EACA,aAAA;EACA,6BAAA;EACA,kBAAA;EACA,uDAAA;AC5EA;AD6EA;EACA,yCAAA;AC3EA;AD6EA;EACA,eAAA;EACA,sBAAA;EACA,kBAAA;EACA,YAAA;EACA,gBAAA;EACA,gBAAA;AC3EA;AD6EA;EACA,eAAA;EACA,6BAAA;EACA,wCAAA;EACA,4DAAA;EACA,eAAA;EACA,gBAAA;EACA,mBAAA;AC3EA;AD8EA;EACA,iDAAA;AC3EA;AD6EA;EACA,wCAAA;AC1EA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-select-entity__wrapper\" :class=\"disabled ? 'g-select-entity__disabled' : ''\">\r\n <span class=\"select-entity__input\">\r\n <a-tag\r\n v-for=\"(item, inx) in getValueList()\"\r\n :key=\"item.value\"\r\n :closable=\"!disabled && !getIsMaxCount()\"\r\n @close=\"onClose(...arguments, inx)\"\r\n >\r\n {{ item.label }}\r\n </a-tag>\r\n <a-tag v-if=\"getIsMaxCount()\">......</a-tag>\r\n </span>\r\n <span class=\"select-entity__addon\" @click=\"onChange\">{{ addonAfter }}</span>\r\n <slot></slot>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-select-entity',\r\n props: {\r\n value: {\r\n type: [Array, Object]\r\n },\r\n multiple: {\r\n type: Boolean,\r\n default: true\r\n },\r\n maxCount: {\r\n type: Number,\r\n default: 7\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n addonAfter: {\r\n type: String,\r\n default: '选择'\r\n }\r\n },\r\n methods: {\r\n getValueList () {\r\n if (this.value) {\r\n if (this.multiple) {\r\n return this.getIsMaxCount() ? this.value.slice(0, this.maxCount) : this.value\r\n }\r\n return [this.value]\r\n }\r\n return []\r\n },\r\n getIsMaxCount () {\r\n if (this.value && this.multiple) {\r\n return this.value.length >= this.maxCount\r\n }\r\n return false\r\n },\r\n onChange () {\r\n if (this.disabled) return\r\n this.$emit('change', this.value)\r\n },\r\n onClose (e, inx) {\r\n e = window.event || e\r\n e.preventDefault()\r\n if (!this.multiple) {\r\n this.$emit('change', null)\r\n return\r\n }\r\n this.value.splice(inx, 1)\r\n this.$emit('change', this.value)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-select-entity__wrapper {\r\n font-size: 14px;\r\n line-height: 30px;\r\n position: relative;\r\n width: 100%;\r\n display: flex;\r\n color: var(--idoole-black-07);\r\n border-radius: 4px;\r\n border: 1px solid var(--idooel-form-title-border-color);\r\n &:hover {\r\n border-color: var(--idooel-primary-color);\r\n }\r\n .select-entity__input {\r\n padding: 0 11px;\r\n background-color: #fff;\r\n border-radius: 4px;\r\n flex-grow: 1;\r\n min-height: 30px;\r\n text-align: left;\r\n }\r\n .select-entity__addon {\r\n padding: 0 11px;\r\n color: var(--idoole-black-07);\r\n background-color: var(--idoole-black-02);\r\n border-left: 1px solid var(--idooel-form-title-border-color);\r\n cursor: pointer;\r\n min-height: 30px;\r\n white-space: nowrap;\r\n }\r\n}\r\n.has-error .g-select-entity__wrapper {\r\n border-color: var(--idooel-form-border-err-color);\r\n}\r\n.g-select-entity__disabled .select-entity__input {\r\n background-color: var(--idoole-black-02);\r\n}\r\n</style>",".g-select-entity__wrapper {\n font-size: 14px;\n line-height: 30px;\n position: relative;\n width: 100%;\n display: flex;\n color: var(--idoole-black-07);\n border-radius: 4px;\n border: 1px solid var(--idooel-form-title-border-color);\n}\n.g-select-entity__wrapper:hover {\n border-color: var(--idooel-primary-color);\n}\n.g-select-entity__wrapper .select-entity__input {\n padding: 0 11px;\n background-color: #fff;\n border-radius: 4px;\n flex-grow: 1;\n min-height: 30px;\n text-align: left;\n}\n.g-select-entity__wrapper .select-entity__addon {\n padding: 0 11px;\n color: var(--idoole-black-07);\n background-color: var(--idoole-black-02);\n border-left: 1px solid var(--idooel-form-title-border-color);\n cursor: pointer;\n min-height: 30px;\n white-space: nowrap;\n}\n\n.has-error .g-select-entity__wrapper {\n border-color: var(--idooel-form-border-err-color);\n}\n\n.g-select-entity__disabled .select-entity__input {\n background-color: var(--idoole-black-02);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3415
3418
|
|
|
3416
3419
|
};
|
|
3417
3420
|
/* scoped */
|
|
3418
|
-
const __vue_scope_id__$
|
|
3421
|
+
const __vue_scope_id__$e = "data-v-328544bb";
|
|
3419
3422
|
/* module identifier */
|
|
3420
|
-
const __vue_module_identifier__$
|
|
3423
|
+
const __vue_module_identifier__$e = undefined;
|
|
3421
3424
|
/* functional template */
|
|
3422
|
-
const __vue_is_functional_template__$
|
|
3425
|
+
const __vue_is_functional_template__$e = false;
|
|
3423
3426
|
/* style inject SSR */
|
|
3424
3427
|
|
|
3425
3428
|
/* style inject shadow dom */
|
|
3426
3429
|
|
|
3427
3430
|
|
|
3428
3431
|
|
|
3429
|
-
const __vue_component__$
|
|
3430
|
-
{ render: __vue_render__$
|
|
3431
|
-
__vue_inject_styles__$
|
|
3432
|
-
__vue_script__$
|
|
3433
|
-
__vue_scope_id__$
|
|
3434
|
-
__vue_is_functional_template__$
|
|
3435
|
-
__vue_module_identifier__$
|
|
3432
|
+
const __vue_component__$e = /*#__PURE__*/normalizeComponent(
|
|
3433
|
+
{ render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e },
|
|
3434
|
+
__vue_inject_styles__$e,
|
|
3435
|
+
__vue_script__$e,
|
|
3436
|
+
__vue_scope_id__$e,
|
|
3437
|
+
__vue_is_functional_template__$e,
|
|
3438
|
+
__vue_module_identifier__$e,
|
|
3436
3439
|
false,
|
|
3437
3440
|
createInjector,
|
|
3438
3441
|
undefined,
|
|
@@ -3446,7 +3449,7 @@ __vue_render__$8._withStripped = true;
|
|
|
3446
3449
|
//
|
|
3447
3450
|
//
|
|
3448
3451
|
|
|
3449
|
-
var script$
|
|
3452
|
+
var script$d = {
|
|
3450
3453
|
name: 'ele-input-number',
|
|
3451
3454
|
props: {
|
|
3452
3455
|
precision: {
|
|
@@ -3464,10 +3467,10 @@ var script$7 = {
|
|
|
3464
3467
|
};
|
|
3465
3468
|
|
|
3466
3469
|
/* script */
|
|
3467
|
-
const __vue_script__$
|
|
3470
|
+
const __vue_script__$d = script$d;
|
|
3468
3471
|
|
|
3469
3472
|
/* template */
|
|
3470
|
-
var __vue_render__$
|
|
3473
|
+
var __vue_render__$d = function () {
|
|
3471
3474
|
var _vm = this;
|
|
3472
3475
|
var _h = _vm.$createElement;
|
|
3473
3476
|
var _c = _vm._self._c || _h;
|
|
@@ -3491,17 +3494,17 @@ var __vue_render__$7 = function () {
|
|
|
3491
3494
|
1
|
|
3492
3495
|
)
|
|
3493
3496
|
};
|
|
3494
|
-
var __vue_staticRenderFns__$
|
|
3495
|
-
__vue_render__$
|
|
3497
|
+
var __vue_staticRenderFns__$d = [];
|
|
3498
|
+
__vue_render__$d._withStripped = true;
|
|
3496
3499
|
|
|
3497
3500
|
/* style */
|
|
3498
|
-
const __vue_inject_styles__$
|
|
3501
|
+
const __vue_inject_styles__$d = undefined;
|
|
3499
3502
|
/* scoped */
|
|
3500
|
-
const __vue_scope_id__$
|
|
3503
|
+
const __vue_scope_id__$d = undefined;
|
|
3501
3504
|
/* module identifier */
|
|
3502
|
-
const __vue_module_identifier__$
|
|
3505
|
+
const __vue_module_identifier__$d = undefined;
|
|
3503
3506
|
/* functional template */
|
|
3504
|
-
const __vue_is_functional_template__$
|
|
3507
|
+
const __vue_is_functional_template__$d = false;
|
|
3505
3508
|
/* style inject */
|
|
3506
3509
|
|
|
3507
3510
|
/* style inject SSR */
|
|
@@ -3510,13 +3513,13 @@ __vue_render__$7._withStripped = true;
|
|
|
3510
3513
|
|
|
3511
3514
|
|
|
3512
3515
|
|
|
3513
|
-
const __vue_component__$
|
|
3514
|
-
{ render: __vue_render__$
|
|
3515
|
-
__vue_inject_styles__$
|
|
3516
|
-
__vue_script__$
|
|
3517
|
-
__vue_scope_id__$
|
|
3518
|
-
__vue_is_functional_template__$
|
|
3519
|
-
__vue_module_identifier__$
|
|
3516
|
+
const __vue_component__$d = /*#__PURE__*/normalizeComponent(
|
|
3517
|
+
{ render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d },
|
|
3518
|
+
__vue_inject_styles__$d,
|
|
3519
|
+
__vue_script__$d,
|
|
3520
|
+
__vue_scope_id__$d,
|
|
3521
|
+
__vue_is_functional_template__$d,
|
|
3522
|
+
__vue_module_identifier__$d,
|
|
3520
3523
|
false,
|
|
3521
3524
|
undefined,
|
|
3522
3525
|
undefined,
|
|
@@ -3528,7 +3531,7 @@ __vue_render__$7._withStripped = true;
|
|
|
3528
3531
|
//
|
|
3529
3532
|
//
|
|
3530
3533
|
|
|
3531
|
-
var script$
|
|
3534
|
+
var script$c = {
|
|
3532
3535
|
name: 'ele-checkbox',
|
|
3533
3536
|
props: {
|
|
3534
3537
|
value: {
|
|
@@ -3552,10 +3555,10 @@ var script$6 = {
|
|
|
3552
3555
|
};
|
|
3553
3556
|
|
|
3554
3557
|
/* script */
|
|
3555
|
-
const __vue_script__$
|
|
3558
|
+
const __vue_script__$c = script$c;
|
|
3556
3559
|
|
|
3557
3560
|
/* template */
|
|
3558
|
-
var __vue_render__$
|
|
3561
|
+
var __vue_render__$c = function () {
|
|
3559
3562
|
var _vm = this;
|
|
3560
3563
|
var _h = _vm.$createElement;
|
|
3561
3564
|
var _c = _vm._self._c || _h;
|
|
@@ -3568,34 +3571,34 @@ var __vue_render__$6 = function () {
|
|
|
3568
3571
|
on: { change: _vm.onChange },
|
|
3569
3572
|
})
|
|
3570
3573
|
};
|
|
3571
|
-
var __vue_staticRenderFns__$
|
|
3572
|
-
__vue_render__$
|
|
3574
|
+
var __vue_staticRenderFns__$c = [];
|
|
3575
|
+
__vue_render__$c._withStripped = true;
|
|
3573
3576
|
|
|
3574
3577
|
/* style */
|
|
3575
|
-
const __vue_inject_styles__$
|
|
3578
|
+
const __vue_inject_styles__$c = function (inject) {
|
|
3576
3579
|
if (!inject) return
|
|
3577
3580
|
inject("data-v-63b1b120_0", { source: ".ant-checkbox-group[data-v-63b1b120] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-checkbox-group[data-v-63b1b120] .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group[data-v-63b1b120] .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\checkbox\\src\\index.vue","index.vue"],"names":[],"mappings":"AA6BA;EACA,gBAAA;EACA,iBAAA;AC5BA;ADgCA;EACA,0CAAA;AC7BA;AD+BA;EACA,iDAAA;AC7BA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <a-checkbox-group :options=\"dataSource\" :disabled=\"disabled\" :defaultValue=\"value\" @change=\"onChange\"></a-checkbox-group>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-checkbox',\r\n props: {\r\n value: {\r\n type: Array\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n methods: {\r\n onChange (value) {\r\n this.$emit('change', value)\r\n this.$emit('input', value)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ant-checkbox-group {\r\n text-align: left;\r\n line-height: 32px;\r\n}\r\n.has-error {\r\n .ant-checkbox-group {\r\n ::v-deep .ant-checkbox-wrapper {\r\n color: var(--idooel-form-border-err-color);\r\n }\r\n ::v-deep .ant-checkbox-inner {\r\n border-color: var(--idooel-form-border-err-color);\r\n }\r\n }\r\n}\r\n</style>",".ant-checkbox-group {\n text-align: left;\n line-height: 32px;\n}\n\n.has-error .ant-checkbox-group ::v-deep .ant-checkbox-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-checkbox-group ::v-deep .ant-checkbox-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3578
3581
|
|
|
3579
3582
|
};
|
|
3580
3583
|
/* scoped */
|
|
3581
|
-
const __vue_scope_id__$
|
|
3584
|
+
const __vue_scope_id__$c = "data-v-63b1b120";
|
|
3582
3585
|
/* module identifier */
|
|
3583
|
-
const __vue_module_identifier__$
|
|
3586
|
+
const __vue_module_identifier__$c = undefined;
|
|
3584
3587
|
/* functional template */
|
|
3585
|
-
const __vue_is_functional_template__$
|
|
3588
|
+
const __vue_is_functional_template__$c = false;
|
|
3586
3589
|
/* style inject SSR */
|
|
3587
3590
|
|
|
3588
3591
|
/* style inject shadow dom */
|
|
3589
3592
|
|
|
3590
3593
|
|
|
3591
3594
|
|
|
3592
|
-
const __vue_component__$
|
|
3593
|
-
{ render: __vue_render__$
|
|
3594
|
-
__vue_inject_styles__$
|
|
3595
|
-
__vue_script__$
|
|
3596
|
-
__vue_scope_id__$
|
|
3597
|
-
__vue_is_functional_template__$
|
|
3598
|
-
__vue_module_identifier__$
|
|
3595
|
+
const __vue_component__$c = /*#__PURE__*/normalizeComponent(
|
|
3596
|
+
{ render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c },
|
|
3597
|
+
__vue_inject_styles__$c,
|
|
3598
|
+
__vue_script__$c,
|
|
3599
|
+
__vue_scope_id__$c,
|
|
3600
|
+
__vue_is_functional_template__$c,
|
|
3601
|
+
__vue_module_identifier__$c,
|
|
3599
3602
|
false,
|
|
3600
3603
|
createInjector,
|
|
3601
3604
|
undefined,
|
|
@@ -3611,8 +3614,12 @@ __vue_render__$6._withStripped = true;
|
|
|
3611
3614
|
//
|
|
3612
3615
|
//
|
|
3613
3616
|
|
|
3614
|
-
var script$
|
|
3617
|
+
var script$b = {
|
|
3615
3618
|
name: 'ele-radio',
|
|
3619
|
+
model: {
|
|
3620
|
+
prop: 'value',
|
|
3621
|
+
event: 'change'
|
|
3622
|
+
},
|
|
3616
3623
|
props: {
|
|
3617
3624
|
value: {
|
|
3618
3625
|
type: [String, Array, Number]
|
|
@@ -3635,17 +3642,17 @@ var script$5 = {
|
|
|
3635
3642
|
};
|
|
3636
3643
|
|
|
3637
3644
|
/* script */
|
|
3638
|
-
const __vue_script__$
|
|
3645
|
+
const __vue_script__$b = script$b;
|
|
3639
3646
|
|
|
3640
3647
|
/* template */
|
|
3641
|
-
var __vue_render__$
|
|
3648
|
+
var __vue_render__$b = function () {
|
|
3642
3649
|
var _vm = this;
|
|
3643
3650
|
var _h = _vm.$createElement;
|
|
3644
3651
|
var _c = _vm._self._c || _h;
|
|
3645
3652
|
return _c(
|
|
3646
3653
|
"a-radio-group",
|
|
3647
3654
|
{
|
|
3648
|
-
attrs: {
|
|
3655
|
+
attrs: { value: _vm.value, disabled: _vm.disabled },
|
|
3649
3656
|
on: { change: _vm.onChange },
|
|
3650
3657
|
},
|
|
3651
3658
|
_vm._l(_vm.dataSource, function (item) {
|
|
@@ -3656,34 +3663,34 @@ var __vue_render__$5 = function () {
|
|
|
3656
3663
|
1
|
|
3657
3664
|
)
|
|
3658
3665
|
};
|
|
3659
|
-
var __vue_staticRenderFns__$
|
|
3660
|
-
__vue_render__$
|
|
3666
|
+
var __vue_staticRenderFns__$b = [];
|
|
3667
|
+
__vue_render__$b._withStripped = true;
|
|
3661
3668
|
|
|
3662
3669
|
/* style */
|
|
3663
|
-
const __vue_inject_styles__$
|
|
3670
|
+
const __vue_inject_styles__$b = function (inject) {
|
|
3664
3671
|
if (!inject) return
|
|
3665
|
-
inject("data-v-
|
|
3672
|
+
inject("data-v-14b69fc8_0", { source: ".ant-radio-group[data-v-14b69fc8] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-radio-group[data-v-14b69fc8] .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group[data-v-14b69fc8] .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\radio\\src\\index.vue","index.vue"],"names":[],"mappings":"AAqCA;EACA,gBAAA;EACA,iBAAA;ACpCA;ADwCA;EACA,0CAAA;ACrCA;ADuCA;EACA,iDAAA;ACrCA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <a-radio-group :value=\"value\" @change=\"onChange\" :disabled=\"disabled\">\r\n <a-radio v-for=\"item in dataSource\" :key=\"item.value\" :value=\"item.value\">\r\n {{ item.label }}\r\n </a-radio>\r\n </a-radio-group>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-radio',\r\n model: {\r\n prop: 'value',\r\n event: 'change'\r\n },\r\n props: {\r\n value: {\r\n type: [String, Array, Number]\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n methods: {\r\n onChange (e) {\r\n this.$emit('change', e.target.value)\r\n this.$emit('input', e.target.value)\r\n }\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.ant-radio-group {\r\n text-align: left;\r\n line-height: 32px;\r\n}\r\n.has-error {\r\n .ant-radio-group {\r\n ::v-deep .ant-radio-wrapper {\r\n color: var(--idooel-form-border-err-color);\r\n }\r\n ::v-deep .ant-radio-inner {\r\n border-color: var(--idooel-form-border-err-color);\r\n }\r\n }\r\n}\r\n</style>",".ant-radio-group {\n text-align: left;\n line-height: 32px;\n}\n\n.has-error .ant-radio-group ::v-deep .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group ::v-deep .ant-radio-inner {\n border-color: var(--idooel-form-border-err-color);\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3666
3673
|
|
|
3667
3674
|
};
|
|
3668
3675
|
/* scoped */
|
|
3669
|
-
const __vue_scope_id__$
|
|
3676
|
+
const __vue_scope_id__$b = "data-v-14b69fc8";
|
|
3670
3677
|
/* module identifier */
|
|
3671
|
-
const __vue_module_identifier__$
|
|
3678
|
+
const __vue_module_identifier__$b = undefined;
|
|
3672
3679
|
/* functional template */
|
|
3673
|
-
const __vue_is_functional_template__$
|
|
3680
|
+
const __vue_is_functional_template__$b = false;
|
|
3674
3681
|
/* style inject SSR */
|
|
3675
3682
|
|
|
3676
3683
|
/* style inject shadow dom */
|
|
3677
3684
|
|
|
3678
3685
|
|
|
3679
3686
|
|
|
3680
|
-
const __vue_component__$
|
|
3681
|
-
{ render: __vue_render__$
|
|
3682
|
-
__vue_inject_styles__$
|
|
3683
|
-
__vue_script__$
|
|
3684
|
-
__vue_scope_id__$
|
|
3685
|
-
__vue_is_functional_template__$
|
|
3686
|
-
__vue_module_identifier__$
|
|
3687
|
+
const __vue_component__$b = /*#__PURE__*/normalizeComponent(
|
|
3688
|
+
{ render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b },
|
|
3689
|
+
__vue_inject_styles__$b,
|
|
3690
|
+
__vue_script__$b,
|
|
3691
|
+
__vue_scope_id__$b,
|
|
3692
|
+
__vue_is_functional_template__$b,
|
|
3693
|
+
__vue_module_identifier__$b,
|
|
3687
3694
|
false,
|
|
3688
3695
|
createInjector,
|
|
3689
3696
|
undefined,
|
|
@@ -3691,38 +3698,94 @@ __vue_render__$5._withStripped = true;
|
|
|
3691
3698
|
);
|
|
3692
3699
|
|
|
3693
3700
|
//
|
|
3694
|
-
var script$
|
|
3701
|
+
var script$a = {
|
|
3695
3702
|
name: 'ele-form',
|
|
3696
3703
|
components: {
|
|
3697
|
-
EleSelect: __vue_component__$
|
|
3698
|
-
EleInput: __vue_component__$
|
|
3699
|
-
EleTextarea: __vue_component__$
|
|
3700
|
-
EleUpload: __vue_component__$
|
|
3701
|
-
EleSelectEntity: __vue_component__$
|
|
3702
|
-
EleInputNumber: __vue_component__$
|
|
3703
|
-
EleCheckbox: __vue_component__$
|
|
3704
|
-
EleRadio: __vue_component__$
|
|
3704
|
+
EleSelect: __vue_component__$p,
|
|
3705
|
+
EleInput: __vue_component__$q,
|
|
3706
|
+
EleTextarea: __vue_component__$h,
|
|
3707
|
+
EleUpload: __vue_component__$f,
|
|
3708
|
+
EleSelectEntity: __vue_component__$e,
|
|
3709
|
+
EleInputNumber: __vue_component__$d,
|
|
3710
|
+
EleCheckbox: __vue_component__$c,
|
|
3711
|
+
EleRadio: __vue_component__$b
|
|
3705
3712
|
},
|
|
3706
3713
|
props: {
|
|
3714
|
+
formName: {
|
|
3715
|
+
type: [Number, String],
|
|
3716
|
+
default: 'coordinated'
|
|
3717
|
+
},
|
|
3707
3718
|
elements: {
|
|
3708
3719
|
type: Array,
|
|
3709
3720
|
default: () => []
|
|
3710
3721
|
}
|
|
3711
3722
|
},
|
|
3712
3723
|
data() {
|
|
3713
|
-
return {
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3724
|
+
return {};
|
|
3725
|
+
},
|
|
3726
|
+
computed: {
|
|
3727
|
+
form() {
|
|
3728
|
+
return this.$form.createForm(this, {
|
|
3729
|
+
name: this.formName
|
|
3730
|
+
});
|
|
3731
|
+
},
|
|
3732
|
+
exposedMethods() {
|
|
3733
|
+
return {
|
|
3734
|
+
setFieldsValue: this.setFieldsValue,
|
|
3735
|
+
getFieldsValue: this.getFieldsValue
|
|
3736
|
+
};
|
|
3737
|
+
}
|
|
3719
3738
|
},
|
|
3720
3739
|
methods: {
|
|
3721
|
-
|
|
3740
|
+
evalDisabledExpression() {
|
|
3741
|
+
this.elements.forEach(ele => {
|
|
3742
|
+
const {
|
|
3743
|
+
disabled
|
|
3744
|
+
} = ele;
|
|
3745
|
+
const ret = this.executeExpression(disabled);
|
|
3746
|
+
this.$set(ele, '_disabled', ret);
|
|
3747
|
+
});
|
|
3748
|
+
},
|
|
3749
|
+
executeExpression(expression) {
|
|
3750
|
+
if (type.isBool(expression)) return expression;
|
|
3751
|
+
if (type.isEmpty(expression)) return false;
|
|
3752
|
+
return parse(expression, {
|
|
3753
|
+
...this.getFieldsValue()
|
|
3754
|
+
});
|
|
3755
|
+
},
|
|
3756
|
+
onChange(value, props) {
|
|
3757
|
+
const {
|
|
3758
|
+
name
|
|
3759
|
+
} = props;
|
|
3722
3760
|
this.setFieldsValue({
|
|
3723
|
-
[
|
|
3761
|
+
[name]: value
|
|
3762
|
+
});
|
|
3763
|
+
this.evalDisabledExpression();
|
|
3764
|
+
this.$emit('change', {
|
|
3765
|
+
value,
|
|
3766
|
+
props,
|
|
3767
|
+
exposed: {
|
|
3768
|
+
...this.exposedMethods
|
|
3769
|
+
}
|
|
3724
3770
|
});
|
|
3725
3771
|
},
|
|
3772
|
+
collectDefaultValues() {
|
|
3773
|
+
const ret = this.elements.reduce((ret, props) => {
|
|
3774
|
+
const {
|
|
3775
|
+
name,
|
|
3776
|
+
defaultValue
|
|
3777
|
+
} = props;
|
|
3778
|
+
if (defaultValue) {
|
|
3779
|
+
ret[name] = defaultValue;
|
|
3780
|
+
}
|
|
3781
|
+
return ret;
|
|
3782
|
+
}, {});
|
|
3783
|
+
return ret;
|
|
3784
|
+
},
|
|
3785
|
+
setDefaultValues() {
|
|
3786
|
+
const defaultValues = this.collectDefaultValues();
|
|
3787
|
+
this.setFieldsValue(defaultValues);
|
|
3788
|
+
},
|
|
3726
3789
|
validateFields() {
|
|
3727
3790
|
let ret = false;
|
|
3728
3791
|
this.form.validateFields((error, values) => {
|
|
@@ -3736,14 +3799,18 @@ var script$4 = {
|
|
|
3736
3799
|
getFieldsValue() {
|
|
3737
3800
|
return this.form.getFieldsValue();
|
|
3738
3801
|
}
|
|
3802
|
+
},
|
|
3803
|
+
mounted() {
|
|
3804
|
+
this.setDefaultValues();
|
|
3805
|
+
this.evalDisabledExpression();
|
|
3739
3806
|
}
|
|
3740
3807
|
};
|
|
3741
3808
|
|
|
3742
3809
|
/* script */
|
|
3743
|
-
const __vue_script__$
|
|
3810
|
+
const __vue_script__$a = script$a;
|
|
3744
3811
|
|
|
3745
3812
|
/* template */
|
|
3746
|
-
var __vue_render__$
|
|
3813
|
+
var __vue_render__$a = function () {
|
|
3747
3814
|
var _vm = this;
|
|
3748
3815
|
var _h = _vm.$createElement;
|
|
3749
3816
|
var _c = _vm._self._c || _h;
|
|
@@ -3783,7 +3850,15 @@ var __vue_render__$4 = function () {
|
|
|
3783
3850
|
},
|
|
3784
3851
|
],
|
|
3785
3852
|
staticStyle: { width: "100%" },
|
|
3786
|
-
attrs: {
|
|
3853
|
+
attrs: {
|
|
3854
|
+
disabled: _vm.executeExpression(ele._disabled),
|
|
3855
|
+
"max-length": ele.maxLength,
|
|
3856
|
+
},
|
|
3857
|
+
on: {
|
|
3858
|
+
change: function ($event) {
|
|
3859
|
+
return _vm.onChange($event, ele)
|
|
3860
|
+
},
|
|
3861
|
+
},
|
|
3787
3862
|
}),
|
|
3788
3863
|
],
|
|
3789
3864
|
1
|
|
@@ -3809,12 +3884,13 @@ var __vue_render__$4 = function () {
|
|
|
3809
3884
|
attrs: {
|
|
3810
3885
|
"max-length": ele.maxLength,
|
|
3811
3886
|
autosize: ele.autosize,
|
|
3887
|
+
disabled: _vm.executeExpression(ele._disabled),
|
|
3812
3888
|
"allow-clear": ele.allowClear,
|
|
3813
3889
|
placeholder: ele.placeholder,
|
|
3814
3890
|
},
|
|
3815
3891
|
on: {
|
|
3816
|
-
|
|
3817
|
-
return _vm.
|
|
3892
|
+
change: function ($event) {
|
|
3893
|
+
return _vm.onChange($event, ele)
|
|
3818
3894
|
},
|
|
3819
3895
|
},
|
|
3820
3896
|
}),
|
|
@@ -3839,7 +3915,14 @@ var __vue_render__$4 = function () {
|
|
|
3839
3915
|
},
|
|
3840
3916
|
],
|
|
3841
3917
|
staticStyle: { width: "100%" },
|
|
3842
|
-
attrs: {
|
|
3918
|
+
attrs: {
|
|
3919
|
+
"data-source": ele.optionList,
|
|
3920
|
+
disabled: _vm.executeExpression(ele._disabled),
|
|
3921
|
+
multiple: ele.multiple,
|
|
3922
|
+
mode: ele.mode,
|
|
3923
|
+
code: ele.code,
|
|
3924
|
+
params: ele.params,
|
|
3925
|
+
},
|
|
3843
3926
|
}),
|
|
3844
3927
|
],
|
|
3845
3928
|
1
|
|
@@ -3867,6 +3950,31 @@ var __vue_render__$4 = function () {
|
|
|
3867
3950
|
1
|
|
3868
3951
|
),
|
|
3869
3952
|
]
|
|
3953
|
+
: ele.type == "ele-date-range"
|
|
3954
|
+
? [
|
|
3955
|
+
_c(
|
|
3956
|
+
"a-form-item",
|
|
3957
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3958
|
+
[
|
|
3959
|
+
_c("ele-date-range", {
|
|
3960
|
+
directives: [
|
|
3961
|
+
{
|
|
3962
|
+
name: "decorator",
|
|
3963
|
+
rawName: "v-decorator",
|
|
3964
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3965
|
+
expression:
|
|
3966
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3967
|
+
},
|
|
3968
|
+
],
|
|
3969
|
+
staticStyle: { width: "100%" },
|
|
3970
|
+
attrs: {
|
|
3971
|
+
disabled: _vm.executeExpression(ele._disabled),
|
|
3972
|
+
},
|
|
3973
|
+
}),
|
|
3974
|
+
],
|
|
3975
|
+
1
|
|
3976
|
+
),
|
|
3977
|
+
]
|
|
3870
3978
|
: ele.type == "SelectEntity"
|
|
3871
3979
|
? [
|
|
3872
3980
|
_c(
|
|
@@ -3909,7 +4017,17 @@ var __vue_render__$4 = function () {
|
|
|
3909
4017
|
},
|
|
3910
4018
|
],
|
|
3911
4019
|
staticStyle: { width: "100%" },
|
|
3912
|
-
attrs: {
|
|
4020
|
+
attrs: {
|
|
4021
|
+
precision: ele.precision,
|
|
4022
|
+
disabled: _vm.executeExpression(
|
|
4023
|
+
ele._disabled
|
|
4024
|
+
),
|
|
4025
|
+
},
|
|
4026
|
+
on: {
|
|
4027
|
+
change: function ($event) {
|
|
4028
|
+
return _vm.onChange($event, ele)
|
|
4029
|
+
},
|
|
4030
|
+
},
|
|
3913
4031
|
},
|
|
3914
4032
|
"ele-input-number",
|
|
3915
4033
|
ele.props,
|
|
@@ -3937,7 +4055,10 @@ var __vue_render__$4 = function () {
|
|
|
3937
4055
|
},
|
|
3938
4056
|
],
|
|
3939
4057
|
staticStyle: { width: "100%" },
|
|
3940
|
-
attrs: {
|
|
4058
|
+
attrs: {
|
|
4059
|
+
"data-source": ele.optionList,
|
|
4060
|
+
disabled: _vm.executeExpression(ele._disabled),
|
|
4061
|
+
},
|
|
3941
4062
|
}),
|
|
3942
4063
|
],
|
|
3943
4064
|
1
|
|
@@ -3960,7 +4081,15 @@ var __vue_render__$4 = function () {
|
|
|
3960
4081
|
},
|
|
3961
4082
|
],
|
|
3962
4083
|
staticStyle: { width: "100%" },
|
|
3963
|
-
attrs: {
|
|
4084
|
+
attrs: {
|
|
4085
|
+
disabled: _vm.executeExpression(ele._disabled),
|
|
4086
|
+
"data-source": ele.optionList,
|
|
4087
|
+
},
|
|
4088
|
+
on: {
|
|
4089
|
+
change: function ($event) {
|
|
4090
|
+
return _vm.onChange($event, ele)
|
|
4091
|
+
},
|
|
4092
|
+
},
|
|
3964
4093
|
}),
|
|
3965
4094
|
],
|
|
3966
4095
|
1
|
|
@@ -3980,42 +4109,1090 @@ var __vue_render__$4 = function () {
|
|
|
3980
4109
|
1
|
|
3981
4110
|
)
|
|
3982
4111
|
};
|
|
3983
|
-
var __vue_staticRenderFns__$
|
|
3984
|
-
__vue_render__$
|
|
4112
|
+
var __vue_staticRenderFns__$a = [];
|
|
4113
|
+
__vue_render__$a._withStripped = true;
|
|
4114
|
+
|
|
4115
|
+
/* style */
|
|
4116
|
+
const __vue_inject_styles__$a = function (inject) {
|
|
4117
|
+
if (!inject) return
|
|
4118
|
+
inject("data-v-39771dfa_0", { source: ".ele__form--wrapper[data-v-39771dfa] {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\form\\src\\index.vue","index.vue"],"names":[],"mappings":"AA+MA;EACA,gBAAA;AC9MA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele__form--wrapper\">\r\n <a-form :form=\"form\" layout=\"vertical\" class=\"ant-advanced-search-form\">\r\n <a-row :gutter=\"24\">\r\n <a-col :span=\"ele.span\" v-for=\"ele in elements\" :key=\"ele.name\">\r\n <template v-if=\"ele.type == 'Input'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-input \r\n @change=\"onChange($event, ele)\" \r\n :disabled=\"executeExpression(ele._disabled)\" \r\n :max-length=\"ele.maxLength\" \r\n v-decorator=\"[ele.name, { rules: ele.rules }]\" \r\n style=\"width:100%;\">\r\n </ele-input>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'Textarea'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-textarea \r\n @change=\"onChange($event, ele)\"\r\n :max-length=\"ele.maxLength\"\r\n :autosize=\"ele.autosize\"\r\n :disabled=\"executeExpression(ele._disabled)\"\r\n :allow-clear=\"ele.allowClear\"\r\n :placeholder=\"ele.placeholder\"\r\n v-decorator=\"[ele.name, { rules: ele.rules }]\"\r\n style=\"width:100%;\">\r\n </ele-textarea>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'Select'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-select \r\n :data-source=\"ele.optionList\" \r\n :disabled=\"executeExpression(ele._disabled)\"\r\n :multiple=\"ele.multiple\"\r\n :mode=\"ele.mode\"\r\n :code=\"ele.code\" \r\n :params=\"ele.params\" \r\n v-decorator=\"[ele.name, { rules: ele.rules }]\" \r\n style=\"width:100%;\">\r\n </ele-select>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'ele-upload'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-upload v-decorator=\"[ele.name, { rules: ele.rules }]\" style=\"width:100%;\"></ele-upload>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'ele-date-range'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-date-range \r\n :disabled=\"executeExpression(ele._disabled)\" \r\n v-decorator=\"[ele.name, { rules: ele.rules }]\" \r\n style=\"width:100%;\">\r\n </ele-date-range>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'SelectEntity'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-select-entity \r\n v-decorator=\"[ele.name, { rules: ele.rules }]\" \r\n style=\"width:100%;\">\r\n </ele-select-entity>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'InputNumber'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-input-number \r\n @change=\"onChange($event, ele)\" \r\n :precision=\"ele.precision\" \r\n :disabled=\"executeExpression(ele._disabled)\" \r\n v-decorator=\"[ele.name, { rules: ele.rules }]\" \r\n v-bind=\"ele.props\" \r\n style=\"width:100%;\">\r\n </ele-input-number>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'Checkbox'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-checkbox \r\n :data-source=\"ele.optionList\" \r\n :disabled=\"executeExpression(ele._disabled)\" \r\n v-decorator=\"[ele.name, { rules: ele.rules }]\" \r\n style=\"width:100%;\">\r\n </ele-checkbox>\r\n </a-form-item>\r\n </template>\r\n <template v-else-if=\"ele.type == 'Radio'\">\r\n <a-form-item :label=\"`${ele.label}:`\">\r\n <ele-radio \r\n @change=\"onChange($event, ele)\" \r\n :disabled=\"executeExpression(ele._disabled)\" \r\n :data-source=\"ele.optionList\" \r\n v-decorator=\"[ele.name, { rules: ele.rules }]\" \r\n style=\"width:100%;\">\r\n </ele-radio>\r\n </a-form-item>\r\n </template>\r\n </a-col>\r\n </a-row>\r\n </a-form>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleSelect from '../../select/src/index.vue'\r\nimport EleInput from '../../input/src/index.vue'\r\nimport EleTextarea from '../../textarea/src/index.vue'\r\nimport EleUpload from '../../upload/src/index.vue'\r\nimport EleSelectEntity from '../../select-entity/src/index.vue'\r\nimport EleInputNumber from '../../input-number/src/index.vue'\r\nimport EleCheckbox from '../../checkbox/src/index.vue'\r\nimport EleRadio from '../../radio/src/index.vue'\r\nimport { parse } from '@idooel/expression'\r\nimport { type } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-form',\r\n components: {\r\n EleSelect,\r\n EleInput,\r\n EleTextarea,\r\n EleUpload,\r\n EleSelectEntity,\r\n EleInputNumber,\r\n EleCheckbox,\r\n EleRadio\r\n },\r\n props: {\r\n formName: {\r\n type: [Number, String],\r\n default: 'coordinated'\r\n },\r\n elements: {\r\n type: Array,\r\n default: () => []\r\n }\r\n },\r\n data () {\r\n return {}\r\n },\r\n computed: {\r\n form () {\r\n return this.$form.createForm(this, { name: this.formName })\r\n },\r\n exposedMethods () {\r\n return {\r\n setFieldsValue: this.setFieldsValue,\r\n getFieldsValue: this.getFieldsValue\r\n }\r\n }\r\n },\r\n methods: {\r\n evalDisabledExpression () {\r\n this.elements.forEach(ele => {\r\n const { disabled } = ele\r\n const ret = this.executeExpression(disabled)\r\n this.$set(ele, '_disabled', ret)\r\n })\r\n },\r\n executeExpression (expression) {\r\n if (type.isBool(expression)) return expression\r\n if (type.isEmpty(expression)) return false\r\n return parse(expression, { ...this.getFieldsValue() })\r\n },\r\n onChange (value, props) {\r\n const { name } = props\r\n this.setFieldsValue({ [name]: value })\r\n this.evalDisabledExpression()\r\n this.$emit('change', { value, props, exposed: { ...this.exposedMethods } })\r\n },\r\n collectDefaultValues () {\r\n const ret = this.elements.reduce((ret, props) => {\r\n const { name, defaultValue } = props\r\n if (defaultValue) {\r\n ret[name] = defaultValue\r\n }\r\n return ret\r\n }, {})\r\n return ret\r\n },\r\n setDefaultValues () {\r\n const defaultValues = this.collectDefaultValues()\r\n this.setFieldsValue(defaultValues)\r\n },\r\n validateFields () {\r\n let ret = false\r\n this.form.validateFields((error, values) => {\r\n ret = !error\r\n })\r\n return ret\r\n },\r\n setFieldsValue (props = {}) {\r\n this.form.setFieldsValue(props)\r\n },\r\n getFieldsValue () {\r\n return this.form.getFieldsValue()\r\n }\r\n },\r\n mounted() {\r\n this.setDefaultValues()\r\n this.evalDisabledExpression()\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele__form--wrapper {\r\n background: #fff;\r\n .ant-form-item {\r\n }\r\n}\r\n</style>",".ele__form--wrapper {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4119
|
+
|
|
4120
|
+
};
|
|
4121
|
+
/* scoped */
|
|
4122
|
+
const __vue_scope_id__$a = "data-v-39771dfa";
|
|
4123
|
+
/* module identifier */
|
|
4124
|
+
const __vue_module_identifier__$a = undefined;
|
|
4125
|
+
/* functional template */
|
|
4126
|
+
const __vue_is_functional_template__$a = false;
|
|
4127
|
+
/* style inject SSR */
|
|
4128
|
+
|
|
4129
|
+
/* style inject shadow dom */
|
|
4130
|
+
|
|
4131
|
+
|
|
4132
|
+
|
|
4133
|
+
const __vue_component__$a = /*#__PURE__*/normalizeComponent(
|
|
4134
|
+
{ render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a },
|
|
4135
|
+
__vue_inject_styles__$a,
|
|
4136
|
+
__vue_script__$a,
|
|
4137
|
+
__vue_scope_id__$a,
|
|
4138
|
+
__vue_is_functional_template__$a,
|
|
4139
|
+
__vue_module_identifier__$a,
|
|
4140
|
+
false,
|
|
4141
|
+
createInjector,
|
|
4142
|
+
undefined,
|
|
4143
|
+
undefined
|
|
4144
|
+
);
|
|
4145
|
+
|
|
4146
|
+
const BUILT_IN_EVENT_NAMES = {
|
|
4147
|
+
SUBMIT: 'submit',
|
|
4148
|
+
CANCEL: 'cancel',
|
|
4149
|
+
INCREASE: 'increase',
|
|
4150
|
+
DELETE: 'delete',
|
|
4151
|
+
NEXT: 'next',
|
|
4152
|
+
PREVIOUS: 'previous'
|
|
4153
|
+
};
|
|
4154
|
+
const RESERVE_EVENT_NAMES = {
|
|
4155
|
+
WATCH_FORM_STATUS: 'watch-form-status',
|
|
4156
|
+
INIT_FORM: 'init-form'
|
|
4157
|
+
};
|
|
4158
|
+
const parseFieldMap = (fieldMap = {}, dataSource = {}) => {
|
|
4159
|
+
let ret = {};
|
|
4160
|
+
Object.keys(fieldMap).forEach(key => {
|
|
4161
|
+
ret[fieldMap[key]] = parse(key, dataSource);
|
|
4162
|
+
});
|
|
4163
|
+
return ret;
|
|
4164
|
+
};
|
|
4165
|
+
|
|
4166
|
+
//
|
|
4167
|
+
var script$9 = {
|
|
4168
|
+
name: 'ele-form-group-model',
|
|
4169
|
+
components: {
|
|
4170
|
+
[__vue_component__$a.name]: __vue_component__$a,
|
|
4171
|
+
[__vue_component__$j.name]: __vue_component__$j
|
|
4172
|
+
},
|
|
4173
|
+
props: {
|
|
4174
|
+
mode: {
|
|
4175
|
+
type: String
|
|
4176
|
+
},
|
|
4177
|
+
fieldName: {
|
|
4178
|
+
type: String,
|
|
4179
|
+
default: 'formGroup'
|
|
4180
|
+
},
|
|
4181
|
+
groupMeta: {
|
|
4182
|
+
type: Function,
|
|
4183
|
+
default: () => []
|
|
4184
|
+
},
|
|
4185
|
+
footerMeta: {
|
|
4186
|
+
type: Object,
|
|
4187
|
+
default: () => {}
|
|
4188
|
+
},
|
|
4189
|
+
preRequest: {
|
|
4190
|
+
type: Object,
|
|
4191
|
+
default: () => {}
|
|
4192
|
+
},
|
|
4193
|
+
infoRequest: {
|
|
4194
|
+
type: Object,
|
|
4195
|
+
default: () => {}
|
|
4196
|
+
},
|
|
4197
|
+
submitRequest: {
|
|
4198
|
+
type: Object,
|
|
4199
|
+
default: () => {}
|
|
4200
|
+
}
|
|
4201
|
+
},
|
|
4202
|
+
data() {
|
|
4203
|
+
return {
|
|
4204
|
+
increaseCount: 1,
|
|
4205
|
+
innerGroupMeta: []
|
|
4206
|
+
};
|
|
4207
|
+
},
|
|
4208
|
+
watch: {
|
|
4209
|
+
readOnlyGroupMeta: {
|
|
4210
|
+
handler(meta) {
|
|
4211
|
+
this.innerGroupMeta = meta;
|
|
4212
|
+
},
|
|
4213
|
+
immediate: true
|
|
4214
|
+
}
|
|
4215
|
+
},
|
|
4216
|
+
computed: {
|
|
4217
|
+
readOnlyGroupMeta() {
|
|
4218
|
+
return this.groupMeta.call(this);
|
|
4219
|
+
},
|
|
4220
|
+
showFooterMeta() {
|
|
4221
|
+
return !type.isEmpty(this.footerMeta);
|
|
4222
|
+
},
|
|
4223
|
+
formRefBase() {
|
|
4224
|
+
return v4();
|
|
4225
|
+
},
|
|
4226
|
+
footerElements() {
|
|
4227
|
+
const {
|
|
4228
|
+
elements
|
|
4229
|
+
} = this.footerMeta;
|
|
4230
|
+
return elements.call(this);
|
|
4231
|
+
},
|
|
4232
|
+
assignAttrForEvents() {
|
|
4233
|
+
const events = this.footerElements.reduce((ret, ele) => {
|
|
4234
|
+
ret[ele.eventName] = e => {
|
|
4235
|
+
this.$emit(ele.eventName || 'click', {
|
|
4236
|
+
...e
|
|
4237
|
+
});
|
|
4238
|
+
};
|
|
4239
|
+
return ret;
|
|
4240
|
+
}, {});
|
|
4241
|
+
return {
|
|
4242
|
+
...this.$listeners,
|
|
4243
|
+
...events,
|
|
4244
|
+
[BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],
|
|
4245
|
+
[BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL],
|
|
4246
|
+
[BUILT_IN_EVENT_NAMES.INCREASE]: this[BUILT_IN_EVENT_NAMES.INCREASE]
|
|
4247
|
+
};
|
|
4248
|
+
},
|
|
4249
|
+
getFormRefs() {
|
|
4250
|
+
return this.innerGroupMeta.map((group, idx) => {
|
|
4251
|
+
if (!group.isGenTpl) {
|
|
4252
|
+
return this.$refs[group.key || `${this.formRefBase}__${idx}`];
|
|
4253
|
+
}
|
|
4254
|
+
return void 0;
|
|
4255
|
+
}).filter(item => !!item).flat();
|
|
4256
|
+
},
|
|
4257
|
+
formModels() {
|
|
4258
|
+
if (this.mode === 'increase') {
|
|
4259
|
+
//TODO increase mode to return formModels
|
|
4260
|
+
return this.getFormRefs.map(form => {
|
|
4261
|
+
return form.getFieldsValue();
|
|
4262
|
+
});
|
|
4263
|
+
} else {
|
|
4264
|
+
return this.getFormRefs.map(form => {
|
|
4265
|
+
const {
|
|
4266
|
+
$vnode: {
|
|
4267
|
+
data: {
|
|
4268
|
+
ref
|
|
4269
|
+
}
|
|
4270
|
+
}
|
|
4271
|
+
} = form;
|
|
4272
|
+
return {
|
|
4273
|
+
key: ref,
|
|
4274
|
+
value: form.getFieldsValue()
|
|
4275
|
+
};
|
|
4276
|
+
}).reduce((ret, props) => {
|
|
4277
|
+
ret[props.key] = props.value;
|
|
4278
|
+
return ret;
|
|
4279
|
+
}, {});
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
},
|
|
4283
|
+
methods: {
|
|
4284
|
+
execFieldMap(fieldMap = {}, dataSource = {}) {
|
|
4285
|
+
const ret = parseFieldMap(fieldMap, {
|
|
4286
|
+
_route: this.$route.query,
|
|
4287
|
+
...dataSource
|
|
4288
|
+
});
|
|
4289
|
+
return ret;
|
|
4290
|
+
},
|
|
4291
|
+
onChangeFormStatus(props, key) {
|
|
4292
|
+
this.$emit(RESERVE_EVENT_NAMES.WATCH_FORM_STATUS, {
|
|
4293
|
+
key,
|
|
4294
|
+
...props
|
|
4295
|
+
});
|
|
4296
|
+
},
|
|
4297
|
+
async infoRequestTrigger() {
|
|
4298
|
+
if (!this.infoRequest) return;
|
|
4299
|
+
const {
|
|
4300
|
+
url,
|
|
4301
|
+
requestType,
|
|
4302
|
+
params = {},
|
|
4303
|
+
fieldMap = {},
|
|
4304
|
+
headers = {}
|
|
4305
|
+
} = this.infoRequest;
|
|
4306
|
+
if (!url) return;
|
|
4307
|
+
net[requestType.toLowerCase()](url, {
|
|
4308
|
+
...params,
|
|
4309
|
+
...this.execFieldMap(fieldMap)
|
|
4310
|
+
}, {
|
|
4311
|
+
...headers
|
|
4312
|
+
}).then(resp => {
|
|
4313
|
+
const {
|
|
4314
|
+
data = {}
|
|
4315
|
+
} = resp;
|
|
4316
|
+
if (this.mode === 'increase') {
|
|
4317
|
+
this.renderIncreaseForm(data);
|
|
4318
|
+
}
|
|
4319
|
+
this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, {
|
|
4320
|
+
...data
|
|
4321
|
+
});
|
|
4322
|
+
});
|
|
4323
|
+
},
|
|
4324
|
+
async preRequestTrigger() {
|
|
4325
|
+
if (!this.preRequest) return;
|
|
4326
|
+
const {
|
|
4327
|
+
url,
|
|
4328
|
+
requestType = 'GET',
|
|
4329
|
+
params = {},
|
|
4330
|
+
fieldMap = {},
|
|
4331
|
+
headers = {}
|
|
4332
|
+
} = this.preRequest;
|
|
4333
|
+
if (!url) return;
|
|
4334
|
+
net[requestType.toLowerCase()](url, {
|
|
4335
|
+
...params,
|
|
4336
|
+
...fieldMap
|
|
4337
|
+
}, {
|
|
4338
|
+
...headers
|
|
4339
|
+
}).then(resp => {
|
|
4340
|
+
const {
|
|
4341
|
+
data = {}
|
|
4342
|
+
} = resp;
|
|
4343
|
+
if (this.mode === 'increase') {
|
|
4344
|
+
this.renderIncreaseForm(data);
|
|
4345
|
+
}
|
|
4346
|
+
this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, {
|
|
4347
|
+
...data
|
|
4348
|
+
});
|
|
4349
|
+
});
|
|
4350
|
+
},
|
|
4351
|
+
renderIncreaseForm(data = {}) {
|
|
4352
|
+
const formGroupValuesLength = data[this.fieldName].length;
|
|
4353
|
+
const genTplTarget = this.readOnlyGroupMeta.find(item => item.isGenTpl);
|
|
4354
|
+
const notGenTplPoolLength = this.readOnlyGroupMeta.filter(item => !item.isGenTpl).length;
|
|
4355
|
+
const genNum = formGroupValuesLength - notGenTplPoolLength;
|
|
4356
|
+
new Array(genNum).fill().forEach(() => {
|
|
4357
|
+
const form = this.genForm(genTplTarget);
|
|
4358
|
+
this.innerGroupMeta.push(form);
|
|
4359
|
+
});
|
|
4360
|
+
const formGroupValues = data[this.fieldName];
|
|
4361
|
+
this.setFieldsValue(formGroupValues);
|
|
4362
|
+
},
|
|
4363
|
+
async submitRequestTrigger(props = {}) {
|
|
4364
|
+
const {
|
|
4365
|
+
url,
|
|
4366
|
+
requestType,
|
|
4367
|
+
headers = {},
|
|
4368
|
+
params = {},
|
|
4369
|
+
fieldMap = {}
|
|
4370
|
+
} = this.submitRequest;
|
|
4371
|
+
if (!url) return;
|
|
4372
|
+
const ret = await net[requestType.toLowerCase()](url, {
|
|
4373
|
+
...params,
|
|
4374
|
+
...this.execFieldMap(fieldMap, {
|
|
4375
|
+
...this.formModels
|
|
4376
|
+
}),
|
|
4377
|
+
[this.fieldName]: this.formModels
|
|
4378
|
+
}, {
|
|
4379
|
+
headers
|
|
4380
|
+
}).then(resp => {
|
|
4381
|
+
this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, {
|
|
4382
|
+
...props,
|
|
4383
|
+
formModel: {
|
|
4384
|
+
...this.formModels,
|
|
4385
|
+
...(resp.data || {})
|
|
4386
|
+
}
|
|
4387
|
+
});
|
|
4388
|
+
return resp.data;
|
|
4389
|
+
});
|
|
4390
|
+
return ret;
|
|
4391
|
+
},
|
|
4392
|
+
setFieldsValue(data = []) {
|
|
4393
|
+
this.getFormRefs.forEach((form, idx) => {
|
|
4394
|
+
form.setFieldsValue(data[idx]);
|
|
4395
|
+
});
|
|
4396
|
+
},
|
|
4397
|
+
[BUILT_IN_EVENT_NAMES.SUBMIT](props = {}) {
|
|
4398
|
+
const status = this.getFormRefs.map(form => {
|
|
4399
|
+
const status = form.validateFields();
|
|
4400
|
+
return status;
|
|
4401
|
+
}).every(item => item);
|
|
4402
|
+
if (status) {
|
|
4403
|
+
return this.submitRequestTrigger(props);
|
|
4404
|
+
} else {
|
|
4405
|
+
return false;
|
|
4406
|
+
}
|
|
4407
|
+
},
|
|
4408
|
+
[BUILT_IN_EVENT_NAMES.CANCEL](props = {}) {
|
|
4409
|
+
this.$emit(BUILT_IN_EVENT_NAMES.CANCEL, {
|
|
4410
|
+
...props
|
|
4411
|
+
});
|
|
4412
|
+
},
|
|
4413
|
+
genForm(base) {
|
|
4414
|
+
const {
|
|
4415
|
+
elements,
|
|
4416
|
+
title,
|
|
4417
|
+
buttonGroupMeta
|
|
4418
|
+
} = base;
|
|
4419
|
+
return {
|
|
4420
|
+
elements: JSON.parse(JSON.stringify(elements)),
|
|
4421
|
+
buttonGroupMeta,
|
|
4422
|
+
title: `${title}${this.increaseCount++}`,
|
|
4423
|
+
_gen: true
|
|
4424
|
+
};
|
|
4425
|
+
},
|
|
4426
|
+
handleClickDelete(props = {}, attr = {}, idx) {
|
|
4427
|
+
this.innerGroupMeta.splice(idx, 1);
|
|
4428
|
+
this.$emit(BUILT_IN_EVENT_NAMES.DELETE, {
|
|
4429
|
+
...props
|
|
4430
|
+
});
|
|
4431
|
+
},
|
|
4432
|
+
[BUILT_IN_EVENT_NAMES.INCREASE](props) {
|
|
4433
|
+
const genTplTarget = this.readOnlyGroupMeta.find(item => item.isGenTpl);
|
|
4434
|
+
const form = this.genForm(genTplTarget);
|
|
4435
|
+
this.innerGroupMeta.push(form);
|
|
4436
|
+
}
|
|
4437
|
+
},
|
|
4438
|
+
async mounted() {
|
|
4439
|
+
await this.preRequestTrigger();
|
|
4440
|
+
await this.infoRequestTrigger();
|
|
4441
|
+
}
|
|
4442
|
+
};
|
|
4443
|
+
|
|
4444
|
+
/* script */
|
|
4445
|
+
const __vue_script__$9 = script$9;
|
|
4446
|
+
|
|
4447
|
+
/* template */
|
|
4448
|
+
var __vue_render__$9 = function () {
|
|
4449
|
+
var _vm = this;
|
|
4450
|
+
var _h = _vm.$createElement;
|
|
4451
|
+
var _c = _vm._self._c || _h;
|
|
4452
|
+
return _c(
|
|
4453
|
+
"div",
|
|
4454
|
+
{ staticClass: "ele form-group-model__wrapper" },
|
|
4455
|
+
[
|
|
4456
|
+
_vm._l(_vm.innerGroupMeta, function (group, idx) {
|
|
4457
|
+
return [
|
|
4458
|
+
!group.isGenTpl
|
|
4459
|
+
? _c(
|
|
4460
|
+
"div",
|
|
4461
|
+
{
|
|
4462
|
+
key: group.key || idx,
|
|
4463
|
+
staticClass: "form-group-model__from",
|
|
4464
|
+
},
|
|
4465
|
+
[
|
|
4466
|
+
_c("div", { staticClass: "form-group-model__form--title" }, [
|
|
4467
|
+
_c("div", [_vm._v(_vm._s(group.title))]),
|
|
4468
|
+
_vm._v(" "),
|
|
4469
|
+
_c(
|
|
4470
|
+
"div",
|
|
4471
|
+
{ staticClass: "form-group-model__form--buttons" },
|
|
4472
|
+
[
|
|
4473
|
+
group.buttonGroupMeta
|
|
4474
|
+
? _c(
|
|
4475
|
+
"ele-button-group",
|
|
4476
|
+
_vm._g(
|
|
4477
|
+
{
|
|
4478
|
+
attrs: {
|
|
4479
|
+
"data-source":
|
|
4480
|
+
group.buttonGroupMeta.elements.call(this),
|
|
4481
|
+
},
|
|
4482
|
+
on: {
|
|
4483
|
+
delete: function ($event) {
|
|
4484
|
+
return _vm.handleClickDelete(
|
|
4485
|
+
$event,
|
|
4486
|
+
group,
|
|
4487
|
+
idx
|
|
4488
|
+
)
|
|
4489
|
+
},
|
|
4490
|
+
},
|
|
4491
|
+
},
|
|
4492
|
+
_vm.assignAttrForEvents
|
|
4493
|
+
)
|
|
4494
|
+
)
|
|
4495
|
+
: _vm._e(),
|
|
4496
|
+
],
|
|
4497
|
+
1
|
|
4498
|
+
),
|
|
4499
|
+
]),
|
|
4500
|
+
_vm._v(" "),
|
|
4501
|
+
_c(
|
|
4502
|
+
"div",
|
|
4503
|
+
{ staticClass: "form-group-model__form--content" },
|
|
4504
|
+
[
|
|
4505
|
+
_c("ele-form", {
|
|
4506
|
+
ref: group.key || _vm.formRefBase + "__" + idx,
|
|
4507
|
+
refInFor: true,
|
|
4508
|
+
attrs: {
|
|
4509
|
+
"form-name": group.key || idx,
|
|
4510
|
+
elements: group.elements,
|
|
4511
|
+
},
|
|
4512
|
+
on: {
|
|
4513
|
+
change: function ($event) {
|
|
4514
|
+
return _vm.onChangeFormStatus(
|
|
4515
|
+
$event,
|
|
4516
|
+
group.key || idx
|
|
4517
|
+
)
|
|
4518
|
+
},
|
|
4519
|
+
},
|
|
4520
|
+
}),
|
|
4521
|
+
],
|
|
4522
|
+
1
|
|
4523
|
+
),
|
|
4524
|
+
]
|
|
4525
|
+
)
|
|
4526
|
+
: _vm._e(),
|
|
4527
|
+
]
|
|
4528
|
+
}),
|
|
4529
|
+
_vm._v(" "),
|
|
4530
|
+
_vm.showFooterMeta
|
|
4531
|
+
? _c(
|
|
4532
|
+
"div",
|
|
4533
|
+
{ staticClass: "form-group-model__form--footer" },
|
|
4534
|
+
[
|
|
4535
|
+
_c(
|
|
4536
|
+
"ele-button-group",
|
|
4537
|
+
_vm._g(
|
|
4538
|
+
{ attrs: { "data-source": _vm.footerElements } },
|
|
4539
|
+
_vm.assignAttrForEvents
|
|
4540
|
+
)
|
|
4541
|
+
),
|
|
4542
|
+
],
|
|
4543
|
+
1
|
|
4544
|
+
)
|
|
4545
|
+
: _vm._e(),
|
|
4546
|
+
],
|
|
4547
|
+
2
|
|
4548
|
+
)
|
|
4549
|
+
};
|
|
4550
|
+
var __vue_staticRenderFns__$9 = [];
|
|
4551
|
+
__vue_render__$9._withStripped = true;
|
|
4552
|
+
|
|
4553
|
+
/* style */
|
|
4554
|
+
const __vue_inject_styles__$9 = function (inject) {
|
|
4555
|
+
if (!inject) return
|
|
4556
|
+
inject("data-v-8651e654_0", { source: ".ele.form-group-model__wrapper[data-v-8651e654] {\n background: unset;\n padding-bottom: 80px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-8651e654] {\n background: #fff;\n margin-top: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__from[data-v-8651e654]:first-child {\n margin-top: unset;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--title[data-v-8651e654] {\n width: 100%;\n height: 56px;\n padding: 0 16px;\n border-bottom: 1px solid;\n border-color: var(--idooel-form-title-border-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--content[data-v-8651e654] {\n padding: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__form--footer[data-v-8651e654] {\n width: 100%;\n height: 64px;\n background: #fff;\n position: fixed;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\form-group-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AA4OA;EACA,iBAAA;EACA,oBAAA;AC3OA;AD4OA;EACA,gBAAA;EACA,gBAAA;AC1OA;AD2OA;EACA,iBAAA;ACzOA;AD2OA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,wBAAA;EACA,mDAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;ACzOA;AD2OA;EACA,aAAA;ACzOA;AD4OA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;EACA,eAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;AC1OA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele form-group-model__wrapper\">\r\n <template v-for=\"(group, idx) in innerGroupMeta\">\r\n <div \r\n class=\"form-group-model__from\"\r\n v-if=\"!group.isGenTpl\"\r\n :key=\"group.key || idx\">\r\n <div class=\"form-group-model__form--title\">\r\n <div>{{ group.title }}</div>\r\n <div class=\"form-group-model__form--buttons\">\r\n <ele-button-group v-if=\"group.buttonGroupMeta\" v-on=\"assignAttrForEvents\" @delete=\"handleClickDelete($event, group, idx)\" :data-source=\"group.buttonGroupMeta.elements.call(this)\"></ele-button-group>\r\n </div>\r\n </div>\r\n <div class=\"form-group-model__form--content\">\r\n <ele-form @change=\"onChangeFormStatus($event, group.key || idx)\" :form-name=\"group.key || idx\" :ref=\"group.key || `${formRefBase}__${idx}`\" :elements=\"group.elements\"></ele-form>\r\n </div>\r\n </div>\r\n </template>\r\n <div v-if=\"showFooterMeta\" class=\"form-group-model__form--footer\">\r\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Form from '../../form/src/index.vue'\r\nimport { BUILT_IN_EVENT_NAMES, RESERVE_EVENT_NAMES, parseFieldMap } from '../../utils'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { type, net } from '@idooel/shared'\r\nimport EleButtonGroup from '../../composite-components/button-group/src/index.vue'\r\nexport default {\r\n name: 'ele-form-group-model',\r\n components: {\r\n [Form.name]: Form,\r\n [EleButtonGroup.name]: EleButtonGroup\r\n },\r\n props: {\r\n mode: {\r\n type: String\r\n },\r\n fieldName: {\r\n type: String,\r\n default: 'formGroup'\r\n },\r\n groupMeta: {\r\n type: Function,\r\n default: () => []\r\n },\r\n footerMeta: {\r\n type: Object,\r\n default: () => {}\r\n },\r\n preRequest: {\r\n type: Object,\r\n default: () => {}\r\n },\r\n infoRequest: {\r\n type: Object,\r\n default: () => {}\r\n },\r\n submitRequest: {\r\n type: Object,\r\n default: () => {}\r\n }\r\n },\r\n data () {\r\n return {\r\n increaseCount: 1,\r\n innerGroupMeta: []\r\n }\r\n },\r\n watch: {\r\n readOnlyGroupMeta: {\r\n handler (meta) {\r\n this.innerGroupMeta = meta\r\n },\r\n immediate: true\r\n }\r\n },\r\n computed: {\r\n readOnlyGroupMeta () {\r\n return this.groupMeta.call(this)\r\n },\r\n showFooterMeta () {\r\n return !type.isEmpty(this.footerMeta)\r\n },\r\n formRefBase () {\r\n return uuidv4()\r\n },\r\n footerElements () {\r\n const { elements } = this.footerMeta\r\n return elements.call(this)\r\n },\r\n assignAttrForEvents () {\r\n const events = this.footerElements.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e) => {\r\n this.$emit(ele.eventName || 'click', { ...e })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],\r\n [BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL],\r\n [BUILT_IN_EVENT_NAMES.INCREASE]: this[BUILT_IN_EVENT_NAMES.INCREASE]\r\n }\r\n },\r\n getFormRefs () {\r\n return this.innerGroupMeta.map((group, idx) => {\r\n if (!group.isGenTpl) {\r\n return this.$refs[group.key || `${this.formRefBase}__${idx}`]\r\n }\r\n return void 0\r\n }).filter(item => !!item).flat()\r\n },\r\n formModels () {\r\n if (this.mode === 'increase') {\r\n //TODO increase mode to return formModels\r\n return this.getFormRefs.map(form => {\r\n return form.getFieldsValue()\r\n })\r\n } else {\r\n return this.getFormRefs.map(form => {\r\n const { $vnode: { data: { ref } } } = form\r\n return {\r\n key: ref,\r\n value: form.getFieldsValue()\r\n }\r\n }).reduce((ret, props) => {\r\n ret[props.key] = props.value\r\n return ret\r\n }, {})\r\n }\r\n }\r\n },\r\n methods: {\r\n execFieldMap (fieldMap = {}, dataSource = {}) {\r\n const ret = parseFieldMap(fieldMap, { _route: this.$route.query, ...dataSource})\r\n return ret\r\n },\r\n onChangeFormStatus (props, key) {\r\n this.$emit(RESERVE_EVENT_NAMES.WATCH_FORM_STATUS, { key, ...props })\r\n },\r\n async infoRequestTrigger () {\r\n if (!this.infoRequest) return\r\n const { url, requestType, params = {}, fieldMap = {}, headers = {} } = this.infoRequest\r\n if (!url) return\r\n net[requestType.toLowerCase()](url, { ...params, ...this.execFieldMap(fieldMap) }, { ...headers }).then(resp => {\r\n const { data = {} } = resp\r\n if (this.mode === 'increase') {\r\n this.renderIncreaseForm(data)\r\n }\r\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\r\n })\r\n },\r\n async preRequestTrigger () {\r\n if (!this.preRequest) return\r\n const { url, requestType = 'GET', params = {}, fieldMap = {}, headers = {} } = this.preRequest\r\n if (!url) return\r\n net[requestType.toLowerCase()](url, { ...params, ...fieldMap }, { ...headers }).then(resp => {\r\n const { data = {} } = resp\r\n if (this.mode === 'increase') {\r\n this.renderIncreaseForm(data)\r\n }\r\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\r\n })\r\n },\r\n renderIncreaseForm (data = {}) {\r\n const formGroupValuesLength = data[this.fieldName].length\r\n const genTplTarget = this.readOnlyGroupMeta.find(item => item.isGenTpl)\r\n const notGenTplPoolLength = this.readOnlyGroupMeta.filter(item => !item.isGenTpl).length\r\n const genNum = formGroupValuesLength - notGenTplPoolLength\r\n new Array(genNum).fill().forEach(() => {\r\n const form = this.genForm(genTplTarget)\r\n this.innerGroupMeta.push(form)\r\n })\r\n const formGroupValues = data[this.fieldName]\r\n this.setFieldsValue(formGroupValues)\r\n },\r\n async submitRequestTrigger (props = {}) {\r\n const { url, requestType, headers = {}, params = {}, fieldMap = {} } = this.submitRequest\r\n if (!url) return\r\n const ret = await net[requestType.toLowerCase()](url, { ...params, ...this.execFieldMap(fieldMap, { ...this.formModels }), [this.fieldName]: this.formModels }, { headers }).then(resp => {\r\n this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, { ...props, formModel: { ...this.formModels, ...resp.data || {} } })\r\n return resp.data\r\n })\r\n return ret\r\n },\r\n setFieldsValue (data = []) {\r\n this.getFormRefs.forEach((form, idx) => {\r\n form.setFieldsValue(data[idx])\r\n })\r\n },\r\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props = {}) {\r\n const status = this.getFormRefs.map(form => {\r\n const status = form.validateFields()\r\n return status\r\n }).every(item => item)\r\n if (status) {\r\n return this.submitRequestTrigger(props)\r\n } else {\r\n return false\r\n }\r\n },\r\n [BUILT_IN_EVENT_NAMES.CANCEL] (props = {}) {\r\n this.$emit(BUILT_IN_EVENT_NAMES.CANCEL, { ...props })\r\n },\r\n genForm (base) {\r\n const { elements, title, buttonGroupMeta } = base\r\n return {\r\n elements: JSON.parse(JSON.stringify(elements)),\r\n buttonGroupMeta,\r\n title: `${title}${this.increaseCount++}`,\r\n _gen: true\r\n }\r\n },\r\n handleClickDelete (props = {}, attr = {}, idx) {\r\n this.innerGroupMeta.splice(idx, 1)\r\n this.$emit(BUILT_IN_EVENT_NAMES.DELETE, { ...props })\r\n },\r\n [BUILT_IN_EVENT_NAMES.INCREASE] (props) {\r\n const genTplTarget = this.readOnlyGroupMeta.find(item => item.isGenTpl)\r\n const form = this.genForm(genTplTarget)\r\n this.innerGroupMeta.push(form)\r\n }\r\n },\r\n async mounted() {\r\n await this.preRequestTrigger()\r\n await this.infoRequestTrigger()\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele {\r\n &.form-group-model__wrapper {\r\n background: unset;\r\n padding-bottom: 80px;\r\n .form-group-model__from {\r\n background: #fff;\r\n margin-top: 16px;\r\n &:first-child {\r\n margin-top: unset;\r\n }\r\n .form-group-model__form--title {\r\n width: 100%;\r\n height: 56px;\r\n padding: 0 16px;\r\n border-bottom: 1px solid;\r\n border-color: var(--idooel-form-title-border-color);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n }\r\n .form-group-model__form--content {\r\n padding: 16px;\r\n }\r\n }\r\n .form-group-model__form--footer {\r\n width: 100%;\r\n height: 64px;\r\n background: #fff;\r\n position: fixed;\r\n bottom: 0;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: end;\r\n }\r\n }\r\n}\r\n</style>",".ele.form-group-model__wrapper {\n background: unset;\n padding-bottom: 80px;\n}\n.ele.form-group-model__wrapper .form-group-model__from {\n background: #fff;\n margin-top: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__from:first-child {\n margin-top: unset;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--title {\n width: 100%;\n height: 56px;\n padding: 0 16px;\n border-bottom: 1px solid;\n border-color: var(--idooel-form-title-border-color);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.ele.form-group-model__wrapper .form-group-model__from .form-group-model__form--content {\n padding: 16px;\n}\n.ele.form-group-model__wrapper .form-group-model__form--footer {\n width: 100%;\n height: 64px;\n background: #fff;\n position: fixed;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4557
|
+
|
|
4558
|
+
};
|
|
4559
|
+
/* scoped */
|
|
4560
|
+
const __vue_scope_id__$9 = "data-v-8651e654";
|
|
4561
|
+
/* module identifier */
|
|
4562
|
+
const __vue_module_identifier__$9 = undefined;
|
|
4563
|
+
/* functional template */
|
|
4564
|
+
const __vue_is_functional_template__$9 = false;
|
|
4565
|
+
/* style inject SSR */
|
|
4566
|
+
|
|
4567
|
+
/* style inject shadow dom */
|
|
4568
|
+
|
|
4569
|
+
|
|
4570
|
+
|
|
4571
|
+
const __vue_component__$9 = /*#__PURE__*/normalizeComponent(
|
|
4572
|
+
{ render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 },
|
|
4573
|
+
__vue_inject_styles__$9,
|
|
4574
|
+
__vue_script__$9,
|
|
4575
|
+
__vue_scope_id__$9,
|
|
4576
|
+
__vue_is_functional_template__$9,
|
|
4577
|
+
__vue_module_identifier__$9,
|
|
4578
|
+
false,
|
|
4579
|
+
createInjector,
|
|
4580
|
+
undefined,
|
|
4581
|
+
undefined
|
|
4582
|
+
);
|
|
4583
|
+
|
|
4584
|
+
//
|
|
4585
|
+
var script$8 = {
|
|
4586
|
+
name: 'ele-form-model',
|
|
4587
|
+
components: {
|
|
4588
|
+
EleButtonGroup: __vue_component__$j
|
|
4589
|
+
},
|
|
4590
|
+
props: {
|
|
4591
|
+
title: {
|
|
4592
|
+
type: String
|
|
4593
|
+
},
|
|
4594
|
+
formMeta: {
|
|
4595
|
+
type: Object
|
|
4596
|
+
},
|
|
4597
|
+
footerMeta: {
|
|
4598
|
+
type: Object
|
|
4599
|
+
}
|
|
4600
|
+
},
|
|
4601
|
+
data() {
|
|
4602
|
+
return {};
|
|
4603
|
+
},
|
|
4604
|
+
computed: {
|
|
4605
|
+
formRef() {
|
|
4606
|
+
return v4();
|
|
4607
|
+
},
|
|
4608
|
+
assignAttrForEvents() {
|
|
4609
|
+
const events = this.footerElements.reduce((ret, ele) => {
|
|
4610
|
+
ret[ele.eventName] = e => {
|
|
4611
|
+
this.$emit(ele.eventName || 'click', {
|
|
4612
|
+
...e,
|
|
4613
|
+
formModel: this.formModels
|
|
4614
|
+
});
|
|
4615
|
+
};
|
|
4616
|
+
return ret;
|
|
4617
|
+
}, {});
|
|
4618
|
+
return {
|
|
4619
|
+
...this.$listeners,
|
|
4620
|
+
...events,
|
|
4621
|
+
[BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],
|
|
4622
|
+
[BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL]
|
|
4623
|
+
};
|
|
4624
|
+
},
|
|
4625
|
+
elements() {
|
|
4626
|
+
const {
|
|
4627
|
+
elements
|
|
4628
|
+
} = this.formMeta;
|
|
4629
|
+
return elements;
|
|
4630
|
+
},
|
|
4631
|
+
preRequest() {
|
|
4632
|
+
const {
|
|
4633
|
+
preRequest
|
|
4634
|
+
} = this.formMeta;
|
|
4635
|
+
return preRequest;
|
|
4636
|
+
},
|
|
4637
|
+
infoRequest() {
|
|
4638
|
+
const {
|
|
4639
|
+
infoRequest
|
|
4640
|
+
} = this.formMeta;
|
|
4641
|
+
return infoRequest;
|
|
4642
|
+
},
|
|
4643
|
+
submitRequest() {
|
|
4644
|
+
const {
|
|
4645
|
+
submitRequest
|
|
4646
|
+
} = this.formMeta;
|
|
4647
|
+
return submitRequest;
|
|
4648
|
+
},
|
|
4649
|
+
footerElements() {
|
|
4650
|
+
const {
|
|
4651
|
+
elements
|
|
4652
|
+
} = this.footerMeta;
|
|
4653
|
+
return elements.call(this);
|
|
4654
|
+
},
|
|
4655
|
+
formModels() {
|
|
4656
|
+
return this.$refs[this.formRef].getFieldsValue();
|
|
4657
|
+
}
|
|
4658
|
+
},
|
|
4659
|
+
methods: {
|
|
4660
|
+
execFieldMap(fieldMap = {}, dataSource = {}) {
|
|
4661
|
+
const ret = parseFieldMap(fieldMap, {
|
|
4662
|
+
_route: this.$route.query,
|
|
4663
|
+
...dataSource
|
|
4664
|
+
});
|
|
4665
|
+
return ret;
|
|
4666
|
+
},
|
|
4667
|
+
async submitRequestTrigger(props = {}) {
|
|
4668
|
+
const {
|
|
4669
|
+
url,
|
|
4670
|
+
requestType,
|
|
4671
|
+
headers = {},
|
|
4672
|
+
params = {},
|
|
4673
|
+
fieldMap = {}
|
|
4674
|
+
} = this.submitRequest;
|
|
4675
|
+
if (!url) return;
|
|
4676
|
+
const ret = await net[requestType.toLowerCase()](url, {
|
|
4677
|
+
...params,
|
|
4678
|
+
...this.execFieldMap(fieldMap, {
|
|
4679
|
+
...this.formModels
|
|
4680
|
+
}),
|
|
4681
|
+
...this.formModels
|
|
4682
|
+
}, {
|
|
4683
|
+
headers
|
|
4684
|
+
}).then(resp => {
|
|
4685
|
+
console.log(resp.data);
|
|
4686
|
+
this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, {
|
|
4687
|
+
...props,
|
|
4688
|
+
formModel: {
|
|
4689
|
+
...this.formModels,
|
|
4690
|
+
...(resp.data || {})
|
|
4691
|
+
}
|
|
4692
|
+
});
|
|
4693
|
+
return resp.data;
|
|
4694
|
+
});
|
|
4695
|
+
return ret;
|
|
4696
|
+
},
|
|
4697
|
+
async infoRequestTrigger() {
|
|
4698
|
+
const {
|
|
4699
|
+
url,
|
|
4700
|
+
requestType,
|
|
4701
|
+
params = {},
|
|
4702
|
+
fieldMap = {},
|
|
4703
|
+
headers = {}
|
|
4704
|
+
} = this.infoRequest;
|
|
4705
|
+
if (!url) return;
|
|
4706
|
+
net[requestType.toLowerCase()](url, {
|
|
4707
|
+
...params,
|
|
4708
|
+
...this.execFieldMap(fieldMap)
|
|
4709
|
+
}, {
|
|
4710
|
+
...headers
|
|
4711
|
+
}).then(resp => {
|
|
4712
|
+
const {
|
|
4713
|
+
data = {}
|
|
4714
|
+
} = resp;
|
|
4715
|
+
this.setFieldsValue(data);
|
|
4716
|
+
this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, {
|
|
4717
|
+
...data
|
|
4718
|
+
});
|
|
4719
|
+
});
|
|
4720
|
+
},
|
|
4721
|
+
async preRequestTrigger() {
|
|
4722
|
+
const {
|
|
4723
|
+
url,
|
|
4724
|
+
requestType = 'GET',
|
|
4725
|
+
params = {},
|
|
4726
|
+
fieldMap = {},
|
|
4727
|
+
headers = {}
|
|
4728
|
+
} = this.preRequest;
|
|
4729
|
+
if (!url) return;
|
|
4730
|
+
const {
|
|
4731
|
+
data
|
|
4732
|
+
} = await net[requestType.toLowerCase()](url, {
|
|
4733
|
+
...params,
|
|
4734
|
+
...fieldMap
|
|
4735
|
+
}, {
|
|
4736
|
+
...headers
|
|
4737
|
+
});
|
|
4738
|
+
this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, {
|
|
4739
|
+
...data
|
|
4740
|
+
});
|
|
4741
|
+
},
|
|
4742
|
+
setFieldsValue(props) {
|
|
4743
|
+
this.$refs[this.formRef].setFieldsValue(props);
|
|
4744
|
+
},
|
|
4745
|
+
validateFields() {
|
|
4746
|
+
return this.$refs[this.formRef].validateFields();
|
|
4747
|
+
},
|
|
4748
|
+
[BUILT_IN_EVENT_NAMES.SUBMIT](props = {}) {
|
|
4749
|
+
const status = this.$refs[this.formRef].validateFields();
|
|
4750
|
+
if (status) {
|
|
4751
|
+
//TODO fieldMap
|
|
4752
|
+
return this.submitRequestTrigger(props);
|
|
4753
|
+
} else {
|
|
4754
|
+
return false;
|
|
4755
|
+
}
|
|
4756
|
+
},
|
|
4757
|
+
[BUILT_IN_EVENT_NAMES.CANCEL](props = {}) {
|
|
4758
|
+
this.$emit(BUILT_IN_EVENT_NAMES.CANCEL, {
|
|
4759
|
+
...props
|
|
4760
|
+
});
|
|
4761
|
+
}
|
|
4762
|
+
},
|
|
4763
|
+
async mounted() {
|
|
4764
|
+
await this.preRequestTrigger();
|
|
4765
|
+
await this.infoRequestTrigger();
|
|
4766
|
+
}
|
|
4767
|
+
};
|
|
4768
|
+
|
|
4769
|
+
/* script */
|
|
4770
|
+
const __vue_script__$8 = script$8;
|
|
4771
|
+
|
|
4772
|
+
/* template */
|
|
4773
|
+
var __vue_render__$8 = function () {
|
|
4774
|
+
var _vm = this;
|
|
4775
|
+
var _h = _vm.$createElement;
|
|
4776
|
+
var _c = _vm._self._c || _h;
|
|
4777
|
+
return _c("div", { staticClass: "form__model--wrapper" }, [
|
|
4778
|
+
_vm.title
|
|
4779
|
+
? _c("div", { staticClass: "form-model__title" }, [
|
|
4780
|
+
_vm._v("\n " + _vm._s(_vm.title) + "\n "),
|
|
4781
|
+
])
|
|
4782
|
+
: _vm._e(),
|
|
4783
|
+
_vm._v(" "),
|
|
4784
|
+
_c(
|
|
4785
|
+
"div",
|
|
4786
|
+
{ staticClass: "form-model__content" },
|
|
4787
|
+
[_c("ele-form", { ref: _vm.formRef, attrs: { elements: _vm.elements } })],
|
|
4788
|
+
1
|
|
4789
|
+
),
|
|
4790
|
+
_vm._v(" "),
|
|
4791
|
+
_vm.footerMeta
|
|
4792
|
+
? _c(
|
|
4793
|
+
"div",
|
|
4794
|
+
{ staticClass: "form-model__footer" },
|
|
4795
|
+
[
|
|
4796
|
+
_c(
|
|
4797
|
+
"ele-button-group",
|
|
4798
|
+
_vm._g(
|
|
4799
|
+
{ attrs: { "data-source": _vm.footerElements } },
|
|
4800
|
+
_vm.assignAttrForEvents
|
|
4801
|
+
)
|
|
4802
|
+
),
|
|
4803
|
+
],
|
|
4804
|
+
1
|
|
4805
|
+
)
|
|
4806
|
+
: _vm._e(),
|
|
4807
|
+
])
|
|
4808
|
+
};
|
|
4809
|
+
var __vue_staticRenderFns__$8 = [];
|
|
4810
|
+
__vue_render__$8._withStripped = true;
|
|
4811
|
+
|
|
4812
|
+
/* style */
|
|
4813
|
+
const __vue_inject_styles__$8 = function (inject) {
|
|
4814
|
+
if (!inject) return
|
|
4815
|
+
inject("data-v-b0dc39fc_0", { source: ".form__model--wrapper[data-v-b0dc39fc] {\n width: 100%;\n height: 100%;\n overflow: auto;\n background: #fff;\n}\n.form__model--wrapper .form-model__title[data-v-b0dc39fc] {\n height: 56px;\n padding: 0 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border-bottom: 1px solid var(--idooel-form-title-border-color);\n}\n.form__model--wrapper .form-model__content[data-v-b0dc39fc] {\n padding: 16px;\n}\n.form__model--wrapper .form-model__footer[data-v-b0dc39fc] {\n /* width: 100%; */\n height: 64px;\n position: fixed;\n bottom: 0;\n display: flex;\n float: right;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\form-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AAyIA;EACA,WAAA;EACA,YAAA;EACA,cAAA;EACA,gBAAA;ACxIA;ADyIA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8DAAA;ACvIA;ADyIA;EACA,aAAA;ACvIA;ADyIA;EACA,iBAAA;EACA,YAAA;EACA,eAAA;EACA,SAAA;EACA,aAAA;EACA,YAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;ACvIA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"form__model--wrapper\">\r\n <div class=\"form-model__title\" v-if=\"title\">\r\n {{ title }}\r\n </div>\r\n <div class=\"form-model__content\">\r\n <ele-form :ref=\"formRef\" :elements=\"elements\"></ele-form>\r\n </div>\r\n <div class=\"form-model__footer\" v-if=\"footerMeta\">\r\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleButtonGroup from '../../composite-components/button-group/src/index.vue'\r\nimport { BUILT_IN_EVENT_NAMES, parseFieldMap, RESERVE_EVENT_NAMES } from '../../utils'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nimport { net } from '@idooel/shared'\r\nexport default {\r\n name: 'ele-form-model',\r\n components: {\r\n EleButtonGroup\r\n },\r\n props: {\r\n title: {\r\n type: String\r\n },\r\n formMeta: {\r\n type: Object\r\n },\r\n footerMeta: {\r\n type: Object\r\n }\r\n },\r\n data() {\r\n return {}\r\n },\r\n computed: {\r\n formRef () {\r\n return uuidv4()\r\n },\r\n assignAttrForEvents () {\r\n const events = this.footerElements.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e) => {\r\n this.$emit(ele.eventName || 'click', { ...e, formModel: this.formModels })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],\r\n [BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL]\r\n }\r\n },\r\n elements () {\r\n const { elements } = this.formMeta\r\n return elements\r\n },\r\n preRequest () {\r\n const { preRequest } = this.formMeta\r\n return preRequest\r\n },\r\n infoRequest () {\r\n const { infoRequest } = this.formMeta\r\n return infoRequest\r\n },\r\n submitRequest () {\r\n const { submitRequest } = this.formMeta\r\n return submitRequest\r\n },\r\n footerElements () {\r\n const { elements } = this.footerMeta\r\n return elements.call(this)\r\n },\r\n formModels () {\r\n return this.$refs[this.formRef].getFieldsValue()\r\n }\r\n },\r\n methods: {\r\n execFieldMap (fieldMap = {}, dataSource = {}) {\r\n const ret = parseFieldMap(fieldMap, { _route: this.$route.query, ...dataSource})\r\n return ret\r\n },\r\n async submitRequestTrigger (props = {}) {\r\n const { url, requestType, headers = {}, params = {}, fieldMap = {} } = this.submitRequest\r\n if (!url) return\r\n const ret = await net[requestType.toLowerCase()](url, { ...params, ...this.execFieldMap(fieldMap, { ...this.formModels }), ...this.formModels }, { headers }).then(resp => {\r\n console.log(resp.data)\r\n this.$emit(BUILT_IN_EVENT_NAMES.SUBMIT, { ...props, formModel: { ...this.formModels, ...resp.data || {} } })\r\n return resp.data\r\n })\r\n return ret\r\n },\r\n async infoRequestTrigger () {\r\n const { url, requestType, params = {}, fieldMap = {}, headers = {} } = this.infoRequest\r\n if (!url) return\r\n net[requestType.toLowerCase()](url, { ...params, ...this.execFieldMap(fieldMap) }, { ...headers }).then(resp => {\r\n const { data = {} } = resp\r\n this.setFieldsValue(data)\r\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\r\n })\r\n },\r\n async preRequestTrigger () {\r\n const { url, requestType = 'GET', params = {}, fieldMap = {}, headers = {} } = this.preRequest\r\n if (!url) return\r\n const { data } = await net[requestType.toLowerCase()](url, { ...params, ...fieldMap }, { ...headers })\r\n this.$emit(RESERVE_EVENT_NAMES.INIT_FORM, { ...data })\r\n },\r\n setFieldsValue (props) {\r\n this.$refs[this.formRef].setFieldsValue(props)\r\n },\r\n validateFields () {\r\n return this.$refs[this.formRef].validateFields()\r\n },\r\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props = {}) {\r\n const status = this.$refs[this.formRef].validateFields()\r\n if (status) {\r\n //TODO fieldMap\r\n return this.submitRequestTrigger(props)\r\n } else {\r\n return false\r\n }\r\n },\r\n [BUILT_IN_EVENT_NAMES.CANCEL] (props = {}) {\r\n this.$emit(BUILT_IN_EVENT_NAMES.CANCEL, { ...props })\r\n }\r\n },\r\n async mounted() {\r\n await this.preRequestTrigger()\r\n await this.infoRequestTrigger()\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.form__model--wrapper {\r\n width: 100%;\r\n height: 100%;\r\n overflow: auto;\r\n background: #fff;\r\n .form-model__title {\r\n height: 56px;\r\n padding: 0 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n border-bottom: 1px solid var(--idooel-form-title-border-color);\r\n }\r\n .form-model__content {\r\n padding: 16px;\r\n }\r\n .form-model__footer {\r\n /* width: 100%; */\r\n height: 64px;\r\n position: fixed;\r\n bottom: 0;\r\n display: flex;\r\n float: right;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: end;\r\n }\r\n}\r\n</style>",".form__model--wrapper {\n width: 100%;\n height: 100%;\n overflow: auto;\n background: #fff;\n}\n.form__model--wrapper .form-model__title {\n height: 56px;\n padding: 0 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n border-bottom: 1px solid var(--idooel-form-title-border-color);\n}\n.form__model--wrapper .form-model__content {\n padding: 16px;\n}\n.form__model--wrapper .form-model__footer {\n /* width: 100%; */\n height: 64px;\n position: fixed;\n bottom: 0;\n display: flex;\n float: right;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4816
|
+
|
|
4817
|
+
};
|
|
4818
|
+
/* scoped */
|
|
4819
|
+
const __vue_scope_id__$8 = "data-v-b0dc39fc";
|
|
4820
|
+
/* module identifier */
|
|
4821
|
+
const __vue_module_identifier__$8 = undefined;
|
|
4822
|
+
/* functional template */
|
|
4823
|
+
const __vue_is_functional_template__$8 = false;
|
|
4824
|
+
/* style inject SSR */
|
|
4825
|
+
|
|
4826
|
+
/* style inject shadow dom */
|
|
4827
|
+
|
|
4828
|
+
|
|
4829
|
+
|
|
4830
|
+
const __vue_component__$8 = /*#__PURE__*/normalizeComponent(
|
|
4831
|
+
{ render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
|
|
4832
|
+
__vue_inject_styles__$8,
|
|
4833
|
+
__vue_script__$8,
|
|
4834
|
+
__vue_scope_id__$8,
|
|
4835
|
+
__vue_is_functional_template__$8,
|
|
4836
|
+
__vue_module_identifier__$8,
|
|
4837
|
+
false,
|
|
4838
|
+
createInjector,
|
|
4839
|
+
undefined,
|
|
4840
|
+
undefined
|
|
4841
|
+
);
|
|
4842
|
+
|
|
4843
|
+
//
|
|
4844
|
+
var script$7 = {
|
|
4845
|
+
name: 'ele-step-model',
|
|
4846
|
+
components: {
|
|
4847
|
+
EleButtonGroup: __vue_component__$j
|
|
4848
|
+
},
|
|
4849
|
+
props: {
|
|
4850
|
+
stepMeta: {
|
|
4851
|
+
type: Object,
|
|
4852
|
+
default: () => ({})
|
|
4853
|
+
},
|
|
4854
|
+
footerMeta: {
|
|
4855
|
+
type: Object,
|
|
4856
|
+
default: () => ({})
|
|
4857
|
+
}
|
|
4858
|
+
},
|
|
4859
|
+
data() {
|
|
4860
|
+
return {
|
|
4861
|
+
current: 0,
|
|
4862
|
+
currentSlotComponentRef: null
|
|
4863
|
+
};
|
|
4864
|
+
},
|
|
4865
|
+
computed: {
|
|
4866
|
+
currentSlotName() {
|
|
4867
|
+
return this.scopedSlotsNames[this.current];
|
|
4868
|
+
},
|
|
4869
|
+
footerElements() {
|
|
4870
|
+
const {
|
|
4871
|
+
elements
|
|
4872
|
+
} = this.footerMeta;
|
|
4873
|
+
return elements.call(this);
|
|
4874
|
+
},
|
|
4875
|
+
assignAttrForEvents() {
|
|
4876
|
+
const events = this.footerElements.reduce((ret, ele) => {
|
|
4877
|
+
ret[ele.eventName] = e => {
|
|
4878
|
+
this.$emit(ele.eventName || 'click', {
|
|
4879
|
+
...e,
|
|
4880
|
+
exposed: this.exposedMethods
|
|
4881
|
+
});
|
|
4882
|
+
};
|
|
4883
|
+
return ret;
|
|
4884
|
+
}, {});
|
|
4885
|
+
return {
|
|
4886
|
+
...this.$listeners,
|
|
4887
|
+
...events,
|
|
4888
|
+
[BUILT_IN_EVENT_NAMES.NEXT]: this[BUILT_IN_EVENT_NAMES.NEXT],
|
|
4889
|
+
[BUILT_IN_EVENT_NAMES.PREVIOUS]: this[BUILT_IN_EVENT_NAMES.PREVIOUS]
|
|
4890
|
+
};
|
|
4891
|
+
},
|
|
4892
|
+
activeIndex() {
|
|
4893
|
+
const {
|
|
4894
|
+
activeIndex
|
|
4895
|
+
} = this.stepMeta;
|
|
4896
|
+
return activeIndex;
|
|
4897
|
+
},
|
|
4898
|
+
elements() {
|
|
4899
|
+
const {
|
|
4900
|
+
elements
|
|
4901
|
+
} = this.stepMeta;
|
|
4902
|
+
return elements;
|
|
4903
|
+
},
|
|
4904
|
+
scopedSlotsNames() {
|
|
4905
|
+
const slotNames = this.elements.map(item => item.key);
|
|
4906
|
+
return slotNames;
|
|
4907
|
+
},
|
|
4908
|
+
exposedMethods() {
|
|
4909
|
+
return {
|
|
4910
|
+
slotRef: this.currentSlotComponentRef,
|
|
4911
|
+
setCurrentStep: this.setCurrentStep,
|
|
4912
|
+
next: this.nextStep,
|
|
4913
|
+
prev: this.prevStep,
|
|
4914
|
+
current: this.current
|
|
4915
|
+
};
|
|
4916
|
+
}
|
|
4917
|
+
},
|
|
4918
|
+
watch: {
|
|
4919
|
+
activeIndex: {
|
|
4920
|
+
handler(idx) {
|
|
4921
|
+
this.current = idx;
|
|
4922
|
+
},
|
|
4923
|
+
immediate: true
|
|
4924
|
+
},
|
|
4925
|
+
current: {
|
|
4926
|
+
handler() {
|
|
4927
|
+
this.$nextTick(() => {
|
|
4928
|
+
this.currentSlotComponentRef = this.getCurrentSlotComponentRef();
|
|
4929
|
+
});
|
|
4930
|
+
},
|
|
4931
|
+
immediate: true
|
|
4932
|
+
}
|
|
4933
|
+
},
|
|
4934
|
+
methods: {
|
|
4935
|
+
getCurrentSlotComponentRef() {
|
|
4936
|
+
const includeMetaCmp = this.$children.find(child => child.meta);
|
|
4937
|
+
if (!includeMetaCmp) return null;
|
|
4938
|
+
const {
|
|
4939
|
+
$children: components
|
|
4940
|
+
} = includeMetaCmp;
|
|
4941
|
+
const target = components.find(cmp => cmp.$options._componentTag === 'ele-tpl');
|
|
4942
|
+
return target.getModel ? target.getModel() : null;
|
|
4943
|
+
},
|
|
4944
|
+
setCurrentStep(index) {
|
|
4945
|
+
this.current = index;
|
|
4946
|
+
},
|
|
4947
|
+
nextStep() {
|
|
4948
|
+
if (this.current >= this.elements.length - 1) return;
|
|
4949
|
+
this.current++;
|
|
4950
|
+
},
|
|
4951
|
+
prevStep() {
|
|
4952
|
+
if (this.current <= 0) return;
|
|
4953
|
+
this.current--;
|
|
4954
|
+
},
|
|
4955
|
+
[BUILT_IN_EVENT_NAMES.NEXT](props) {
|
|
4956
|
+
this.$emit(BUILT_IN_EVENT_NAMES.NEXT, {
|
|
4957
|
+
...props,
|
|
4958
|
+
exposed: {
|
|
4959
|
+
...this.exposedMethods
|
|
4960
|
+
}
|
|
4961
|
+
});
|
|
4962
|
+
},
|
|
4963
|
+
[BUILT_IN_EVENT_NAMES.PREVIOUS](props) {
|
|
4964
|
+
this.$emit(BUILT_IN_EVENT_NAMES.PREVIOUS, {
|
|
4965
|
+
...props,
|
|
4966
|
+
exposed: {
|
|
4967
|
+
...this.exposedMethods
|
|
4968
|
+
}
|
|
4969
|
+
});
|
|
4970
|
+
}
|
|
4971
|
+
}
|
|
4972
|
+
};
|
|
4973
|
+
|
|
4974
|
+
/* script */
|
|
4975
|
+
const __vue_script__$7 = script$7;
|
|
4976
|
+
|
|
4977
|
+
/* template */
|
|
4978
|
+
var __vue_render__$7 = function () {
|
|
4979
|
+
var _vm = this;
|
|
4980
|
+
var _h = _vm.$createElement;
|
|
4981
|
+
var _c = _vm._self._c || _h;
|
|
4982
|
+
return _c("div", { staticClass: "ele-step-model__wrapper" }, [
|
|
4983
|
+
_c(
|
|
4984
|
+
"div",
|
|
4985
|
+
{ staticClass: "ele-step-model__step--wrapper" },
|
|
4986
|
+
[
|
|
4987
|
+
_c(
|
|
4988
|
+
"a-steps",
|
|
4989
|
+
{
|
|
4990
|
+
staticClass: "ele-steps",
|
|
4991
|
+
attrs: { current: _vm.current, size: "small" },
|
|
4992
|
+
},
|
|
4993
|
+
_vm._l(_vm.elements, function (step) {
|
|
4994
|
+
return _c("a-step", { key: step.key, attrs: { title: step.title } })
|
|
4995
|
+
}),
|
|
4996
|
+
1
|
|
4997
|
+
),
|
|
4998
|
+
],
|
|
4999
|
+
1
|
|
5000
|
+
),
|
|
5001
|
+
_vm._v(" "),
|
|
5002
|
+
_c(
|
|
5003
|
+
"div",
|
|
5004
|
+
{ staticClass: "ele-step-model__content--wrapper" },
|
|
5005
|
+
[
|
|
5006
|
+
_vm._l(_vm.scopedSlotsNames, function (name) {
|
|
5007
|
+
return [
|
|
5008
|
+
_vm.currentSlotName == name
|
|
5009
|
+
? _c(
|
|
5010
|
+
"div",
|
|
5011
|
+
{
|
|
5012
|
+
key: name,
|
|
5013
|
+
class: [
|
|
5014
|
+
"ele-step-model__slot",
|
|
5015
|
+
"ele-step-model__slot--" + name,
|
|
5016
|
+
],
|
|
5017
|
+
},
|
|
5018
|
+
[_vm._t(name)],
|
|
5019
|
+
2
|
|
5020
|
+
)
|
|
5021
|
+
: _vm._e(),
|
|
5022
|
+
]
|
|
5023
|
+
}),
|
|
5024
|
+
],
|
|
5025
|
+
2
|
|
5026
|
+
),
|
|
5027
|
+
_vm._v(" "),
|
|
5028
|
+
_c(
|
|
5029
|
+
"div",
|
|
5030
|
+
{ staticClass: "ele-step-model__footer--wrapper" },
|
|
5031
|
+
[
|
|
5032
|
+
_c(
|
|
5033
|
+
"ele-button-group",
|
|
5034
|
+
_vm._g(
|
|
5035
|
+
{ attrs: { "data-source": _vm.footerElements } },
|
|
5036
|
+
_vm.assignAttrForEvents
|
|
5037
|
+
)
|
|
5038
|
+
),
|
|
5039
|
+
],
|
|
5040
|
+
1
|
|
5041
|
+
),
|
|
5042
|
+
])
|
|
5043
|
+
};
|
|
5044
|
+
var __vue_staticRenderFns__$7 = [];
|
|
5045
|
+
__vue_render__$7._withStripped = true;
|
|
3985
5046
|
|
|
3986
5047
|
/* style */
|
|
3987
|
-
const __vue_inject_styles__$
|
|
5048
|
+
const __vue_inject_styles__$7 = function (inject) {
|
|
3988
5049
|
if (!inject) return
|
|
3989
|
-
inject("data-v-
|
|
5050
|
+
inject("data-v-ef1ef15c_0", { source: ".ele-step-model__wrapper[data-v-ef1ef15c] {\n width: 100%;\n height: 100vh;\n position: relative;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper[data-v-ef1ef15c] {\n width: 100%;\n height: 64px;\n padding: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n background: #fff;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper .ele-steps .ant-steps-item[data-v-ef1ef15c] {\n text-align: left;\n}\n.ele-step-model__wrapper .ele-step-model__content--wrapper[data-v-ef1ef15c] {\n width: 100%;\n width: 100%;\n margin-top: 16px;\n margin-bottom: 16px;\n height: calc(100vh - 64px - 64px - 16px - 16px);\n overflow: auto;\n}\n.ele-step-model__wrapper .ele-step-model__footer--wrapper[data-v-ef1ef15c] {\n width: 100%;\n height: 64px;\n background: #fff;\n position: absolute;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\step-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AAsIA;EACA,WAAA;EACA,aAAA;EACA,kBAAA;ACrIA;ADsIA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,gBAAA;ACpIA;ADsIA;EACA,gBAAA;ACpIA;ADwIA;EACA,WAAA;EACA,WAAA;EACA,gBAAA;EACA,mBAAA;EACA,+CAAA;EACA,cAAA;ACtIA;ADwIA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;EACA,kBAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;ACtIA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"ele-step-model__wrapper\">\r\n <div class=\"ele-step-model__step--wrapper\">\r\n <a-steps class=\"ele-steps\" :current=\"current\" size=\"small\">\r\n <a-step v-for=\"step in elements\" :title=\"step.title\" :key=\"step.key\" />\r\n </a-steps>\r\n </div>\r\n <div class=\"ele-step-model__content--wrapper\">\r\n <template v-for=\"name in scopedSlotsNames\">\r\n <div :key=\"name\" v-if=\"currentSlotName == name\" :class=\"['ele-step-model__slot', `ele-step-model__slot--${name}`]\">\r\n <slot :name=\"name\"></slot>\r\n </div>\r\n </template>\r\n </div>\r\n <div class=\"ele-step-model__footer--wrapper\">\r\n <ele-button-group v-on=\"assignAttrForEvents\" :data-source=\"footerElements\"></ele-button-group>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleButtonGroup from '../../composite-components/button-group/src/index.vue'\r\nimport { BUILT_IN_EVENT_NAMES } from '../../utils'\r\nexport default {\r\n name: 'ele-step-model',\r\n components: {\r\n EleButtonGroup\r\n },\r\n props: {\r\n stepMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n footerMeta: {\r\n type: Object,\r\n default: () => ({})\r\n }\r\n },\r\n data() {\r\n return {\r\n current: 0,\r\n currentSlotComponentRef: null\r\n }\r\n },\r\n computed: {\r\n currentSlotName () {\r\n return this.scopedSlotsNames[this.current]\r\n },\r\n footerElements () {\r\n const { elements } = this.footerMeta\r\n return elements.call(this)\r\n },\r\n assignAttrForEvents () {\r\n const events = this.footerElements.reduce((ret, ele) => {\r\n ret[ele.eventName] = (e) => {\r\n this.$emit(ele.eventName || 'click', { ...e, exposed: this.exposedMethods })\r\n }\r\n return ret\r\n }, {})\r\n return {\r\n ...this.$listeners,\r\n ...events,\r\n [BUILT_IN_EVENT_NAMES.NEXT]: this[BUILT_IN_EVENT_NAMES.NEXT],\r\n [BUILT_IN_EVENT_NAMES.PREVIOUS]: this[BUILT_IN_EVENT_NAMES.PREVIOUS]\r\n }\r\n },\r\n activeIndex () {\r\n const { activeIndex } = this.stepMeta\r\n return activeIndex\r\n },\r\n elements () {\r\n const { elements } = this.stepMeta\r\n return elements\r\n },\r\n scopedSlotsNames () {\r\n const slotNames = this.elements.map(item => item.key)\r\n return slotNames\r\n },\r\n exposedMethods () {\r\n return {\r\n slotRef: this.currentSlotComponentRef,\r\n setCurrentStep: this.setCurrentStep,\r\n next: this.nextStep,\r\n prev: this.prevStep,\r\n current: this.current\r\n }\r\n }\r\n },\r\n watch: {\r\n activeIndex: {\r\n handler (idx) {\r\n this.current = idx\r\n },\r\n immediate: true\r\n },\r\n current: {\r\n handler () {\r\n this.$nextTick(() => {\r\n this.currentSlotComponentRef = this.getCurrentSlotComponentRef()\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n getCurrentSlotComponentRef () {\r\n const includeMetaCmp = this.$children.find(child => child.meta)\r\n if (!includeMetaCmp) return null\r\n const { $children: components } = includeMetaCmp\r\n const target = components.find(cmp => cmp.$options._componentTag === 'ele-tpl')\r\n return target.getModel ? target.getModel() : null\r\n },\r\n setCurrentStep (index) {\r\n this.current = index\r\n },\r\n nextStep () {\r\n if (this.current >= this.elements.length - 1) return\r\n this.current ++\r\n },\r\n prevStep () {\r\n if (this.current <= 0) return\r\n this.current --\r\n },\r\n [BUILT_IN_EVENT_NAMES.NEXT] (props) {\r\n this.$emit(BUILT_IN_EVENT_NAMES.NEXT, { ...props, exposed: { ...this.exposedMethods } })\r\n },\r\n [BUILT_IN_EVENT_NAMES.PREVIOUS] (props) {\r\n this.$emit(BUILT_IN_EVENT_NAMES.PREVIOUS, { ...props, exposed: { ...this.exposedMethods } })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele-step-model__wrapper {\r\n width: 100%;\r\n height: 100vh;\r\n position: relative;\r\n .ele-step-model__step--wrapper {\r\n width: 100%;\r\n height: 64px;\r\n padding: 16px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n background: #fff;\r\n .ele-steps {\r\n .ant-steps-item {\r\n text-align: left;\r\n }\r\n }\r\n }\r\n .ele-step-model__content--wrapper {\r\n width: 100%;\r\n width: 100%;\r\n margin-top: 16px;\r\n margin-bottom: 16px;\r\n height: calc(100vh - 64px - 64px - 16px - 16px);\r\n overflow: auto;\r\n }\r\n .ele-step-model__footer--wrapper {\r\n width: 100%;\r\n height: 64px;\r\n background: #fff;\r\n position: absolute;\r\n bottom: 0;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: end;\r\n }\r\n}\r\n</style>import meta from '@/views/tree-table-page/meta'\r\n",".ele-step-model__wrapper {\n width: 100%;\n height: 100vh;\n position: relative;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper {\n width: 100%;\n height: 64px;\n padding: 16px;\n display: flex;\n flex-direction: row;\n align-items: center;\n background: #fff;\n}\n.ele-step-model__wrapper .ele-step-model__step--wrapper .ele-steps .ant-steps-item {\n text-align: left;\n}\n.ele-step-model__wrapper .ele-step-model__content--wrapper {\n width: 100%;\n width: 100%;\n margin-top: 16px;\n margin-bottom: 16px;\n height: calc(100vh - 64px - 64px - 16px - 16px);\n overflow: auto;\n}\n.ele-step-model__wrapper .ele-step-model__footer--wrapper {\n width: 100%;\n height: 64px;\n background: #fff;\n position: absolute;\n bottom: 0;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3990
5051
|
|
|
3991
5052
|
};
|
|
3992
5053
|
/* scoped */
|
|
3993
|
-
const __vue_scope_id__$
|
|
5054
|
+
const __vue_scope_id__$7 = "data-v-ef1ef15c";
|
|
3994
5055
|
/* module identifier */
|
|
3995
|
-
const __vue_module_identifier__$
|
|
5056
|
+
const __vue_module_identifier__$7 = undefined;
|
|
3996
5057
|
/* functional template */
|
|
3997
|
-
const __vue_is_functional_template__$
|
|
5058
|
+
const __vue_is_functional_template__$7 = false;
|
|
3998
5059
|
/* style inject SSR */
|
|
3999
5060
|
|
|
4000
5061
|
/* style inject shadow dom */
|
|
4001
5062
|
|
|
4002
5063
|
|
|
4003
5064
|
|
|
4004
|
-
const __vue_component__$
|
|
4005
|
-
{ render: __vue_render__$
|
|
4006
|
-
__vue_inject_styles__$
|
|
4007
|
-
__vue_script__$
|
|
4008
|
-
__vue_scope_id__$
|
|
4009
|
-
__vue_is_functional_template__$
|
|
4010
|
-
__vue_module_identifier__$
|
|
5065
|
+
const __vue_component__$7 = /*#__PURE__*/normalizeComponent(
|
|
5066
|
+
{ render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
|
|
5067
|
+
__vue_inject_styles__$7,
|
|
5068
|
+
__vue_script__$7,
|
|
5069
|
+
__vue_scope_id__$7,
|
|
5070
|
+
__vue_is_functional_template__$7,
|
|
5071
|
+
__vue_module_identifier__$7,
|
|
4011
5072
|
false,
|
|
4012
5073
|
createInjector,
|
|
4013
5074
|
undefined,
|
|
4014
5075
|
undefined
|
|
4015
5076
|
);
|
|
4016
5077
|
|
|
4017
|
-
|
|
5078
|
+
//
|
|
5079
|
+
var script$6 = {
|
|
5080
|
+
name: 'ele-tpl',
|
|
5081
|
+
props: {
|
|
5082
|
+
modelName: {
|
|
5083
|
+
type: String
|
|
5084
|
+
}
|
|
5085
|
+
},
|
|
5086
|
+
components: {
|
|
5087
|
+
[__vue_component__$i.name]: __vue_component__$i,
|
|
5088
|
+
[__vue_component__$9.name]: __vue_component__$9,
|
|
5089
|
+
[__vue_component__$7.name]: __vue_component__$7,
|
|
5090
|
+
[__vue_component__$8.name]: __vue_component__$8
|
|
5091
|
+
},
|
|
5092
|
+
computed: {
|
|
5093
|
+
modelNameValidator() {
|
|
5094
|
+
const target = models.find(model => model.name === this.modelName);
|
|
5095
|
+
return {
|
|
5096
|
+
existed: !!target,
|
|
5097
|
+
message: !!target ? '' : `Model <span style="color:red;">${this.modelName}</span> not found`
|
|
5098
|
+
};
|
|
5099
|
+
},
|
|
5100
|
+
genModelRef() {
|
|
5101
|
+
return v4();
|
|
5102
|
+
}
|
|
5103
|
+
},
|
|
5104
|
+
methods: {
|
|
5105
|
+
getModel() {
|
|
5106
|
+
return this.$refs[this.genModelRef];
|
|
5107
|
+
}
|
|
5108
|
+
}
|
|
5109
|
+
};
|
|
5110
|
+
|
|
5111
|
+
/* script */
|
|
5112
|
+
const __vue_script__$6 = script$6;
|
|
5113
|
+
|
|
5114
|
+
/* template */
|
|
5115
|
+
var __vue_render__$6 = function () {
|
|
5116
|
+
var _vm = this;
|
|
5117
|
+
var _h = _vm.$createElement;
|
|
5118
|
+
var _c = _vm._self._c || _h;
|
|
5119
|
+
return _vm.modelNameValidator.existed
|
|
5120
|
+
? _c(
|
|
5121
|
+
_vm.modelName,
|
|
5122
|
+
_vm._g(
|
|
5123
|
+
_vm._b(
|
|
5124
|
+
{
|
|
5125
|
+
ref: _vm.genModelRef,
|
|
5126
|
+
tag: "component",
|
|
5127
|
+
scopedSlots: _vm._u(
|
|
5128
|
+
[
|
|
5129
|
+
_vm._l(_vm.$scopedSlots, function (idx, name) {
|
|
5130
|
+
return {
|
|
5131
|
+
key: name,
|
|
5132
|
+
fn: function (data) {
|
|
5133
|
+
return [_vm._t(name, null, null, data)]
|
|
5134
|
+
},
|
|
5135
|
+
}
|
|
5136
|
+
}),
|
|
5137
|
+
],
|
|
5138
|
+
null,
|
|
5139
|
+
true
|
|
5140
|
+
),
|
|
5141
|
+
},
|
|
5142
|
+
"component",
|
|
5143
|
+
_vm.$attrs,
|
|
5144
|
+
false
|
|
5145
|
+
),
|
|
5146
|
+
_vm.$listeners
|
|
5147
|
+
)
|
|
5148
|
+
)
|
|
5149
|
+
: _c("div", {
|
|
5150
|
+
domProps: { innerHTML: _vm._s(_vm.modelNameValidator.message) },
|
|
5151
|
+
})
|
|
5152
|
+
};
|
|
5153
|
+
var __vue_staticRenderFns__$6 = [];
|
|
5154
|
+
__vue_render__$6._withStripped = true;
|
|
5155
|
+
|
|
5156
|
+
/* style */
|
|
5157
|
+
const __vue_inject_styles__$6 = function (inject) {
|
|
5158
|
+
if (!inject) return
|
|
5159
|
+
inject("data-v-ea20e66e_0", { source: ".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-008: rgba(0, 0, 0, 0.88);\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,qBAAqB;AACvB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AACA;EACE,cAAc;AAChB;AAEA;EACE,+BAA+B;EAC/B,sCAAsC;EACtC,sCAAsC;EACtC,sCAAsC;EACtC,uCAAuC;EACvC,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;EACrC,qDAAqD;EACrD,kDAAkD;EAClD,gDAAgD;EAChD,gCAAgC;EAChC,uCAAuC;EACvC,yBAAyB;EACzB,yBAAyB;AAC3B;;AAEA,oCAAoC","file":"index.vue","sourcesContent":[".has-error .ele-upload__wrapper .ele-upload__inner {\n border-color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--icon .anticon-cloud-upload {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__message {\n color: #F5222D;\n}\n.has-error .ele-upload__wrapper .ele-upload__inner .ele-upload__area .ele-upload__area--text .ele-upload__ext {\n color: #FFA39E;\n}\n\n:root {\n --idooel-primary-color: #1890FF;\n --idoole-black-02: rgba(0, 0, 0, 0.04);\n --idoole-black-06: rgba(0, 0, 0, 0.44);\n --idoole-black-07: rgba(0, 0, 0, 0.64);\n --idoole-black-008: rgba(0, 0, 0, 0.88);\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n --idooel-form-title-border-color: rgba(0, 0, 0, 0.16);\n --idooel-form-upload-bg-color: rgba(0, 0, 0, 0.02);\n --idooel-form-upload-border-hover-color: #40A9FF;\n --idooel-form-border-radius: 2px;\n --idooel-form-border-err-color: #F5222D;\n --idooel-link-06: #1890FF;\n --idooel-link-03: #91D5FF;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
5160
|
+
|
|
5161
|
+
};
|
|
5162
|
+
/* scoped */
|
|
5163
|
+
const __vue_scope_id__$6 = undefined;
|
|
5164
|
+
/* module identifier */
|
|
5165
|
+
const __vue_module_identifier__$6 = undefined;
|
|
5166
|
+
/* functional template */
|
|
5167
|
+
const __vue_is_functional_template__$6 = false;
|
|
5168
|
+
/* style inject SSR */
|
|
5169
|
+
|
|
5170
|
+
/* style inject shadow dom */
|
|
5171
|
+
|
|
5172
|
+
|
|
5173
|
+
|
|
5174
|
+
const __vue_component__$6 = /*#__PURE__*/normalizeComponent(
|
|
5175
|
+
{ render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
|
|
5176
|
+
__vue_inject_styles__$6,
|
|
5177
|
+
__vue_script__$6,
|
|
5178
|
+
__vue_scope_id__$6,
|
|
5179
|
+
__vue_is_functional_template__$6,
|
|
5180
|
+
__vue_module_identifier__$6,
|
|
5181
|
+
false,
|
|
5182
|
+
createInjector,
|
|
5183
|
+
undefined,
|
|
5184
|
+
undefined
|
|
5185
|
+
);
|
|
5186
|
+
|
|
5187
|
+
__vue_component__$6.install = Vue => Vue.component(__vue_component__$6.name, __vue_component__$6);
|
|
5188
|
+
|
|
5189
|
+
__vue_component__$a.install = Vue => Vue.component(__vue_component__$a.name, __vue_component__$a);
|
|
4018
5190
|
|
|
5191
|
+
//
|
|
5192
|
+
//
|
|
5193
|
+
//
|
|
5194
|
+
//
|
|
5195
|
+
//
|
|
4019
5196
|
//
|
|
4020
5197
|
//
|
|
4021
5198
|
//
|
|
@@ -4023,63 +5200,97 @@ __vue_component__$4.install = Vue => Vue.component(__vue_component__$4.name, __v
|
|
|
4023
5200
|
//
|
|
4024
5201
|
//
|
|
4025
5202
|
|
|
4026
|
-
var script$
|
|
4027
|
-
name: '
|
|
5203
|
+
var script$5 = {
|
|
5204
|
+
name: 'ele-alert',
|
|
5205
|
+
props: {
|
|
5206
|
+
type: {
|
|
5207
|
+
type: String,
|
|
5208
|
+
default: 'success'
|
|
5209
|
+
},
|
|
5210
|
+
showIcon: {
|
|
5211
|
+
type: Boolean,
|
|
5212
|
+
default: true
|
|
5213
|
+
},
|
|
5214
|
+
message: {
|
|
5215
|
+
type: String,
|
|
5216
|
+
default: 'Success Tips'
|
|
5217
|
+
},
|
|
5218
|
+
description: {
|
|
5219
|
+
type: String
|
|
5220
|
+
},
|
|
5221
|
+
closable: {
|
|
5222
|
+
type: Boolean,
|
|
5223
|
+
default: true
|
|
5224
|
+
},
|
|
5225
|
+
closeText: {
|
|
5226
|
+
type: String
|
|
5227
|
+
}
|
|
5228
|
+
}
|
|
4028
5229
|
};
|
|
4029
5230
|
|
|
4030
5231
|
/* script */
|
|
4031
|
-
const __vue_script__$
|
|
5232
|
+
const __vue_script__$5 = script$5;
|
|
4032
5233
|
|
|
4033
5234
|
/* template */
|
|
4034
|
-
var __vue_render__$
|
|
5235
|
+
var __vue_render__$5 = function () {
|
|
4035
5236
|
var _vm = this;
|
|
4036
5237
|
var _h = _vm.$createElement;
|
|
4037
5238
|
var _c = _vm._self._c || _h;
|
|
4038
|
-
return _c("
|
|
5239
|
+
return _c("a-alert", {
|
|
5240
|
+
staticClass: "ele-alert",
|
|
5241
|
+
attrs: {
|
|
5242
|
+
message: _vm.message,
|
|
5243
|
+
description: _vm.description,
|
|
5244
|
+
type: _vm.type,
|
|
5245
|
+
closable: _vm.closable,
|
|
5246
|
+
closeText: _vm.closeText,
|
|
5247
|
+
"show-icon": _vm.showIcon,
|
|
5248
|
+
},
|
|
5249
|
+
})
|
|
4039
5250
|
};
|
|
4040
|
-
var __vue_staticRenderFns__$
|
|
4041
|
-
__vue_render__$
|
|
5251
|
+
var __vue_staticRenderFns__$5 = [];
|
|
5252
|
+
__vue_render__$5._withStripped = true;
|
|
4042
5253
|
|
|
4043
5254
|
/* style */
|
|
4044
|
-
const __vue_inject_styles__$
|
|
5255
|
+
const __vue_inject_styles__$5 = function (inject) {
|
|
4045
5256
|
if (!inject) return
|
|
4046
|
-
inject("data-v-
|
|
5257
|
+
inject("data-v-5f94c62c_0", { source: ".ele-alert[data-v-5f94c62c] {\n text-align: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\alert\\src\\index.vue","index.vue"],"names":[],"mappings":"AA0CA;EACA,2BAAA;ACzCA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <a-alert\r\n class=\"ele-alert\"\r\n :message=\"message\" \r\n :description=\"description\" \r\n :type=\"type\"\r\n :closable=\"closable\"\r\n :closeText=\"closeText\"\r\n :show-icon=\"showIcon\" />\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-alert',\r\n props: {\r\n type: {\r\n type: String,\r\n default: 'success'\r\n },\r\n showIcon: {\r\n type: Boolean,\r\n default: true\r\n },\r\n message: {\r\n type: String,\r\n default: 'Success Tips'\r\n },\r\n description: {\r\n type: String\r\n },\r\n closable: {\r\n type: Boolean,\r\n default: true\r\n },\r\n closeText: {\r\n type: String\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele-alert {\r\n text-align: left !important;\r\n}\r\n</style>",".ele-alert {\n text-align: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4047
5258
|
|
|
4048
5259
|
};
|
|
4049
5260
|
/* scoped */
|
|
4050
|
-
const __vue_scope_id__$
|
|
5261
|
+
const __vue_scope_id__$5 = "data-v-5f94c62c";
|
|
4051
5262
|
/* module identifier */
|
|
4052
|
-
const __vue_module_identifier__$
|
|
5263
|
+
const __vue_module_identifier__$5 = undefined;
|
|
4053
5264
|
/* functional template */
|
|
4054
|
-
const __vue_is_functional_template__$
|
|
4055
|
-
/* style inject SSR */
|
|
4056
|
-
|
|
4057
|
-
/* style inject shadow dom */
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
const __vue_component__$
|
|
4062
|
-
{ render: __vue_render__$
|
|
4063
|
-
__vue_inject_styles__$
|
|
4064
|
-
__vue_script__$
|
|
4065
|
-
__vue_scope_id__$
|
|
4066
|
-
__vue_is_functional_template__$
|
|
4067
|
-
__vue_module_identifier__$
|
|
5265
|
+
const __vue_is_functional_template__$5 = false;
|
|
5266
|
+
/* style inject SSR */
|
|
5267
|
+
|
|
5268
|
+
/* style inject shadow dom */
|
|
5269
|
+
|
|
5270
|
+
|
|
5271
|
+
|
|
5272
|
+
const __vue_component__$5 = /*#__PURE__*/normalizeComponent(
|
|
5273
|
+
{ render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
|
|
5274
|
+
__vue_inject_styles__$5,
|
|
5275
|
+
__vue_script__$5,
|
|
5276
|
+
__vue_scope_id__$5,
|
|
5277
|
+
__vue_is_functional_template__$5,
|
|
5278
|
+
__vue_module_identifier__$5,
|
|
4068
5279
|
false,
|
|
4069
5280
|
createInjector,
|
|
4070
5281
|
undefined,
|
|
4071
5282
|
undefined
|
|
4072
5283
|
);
|
|
4073
5284
|
|
|
4074
|
-
__vue_component__$
|
|
5285
|
+
__vue_component__$5.install = Vue => Vue.component(__vue_component__$5.name, __vue_component__$5);
|
|
4075
5286
|
|
|
4076
|
-
__vue_component__$
|
|
5287
|
+
__vue_component__$f.install = Vue => Vue.component(__vue_component__$f.name, __vue_component__$f);
|
|
4077
5288
|
|
|
4078
|
-
__vue_component__$
|
|
5289
|
+
__vue_component__$e.install = Vue => Vue.component(__vue_component__$e.name, __vue_component__$e);
|
|
4079
5290
|
|
|
4080
|
-
__vue_component__$
|
|
5291
|
+
__vue_component__$g.install = Vue => Vue.component(__vue_component__$g.name, __vue_component__$g);
|
|
4081
5292
|
|
|
4082
|
-
__vue_component__$
|
|
5293
|
+
__vue_component__$d.install = Vue => Vue.component(__vue_component__$d.name, __vue_component__$d);
|
|
4083
5294
|
|
|
4084
5295
|
//
|
|
4085
5296
|
//
|
|
@@ -4103,8 +5314,17 @@ __vue_component__$7.install = Vue => Vue.component(__vue_component__$7.name, __v
|
|
|
4103
5314
|
//
|
|
4104
5315
|
//
|
|
4105
5316
|
//
|
|
5317
|
+
//
|
|
5318
|
+
//
|
|
5319
|
+
//
|
|
5320
|
+
//
|
|
5321
|
+
//
|
|
5322
|
+
//
|
|
5323
|
+
//
|
|
5324
|
+
//
|
|
5325
|
+
//
|
|
4106
5326
|
|
|
4107
|
-
var script$
|
|
5327
|
+
var script$4 = {
|
|
4108
5328
|
name: 'ele-modal',
|
|
4109
5329
|
props: {
|
|
4110
5330
|
value: {
|
|
@@ -4125,7 +5345,7 @@ var script$2 = {
|
|
|
4125
5345
|
},
|
|
4126
5346
|
size: {
|
|
4127
5347
|
type: String,
|
|
4128
|
-
default: '
|
|
5348
|
+
default: 'middle'
|
|
4129
5349
|
},
|
|
4130
5350
|
map: {
|
|
4131
5351
|
type: Object,
|
|
@@ -4152,6 +5372,10 @@ var script$2 = {
|
|
|
4152
5372
|
onlyClose: {
|
|
4153
5373
|
type: Boolean,
|
|
4154
5374
|
default: false
|
|
5375
|
+
},
|
|
5376
|
+
buttonGroupMeta: {
|
|
5377
|
+
type: Object,
|
|
5378
|
+
default: () => ({})
|
|
4155
5379
|
}
|
|
4156
5380
|
},
|
|
4157
5381
|
watch: {
|
|
@@ -4192,20 +5416,305 @@ var script$2 = {
|
|
|
4192
5416
|
this.showModal = true;
|
|
4193
5417
|
this.removeHidden();
|
|
4194
5418
|
},
|
|
4195
|
-
handleCancel() {
|
|
4196
|
-
this.showModal = false;
|
|
4197
|
-
this.removeHidden();
|
|
4198
|
-
console.log('on-cancel');
|
|
4199
|
-
this.$emit('cancel');
|
|
4200
|
-
this.$emit('input', this.showModal);
|
|
5419
|
+
handleCancel() {
|
|
5420
|
+
this.showModal = false;
|
|
5421
|
+
this.removeHidden();
|
|
5422
|
+
console.log('on-cancel');
|
|
5423
|
+
this.$emit('cancel');
|
|
5424
|
+
this.$emit('input', this.showModal);
|
|
5425
|
+
},
|
|
5426
|
+
handleOk() {
|
|
5427
|
+
console.log('on-ok');
|
|
5428
|
+
this.$emit('ok');
|
|
5429
|
+
},
|
|
5430
|
+
removeHidden() {
|
|
5431
|
+
let ishidden = document.body.style.overflow === 'hidden';
|
|
5432
|
+
ishidden && (document.body.style.overflow = 'initial');
|
|
5433
|
+
}
|
|
5434
|
+
}
|
|
5435
|
+
};
|
|
5436
|
+
|
|
5437
|
+
/* script */
|
|
5438
|
+
const __vue_script__$4 = script$4;
|
|
5439
|
+
|
|
5440
|
+
/* template */
|
|
5441
|
+
var __vue_render__$4 = function () {
|
|
5442
|
+
var _vm = this;
|
|
5443
|
+
var _h = _vm.$createElement;
|
|
5444
|
+
var _c = _vm._self._c || _h;
|
|
5445
|
+
return _c(
|
|
5446
|
+
"a-modal",
|
|
5447
|
+
{
|
|
5448
|
+
attrs: {
|
|
5449
|
+
title: _vm.title,
|
|
5450
|
+
cancelText: _vm.cancelText,
|
|
5451
|
+
okText: _vm.okText,
|
|
5452
|
+
closable: _vm.closable,
|
|
5453
|
+
width: _vm.width,
|
|
5454
|
+
keyboard: false,
|
|
5455
|
+
maskClosable: _vm.maskClosable,
|
|
5456
|
+
dialogStyle: { top: _vm.upDownDistance[_vm.size] + "px" },
|
|
5457
|
+
bodyStyle: { maxHeight: _vm.maxheight, overflowY: "auto" },
|
|
5458
|
+
footer: _vm.showFooter ? undefined : null,
|
|
5459
|
+
},
|
|
5460
|
+
on: { cancel: _vm.handleCancel, ok: _vm.handleOk },
|
|
5461
|
+
model: {
|
|
5462
|
+
value: _vm.showModal,
|
|
5463
|
+
callback: function ($$v) {
|
|
5464
|
+
_vm.showModal = $$v;
|
|
5465
|
+
},
|
|
5466
|
+
expression: "showModal",
|
|
5467
|
+
},
|
|
5468
|
+
},
|
|
5469
|
+
[
|
|
5470
|
+
_vm._t("default"),
|
|
5471
|
+
_vm._v(" "),
|
|
5472
|
+
_c("template", { slot: "footer" }, [
|
|
5473
|
+
_c(
|
|
5474
|
+
"div",
|
|
5475
|
+
{ staticClass: "ele-modal__footer" },
|
|
5476
|
+
_vm._l(_vm.buttonGroupMeta.elements, function (btn) {
|
|
5477
|
+
return _c(
|
|
5478
|
+
"ele-button",
|
|
5479
|
+
_vm._g(
|
|
5480
|
+
{
|
|
5481
|
+
key: btn.key,
|
|
5482
|
+
attrs: { type: btn.type, "event-name": btn.eventName },
|
|
5483
|
+
},
|
|
5484
|
+
_vm.$listeners
|
|
5485
|
+
),
|
|
5486
|
+
[_vm._v("\n " + _vm._s(btn.label) + "\n ")]
|
|
5487
|
+
)
|
|
5488
|
+
}),
|
|
5489
|
+
1
|
|
5490
|
+
),
|
|
5491
|
+
]),
|
|
5492
|
+
],
|
|
5493
|
+
2
|
|
5494
|
+
)
|
|
5495
|
+
};
|
|
5496
|
+
var __vue_staticRenderFns__$4 = [];
|
|
5497
|
+
__vue_render__$4._withStripped = true;
|
|
5498
|
+
|
|
5499
|
+
/* style */
|
|
5500
|
+
const __vue_inject_styles__$4 = undefined;
|
|
5501
|
+
/* scoped */
|
|
5502
|
+
const __vue_scope_id__$4 = undefined;
|
|
5503
|
+
/* module identifier */
|
|
5504
|
+
const __vue_module_identifier__$4 = undefined;
|
|
5505
|
+
/* functional template */
|
|
5506
|
+
const __vue_is_functional_template__$4 = false;
|
|
5507
|
+
/* style inject */
|
|
5508
|
+
|
|
5509
|
+
/* style inject SSR */
|
|
5510
|
+
|
|
5511
|
+
/* style inject shadow dom */
|
|
5512
|
+
|
|
5513
|
+
|
|
5514
|
+
|
|
5515
|
+
const __vue_component__$4 = /*#__PURE__*/normalizeComponent(
|
|
5516
|
+
{ render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
|
|
5517
|
+
__vue_inject_styles__$4,
|
|
5518
|
+
__vue_script__$4,
|
|
5519
|
+
__vue_scope_id__$4,
|
|
5520
|
+
__vue_is_functional_template__$4,
|
|
5521
|
+
__vue_module_identifier__$4,
|
|
5522
|
+
false,
|
|
5523
|
+
undefined,
|
|
5524
|
+
undefined,
|
|
5525
|
+
undefined
|
|
5526
|
+
);
|
|
5527
|
+
|
|
5528
|
+
__vue_component__$4.install = Vue => Vue.component(__vue_component__$4.name, __vue_component__$4);
|
|
5529
|
+
|
|
5530
|
+
__vue_component__$c.install = Vue => Vue.component(__vue_component__$c.name, __vue_component__$c);
|
|
5531
|
+
|
|
5532
|
+
__vue_component__$b.install = Vue => Vue.component(__vue_component__$b.name, __vue_component__$b);
|
|
5533
|
+
|
|
5534
|
+
//
|
|
5535
|
+
var script$3 = {
|
|
5536
|
+
name: 'ele-batch-export',
|
|
5537
|
+
components: {
|
|
5538
|
+
EleIcon: __vue_component__$g
|
|
5539
|
+
},
|
|
5540
|
+
props: {
|
|
5541
|
+
value: {
|
|
5542
|
+
type: Boolean,
|
|
5543
|
+
default: false
|
|
5544
|
+
},
|
|
5545
|
+
buttonGroupMeta: {
|
|
5546
|
+
type: Object,
|
|
5547
|
+
default: () => {
|
|
5548
|
+
return {
|
|
5549
|
+
elements: [{
|
|
5550
|
+
label: '关闭',
|
|
5551
|
+
key: 'close',
|
|
5552
|
+
type: 'primary',
|
|
5553
|
+
eventName: 'handleClose'
|
|
5554
|
+
}]
|
|
5555
|
+
};
|
|
5556
|
+
}
|
|
5557
|
+
}
|
|
5558
|
+
},
|
|
5559
|
+
data() {
|
|
5560
|
+
return {
|
|
5561
|
+
innerValue: false
|
|
5562
|
+
};
|
|
5563
|
+
},
|
|
5564
|
+
watch: {
|
|
5565
|
+
value: {
|
|
5566
|
+
handler(value) {
|
|
5567
|
+
this.$nextTick(() => {
|
|
5568
|
+
this.innerValue = value;
|
|
5569
|
+
});
|
|
5570
|
+
},
|
|
5571
|
+
immediate: true
|
|
5572
|
+
}
|
|
5573
|
+
},
|
|
5574
|
+
methods: {
|
|
5575
|
+
handleClick() {
|
|
5576
|
+
this.$emit('on-batch-export');
|
|
5577
|
+
}
|
|
5578
|
+
}
|
|
5579
|
+
};
|
|
5580
|
+
|
|
5581
|
+
/* script */
|
|
5582
|
+
const __vue_script__$3 = script$3;
|
|
5583
|
+
|
|
5584
|
+
/* template */
|
|
5585
|
+
var __vue_render__$3 = function () {
|
|
5586
|
+
var _vm = this;
|
|
5587
|
+
var _h = _vm.$createElement;
|
|
5588
|
+
var _c = _vm._self._c || _h;
|
|
5589
|
+
return _c(
|
|
5590
|
+
"ele-modal",
|
|
5591
|
+
_vm._g(
|
|
5592
|
+
{
|
|
5593
|
+
attrs: { buttonGroupMeta: _vm.buttonGroupMeta, title: "批量导出" },
|
|
5594
|
+
model: {
|
|
5595
|
+
value: _vm.innerValue,
|
|
5596
|
+
callback: function ($$v) {
|
|
5597
|
+
_vm.innerValue = $$v;
|
|
5598
|
+
},
|
|
5599
|
+
expression: "innerValue",
|
|
5600
|
+
},
|
|
5601
|
+
},
|
|
5602
|
+
_vm.$listeners
|
|
5603
|
+
),
|
|
5604
|
+
[
|
|
5605
|
+
_c("div", { staticClass: "ele-batch-export__content" }, [
|
|
5606
|
+
_c(
|
|
5607
|
+
"div",
|
|
5608
|
+
{ staticClass: "ele-batch-export__container" },
|
|
5609
|
+
[
|
|
5610
|
+
_c("ele-icon", {
|
|
5611
|
+
staticClass: "ele-batch-export__icon",
|
|
5612
|
+
attrs: { type: "download" },
|
|
5613
|
+
}),
|
|
5614
|
+
_vm._v(" "),
|
|
5615
|
+
_c("div", { staticClass: "ele-batch-export__handle" }, [
|
|
5616
|
+
_c(
|
|
5617
|
+
"div",
|
|
5618
|
+
{
|
|
5619
|
+
staticClass: "ele-batch-export__btn",
|
|
5620
|
+
on: { click: _vm.handleClick },
|
|
5621
|
+
},
|
|
5622
|
+
[
|
|
5623
|
+
_vm._v(
|
|
5624
|
+
"导出任务处理中..... 请点击此按钮跳转到“批处理管理”菜单查看任务进度"
|
|
5625
|
+
),
|
|
5626
|
+
]
|
|
5627
|
+
),
|
|
5628
|
+
_vm._v(" "),
|
|
5629
|
+
_c("div", { staticClass: "ele-batch-export__btn--hint" }, [
|
|
5630
|
+
_vm._v("批处理任务的准备工作会在后台运行"),
|
|
5631
|
+
]),
|
|
5632
|
+
]),
|
|
5633
|
+
],
|
|
5634
|
+
1
|
|
5635
|
+
),
|
|
5636
|
+
_vm._v(" "),
|
|
5637
|
+
_c("div", { staticClass: "ele-batch-export__message" }, [
|
|
5638
|
+
_vm._v("\n 您可以请点击上方按钮查看任务进度或关闭弹框\n "),
|
|
5639
|
+
]),
|
|
5640
|
+
]),
|
|
5641
|
+
]
|
|
5642
|
+
)
|
|
5643
|
+
};
|
|
5644
|
+
var __vue_staticRenderFns__$3 = [];
|
|
5645
|
+
__vue_render__$3._withStripped = true;
|
|
5646
|
+
|
|
5647
|
+
/* style */
|
|
5648
|
+
const __vue_inject_styles__$3 = function (inject) {
|
|
5649
|
+
if (!inject) return
|
|
5650
|
+
inject("data-v-8734c1a2_0", { source: ".ele-batch-export__content[data-v-8734c1a2] {\n height: 106px;\n}\n.ele-batch-export__content .ele-batch-export__container[data-v-8734c1a2] {\n border-width: 1px;\n border-style: dashed;\n height: 80px;\n border-color: var(--idooel-link-06);\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__icon[data-v-8734c1a2] {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle[data-v-8734c1a2] {\n margin-left: 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn[data-v-8734c1a2] {\n color: var(--idooel-link-06);\n font-size: 16px;\n cursor: pointer;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn--hint[data-v-8734c1a2] {\n color: var(--idooel-link-03);\n font-size: 14px;\n}\n.ele-batch-export__content .ele-batch-export__message[data-v-8734c1a2] {\n color: var(--idooel-link-06);\n font-size: 14px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\batch-export\\src\\index.vue","index.vue"],"names":[],"mappings":"AAyEA;EACA,aAAA;ACxEA;ADyEA;EACA,iBAAA;EACA,oBAAA;EACA,YAAA;EACA,mCAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,eAAA;ACvEA;ADwEA;EACA,eAAA;EACA,4BAAA;ACtEA;ADwEA;EACA,iBAAA;ACtEA;ADuEA;EACA,4BAAA;EACA,eAAA;EACA,eAAA;ACrEA;ADuEA;EACA,4BAAA;EACA,eAAA;ACrEA;ADyEA;EACA,4BAAA;EACA,eAAA;ACvEA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <ele-modal \r\n v-model=\"innerValue\" \r\n v-on=\"$listeners\"\r\n :buttonGroupMeta=\"buttonGroupMeta\" \r\n title=\"批量导出\">\r\n <div class=\"ele-batch-export__content\">\r\n <div class=\"ele-batch-export__container\">\r\n <ele-icon class=\"ele-batch-export__icon\" type=\"download\"></ele-icon>\r\n <div class=\"ele-batch-export__handle\">\r\n <div class=\"ele-batch-export__btn\" @click=\"handleClick\">导出任务处理中..... 请点击此按钮跳转到“批处理管理”菜单查看任务进度</div>\r\n <div class=\"ele-batch-export__btn--hint\">批处理任务的准备工作会在后台运行</div>\r\n </div>\r\n </div>\r\n <div class=\"ele-batch-export__message\">\r\n 您可以请点击上方按钮查看任务进度或关闭弹框\r\n </div>\r\n </div>\r\n </ele-modal>\r\n</template>\r\n\r\n<script>\r\nimport EleIcon from '../../icon/src/index.vue'\r\nexport default {\r\n name: 'ele-batch-export',\r\n components: {\r\n EleIcon\r\n },\r\n props: {\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n buttonGroupMeta: {\r\n type: Object,\r\n default: () => {\r\n return {\r\n elements: [\r\n {\r\n label: '关闭',\r\n key: 'close',\r\n type: 'primary',\r\n eventName: 'handleClose'\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n },\r\n data() {\r\n return {\r\n innerValue: false\r\n }\r\n },\r\n watch: {\r\n value: {\r\n handler (value) {\r\n this.$nextTick(() => {\r\n this.innerValue = value\r\n })\r\n },\r\n immediate: true\r\n }\r\n },\r\n methods: {\r\n handleClick () {\r\n this.$emit('on-batch-export')\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.ele-batch-export__content {\r\n height: 106px;\r\n .ele-batch-export__container {\r\n border-width: 1px;\r\n border-style: dashed;\r\n height: 80px;\r\n border-color: var(--idooel-link-06);\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: 0 16px;\r\n .ele-batch-export__icon {\r\n font-size: 48px;\r\n color: var(--idooel-link-06);\r\n }\r\n .ele-batch-export__handle {\r\n margin-left: 16px;\r\n .ele-batch-export__btn {\r\n color: var(--idooel-link-06);\r\n font-size: 16px;\r\n cursor: pointer;\r\n }\r\n .ele-batch-export__btn--hint {\r\n color: var(--idooel-link-03);\r\n font-size: 14px;\r\n }\r\n }\r\n }\r\n .ele-batch-export__message {\r\n color: var(--idooel-link-06);\r\n font-size: 14px;\r\n }\r\n}\r\n</style>",".ele-batch-export__content {\n height: 106px;\n}\n.ele-batch-export__content .ele-batch-export__container {\n border-width: 1px;\n border-style: dashed;\n height: 80px;\n border-color: var(--idooel-link-06);\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__icon {\n font-size: 48px;\n color: var(--idooel-link-06);\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle {\n margin-left: 16px;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn {\n color: var(--idooel-link-06);\n font-size: 16px;\n cursor: pointer;\n}\n.ele-batch-export__content .ele-batch-export__container .ele-batch-export__handle .ele-batch-export__btn--hint {\n color: var(--idooel-link-03);\n font-size: 14px;\n}\n.ele-batch-export__content .ele-batch-export__message {\n color: var(--idooel-link-06);\n font-size: 14px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
5651
|
+
|
|
5652
|
+
};
|
|
5653
|
+
/* scoped */
|
|
5654
|
+
const __vue_scope_id__$3 = "data-v-8734c1a2";
|
|
5655
|
+
/* module identifier */
|
|
5656
|
+
const __vue_module_identifier__$3 = undefined;
|
|
5657
|
+
/* functional template */
|
|
5658
|
+
const __vue_is_functional_template__$3 = false;
|
|
5659
|
+
/* style inject SSR */
|
|
5660
|
+
|
|
5661
|
+
/* style inject shadow dom */
|
|
5662
|
+
|
|
5663
|
+
|
|
5664
|
+
|
|
5665
|
+
const __vue_component__$3 = /*#__PURE__*/normalizeComponent(
|
|
5666
|
+
{ render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
|
|
5667
|
+
__vue_inject_styles__$3,
|
|
5668
|
+
__vue_script__$3,
|
|
5669
|
+
__vue_scope_id__$3,
|
|
5670
|
+
__vue_is_functional_template__$3,
|
|
5671
|
+
__vue_module_identifier__$3,
|
|
5672
|
+
false,
|
|
5673
|
+
createInjector,
|
|
5674
|
+
undefined,
|
|
5675
|
+
undefined
|
|
5676
|
+
);
|
|
5677
|
+
|
|
5678
|
+
__vue_component__$3.install = Vue => Vue.component(__vue_component__$3.name, __vue_component__$3);
|
|
5679
|
+
|
|
5680
|
+
//
|
|
5681
|
+
//
|
|
5682
|
+
//
|
|
5683
|
+
//
|
|
5684
|
+
//
|
|
5685
|
+
//
|
|
5686
|
+
//
|
|
5687
|
+
//
|
|
5688
|
+
//
|
|
5689
|
+
//
|
|
5690
|
+
//
|
|
5691
|
+
|
|
5692
|
+
var script$2 = {
|
|
5693
|
+
name: 'ele-date-range',
|
|
5694
|
+
model: {
|
|
5695
|
+
prop: 'value',
|
|
5696
|
+
event: 'change'
|
|
5697
|
+
},
|
|
5698
|
+
props: {
|
|
5699
|
+
disabled: {
|
|
5700
|
+
type: Boolean,
|
|
5701
|
+
default: false
|
|
5702
|
+
},
|
|
5703
|
+
showTime: {
|
|
5704
|
+
type: Object
|
|
4201
5705
|
},
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
5706
|
+
format: {
|
|
5707
|
+
type: Array,
|
|
5708
|
+
default: () => ['YYYY-MM-DD', 'YYYY-MM-DD']
|
|
4205
5709
|
},
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
5710
|
+
value: {
|
|
5711
|
+
type: Array,
|
|
5712
|
+
default: () => []
|
|
5713
|
+
}
|
|
5714
|
+
},
|
|
5715
|
+
methods: {
|
|
5716
|
+
onChange(date, dateString) {
|
|
5717
|
+
this.$emit('change', dateString);
|
|
4209
5718
|
}
|
|
4210
5719
|
}
|
|
4211
5720
|
};
|
|
@@ -4218,51 +5727,32 @@ var __vue_render__$2 = function () {
|
|
|
4218
5727
|
var _vm = this;
|
|
4219
5728
|
var _h = _vm.$createElement;
|
|
4220
5729
|
var _c = _vm._self._c || _h;
|
|
4221
|
-
return _c(
|
|
4222
|
-
"
|
|
4223
|
-
{
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
closable: _vm.closable,
|
|
4229
|
-
width: _vm.width,
|
|
4230
|
-
keyboard: false,
|
|
4231
|
-
maskClosable: _vm.maskClosable,
|
|
4232
|
-
dialogStyle: { top: _vm.upDownDistance[_vm.size] + "px" },
|
|
4233
|
-
bodyStyle: { maxHeight: _vm.maxheight, overflowY: "auto" },
|
|
4234
|
-
footer: _vm.showFooter ? undefined : null,
|
|
4235
|
-
},
|
|
4236
|
-
on: { cancel: _vm.handleCancel, ok: _vm.handleOk },
|
|
4237
|
-
model: {
|
|
4238
|
-
value: _vm.showModal,
|
|
4239
|
-
callback: function ($$v) {
|
|
4240
|
-
_vm.showModal = $$v;
|
|
4241
|
-
},
|
|
4242
|
-
expression: "showModal",
|
|
4243
|
-
},
|
|
5730
|
+
return _c("a-range-picker", {
|
|
5731
|
+
staticStyle: { width: "100%" },
|
|
5732
|
+
attrs: {
|
|
5733
|
+
disabled: _vm.disabled,
|
|
5734
|
+
"show-time": _vm.showTime,
|
|
5735
|
+
value: _vm.value,
|
|
5736
|
+
format: _vm.format,
|
|
4244
5737
|
},
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
_vm._v(" "),
|
|
4248
|
-
_c("template", { slot: "footer" }, [_vm._t("footer")], 2),
|
|
4249
|
-
],
|
|
4250
|
-
2
|
|
4251
|
-
)
|
|
5738
|
+
on: { change: _vm.onChange },
|
|
5739
|
+
})
|
|
4252
5740
|
};
|
|
4253
5741
|
var __vue_staticRenderFns__$2 = [];
|
|
4254
5742
|
__vue_render__$2._withStripped = true;
|
|
4255
5743
|
|
|
4256
5744
|
/* style */
|
|
4257
|
-
const __vue_inject_styles__$2 =
|
|
5745
|
+
const __vue_inject_styles__$2 = function (inject) {
|
|
5746
|
+
if (!inject) return
|
|
5747
|
+
inject("data-v-547e029c_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
5748
|
+
|
|
5749
|
+
};
|
|
4258
5750
|
/* scoped */
|
|
4259
|
-
const __vue_scope_id__$2 =
|
|
5751
|
+
const __vue_scope_id__$2 = "data-v-547e029c";
|
|
4260
5752
|
/* module identifier */
|
|
4261
5753
|
const __vue_module_identifier__$2 = undefined;
|
|
4262
5754
|
/* functional template */
|
|
4263
5755
|
const __vue_is_functional_template__$2 = false;
|
|
4264
|
-
/* style inject */
|
|
4265
|
-
|
|
4266
5756
|
/* style inject SSR */
|
|
4267
5757
|
|
|
4268
5758
|
/* style inject shadow dom */
|
|
@@ -4277,26 +5767,39 @@ __vue_render__$2._withStripped = true;
|
|
|
4277
5767
|
__vue_is_functional_template__$2,
|
|
4278
5768
|
__vue_module_identifier__$2,
|
|
4279
5769
|
false,
|
|
4280
|
-
|
|
5770
|
+
createInjector,
|
|
4281
5771
|
undefined,
|
|
4282
5772
|
undefined
|
|
4283
5773
|
);
|
|
4284
5774
|
|
|
4285
5775
|
__vue_component__$2.install = Vue => Vue.component(__vue_component__$2.name, __vue_component__$2);
|
|
4286
5776
|
|
|
4287
|
-
__vue_component__$
|
|
5777
|
+
__vue_component__$j.install = Vue => Vue.component(__vue_component__$j.name, __vue_component__$j);
|
|
4288
5778
|
|
|
4289
|
-
__vue_component__$
|
|
5779
|
+
__vue_component__$k.install = Vue => Vue.component(__vue_component__$k.name, __vue_component__$k);
|
|
4290
5780
|
|
|
4291
5781
|
//
|
|
4292
5782
|
//
|
|
4293
5783
|
//
|
|
4294
5784
|
//
|
|
4295
|
-
//
|
|
4296
|
-
//
|
|
4297
5785
|
|
|
4298
5786
|
var script$1 = {
|
|
4299
|
-
name: 'ele-
|
|
5787
|
+
name: 'ele-modal-import',
|
|
5788
|
+
model: {
|
|
5789
|
+
prop: 'value',
|
|
5790
|
+
event: 'change'
|
|
5791
|
+
},
|
|
5792
|
+
props: {
|
|
5793
|
+
value: {
|
|
5794
|
+
type: Boolean,
|
|
5795
|
+
default: false
|
|
5796
|
+
}
|
|
5797
|
+
},
|
|
5798
|
+
data() {
|
|
5799
|
+
return {
|
|
5800
|
+
innerValue: true
|
|
5801
|
+
};
|
|
5802
|
+
}
|
|
4300
5803
|
};
|
|
4301
5804
|
|
|
4302
5805
|
/* script */
|
|
@@ -4307,7 +5810,15 @@ var __vue_render__$1 = function () {
|
|
|
4307
5810
|
var _vm = this;
|
|
4308
5811
|
var _h = _vm.$createElement;
|
|
4309
5812
|
var _c = _vm._self._c || _h;
|
|
4310
|
-
return _c("
|
|
5813
|
+
return _c("ele-modal", {
|
|
5814
|
+
model: {
|
|
5815
|
+
value: _vm.innerValue,
|
|
5816
|
+
callback: function ($$v) {
|
|
5817
|
+
_vm.innerValue = $$v;
|
|
5818
|
+
},
|
|
5819
|
+
expression: "innerValue",
|
|
5820
|
+
},
|
|
5821
|
+
})
|
|
4311
5822
|
};
|
|
4312
5823
|
var __vue_staticRenderFns__$1 = [];
|
|
4313
5824
|
__vue_render__$1._withStripped = true;
|
|
@@ -4315,11 +5826,11 @@ __vue_render__$1._withStripped = true;
|
|
|
4315
5826
|
/* style */
|
|
4316
5827
|
const __vue_inject_styles__$1 = function (inject) {
|
|
4317
5828
|
if (!inject) return
|
|
4318
|
-
inject("data-v-
|
|
5829
|
+
inject("data-v-68861ff4_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
4319
5830
|
|
|
4320
5831
|
};
|
|
4321
5832
|
/* scoped */
|
|
4322
|
-
const __vue_scope_id__$1 = "data-v-
|
|
5833
|
+
const __vue_scope_id__$1 = "data-v-68861ff4";
|
|
4323
5834
|
/* module identifier */
|
|
4324
5835
|
const __vue_module_identifier__$1 = undefined;
|
|
4325
5836
|
/* functional template */
|
|
@@ -4345,123 +5856,57 @@ __vue_render__$1._withStripped = true;
|
|
|
4345
5856
|
|
|
4346
5857
|
__vue_component__$1.install = Vue => Vue.component(__vue_component__$1.name, __vue_component__$1);
|
|
4347
5858
|
|
|
4348
|
-
__vue_component__$
|
|
5859
|
+
__vue_component__$i.install = Vue => Vue.component(__vue_component__$i.name, __vue_component__$i);
|
|
4349
5860
|
|
|
4350
|
-
__vue_component__$
|
|
5861
|
+
__vue_component__$8.install = Vue => Vue.component(__vue_component__$8.name, __vue_component__$8);
|
|
4351
5862
|
|
|
4352
|
-
__vue_component__$
|
|
5863
|
+
__vue_component__$9.install = Vue => Vue.component(__vue_component__$9.name, __vue_component__$9);
|
|
4353
5864
|
|
|
4354
|
-
|
|
4355
|
-
SUBMIT: 'submit',
|
|
4356
|
-
CANCEL: 'cancel'
|
|
4357
|
-
};
|
|
5865
|
+
__vue_component__$7.install = Vue => Vue.component(__vue_component__$7.name, __vue_component__$7);
|
|
4358
5866
|
|
|
4359
5867
|
//
|
|
5868
|
+
//
|
|
5869
|
+
//
|
|
5870
|
+
//
|
|
5871
|
+
//
|
|
5872
|
+
//
|
|
5873
|
+
//
|
|
5874
|
+
//
|
|
5875
|
+
//
|
|
5876
|
+
//
|
|
5877
|
+
//
|
|
5878
|
+
//
|
|
5879
|
+
//
|
|
5880
|
+
//
|
|
5881
|
+
|
|
4360
5882
|
var script = {
|
|
4361
|
-
name: 'ele-
|
|
4362
|
-
components: {
|
|
4363
|
-
EleButtonGroup: __vue_component__$e
|
|
4364
|
-
},
|
|
5883
|
+
name: 'ele-tabs',
|
|
5884
|
+
components: {},
|
|
4365
5885
|
props: {
|
|
4366
|
-
|
|
4367
|
-
type:
|
|
4368
|
-
|
|
4369
|
-
formMeta: {
|
|
4370
|
-
type: Object
|
|
4371
|
-
},
|
|
4372
|
-
footerMeta: {
|
|
4373
|
-
type: Object
|
|
4374
|
-
}
|
|
4375
|
-
},
|
|
4376
|
-
data() {
|
|
4377
|
-
return {};
|
|
4378
|
-
},
|
|
4379
|
-
computed: {
|
|
4380
|
-
formRef() {
|
|
4381
|
-
return v4();
|
|
4382
|
-
},
|
|
4383
|
-
assignAttrForEvents() {
|
|
4384
|
-
const events = this.footerElements.reduce((ret, ele) => {
|
|
4385
|
-
ret[ele.eventName] = e => {
|
|
4386
|
-
this.$emit(ele.eventName || 'click', {
|
|
4387
|
-
...e,
|
|
4388
|
-
formModel: this.formModels
|
|
4389
|
-
});
|
|
4390
|
-
};
|
|
4391
|
-
return ret;
|
|
4392
|
-
}, {});
|
|
4393
|
-
return {
|
|
4394
|
-
...this.$listeners,
|
|
4395
|
-
...events,
|
|
4396
|
-
[BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],
|
|
4397
|
-
[BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL]
|
|
4398
|
-
};
|
|
4399
|
-
},
|
|
4400
|
-
elements() {
|
|
4401
|
-
const {
|
|
4402
|
-
elements
|
|
4403
|
-
} = this.formMeta;
|
|
4404
|
-
return elements;
|
|
4405
|
-
},
|
|
4406
|
-
preRequest() {
|
|
4407
|
-
const {
|
|
4408
|
-
preRequest
|
|
4409
|
-
} = this.formMeta;
|
|
4410
|
-
return preRequest;
|
|
4411
|
-
},
|
|
4412
|
-
infoRequest() {
|
|
4413
|
-
const {
|
|
4414
|
-
infoRequest
|
|
4415
|
-
} = this.formMeta;
|
|
4416
|
-
return infoRequest;
|
|
5886
|
+
activeKey: {
|
|
5887
|
+
type: Number,
|
|
5888
|
+
default: 0
|
|
4417
5889
|
},
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
5890
|
+
tabsList: {
|
|
5891
|
+
type: Array,
|
|
5892
|
+
default() {
|
|
5893
|
+
return [];
|
|
5894
|
+
}
|
|
4423
5895
|
},
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
5896
|
+
tabBarStyle: {
|
|
5897
|
+
type: Object,
|
|
5898
|
+
default() {
|
|
5899
|
+
return {};
|
|
5900
|
+
}
|
|
4429
5901
|
},
|
|
4430
|
-
|
|
4431
|
-
|
|
5902
|
+
tabBarGutter: {
|
|
5903
|
+
type: Number
|
|
4432
5904
|
}
|
|
4433
5905
|
},
|
|
4434
5906
|
methods: {
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
async preRequestTrigger() {
|
|
4438
|
-
const {
|
|
4439
|
-
url,
|
|
4440
|
-
requestType = 'GET',
|
|
4441
|
-
fieldMap = {}
|
|
4442
|
-
} = this.preRequest;
|
|
4443
|
-
if (!url) return;
|
|
4444
|
-
await net[requestType.toLowerCase()](url, {});
|
|
4445
|
-
},
|
|
4446
|
-
setValueForField(props) {
|
|
4447
|
-
this.$refs[this.formRef].setFieldsValue(props);
|
|
4448
|
-
},
|
|
4449
|
-
[BUILT_IN_EVENT_NAMES.SUBMIT](props) {
|
|
4450
|
-
const status = this.$refs[this.formRef].validateFields();
|
|
4451
|
-
console.log('status', status);
|
|
4452
|
-
if (status) {
|
|
4453
|
-
console.log('status', this.formModels);
|
|
4454
|
-
} else {
|
|
4455
|
-
console.log('error');
|
|
4456
|
-
}
|
|
4457
|
-
},
|
|
4458
|
-
[BUILT_IN_EVENT_NAMES.CANCEL](props) {
|
|
4459
|
-
console.log('inner CANCEL', props);
|
|
5907
|
+
changeHandle(key) {
|
|
5908
|
+
this.$emit('changeActiveKey', key);
|
|
4460
5909
|
}
|
|
4461
|
-
},
|
|
4462
|
-
async mounted() {
|
|
4463
|
-
await this.preRequestTrigger();
|
|
4464
|
-
await this.infoRequestTrigger();
|
|
4465
5910
|
}
|
|
4466
5911
|
};
|
|
4467
5912
|
|
|
@@ -4473,33 +5918,53 @@ var __vue_render__ = function () {
|
|
|
4473
5918
|
var _vm = this;
|
|
4474
5919
|
var _h = _vm.$createElement;
|
|
4475
5920
|
var _c = _vm._self._c || _h;
|
|
4476
|
-
return _c(
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
5921
|
+
return _c(
|
|
5922
|
+
"div",
|
|
5923
|
+
[
|
|
5924
|
+
_c(
|
|
5925
|
+
"a-tabs",
|
|
5926
|
+
{
|
|
5927
|
+
staticClass: "tabclass",
|
|
5928
|
+
attrs: {
|
|
5929
|
+
"default-active-key": _vm.activeKey,
|
|
5930
|
+
tabBarGutter: _vm.tabBarGutter,
|
|
5931
|
+
tabBarStyle: _vm.tabBarStyle,
|
|
5932
|
+
},
|
|
5933
|
+
on: { change: _vm.changeHandle },
|
|
5934
|
+
},
|
|
5935
|
+
_vm._l(_vm.tabsList, function (item, index) {
|
|
5936
|
+
return _c(
|
|
5937
|
+
"a-tab-pane",
|
|
5938
|
+
{
|
|
5939
|
+
key: index,
|
|
5940
|
+
attrs: { tab: item.tabName, disabled: item.disabled },
|
|
5941
|
+
scopedSlots: _vm._u(
|
|
5942
|
+
[
|
|
5943
|
+
{
|
|
5944
|
+
key: "tab",
|
|
5945
|
+
fn: function () {
|
|
5946
|
+
return [
|
|
5947
|
+
item.renderHeader
|
|
5948
|
+
? _c(item.renderHeader, { tag: "component" })
|
|
5949
|
+
: _c("span", [_vm._v(_vm._s(item.tabName))]),
|
|
5950
|
+
]
|
|
5951
|
+
},
|
|
5952
|
+
proxy: true,
|
|
5953
|
+
},
|
|
5954
|
+
],
|
|
5955
|
+
null,
|
|
5956
|
+
true
|
|
5957
|
+
),
|
|
5958
|
+
},
|
|
5959
|
+
[_vm._v(" "), _c(item.content, { tag: "component" })],
|
|
5960
|
+
1
|
|
4497
5961
|
)
|
|
4498
|
-
),
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
5962
|
+
}),
|
|
5963
|
+
1
|
|
5964
|
+
),
|
|
5965
|
+
],
|
|
5966
|
+
1
|
|
5967
|
+
)
|
|
4503
5968
|
};
|
|
4504
5969
|
var __vue_staticRenderFns__ = [];
|
|
4505
5970
|
__vue_render__._withStripped = true;
|
|
@@ -4507,11 +5972,11 @@ __vue_render__._withStripped = true;
|
|
|
4507
5972
|
/* style */
|
|
4508
5973
|
const __vue_inject_styles__ = function (inject) {
|
|
4509
5974
|
if (!inject) return
|
|
4510
|
-
inject("data-v-
|
|
5975
|
+
inject("data-v-683a8ad6_0", { source: ".tabclass .ant-tabs-nav-animated {\n float: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\tabs\\src\\index.vue","index.vue"],"names":[],"mappings":"AAkDA;EACA,sBAAA;ACjDA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div>\r\n <a-tabs class=\"tabclass\" :default-active-key=\"activeKey\" :tabBarGutter=\"tabBarGutter\" :tabBarStyle=\"tabBarStyle\" @change=\"changeHandle\">\r\n <a-tab-pane v-for=\"(item, index) in tabsList\" :key=\"index\" :tab=\"item.tabName\" :disabled=\"item.disabled\">\r\n <template #tab>\r\n <component v-if=\"item.renderHeader\" :is=\"item.renderHeader\" ></component>\r\n <span v-else>{{ item.tabName }}</span>\r\n </template>\r\n <component :is=\"item.content\"></component>\r\n </a-tab-pane>\r\n </a-tabs>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-tabs',\r\n components: {\r\n },\r\n props: {\r\n activeKey: {\r\n type: Number,\r\n default: 0\r\n },\r\n tabsList: {\r\n type: Array,\r\n default () {\r\n return []\r\n }\r\n },\r\n tabBarStyle: {\r\n type: Object,\r\n default () {\r\n return {}\r\n }\r\n },\r\n tabBarGutter: {\r\n type: Number\r\n }\r\n },\r\n methods: {\r\n changeHandle (key) {\r\n this.$emit('changeActiveKey', key)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n.tabclass {\r\n .ant-tabs-nav-animated {\r\n float: left !important;\r\n }\r\n}\r\n</style>",".tabclass .ant-tabs-nav-animated {\n float: left !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4511
5976
|
|
|
4512
5977
|
};
|
|
4513
5978
|
/* scoped */
|
|
4514
|
-
const __vue_scope_id__ =
|
|
5979
|
+
const __vue_scope_id__ = undefined;
|
|
4515
5980
|
/* module identifier */
|
|
4516
5981
|
const __vue_module_identifier__ = undefined;
|
|
4517
5982
|
/* functional template */
|
|
@@ -4537,9 +6002,9 @@ __vue_render__._withStripped = true;
|
|
|
4537
6002
|
|
|
4538
6003
|
__vue_component__.install = Vue => Vue.component(__vue_component__.name, __vue_component__);
|
|
4539
6004
|
|
|
4540
|
-
const compositeComponents = [__vue_component__$
|
|
4541
|
-
const models = [__vue_component__$
|
|
4542
|
-
const components = [__vue_component__$
|
|
6005
|
+
const compositeComponents = [__vue_component__$j, __vue_component__$k, __vue_component__$1];
|
|
6006
|
+
const models = [__vue_component__$i, __vue_component__$8, __vue_component__$9, __vue_component__$7];
|
|
6007
|
+
const components = [__vue_component__$s, __vue_component__$r, __vue_component__$q, __vue_component__$p, __vue_component__$n, __vue_component__$m, __vue_component__$6, __vue_component__$a, __vue_component__$5, __vue_component__$f, __vue_component__$e, __vue_component__$g, __vue_component__$d, __vue_component__$4, __vue_component__$c, __vue_component__$b, __vue_component__$3, __vue_component__$2, ...compositeComponents, ...models, __vue_component__];
|
|
4543
6008
|
const install = Vue => {
|
|
4544
6009
|
if (install.installed) return;
|
|
4545
6010
|
install.installed = true;
|
|
@@ -4548,4 +6013,4 @@ const install = Vue => {
|
|
|
4548
6013
|
});
|
|
4549
6014
|
};
|
|
4550
6015
|
|
|
4551
|
-
export { __vue_component__$
|
|
6016
|
+
export { __vue_component__$s as EleButton, __vue_component__$r as EleDate, __vue_component__$q as EleInput, __vue_component__$4 as EleModal, __vue_component__$p as EleSelect, __vue_component__$n as EleTable, __vue_component__ as EleTabs, __vue_component__$6 as EleTpl, __vue_component__$m as EleTree, install as default, models };
|