@idooel/components 0.0.1-beta.1 → 0.0.1-beta.2
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 +2295 -378
- package/dist/@idooel/components.umd.js +2306 -388
- package/package.json +3 -2
- package/packages/attachment/index.js +0 -0
- package/packages/attachment/src/index.vue +15 -0
- package/packages/batch-export/index.js +5 -0
- package/packages/batch-export/src/index.vue +15 -0
- package/packages/checkbox/index.js +5 -0
- package/packages/checkbox/src/index.vue +44 -0
- package/packages/composite-components/button-group/src/index.vue +0 -5
- package/packages/composite-components/search-area/src/index.vue +75 -40
- package/packages/form/index.js +5 -0
- package/packages/form/src/index.vue +119 -0
- package/packages/form-model/index.js +5 -0
- package/packages/form-model/src/index.vue +139 -0
- package/packages/icon/index.js +5 -0
- package/packages/icon/src/index.vue +32 -0
- package/packages/index.js +25 -2
- package/packages/input/src/index.vue +5 -1
- package/packages/input-number/index.js +5 -0
- package/packages/input-number/src/index.vue +24 -0
- package/packages/modal/index.js +5 -0
- package/packages/modal/src/index.vue +129 -0
- package/packages/radio/index.js +5 -0
- package/packages/radio/src/index.vue +48 -0
- package/packages/select-entity/index.js +5 -0
- package/packages/select-entity/src/index.vue +114 -0
- package/packages/table/src/action.vue +1 -1
- package/packages/text/index.js +5 -0
- package/packages/text/src/index.vue +15 -0
- package/packages/textarea/index.js +5 -0
- package/packages/textarea/src/index.vue +49 -0
- package/packages/theme/form.scss +24 -0
- package/packages/theme/index.scss +12 -0
- package/packages/theme/variables.scss +23 -1
- package/packages/tree-table-model/src/index.vue +35 -27
- package/packages/upload/index.js +5 -0
- package/packages/upload/src/index.vue +351 -0
- package/packages/utils/index.js +4 -0
- package/scripts/rollup.config.js +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@idooel/shared'), require('moment')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@idooel/shared', 'moment'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.__ele__umd__components__ = {}, global.shared, global.moment));
|
|
5
|
-
})(this, (function (exports, shared, moment) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@idooel/shared'), require('moment'), require('vue-upload-component')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@idooel/shared', 'moment', 'vue-upload-component'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.__ele__umd__components__ = {}, global.shared, global.moment, global.FileUpload));
|
|
5
|
+
})(this, (function (exports, shared, moment, FileUpload) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
9
|
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
10
|
+
var FileUpload__default = /*#__PURE__*/_interopDefaultLegacy(FileUpload);
|
|
10
11
|
|
|
11
12
|
//
|
|
12
13
|
//
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
//
|
|
27
28
|
//
|
|
28
29
|
|
|
29
|
-
var script$
|
|
30
|
+
var script$n = {
|
|
30
31
|
name: 'ele-button',
|
|
31
32
|
props: {
|
|
32
33
|
record: {
|
|
@@ -144,10 +145,10 @@
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
/* script */
|
|
147
|
-
const __vue_script__$
|
|
148
|
+
const __vue_script__$n = script$n;
|
|
148
149
|
|
|
149
150
|
/* template */
|
|
150
|
-
var __vue_render__$
|
|
151
|
+
var __vue_render__$n = function () {
|
|
151
152
|
var _vm = this;
|
|
152
153
|
var _h = _vm.$createElement;
|
|
153
154
|
var _c = _vm._self._c || _h;
|
|
@@ -193,17 +194,17 @@
|
|
|
193
194
|
2
|
|
194
195
|
)
|
|
195
196
|
};
|
|
196
|
-
var __vue_staticRenderFns__$
|
|
197
|
-
__vue_render__$
|
|
197
|
+
var __vue_staticRenderFns__$n = [];
|
|
198
|
+
__vue_render__$n._withStripped = true;
|
|
198
199
|
|
|
199
200
|
/* style */
|
|
200
|
-
const __vue_inject_styles__$
|
|
201
|
+
const __vue_inject_styles__$n = undefined;
|
|
201
202
|
/* scoped */
|
|
202
|
-
const __vue_scope_id__$
|
|
203
|
+
const __vue_scope_id__$n = undefined;
|
|
203
204
|
/* module identifier */
|
|
204
|
-
const __vue_module_identifier__$
|
|
205
|
+
const __vue_module_identifier__$n = undefined;
|
|
205
206
|
/* functional template */
|
|
206
|
-
const __vue_is_functional_template__$
|
|
207
|
+
const __vue_is_functional_template__$n = false;
|
|
207
208
|
/* style inject */
|
|
208
209
|
|
|
209
210
|
/* style inject SSR */
|
|
@@ -212,20 +213,20 @@
|
|
|
212
213
|
|
|
213
214
|
|
|
214
215
|
|
|
215
|
-
const __vue_component__$
|
|
216
|
-
{ render: __vue_render__$
|
|
217
|
-
__vue_inject_styles__$
|
|
218
|
-
__vue_script__$
|
|
219
|
-
__vue_scope_id__$
|
|
220
|
-
__vue_is_functional_template__$
|
|
221
|
-
__vue_module_identifier__$
|
|
216
|
+
const __vue_component__$n = /*#__PURE__*/normalizeComponent(
|
|
217
|
+
{ render: __vue_render__$n, staticRenderFns: __vue_staticRenderFns__$n },
|
|
218
|
+
__vue_inject_styles__$n,
|
|
219
|
+
__vue_script__$n,
|
|
220
|
+
__vue_scope_id__$n,
|
|
221
|
+
__vue_is_functional_template__$n,
|
|
222
|
+
__vue_module_identifier__$n,
|
|
222
223
|
false,
|
|
223
224
|
undefined,
|
|
224
225
|
undefined,
|
|
225
226
|
undefined
|
|
226
227
|
);
|
|
227
228
|
|
|
228
|
-
__vue_component__$
|
|
229
|
+
__vue_component__$n.install = Vue => Vue.component(__vue_component__$n.name, __vue_component__$n);
|
|
229
230
|
|
|
230
231
|
//
|
|
231
232
|
//
|
|
@@ -240,7 +241,7 @@
|
|
|
240
241
|
//
|
|
241
242
|
//
|
|
242
243
|
|
|
243
|
-
var script$
|
|
244
|
+
var script$m = {
|
|
244
245
|
name: 'ele-date',
|
|
245
246
|
props: {
|
|
246
247
|
value: {
|
|
@@ -268,10 +269,10 @@
|
|
|
268
269
|
};
|
|
269
270
|
|
|
270
271
|
/* script */
|
|
271
|
-
const __vue_script__$
|
|
272
|
+
const __vue_script__$m = script$m;
|
|
272
273
|
|
|
273
274
|
/* template */
|
|
274
|
-
var __vue_render__$
|
|
275
|
+
var __vue_render__$m = function () {
|
|
275
276
|
var _vm = this;
|
|
276
277
|
var _h = _vm.$createElement;
|
|
277
278
|
var _c = _vm._self._c || _h;
|
|
@@ -286,17 +287,17 @@
|
|
|
286
287
|
on: { focus: _vm.onFocus, panelChange: _vm.onPanelChange },
|
|
287
288
|
})
|
|
288
289
|
};
|
|
289
|
-
var __vue_staticRenderFns__$
|
|
290
|
-
__vue_render__$
|
|
290
|
+
var __vue_staticRenderFns__$m = [];
|
|
291
|
+
__vue_render__$m._withStripped = true;
|
|
291
292
|
|
|
292
293
|
/* style */
|
|
293
|
-
const __vue_inject_styles__$
|
|
294
|
+
const __vue_inject_styles__$m = undefined;
|
|
294
295
|
/* scoped */
|
|
295
|
-
const __vue_scope_id__$
|
|
296
|
+
const __vue_scope_id__$m = undefined;
|
|
296
297
|
/* module identifier */
|
|
297
|
-
const __vue_module_identifier__$
|
|
298
|
+
const __vue_module_identifier__$m = undefined;
|
|
298
299
|
/* functional template */
|
|
299
|
-
const __vue_is_functional_template__$
|
|
300
|
+
const __vue_is_functional_template__$m = false;
|
|
300
301
|
/* style inject */
|
|
301
302
|
|
|
302
303
|
/* style inject SSR */
|
|
@@ -305,29 +306,33 @@
|
|
|
305
306
|
|
|
306
307
|
|
|
307
308
|
|
|
308
|
-
const __vue_component__$
|
|
309
|
-
{ render: __vue_render__$
|
|
310
|
-
__vue_inject_styles__$
|
|
311
|
-
__vue_script__$
|
|
312
|
-
__vue_scope_id__$
|
|
313
|
-
__vue_is_functional_template__$
|
|
314
|
-
__vue_module_identifier__$
|
|
309
|
+
const __vue_component__$m = /*#__PURE__*/normalizeComponent(
|
|
310
|
+
{ render: __vue_render__$m, staticRenderFns: __vue_staticRenderFns__$m },
|
|
311
|
+
__vue_inject_styles__$m,
|
|
312
|
+
__vue_script__$m,
|
|
313
|
+
__vue_scope_id__$m,
|
|
314
|
+
__vue_is_functional_template__$m,
|
|
315
|
+
__vue_module_identifier__$m,
|
|
315
316
|
false,
|
|
316
317
|
undefined,
|
|
317
318
|
undefined,
|
|
318
319
|
undefined
|
|
319
320
|
);
|
|
320
321
|
|
|
321
|
-
__vue_component__$
|
|
322
|
+
__vue_component__$m.install = Vue => Vue.component(__vue_component__$m.name, __vue_component__$m);
|
|
322
323
|
|
|
323
324
|
//
|
|
324
325
|
//
|
|
325
326
|
//
|
|
326
327
|
//
|
|
327
328
|
|
|
328
|
-
var script$
|
|
329
|
+
var script$l = {
|
|
329
330
|
name: 'ele-input',
|
|
330
331
|
props: {
|
|
332
|
+
maxLength: {
|
|
333
|
+
type: Number,
|
|
334
|
+
default: 125
|
|
335
|
+
},
|
|
331
336
|
value: {
|
|
332
337
|
type: String
|
|
333
338
|
}
|
|
@@ -385,53 +390,53 @@
|
|
|
385
390
|
}
|
|
386
391
|
|
|
387
392
|
/* script */
|
|
388
|
-
const __vue_script__$
|
|
393
|
+
const __vue_script__$l = script$l;
|
|
389
394
|
|
|
390
395
|
/* template */
|
|
391
|
-
var __vue_render__$
|
|
396
|
+
var __vue_render__$l = function () {
|
|
392
397
|
var _vm = this;
|
|
393
398
|
var _h = _vm.$createElement;
|
|
394
399
|
var _c = _vm._self._c || _h;
|
|
395
400
|
return _c("a-input", {
|
|
396
|
-
attrs: { value: _vm.value },
|
|
401
|
+
attrs: { value: _vm.value, "max-length": _vm.maxLength },
|
|
397
402
|
on: { change: _vm.onChange },
|
|
398
403
|
})
|
|
399
404
|
};
|
|
400
|
-
var __vue_staticRenderFns__$
|
|
401
|
-
__vue_render__$
|
|
405
|
+
var __vue_staticRenderFns__$l = [];
|
|
406
|
+
__vue_render__$l._withStripped = true;
|
|
402
407
|
|
|
403
408
|
/* style */
|
|
404
|
-
const __vue_inject_styles__$
|
|
409
|
+
const __vue_inject_styles__$l = function (inject) {
|
|
405
410
|
if (!inject) return
|
|
406
|
-
inject("data-v-
|
|
411
|
+
inject("data-v-468d0810_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 });
|
|
407
412
|
|
|
408
413
|
};
|
|
409
414
|
/* scoped */
|
|
410
|
-
const __vue_scope_id__$
|
|
415
|
+
const __vue_scope_id__$l = "data-v-468d0810";
|
|
411
416
|
/* module identifier */
|
|
412
|
-
const __vue_module_identifier__$
|
|
417
|
+
const __vue_module_identifier__$l = undefined;
|
|
413
418
|
/* functional template */
|
|
414
|
-
const __vue_is_functional_template__$
|
|
419
|
+
const __vue_is_functional_template__$l = false;
|
|
415
420
|
/* style inject SSR */
|
|
416
421
|
|
|
417
422
|
/* style inject shadow dom */
|
|
418
423
|
|
|
419
424
|
|
|
420
425
|
|
|
421
|
-
const __vue_component__$
|
|
422
|
-
{ render: __vue_render__$
|
|
423
|
-
__vue_inject_styles__$
|
|
424
|
-
__vue_script__$
|
|
425
|
-
__vue_scope_id__$
|
|
426
|
-
__vue_is_functional_template__$
|
|
427
|
-
__vue_module_identifier__$
|
|
426
|
+
const __vue_component__$l = /*#__PURE__*/normalizeComponent(
|
|
427
|
+
{ render: __vue_render__$l, staticRenderFns: __vue_staticRenderFns__$l },
|
|
428
|
+
__vue_inject_styles__$l,
|
|
429
|
+
__vue_script__$l,
|
|
430
|
+
__vue_scope_id__$l,
|
|
431
|
+
__vue_is_functional_template__$l,
|
|
432
|
+
__vue_module_identifier__$l,
|
|
428
433
|
false,
|
|
429
434
|
createInjector,
|
|
430
435
|
undefined,
|
|
431
436
|
undefined
|
|
432
437
|
);
|
|
433
438
|
|
|
434
|
-
__vue_component__$
|
|
439
|
+
__vue_component__$l.install = Vue => Vue.component(__vue_component__$l.name, __vue_component__$l);
|
|
435
440
|
|
|
436
441
|
//
|
|
437
442
|
//
|
|
@@ -442,7 +447,7 @@
|
|
|
442
447
|
//
|
|
443
448
|
//
|
|
444
449
|
|
|
445
|
-
var script$
|
|
450
|
+
var script$k = {
|
|
446
451
|
name: 'ele-select',
|
|
447
452
|
props: {
|
|
448
453
|
value: {
|
|
@@ -465,10 +470,10 @@
|
|
|
465
470
|
};
|
|
466
471
|
|
|
467
472
|
/* script */
|
|
468
|
-
const __vue_script__$
|
|
473
|
+
const __vue_script__$k = script$k;
|
|
469
474
|
|
|
470
475
|
/* template */
|
|
471
|
-
var __vue_render__$
|
|
476
|
+
var __vue_render__$k = function () {
|
|
472
477
|
var _vm = this;
|
|
473
478
|
var _h = _vm.$createElement;
|
|
474
479
|
var _c = _vm._self._c || _h;
|
|
@@ -489,41 +494,41 @@
|
|
|
489
494
|
1
|
|
490
495
|
)
|
|
491
496
|
};
|
|
492
|
-
var __vue_staticRenderFns__$
|
|
493
|
-
__vue_render__$
|
|
497
|
+
var __vue_staticRenderFns__$k = [];
|
|
498
|
+
__vue_render__$k._withStripped = true;
|
|
494
499
|
|
|
495
500
|
/* style */
|
|
496
|
-
const __vue_inject_styles__$
|
|
501
|
+
const __vue_inject_styles__$k = function (inject) {
|
|
497
502
|
if (!inject) return
|
|
498
503
|
inject("data-v-499435e8_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
499
504
|
|
|
500
505
|
};
|
|
501
506
|
/* scoped */
|
|
502
|
-
const __vue_scope_id__$
|
|
507
|
+
const __vue_scope_id__$k = "data-v-499435e8";
|
|
503
508
|
/* module identifier */
|
|
504
|
-
const __vue_module_identifier__$
|
|
509
|
+
const __vue_module_identifier__$k = undefined;
|
|
505
510
|
/* functional template */
|
|
506
|
-
const __vue_is_functional_template__$
|
|
511
|
+
const __vue_is_functional_template__$k = false;
|
|
507
512
|
/* style inject SSR */
|
|
508
513
|
|
|
509
514
|
/* style inject shadow dom */
|
|
510
515
|
|
|
511
516
|
|
|
512
517
|
|
|
513
|
-
const __vue_component__$
|
|
514
|
-
{ render: __vue_render__$
|
|
515
|
-
__vue_inject_styles__$
|
|
516
|
-
__vue_script__$
|
|
517
|
-
__vue_scope_id__$
|
|
518
|
-
__vue_is_functional_template__$
|
|
519
|
-
__vue_module_identifier__$
|
|
518
|
+
const __vue_component__$k = /*#__PURE__*/normalizeComponent(
|
|
519
|
+
{ render: __vue_render__$k, staticRenderFns: __vue_staticRenderFns__$k },
|
|
520
|
+
__vue_inject_styles__$k,
|
|
521
|
+
__vue_script__$k,
|
|
522
|
+
__vue_scope_id__$k,
|
|
523
|
+
__vue_is_functional_template__$k,
|
|
524
|
+
__vue_module_identifier__$k,
|
|
520
525
|
false,
|
|
521
526
|
createInjector,
|
|
522
527
|
undefined,
|
|
523
528
|
undefined
|
|
524
529
|
);
|
|
525
530
|
|
|
526
|
-
__vue_component__$
|
|
531
|
+
__vue_component__$k.install = Vue => Vue.component(__vue_component__$k.name, __vue_component__$k);
|
|
527
532
|
|
|
528
533
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
529
534
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
@@ -1157,7 +1162,7 @@
|
|
|
1157
1162
|
|
|
1158
1163
|
//
|
|
1159
1164
|
const MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002';
|
|
1160
|
-
var script$
|
|
1165
|
+
var script$j = {
|
|
1161
1166
|
props: {
|
|
1162
1167
|
record: {
|
|
1163
1168
|
type: Object
|
|
@@ -1255,10 +1260,10 @@
|
|
|
1255
1260
|
};
|
|
1256
1261
|
|
|
1257
1262
|
/* script */
|
|
1258
|
-
const __vue_script__$
|
|
1263
|
+
const __vue_script__$j = script$j;
|
|
1259
1264
|
|
|
1260
1265
|
/* template */
|
|
1261
|
-
var __vue_render__$
|
|
1266
|
+
var __vue_render__$j = function () {
|
|
1262
1267
|
var _vm = this;
|
|
1263
1268
|
var _h = _vm.$createElement;
|
|
1264
1269
|
var _c = _vm._self._c || _h;
|
|
@@ -1271,7 +1276,19 @@
|
|
|
1271
1276
|
{ key: idx, staticClass: "table-action__item" },
|
|
1272
1277
|
[
|
|
1273
1278
|
item.type == "text"
|
|
1274
|
-
? [
|
|
1279
|
+
? [
|
|
1280
|
+
_c(
|
|
1281
|
+
"span",
|
|
1282
|
+
{
|
|
1283
|
+
on: {
|
|
1284
|
+
click: function ($event) {
|
|
1285
|
+
return _vm.handleClickText(item)
|
|
1286
|
+
},
|
|
1287
|
+
},
|
|
1288
|
+
},
|
|
1289
|
+
[_vm._v(_vm._s(item.label))]
|
|
1290
|
+
),
|
|
1291
|
+
]
|
|
1275
1292
|
: item.type == "dropdown"
|
|
1276
1293
|
? [
|
|
1277
1294
|
_c(
|
|
@@ -1346,34 +1363,34 @@
|
|
|
1346
1363
|
0
|
|
1347
1364
|
)
|
|
1348
1365
|
};
|
|
1349
|
-
var __vue_staticRenderFns__$
|
|
1350
|
-
__vue_render__$
|
|
1366
|
+
var __vue_staticRenderFns__$j = [];
|
|
1367
|
+
__vue_render__$j._withStripped = true;
|
|
1351
1368
|
|
|
1352
1369
|
/* style */
|
|
1353
|
-
const __vue_inject_styles__$
|
|
1370
|
+
const __vue_inject_styles__$j = function (inject) {
|
|
1354
1371
|
if (!inject) return
|
|
1355
|
-
inject("data-v-
|
|
1372
|
+
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 });
|
|
1356
1373
|
|
|
1357
1374
|
};
|
|
1358
1375
|
/* scoped */
|
|
1359
|
-
const __vue_scope_id__$
|
|
1376
|
+
const __vue_scope_id__$j = "data-v-572820bc";
|
|
1360
1377
|
/* module identifier */
|
|
1361
|
-
const __vue_module_identifier__$
|
|
1378
|
+
const __vue_module_identifier__$j = undefined;
|
|
1362
1379
|
/* functional template */
|
|
1363
|
-
const __vue_is_functional_template__$
|
|
1380
|
+
const __vue_is_functional_template__$j = false;
|
|
1364
1381
|
/* style inject SSR */
|
|
1365
1382
|
|
|
1366
1383
|
/* style inject shadow dom */
|
|
1367
1384
|
|
|
1368
1385
|
|
|
1369
1386
|
|
|
1370
|
-
const __vue_component__$
|
|
1371
|
-
{ render: __vue_render__$
|
|
1372
|
-
__vue_inject_styles__$
|
|
1373
|
-
__vue_script__$
|
|
1374
|
-
__vue_scope_id__$
|
|
1375
|
-
__vue_is_functional_template__$
|
|
1376
|
-
__vue_module_identifier__$
|
|
1387
|
+
const __vue_component__$j = /*#__PURE__*/normalizeComponent(
|
|
1388
|
+
{ render: __vue_render__$j, staticRenderFns: __vue_staticRenderFns__$j },
|
|
1389
|
+
__vue_inject_styles__$j,
|
|
1390
|
+
__vue_script__$j,
|
|
1391
|
+
__vue_scope_id__$j,
|
|
1392
|
+
__vue_is_functional_template__$j,
|
|
1393
|
+
__vue_module_identifier__$j,
|
|
1377
1394
|
false,
|
|
1378
1395
|
createInjector,
|
|
1379
1396
|
undefined,
|
|
@@ -1381,10 +1398,10 @@
|
|
|
1381
1398
|
);
|
|
1382
1399
|
|
|
1383
1400
|
//
|
|
1384
|
-
var script$
|
|
1401
|
+
var script$i = {
|
|
1385
1402
|
name: 'ele-table',
|
|
1386
1403
|
components: {
|
|
1387
|
-
Actions: __vue_component__$
|
|
1404
|
+
Actions: __vue_component__$j
|
|
1388
1405
|
},
|
|
1389
1406
|
props: {
|
|
1390
1407
|
actions: {
|
|
@@ -1427,10 +1444,10 @@
|
|
|
1427
1444
|
};
|
|
1428
1445
|
|
|
1429
1446
|
/* script */
|
|
1430
|
-
const __vue_script__$
|
|
1447
|
+
const __vue_script__$i = script$i;
|
|
1431
1448
|
|
|
1432
1449
|
/* template */
|
|
1433
|
-
var __vue_render__$
|
|
1450
|
+
var __vue_render__$i = function () {
|
|
1434
1451
|
var _vm = this;
|
|
1435
1452
|
var _h = _vm.$createElement;
|
|
1436
1453
|
var _c = _vm._self._c || _h;
|
|
@@ -1489,41 +1506,41 @@
|
|
|
1489
1506
|
1
|
|
1490
1507
|
)
|
|
1491
1508
|
};
|
|
1492
|
-
var __vue_staticRenderFns__$
|
|
1493
|
-
__vue_render__$
|
|
1509
|
+
var __vue_staticRenderFns__$i = [];
|
|
1510
|
+
__vue_render__$i._withStripped = true;
|
|
1494
1511
|
|
|
1495
1512
|
/* style */
|
|
1496
|
-
const __vue_inject_styles__$
|
|
1513
|
+
const __vue_inject_styles__$i = function (inject) {
|
|
1497
1514
|
if (!inject) return
|
|
1498
1515
|
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 });
|
|
1499
1516
|
|
|
1500
1517
|
};
|
|
1501
1518
|
/* scoped */
|
|
1502
|
-
const __vue_scope_id__$
|
|
1519
|
+
const __vue_scope_id__$i = "data-v-6f3faf52";
|
|
1503
1520
|
/* module identifier */
|
|
1504
|
-
const __vue_module_identifier__$
|
|
1521
|
+
const __vue_module_identifier__$i = undefined;
|
|
1505
1522
|
/* functional template */
|
|
1506
|
-
const __vue_is_functional_template__$
|
|
1523
|
+
const __vue_is_functional_template__$i = false;
|
|
1507
1524
|
/* style inject SSR */
|
|
1508
1525
|
|
|
1509
1526
|
/* style inject shadow dom */
|
|
1510
1527
|
|
|
1511
1528
|
|
|
1512
1529
|
|
|
1513
|
-
const __vue_component__$
|
|
1514
|
-
{ render: __vue_render__$
|
|
1515
|
-
__vue_inject_styles__$
|
|
1516
|
-
__vue_script__$
|
|
1517
|
-
__vue_scope_id__$
|
|
1518
|
-
__vue_is_functional_template__$
|
|
1519
|
-
__vue_module_identifier__$
|
|
1530
|
+
const __vue_component__$i = /*#__PURE__*/normalizeComponent(
|
|
1531
|
+
{ render: __vue_render__$i, staticRenderFns: __vue_staticRenderFns__$i },
|
|
1532
|
+
__vue_inject_styles__$i,
|
|
1533
|
+
__vue_script__$i,
|
|
1534
|
+
__vue_scope_id__$i,
|
|
1535
|
+
__vue_is_functional_template__$i,
|
|
1536
|
+
__vue_module_identifier__$i,
|
|
1520
1537
|
false,
|
|
1521
1538
|
createInjector,
|
|
1522
1539
|
undefined,
|
|
1523
1540
|
undefined
|
|
1524
1541
|
);
|
|
1525
1542
|
|
|
1526
|
-
__vue_component__$
|
|
1543
|
+
__vue_component__$i.install = Vue => Vue.component(__vue_component__$i.name, __vue_component__$i);
|
|
1527
1544
|
|
|
1528
1545
|
//
|
|
1529
1546
|
//
|
|
@@ -1549,7 +1566,7 @@
|
|
|
1549
1566
|
//
|
|
1550
1567
|
//
|
|
1551
1568
|
|
|
1552
|
-
var script$
|
|
1569
|
+
var script$h = {
|
|
1553
1570
|
name: 'ele-tree',
|
|
1554
1571
|
props: {
|
|
1555
1572
|
treeData: {
|
|
@@ -1612,10 +1629,10 @@
|
|
|
1612
1629
|
};
|
|
1613
1630
|
|
|
1614
1631
|
/* script */
|
|
1615
|
-
const __vue_script__$
|
|
1632
|
+
const __vue_script__$h = script$h;
|
|
1616
1633
|
|
|
1617
1634
|
/* template */
|
|
1618
|
-
var __vue_render__$
|
|
1635
|
+
var __vue_render__$h = function () {
|
|
1619
1636
|
var _vm = this;
|
|
1620
1637
|
var _h = _vm.$createElement;
|
|
1621
1638
|
var _c = _vm._self._c || _h;
|
|
@@ -1672,41 +1689,41 @@
|
|
|
1672
1689
|
1
|
|
1673
1690
|
)
|
|
1674
1691
|
};
|
|
1675
|
-
var __vue_staticRenderFns__$
|
|
1676
|
-
__vue_render__$
|
|
1692
|
+
var __vue_staticRenderFns__$h = [];
|
|
1693
|
+
__vue_render__$h._withStripped = true;
|
|
1677
1694
|
|
|
1678
1695
|
/* style */
|
|
1679
|
-
const __vue_inject_styles__$
|
|
1696
|
+
const __vue_inject_styles__$h = function (inject) {
|
|
1680
1697
|
if (!inject) return
|
|
1681
1698
|
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 });
|
|
1682
1699
|
|
|
1683
1700
|
};
|
|
1684
1701
|
/* scoped */
|
|
1685
|
-
const __vue_scope_id__$
|
|
1702
|
+
const __vue_scope_id__$h = "data-v-cc99bbf0";
|
|
1686
1703
|
/* module identifier */
|
|
1687
|
-
const __vue_module_identifier__$
|
|
1704
|
+
const __vue_module_identifier__$h = undefined;
|
|
1688
1705
|
/* functional template */
|
|
1689
|
-
const __vue_is_functional_template__$
|
|
1706
|
+
const __vue_is_functional_template__$h = false;
|
|
1690
1707
|
/* style inject SSR */
|
|
1691
1708
|
|
|
1692
1709
|
/* style inject shadow dom */
|
|
1693
1710
|
|
|
1694
1711
|
|
|
1695
1712
|
|
|
1696
|
-
const __vue_component__$
|
|
1697
|
-
{ render: __vue_render__$
|
|
1698
|
-
__vue_inject_styles__$
|
|
1699
|
-
__vue_script__$
|
|
1700
|
-
__vue_scope_id__$
|
|
1701
|
-
__vue_is_functional_template__$
|
|
1702
|
-
__vue_module_identifier__$
|
|
1713
|
+
const __vue_component__$h = /*#__PURE__*/normalizeComponent(
|
|
1714
|
+
{ render: __vue_render__$h, staticRenderFns: __vue_staticRenderFns__$h },
|
|
1715
|
+
__vue_inject_styles__$h,
|
|
1716
|
+
__vue_script__$h,
|
|
1717
|
+
__vue_scope_id__$h,
|
|
1718
|
+
__vue_is_functional_template__$h,
|
|
1719
|
+
__vue_module_identifier__$h,
|
|
1703
1720
|
false,
|
|
1704
1721
|
createInjector,
|
|
1705
1722
|
undefined,
|
|
1706
1723
|
undefined
|
|
1707
1724
|
);
|
|
1708
1725
|
|
|
1709
|
-
__vue_component__$
|
|
1726
|
+
__vue_component__$h.install = Vue => Vue.component(__vue_component__$h.name, __vue_component__$h);
|
|
1710
1727
|
|
|
1711
1728
|
//
|
|
1712
1729
|
//
|
|
@@ -1716,7 +1733,7 @@
|
|
|
1716
1733
|
//
|
|
1717
1734
|
//
|
|
1718
1735
|
|
|
1719
|
-
var script$
|
|
1736
|
+
var script$g = {
|
|
1720
1737
|
props: {
|
|
1721
1738
|
label: {
|
|
1722
1739
|
type: String
|
|
@@ -1725,10 +1742,10 @@
|
|
|
1725
1742
|
};
|
|
1726
1743
|
|
|
1727
1744
|
/* script */
|
|
1728
|
-
const __vue_script__$
|
|
1745
|
+
const __vue_script__$g = script$g;
|
|
1729
1746
|
|
|
1730
1747
|
/* template */
|
|
1731
|
-
var __vue_render__$
|
|
1748
|
+
var __vue_render__$g = function () {
|
|
1732
1749
|
var _vm = this;
|
|
1733
1750
|
var _h = _vm.$createElement;
|
|
1734
1751
|
var _c = _vm._self._c || _h;
|
|
@@ -1738,34 +1755,34 @@
|
|
|
1738
1755
|
_c("span", { staticClass: "label__suffix" }, [_vm._v(":")]),
|
|
1739
1756
|
])
|
|
1740
1757
|
};
|
|
1741
|
-
var __vue_staticRenderFns__$
|
|
1742
|
-
__vue_render__$
|
|
1758
|
+
var __vue_staticRenderFns__$g = [];
|
|
1759
|
+
__vue_render__$g._withStripped = true;
|
|
1743
1760
|
|
|
1744
1761
|
/* style */
|
|
1745
|
-
const __vue_inject_styles__$
|
|
1762
|
+
const __vue_inject_styles__$g = function (inject) {
|
|
1746
1763
|
if (!inject) return
|
|
1747
1764
|
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 });
|
|
1748
1765
|
|
|
1749
1766
|
};
|
|
1750
1767
|
/* scoped */
|
|
1751
|
-
const __vue_scope_id__$
|
|
1768
|
+
const __vue_scope_id__$g = "data-v-40e71716";
|
|
1752
1769
|
/* module identifier */
|
|
1753
|
-
const __vue_module_identifier__$
|
|
1770
|
+
const __vue_module_identifier__$g = undefined;
|
|
1754
1771
|
/* functional template */
|
|
1755
|
-
const __vue_is_functional_template__$
|
|
1772
|
+
const __vue_is_functional_template__$g = false;
|
|
1756
1773
|
/* style inject SSR */
|
|
1757
1774
|
|
|
1758
1775
|
/* style inject shadow dom */
|
|
1759
1776
|
|
|
1760
1777
|
|
|
1761
1778
|
|
|
1762
|
-
const __vue_component__$
|
|
1763
|
-
{ render: __vue_render__$
|
|
1764
|
-
__vue_inject_styles__$
|
|
1765
|
-
__vue_script__$
|
|
1766
|
-
__vue_scope_id__$
|
|
1767
|
-
__vue_is_functional_template__$
|
|
1768
|
-
__vue_module_identifier__$
|
|
1779
|
+
const __vue_component__$g = /*#__PURE__*/normalizeComponent(
|
|
1780
|
+
{ render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g },
|
|
1781
|
+
__vue_inject_styles__$g,
|
|
1782
|
+
__vue_script__$g,
|
|
1783
|
+
__vue_scope_id__$g,
|
|
1784
|
+
__vue_is_functional_template__$g,
|
|
1785
|
+
__vue_module_identifier__$g,
|
|
1769
1786
|
false,
|
|
1770
1787
|
createInjector,
|
|
1771
1788
|
undefined,
|
|
@@ -1773,14 +1790,14 @@
|
|
|
1773
1790
|
);
|
|
1774
1791
|
|
|
1775
1792
|
//
|
|
1776
|
-
var script$
|
|
1793
|
+
var script$f = {
|
|
1777
1794
|
name: 'ele-search-area',
|
|
1778
1795
|
components: {
|
|
1779
|
-
EleInput: __vue_component__$
|
|
1780
|
-
EleSelect: __vue_component__$
|
|
1781
|
-
ELeButton: __vue_component__$
|
|
1782
|
-
Label: __vue_component__$
|
|
1783
|
-
EleDate: __vue_component__$
|
|
1796
|
+
EleInput: __vue_component__$l,
|
|
1797
|
+
EleSelect: __vue_component__$k,
|
|
1798
|
+
ELeButton: __vue_component__$n,
|
|
1799
|
+
Label: __vue_component__$g,
|
|
1800
|
+
EleDate: __vue_component__$m
|
|
1784
1801
|
},
|
|
1785
1802
|
props: {
|
|
1786
1803
|
gutter: {
|
|
@@ -1798,30 +1815,57 @@
|
|
|
1798
1815
|
},
|
|
1799
1816
|
data() {
|
|
1800
1817
|
return {
|
|
1801
|
-
isExpand: false
|
|
1802
|
-
collapseDataSource: []
|
|
1818
|
+
isExpand: false
|
|
1803
1819
|
};
|
|
1804
1820
|
},
|
|
1805
1821
|
computed: {
|
|
1806
|
-
|
|
1807
|
-
return
|
|
1822
|
+
cuttingFormula() {
|
|
1823
|
+
return 24 / this.span - 1;
|
|
1824
|
+
},
|
|
1825
|
+
buildDataSource() {
|
|
1826
|
+
return this.controlDisplayByFormula(this.mapDefaultValueToValue());
|
|
1808
1827
|
},
|
|
1809
1828
|
innerDataSource() {
|
|
1810
|
-
return
|
|
1811
|
-
type: '_action'
|
|
1812
|
-
|
|
1813
|
-
type: '_action'
|
|
1829
|
+
return [...this.buildDataSource, {
|
|
1830
|
+
type: '_action',
|
|
1831
|
+
_show: true
|
|
1814
1832
|
}];
|
|
1815
1833
|
}
|
|
1816
1834
|
},
|
|
1817
|
-
created() {
|
|
1818
|
-
this.collapseDataSource = this.dataSource.slice(0, 24 / this.span - 1);
|
|
1819
|
-
},
|
|
1835
|
+
created() {},
|
|
1820
1836
|
methods: {
|
|
1821
|
-
|
|
1822
|
-
if (
|
|
1823
|
-
|
|
1837
|
+
controlDisplayByFormula(dataSource = []) {
|
|
1838
|
+
if (this.isExpand) {
|
|
1839
|
+
dataSource.forEach(item => {
|
|
1840
|
+
this.$set(item, '_show', true);
|
|
1841
|
+
});
|
|
1842
|
+
} else {
|
|
1843
|
+
dataSource.forEach((item, idx) => {
|
|
1844
|
+
if (idx < this.cuttingFormula) {
|
|
1845
|
+
this.$set(item, '_show', true);
|
|
1846
|
+
} else {
|
|
1847
|
+
this.$set(item, '_show', false);
|
|
1848
|
+
}
|
|
1849
|
+
});
|
|
1824
1850
|
}
|
|
1851
|
+
return dataSource;
|
|
1852
|
+
},
|
|
1853
|
+
buildDefaultValue(arg) {
|
|
1854
|
+
if (!arg || arg.charAt(0) !== '_') return arg;
|
|
1855
|
+
return parse(arg, {
|
|
1856
|
+
_route: this.$route.query
|
|
1857
|
+
});
|
|
1858
|
+
},
|
|
1859
|
+
mapDefaultValueToValue() {
|
|
1860
|
+
this.dataSource.forEach(props => {
|
|
1861
|
+
this.$set(props, '_show', this.isExpand);
|
|
1862
|
+
if (props.defaultValue) {
|
|
1863
|
+
this.$set(props, '_value', this.buildDefaultValue(props.defaultValue));
|
|
1864
|
+
}
|
|
1865
|
+
});
|
|
1866
|
+
return this.dataSource;
|
|
1867
|
+
},
|
|
1868
|
+
handleClickExpandCollapse() {
|
|
1825
1869
|
this.isExpand = !this.isExpand;
|
|
1826
1870
|
},
|
|
1827
1871
|
handleClickSearch() {
|
|
@@ -1844,15 +1888,21 @@
|
|
|
1844
1888
|
},
|
|
1845
1889
|
handleClickReset() {
|
|
1846
1890
|
this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {
|
|
1891
|
+
const {
|
|
1892
|
+
defaultValue
|
|
1893
|
+
} = item;
|
|
1847
1894
|
switch (item.type) {
|
|
1848
1895
|
case 'Select':
|
|
1849
|
-
this.$set(item, '_value',
|
|
1896
|
+
defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue));
|
|
1897
|
+
!defaultValue && this.$set(item, '_value', null);
|
|
1850
1898
|
break;
|
|
1851
1899
|
case 'DatePicker':
|
|
1852
|
-
this.$set(item, '_value',
|
|
1900
|
+
defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue));
|
|
1901
|
+
!defaultValue && this.$set(item, '_value', undefined);
|
|
1853
1902
|
break;
|
|
1854
1903
|
default:
|
|
1855
|
-
this.$set(item, '_value',
|
|
1904
|
+
defaultValue && this.$set(item, '_value', this.buildDefaultValue(defaultValue));
|
|
1905
|
+
!defaultValue && this.$set(item, '_value', null);
|
|
1856
1906
|
break;
|
|
1857
1907
|
}
|
|
1858
1908
|
});
|
|
@@ -1867,10 +1917,10 @@
|
|
|
1867
1917
|
};
|
|
1868
1918
|
|
|
1869
1919
|
/* script */
|
|
1870
|
-
const __vue_script__$
|
|
1920
|
+
const __vue_script__$f = script$f;
|
|
1871
1921
|
|
|
1872
1922
|
/* template */
|
|
1873
|
-
var __vue_render__$
|
|
1923
|
+
var __vue_render__$f = function () {
|
|
1874
1924
|
var _vm = this;
|
|
1875
1925
|
var _h = _vm.$createElement;
|
|
1876
1926
|
var _c = _vm._self._c || _h;
|
|
@@ -1881,150 +1931,175 @@
|
|
|
1881
1931
|
_c(
|
|
1882
1932
|
"a-row",
|
|
1883
1933
|
{ attrs: { gutter: _vm.gutter } },
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
[
|
|
1889
|
-
item.type == "_action"
|
|
1934
|
+
[
|
|
1935
|
+
_vm._l(_vm.innerDataSource, function (item, idx) {
|
|
1936
|
+
return [
|
|
1937
|
+
item._show
|
|
1890
1938
|
? _c(
|
|
1891
|
-
"
|
|
1892
|
-
{
|
|
1939
|
+
"a-col",
|
|
1940
|
+
{ key: idx, attrs: { span: item.span || _vm.span } },
|
|
1893
1941
|
[
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
),
|
|
1902
|
-
_vm._v(" "),
|
|
1903
|
-
_c(
|
|
1904
|
-
"ele-button",
|
|
1905
|
-
{
|
|
1906
|
-
staticStyle: { "margin-left": "8px" },
|
|
1907
|
-
attrs: { icon: "reload" },
|
|
1908
|
-
on: { click: _vm.handleClickReset },
|
|
1909
|
-
},
|
|
1910
|
-
[_vm._v("重置")]
|
|
1911
|
-
),
|
|
1912
|
-
_vm._v(" "),
|
|
1913
|
-
_c(
|
|
1914
|
-
"div",
|
|
1915
|
-
{
|
|
1916
|
-
staticClass: "expand-collapse",
|
|
1917
|
-
on: { click: _vm.handleClickExpandCollapse },
|
|
1918
|
-
},
|
|
1919
|
-
[
|
|
1920
|
-
_c("span", { staticClass: "expand-collapse__text" }, [
|
|
1921
|
-
_vm._v(_vm._s(_vm.isExpand ? "收起" : "展开")),
|
|
1922
|
-
]),
|
|
1923
|
-
_vm._v(" "),
|
|
1924
|
-
_c(
|
|
1925
|
-
"span",
|
|
1926
|
-
{ staticClass: "expand-collapse__icon" },
|
|
1942
|
+
item.type == "_action"
|
|
1943
|
+
? _c(
|
|
1944
|
+
"div",
|
|
1945
|
+
{
|
|
1946
|
+
staticClass:
|
|
1947
|
+
"search-area__item search-area--action",
|
|
1948
|
+
},
|
|
1927
1949
|
[
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1950
|
+
_c(
|
|
1951
|
+
"ele-button",
|
|
1952
|
+
{
|
|
1953
|
+
attrs: { icon: "search", type: "primary" },
|
|
1954
|
+
on: { click: _vm.handleClickSearch },
|
|
1955
|
+
},
|
|
1956
|
+
[_vm._v("查询")]
|
|
1957
|
+
),
|
|
1958
|
+
_vm._v(" "),
|
|
1959
|
+
_c(
|
|
1960
|
+
"ele-button",
|
|
1961
|
+
{
|
|
1962
|
+
staticStyle: { "margin-left": "8px" },
|
|
1963
|
+
attrs: { icon: "reload" },
|
|
1964
|
+
on: { click: _vm.handleClickReset },
|
|
1965
|
+
},
|
|
1966
|
+
[_vm._v("重置")]
|
|
1967
|
+
),
|
|
1968
|
+
_vm._v(" "),
|
|
1969
|
+
_c(
|
|
1970
|
+
"div",
|
|
1971
|
+
{
|
|
1972
|
+
staticClass: "expand-collapse",
|
|
1973
|
+
on: { click: _vm.handleClickExpandCollapse },
|
|
1974
|
+
},
|
|
1975
|
+
[
|
|
1976
|
+
_c(
|
|
1977
|
+
"span",
|
|
1978
|
+
{ staticClass: "expand-collapse__text" },
|
|
1979
|
+
[
|
|
1980
|
+
_vm._v(
|
|
1981
|
+
_vm._s(_vm.isExpand ? "收起" : "展开")
|
|
1982
|
+
),
|
|
1983
|
+
]
|
|
1984
|
+
),
|
|
1985
|
+
_vm._v(" "),
|
|
1986
|
+
_c(
|
|
1987
|
+
"span",
|
|
1988
|
+
{ staticClass: "expand-collapse__icon" },
|
|
1989
|
+
[
|
|
1990
|
+
_vm.isExpand
|
|
1991
|
+
? _c("a-icon", {
|
|
1992
|
+
attrs: { type: "up" },
|
|
1993
|
+
})
|
|
1994
|
+
: _c("a-icon", {
|
|
1995
|
+
attrs: { type: "down" },
|
|
1996
|
+
}),
|
|
1997
|
+
],
|
|
1998
|
+
1
|
|
1999
|
+
),
|
|
2000
|
+
]
|
|
2001
|
+
),
|
|
1931
2002
|
],
|
|
1932
2003
|
1
|
|
2004
|
+
)
|
|
2005
|
+
: _c(
|
|
2006
|
+
"div",
|
|
2007
|
+
{ staticClass: "search-area__item" },
|
|
2008
|
+
[
|
|
2009
|
+
item.type == "Input"
|
|
2010
|
+
? [
|
|
2011
|
+
_c("Label", {
|
|
2012
|
+
attrs: { label: item.label },
|
|
2013
|
+
}),
|
|
2014
|
+
_vm._v(" "),
|
|
2015
|
+
_c("ele-input", {
|
|
2016
|
+
model: {
|
|
2017
|
+
value: item._value,
|
|
2018
|
+
callback: function ($$v) {
|
|
2019
|
+
_vm.$set(item, "_value", $$v);
|
|
2020
|
+
},
|
|
2021
|
+
expression: "item._value",
|
|
2022
|
+
},
|
|
2023
|
+
}),
|
|
2024
|
+
]
|
|
2025
|
+
: item.type == "Select"
|
|
2026
|
+
? [
|
|
2027
|
+
_c("Label", {
|
|
2028
|
+
attrs: { label: item.label },
|
|
2029
|
+
}),
|
|
2030
|
+
_vm._v(" "),
|
|
2031
|
+
_c("ele-select", {
|
|
2032
|
+
attrs: { "data-source": item.optionList },
|
|
2033
|
+
model: {
|
|
2034
|
+
value: item._value,
|
|
2035
|
+
callback: function ($$v) {
|
|
2036
|
+
_vm.$set(item, "_value", $$v);
|
|
2037
|
+
},
|
|
2038
|
+
expression: "item._value",
|
|
2039
|
+
},
|
|
2040
|
+
}),
|
|
2041
|
+
]
|
|
2042
|
+
: item.type == "DatePicker"
|
|
2043
|
+
? [
|
|
2044
|
+
_c("Label", {
|
|
2045
|
+
attrs: { label: item.label },
|
|
2046
|
+
}),
|
|
2047
|
+
_vm._v(" "),
|
|
2048
|
+
_c("ele-date", {
|
|
2049
|
+
attrs: { format: item.format },
|
|
2050
|
+
model: {
|
|
2051
|
+
value: item._value,
|
|
2052
|
+
callback: function ($$v) {
|
|
2053
|
+
_vm.$set(item, "_value", $$v);
|
|
2054
|
+
},
|
|
2055
|
+
expression: "item._value",
|
|
2056
|
+
},
|
|
2057
|
+
}),
|
|
2058
|
+
]
|
|
2059
|
+
: _vm._e(),
|
|
2060
|
+
],
|
|
2061
|
+
2
|
|
1933
2062
|
),
|
|
1934
|
-
|
|
1935
|
-
),
|
|
1936
|
-
],
|
|
1937
|
-
1
|
|
2063
|
+
]
|
|
1938
2064
|
)
|
|
1939
|
-
:
|
|
1940
|
-
"div",
|
|
1941
|
-
{ staticClass: "search-area__item" },
|
|
1942
|
-
[
|
|
1943
|
-
item.type == "Input"
|
|
1944
|
-
? [
|
|
1945
|
-
_c("Label", { attrs: { label: item.label } }),
|
|
1946
|
-
_vm._v(" "),
|
|
1947
|
-
_c("ele-input", {
|
|
1948
|
-
model: {
|
|
1949
|
-
value: item._value,
|
|
1950
|
-
callback: function ($$v) {
|
|
1951
|
-
_vm.$set(item, "_value", $$v);
|
|
1952
|
-
},
|
|
1953
|
-
expression: "item._value",
|
|
1954
|
-
},
|
|
1955
|
-
}),
|
|
1956
|
-
]
|
|
1957
|
-
: item.type == "Select"
|
|
1958
|
-
? [
|
|
1959
|
-
_c("Label", { attrs: { label: item.label } }),
|
|
1960
|
-
_vm._v(" "),
|
|
1961
|
-
_c("ele-select", {
|
|
1962
|
-
attrs: { "data-source": item.optionList },
|
|
1963
|
-
model: {
|
|
1964
|
-
value: item._value,
|
|
1965
|
-
callback: function ($$v) {
|
|
1966
|
-
_vm.$set(item, "_value", $$v);
|
|
1967
|
-
},
|
|
1968
|
-
expression: "item._value",
|
|
1969
|
-
},
|
|
1970
|
-
}),
|
|
1971
|
-
]
|
|
1972
|
-
: item.type == "DatePicker"
|
|
1973
|
-
? [
|
|
1974
|
-
_c("Label", { attrs: { label: item.label } }),
|
|
1975
|
-
_vm._v(" "),
|
|
1976
|
-
_c("ele-date", {
|
|
1977
|
-
attrs: { format: item.format },
|
|
1978
|
-
model: {
|
|
1979
|
-
value: item._value,
|
|
1980
|
-
callback: function ($$v) {
|
|
1981
|
-
_vm.$set(item, "_value", $$v);
|
|
1982
|
-
},
|
|
1983
|
-
expression: "item._value",
|
|
1984
|
-
},
|
|
1985
|
-
}),
|
|
1986
|
-
]
|
|
1987
|
-
: _vm._e(),
|
|
1988
|
-
],
|
|
1989
|
-
2
|
|
1990
|
-
),
|
|
2065
|
+
: _vm._e(),
|
|
1991
2066
|
]
|
|
1992
|
-
)
|
|
1993
|
-
|
|
1994
|
-
|
|
2067
|
+
}),
|
|
2068
|
+
],
|
|
2069
|
+
2
|
|
1995
2070
|
),
|
|
1996
2071
|
],
|
|
1997
2072
|
1
|
|
1998
2073
|
)
|
|
1999
2074
|
};
|
|
2000
|
-
var __vue_staticRenderFns__$
|
|
2001
|
-
__vue_render__$
|
|
2075
|
+
var __vue_staticRenderFns__$f = [];
|
|
2076
|
+
__vue_render__$f._withStripped = true;
|
|
2002
2077
|
|
|
2003
2078
|
/* style */
|
|
2004
|
-
const __vue_inject_styles__$
|
|
2079
|
+
const __vue_inject_styles__$f = function (inject) {
|
|
2005
2080
|
if (!inject) return
|
|
2006
|
-
inject("data-v-
|
|
2081
|
+
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 });
|
|
2007
2082
|
|
|
2008
2083
|
};
|
|
2009
2084
|
/* scoped */
|
|
2010
|
-
const __vue_scope_id__$
|
|
2085
|
+
const __vue_scope_id__$f = "data-v-5a224358";
|
|
2011
2086
|
/* module identifier */
|
|
2012
|
-
const __vue_module_identifier__$
|
|
2087
|
+
const __vue_module_identifier__$f = undefined;
|
|
2013
2088
|
/* functional template */
|
|
2014
|
-
const __vue_is_functional_template__$
|
|
2089
|
+
const __vue_is_functional_template__$f = false;
|
|
2015
2090
|
/* style inject SSR */
|
|
2016
2091
|
|
|
2017
2092
|
/* style inject shadow dom */
|
|
2018
2093
|
|
|
2019
2094
|
|
|
2020
2095
|
|
|
2021
|
-
const __vue_component__$
|
|
2022
|
-
{ render: __vue_render__$
|
|
2023
|
-
__vue_inject_styles__$
|
|
2024
|
-
__vue_script__$
|
|
2025
|
-
__vue_scope_id__$
|
|
2026
|
-
__vue_is_functional_template__$
|
|
2027
|
-
__vue_module_identifier__$
|
|
2096
|
+
const __vue_component__$f = /*#__PURE__*/normalizeComponent(
|
|
2097
|
+
{ render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f },
|
|
2098
|
+
__vue_inject_styles__$f,
|
|
2099
|
+
__vue_script__$f,
|
|
2100
|
+
__vue_scope_id__$f,
|
|
2101
|
+
__vue_is_functional_template__$f,
|
|
2102
|
+
__vue_module_identifier__$f,
|
|
2028
2103
|
false,
|
|
2029
2104
|
createInjector,
|
|
2030
2105
|
undefined,
|
|
@@ -2032,29 +2107,24 @@
|
|
|
2032
2107
|
);
|
|
2033
2108
|
|
|
2034
2109
|
//
|
|
2035
|
-
var script$
|
|
2110
|
+
var script$e = {
|
|
2036
2111
|
name: 'ele-button-group',
|
|
2037
2112
|
components: {
|
|
2038
|
-
EleButton: __vue_component__$
|
|
2113
|
+
EleButton: __vue_component__$n
|
|
2039
2114
|
},
|
|
2040
2115
|
props: {
|
|
2041
2116
|
dataSource: {
|
|
2042
2117
|
type: Array,
|
|
2043
2118
|
default: () => []
|
|
2044
2119
|
}
|
|
2045
|
-
},
|
|
2046
|
-
methods: {
|
|
2047
|
-
handleClick(props) {
|
|
2048
|
-
this.$emit('click', props);
|
|
2049
|
-
}
|
|
2050
2120
|
}
|
|
2051
2121
|
};
|
|
2052
2122
|
|
|
2053
2123
|
/* script */
|
|
2054
|
-
const __vue_script__$
|
|
2124
|
+
const __vue_script__$e = script$e;
|
|
2055
2125
|
|
|
2056
2126
|
/* template */
|
|
2057
|
-
var __vue_render__$
|
|
2127
|
+
var __vue_render__$e = function () {
|
|
2058
2128
|
var _vm = this;
|
|
2059
2129
|
var _h = _vm.$createElement;
|
|
2060
2130
|
var _c = _vm._self._c || _h;
|
|
@@ -2084,34 +2154,34 @@
|
|
|
2084
2154
|
1
|
|
2085
2155
|
)
|
|
2086
2156
|
};
|
|
2087
|
-
var __vue_staticRenderFns__$
|
|
2088
|
-
__vue_render__$
|
|
2157
|
+
var __vue_staticRenderFns__$e = [];
|
|
2158
|
+
__vue_render__$e._withStripped = true;
|
|
2089
2159
|
|
|
2090
2160
|
/* style */
|
|
2091
|
-
const __vue_inject_styles__$
|
|
2161
|
+
const __vue_inject_styles__$e = function (inject) {
|
|
2092
2162
|
if (!inject) return
|
|
2093
|
-
inject("data-v-
|
|
2163
|
+
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 });
|
|
2094
2164
|
|
|
2095
2165
|
};
|
|
2096
2166
|
/* scoped */
|
|
2097
|
-
const __vue_scope_id__$
|
|
2167
|
+
const __vue_scope_id__$e = "data-v-de67e2d2";
|
|
2098
2168
|
/* module identifier */
|
|
2099
|
-
const __vue_module_identifier__$
|
|
2169
|
+
const __vue_module_identifier__$e = undefined;
|
|
2100
2170
|
/* functional template */
|
|
2101
|
-
const __vue_is_functional_template__$
|
|
2171
|
+
const __vue_is_functional_template__$e = false;
|
|
2102
2172
|
/* style inject SSR */
|
|
2103
2173
|
|
|
2104
2174
|
/* style inject shadow dom */
|
|
2105
2175
|
|
|
2106
2176
|
|
|
2107
2177
|
|
|
2108
|
-
const __vue_component__$
|
|
2109
|
-
{ render: __vue_render__$
|
|
2110
|
-
__vue_inject_styles__$
|
|
2111
|
-
__vue_script__$
|
|
2112
|
-
__vue_scope_id__$
|
|
2113
|
-
__vue_is_functional_template__$
|
|
2114
|
-
__vue_module_identifier__$
|
|
2178
|
+
const __vue_component__$e = /*#__PURE__*/normalizeComponent(
|
|
2179
|
+
{ render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e },
|
|
2180
|
+
__vue_inject_styles__$e,
|
|
2181
|
+
__vue_script__$e,
|
|
2182
|
+
__vue_scope_id__$e,
|
|
2183
|
+
__vue_is_functional_template__$e,
|
|
2184
|
+
__vue_module_identifier__$e,
|
|
2115
2185
|
false,
|
|
2116
2186
|
createInjector,
|
|
2117
2187
|
undefined,
|
|
@@ -2119,13 +2189,13 @@
|
|
|
2119
2189
|
);
|
|
2120
2190
|
|
|
2121
2191
|
//
|
|
2122
|
-
var script$
|
|
2192
|
+
var script$d = {
|
|
2123
2193
|
name: 'ele-tree-table-model',
|
|
2124
2194
|
components: {
|
|
2125
|
-
EleTree: __vue_component__$
|
|
2126
|
-
EleTable: __vue_component__$
|
|
2127
|
-
EleSearchArea: __vue_component__$
|
|
2128
|
-
EleButtonGroup: __vue_component__$
|
|
2195
|
+
EleTree: __vue_component__$h,
|
|
2196
|
+
EleTable: __vue_component__$i,
|
|
2197
|
+
EleSearchArea: __vue_component__$f,
|
|
2198
|
+
EleButtonGroup: __vue_component__$e
|
|
2129
2199
|
},
|
|
2130
2200
|
props: {
|
|
2131
2201
|
treeMeta: {
|
|
@@ -2171,6 +2241,9 @@
|
|
|
2171
2241
|
};
|
|
2172
2242
|
},
|
|
2173
2243
|
computed: {
|
|
2244
|
+
showTree() {
|
|
2245
|
+
return !!Object.keys(this.treeMeta).length;
|
|
2246
|
+
},
|
|
2174
2247
|
buttonGroup() {
|
|
2175
2248
|
return v4();
|
|
2176
2249
|
},
|
|
@@ -2265,15 +2338,17 @@
|
|
|
2265
2338
|
}
|
|
2266
2339
|
},
|
|
2267
2340
|
async created() {
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2341
|
+
if (this.showTree) {
|
|
2342
|
+
this.treeData = await this.requestTreeData();
|
|
2343
|
+
const [defaultTreeNode = {}] = this.treeData;
|
|
2344
|
+
this.defaultExpandedKeys = [defaultTreeNode[this.replaceFields.key]];
|
|
2345
|
+
this.defaultSelectedKeys = [defaultTreeNode[this.replaceFields.key]];
|
|
2346
|
+
this.currentTreeNodeData = defaultTreeNode;
|
|
2347
|
+
}
|
|
2272
2348
|
const {
|
|
2273
2349
|
fieldMap
|
|
2274
2350
|
} = this.tableMeta;
|
|
2275
|
-
this.
|
|
2276
|
-
this.tableData = await this.requestTableData(this.execTableFieldMap(fieldMap, defaultTreeNode));
|
|
2351
|
+
this.tableData = await this.requestTableData(this.execTableFieldMap(fieldMap, this.currentTreeNodeData));
|
|
2277
2352
|
},
|
|
2278
2353
|
methods: {
|
|
2279
2354
|
handleClickButtonGroup(props) {
|
|
@@ -2399,34 +2474,37 @@
|
|
|
2399
2474
|
};
|
|
2400
2475
|
|
|
2401
2476
|
/* script */
|
|
2402
|
-
const __vue_script__$
|
|
2477
|
+
const __vue_script__$d = script$d;
|
|
2403
2478
|
|
|
2404
2479
|
/* template */
|
|
2405
|
-
var __vue_render__$
|
|
2480
|
+
var __vue_render__$d = function () {
|
|
2406
2481
|
var _vm = this;
|
|
2407
2482
|
var _h = _vm.$createElement;
|
|
2408
2483
|
var _c = _vm._self._c || _h;
|
|
2409
|
-
return _c("section", { staticClass: "model__tree-table" }, [
|
|
2410
|
-
|
|
2411
|
-
_c("
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2484
|
+
return _c("section", { staticClass: "ele model__tree-table" }, [
|
|
2485
|
+
_vm.showTree
|
|
2486
|
+
? _c("section", { staticClass: "model__tree-table--container" }, [
|
|
2487
|
+
_c("div", { staticClass: "model__tree--title" }),
|
|
2488
|
+
_vm._v(" "),
|
|
2489
|
+
_c(
|
|
2490
|
+
"section",
|
|
2491
|
+
{ ref: _vm.modelTreeWrapper, staticClass: "model__tree--wrapper" },
|
|
2492
|
+
[
|
|
2493
|
+
_c("ele-tree", {
|
|
2494
|
+
attrs: {
|
|
2495
|
+
"tree-data": _vm.treeData,
|
|
2496
|
+
defaultExpandedKeys: _vm.defaultExpandedKeys,
|
|
2497
|
+
defaultSelectedKeys: _vm.defaultSelectedKeys,
|
|
2498
|
+
"replace-fields":
|
|
2499
|
+
_vm.treeMeta.replaceFields || _vm.replaceFields,
|
|
2500
|
+
},
|
|
2501
|
+
on: { select: _vm.selectTreeNode },
|
|
2502
|
+
}),
|
|
2503
|
+
],
|
|
2504
|
+
1
|
|
2505
|
+
),
|
|
2506
|
+
])
|
|
2507
|
+
: _vm._e(),
|
|
2430
2508
|
_vm._v(" "),
|
|
2431
2509
|
_c("section", { staticClass: "model__table--container" }, [
|
|
2432
2510
|
_c("div", { staticClass: "model__table--title" }),
|
|
@@ -2479,34 +2557,34 @@
|
|
|
2479
2557
|
]),
|
|
2480
2558
|
])
|
|
2481
2559
|
};
|
|
2482
|
-
var __vue_staticRenderFns__$
|
|
2483
|
-
__vue_render__$
|
|
2560
|
+
var __vue_staticRenderFns__$d = [];
|
|
2561
|
+
__vue_render__$d._withStripped = true;
|
|
2484
2562
|
|
|
2485
2563
|
/* style */
|
|
2486
|
-
const __vue_inject_styles__$
|
|
2564
|
+
const __vue_inject_styles__$d = function (inject) {
|
|
2487
2565
|
if (!inject) return
|
|
2488
|
-
inject("data-v-37846a00_0", { source: ".model__tree-table[data-v-37846a00] {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.model__tree-table .model__tree-table--container .model__tree--wrapper[data-v-37846a00] {\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.model__tree-table .model__table--container[data-v-37846a00] {\n min-width: 0;\n background: #fff;\n}\n.model__tree-table .model__table--container .model__table--wrapper[data-v-37846a00] {\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":"AA0RA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;ACzRA;AD2RA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;ACzRA;AD4RA;EACA,YAAA;EACA,gBAAA;AC1RA;AD2RA;EACA,gBAAA;ACzRA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <section class=\"model__tree-table\">\r\n <section class=\"model__tree-table--container\">\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 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 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 const { fieldMap } = this.tableMeta\r\n this.currentTreeNodeData = defaultTreeNode\r\n this.tableData = await this.requestTableData(this.execTableFieldMap(fieldMap, defaultTreeNode))\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.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 min-width: 0;\r\n background: #fff;\r\n .model__table--wrapper {\r\n background: #fff;\r\n }\r\n }\r\n}\r\n</style>",".model__tree-table {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.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.model__tree-table .model__table--container {\n min-width: 0;\n background: #fff;\n}\n.model__tree-table .model__table--container .model__table--wrapper {\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
2566
|
+
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 });
|
|
2489
2567
|
|
|
2490
2568
|
};
|
|
2491
2569
|
/* scoped */
|
|
2492
|
-
const __vue_scope_id__$
|
|
2570
|
+
const __vue_scope_id__$d = "data-v-fe2ee33e";
|
|
2493
2571
|
/* module identifier */
|
|
2494
|
-
const __vue_module_identifier__$
|
|
2572
|
+
const __vue_module_identifier__$d = undefined;
|
|
2495
2573
|
/* functional template */
|
|
2496
|
-
const __vue_is_functional_template__$
|
|
2574
|
+
const __vue_is_functional_template__$d = false;
|
|
2497
2575
|
/* style inject SSR */
|
|
2498
2576
|
|
|
2499
2577
|
/* style inject shadow dom */
|
|
2500
2578
|
|
|
2501
2579
|
|
|
2502
2580
|
|
|
2503
|
-
const __vue_component__$
|
|
2504
|
-
{ render: __vue_render__$
|
|
2505
|
-
__vue_inject_styles__$
|
|
2506
|
-
__vue_script__$
|
|
2507
|
-
__vue_scope_id__$
|
|
2508
|
-
__vue_is_functional_template__$
|
|
2509
|
-
__vue_module_identifier__$
|
|
2581
|
+
const __vue_component__$d = /*#__PURE__*/normalizeComponent(
|
|
2582
|
+
{ render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d },
|
|
2583
|
+
__vue_inject_styles__$d,
|
|
2584
|
+
__vue_script__$d,
|
|
2585
|
+
__vue_scope_id__$d,
|
|
2586
|
+
__vue_is_functional_template__$d,
|
|
2587
|
+
__vue_module_identifier__$d,
|
|
2510
2588
|
false,
|
|
2511
2589
|
createInjector,
|
|
2512
2590
|
undefined,
|
|
@@ -2514,7 +2592,7 @@
|
|
|
2514
2592
|
);
|
|
2515
2593
|
|
|
2516
2594
|
//
|
|
2517
|
-
var script = {
|
|
2595
|
+
var script$c = {
|
|
2518
2596
|
name: 'ele-tpl',
|
|
2519
2597
|
props: {
|
|
2520
2598
|
modelName: {
|
|
@@ -2522,7 +2600,7 @@
|
|
|
2522
2600
|
}
|
|
2523
2601
|
},
|
|
2524
2602
|
components: {
|
|
2525
|
-
[__vue_component__$
|
|
2603
|
+
[__vue_component__$d.name]: __vue_component__$d
|
|
2526
2604
|
},
|
|
2527
2605
|
computed: {
|
|
2528
2606
|
modelNameValidator() {
|
|
@@ -2544,10 +2622,10 @@
|
|
|
2544
2622
|
};
|
|
2545
2623
|
|
|
2546
2624
|
/* script */
|
|
2547
|
-
const __vue_script__ = script;
|
|
2625
|
+
const __vue_script__$c = script$c;
|
|
2548
2626
|
|
|
2549
2627
|
/* template */
|
|
2550
|
-
var __vue_render__ = function () {
|
|
2628
|
+
var __vue_render__$c = function () {
|
|
2551
2629
|
var _vm = this;
|
|
2552
2630
|
var _h = _vm.$createElement;
|
|
2553
2631
|
var _c = _vm._self._c || _h;
|
|
@@ -2585,51 +2663,1890 @@
|
|
|
2585
2663
|
domProps: { innerHTML: _vm._s(_vm.modelNameValidator.message) },
|
|
2586
2664
|
})
|
|
2587
2665
|
};
|
|
2588
|
-
var __vue_staticRenderFns__ = [];
|
|
2589
|
-
__vue_render__._withStripped = true;
|
|
2666
|
+
var __vue_staticRenderFns__$c = [];
|
|
2667
|
+
__vue_render__$c._withStripped = true;
|
|
2590
2668
|
|
|
2591
2669
|
/* style */
|
|
2592
|
-
const __vue_inject_styles__ = function (inject) {
|
|
2670
|
+
const __vue_inject_styles__$c = function (inject) {
|
|
2593
2671
|
if (!inject) return
|
|
2594
|
-
inject("data-v-7b13873a_0", { source: ":root {\n --idooel-primary-color: #1890FF;\n --idooel-border-width: 2;\n --idooel-border-color: #53a8ff;\n --idooel-column-border-width: 1;\n --idooel-column-border-color: #d9ecff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,+BAA+B;EAC/B,wBAAwB;EACxB,8BAA8B;EAC9B,+BAA+B;EAC/B,qCAAqC;
|
|
2672
|
+
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 });
|
|
2595
2673
|
|
|
2596
2674
|
};
|
|
2597
2675
|
/* scoped */
|
|
2598
|
-
const __vue_scope_id__ = undefined;
|
|
2676
|
+
const __vue_scope_id__$c = undefined;
|
|
2599
2677
|
/* module identifier */
|
|
2600
|
-
const __vue_module_identifier__ = undefined;
|
|
2678
|
+
const __vue_module_identifier__$c = undefined;
|
|
2601
2679
|
/* functional template */
|
|
2602
|
-
const __vue_is_functional_template__ = false;
|
|
2680
|
+
const __vue_is_functional_template__$c = false;
|
|
2603
2681
|
/* style inject SSR */
|
|
2604
2682
|
|
|
2605
2683
|
/* style inject shadow dom */
|
|
2606
2684
|
|
|
2607
2685
|
|
|
2608
2686
|
|
|
2609
|
-
const __vue_component__ = /*#__PURE__*/normalizeComponent(
|
|
2610
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
2611
|
-
__vue_inject_styles__,
|
|
2612
|
-
__vue_script__,
|
|
2613
|
-
__vue_scope_id__,
|
|
2614
|
-
__vue_is_functional_template__,
|
|
2615
|
-
__vue_module_identifier__,
|
|
2687
|
+
const __vue_component__$c = /*#__PURE__*/normalizeComponent(
|
|
2688
|
+
{ render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c },
|
|
2689
|
+
__vue_inject_styles__$c,
|
|
2690
|
+
__vue_script__$c,
|
|
2691
|
+
__vue_scope_id__$c,
|
|
2692
|
+
__vue_is_functional_template__$c,
|
|
2693
|
+
__vue_module_identifier__$c,
|
|
2616
2694
|
false,
|
|
2617
2695
|
createInjector,
|
|
2618
2696
|
undefined,
|
|
2619
2697
|
undefined
|
|
2620
2698
|
);
|
|
2621
2699
|
|
|
2622
|
-
__vue_component__.install = Vue => Vue.component(__vue_component__.name, __vue_component__);
|
|
2700
|
+
__vue_component__$c.install = Vue => Vue.component(__vue_component__$c.name, __vue_component__$c);
|
|
2623
2701
|
|
|
2624
|
-
|
|
2702
|
+
//
|
|
2703
|
+
//
|
|
2704
|
+
//
|
|
2705
|
+
//
|
|
2706
|
+
//
|
|
2707
|
+
//
|
|
2708
|
+
//
|
|
2709
|
+
//
|
|
2710
|
+
//
|
|
2711
|
+
//
|
|
2712
|
+
//
|
|
2625
2713
|
|
|
2626
|
-
|
|
2714
|
+
var script$b = {
|
|
2715
|
+
name: 'ele-textarea',
|
|
2716
|
+
props: {
|
|
2717
|
+
maxLength: {
|
|
2718
|
+
type: Number
|
|
2719
|
+
},
|
|
2720
|
+
placeholder: {
|
|
2721
|
+
type: String
|
|
2722
|
+
},
|
|
2723
|
+
allowClear: {
|
|
2724
|
+
type: Boolean,
|
|
2725
|
+
default: false
|
|
2726
|
+
},
|
|
2727
|
+
autosize: {
|
|
2728
|
+
type: [Boolean, Object],
|
|
2729
|
+
default: () => ({
|
|
2730
|
+
minRows: 4,
|
|
2731
|
+
maxRows: 4
|
|
2732
|
+
})
|
|
2733
|
+
},
|
|
2734
|
+
value: {
|
|
2735
|
+
type: String
|
|
2736
|
+
}
|
|
2737
|
+
},
|
|
2738
|
+
methods: {
|
|
2739
|
+
onChange(e) {
|
|
2740
|
+
const value = e.target.value;
|
|
2741
|
+
this.$emit('on-change', value);
|
|
2742
|
+
this.$emit('input', value);
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
};
|
|
2627
2746
|
|
|
2628
|
-
|
|
2747
|
+
/* script */
|
|
2748
|
+
const __vue_script__$b = script$b;
|
|
2749
|
+
|
|
2750
|
+
/* template */
|
|
2751
|
+
var __vue_render__$b = function () {
|
|
2752
|
+
var _vm = this;
|
|
2753
|
+
var _h = _vm.$createElement;
|
|
2754
|
+
var _c = _vm._self._c || _h;
|
|
2755
|
+
return _c("a-textarea", {
|
|
2756
|
+
attrs: {
|
|
2757
|
+
value: _vm.value,
|
|
2758
|
+
"auto-size": _vm.autosize,
|
|
2759
|
+
"max-length": _vm.maxLength,
|
|
2760
|
+
placeholder: _vm.placeholder,
|
|
2761
|
+
"allow-clear": _vm.allowClear,
|
|
2762
|
+
},
|
|
2763
|
+
on: { change: _vm.onChange },
|
|
2764
|
+
})
|
|
2765
|
+
};
|
|
2766
|
+
var __vue_staticRenderFns__$b = [];
|
|
2767
|
+
__vue_render__$b._withStripped = true;
|
|
2768
|
+
|
|
2769
|
+
/* style */
|
|
2770
|
+
const __vue_inject_styles__$b = function (inject) {
|
|
2771
|
+
if (!inject) return
|
|
2772
|
+
inject("data-v-256502c2_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", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
|
|
2773
|
+
|
|
2774
|
+
};
|
|
2775
|
+
/* scoped */
|
|
2776
|
+
const __vue_scope_id__$b = "data-v-256502c2";
|
|
2777
|
+
/* module identifier */
|
|
2778
|
+
const __vue_module_identifier__$b = undefined;
|
|
2779
|
+
/* functional template */
|
|
2780
|
+
const __vue_is_functional_template__$b = false;
|
|
2781
|
+
/* style inject SSR */
|
|
2782
|
+
|
|
2783
|
+
/* style inject shadow dom */
|
|
2784
|
+
|
|
2785
|
+
|
|
2786
|
+
|
|
2787
|
+
const __vue_component__$b = /*#__PURE__*/normalizeComponent(
|
|
2788
|
+
{ render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b },
|
|
2789
|
+
__vue_inject_styles__$b,
|
|
2790
|
+
__vue_script__$b,
|
|
2791
|
+
__vue_scope_id__$b,
|
|
2792
|
+
__vue_is_functional_template__$b,
|
|
2793
|
+
__vue_module_identifier__$b,
|
|
2794
|
+
false,
|
|
2795
|
+
createInjector,
|
|
2796
|
+
undefined,
|
|
2797
|
+
undefined
|
|
2798
|
+
);
|
|
2799
|
+
|
|
2800
|
+
//
|
|
2801
|
+
//
|
|
2802
|
+
//
|
|
2803
|
+
//
|
|
2804
|
+
//
|
|
2805
|
+
//
|
|
2806
|
+
//
|
|
2807
|
+
//
|
|
2808
|
+
//
|
|
2809
|
+
|
|
2810
|
+
var script$a = {
|
|
2811
|
+
name: 'ele-icon',
|
|
2812
|
+
props: {
|
|
2813
|
+
type: {
|
|
2814
|
+
type: String,
|
|
2815
|
+
default: ''
|
|
2816
|
+
},
|
|
2817
|
+
theme: {
|
|
2818
|
+
type: String
|
|
2819
|
+
}
|
|
2820
|
+
},
|
|
2821
|
+
computed: {
|
|
2822
|
+
isAntIcon() {
|
|
2823
|
+
const prefix = this.type.slice(0, 5);
|
|
2824
|
+
if (prefix === 'icon-') {
|
|
2825
|
+
return false;
|
|
2826
|
+
}
|
|
2827
|
+
return true;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
};
|
|
2831
|
+
|
|
2832
|
+
/* script */
|
|
2833
|
+
const __vue_script__$a = script$a;
|
|
2834
|
+
|
|
2835
|
+
/* template */
|
|
2836
|
+
var __vue_render__$a = function () {
|
|
2837
|
+
var _vm = this;
|
|
2838
|
+
var _h = _vm.$createElement;
|
|
2839
|
+
var _c = _vm._self._c || _h;
|
|
2840
|
+
return _vm.isAntIcon
|
|
2841
|
+
? _c("a-icon", { attrs: { type: _vm.type, theme: _vm.theme } })
|
|
2842
|
+
: _c("i", { class: ["iconfont", _vm.type] })
|
|
2843
|
+
};
|
|
2844
|
+
var __vue_staticRenderFns__$a = [];
|
|
2845
|
+
__vue_render__$a._withStripped = true;
|
|
2846
|
+
|
|
2847
|
+
/* style */
|
|
2848
|
+
const __vue_inject_styles__$a = undefined;
|
|
2849
|
+
/* scoped */
|
|
2850
|
+
const __vue_scope_id__$a = undefined;
|
|
2851
|
+
/* module identifier */
|
|
2852
|
+
const __vue_module_identifier__$a = undefined;
|
|
2853
|
+
/* functional template */
|
|
2854
|
+
const __vue_is_functional_template__$a = false;
|
|
2855
|
+
/* style inject */
|
|
2856
|
+
|
|
2857
|
+
/* style inject SSR */
|
|
2858
|
+
|
|
2859
|
+
/* style inject shadow dom */
|
|
2860
|
+
|
|
2861
|
+
|
|
2862
|
+
|
|
2863
|
+
const __vue_component__$a = /*#__PURE__*/normalizeComponent(
|
|
2864
|
+
{ render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a },
|
|
2865
|
+
__vue_inject_styles__$a,
|
|
2866
|
+
__vue_script__$a,
|
|
2867
|
+
__vue_scope_id__$a,
|
|
2868
|
+
__vue_is_functional_template__$a,
|
|
2869
|
+
__vue_module_identifier__$a,
|
|
2870
|
+
false,
|
|
2871
|
+
undefined,
|
|
2872
|
+
undefined,
|
|
2873
|
+
undefined
|
|
2874
|
+
);
|
|
2875
|
+
|
|
2876
|
+
//
|
|
2877
|
+
var script$9 = {
|
|
2878
|
+
name: 'ele-upload',
|
|
2879
|
+
components: {
|
|
2880
|
+
FileUpload: FileUpload__default["default"],
|
|
2881
|
+
EleIcon: __vue_component__$a
|
|
2882
|
+
},
|
|
2883
|
+
model: {
|
|
2884
|
+
prop: 'value',
|
|
2885
|
+
event: 'change'
|
|
2886
|
+
},
|
|
2887
|
+
props: {
|
|
2888
|
+
url: {
|
|
2889
|
+
type: String,
|
|
2890
|
+
default: '/zuul/api-file/workbench/file'
|
|
2891
|
+
},
|
|
2892
|
+
size: {
|
|
2893
|
+
type: Number,
|
|
2894
|
+
default: 100
|
|
2895
|
+
},
|
|
2896
|
+
accept: {
|
|
2897
|
+
type: String
|
|
2898
|
+
},
|
|
2899
|
+
maximum: {
|
|
2900
|
+
type: Number,
|
|
2901
|
+
default: 10
|
|
2902
|
+
},
|
|
2903
|
+
multiple: {
|
|
2904
|
+
type: Boolean,
|
|
2905
|
+
default: false
|
|
2906
|
+
},
|
|
2907
|
+
drop: {
|
|
2908
|
+
type: Boolean,
|
|
2909
|
+
default: true
|
|
2910
|
+
},
|
|
2911
|
+
value: {
|
|
2912
|
+
type: [String, Array]
|
|
2913
|
+
},
|
|
2914
|
+
querys: {
|
|
2915
|
+
type: Object,
|
|
2916
|
+
default: () => ({
|
|
2917
|
+
_csrf: 'c81f993f-f044-45bb-b3af-2977d335042d',
|
|
2918
|
+
_t: new Date().valueOf()
|
|
2919
|
+
})
|
|
2920
|
+
},
|
|
2921
|
+
headers: {
|
|
2922
|
+
type: Object,
|
|
2923
|
+
default: () => ({})
|
|
2924
|
+
},
|
|
2925
|
+
byteConversion: {
|
|
2926
|
+
type: Number,
|
|
2927
|
+
default: 1024 * 1024
|
|
2928
|
+
},
|
|
2929
|
+
chunkEnabled: {
|
|
2930
|
+
type: Boolean,
|
|
2931
|
+
default: true
|
|
2932
|
+
}
|
|
2933
|
+
},
|
|
2934
|
+
data() {
|
|
2935
|
+
return {
|
|
2936
|
+
files: [],
|
|
2937
|
+
saveToServerAsyncPageTimer: null
|
|
2938
|
+
};
|
|
2939
|
+
},
|
|
2940
|
+
computed: {
|
|
2941
|
+
getPayloads() {
|
|
2942
|
+
return {
|
|
2943
|
+
override: false
|
|
2944
|
+
};
|
|
2945
|
+
},
|
|
2946
|
+
chunkConfig() {
|
|
2947
|
+
shared.route.toQueryString(this.querys);
|
|
2948
|
+
return {
|
|
2949
|
+
action: `${window.prefixPath}/zuul/api-file/workbench/file/temp/chunk/vue`,
|
|
2950
|
+
headers: {
|
|
2951
|
+
'X-XSRF-TOKEN': localStorage.getItem('token')
|
|
2952
|
+
},
|
|
2953
|
+
minSize: 3 * this.byteConversion,
|
|
2954
|
+
maxActive: 3,
|
|
2955
|
+
maxRetries: 5,
|
|
2956
|
+
startBody: {
|
|
2957
|
+
override: true,
|
|
2958
|
+
path: '/cw'
|
|
2959
|
+
},
|
|
2960
|
+
uploadBody: {
|
|
2961
|
+
override: true,
|
|
2962
|
+
path: '/cw'
|
|
2963
|
+
},
|
|
2964
|
+
finishBody: {
|
|
2965
|
+
override: true,
|
|
2966
|
+
path: '/cw'
|
|
2967
|
+
}
|
|
2968
|
+
};
|
|
2969
|
+
},
|
|
2970
|
+
isFileUploadSuccessed() {
|
|
2971
|
+
return this.files.every(file => file.success);
|
|
2972
|
+
},
|
|
2973
|
+
isShowUploadContainer() {
|
|
2974
|
+
if (this.multiple) {
|
|
2975
|
+
if (this.isFileUploadSuccessed && this.files.length >= this.maximum) {
|
|
2976
|
+
return false;
|
|
2977
|
+
} else {
|
|
2978
|
+
return true;
|
|
2979
|
+
}
|
|
2980
|
+
} else {
|
|
2981
|
+
if (this.isFileUploadSuccessed && this.files.length >= 1) {
|
|
2982
|
+
return false;
|
|
2983
|
+
} else {
|
|
2984
|
+
return true;
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
},
|
|
2988
|
+
getMaximum() {
|
|
2989
|
+
return this.multiple ? this.maximum : 1;
|
|
2990
|
+
},
|
|
2991
|
+
fileSizeLimit() {
|
|
2992
|
+
return this.size * this.byteConversion;
|
|
2993
|
+
},
|
|
2994
|
+
postAction() {
|
|
2995
|
+
const ret = shared.route.toQueryString(this.querys);
|
|
2996
|
+
return `${window.prefixPath}${this.url}?${ret}`;
|
|
2997
|
+
},
|
|
2998
|
+
uploadRef() {
|
|
2999
|
+
return v4();
|
|
3000
|
+
},
|
|
3001
|
+
fileSuffixIcon() {
|
|
3002
|
+
return {
|
|
3003
|
+
'doc': {
|
|
3004
|
+
name: 'icon-doc'
|
|
3005
|
+
}
|
|
3006
|
+
};
|
|
3007
|
+
},
|
|
3008
|
+
fileIds() {
|
|
3009
|
+
const fileIds = this.files.map(file => {
|
|
3010
|
+
return file.response.data.fileID;
|
|
3011
|
+
});
|
|
3012
|
+
return this.multiple ? fileIds : fileIds[0];
|
|
3013
|
+
}
|
|
3014
|
+
},
|
|
3015
|
+
methods: {
|
|
3016
|
+
handleClickDownload(file) {
|
|
3017
|
+
console.log('download file', file);
|
|
3018
|
+
},
|
|
3019
|
+
handleClickDelete(file) {
|
|
3020
|
+
this.$refs[this.uploadRef].remove(file);
|
|
3021
|
+
this.$emit('change', this.fileIds);
|
|
3022
|
+
},
|
|
3023
|
+
onWatchFiles(files) {
|
|
3024
|
+
this.files = files;
|
|
3025
|
+
if (this.isFileUploadSuccessed) {
|
|
3026
|
+
this.$emit('change', this.fileIds);
|
|
3027
|
+
}
|
|
3028
|
+
},
|
|
3029
|
+
async saveToServerAsyncPage(payloads = {}) {
|
|
3030
|
+
shared.net.post('zuul/api-file/workbench/file/temp/saveToServerAsyncPage', payloads, {
|
|
3031
|
+
headers: {
|
|
3032
|
+
'Content-Type': 'multipart/form-data'
|
|
3033
|
+
}
|
|
3034
|
+
}).then(resp => {
|
|
3035
|
+
const {
|
|
3036
|
+
data
|
|
3037
|
+
} = resp;
|
|
3038
|
+
if (data !== 'saveToServerAsyncPage') {
|
|
3039
|
+
clearInterval(this.saveToServerAsyncPageTimer);
|
|
3040
|
+
}
|
|
3041
|
+
});
|
|
3042
|
+
// const ret = await net.post({
|
|
3043
|
+
// url: 'zuul/api-file/workbench/file/temp/saveToServerAsyncPage',
|
|
3044
|
+
// method: 'POST',
|
|
3045
|
+
// data: { ...payloads }
|
|
3046
|
+
// }).then(resp => {
|
|
3047
|
+
// const { data: { data, code, message } } = resp
|
|
3048
|
+
// if (code !== '2000') {
|
|
3049
|
+
// this.$Message.error(message)
|
|
3050
|
+
// return
|
|
3051
|
+
// }
|
|
3052
|
+
// if (data !== 'saveToServerAsyncPage') {
|
|
3053
|
+
// clearInterval(timer)
|
|
3054
|
+
// const { fileID, size } = data
|
|
3055
|
+
// this.$emit('on-success', { ...data, fileId: fileID })
|
|
3056
|
+
// this.$Message.success('同步成功')
|
|
3057
|
+
// return { fileId: fileID, size }
|
|
3058
|
+
// }
|
|
3059
|
+
// })
|
|
3060
|
+
// return ret
|
|
3061
|
+
},
|
|
3062
|
+
onWatchInputFiles(newFile, oldFile) {
|
|
3063
|
+
if (newFile && !oldFile) {
|
|
3064
|
+
// add file
|
|
3065
|
+
console.log('add', newFile);
|
|
3066
|
+
}
|
|
3067
|
+
if (newFile && oldFile) {
|
|
3068
|
+
// update file
|
|
3069
|
+
console.log('update', newFile);
|
|
3070
|
+
const {
|
|
3071
|
+
success,
|
|
3072
|
+
active,
|
|
3073
|
+
chunk,
|
|
3074
|
+
response
|
|
3075
|
+
} = newFile;
|
|
3076
|
+
if (chunk && success && !active) {
|
|
3077
|
+
console.log('chunk end');
|
|
3078
|
+
const {
|
|
3079
|
+
data: {
|
|
3080
|
+
file,
|
|
3081
|
+
type
|
|
3082
|
+
}
|
|
3083
|
+
} = response;
|
|
3084
|
+
const payloads = {
|
|
3085
|
+
filePath: file.match(/\/cw(.*)/)[0],
|
|
3086
|
+
asyncID: v4(),
|
|
3087
|
+
isDeleteOrigin: false,
|
|
3088
|
+
toImage: type === 'pdf' ? true : false,
|
|
3089
|
+
unzip: type === 'zip' ? true : false,
|
|
3090
|
+
_csrf: localStorage.getItem('token')
|
|
3091
|
+
};
|
|
3092
|
+
this.saveToServerAsyncPageTimer = setInterval(() => {
|
|
3093
|
+
this.saveToServerAsyncPage(payloads);
|
|
3094
|
+
}, 2000);
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
if (!newFile && oldFile) {
|
|
3098
|
+
// delete file
|
|
3099
|
+
console.log('delete');
|
|
3100
|
+
}
|
|
3101
|
+
if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) {
|
|
3102
|
+
if (!this.$refs[this.uploadRef].active) {
|
|
3103
|
+
this.$refs[this.uploadRef].active = true;
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3107
|
+
}
|
|
3108
|
+
};
|
|
3109
|
+
|
|
3110
|
+
/* script */
|
|
3111
|
+
const __vue_script__$9 = script$9;
|
|
3112
|
+
|
|
3113
|
+
/* template */
|
|
3114
|
+
var __vue_render__$9 = function () {
|
|
3115
|
+
var _vm = this;
|
|
3116
|
+
var _h = _vm.$createElement;
|
|
3117
|
+
var _c = _vm._self._c || _h;
|
|
3118
|
+
return _c(
|
|
3119
|
+
"div",
|
|
3120
|
+
{ staticClass: "ele-upload__wrapper" },
|
|
3121
|
+
[
|
|
3122
|
+
_c(
|
|
3123
|
+
"FileUpload",
|
|
3124
|
+
{
|
|
3125
|
+
directives: [
|
|
3126
|
+
{
|
|
3127
|
+
name: "show",
|
|
3128
|
+
rawName: "v-show",
|
|
3129
|
+
value: _vm.isShowUploadContainer,
|
|
3130
|
+
expression: "isShowUploadContainer",
|
|
3131
|
+
},
|
|
3132
|
+
],
|
|
3133
|
+
ref: _vm.uploadRef,
|
|
3134
|
+
staticClass: "ele-upload__inner",
|
|
3135
|
+
staticStyle: { width: "100%" },
|
|
3136
|
+
attrs: {
|
|
3137
|
+
drop: _vm.drop,
|
|
3138
|
+
"chunk-enabled": _vm.chunkEnabled,
|
|
3139
|
+
chunk: _vm.chunkConfig,
|
|
3140
|
+
accept: _vm.accept,
|
|
3141
|
+
size: _vm.fileSizeLimit,
|
|
3142
|
+
"post-action": _vm.postAction,
|
|
3143
|
+
multiple: _vm.multiple,
|
|
3144
|
+
maximum: _vm.getMaximum,
|
|
3145
|
+
},
|
|
3146
|
+
on: { "input-file": _vm.onWatchInputFiles, input: _vm.onWatchFiles },
|
|
3147
|
+
model: {
|
|
3148
|
+
value: _vm.files,
|
|
3149
|
+
callback: function ($$v) {
|
|
3150
|
+
_vm.files = $$v;
|
|
3151
|
+
},
|
|
3152
|
+
expression: "files",
|
|
3153
|
+
},
|
|
3154
|
+
},
|
|
3155
|
+
[
|
|
3156
|
+
_c("section", { staticClass: "ele-upload__area" }, [
|
|
3157
|
+
_c(
|
|
3158
|
+
"div",
|
|
3159
|
+
{ staticClass: "ele-upload__area--icon" },
|
|
3160
|
+
[_c("ele-icon", { attrs: { type: "cloud-upload" } })],
|
|
3161
|
+
1
|
|
3162
|
+
),
|
|
3163
|
+
_vm._v(" "),
|
|
3164
|
+
_c("div", { staticClass: "ele-upload__area--text" }, [
|
|
3165
|
+
_c("div", { staticClass: "ele-upload__message" }, [
|
|
3166
|
+
_vm._v("单击或拖动文件到该区域以上传"),
|
|
3167
|
+
]),
|
|
3168
|
+
_vm._v(" "),
|
|
3169
|
+
_c("div", { staticClass: "ele-upload__ext" }, [
|
|
3170
|
+
_vm._v("文件小于" + _vm._s(_vm.size) + "M"),
|
|
3171
|
+
]),
|
|
3172
|
+
]),
|
|
3173
|
+
]),
|
|
3174
|
+
]
|
|
3175
|
+
),
|
|
3176
|
+
_vm._v(" "),
|
|
3177
|
+
_c(
|
|
3178
|
+
"section",
|
|
3179
|
+
{ staticClass: "ele-files__wrapper" },
|
|
3180
|
+
_vm._l(_vm.files, function (file, idx) {
|
|
3181
|
+
return _c("div", { key: idx, staticClass: "ele-file__item" }, [
|
|
3182
|
+
_c(
|
|
3183
|
+
"div",
|
|
3184
|
+
{ staticClass: "ele-file__suffix--icon" },
|
|
3185
|
+
[_c("ele-icon", { attrs: { type: "icon-doc" } })],
|
|
3186
|
+
1
|
|
3187
|
+
),
|
|
3188
|
+
_vm._v(" "),
|
|
3189
|
+
_c("div", { staticClass: "ele-file__name" }, [
|
|
3190
|
+
_c(
|
|
3191
|
+
"div",
|
|
3192
|
+
{
|
|
3193
|
+
staticClass: "ele-file__inner",
|
|
3194
|
+
on: {
|
|
3195
|
+
click: function ($event) {
|
|
3196
|
+
return _vm.handleClickDownload(file)
|
|
3197
|
+
},
|
|
3198
|
+
},
|
|
3199
|
+
},
|
|
3200
|
+
[_vm._v(_vm._s(file.name))]
|
|
3201
|
+
),
|
|
3202
|
+
_vm._v(" "),
|
|
3203
|
+
!file.success
|
|
3204
|
+
? _c(
|
|
3205
|
+
"div",
|
|
3206
|
+
{ staticClass: "ele-uplpad__progress" },
|
|
3207
|
+
[
|
|
3208
|
+
_c("a-progress", {
|
|
3209
|
+
attrs: {
|
|
3210
|
+
strokeWidth: 2,
|
|
3211
|
+
percent: Number(file.progress),
|
|
3212
|
+
size: "small",
|
|
3213
|
+
},
|
|
3214
|
+
}),
|
|
3215
|
+
],
|
|
3216
|
+
1
|
|
3217
|
+
)
|
|
3218
|
+
: _vm._e(),
|
|
3219
|
+
]),
|
|
3220
|
+
_vm._v(" "),
|
|
3221
|
+
file.success || file.error
|
|
3222
|
+
? _c("div", { staticClass: "ele-file__delete" }, [
|
|
3223
|
+
_c("span", { staticClass: "ele-file__size" }, [
|
|
3224
|
+
_vm._v(
|
|
3225
|
+
_vm._s((file.size / _vm.byteConversion).toFixed(2)) + "M"
|
|
3226
|
+
),
|
|
3227
|
+
]),
|
|
3228
|
+
_vm._v(" "),
|
|
3229
|
+
_c(
|
|
3230
|
+
"span",
|
|
3231
|
+
{
|
|
3232
|
+
staticClass: "ele-file__delete--icon",
|
|
3233
|
+
on: {
|
|
3234
|
+
click: function ($event) {
|
|
3235
|
+
return _vm.handleClickDelete(file)
|
|
3236
|
+
},
|
|
3237
|
+
},
|
|
3238
|
+
},
|
|
3239
|
+
[_c("ele-icon", { attrs: { type: "delete" } })],
|
|
3240
|
+
1
|
|
3241
|
+
),
|
|
3242
|
+
])
|
|
3243
|
+
: _vm._e(),
|
|
3244
|
+
])
|
|
3245
|
+
}),
|
|
3246
|
+
0
|
|
3247
|
+
),
|
|
3248
|
+
],
|
|
3249
|
+
1
|
|
3250
|
+
)
|
|
3251
|
+
};
|
|
3252
|
+
var __vue_staticRenderFns__$9 = [];
|
|
3253
|
+
__vue_render__$9._withStripped = true;
|
|
3254
|
+
|
|
3255
|
+
/* style */
|
|
3256
|
+
const __vue_inject_styles__$9 = function (inject) {
|
|
3257
|
+
if (!inject) return
|
|
3258
|
+
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 });
|
|
3259
|
+
|
|
3260
|
+
};
|
|
3261
|
+
/* scoped */
|
|
3262
|
+
const __vue_scope_id__$9 = "data-v-29bc9f58";
|
|
3263
|
+
/* module identifier */
|
|
3264
|
+
const __vue_module_identifier__$9 = undefined;
|
|
3265
|
+
/* functional template */
|
|
3266
|
+
const __vue_is_functional_template__$9 = false;
|
|
3267
|
+
/* style inject SSR */
|
|
3268
|
+
|
|
3269
|
+
/* style inject shadow dom */
|
|
3270
|
+
|
|
3271
|
+
|
|
3272
|
+
|
|
3273
|
+
const __vue_component__$9 = /*#__PURE__*/normalizeComponent(
|
|
3274
|
+
{ render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 },
|
|
3275
|
+
__vue_inject_styles__$9,
|
|
3276
|
+
__vue_script__$9,
|
|
3277
|
+
__vue_scope_id__$9,
|
|
3278
|
+
__vue_is_functional_template__$9,
|
|
3279
|
+
__vue_module_identifier__$9,
|
|
3280
|
+
false,
|
|
3281
|
+
createInjector,
|
|
3282
|
+
undefined,
|
|
3283
|
+
undefined
|
|
3284
|
+
);
|
|
3285
|
+
|
|
3286
|
+
//
|
|
3287
|
+
//
|
|
3288
|
+
//
|
|
3289
|
+
//
|
|
3290
|
+
//
|
|
3291
|
+
//
|
|
3292
|
+
//
|
|
3293
|
+
//
|
|
3294
|
+
//
|
|
3295
|
+
//
|
|
3296
|
+
//
|
|
3297
|
+
//
|
|
3298
|
+
//
|
|
3299
|
+
//
|
|
3300
|
+
//
|
|
3301
|
+
//
|
|
3302
|
+
//
|
|
3303
|
+
//
|
|
3304
|
+
|
|
3305
|
+
var script$8 = {
|
|
3306
|
+
name: 'ele-select-entity',
|
|
3307
|
+
props: {
|
|
3308
|
+
value: {
|
|
3309
|
+
type: [Array, Object]
|
|
3310
|
+
},
|
|
3311
|
+
multiple: {
|
|
3312
|
+
type: Boolean,
|
|
3313
|
+
default: true
|
|
3314
|
+
},
|
|
3315
|
+
maxCount: {
|
|
3316
|
+
type: Number,
|
|
3317
|
+
default: 7
|
|
3318
|
+
},
|
|
3319
|
+
disabled: {
|
|
3320
|
+
type: Boolean,
|
|
3321
|
+
default: false
|
|
3322
|
+
},
|
|
3323
|
+
addonAfter: {
|
|
3324
|
+
type: String,
|
|
3325
|
+
default: '选择'
|
|
3326
|
+
}
|
|
3327
|
+
},
|
|
3328
|
+
methods: {
|
|
3329
|
+
getValueList() {
|
|
3330
|
+
if (this.value) {
|
|
3331
|
+
if (this.multiple) {
|
|
3332
|
+
return this.getIsMaxCount() ? this.value.slice(0, this.maxCount) : this.value;
|
|
3333
|
+
}
|
|
3334
|
+
return [this.value];
|
|
3335
|
+
}
|
|
3336
|
+
return [];
|
|
3337
|
+
},
|
|
3338
|
+
getIsMaxCount() {
|
|
3339
|
+
if (this.value && this.multiple) {
|
|
3340
|
+
return this.value.length >= this.maxCount;
|
|
3341
|
+
}
|
|
3342
|
+
return false;
|
|
3343
|
+
},
|
|
3344
|
+
onChange() {
|
|
3345
|
+
if (this.disabled) return;
|
|
3346
|
+
this.$emit('change', this.value);
|
|
3347
|
+
},
|
|
3348
|
+
onClose(e, inx) {
|
|
3349
|
+
e = window.event || e;
|
|
3350
|
+
e.preventDefault();
|
|
3351
|
+
if (!this.multiple) {
|
|
3352
|
+
this.$emit('change', null);
|
|
3353
|
+
return;
|
|
3354
|
+
}
|
|
3355
|
+
this.value.splice(inx, 1);
|
|
3356
|
+
this.$emit('change', this.value);
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
};
|
|
3360
|
+
|
|
3361
|
+
/* script */
|
|
3362
|
+
const __vue_script__$8 = script$8;
|
|
3363
|
+
|
|
3364
|
+
/* template */
|
|
3365
|
+
var __vue_render__$8 = function () {
|
|
3366
|
+
var _vm = this;
|
|
3367
|
+
var _h = _vm.$createElement;
|
|
3368
|
+
var _c = _vm._self._c || _h;
|
|
3369
|
+
return _c(
|
|
3370
|
+
"div",
|
|
3371
|
+
{
|
|
3372
|
+
staticClass: "g-select-entity__wrapper",
|
|
3373
|
+
class: _vm.disabled ? "g-select-entity__disabled" : "",
|
|
3374
|
+
},
|
|
3375
|
+
[
|
|
3376
|
+
_c(
|
|
3377
|
+
"span",
|
|
3378
|
+
{ staticClass: "select-entity__input" },
|
|
3379
|
+
[
|
|
3380
|
+
_vm._l(_vm.getValueList(), function (item, inx) {
|
|
3381
|
+
return _c(
|
|
3382
|
+
"a-tag",
|
|
3383
|
+
{
|
|
3384
|
+
key: item.value,
|
|
3385
|
+
attrs: { closable: !_vm.disabled && !_vm.getIsMaxCount() },
|
|
3386
|
+
on: {
|
|
3387
|
+
close: function ($event) {
|
|
3388
|
+
var i = arguments.length,
|
|
3389
|
+
argsArray = Array(i);
|
|
3390
|
+
while (i--) argsArray[i] = arguments[i];
|
|
3391
|
+
return _vm.onClose.apply(void 0, argsArray.concat([inx]))
|
|
3392
|
+
},
|
|
3393
|
+
},
|
|
3394
|
+
},
|
|
3395
|
+
[_vm._v("\n " + _vm._s(item.label) + "\n ")]
|
|
3396
|
+
)
|
|
3397
|
+
}),
|
|
3398
|
+
_vm._v(" "),
|
|
3399
|
+
_vm.getIsMaxCount() ? _c("a-tag", [_vm._v("......")]) : _vm._e(),
|
|
3400
|
+
],
|
|
3401
|
+
2
|
|
3402
|
+
),
|
|
3403
|
+
_vm._v(" "),
|
|
3404
|
+
_c(
|
|
3405
|
+
"span",
|
|
3406
|
+
{ staticClass: "select-entity__addon", on: { click: _vm.onChange } },
|
|
3407
|
+
[_vm._v(_vm._s(_vm.addonAfter))]
|
|
3408
|
+
),
|
|
3409
|
+
_vm._v(" "),
|
|
3410
|
+
_vm._t("default"),
|
|
3411
|
+
],
|
|
3412
|
+
2
|
|
3413
|
+
)
|
|
3414
|
+
};
|
|
3415
|
+
var __vue_staticRenderFns__$8 = [];
|
|
3416
|
+
__vue_render__$8._withStripped = true;
|
|
3417
|
+
|
|
3418
|
+
/* style */
|
|
3419
|
+
const __vue_inject_styles__$8 = function (inject) {
|
|
3420
|
+
if (!inject) return
|
|
3421
|
+
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 });
|
|
3422
|
+
|
|
3423
|
+
};
|
|
3424
|
+
/* scoped */
|
|
3425
|
+
const __vue_scope_id__$8 = "data-v-328544bb";
|
|
3426
|
+
/* module identifier */
|
|
3427
|
+
const __vue_module_identifier__$8 = undefined;
|
|
3428
|
+
/* functional template */
|
|
3429
|
+
const __vue_is_functional_template__$8 = false;
|
|
3430
|
+
/* style inject SSR */
|
|
3431
|
+
|
|
3432
|
+
/* style inject shadow dom */
|
|
3433
|
+
|
|
3434
|
+
|
|
3435
|
+
|
|
3436
|
+
const __vue_component__$8 = /*#__PURE__*/normalizeComponent(
|
|
3437
|
+
{ render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
|
|
3438
|
+
__vue_inject_styles__$8,
|
|
3439
|
+
__vue_script__$8,
|
|
3440
|
+
__vue_scope_id__$8,
|
|
3441
|
+
__vue_is_functional_template__$8,
|
|
3442
|
+
__vue_module_identifier__$8,
|
|
3443
|
+
false,
|
|
3444
|
+
createInjector,
|
|
3445
|
+
undefined,
|
|
3446
|
+
undefined
|
|
3447
|
+
);
|
|
3448
|
+
|
|
3449
|
+
//
|
|
3450
|
+
//
|
|
3451
|
+
//
|
|
3452
|
+
//
|
|
3453
|
+
//
|
|
3454
|
+
//
|
|
3455
|
+
|
|
3456
|
+
var script$7 = {
|
|
3457
|
+
name: 'ele-input-number',
|
|
3458
|
+
props: {
|
|
3459
|
+
precision: {
|
|
3460
|
+
type: Number
|
|
3461
|
+
},
|
|
3462
|
+
value: {
|
|
3463
|
+
type: [Number, String]
|
|
3464
|
+
}
|
|
3465
|
+
},
|
|
3466
|
+
methods: {
|
|
3467
|
+
onChange(value) {
|
|
3468
|
+
this.$emit('change', value);
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
};
|
|
3472
|
+
|
|
3473
|
+
/* script */
|
|
3474
|
+
const __vue_script__$7 = script$7;
|
|
3475
|
+
|
|
3476
|
+
/* template */
|
|
3477
|
+
var __vue_render__$7 = function () {
|
|
3478
|
+
var _vm = this;
|
|
3479
|
+
var _h = _vm.$createElement;
|
|
3480
|
+
var _c = _vm._self._c || _h;
|
|
3481
|
+
return _c(
|
|
3482
|
+
"div",
|
|
3483
|
+
[
|
|
3484
|
+
_c(
|
|
3485
|
+
"a-input-number",
|
|
3486
|
+
_vm._b(
|
|
3487
|
+
{
|
|
3488
|
+
staticStyle: { width: "100%" },
|
|
3489
|
+
attrs: { value: _vm.value, precision: _vm.precision },
|
|
3490
|
+
on: { change: _vm.onChange },
|
|
3491
|
+
},
|
|
3492
|
+
"a-input-number",
|
|
3493
|
+
_vm.$attrs,
|
|
3494
|
+
false
|
|
3495
|
+
)
|
|
3496
|
+
),
|
|
3497
|
+
],
|
|
3498
|
+
1
|
|
3499
|
+
)
|
|
3500
|
+
};
|
|
3501
|
+
var __vue_staticRenderFns__$7 = [];
|
|
3502
|
+
__vue_render__$7._withStripped = true;
|
|
3503
|
+
|
|
3504
|
+
/* style */
|
|
3505
|
+
const __vue_inject_styles__$7 = undefined;
|
|
3506
|
+
/* scoped */
|
|
3507
|
+
const __vue_scope_id__$7 = undefined;
|
|
3508
|
+
/* module identifier */
|
|
3509
|
+
const __vue_module_identifier__$7 = undefined;
|
|
3510
|
+
/* functional template */
|
|
3511
|
+
const __vue_is_functional_template__$7 = false;
|
|
3512
|
+
/* style inject */
|
|
3513
|
+
|
|
3514
|
+
/* style inject SSR */
|
|
3515
|
+
|
|
3516
|
+
/* style inject shadow dom */
|
|
3517
|
+
|
|
3518
|
+
|
|
3519
|
+
|
|
3520
|
+
const __vue_component__$7 = /*#__PURE__*/normalizeComponent(
|
|
3521
|
+
{ render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
|
|
3522
|
+
__vue_inject_styles__$7,
|
|
3523
|
+
__vue_script__$7,
|
|
3524
|
+
__vue_scope_id__$7,
|
|
3525
|
+
__vue_is_functional_template__$7,
|
|
3526
|
+
__vue_module_identifier__$7,
|
|
3527
|
+
false,
|
|
3528
|
+
undefined,
|
|
3529
|
+
undefined,
|
|
3530
|
+
undefined
|
|
3531
|
+
);
|
|
3532
|
+
|
|
3533
|
+
//
|
|
3534
|
+
//
|
|
3535
|
+
//
|
|
3536
|
+
//
|
|
3537
|
+
|
|
3538
|
+
var script$6 = {
|
|
3539
|
+
name: 'ele-checkbox',
|
|
3540
|
+
props: {
|
|
3541
|
+
value: {
|
|
3542
|
+
type: Array
|
|
3543
|
+
},
|
|
3544
|
+
dataSource: {
|
|
3545
|
+
type: Array,
|
|
3546
|
+
default: () => []
|
|
3547
|
+
},
|
|
3548
|
+
disabled: {
|
|
3549
|
+
type: Boolean,
|
|
3550
|
+
default: false
|
|
3551
|
+
}
|
|
3552
|
+
},
|
|
3553
|
+
methods: {
|
|
3554
|
+
onChange(value) {
|
|
3555
|
+
this.$emit('change', value);
|
|
3556
|
+
this.$emit('input', value);
|
|
3557
|
+
}
|
|
3558
|
+
}
|
|
3559
|
+
};
|
|
3560
|
+
|
|
3561
|
+
/* script */
|
|
3562
|
+
const __vue_script__$6 = script$6;
|
|
3563
|
+
|
|
3564
|
+
/* template */
|
|
3565
|
+
var __vue_render__$6 = function () {
|
|
3566
|
+
var _vm = this;
|
|
3567
|
+
var _h = _vm.$createElement;
|
|
3568
|
+
var _c = _vm._self._c || _h;
|
|
3569
|
+
return _c("a-checkbox-group", {
|
|
3570
|
+
attrs: {
|
|
3571
|
+
options: _vm.dataSource,
|
|
3572
|
+
disabled: _vm.disabled,
|
|
3573
|
+
defaultValue: _vm.value,
|
|
3574
|
+
},
|
|
3575
|
+
on: { change: _vm.onChange },
|
|
3576
|
+
})
|
|
3577
|
+
};
|
|
3578
|
+
var __vue_staticRenderFns__$6 = [];
|
|
3579
|
+
__vue_render__$6._withStripped = true;
|
|
3580
|
+
|
|
3581
|
+
/* style */
|
|
3582
|
+
const __vue_inject_styles__$6 = function (inject) {
|
|
3583
|
+
if (!inject) return
|
|
3584
|
+
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 });
|
|
3585
|
+
|
|
3586
|
+
};
|
|
3587
|
+
/* scoped */
|
|
3588
|
+
const __vue_scope_id__$6 = "data-v-63b1b120";
|
|
3589
|
+
/* module identifier */
|
|
3590
|
+
const __vue_module_identifier__$6 = undefined;
|
|
3591
|
+
/* functional template */
|
|
3592
|
+
const __vue_is_functional_template__$6 = false;
|
|
3593
|
+
/* style inject SSR */
|
|
3594
|
+
|
|
3595
|
+
/* style inject shadow dom */
|
|
3596
|
+
|
|
3597
|
+
|
|
3598
|
+
|
|
3599
|
+
const __vue_component__$6 = /*#__PURE__*/normalizeComponent(
|
|
3600
|
+
{ render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
|
|
3601
|
+
__vue_inject_styles__$6,
|
|
3602
|
+
__vue_script__$6,
|
|
3603
|
+
__vue_scope_id__$6,
|
|
3604
|
+
__vue_is_functional_template__$6,
|
|
3605
|
+
__vue_module_identifier__$6,
|
|
3606
|
+
false,
|
|
3607
|
+
createInjector,
|
|
3608
|
+
undefined,
|
|
3609
|
+
undefined
|
|
3610
|
+
);
|
|
3611
|
+
|
|
3612
|
+
//
|
|
3613
|
+
//
|
|
3614
|
+
//
|
|
3615
|
+
//
|
|
3616
|
+
//
|
|
3617
|
+
//
|
|
3618
|
+
//
|
|
3619
|
+
//
|
|
3620
|
+
|
|
3621
|
+
var script$5 = {
|
|
3622
|
+
name: 'ele-radio',
|
|
3623
|
+
props: {
|
|
3624
|
+
value: {
|
|
3625
|
+
type: [String, Array, Number]
|
|
3626
|
+
},
|
|
3627
|
+
dataSource: {
|
|
3628
|
+
type: Array,
|
|
3629
|
+
default: () => []
|
|
3630
|
+
},
|
|
3631
|
+
disabled: {
|
|
3632
|
+
type: Boolean,
|
|
3633
|
+
default: false
|
|
3634
|
+
}
|
|
3635
|
+
},
|
|
3636
|
+
methods: {
|
|
3637
|
+
onChange(e) {
|
|
3638
|
+
this.$emit('change', e.target.value);
|
|
3639
|
+
this.$emit('input', e.target.value);
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
};
|
|
3643
|
+
|
|
3644
|
+
/* script */
|
|
3645
|
+
const __vue_script__$5 = script$5;
|
|
3646
|
+
|
|
3647
|
+
/* template */
|
|
3648
|
+
var __vue_render__$5 = function () {
|
|
3649
|
+
var _vm = this;
|
|
3650
|
+
var _h = _vm.$createElement;
|
|
3651
|
+
var _c = _vm._self._c || _h;
|
|
3652
|
+
return _c(
|
|
3653
|
+
"a-radio-group",
|
|
3654
|
+
{
|
|
3655
|
+
attrs: { defaultValue: _vm.value, disabled: _vm.disabled },
|
|
3656
|
+
on: { change: _vm.onChange },
|
|
3657
|
+
},
|
|
3658
|
+
_vm._l(_vm.dataSource, function (item) {
|
|
3659
|
+
return _c("a-radio", { key: item.value, attrs: { value: item.value } }, [
|
|
3660
|
+
_vm._v("\n " + _vm._s(item.label) + "\n "),
|
|
3661
|
+
])
|
|
3662
|
+
}),
|
|
3663
|
+
1
|
|
3664
|
+
)
|
|
3665
|
+
};
|
|
3666
|
+
var __vue_staticRenderFns__$5 = [];
|
|
3667
|
+
__vue_render__$5._withStripped = true;
|
|
3668
|
+
|
|
3669
|
+
/* style */
|
|
3670
|
+
const __vue_inject_styles__$5 = function (inject) {
|
|
3671
|
+
if (!inject) return
|
|
3672
|
+
inject("data-v-66c5cdf2_0", { source: ".ant-radio-group[data-v-66c5cdf2] {\n text-align: left;\n line-height: 32px;\n}\n.has-error .ant-radio-group[data-v-66c5cdf2] .ant-radio-wrapper {\n color: var(--idooel-form-border-err-color);\n}\n.has-error .ant-radio-group[data-v-66c5cdf2] .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":"AAiCA;EACA,gBAAA;EACA,iBAAA;AChCA;ADoCA;EACA,0CAAA;ACjCA;ADmCA;EACA,iDAAA;ACjCA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <a-radio-group :defaultValue=\"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 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 });
|
|
3673
|
+
|
|
3674
|
+
};
|
|
3675
|
+
/* scoped */
|
|
3676
|
+
const __vue_scope_id__$5 = "data-v-66c5cdf2";
|
|
3677
|
+
/* module identifier */
|
|
3678
|
+
const __vue_module_identifier__$5 = undefined;
|
|
3679
|
+
/* functional template */
|
|
3680
|
+
const __vue_is_functional_template__$5 = false;
|
|
3681
|
+
/* style inject SSR */
|
|
3682
|
+
|
|
3683
|
+
/* style inject shadow dom */
|
|
3684
|
+
|
|
3685
|
+
|
|
3686
|
+
|
|
3687
|
+
const __vue_component__$5 = /*#__PURE__*/normalizeComponent(
|
|
3688
|
+
{ render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
|
|
3689
|
+
__vue_inject_styles__$5,
|
|
3690
|
+
__vue_script__$5,
|
|
3691
|
+
__vue_scope_id__$5,
|
|
3692
|
+
__vue_is_functional_template__$5,
|
|
3693
|
+
__vue_module_identifier__$5,
|
|
3694
|
+
false,
|
|
3695
|
+
createInjector,
|
|
3696
|
+
undefined,
|
|
3697
|
+
undefined
|
|
3698
|
+
);
|
|
3699
|
+
|
|
3700
|
+
//
|
|
3701
|
+
var script$4 = {
|
|
3702
|
+
name: 'ele-form',
|
|
3703
|
+
components: {
|
|
3704
|
+
EleSelect: __vue_component__$k,
|
|
3705
|
+
EleInput: __vue_component__$l,
|
|
3706
|
+
EleTextarea: __vue_component__$b,
|
|
3707
|
+
EleUpload: __vue_component__$9,
|
|
3708
|
+
EleSelectEntity: __vue_component__$8,
|
|
3709
|
+
EleInputNumber: __vue_component__$7,
|
|
3710
|
+
EleCheckbox: __vue_component__$6,
|
|
3711
|
+
EleRadio: __vue_component__$5
|
|
3712
|
+
},
|
|
3713
|
+
props: {
|
|
3714
|
+
elements: {
|
|
3715
|
+
type: Array,
|
|
3716
|
+
default: () => []
|
|
3717
|
+
}
|
|
3718
|
+
},
|
|
3719
|
+
data() {
|
|
3720
|
+
return {
|
|
3721
|
+
some: '1',
|
|
3722
|
+
form: this.$form.createForm(this, {
|
|
3723
|
+
name: 'coordinated'
|
|
3724
|
+
})
|
|
3725
|
+
};
|
|
3726
|
+
},
|
|
3727
|
+
methods: {
|
|
3728
|
+
onChangeTextarea(value, props) {
|
|
3729
|
+
this.setFieldsValue({
|
|
3730
|
+
[props.name]: value
|
|
3731
|
+
});
|
|
3732
|
+
},
|
|
3733
|
+
validateFields() {
|
|
3734
|
+
let ret = false;
|
|
3735
|
+
this.form.validateFields((error, values) => {
|
|
3736
|
+
ret = !error;
|
|
3737
|
+
});
|
|
3738
|
+
return ret;
|
|
3739
|
+
},
|
|
3740
|
+
setFieldsValue(props = {}) {
|
|
3741
|
+
this.form.setFieldsValue(props);
|
|
3742
|
+
},
|
|
3743
|
+
getFieldsValue() {
|
|
3744
|
+
return this.form.getFieldsValue();
|
|
3745
|
+
}
|
|
3746
|
+
}
|
|
3747
|
+
};
|
|
3748
|
+
|
|
3749
|
+
/* script */
|
|
3750
|
+
const __vue_script__$4 = script$4;
|
|
3751
|
+
|
|
3752
|
+
/* template */
|
|
3753
|
+
var __vue_render__$4 = function () {
|
|
3754
|
+
var _vm = this;
|
|
3755
|
+
var _h = _vm.$createElement;
|
|
3756
|
+
var _c = _vm._self._c || _h;
|
|
3757
|
+
return _c(
|
|
3758
|
+
"div",
|
|
3759
|
+
{ staticClass: "ele__form--wrapper" },
|
|
3760
|
+
[
|
|
3761
|
+
_c(
|
|
3762
|
+
"a-form",
|
|
3763
|
+
{
|
|
3764
|
+
staticClass: "ant-advanced-search-form",
|
|
3765
|
+
attrs: { form: _vm.form, layout: "vertical" },
|
|
3766
|
+
},
|
|
3767
|
+
[
|
|
3768
|
+
_c(
|
|
3769
|
+
"a-row",
|
|
3770
|
+
{ attrs: { gutter: 24 } },
|
|
3771
|
+
_vm._l(_vm.elements, function (ele) {
|
|
3772
|
+
return _c(
|
|
3773
|
+
"a-col",
|
|
3774
|
+
{ key: ele.name, attrs: { span: ele.span } },
|
|
3775
|
+
[
|
|
3776
|
+
ele.type == "Input"
|
|
3777
|
+
? [
|
|
3778
|
+
_c(
|
|
3779
|
+
"a-form-item",
|
|
3780
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3781
|
+
[
|
|
3782
|
+
_c("ele-input", {
|
|
3783
|
+
directives: [
|
|
3784
|
+
{
|
|
3785
|
+
name: "decorator",
|
|
3786
|
+
rawName: "v-decorator",
|
|
3787
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3788
|
+
expression:
|
|
3789
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3790
|
+
},
|
|
3791
|
+
],
|
|
3792
|
+
staticStyle: { width: "100%" },
|
|
3793
|
+
attrs: { "max-length": ele.maxLength },
|
|
3794
|
+
}),
|
|
3795
|
+
],
|
|
3796
|
+
1
|
|
3797
|
+
),
|
|
3798
|
+
]
|
|
3799
|
+
: ele.type == "Textarea"
|
|
3800
|
+
? [
|
|
3801
|
+
_c(
|
|
3802
|
+
"a-form-item",
|
|
3803
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3804
|
+
[
|
|
3805
|
+
_c("ele-textarea", {
|
|
3806
|
+
directives: [
|
|
3807
|
+
{
|
|
3808
|
+
name: "decorator",
|
|
3809
|
+
rawName: "v-decorator",
|
|
3810
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3811
|
+
expression:
|
|
3812
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3813
|
+
},
|
|
3814
|
+
],
|
|
3815
|
+
staticStyle: { width: "100%" },
|
|
3816
|
+
attrs: {
|
|
3817
|
+
"max-length": ele.maxLength,
|
|
3818
|
+
autosize: ele.autosize,
|
|
3819
|
+
"allow-clear": ele.allowClear,
|
|
3820
|
+
placeholder: ele.placeholder,
|
|
3821
|
+
},
|
|
3822
|
+
on: {
|
|
3823
|
+
"on-change": function ($event) {
|
|
3824
|
+
return _vm.onChangeTextarea($event, ele)
|
|
3825
|
+
},
|
|
3826
|
+
},
|
|
3827
|
+
}),
|
|
3828
|
+
],
|
|
3829
|
+
1
|
|
3830
|
+
),
|
|
3831
|
+
]
|
|
3832
|
+
: ele.type == "Select"
|
|
3833
|
+
? [
|
|
3834
|
+
_c(
|
|
3835
|
+
"a-form-item",
|
|
3836
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3837
|
+
[
|
|
3838
|
+
_c("ele-select", {
|
|
3839
|
+
directives: [
|
|
3840
|
+
{
|
|
3841
|
+
name: "decorator",
|
|
3842
|
+
rawName: "v-decorator",
|
|
3843
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3844
|
+
expression:
|
|
3845
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3846
|
+
},
|
|
3847
|
+
],
|
|
3848
|
+
staticStyle: { width: "100%" },
|
|
3849
|
+
attrs: { "data-source": ele.optionList },
|
|
3850
|
+
}),
|
|
3851
|
+
],
|
|
3852
|
+
1
|
|
3853
|
+
),
|
|
3854
|
+
]
|
|
3855
|
+
: ele.type == "ele-upload"
|
|
3856
|
+
? [
|
|
3857
|
+
_c(
|
|
3858
|
+
"a-form-item",
|
|
3859
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3860
|
+
[
|
|
3861
|
+
_c("ele-upload", {
|
|
3862
|
+
directives: [
|
|
3863
|
+
{
|
|
3864
|
+
name: "decorator",
|
|
3865
|
+
rawName: "v-decorator",
|
|
3866
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3867
|
+
expression:
|
|
3868
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3869
|
+
},
|
|
3870
|
+
],
|
|
3871
|
+
staticStyle: { width: "100%" },
|
|
3872
|
+
}),
|
|
3873
|
+
],
|
|
3874
|
+
1
|
|
3875
|
+
),
|
|
3876
|
+
]
|
|
3877
|
+
: ele.type == "SelectEntity"
|
|
3878
|
+
? [
|
|
3879
|
+
_c(
|
|
3880
|
+
"a-form-item",
|
|
3881
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3882
|
+
[
|
|
3883
|
+
_c("ele-select-entity", {
|
|
3884
|
+
directives: [
|
|
3885
|
+
{
|
|
3886
|
+
name: "decorator",
|
|
3887
|
+
rawName: "v-decorator",
|
|
3888
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3889
|
+
expression:
|
|
3890
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3891
|
+
},
|
|
3892
|
+
],
|
|
3893
|
+
staticStyle: { width: "100%" },
|
|
3894
|
+
}),
|
|
3895
|
+
],
|
|
3896
|
+
1
|
|
3897
|
+
),
|
|
3898
|
+
]
|
|
3899
|
+
: ele.type == "InputNumber"
|
|
3900
|
+
? [
|
|
3901
|
+
_c(
|
|
3902
|
+
"a-form-item",
|
|
3903
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3904
|
+
[
|
|
3905
|
+
_c(
|
|
3906
|
+
"ele-input-number",
|
|
3907
|
+
_vm._b(
|
|
3908
|
+
{
|
|
3909
|
+
directives: [
|
|
3910
|
+
{
|
|
3911
|
+
name: "decorator",
|
|
3912
|
+
rawName: "v-decorator",
|
|
3913
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3914
|
+
expression:
|
|
3915
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3916
|
+
},
|
|
3917
|
+
],
|
|
3918
|
+
staticStyle: { width: "100%" },
|
|
3919
|
+
attrs: { precision: ele.precision },
|
|
3920
|
+
},
|
|
3921
|
+
"ele-input-number",
|
|
3922
|
+
ele.props,
|
|
3923
|
+
false
|
|
3924
|
+
)
|
|
3925
|
+
),
|
|
3926
|
+
],
|
|
3927
|
+
1
|
|
3928
|
+
),
|
|
3929
|
+
]
|
|
3930
|
+
: ele.type == "Checkbox"
|
|
3931
|
+
? [
|
|
3932
|
+
_c(
|
|
3933
|
+
"a-form-item",
|
|
3934
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3935
|
+
[
|
|
3936
|
+
_c("ele-checkbox", {
|
|
3937
|
+
directives: [
|
|
3938
|
+
{
|
|
3939
|
+
name: "decorator",
|
|
3940
|
+
rawName: "v-decorator",
|
|
3941
|
+
value: [ele.name, { rules: ele.rules }],
|
|
3942
|
+
expression:
|
|
3943
|
+
"[ele.name, { rules: ele.rules }]",
|
|
3944
|
+
},
|
|
3945
|
+
],
|
|
3946
|
+
staticStyle: { width: "100%" },
|
|
3947
|
+
attrs: { "data-source": ele.optionList },
|
|
3948
|
+
}),
|
|
3949
|
+
],
|
|
3950
|
+
1
|
|
3951
|
+
),
|
|
3952
|
+
]
|
|
3953
|
+
: ele.type == "Radio"
|
|
3954
|
+
? [
|
|
3955
|
+
_c(
|
|
3956
|
+
"a-form-item",
|
|
3957
|
+
{ attrs: { label: ele.label + ":" } },
|
|
3958
|
+
[
|
|
3959
|
+
_c("ele-radio", {
|
|
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: { "data-source": ele.optionList },
|
|
3971
|
+
}),
|
|
3972
|
+
],
|
|
3973
|
+
1
|
|
3974
|
+
),
|
|
3975
|
+
]
|
|
3976
|
+
: _vm._e(),
|
|
3977
|
+
],
|
|
3978
|
+
2
|
|
3979
|
+
)
|
|
3980
|
+
}),
|
|
3981
|
+
1
|
|
3982
|
+
),
|
|
3983
|
+
],
|
|
3984
|
+
1
|
|
3985
|
+
),
|
|
3986
|
+
],
|
|
3987
|
+
1
|
|
3988
|
+
)
|
|
3989
|
+
};
|
|
3990
|
+
var __vue_staticRenderFns__$4 = [];
|
|
3991
|
+
__vue_render__$4._withStripped = true;
|
|
3992
|
+
|
|
3993
|
+
/* style */
|
|
3994
|
+
const __vue_inject_styles__$4 = function (inject) {
|
|
3995
|
+
if (!inject) return
|
|
3996
|
+
inject("data-v-e06c4e7c_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue","sourcesContent":["\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
3997
|
+
|
|
3998
|
+
};
|
|
3999
|
+
/* scoped */
|
|
4000
|
+
const __vue_scope_id__$4 = "data-v-e06c4e7c";
|
|
4001
|
+
/* module identifier */
|
|
4002
|
+
const __vue_module_identifier__$4 = undefined;
|
|
4003
|
+
/* functional template */
|
|
4004
|
+
const __vue_is_functional_template__$4 = false;
|
|
4005
|
+
/* style inject SSR */
|
|
4006
|
+
|
|
4007
|
+
/* style inject shadow dom */
|
|
4008
|
+
|
|
4009
|
+
|
|
4010
|
+
|
|
4011
|
+
const __vue_component__$4 = /*#__PURE__*/normalizeComponent(
|
|
4012
|
+
{ render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
|
|
4013
|
+
__vue_inject_styles__$4,
|
|
4014
|
+
__vue_script__$4,
|
|
4015
|
+
__vue_scope_id__$4,
|
|
4016
|
+
__vue_is_functional_template__$4,
|
|
4017
|
+
__vue_module_identifier__$4,
|
|
4018
|
+
false,
|
|
4019
|
+
createInjector,
|
|
4020
|
+
undefined,
|
|
4021
|
+
undefined
|
|
4022
|
+
);
|
|
4023
|
+
|
|
4024
|
+
__vue_component__$4.install = Vue => Vue.component(__vue_component__$4.name, __vue_component__$4);
|
|
4025
|
+
|
|
4026
|
+
//
|
|
4027
|
+
//
|
|
4028
|
+
//
|
|
4029
|
+
//
|
|
4030
|
+
//
|
|
4031
|
+
//
|
|
4032
|
+
|
|
4033
|
+
var script$3 = {
|
|
4034
|
+
name: 'g-text'
|
|
4035
|
+
};
|
|
4036
|
+
|
|
4037
|
+
/* script */
|
|
4038
|
+
const __vue_script__$3 = script$3;
|
|
4039
|
+
|
|
4040
|
+
/* template */
|
|
4041
|
+
var __vue_render__$3 = function () {
|
|
4042
|
+
var _vm = this;
|
|
4043
|
+
var _h = _vm.$createElement;
|
|
4044
|
+
var _c = _vm._self._c || _h;
|
|
4045
|
+
return _c("div", [_vm._v("\n text\n")])
|
|
4046
|
+
};
|
|
4047
|
+
var __vue_staticRenderFns__$3 = [];
|
|
4048
|
+
__vue_render__$3._withStripped = true;
|
|
4049
|
+
|
|
4050
|
+
/* style */
|
|
4051
|
+
const __vue_inject_styles__$3 = function (inject) {
|
|
4052
|
+
if (!inject) return
|
|
4053
|
+
inject("data-v-d41a0ce6_0", { source: "\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 });
|
|
4054
|
+
|
|
4055
|
+
};
|
|
4056
|
+
/* scoped */
|
|
4057
|
+
const __vue_scope_id__$3 = "data-v-d41a0ce6";
|
|
4058
|
+
/* module identifier */
|
|
4059
|
+
const __vue_module_identifier__$3 = undefined;
|
|
4060
|
+
/* functional template */
|
|
4061
|
+
const __vue_is_functional_template__$3 = false;
|
|
4062
|
+
/* style inject SSR */
|
|
4063
|
+
|
|
4064
|
+
/* style inject shadow dom */
|
|
4065
|
+
|
|
4066
|
+
|
|
4067
|
+
|
|
4068
|
+
const __vue_component__$3 = /*#__PURE__*/normalizeComponent(
|
|
4069
|
+
{ render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
|
|
4070
|
+
__vue_inject_styles__$3,
|
|
4071
|
+
__vue_script__$3,
|
|
4072
|
+
__vue_scope_id__$3,
|
|
4073
|
+
__vue_is_functional_template__$3,
|
|
4074
|
+
__vue_module_identifier__$3,
|
|
4075
|
+
false,
|
|
4076
|
+
createInjector,
|
|
4077
|
+
undefined,
|
|
4078
|
+
undefined
|
|
4079
|
+
);
|
|
4080
|
+
|
|
4081
|
+
__vue_component__$3.install = Vue => Vue.component(__vue_component__$3.name, __vue_component__$3);
|
|
4082
|
+
|
|
4083
|
+
__vue_component__$9.install = Vue => Vue.component(__vue_component__$9.name, __vue_component__$9);
|
|
4084
|
+
|
|
4085
|
+
__vue_component__$8.install = Vue => Vue.component(__vue_component__$8.name, __vue_component__$8);
|
|
4086
|
+
|
|
4087
|
+
__vue_component__$a.install = Vue => Vue.component(__vue_component__$a.name, __vue_component__$a);
|
|
4088
|
+
|
|
4089
|
+
__vue_component__$7.install = Vue => Vue.component(__vue_component__$7.name, __vue_component__$7);
|
|
4090
|
+
|
|
4091
|
+
//
|
|
4092
|
+
//
|
|
4093
|
+
//
|
|
4094
|
+
//
|
|
4095
|
+
//
|
|
4096
|
+
//
|
|
4097
|
+
//
|
|
4098
|
+
//
|
|
4099
|
+
//
|
|
4100
|
+
//
|
|
4101
|
+
//
|
|
4102
|
+
//
|
|
4103
|
+
//
|
|
4104
|
+
//
|
|
4105
|
+
//
|
|
4106
|
+
//
|
|
4107
|
+
//
|
|
4108
|
+
//
|
|
4109
|
+
//
|
|
4110
|
+
//
|
|
4111
|
+
//
|
|
4112
|
+
//
|
|
4113
|
+
|
|
4114
|
+
var script$2 = {
|
|
4115
|
+
name: 'ele-modal',
|
|
4116
|
+
props: {
|
|
4117
|
+
value: {
|
|
4118
|
+
type: Boolean,
|
|
4119
|
+
default: false
|
|
4120
|
+
},
|
|
4121
|
+
title: {
|
|
4122
|
+
type: String,
|
|
4123
|
+
default: '标题'
|
|
4124
|
+
},
|
|
4125
|
+
cancelText: {
|
|
4126
|
+
type: String,
|
|
4127
|
+
default: '关闭'
|
|
4128
|
+
},
|
|
4129
|
+
okText: {
|
|
4130
|
+
type: String,
|
|
4131
|
+
default: '确定'
|
|
4132
|
+
},
|
|
4133
|
+
size: {
|
|
4134
|
+
type: String,
|
|
4135
|
+
default: 'small'
|
|
4136
|
+
},
|
|
4137
|
+
map: {
|
|
4138
|
+
type: Object,
|
|
4139
|
+
default() {
|
|
4140
|
+
return {};
|
|
4141
|
+
}
|
|
4142
|
+
},
|
|
4143
|
+
closable: {
|
|
4144
|
+
type: Boolean,
|
|
4145
|
+
default: true
|
|
4146
|
+
},
|
|
4147
|
+
maskClosable: {
|
|
4148
|
+
type: Boolean,
|
|
4149
|
+
default: false
|
|
4150
|
+
},
|
|
4151
|
+
showFooter: {
|
|
4152
|
+
type: Boolean,
|
|
4153
|
+
default: true
|
|
4154
|
+
},
|
|
4155
|
+
footer: {
|
|
4156
|
+
type: Function,
|
|
4157
|
+
default: null
|
|
4158
|
+
},
|
|
4159
|
+
onlyClose: {
|
|
4160
|
+
type: Boolean,
|
|
4161
|
+
default: false
|
|
4162
|
+
}
|
|
4163
|
+
},
|
|
4164
|
+
watch: {
|
|
4165
|
+
value(newVal) {
|
|
4166
|
+
this.$nextTick(() => {
|
|
4167
|
+
this.showModal = newVal;
|
|
4168
|
+
});
|
|
4169
|
+
}
|
|
4170
|
+
},
|
|
4171
|
+
computed: {
|
|
4172
|
+
width() {
|
|
4173
|
+
return this.map[this.size];
|
|
4174
|
+
},
|
|
4175
|
+
maxheight() {
|
|
4176
|
+
return `calc(100vh - ${this.upDownDistance[this.size] * 2 + (this.title ? 55 : 0) + (this.showFooter ? 53 : 0)}px`;
|
|
4177
|
+
}
|
|
4178
|
+
},
|
|
4179
|
+
data() {
|
|
4180
|
+
return {
|
|
4181
|
+
showModal: false
|
|
4182
|
+
};
|
|
4183
|
+
},
|
|
4184
|
+
created() {
|
|
4185
|
+
let defaultMap = {
|
|
4186
|
+
small: 480,
|
|
4187
|
+
middle: 768,
|
|
4188
|
+
big: 1200
|
|
4189
|
+
};
|
|
4190
|
+
this.upDownDistance = {
|
|
4191
|
+
small: 80,
|
|
4192
|
+
middle: 80,
|
|
4193
|
+
big: 40
|
|
4194
|
+
};
|
|
4195
|
+
this.map = Object.assign(this.map, defaultMap);
|
|
4196
|
+
},
|
|
4197
|
+
methods: {
|
|
4198
|
+
openModal() {
|
|
4199
|
+
this.showModal = true;
|
|
4200
|
+
this.removeHidden();
|
|
4201
|
+
},
|
|
4202
|
+
handleCancel() {
|
|
4203
|
+
this.showModal = false;
|
|
4204
|
+
this.removeHidden();
|
|
4205
|
+
console.log('on-cancel');
|
|
4206
|
+
this.$emit('cancel');
|
|
4207
|
+
this.$emit('input', this.showModal);
|
|
4208
|
+
},
|
|
4209
|
+
handleOk() {
|
|
4210
|
+
console.log('on-ok');
|
|
4211
|
+
this.$emit('ok');
|
|
4212
|
+
},
|
|
4213
|
+
removeHidden() {
|
|
4214
|
+
let ishidden = document.body.style.overflow === 'hidden';
|
|
4215
|
+
ishidden && (document.body.style.overflow = 'initial');
|
|
4216
|
+
}
|
|
4217
|
+
}
|
|
4218
|
+
};
|
|
4219
|
+
|
|
4220
|
+
/* script */
|
|
4221
|
+
const __vue_script__$2 = script$2;
|
|
4222
|
+
|
|
4223
|
+
/* template */
|
|
4224
|
+
var __vue_render__$2 = function () {
|
|
4225
|
+
var _vm = this;
|
|
4226
|
+
var _h = _vm.$createElement;
|
|
4227
|
+
var _c = _vm._self._c || _h;
|
|
4228
|
+
return _c(
|
|
4229
|
+
"a-modal",
|
|
4230
|
+
{
|
|
4231
|
+
attrs: {
|
|
4232
|
+
title: _vm.title,
|
|
4233
|
+
cancelText: _vm.cancelText,
|
|
4234
|
+
okText: _vm.okText,
|
|
4235
|
+
closable: _vm.closable,
|
|
4236
|
+
width: _vm.width,
|
|
4237
|
+
keyboard: false,
|
|
4238
|
+
maskClosable: _vm.maskClosable,
|
|
4239
|
+
dialogStyle: { top: _vm.upDownDistance[_vm.size] + "px" },
|
|
4240
|
+
bodyStyle: { maxHeight: _vm.maxheight, overflowY: "auto" },
|
|
4241
|
+
footer: _vm.showFooter ? undefined : null,
|
|
4242
|
+
},
|
|
4243
|
+
on: { cancel: _vm.handleCancel, ok: _vm.handleOk },
|
|
4244
|
+
model: {
|
|
4245
|
+
value: _vm.showModal,
|
|
4246
|
+
callback: function ($$v) {
|
|
4247
|
+
_vm.showModal = $$v;
|
|
4248
|
+
},
|
|
4249
|
+
expression: "showModal",
|
|
4250
|
+
},
|
|
4251
|
+
},
|
|
4252
|
+
[
|
|
4253
|
+
_vm._t("default"),
|
|
4254
|
+
_vm._v(" "),
|
|
4255
|
+
_c("template", { slot: "footer" }, [_vm._t("footer")], 2),
|
|
4256
|
+
],
|
|
4257
|
+
2
|
|
4258
|
+
)
|
|
4259
|
+
};
|
|
4260
|
+
var __vue_staticRenderFns__$2 = [];
|
|
4261
|
+
__vue_render__$2._withStripped = true;
|
|
4262
|
+
|
|
4263
|
+
/* style */
|
|
4264
|
+
const __vue_inject_styles__$2 = undefined;
|
|
4265
|
+
/* scoped */
|
|
4266
|
+
const __vue_scope_id__$2 = undefined;
|
|
4267
|
+
/* module identifier */
|
|
4268
|
+
const __vue_module_identifier__$2 = undefined;
|
|
4269
|
+
/* functional template */
|
|
4270
|
+
const __vue_is_functional_template__$2 = false;
|
|
4271
|
+
/* style inject */
|
|
4272
|
+
|
|
4273
|
+
/* style inject SSR */
|
|
4274
|
+
|
|
4275
|
+
/* style inject shadow dom */
|
|
4276
|
+
|
|
4277
|
+
|
|
4278
|
+
|
|
4279
|
+
const __vue_component__$2 = /*#__PURE__*/normalizeComponent(
|
|
4280
|
+
{ render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
|
|
4281
|
+
__vue_inject_styles__$2,
|
|
4282
|
+
__vue_script__$2,
|
|
4283
|
+
__vue_scope_id__$2,
|
|
4284
|
+
__vue_is_functional_template__$2,
|
|
4285
|
+
__vue_module_identifier__$2,
|
|
4286
|
+
false,
|
|
4287
|
+
undefined,
|
|
4288
|
+
undefined,
|
|
4289
|
+
undefined
|
|
4290
|
+
);
|
|
4291
|
+
|
|
4292
|
+
__vue_component__$2.install = Vue => Vue.component(__vue_component__$2.name, __vue_component__$2);
|
|
4293
|
+
|
|
4294
|
+
__vue_component__$6.install = Vue => Vue.component(__vue_component__$6.name, __vue_component__$6);
|
|
4295
|
+
|
|
4296
|
+
__vue_component__$5.install = Vue => Vue.component(__vue_component__$5.name, __vue_component__$5);
|
|
4297
|
+
|
|
4298
|
+
//
|
|
4299
|
+
//
|
|
4300
|
+
//
|
|
4301
|
+
//
|
|
4302
|
+
//
|
|
4303
|
+
//
|
|
4304
|
+
|
|
4305
|
+
var script$1 = {
|
|
4306
|
+
name: 'ele-batch-export'
|
|
4307
|
+
};
|
|
4308
|
+
|
|
4309
|
+
/* script */
|
|
4310
|
+
const __vue_script__$1 = script$1;
|
|
4311
|
+
|
|
4312
|
+
/* template */
|
|
4313
|
+
var __vue_render__$1 = function () {
|
|
4314
|
+
var _vm = this;
|
|
4315
|
+
var _h = _vm.$createElement;
|
|
4316
|
+
var _c = _vm._self._c || _h;
|
|
4317
|
+
return _c("div", [_vm._v("\n export\n")])
|
|
4318
|
+
};
|
|
4319
|
+
var __vue_staticRenderFns__$1 = [];
|
|
4320
|
+
__vue_render__$1._withStripped = true;
|
|
4321
|
+
|
|
4322
|
+
/* style */
|
|
4323
|
+
const __vue_inject_styles__$1 = function (inject) {
|
|
4324
|
+
if (!inject) return
|
|
4325
|
+
inject("data-v-4ed65b1c_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
|
|
4326
|
+
|
|
4327
|
+
};
|
|
4328
|
+
/* scoped */
|
|
4329
|
+
const __vue_scope_id__$1 = "data-v-4ed65b1c";
|
|
4330
|
+
/* module identifier */
|
|
4331
|
+
const __vue_module_identifier__$1 = undefined;
|
|
4332
|
+
/* functional template */
|
|
4333
|
+
const __vue_is_functional_template__$1 = false;
|
|
4334
|
+
/* style inject SSR */
|
|
4335
|
+
|
|
4336
|
+
/* style inject shadow dom */
|
|
4337
|
+
|
|
4338
|
+
|
|
4339
|
+
|
|
4340
|
+
const __vue_component__$1 = /*#__PURE__*/normalizeComponent(
|
|
4341
|
+
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
|
|
4342
|
+
__vue_inject_styles__$1,
|
|
4343
|
+
__vue_script__$1,
|
|
4344
|
+
__vue_scope_id__$1,
|
|
4345
|
+
__vue_is_functional_template__$1,
|
|
4346
|
+
__vue_module_identifier__$1,
|
|
4347
|
+
false,
|
|
4348
|
+
createInjector,
|
|
4349
|
+
undefined,
|
|
4350
|
+
undefined
|
|
4351
|
+
);
|
|
4352
|
+
|
|
4353
|
+
__vue_component__$1.install = Vue => Vue.component(__vue_component__$1.name, __vue_component__$1);
|
|
4354
|
+
|
|
4355
|
+
__vue_component__$e.install = Vue => Vue.component(__vue_component__$e.name, __vue_component__$e);
|
|
4356
|
+
|
|
4357
|
+
__vue_component__$f.install = Vue => Vue.component(__vue_component__$f.name, __vue_component__$f);
|
|
4358
|
+
|
|
4359
|
+
__vue_component__$d.install = Vue => Vue.component(__vue_component__$d.name, __vue_component__$d);
|
|
4360
|
+
|
|
4361
|
+
const BUILT_IN_EVENT_NAMES = {
|
|
4362
|
+
SUBMIT: 'submit',
|
|
4363
|
+
CANCEL: 'cancel'
|
|
4364
|
+
};
|
|
4365
|
+
|
|
4366
|
+
//
|
|
4367
|
+
var script = {
|
|
4368
|
+
name: 'ele-form-model',
|
|
4369
|
+
components: {
|
|
4370
|
+
EleButtonGroup: __vue_component__$e
|
|
4371
|
+
},
|
|
4372
|
+
props: {
|
|
4373
|
+
title: {
|
|
4374
|
+
type: String
|
|
4375
|
+
},
|
|
4376
|
+
formMeta: {
|
|
4377
|
+
type: Object
|
|
4378
|
+
},
|
|
4379
|
+
footerMeta: {
|
|
4380
|
+
type: Object
|
|
4381
|
+
}
|
|
4382
|
+
},
|
|
4383
|
+
data() {
|
|
4384
|
+
return {};
|
|
4385
|
+
},
|
|
4386
|
+
computed: {
|
|
4387
|
+
formRef() {
|
|
4388
|
+
return v4();
|
|
4389
|
+
},
|
|
4390
|
+
assignAttrForEvents() {
|
|
4391
|
+
const events = this.footerElements.reduce((ret, ele) => {
|
|
4392
|
+
ret[ele.eventName] = e => {
|
|
4393
|
+
this.$emit(ele.eventName || 'click', {
|
|
4394
|
+
...e,
|
|
4395
|
+
formModel: this.formModels
|
|
4396
|
+
});
|
|
4397
|
+
};
|
|
4398
|
+
return ret;
|
|
4399
|
+
}, {});
|
|
4400
|
+
return {
|
|
4401
|
+
...this.$listeners,
|
|
4402
|
+
...events,
|
|
4403
|
+
[BUILT_IN_EVENT_NAMES.SUBMIT]: this[BUILT_IN_EVENT_NAMES.SUBMIT],
|
|
4404
|
+
[BUILT_IN_EVENT_NAMES.CANCEL]: this[BUILT_IN_EVENT_NAMES.CANCEL]
|
|
4405
|
+
};
|
|
4406
|
+
},
|
|
4407
|
+
elements() {
|
|
4408
|
+
const {
|
|
4409
|
+
elements
|
|
4410
|
+
} = this.formMeta;
|
|
4411
|
+
return elements;
|
|
4412
|
+
},
|
|
4413
|
+
preRequest() {
|
|
4414
|
+
const {
|
|
4415
|
+
preRequest
|
|
4416
|
+
} = this.formMeta;
|
|
4417
|
+
return preRequest;
|
|
4418
|
+
},
|
|
4419
|
+
infoRequest() {
|
|
4420
|
+
const {
|
|
4421
|
+
infoRequest
|
|
4422
|
+
} = this.formMeta;
|
|
4423
|
+
return infoRequest;
|
|
4424
|
+
},
|
|
4425
|
+
submitRequest() {
|
|
4426
|
+
const {
|
|
4427
|
+
submitRequest
|
|
4428
|
+
} = this.formMeta;
|
|
4429
|
+
return submitRequest;
|
|
4430
|
+
},
|
|
4431
|
+
footerElements() {
|
|
4432
|
+
const {
|
|
4433
|
+
elements
|
|
4434
|
+
} = this.footerMeta;
|
|
4435
|
+
return elements.call(this);
|
|
4436
|
+
},
|
|
4437
|
+
formModels() {
|
|
4438
|
+
return this.$refs[this.formRef].getFieldsValue();
|
|
4439
|
+
}
|
|
4440
|
+
},
|
|
4441
|
+
methods: {
|
|
4442
|
+
async submitRequestTrigger() {},
|
|
4443
|
+
async infoRequestTrigger() {},
|
|
4444
|
+
async preRequestTrigger() {
|
|
4445
|
+
const {
|
|
4446
|
+
url,
|
|
4447
|
+
requestType = 'GET',
|
|
4448
|
+
fieldMap = {}
|
|
4449
|
+
} = this.preRequest;
|
|
4450
|
+
if (!url) return;
|
|
4451
|
+
await shared.net[requestType.toLowerCase()](url, {});
|
|
4452
|
+
},
|
|
4453
|
+
setValueForField(props) {
|
|
4454
|
+
this.$refs[this.formRef].setFieldsValue(props);
|
|
4455
|
+
},
|
|
4456
|
+
[BUILT_IN_EVENT_NAMES.SUBMIT](props) {
|
|
4457
|
+
const status = this.$refs[this.formRef].validateFields();
|
|
4458
|
+
console.log('status', status);
|
|
4459
|
+
if (status) {
|
|
4460
|
+
console.log('status', this.formModels);
|
|
4461
|
+
} else {
|
|
4462
|
+
console.log('error');
|
|
4463
|
+
}
|
|
4464
|
+
},
|
|
4465
|
+
[BUILT_IN_EVENT_NAMES.CANCEL](props) {
|
|
4466
|
+
console.log('inner CANCEL', props);
|
|
4467
|
+
}
|
|
4468
|
+
},
|
|
4469
|
+
async mounted() {
|
|
4470
|
+
await this.preRequestTrigger();
|
|
4471
|
+
await this.infoRequestTrigger();
|
|
4472
|
+
}
|
|
4473
|
+
};
|
|
4474
|
+
|
|
4475
|
+
/* script */
|
|
4476
|
+
const __vue_script__ = script;
|
|
4477
|
+
|
|
4478
|
+
/* template */
|
|
4479
|
+
var __vue_render__ = function () {
|
|
4480
|
+
var _vm = this;
|
|
4481
|
+
var _h = _vm.$createElement;
|
|
4482
|
+
var _c = _vm._self._c || _h;
|
|
4483
|
+
return _c("div", { staticClass: "form__model--wrapper" }, [
|
|
4484
|
+
_c("div", { staticClass: "form-model__title" }, [
|
|
4485
|
+
_vm._v("\n " + _vm._s(_vm.title) + "\n "),
|
|
4486
|
+
]),
|
|
4487
|
+
_vm._v(" "),
|
|
4488
|
+
_c(
|
|
4489
|
+
"div",
|
|
4490
|
+
{ staticClass: "form-model__content" },
|
|
4491
|
+
[_c("ele-form", { ref: _vm.formRef, attrs: { elements: _vm.elements } })],
|
|
4492
|
+
1
|
|
4493
|
+
),
|
|
4494
|
+
_vm._v(" "),
|
|
4495
|
+
_c(
|
|
4496
|
+
"div",
|
|
4497
|
+
{ staticClass: "form-model__footer" },
|
|
4498
|
+
[
|
|
4499
|
+
_c(
|
|
4500
|
+
"ele-button-group",
|
|
4501
|
+
_vm._g(
|
|
4502
|
+
{ attrs: { "data-source": _vm.footerElements } },
|
|
4503
|
+
_vm.assignAttrForEvents
|
|
4504
|
+
)
|
|
4505
|
+
),
|
|
4506
|
+
],
|
|
4507
|
+
1
|
|
4508
|
+
),
|
|
4509
|
+
])
|
|
4510
|
+
};
|
|
4511
|
+
var __vue_staticRenderFns__ = [];
|
|
4512
|
+
__vue_render__._withStripped = true;
|
|
4513
|
+
|
|
4514
|
+
/* style */
|
|
4515
|
+
const __vue_inject_styles__ = function (inject) {
|
|
4516
|
+
if (!inject) return
|
|
4517
|
+
inject("data-v-4815b8c0_0", { source: ".form__model--wrapper[data-v-4815b8c0] {\n width: 100%;\n height: 100%;\n overflow: auto;\n}\n.form__model--wrapper .form-model__title[data-v-4815b8c0] {\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-4815b8c0] {\n padding: 16px;\n}\n.form__model--wrapper .form-model__footer[data-v-4815b8c0] {\n width: 100%;\n height: 64px;\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-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AAgHA;EACA,WAAA;EACA,YAAA;EACA,cAAA;AC/GA;ADgHA;EACA,YAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8DAAA;AC9GA;ADgHA;EACA,aAAA;AC9GA;ADgHA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,oBAAA;AC9GA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"form__model--wrapper\">\r\n <div class=\"form-model__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\">\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\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 async submitRequestTrigger () {},\r\n async infoRequestTrigger () {},\r\n async preRequestTrigger () {\r\n const { url, requestType = 'GET', fieldMap = {} } = this.preRequest\r\n if (!url) return\r\n await net[requestType.toLowerCase()](url, {})\r\n },\r\n setValueForField (props) {\r\n this.$refs[this.formRef].setFieldsValue(props)\r\n },\r\n [BUILT_IN_EVENT_NAMES.SUBMIT] (props) {\r\n const status = this.$refs[this.formRef].validateFields()\r\n console.log('status', status)\r\n if (status) {\r\n console.log('status', this.formModels)\r\n } else {\r\n console.log('error')\r\n }\r\n },\r\n [BUILT_IN_EVENT_NAMES.CANCEL] (props) {\r\n console.log('inner 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 .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 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}\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 flex-direction: row;\n align-items: center;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
|
4518
|
+
|
|
4519
|
+
};
|
|
4520
|
+
/* scoped */
|
|
4521
|
+
const __vue_scope_id__ = "data-v-4815b8c0";
|
|
4522
|
+
/* module identifier */
|
|
4523
|
+
const __vue_module_identifier__ = undefined;
|
|
4524
|
+
/* functional template */
|
|
4525
|
+
const __vue_is_functional_template__ = false;
|
|
4526
|
+
/* style inject SSR */
|
|
4527
|
+
|
|
4528
|
+
/* style inject shadow dom */
|
|
4529
|
+
|
|
4530
|
+
|
|
4531
|
+
|
|
4532
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent(
|
|
4533
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
4534
|
+
__vue_inject_styles__,
|
|
4535
|
+
__vue_script__,
|
|
4536
|
+
__vue_scope_id__,
|
|
4537
|
+
__vue_is_functional_template__,
|
|
4538
|
+
__vue_module_identifier__,
|
|
4539
|
+
false,
|
|
4540
|
+
createInjector,
|
|
4541
|
+
undefined,
|
|
4542
|
+
undefined
|
|
4543
|
+
);
|
|
4544
|
+
|
|
4545
|
+
__vue_component__.install = Vue => Vue.component(__vue_component__.name, __vue_component__);
|
|
2629
4546
|
|
|
2630
|
-
const compositeComponents = [__vue_component__$
|
|
2631
|
-
const models = [__vue_component__$
|
|
2632
|
-
const components = [__vue_component__$
|
|
4547
|
+
const compositeComponents = [__vue_component__$e, __vue_component__$f];
|
|
4548
|
+
const models = [__vue_component__$d, __vue_component__];
|
|
4549
|
+
const components = [__vue_component__$n, __vue_component__$m, __vue_component__$l, __vue_component__$k, __vue_component__$i, __vue_component__$h, __vue_component__$c, __vue_component__$4, __vue_component__$3, __vue_component__$9, __vue_component__$8, __vue_component__$a, __vue_component__$7, __vue_component__$2, __vue_component__$6, __vue_component__$5, __vue_component__$1, ...compositeComponents, ...models];
|
|
2633
4550
|
const install = Vue => {
|
|
2634
4551
|
if (install.installed) return;
|
|
2635
4552
|
install.installed = true;
|
|
@@ -2638,13 +4555,14 @@
|
|
|
2638
4555
|
});
|
|
2639
4556
|
};
|
|
2640
4557
|
|
|
2641
|
-
exports.EleButton = __vue_component__$
|
|
2642
|
-
exports.EleDate = __vue_component__$
|
|
2643
|
-
exports.EleInput = __vue_component__$
|
|
2644
|
-
exports.
|
|
2645
|
-
exports.
|
|
2646
|
-
exports.
|
|
2647
|
-
exports.
|
|
4558
|
+
exports.EleButton = __vue_component__$n;
|
|
4559
|
+
exports.EleDate = __vue_component__$m;
|
|
4560
|
+
exports.EleInput = __vue_component__$l;
|
|
4561
|
+
exports.EleModal = __vue_component__$2;
|
|
4562
|
+
exports.EleSelect = __vue_component__$k;
|
|
4563
|
+
exports.EleTable = __vue_component__$i;
|
|
4564
|
+
exports.EleTpl = __vue_component__$c;
|
|
4565
|
+
exports.EleTree = __vue_component__$h;
|
|
2648
4566
|
exports["default"] = install;
|
|
2649
4567
|
exports.models = models;
|
|
2650
4568
|
|