@panpanzhao/component-ui 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component-ui.common.js +1631 -465
- package/lib/components/crud.js +331 -185
- package/lib/components/dialog.js +10 -10
- package/lib/components/drawer.js +547 -0
- package/lib/components/form-dialog.js +145 -83
- package/lib/components/form-drawer.js +1260 -0
- package/lib/components/form-group.js +94 -53
- package/lib/components/form-input.js +55 -52
- package/lib/components/form-item.js +37 -9
- package/lib/components/form-view-dialog.js +35 -41
- package/lib/components/form-view-group.js +26 -25
- package/lib/components/form-view.js +14 -11
- package/lib/components/form.js +70 -25
- package/lib/components/formula.js +148 -78
- package/lib/components/table-column.js +47 -29
- package/lib/components/table-editable.js +22 -21
- package/lib/components/table-operate.js +2350 -0
- package/lib/components/table-search.js +33 -21
- package/lib/components/table.js +75 -44
- package/lib/index.js +1 -1
- package/lib/styles/component-ui.css +1 -1
- package/lib/styles/drawer.css +1 -0
- package/lib/styles/form-dialog.css +0 -1
- package/lib/styles/form.css +1 -1
- package/lib/styles/index.css +1 -1
- package/lib/styles/table-search.css +1 -0
- package/package.json +1 -1
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 58);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ([
|
|
@@ -167,312 +167,318 @@ module.exports = require("@panpanzhao/component-ui/lib/components/table-column")
|
|
|
167
167
|
/* 13 */
|
|
168
168
|
/***/ (function(module, exports) {
|
|
169
169
|
|
|
170
|
-
module.exports = require("
|
|
170
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/table-search");
|
|
171
171
|
|
|
172
172
|
/***/ }),
|
|
173
173
|
/* 14 */
|
|
174
174
|
/***/ (function(module, exports) {
|
|
175
175
|
|
|
176
|
-
module.exports = require("element-ui/lib/
|
|
176
|
+
module.exports = require("element-ui/lib/radio");
|
|
177
177
|
|
|
178
178
|
/***/ }),
|
|
179
179
|
/* 15 */
|
|
180
180
|
/***/ (function(module, exports) {
|
|
181
181
|
|
|
182
|
-
module.exports = require("
|
|
182
|
+
module.exports = require("element-ui/lib/table");
|
|
183
183
|
|
|
184
184
|
/***/ }),
|
|
185
185
|
/* 16 */
|
|
186
186
|
/***/ (function(module, exports) {
|
|
187
187
|
|
|
188
|
-
module.exports = require("
|
|
188
|
+
module.exports = require("element-ui/lib/message-box");
|
|
189
189
|
|
|
190
190
|
/***/ }),
|
|
191
191
|
/* 17 */
|
|
192
192
|
/***/ (function(module, exports) {
|
|
193
193
|
|
|
194
|
-
module.exports = require("element-ui/
|
|
194
|
+
module.exports = require("element-ui/src/utils/popup");
|
|
195
195
|
|
|
196
196
|
/***/ }),
|
|
197
197
|
/* 18 */
|
|
198
198
|
/***/ (function(module, exports) {
|
|
199
199
|
|
|
200
|
-
module.exports = require("element-ui/
|
|
200
|
+
module.exports = require("element-ui/src/mixins/emitter");
|
|
201
201
|
|
|
202
202
|
/***/ }),
|
|
203
203
|
/* 19 */
|
|
204
204
|
/***/ (function(module, exports) {
|
|
205
205
|
|
|
206
|
-
module.exports = require("
|
|
206
|
+
module.exports = require("codemirror");
|
|
207
207
|
|
|
208
208
|
/***/ }),
|
|
209
209
|
/* 20 */
|
|
210
210
|
/***/ (function(module, exports) {
|
|
211
211
|
|
|
212
|
-
module.exports = require("
|
|
212
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/drawer");
|
|
213
213
|
|
|
214
214
|
/***/ }),
|
|
215
215
|
/* 21 */
|
|
216
216
|
/***/ (function(module, exports) {
|
|
217
217
|
|
|
218
|
-
module.exports = require("
|
|
218
|
+
module.exports = require("dayjs");
|
|
219
219
|
|
|
220
220
|
/***/ }),
|
|
221
221
|
/* 22 */
|
|
222
222
|
/***/ (function(module, exports) {
|
|
223
223
|
|
|
224
|
-
module.exports = require("element-ui/lib/
|
|
224
|
+
module.exports = require("element-ui/lib/link");
|
|
225
225
|
|
|
226
226
|
/***/ }),
|
|
227
227
|
/* 23 */
|
|
228
228
|
/***/ (function(module, exports) {
|
|
229
229
|
|
|
230
|
-
module.exports = require("element-ui/lib/
|
|
230
|
+
module.exports = require("element-ui/lib/form");
|
|
231
231
|
|
|
232
232
|
/***/ }),
|
|
233
233
|
/* 24 */
|
|
234
234
|
/***/ (function(module, exports) {
|
|
235
235
|
|
|
236
|
-
module.exports = require("element-ui/lib/
|
|
236
|
+
module.exports = require("element-ui/lib/row");
|
|
237
237
|
|
|
238
238
|
/***/ }),
|
|
239
239
|
/* 25 */
|
|
240
240
|
/***/ (function(module, exports) {
|
|
241
241
|
|
|
242
|
-
module.exports = require("element-ui/lib/
|
|
242
|
+
module.exports = require("element-ui/lib/col");
|
|
243
243
|
|
|
244
244
|
/***/ }),
|
|
245
245
|
/* 26 */
|
|
246
246
|
/***/ (function(module, exports) {
|
|
247
247
|
|
|
248
|
-
module.exports = require("
|
|
248
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/form-item");
|
|
249
249
|
|
|
250
250
|
/***/ }),
|
|
251
251
|
/* 27 */
|
|
252
252
|
/***/ (function(module, exports) {
|
|
253
253
|
|
|
254
|
-
module.exports = require("element-ui/lib/
|
|
254
|
+
module.exports = require("element-ui/lib/input-number");
|
|
255
255
|
|
|
256
256
|
/***/ }),
|
|
257
257
|
/* 28 */
|
|
258
258
|
/***/ (function(module, exports) {
|
|
259
259
|
|
|
260
|
-
module.exports = require("element-ui/lib/
|
|
260
|
+
module.exports = require("element-ui/lib/select");
|
|
261
261
|
|
|
262
262
|
/***/ }),
|
|
263
263
|
/* 29 */
|
|
264
264
|
/***/ (function(module, exports) {
|
|
265
265
|
|
|
266
|
-
module.exports = require("element-ui/lib/
|
|
266
|
+
module.exports = require("element-ui/lib/option");
|
|
267
267
|
|
|
268
268
|
/***/ }),
|
|
269
269
|
/* 30 */
|
|
270
270
|
/***/ (function(module, exports) {
|
|
271
271
|
|
|
272
|
-
module.exports = require("element-ui/lib/
|
|
272
|
+
module.exports = require("element-ui/lib/option-group");
|
|
273
273
|
|
|
274
274
|
/***/ }),
|
|
275
275
|
/* 31 */
|
|
276
276
|
/***/ (function(module, exports) {
|
|
277
277
|
|
|
278
|
-
module.exports = require("element-ui/lib/
|
|
278
|
+
module.exports = require("element-ui/lib/radio-group");
|
|
279
279
|
|
|
280
280
|
/***/ }),
|
|
281
281
|
/* 32 */
|
|
282
282
|
/***/ (function(module, exports) {
|
|
283
283
|
|
|
284
|
-
module.exports = require("element-ui/lib/
|
|
284
|
+
module.exports = require("element-ui/lib/radio-button");
|
|
285
285
|
|
|
286
286
|
/***/ }),
|
|
287
287
|
/* 33 */
|
|
288
288
|
/***/ (function(module, exports) {
|
|
289
289
|
|
|
290
|
-
module.exports = require("element-ui/lib/
|
|
290
|
+
module.exports = require("element-ui/lib/checkbox-group");
|
|
291
291
|
|
|
292
292
|
/***/ }),
|
|
293
293
|
/* 34 */
|
|
294
294
|
/***/ (function(module, exports) {
|
|
295
295
|
|
|
296
|
-
module.exports = require("element-ui/lib/
|
|
296
|
+
module.exports = require("element-ui/lib/checkbox");
|
|
297
297
|
|
|
298
298
|
/***/ }),
|
|
299
299
|
/* 35 */
|
|
300
300
|
/***/ (function(module, exports) {
|
|
301
301
|
|
|
302
|
-
module.exports = require("element-ui/lib/
|
|
302
|
+
module.exports = require("element-ui/lib/checkbox-button");
|
|
303
303
|
|
|
304
304
|
/***/ }),
|
|
305
305
|
/* 36 */
|
|
306
306
|
/***/ (function(module, exports) {
|
|
307
307
|
|
|
308
|
-
module.exports = require("element-ui/lib/
|
|
308
|
+
module.exports = require("element-ui/lib/switch");
|
|
309
309
|
|
|
310
310
|
/***/ }),
|
|
311
311
|
/* 37 */
|
|
312
312
|
/***/ (function(module, exports) {
|
|
313
313
|
|
|
314
|
-
module.exports = require("element-ui/lib/
|
|
314
|
+
module.exports = require("element-ui/lib/cascader");
|
|
315
315
|
|
|
316
316
|
/***/ }),
|
|
317
317
|
/* 38 */
|
|
318
318
|
/***/ (function(module, exports) {
|
|
319
319
|
|
|
320
|
-
module.exports = require("element-ui/lib/
|
|
320
|
+
module.exports = require("element-ui/lib/slider");
|
|
321
321
|
|
|
322
322
|
/***/ }),
|
|
323
323
|
/* 39 */
|
|
324
324
|
/***/ (function(module, exports) {
|
|
325
325
|
|
|
326
|
-
module.exports = require("element-ui/lib/
|
|
326
|
+
module.exports = require("element-ui/lib/transfer");
|
|
327
327
|
|
|
328
328
|
/***/ }),
|
|
329
329
|
/* 40 */
|
|
330
330
|
/***/ (function(module, exports) {
|
|
331
331
|
|
|
332
|
-
module.exports = require("element-ui/lib/
|
|
332
|
+
module.exports = require("element-ui/lib/time-picker");
|
|
333
333
|
|
|
334
334
|
/***/ }),
|
|
335
335
|
/* 41 */
|
|
336
336
|
/***/ (function(module, exports) {
|
|
337
337
|
|
|
338
|
-
module.exports = require("element-ui/lib/
|
|
338
|
+
module.exports = require("element-ui/lib/date-picker");
|
|
339
339
|
|
|
340
340
|
/***/ }),
|
|
341
341
|
/* 42 */
|
|
342
342
|
/***/ (function(module, exports) {
|
|
343
343
|
|
|
344
|
-
module.exports = require("element-ui/lib/
|
|
344
|
+
module.exports = require("element-ui/lib/upload");
|
|
345
345
|
|
|
346
346
|
/***/ }),
|
|
347
347
|
/* 43 */
|
|
348
348
|
/***/ (function(module, exports) {
|
|
349
349
|
|
|
350
|
-
module.exports = require("element-ui/lib/
|
|
350
|
+
module.exports = require("element-ui/lib/form-item");
|
|
351
351
|
|
|
352
352
|
/***/ }),
|
|
353
353
|
/* 44 */
|
|
354
354
|
/***/ (function(module, exports) {
|
|
355
355
|
|
|
356
|
-
module.exports = require("element-ui/lib/
|
|
356
|
+
module.exports = require("element-ui/lib/descriptions");
|
|
357
357
|
|
|
358
358
|
/***/ }),
|
|
359
359
|
/* 45 */
|
|
360
360
|
/***/ (function(module, exports) {
|
|
361
361
|
|
|
362
|
-
module.exports = require("
|
|
362
|
+
module.exports = require("element-ui/lib/descriptions-item");
|
|
363
363
|
|
|
364
364
|
/***/ }),
|
|
365
365
|
/* 46 */
|
|
366
366
|
/***/ (function(module, exports) {
|
|
367
367
|
|
|
368
|
-
module.exports = require("
|
|
368
|
+
module.exports = require("element-ui/lib/pagination");
|
|
369
369
|
|
|
370
370
|
/***/ }),
|
|
371
371
|
/* 47 */
|
|
372
372
|
/***/ (function(module, exports) {
|
|
373
373
|
|
|
374
|
-
module.exports = require("element-ui/lib/
|
|
374
|
+
module.exports = require("element-ui/lib/dropdown");
|
|
375
375
|
|
|
376
376
|
/***/ }),
|
|
377
377
|
/* 48 */
|
|
378
378
|
/***/ (function(module, exports) {
|
|
379
379
|
|
|
380
|
-
module.exports = require("
|
|
380
|
+
module.exports = require("element-ui/lib/dropdown-item");
|
|
381
381
|
|
|
382
382
|
/***/ }),
|
|
383
383
|
/* 49 */
|
|
384
384
|
/***/ (function(module, exports) {
|
|
385
385
|
|
|
386
|
-
module.exports = require("
|
|
386
|
+
module.exports = require("element-ui/lib/dropdown-menu");
|
|
387
387
|
|
|
388
388
|
/***/ }),
|
|
389
389
|
/* 50 */
|
|
390
390
|
/***/ (function(module, exports) {
|
|
391
391
|
|
|
392
|
-
module.exports = require("
|
|
392
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/form");
|
|
393
393
|
|
|
394
394
|
/***/ }),
|
|
395
395
|
/* 51 */
|
|
396
396
|
/***/ (function(module, exports) {
|
|
397
397
|
|
|
398
|
-
module.exports = require("
|
|
398
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/table");
|
|
399
399
|
|
|
400
400
|
/***/ }),
|
|
401
401
|
/* 52 */
|
|
402
402
|
/***/ (function(module, exports) {
|
|
403
403
|
|
|
404
|
-
module.exports = require("element-ui/lib/
|
|
404
|
+
module.exports = require("element-ui/lib/popover");
|
|
405
405
|
|
|
406
406
|
/***/ }),
|
|
407
407
|
/* 53 */
|
|
408
408
|
/***/ (function(module, exports) {
|
|
409
409
|
|
|
410
|
-
module.exports = require("
|
|
410
|
+
module.exports = require("async-validator");
|
|
411
411
|
|
|
412
412
|
/***/ }),
|
|
413
413
|
/* 54 */
|
|
414
414
|
/***/ (function(module, exports) {
|
|
415
415
|
|
|
416
|
-
module.exports = require("element-ui/
|
|
416
|
+
module.exports = require("element-ui/lib/tree");
|
|
417
417
|
|
|
418
418
|
/***/ }),
|
|
419
419
|
/* 55 */
|
|
420
420
|
/***/ (function(module, exports) {
|
|
421
421
|
|
|
422
|
-
module.exports = require("element-ui/
|
|
422
|
+
module.exports = require("element-ui/lib/badge");
|
|
423
423
|
|
|
424
424
|
/***/ }),
|
|
425
425
|
/* 56 */
|
|
426
426
|
/***/ (function(module, exports) {
|
|
427
427
|
|
|
428
|
-
module.exports = require("element-ui/
|
|
428
|
+
module.exports = require("element-ui/lib/message");
|
|
429
429
|
|
|
430
430
|
/***/ }),
|
|
431
431
|
/* 57 */
|
|
432
|
+
/***/ (function(module, exports) {
|
|
433
|
+
|
|
434
|
+
module.exports = require("element-ui/src/mixins/migrating");
|
|
435
|
+
|
|
436
|
+
/***/ }),
|
|
437
|
+
/* 58 */
|
|
432
438
|
/***/ (function(module, exports, __webpack_require__) {
|
|
433
439
|
|
|
434
|
-
module.exports = __webpack_require__(
|
|
440
|
+
module.exports = __webpack_require__(63);
|
|
435
441
|
|
|
436
442
|
|
|
437
443
|
/***/ }),
|
|
438
|
-
/*
|
|
444
|
+
/* 59 */
|
|
439
445
|
/***/ (function(module, exports) {
|
|
440
446
|
|
|
441
447
|
module.exports = require("codemirror/mode/javascript/javascript");
|
|
442
448
|
|
|
443
449
|
/***/ }),
|
|
444
|
-
/*
|
|
450
|
+
/* 60 */
|
|
445
451
|
/***/ (function(module, exports) {
|
|
446
452
|
|
|
447
453
|
module.exports = require("codemirror/mode/htmlmixed/htmlmixed");
|
|
448
454
|
|
|
449
455
|
/***/ }),
|
|
450
|
-
/*
|
|
456
|
+
/* 61 */
|
|
451
457
|
/***/ (function(module, exports) {
|
|
452
458
|
|
|
453
459
|
module.exports = require("codemirror/addon/mode/simple");
|
|
454
460
|
|
|
455
461
|
/***/ }),
|
|
456
|
-
/*
|
|
462
|
+
/* 62 */
|
|
457
463
|
/***/ (function(module, exports) {
|
|
458
464
|
|
|
459
465
|
module.exports = require("codemirror/addon/mode/multiplex");
|
|
460
466
|
|
|
461
467
|
/***/ }),
|
|
462
|
-
/*
|
|
468
|
+
/* 63 */
|
|
463
469
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
464
470
|
|
|
465
471
|
"use strict";
|
|
466
472
|
// ESM COMPAT FLAG
|
|
467
473
|
__webpack_require__.r(__webpack_exports__);
|
|
468
474
|
|
|
469
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/form.vue?vue&type=template&id=
|
|
470
|
-
var
|
|
475
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/form.vue?vue&type=template&id=26d7095f&
|
|
476
|
+
var formvue_type_template_id_26d7095f_render = function render() {
|
|
471
477
|
var _vm = this,
|
|
472
478
|
_c = _vm._self._c
|
|
473
479
|
return _c(
|
|
474
480
|
"div",
|
|
475
|
-
{
|
|
481
|
+
{ class: ["form", { "is-full": _vm.isFull }] },
|
|
476
482
|
[
|
|
477
483
|
_vm._t("default", function () {
|
|
478
484
|
return [
|
|
@@ -491,7 +497,10 @@ var formvue_type_template_id_42f43bc0_render = function render() {
|
|
|
491
497
|
return [
|
|
492
498
|
_c(
|
|
493
499
|
"el-col",
|
|
494
|
-
{
|
|
500
|
+
{
|
|
501
|
+
key: item.prop,
|
|
502
|
+
attrs: { span: item.span || _vm.span },
|
|
503
|
+
},
|
|
495
504
|
[
|
|
496
505
|
_c(
|
|
497
506
|
"form-item",
|
|
@@ -531,36 +540,40 @@ var formvue_type_template_id_42f43bc0_render = function render() {
|
|
|
531
540
|
)
|
|
532
541
|
}
|
|
533
542
|
var staticRenderFns = []
|
|
534
|
-
|
|
543
|
+
formvue_type_template_id_26d7095f_render._withStripped = true
|
|
535
544
|
|
|
536
545
|
|
|
537
|
-
// CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=template&id=
|
|
546
|
+
// CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=template&id=26d7095f&
|
|
538
547
|
|
|
539
548
|
// EXTERNAL MODULE: external "element-ui/lib/form"
|
|
540
|
-
var form_ = __webpack_require__(
|
|
549
|
+
var form_ = __webpack_require__(23);
|
|
541
550
|
var form_default = /*#__PURE__*/__webpack_require__.n(form_);
|
|
542
551
|
|
|
543
552
|
// EXTERNAL MODULE: external "element-ui/lib/row"
|
|
544
|
-
var row_ = __webpack_require__(
|
|
553
|
+
var row_ = __webpack_require__(24);
|
|
545
554
|
var row_default = /*#__PURE__*/__webpack_require__.n(row_);
|
|
546
555
|
|
|
547
556
|
// EXTERNAL MODULE: external "element-ui/lib/col"
|
|
548
|
-
var col_ = __webpack_require__(
|
|
557
|
+
var col_ = __webpack_require__(25);
|
|
549
558
|
var col_default = /*#__PURE__*/__webpack_require__.n(col_);
|
|
550
559
|
|
|
551
560
|
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/form-item"
|
|
552
|
-
var form_item_ = __webpack_require__(
|
|
561
|
+
var form_item_ = __webpack_require__(26);
|
|
553
562
|
var form_item_default = /*#__PURE__*/__webpack_require__.n(form_item_);
|
|
554
563
|
|
|
555
564
|
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/utils/formula"
|
|
556
565
|
var formula_ = __webpack_require__(2);
|
|
557
566
|
|
|
567
|
+
// EXTERNAL MODULE: external "lodash"
|
|
568
|
+
var external_lodash_ = __webpack_require__(1);
|
|
569
|
+
|
|
558
570
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/form.vue?vue&type=script&lang=js&
|
|
559
571
|
|
|
560
572
|
|
|
561
573
|
|
|
562
574
|
|
|
563
575
|
|
|
576
|
+
|
|
564
577
|
/* harmony default export */ var formvue_type_script_lang_js_ = ({
|
|
565
578
|
name: "Form",
|
|
566
579
|
componentName: "Form",
|
|
@@ -576,7 +589,12 @@ var formula_ = __webpack_require__(2);
|
|
|
576
589
|
};
|
|
577
590
|
},
|
|
578
591
|
props: {
|
|
592
|
+
isFull: {
|
|
593
|
+
type: Boolean,
|
|
594
|
+
default: true
|
|
595
|
+
},
|
|
579
596
|
prop: String,
|
|
597
|
+
span: Number,
|
|
580
598
|
formItems: {
|
|
581
599
|
type: Array,
|
|
582
600
|
default: function _default() {
|
|
@@ -623,11 +641,14 @@ var formula_ = __webpack_require__(2);
|
|
|
623
641
|
}
|
|
624
642
|
if (typeof item.show === "function" && !item.show.call(_this, {
|
|
625
643
|
form: _this,
|
|
644
|
+
formModel: _this.formModel,
|
|
626
645
|
config: item
|
|
627
646
|
})) {
|
|
628
647
|
return false;
|
|
629
648
|
}
|
|
630
|
-
if (typeof item.show === "string" && !Object(formula_["evaluate"])(item.show, _this.formModel
|
|
649
|
+
if (typeof item.show === "string" && !Object(formula_["evaluate"])(item.show, _this.formModel, {
|
|
650
|
+
evalMode: true
|
|
651
|
+
})) {
|
|
631
652
|
return false;
|
|
632
653
|
}
|
|
633
654
|
return true;
|
|
@@ -647,6 +668,7 @@ var formula_ = __webpack_require__(2);
|
|
|
647
668
|
data: function data() {
|
|
648
669
|
return {
|
|
649
670
|
defaultModel: {},
|
|
671
|
+
//默认值存储
|
|
650
672
|
formItemLayout: {}
|
|
651
673
|
};
|
|
652
674
|
},
|
|
@@ -655,8 +677,30 @@ var formula_ = __webpack_require__(2);
|
|
|
655
677
|
this.formItems.forEach(function (item) {
|
|
656
678
|
_this2.formItemLayout[item.prop] = item;
|
|
657
679
|
_this2.defaultModel[item.prop] = item.value;
|
|
658
|
-
|
|
659
|
-
|
|
680
|
+
//初始化值处理
|
|
681
|
+
var formVal = Object(external_lodash_["get"])(_this2.formModel, item.prop);
|
|
682
|
+
if (typeof formVal === 'undefined') {
|
|
683
|
+
//初始化数据值
|
|
684
|
+
if (item.prop && item.prop.indexOf(".") != -1) {
|
|
685
|
+
//循环设置值
|
|
686
|
+
var keyArr = item.prop.split('.');
|
|
687
|
+
var tempObj = _this2.formModel;
|
|
688
|
+
keyArr.forEach(function (key, index) {
|
|
689
|
+
if (index < keyArr.length - 1) {
|
|
690
|
+
if (typeof tempObj[key] === 'undefined') {
|
|
691
|
+
_this2.$set(tempObj, key, {});
|
|
692
|
+
}
|
|
693
|
+
tempObj = tempObj[key];
|
|
694
|
+
} else {
|
|
695
|
+
_this2.$set(tempObj, key, item.value || null);
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
} else {
|
|
699
|
+
_this2.$set(_this2.formModel, item.prop, item.value || null);
|
|
700
|
+
}
|
|
701
|
+
} else {
|
|
702
|
+
item.value = formVal;
|
|
703
|
+
}
|
|
660
704
|
});
|
|
661
705
|
},
|
|
662
706
|
methods: {
|
|
@@ -666,6 +710,9 @@ var formula_ = __webpack_require__(2);
|
|
|
666
710
|
validateField: function validateField(props, callback) {
|
|
667
711
|
return this.$refs.form.validateField(props, callback);
|
|
668
712
|
},
|
|
713
|
+
reset: function reset() {
|
|
714
|
+
this.resetFields();
|
|
715
|
+
},
|
|
669
716
|
resetFields: function resetFields() {
|
|
670
717
|
for (var key in this.defaultModel) {
|
|
671
718
|
if (this.formItemLayout[key]) {
|
|
@@ -799,7 +846,7 @@ function normalizeComponent(
|
|
|
799
846
|
|
|
800
847
|
var component = normalizeComponent(
|
|
801
848
|
src_formvue_type_script_lang_js_,
|
|
802
|
-
|
|
849
|
+
formvue_type_template_id_26d7095f_render,
|
|
803
850
|
staticRenderFns,
|
|
804
851
|
false,
|
|
805
852
|
null,
|
|
@@ -976,7 +1023,7 @@ InputNumbervue_type_template_id_7a2f5f6e_render._withStripped = true
|
|
|
976
1023
|
// CONCATENATED MODULE: ./src/components/form/src/item/InputNumber.vue?vue&type=template&id=7a2f5f6e&
|
|
977
1024
|
|
|
978
1025
|
// EXTERNAL MODULE: external "element-ui/lib/input-number"
|
|
979
|
-
var input_number_ = __webpack_require__(
|
|
1026
|
+
var input_number_ = __webpack_require__(27);
|
|
980
1027
|
var input_number_default = /*#__PURE__*/__webpack_require__.n(input_number_);
|
|
981
1028
|
|
|
982
1029
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/InputNumber.vue?vue&type=script&lang=js&
|
|
@@ -1016,15 +1063,15 @@ var InputNumber_component = normalizeComponent(
|
|
|
1016
1063
|
|
|
1017
1064
|
/* harmony default export */ var InputNumber = (InputNumber_component.exports);
|
|
1018
1065
|
// EXTERNAL MODULE: external "element-ui/lib/select"
|
|
1019
|
-
var select_ = __webpack_require__(
|
|
1066
|
+
var select_ = __webpack_require__(28);
|
|
1020
1067
|
var select_default = /*#__PURE__*/__webpack_require__.n(select_);
|
|
1021
1068
|
|
|
1022
1069
|
// EXTERNAL MODULE: external "element-ui/lib/option"
|
|
1023
|
-
var option_ = __webpack_require__(
|
|
1070
|
+
var option_ = __webpack_require__(29);
|
|
1024
1071
|
var option_default = /*#__PURE__*/__webpack_require__.n(option_);
|
|
1025
1072
|
|
|
1026
1073
|
// EXTERNAL MODULE: external "element-ui/lib/option-group"
|
|
1027
|
-
var option_group_ = __webpack_require__(
|
|
1074
|
+
var option_group_ = __webpack_require__(30);
|
|
1028
1075
|
var option_group_default = /*#__PURE__*/__webpack_require__.n(option_group_);
|
|
1029
1076
|
|
|
1030
1077
|
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/SelectTree.vue?vue&type=template&id=626a2185&
|
|
@@ -1348,9 +1395,6 @@ var SelectTree_component = normalizeComponent(
|
|
|
1348
1395
|
)
|
|
1349
1396
|
|
|
1350
1397
|
/* harmony default export */ var SelectTree = (SelectTree_component.exports);
|
|
1351
|
-
// EXTERNAL MODULE: external "lodash"
|
|
1352
|
-
var external_lodash_ = __webpack_require__(1);
|
|
1353
|
-
|
|
1354
1398
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/Select.vue?vue&type=script&lang=js&
|
|
1355
1399
|
|
|
1356
1400
|
|
|
@@ -1559,15 +1603,15 @@ var Select_component = normalizeComponent(
|
|
|
1559
1603
|
|
|
1560
1604
|
/* harmony default export */ var Select = (Select_component.exports);
|
|
1561
1605
|
// EXTERNAL MODULE: external "element-ui/lib/radio-group"
|
|
1562
|
-
var radio_group_ = __webpack_require__(
|
|
1606
|
+
var radio_group_ = __webpack_require__(31);
|
|
1563
1607
|
var radio_group_default = /*#__PURE__*/__webpack_require__.n(radio_group_);
|
|
1564
1608
|
|
|
1565
1609
|
// EXTERNAL MODULE: external "element-ui/lib/radio"
|
|
1566
|
-
var radio_ = __webpack_require__(
|
|
1610
|
+
var radio_ = __webpack_require__(14);
|
|
1567
1611
|
var radio_default = /*#__PURE__*/__webpack_require__.n(radio_);
|
|
1568
1612
|
|
|
1569
1613
|
// EXTERNAL MODULE: external "element-ui/lib/radio-button"
|
|
1570
|
-
var radio_button_ = __webpack_require__(
|
|
1614
|
+
var radio_button_ = __webpack_require__(32);
|
|
1571
1615
|
var radio_button_default = /*#__PURE__*/__webpack_require__.n(radio_button_);
|
|
1572
1616
|
|
|
1573
1617
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/Radio.vue?vue&type=script&lang=js&
|
|
@@ -1754,15 +1798,15 @@ var Radio_component = normalizeComponent(
|
|
|
1754
1798
|
|
|
1755
1799
|
/* harmony default export */ var Radio = (Radio_component.exports);
|
|
1756
1800
|
// EXTERNAL MODULE: external "element-ui/lib/checkbox-group"
|
|
1757
|
-
var checkbox_group_ = __webpack_require__(
|
|
1801
|
+
var checkbox_group_ = __webpack_require__(33);
|
|
1758
1802
|
var checkbox_group_default = /*#__PURE__*/__webpack_require__.n(checkbox_group_);
|
|
1759
1803
|
|
|
1760
1804
|
// EXTERNAL MODULE: external "element-ui/lib/checkbox"
|
|
1761
|
-
var checkbox_ = __webpack_require__(
|
|
1805
|
+
var checkbox_ = __webpack_require__(34);
|
|
1762
1806
|
var checkbox_default = /*#__PURE__*/__webpack_require__.n(checkbox_);
|
|
1763
1807
|
|
|
1764
1808
|
// EXTERNAL MODULE: external "element-ui/lib/checkbox-button"
|
|
1765
|
-
var checkbox_button_ = __webpack_require__(
|
|
1809
|
+
var checkbox_button_ = __webpack_require__(35);
|
|
1766
1810
|
var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button_);
|
|
1767
1811
|
|
|
1768
1812
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/Checkbox.vue?vue&type=script&lang=js&
|
|
@@ -2004,31 +2048,31 @@ var InputText_component = normalizeComponent(
|
|
|
2004
2048
|
|
|
2005
2049
|
/* harmony default export */ var InputText = (InputText_component.exports);
|
|
2006
2050
|
// EXTERNAL MODULE: external "element-ui/lib/switch"
|
|
2007
|
-
var switch_ = __webpack_require__(
|
|
2051
|
+
var switch_ = __webpack_require__(36);
|
|
2008
2052
|
var switch_default = /*#__PURE__*/__webpack_require__.n(switch_);
|
|
2009
2053
|
|
|
2010
2054
|
// EXTERNAL MODULE: external "element-ui/lib/cascader"
|
|
2011
|
-
var cascader_ = __webpack_require__(
|
|
2055
|
+
var cascader_ = __webpack_require__(37);
|
|
2012
2056
|
var cascader_default = /*#__PURE__*/__webpack_require__.n(cascader_);
|
|
2013
2057
|
|
|
2014
2058
|
// EXTERNAL MODULE: external "element-ui/lib/slider"
|
|
2015
|
-
var slider_ = __webpack_require__(
|
|
2059
|
+
var slider_ = __webpack_require__(38);
|
|
2016
2060
|
var slider_default = /*#__PURE__*/__webpack_require__.n(slider_);
|
|
2017
2061
|
|
|
2018
2062
|
// EXTERNAL MODULE: external "element-ui/lib/transfer"
|
|
2019
|
-
var transfer_ = __webpack_require__(
|
|
2063
|
+
var transfer_ = __webpack_require__(39);
|
|
2020
2064
|
var transfer_default = /*#__PURE__*/__webpack_require__.n(transfer_);
|
|
2021
2065
|
|
|
2022
2066
|
// EXTERNAL MODULE: external "element-ui/lib/time-picker"
|
|
2023
|
-
var time_picker_ = __webpack_require__(
|
|
2067
|
+
var time_picker_ = __webpack_require__(40);
|
|
2024
2068
|
var time_picker_default = /*#__PURE__*/__webpack_require__.n(time_picker_);
|
|
2025
2069
|
|
|
2026
2070
|
// EXTERNAL MODULE: external "element-ui/lib/date-picker"
|
|
2027
|
-
var date_picker_ = __webpack_require__(
|
|
2071
|
+
var date_picker_ = __webpack_require__(41);
|
|
2028
2072
|
var date_picker_default = /*#__PURE__*/__webpack_require__.n(date_picker_);
|
|
2029
2073
|
|
|
2030
2074
|
// EXTERNAL MODULE: external "element-ui/lib/upload"
|
|
2031
|
-
var upload_ = __webpack_require__(
|
|
2075
|
+
var upload_ = __webpack_require__(42);
|
|
2032
2076
|
var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
2033
2077
|
|
|
2034
2078
|
// CONCATENATED MODULE: ./src/components/form/src/form-input.js
|
|
@@ -2046,6 +2090,7 @@ var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
|
2046
2090
|
|
|
2047
2091
|
|
|
2048
2092
|
|
|
2093
|
+
|
|
2049
2094
|
/* harmony default export */ var form_input = ({
|
|
2050
2095
|
name: "FormInput",
|
|
2051
2096
|
inheritAttrs: false,
|
|
@@ -2060,6 +2105,7 @@ var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
|
2060
2105
|
Input: Input,
|
|
2061
2106
|
InputNumber: InputNumber,
|
|
2062
2107
|
Select: Select,
|
|
2108
|
+
SelectTree: SelectTree,
|
|
2063
2109
|
Radio: Radio,
|
|
2064
2110
|
Checkbox: Checkbox,
|
|
2065
2111
|
InputText: InputText
|
|
@@ -2109,7 +2155,7 @@ form_input.install = function (Vue) {
|
|
|
2109
2155
|
};
|
|
2110
2156
|
/* harmony default export */ var components_form_input = (form_input);
|
|
2111
2157
|
// EXTERNAL MODULE: external "element-ui/lib/form-item"
|
|
2112
|
-
var lib_form_item_ = __webpack_require__(
|
|
2158
|
+
var lib_form_item_ = __webpack_require__(43);
|
|
2113
2159
|
var lib_form_item_default = /*#__PURE__*/__webpack_require__.n(lib_form_item_);
|
|
2114
2160
|
|
|
2115
2161
|
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/form-input"
|
|
@@ -2120,6 +2166,7 @@ var form_input_default = /*#__PURE__*/__webpack_require__.n(form_input_);
|
|
|
2120
2166
|
|
|
2121
2167
|
|
|
2122
2168
|
|
|
2169
|
+
|
|
2123
2170
|
/* harmony default export */ var form_item = ({
|
|
2124
2171
|
name: "FormItem",
|
|
2125
2172
|
components: {
|
|
@@ -2132,6 +2179,10 @@ var form_input_default = /*#__PURE__*/__webpack_require__.n(form_input_);
|
|
|
2132
2179
|
prop: String,
|
|
2133
2180
|
value: [String, Number, Boolean, Object, Array, Date],
|
|
2134
2181
|
label: String,
|
|
2182
|
+
labelWidth: String,
|
|
2183
|
+
showMessage: Boolean,
|
|
2184
|
+
inlineMessage: Boolean,
|
|
2185
|
+
size: String,
|
|
2135
2186
|
rules: [Object, Array],
|
|
2136
2187
|
actions: Array,
|
|
2137
2188
|
on: Object,
|
|
@@ -2231,6 +2282,7 @@ var form_input_default = /*#__PURE__*/__webpack_require__.n(form_input_);
|
|
|
2231
2282
|
if (typeof this.render === "function") {
|
|
2232
2283
|
return this.render(h, {
|
|
2233
2284
|
form: this.form,
|
|
2285
|
+
formModel: this.form.formModel,
|
|
2234
2286
|
config: this.config
|
|
2235
2287
|
});
|
|
2236
2288
|
}
|
|
@@ -2240,14 +2292,24 @@ var form_input_default = /*#__PURE__*/__webpack_require__.n(form_input_);
|
|
|
2240
2292
|
input: function input(val) {
|
|
2241
2293
|
_this2.execEvent("input", val);
|
|
2242
2294
|
if (_this2.form) {
|
|
2243
|
-
_this2.
|
|
2295
|
+
if (_this2.prop && _this2.prop.indexOf(".") != -1) {
|
|
2296
|
+
Object(external_lodash_["set"])(_this2.form.formModel, _this2.prop, val);
|
|
2297
|
+
} else {
|
|
2298
|
+
_this2.form.formModel[_this2.prop] = val;
|
|
2299
|
+
}
|
|
2244
2300
|
}
|
|
2301
|
+
_this2.config.value = val;
|
|
2245
2302
|
},
|
|
2246
2303
|
change: function change(val, selectOption) {
|
|
2247
2304
|
_this2.execEvent("change", val, selectOption);
|
|
2248
2305
|
if (_this2.form) {
|
|
2249
|
-
_this2.
|
|
2306
|
+
if (_this2.prop && _this2.prop.indexOf(".") != -1) {
|
|
2307
|
+
Object(external_lodash_["set"])(_this2.form.formModel, _this2.prop, val);
|
|
2308
|
+
} else {
|
|
2309
|
+
_this2.form.formModel[_this2.prop] = val;
|
|
2310
|
+
}
|
|
2250
2311
|
}
|
|
2312
|
+
_this2.config.value = val;
|
|
2251
2313
|
}
|
|
2252
2314
|
})
|
|
2253
2315
|
};
|
|
@@ -2255,7 +2317,9 @@ var form_input_default = /*#__PURE__*/__webpack_require__.n(form_input_);
|
|
|
2255
2317
|
"attrs": {
|
|
2256
2318
|
"label": this.label,
|
|
2257
2319
|
"prop": this.prop,
|
|
2258
|
-
"rules": this.rules
|
|
2320
|
+
"rules": this.rules,
|
|
2321
|
+
"labelWidth": this.labelWidth,
|
|
2322
|
+
"size": this.size
|
|
2259
2323
|
}
|
|
2260
2324
|
}, [h("form-input", babel_helper_vue_jsx_merge_props_default()([{}, itemProp]))]);
|
|
2261
2325
|
}
|
|
@@ -2270,7 +2334,7 @@ form_item.install = function (Vue) {
|
|
|
2270
2334
|
// CONCATENATED MODULE: ./src/components/form-group/src/content.js
|
|
2271
2335
|
|
|
2272
2336
|
|
|
2273
|
-
/* harmony default export */ var
|
|
2337
|
+
/* harmony default export */ var src_content = ({
|
|
2274
2338
|
name: "Content",
|
|
2275
2339
|
inheritAttrs: false,
|
|
2276
2340
|
components: {
|
|
@@ -2328,7 +2392,7 @@ form_item.install = function (Vue) {
|
|
|
2328
2392
|
}
|
|
2329
2393
|
},
|
|
2330
2394
|
render: function render(h) {
|
|
2331
|
-
if (this.slots.form) {
|
|
2395
|
+
if (this.slots && this.slots.form) {
|
|
2332
2396
|
var vForm = typeof this.slots.form === "function" ? this.slots.form.call(this, h) : this.slots.form;
|
|
2333
2397
|
return vForm;
|
|
2334
2398
|
}
|
|
@@ -2516,7 +2580,7 @@ var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
|
2516
2580
|
}, form),
|
|
2517
2581
|
on: form.on
|
|
2518
2582
|
};
|
|
2519
|
-
return h(
|
|
2583
|
+
return h(src_content, babel_helper_vue_jsx_merge_props_default()([{
|
|
2520
2584
|
"ref": form.prop,
|
|
2521
2585
|
"key": form.prop,
|
|
2522
2586
|
"attrs": {
|
|
@@ -2695,6 +2759,7 @@ var button_default = /*#__PURE__*/__webpack_require__.n(button_);
|
|
|
2695
2759
|
}
|
|
2696
2760
|
},
|
|
2697
2761
|
props: {
|
|
2762
|
+
request: Function,
|
|
2698
2763
|
dialog: {
|
|
2699
2764
|
type: Object,
|
|
2700
2765
|
default: function _default() {
|
|
@@ -2755,13 +2820,16 @@ var button_default = /*#__PURE__*/__webpack_require__.n(button_);
|
|
|
2755
2820
|
};
|
|
2756
2821
|
},
|
|
2757
2822
|
computed: {
|
|
2758
|
-
|
|
2759
|
-
return this.api.request || (this.$COMPONENT || {}).request;
|
|
2823
|
+
requester: function requester() {
|
|
2824
|
+
return this.api.request || this.request || (this.$COMPONENT || {}).request;
|
|
2760
2825
|
}
|
|
2761
2826
|
},
|
|
2762
2827
|
methods: {
|
|
2763
|
-
open: function open() {
|
|
2828
|
+
open: function open(model) {
|
|
2764
2829
|
this.show = true;
|
|
2830
|
+
if (model) {
|
|
2831
|
+
this.setFormModel(model);
|
|
2832
|
+
}
|
|
2765
2833
|
},
|
|
2766
2834
|
close: function close() {
|
|
2767
2835
|
this.show = false;
|
|
@@ -2769,28 +2837,49 @@ var button_default = /*#__PURE__*/__webpack_require__.n(button_);
|
|
|
2769
2837
|
setFormModel: function setFormModel(model) {
|
|
2770
2838
|
Object(external_lodash_["merge"])(this.formModel, model);
|
|
2771
2839
|
},
|
|
2840
|
+
reset: function reset() {
|
|
2841
|
+
this.$refs.form && this.$refs.form.reset();
|
|
2842
|
+
},
|
|
2772
2843
|
submit: function submit(button) {
|
|
2773
2844
|
var _this2 = this;
|
|
2774
|
-
if (!(this.api && this.request)) {
|
|
2775
|
-
return false;
|
|
2776
|
-
}
|
|
2777
2845
|
this.$refs.form.validate(function (isValidate, errorMessage) {
|
|
2778
2846
|
if (!isValidate) {
|
|
2779
2847
|
return false;
|
|
2780
2848
|
}
|
|
2849
|
+
var reqData = Object(external_lodash_["merge"])(_this2.api.data || {}, _this2.formModel);
|
|
2850
|
+
if (typeof _this2.api.before === "function") {
|
|
2851
|
+
reqData = _this2.api.before.call(_this2, reqData);
|
|
2852
|
+
}
|
|
2853
|
+
if (!(_this2.api.url && _this2.requester)) {
|
|
2854
|
+
_this2.close();
|
|
2855
|
+
_this2.reset();
|
|
2856
|
+
_this2.$emit("success", {
|
|
2857
|
+
request: _this2.requester,
|
|
2858
|
+
reqData: reqData
|
|
2859
|
+
});
|
|
2860
|
+
return false;
|
|
2861
|
+
}
|
|
2781
2862
|
button.loading = true;
|
|
2782
|
-
|
|
2783
|
-
_this2.request({
|
|
2863
|
+
_this2.requester({
|
|
2784
2864
|
url: Object(formula_["evaluate"])(_this2.api.url, reqData),
|
|
2785
2865
|
method: _this2.api.method || "POST",
|
|
2786
2866
|
data: reqData
|
|
2787
2867
|
}).then(function (res) {
|
|
2788
2868
|
button.loading = false;
|
|
2789
2869
|
_this2.close();
|
|
2790
|
-
_this2
|
|
2870
|
+
_this2.reset();
|
|
2871
|
+
_this2.$emit("success", {
|
|
2872
|
+
request: _this2.requester,
|
|
2873
|
+
reqData: reqData,
|
|
2874
|
+
resData: res
|
|
2875
|
+
});
|
|
2791
2876
|
}).catch(function (error) {
|
|
2792
2877
|
button.loading = false;
|
|
2793
|
-
_this2.$emit("error",
|
|
2878
|
+
_this2.$emit("error", {
|
|
2879
|
+
request: _this2.requester,
|
|
2880
|
+
reqData: reqData,
|
|
2881
|
+
resError: error
|
|
2882
|
+
});
|
|
2794
2883
|
});
|
|
2795
2884
|
});
|
|
2796
2885
|
},
|
|
@@ -2879,122 +2968,399 @@ form_dialog_src.install = function (Vue) {
|
|
|
2879
2968
|
Vue.component(form_dialog_src.name, form_dialog_src);
|
|
2880
2969
|
};
|
|
2881
2970
|
/* harmony default export */ var form_dialog = (form_dialog_src);
|
|
2882
|
-
//
|
|
2883
|
-
var
|
|
2884
|
-
|
|
2885
|
-
_c = _vm._self._c
|
|
2886
|
-
return _c(
|
|
2887
|
-
"div",
|
|
2888
|
-
{ staticClass: "form-view" },
|
|
2889
|
-
[
|
|
2890
|
-
_vm._t("default", function () {
|
|
2891
|
-
return [
|
|
2892
|
-
_c(
|
|
2893
|
-
"el-descriptions",
|
|
2894
|
-
_vm._g(
|
|
2895
|
-
_vm._b({ ref: "form" }, "el-descriptions", _vm.formProps, false),
|
|
2896
|
-
_vm.formListeners
|
|
2897
|
-
),
|
|
2898
|
-
_vm._l(_vm.filterFormItems, function (item) {
|
|
2899
|
-
return _c(
|
|
2900
|
-
"el-descriptions-item",
|
|
2901
|
-
_vm._g(
|
|
2902
|
-
_vm._b(
|
|
2903
|
-
{ key: item.prop },
|
|
2904
|
-
"el-descriptions-item",
|
|
2905
|
-
item,
|
|
2906
|
-
false
|
|
2907
|
-
),
|
|
2908
|
-
item.on
|
|
2909
|
-
),
|
|
2910
|
-
[
|
|
2911
|
-
_vm._v(
|
|
2912
|
-
"\n " + _vm._s(_vm.formModel[item.prop]) + "\n "
|
|
2913
|
-
),
|
|
2914
|
-
]
|
|
2915
|
-
)
|
|
2916
|
-
}),
|
|
2917
|
-
1
|
|
2918
|
-
),
|
|
2919
|
-
]
|
|
2920
|
-
}),
|
|
2921
|
-
],
|
|
2922
|
-
2
|
|
2923
|
-
)
|
|
2924
|
-
}
|
|
2925
|
-
var srcvue_type_template_id_1df6f53d_staticRenderFns = []
|
|
2926
|
-
srcvue_type_template_id_1df6f53d_render._withStripped = true
|
|
2971
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/drawer"
|
|
2972
|
+
var drawer_ = __webpack_require__(20);
|
|
2973
|
+
var drawer_default = /*#__PURE__*/__webpack_require__.n(drawer_);
|
|
2927
2974
|
|
|
2975
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-drawer/src/index.vue?vue&type=script&lang=js&
|
|
2928
2976
|
|
|
2929
|
-
// CONCATENATED MODULE: ./src/components/form-view/src/index.vue?vue&type=template&id=1df6f53d&
|
|
2930
2977
|
|
|
2931
|
-
// EXTERNAL MODULE: external "element-ui/lib/descriptions"
|
|
2932
|
-
var descriptions_ = __webpack_require__(39);
|
|
2933
|
-
var descriptions_default = /*#__PURE__*/__webpack_require__.n(descriptions_);
|
|
2934
2978
|
|
|
2935
|
-
// EXTERNAL MODULE: external "element-ui/lib/descriptions-item"
|
|
2936
|
-
var descriptions_item_ = __webpack_require__(40);
|
|
2937
|
-
var descriptions_item_default = /*#__PURE__*/__webpack_require__.n(descriptions_item_);
|
|
2938
2979
|
|
|
2939
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-view/src/index.vue?vue&type=script&lang=js&
|
|
2940
2980
|
|
|
2941
2981
|
|
|
2942
2982
|
|
|
2943
2983
|
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2984
|
+
|
|
2985
|
+
|
|
2986
|
+
|
|
2987
|
+
/* harmony default export */ var form_drawer_srcvue_type_script_lang_js_ = ({
|
|
2988
|
+
name: "FormDrawer",
|
|
2989
|
+
componentName: "FormDrawer",
|
|
2947
2990
|
components: {
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2991
|
+
Form: components_form,
|
|
2992
|
+
FormGroup: form_group,
|
|
2993
|
+
Drawer: drawer_default.a,
|
|
2994
|
+
Tool: {
|
|
2995
|
+
components: {
|
|
2996
|
+
elButton: button_default.a
|
|
2997
|
+
},
|
|
2998
|
+
props: {
|
|
2999
|
+
label: String,
|
|
3000
|
+
show: {
|
|
3001
|
+
type: [Boolean, Function],
|
|
3002
|
+
default: true
|
|
3003
|
+
},
|
|
3004
|
+
on: {
|
|
3005
|
+
type: Object,
|
|
3006
|
+
default: function _default() {
|
|
3007
|
+
return {};
|
|
3008
|
+
}
|
|
3009
|
+
},
|
|
3010
|
+
render: Function
|
|
3011
|
+
},
|
|
3012
|
+
computed: {
|
|
3013
|
+
attrs: function attrs() {
|
|
3014
|
+
return Object.assign({
|
|
3015
|
+
size: "mini"
|
|
3016
|
+
}, this.$attrs);
|
|
3017
|
+
}
|
|
3018
|
+
},
|
|
3019
|
+
data: function data() {
|
|
3020
|
+
return {
|
|
3021
|
+
loading: this.$attrs.loading
|
|
3022
|
+
};
|
|
3023
|
+
},
|
|
3024
|
+
render: function render(h) {
|
|
3025
|
+
var _this = this;
|
|
3026
|
+
if (this.show === false) {
|
|
3027
|
+
return null;
|
|
3028
|
+
}
|
|
3029
|
+
if (typeof this.render === "function") {
|
|
3030
|
+
return this.render(h, this);
|
|
3031
|
+
}
|
|
3032
|
+
var param = {
|
|
3033
|
+
attrs: this.attrs,
|
|
3034
|
+
on: {
|
|
3035
|
+
click: function click(event) {
|
|
3036
|
+
if (typeof _this.$listeners.click === "function") {
|
|
3037
|
+
_this.$listeners.click.call(event, _this);
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
};
|
|
3042
|
+
return h("el-button", babel_helper_vue_jsx_merge_props_default()([{}, param, {
|
|
3043
|
+
"attrs": {
|
|
3044
|
+
"loading": this.loading
|
|
3045
|
+
}
|
|
3046
|
+
}]), [this.label]);
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
},
|
|
3050
|
+
props: {
|
|
3051
|
+
drawer: {
|
|
3052
|
+
type: Object,
|
|
3053
|
+
default: function _default() {
|
|
3054
|
+
return {
|
|
3055
|
+
confirmButtonText: "确认",
|
|
3056
|
+
confirmButtonType: "Primary",
|
|
3057
|
+
cancelButtonText: "取消",
|
|
3058
|
+
cancelButtonType: "Primary"
|
|
3059
|
+
};
|
|
3060
|
+
}
|
|
3061
|
+
},
|
|
3062
|
+
formMode: String,
|
|
3063
|
+
api: {
|
|
3064
|
+
type: Object,
|
|
3065
|
+
default: function _default() {
|
|
3066
|
+
return {};
|
|
3067
|
+
}
|
|
3068
|
+
},
|
|
3069
|
+
form: {
|
|
3070
|
+
type: Object,
|
|
3071
|
+
default: function _default() {
|
|
3072
|
+
return {};
|
|
3073
|
+
}
|
|
3074
|
+
},
|
|
3075
|
+
tools: Array,
|
|
3076
|
+
on: {
|
|
3077
|
+
type: Object,
|
|
3078
|
+
default: function _default() {
|
|
3079
|
+
return {};
|
|
3080
|
+
}
|
|
3081
|
+
},
|
|
3082
|
+
slots: {
|
|
3083
|
+
type: Object,
|
|
3084
|
+
default: function _default() {
|
|
3085
|
+
return {};
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
},
|
|
3089
|
+
data: function data() {
|
|
3090
|
+
return {
|
|
3091
|
+
show: false,
|
|
3092
|
+
formModel: {},
|
|
3093
|
+
defaultTools: [{
|
|
3094
|
+
label: this.drawer.cancelButtonText || "取消",
|
|
3095
|
+
type: this.confirmButtonType,
|
|
3096
|
+
loading: false,
|
|
3097
|
+
on: {
|
|
3098
|
+
click: this.close
|
|
3099
|
+
}
|
|
3100
|
+
}, {
|
|
3101
|
+
label: this.drawer.confirmButtonText || "确认",
|
|
3102
|
+
type: this.confirmButtonType || "primary",
|
|
3103
|
+
loading: false,
|
|
3104
|
+
on: {
|
|
3105
|
+
click: this.submit
|
|
3106
|
+
}
|
|
3107
|
+
}]
|
|
3108
|
+
};
|
|
3109
|
+
},
|
|
3110
|
+
computed: {
|
|
3111
|
+
request: function request() {
|
|
3112
|
+
return this.api.request || (this.$COMPONENT || {}).request;
|
|
3113
|
+
}
|
|
3114
|
+
},
|
|
3115
|
+
methods: {
|
|
3116
|
+
open: function open(model) {
|
|
3117
|
+
this.show = true;
|
|
3118
|
+
if (model) {
|
|
3119
|
+
this.setFormModel(model);
|
|
3120
|
+
}
|
|
3121
|
+
},
|
|
3122
|
+
close: function close() {
|
|
3123
|
+
this.show = false;
|
|
3124
|
+
this.$emit("close");
|
|
3125
|
+
},
|
|
3126
|
+
setFormModel: function setFormModel(model) {
|
|
3127
|
+
Object(external_lodash_["merge"])(this.formModel, model);
|
|
3128
|
+
},
|
|
3129
|
+
reset: function reset() {
|
|
3130
|
+
this.$refs.form && this.$refs.form.reset();
|
|
3131
|
+
},
|
|
3132
|
+
submit: function submit(button) {
|
|
3133
|
+
var _this2 = this;
|
|
3134
|
+
this.$refs.form.validate(function (isValidate, errorMessage) {
|
|
3135
|
+
if (!isValidate) {
|
|
3136
|
+
return false;
|
|
3137
|
+
}
|
|
3138
|
+
var reqData = Object(external_lodash_["merge"])(_this2.api.data || {}, _this2.formModel);
|
|
3139
|
+
if (!(_this2.api.url && _this2.request)) {
|
|
3140
|
+
_this2.$emit("success", null, reqData);
|
|
3141
|
+
_this2.reset();
|
|
3142
|
+
_this2.close();
|
|
3143
|
+
return false;
|
|
3144
|
+
}
|
|
3145
|
+
button.loading = true;
|
|
3146
|
+
_this2.request({
|
|
3147
|
+
url: Object(formula_["evaluate"])(_this2.api.url, reqData),
|
|
3148
|
+
method: _this2.api.method || "POST",
|
|
3149
|
+
data: reqData
|
|
3150
|
+
}).then(function (res) {
|
|
3151
|
+
button.loading = false;
|
|
3152
|
+
_this2.$emit("success", res, reqData);
|
|
3153
|
+
_this2.reset();
|
|
3154
|
+
_this2.close();
|
|
3155
|
+
}).catch(function (error) {
|
|
3156
|
+
button.loading = false;
|
|
3157
|
+
_this2.$emit("error", error, reqData);
|
|
3158
|
+
});
|
|
3159
|
+
});
|
|
3160
|
+
},
|
|
3161
|
+
renderForm: function renderForm(h) {
|
|
3162
|
+
var param = {
|
|
3163
|
+
attrs: Object.assign({
|
|
3164
|
+
formModel: this.formModel
|
|
3165
|
+
}, this.form)
|
|
3166
|
+
};
|
|
3167
|
+
if (this.formMode === "group") {
|
|
3168
|
+
return h(form_group, babel_helper_vue_jsx_merge_props_default()([{
|
|
3169
|
+
"ref": "form"
|
|
3170
|
+
}, param]));
|
|
3171
|
+
}
|
|
3172
|
+
return h(components_form, babel_helper_vue_jsx_merge_props_default()([{
|
|
3173
|
+
"ref": "form"
|
|
3174
|
+
}, param]));
|
|
3175
|
+
},
|
|
3176
|
+
renderTitle: function renderTitle(h) {
|
|
3177
|
+
if (typeof this.slots.title === "function") {
|
|
3178
|
+
return this.slots.title.call(this, this.formModel);
|
|
3179
|
+
}
|
|
3180
|
+
return this.slots.title || this.drawer.title;
|
|
3181
|
+
},
|
|
3182
|
+
renderTools: function renderTools(h) {
|
|
3183
|
+
if (typeof this.slots.footer === "function") {
|
|
3184
|
+
return this.slots.footer.call(this, this.formModel);
|
|
3185
|
+
}
|
|
3186
|
+
return h("div", [(this.tools || this.defaultTools).map(function (item) {
|
|
3187
|
+
var toolParam = {
|
|
3188
|
+
attrs: Object.assign({}, item),
|
|
3189
|
+
on: item.on
|
|
3190
|
+
};
|
|
3191
|
+
return h("Tool", babel_helper_vue_jsx_merge_props_default()([{}, toolParam]));
|
|
3192
|
+
})]);
|
|
3193
|
+
}
|
|
3194
|
+
},
|
|
3195
|
+
render: function render(h) {
|
|
3196
|
+
var _this3 = this;
|
|
3197
|
+
var param = {
|
|
3198
|
+
attrs: Object.assign({
|
|
3199
|
+
visible: this.show,
|
|
3200
|
+
closeOnClickModal: false,
|
|
3201
|
+
"customClass": "form-drawer"
|
|
3202
|
+
}, this.drawer),
|
|
3203
|
+
on: Object.assign(this.on, {
|
|
3204
|
+
close: function close() {
|
|
3205
|
+
_this3.close();
|
|
3206
|
+
}
|
|
3207
|
+
})
|
|
3208
|
+
};
|
|
3209
|
+
return h(drawer_default.a, babel_helper_vue_jsx_merge_props_default()([{}, param]), [h("template", {
|
|
3210
|
+
"slot": "title",
|
|
3211
|
+
"class": "drawer-title"
|
|
3212
|
+
}, [h("span", [this.renderTitle(h)])]), h("template", {
|
|
3213
|
+
"slot": "footer",
|
|
3214
|
+
"class": "drawer-footer"
|
|
3215
|
+
}, [this.renderTools(h)]), this.renderForm(h)]);
|
|
3216
|
+
}
|
|
3217
|
+
});
|
|
3218
|
+
// CONCATENATED MODULE: ./src/components/form-drawer/src/index.vue?vue&type=script&lang=js&
|
|
3219
|
+
/* harmony default export */ var components_form_drawer_srcvue_type_script_lang_js_ = (form_drawer_srcvue_type_script_lang_js_);
|
|
3220
|
+
// CONCATENATED MODULE: ./src/components/form-drawer/src/index.vue
|
|
3221
|
+
var form_drawer_src_render, form_drawer_src_staticRenderFns
|
|
3222
|
+
|
|
3223
|
+
|
|
3224
|
+
|
|
3225
|
+
|
|
3226
|
+
/* normalize component */
|
|
3227
|
+
|
|
3228
|
+
var form_drawer_src_component = normalizeComponent(
|
|
3229
|
+
components_form_drawer_srcvue_type_script_lang_js_,
|
|
3230
|
+
form_drawer_src_render,
|
|
3231
|
+
form_drawer_src_staticRenderFns,
|
|
3232
|
+
false,
|
|
3233
|
+
null,
|
|
3234
|
+
null,
|
|
3235
|
+
null
|
|
3236
|
+
|
|
3237
|
+
)
|
|
3238
|
+
|
|
3239
|
+
/* harmony default export */ var form_drawer_src = (form_drawer_src_component.exports);
|
|
3240
|
+
// CONCATENATED MODULE: ./src/components/form-drawer/index.js
|
|
3241
|
+
|
|
3242
|
+
form_drawer_src.install = function (Vue) {
|
|
3243
|
+
Vue.component(form_drawer_src.name, form_drawer_src);
|
|
3244
|
+
};
|
|
3245
|
+
/* harmony default export */ var form_drawer = (form_drawer_src);
|
|
3246
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-view/src/index.vue?vue&type=template&id=720bd4fc&
|
|
3247
|
+
var srcvue_type_template_id_720bd4fc_render = function render() {
|
|
3248
|
+
var _vm = this,
|
|
3249
|
+
_c = _vm._self._c
|
|
3250
|
+
return _c(
|
|
3251
|
+
"div",
|
|
3252
|
+
{ staticClass: "form-view" },
|
|
3253
|
+
[
|
|
3254
|
+
_vm._t("default", function () {
|
|
3255
|
+
return [
|
|
3256
|
+
_c(
|
|
3257
|
+
"el-descriptions",
|
|
3258
|
+
_vm._g(
|
|
3259
|
+
_vm._b({ ref: "form" }, "el-descriptions", _vm.formProps, false),
|
|
3260
|
+
_vm.formListeners
|
|
3261
|
+
),
|
|
3262
|
+
_vm._l(_vm.filterFormItems, function (item) {
|
|
3263
|
+
return _c(
|
|
3264
|
+
"el-descriptions-item",
|
|
3265
|
+
_vm._g(
|
|
3266
|
+
_vm._b(
|
|
3267
|
+
{ key: item.prop },
|
|
3268
|
+
"el-descriptions-item",
|
|
3269
|
+
item,
|
|
3270
|
+
false
|
|
3271
|
+
),
|
|
3272
|
+
item.on
|
|
3273
|
+
),
|
|
3274
|
+
[
|
|
3275
|
+
_vm._v(
|
|
3276
|
+
"\n " + _vm._s(_vm.formModel[item.prop]) + "\n "
|
|
3277
|
+
),
|
|
3278
|
+
]
|
|
3279
|
+
)
|
|
3280
|
+
}),
|
|
3281
|
+
1
|
|
3282
|
+
),
|
|
3283
|
+
]
|
|
3284
|
+
}),
|
|
3285
|
+
],
|
|
3286
|
+
2
|
|
3287
|
+
)
|
|
3288
|
+
}
|
|
3289
|
+
var srcvue_type_template_id_720bd4fc_staticRenderFns = []
|
|
3290
|
+
srcvue_type_template_id_720bd4fc_render._withStripped = true
|
|
3291
|
+
|
|
3292
|
+
|
|
3293
|
+
// CONCATENATED MODULE: ./src/components/form-view/src/index.vue?vue&type=template&id=720bd4fc&
|
|
3294
|
+
|
|
3295
|
+
// EXTERNAL MODULE: external "element-ui/lib/descriptions"
|
|
3296
|
+
var descriptions_ = __webpack_require__(44);
|
|
3297
|
+
var descriptions_default = /*#__PURE__*/__webpack_require__.n(descriptions_);
|
|
3298
|
+
|
|
3299
|
+
// EXTERNAL MODULE: external "element-ui/lib/descriptions-item"
|
|
3300
|
+
var descriptions_item_ = __webpack_require__(45);
|
|
3301
|
+
var descriptions_item_default = /*#__PURE__*/__webpack_require__.n(descriptions_item_);
|
|
3302
|
+
|
|
3303
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-view/src/index.vue?vue&type=script&lang=js&
|
|
3304
|
+
|
|
3305
|
+
|
|
3306
|
+
|
|
3307
|
+
|
|
3308
|
+
/* harmony default export */ var form_view_srcvue_type_script_lang_js_ = ({
|
|
3309
|
+
name: "FormView",
|
|
3310
|
+
componentName: "FormView",
|
|
3311
|
+
components: {
|
|
3312
|
+
elDescriptions: descriptions_default.a,
|
|
3313
|
+
elDescriptionsItem: descriptions_item_default.a
|
|
3314
|
+
},
|
|
3315
|
+
props: {
|
|
3316
|
+
prop: String,
|
|
3317
|
+
labelWidth: String,
|
|
3318
|
+
formItems: {
|
|
3319
|
+
type: Array,
|
|
3320
|
+
default: function _default() {
|
|
3321
|
+
return [];
|
|
3322
|
+
}
|
|
3323
|
+
},
|
|
3324
|
+
formModel: {
|
|
3325
|
+
type: Object,
|
|
3326
|
+
default: function _default() {
|
|
3327
|
+
return {};
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
},
|
|
3331
|
+
computed: {
|
|
3332
|
+
formProps: function formProps() {
|
|
3333
|
+
return Object.assign({
|
|
3334
|
+
border: true,
|
|
3335
|
+
labelStyle: {
|
|
3336
|
+
width: this.labelWidth
|
|
3337
|
+
}
|
|
3338
|
+
}, this.$attrs);
|
|
3339
|
+
},
|
|
3340
|
+
formListeners: function formListeners() {
|
|
3341
|
+
return Object.assign({}, this.$listeners);
|
|
3342
|
+
},
|
|
3343
|
+
rowProps: function rowProps() {
|
|
3344
|
+
return Object.assign({}, this.$attrs);
|
|
3345
|
+
},
|
|
3346
|
+
filterFormItems: function filterFormItems() {
|
|
3347
|
+
var _this = this;
|
|
3348
|
+
return this.formItems.filter(function (item) {
|
|
3349
|
+
if (item.show === false) {
|
|
3350
|
+
return false;
|
|
3351
|
+
}
|
|
3352
|
+
if (typeof item.show === "function" && !item.show.call(_this, {
|
|
3353
|
+
form: _this,
|
|
3354
|
+
config: item
|
|
3355
|
+
})) {
|
|
3356
|
+
return false;
|
|
3357
|
+
}
|
|
3358
|
+
if (typeof item.show === "string" && !Object(formula_["evaluate"])(item.show, _this.formModel, {
|
|
3359
|
+
evalMode: true
|
|
3360
|
+
})) {
|
|
3361
|
+
return false;
|
|
3362
|
+
}
|
|
3363
|
+
return true;
|
|
2998
3364
|
});
|
|
2999
3365
|
}
|
|
3000
3366
|
},
|
|
@@ -3029,8 +3395,8 @@ var descriptions_item_default = /*#__PURE__*/__webpack_require__.n(descriptions_
|
|
|
3029
3395
|
|
|
3030
3396
|
var form_view_src_component = normalizeComponent(
|
|
3031
3397
|
components_form_view_srcvue_type_script_lang_js_,
|
|
3032
|
-
|
|
3033
|
-
|
|
3398
|
+
srcvue_type_template_id_720bd4fc_render,
|
|
3399
|
+
srcvue_type_template_id_720bd4fc_staticRenderFns,
|
|
3034
3400
|
false,
|
|
3035
3401
|
null,
|
|
3036
3402
|
null,
|
|
@@ -3048,7 +3414,7 @@ form_view_src.install = function (Vue) {
|
|
|
3048
3414
|
// CONCATENATED MODULE: ./src/components/form-view-group/src/content.js
|
|
3049
3415
|
|
|
3050
3416
|
|
|
3051
|
-
/* harmony default export */ var
|
|
3417
|
+
/* harmony default export */ var form_view_group_src_content = ({
|
|
3052
3418
|
name: "Content",
|
|
3053
3419
|
inheritAttrs: false,
|
|
3054
3420
|
components: {
|
|
@@ -3166,7 +3532,7 @@ form_view_src.install = function (Vue) {
|
|
|
3166
3532
|
attrs: Object.assign({}, form),
|
|
3167
3533
|
on: form.on
|
|
3168
3534
|
};
|
|
3169
|
-
return h(
|
|
3535
|
+
return h(form_view_group_src_content, babel_helper_vue_jsx_merge_props_default()([{
|
|
3170
3536
|
"ref": form.prop,
|
|
3171
3537
|
"key": form.prop,
|
|
3172
3538
|
"attrs": {
|
|
@@ -3272,7 +3638,6 @@ form_view_group_src.install = function (Vue) {
|
|
|
3272
3638
|
|
|
3273
3639
|
|
|
3274
3640
|
|
|
3275
|
-
|
|
3276
3641
|
/* harmony default export */ var form_view_dialog_srcvue_type_script_lang_js_ = ({
|
|
3277
3642
|
name: "FormViewDialog",
|
|
3278
3643
|
componentName: "FormViewDialog",
|
|
@@ -3486,8 +3851,8 @@ form_view_dialog_src.install = function (Vue) {
|
|
|
3486
3851
|
Vue.component(form_view_dialog_src.name, form_view_dialog_src);
|
|
3487
3852
|
};
|
|
3488
3853
|
/* harmony default export */ var form_view_dialog = (form_view_dialog_src);
|
|
3489
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/table.vue?vue&type=template&id=
|
|
3490
|
-
var
|
|
3854
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/table.vue?vue&type=template&id=189ef3b0&
|
|
3855
|
+
var tablevue_type_template_id_189ef3b0_render = function render() {
|
|
3491
3856
|
var _vm = this,
|
|
3492
3857
|
_c = _vm._self._c
|
|
3493
3858
|
return _c("div", { staticClass: "table" }, [
|
|
@@ -3565,14 +3930,14 @@ var tablevue_type_template_id_f8ac923e_render = function render() {
|
|
|
3565
3930
|
: _vm._e(),
|
|
3566
3931
|
])
|
|
3567
3932
|
}
|
|
3568
|
-
var
|
|
3569
|
-
|
|
3933
|
+
var tablevue_type_template_id_189ef3b0_staticRenderFns = []
|
|
3934
|
+
tablevue_type_template_id_189ef3b0_render._withStripped = true
|
|
3570
3935
|
|
|
3571
3936
|
|
|
3572
|
-
// CONCATENATED MODULE: ./src/components/table/src/table.vue?vue&type=template&id=
|
|
3937
|
+
// CONCATENATED MODULE: ./src/components/table/src/table.vue?vue&type=template&id=189ef3b0&
|
|
3573
3938
|
|
|
3574
3939
|
// EXTERNAL MODULE: external "element-ui/lib/table"
|
|
3575
|
-
var table_ = __webpack_require__(
|
|
3940
|
+
var table_ = __webpack_require__(15);
|
|
3576
3941
|
var table_default = /*#__PURE__*/__webpack_require__.n(table_);
|
|
3577
3942
|
|
|
3578
3943
|
// EXTERNAL MODULE: external "element-ui/lib/table-column"
|
|
@@ -3580,7 +3945,7 @@ var table_column_ = __webpack_require__(3);
|
|
|
3580
3945
|
var table_column_default = /*#__PURE__*/__webpack_require__.n(table_column_);
|
|
3581
3946
|
|
|
3582
3947
|
// EXTERNAL MODULE: external "element-ui/lib/pagination"
|
|
3583
|
-
var pagination_ = __webpack_require__(
|
|
3948
|
+
var pagination_ = __webpack_require__(46);
|
|
3584
3949
|
var pagination_default = /*#__PURE__*/__webpack_require__.n(pagination_);
|
|
3585
3950
|
|
|
3586
3951
|
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/table-column"
|
|
@@ -3666,22 +4031,24 @@ var components_table_column_default = /*#__PURE__*/__webpack_require__.n(compone
|
|
|
3666
4031
|
};
|
|
3667
4032
|
},
|
|
3668
4033
|
props: {
|
|
4034
|
+
request: Function,
|
|
3669
4035
|
data: {
|
|
3670
4036
|
type: Array,
|
|
3671
4037
|
default: function _default() {
|
|
3672
4038
|
return null;
|
|
3673
4039
|
}
|
|
3674
4040
|
},
|
|
3675
|
-
api:
|
|
4041
|
+
api: {
|
|
4042
|
+
type: Object,
|
|
4043
|
+
default: function _default() {
|
|
4044
|
+
return {};
|
|
4045
|
+
}
|
|
4046
|
+
},
|
|
4047
|
+
hasInit: Boolean,
|
|
3676
4048
|
remoteProp: {
|
|
3677
4049
|
type: Object,
|
|
3678
4050
|
default: function _default() {
|
|
3679
|
-
return {
|
|
3680
|
-
data: "list",
|
|
3681
|
-
currentPage: "page",
|
|
3682
|
-
pageSize: "pageSize",
|
|
3683
|
-
total: "total"
|
|
3684
|
-
};
|
|
4051
|
+
return {};
|
|
3685
4052
|
}
|
|
3686
4053
|
},
|
|
3687
4054
|
dataSource: Object,
|
|
@@ -3691,7 +4058,6 @@ var components_table_column_default = /*#__PURE__*/__webpack_require__.n(compone
|
|
|
3691
4058
|
return [];
|
|
3692
4059
|
}
|
|
3693
4060
|
},
|
|
3694
|
-
beforeSearch: Function,
|
|
3695
4061
|
pagination: {
|
|
3696
4062
|
type: [Boolean, Object],
|
|
3697
4063
|
default: function _default() {
|
|
@@ -3734,6 +4100,17 @@ var components_table_column_default = /*#__PURE__*/__webpack_require__.n(compone
|
|
|
3734
4100
|
}
|
|
3735
4101
|
},
|
|
3736
4102
|
computed: {
|
|
4103
|
+
requester: function requester() {
|
|
4104
|
+
return this.api.request || this.request || (this.$COMPONENT || {}).request;
|
|
4105
|
+
},
|
|
4106
|
+
remoteDataProp: function remoteDataProp() {
|
|
4107
|
+
return Object.assign({
|
|
4108
|
+
data: "list",
|
|
4109
|
+
currentPage: "page",
|
|
4110
|
+
pageSize: "pageSize",
|
|
4111
|
+
total: "total"
|
|
4112
|
+
}, this.remoteProp);
|
|
4113
|
+
},
|
|
3737
4114
|
tableSource: function tableSource() {
|
|
3738
4115
|
return this.data || this.remoteData || [];
|
|
3739
4116
|
},
|
|
@@ -3806,40 +4183,59 @@ var components_table_column_default = /*#__PURE__*/__webpack_require__.n(compone
|
|
|
3806
4183
|
}
|
|
3807
4184
|
},
|
|
3808
4185
|
mounted: function mounted() {
|
|
3809
|
-
|
|
4186
|
+
if (this.hasInit) {
|
|
4187
|
+
this.reset();
|
|
4188
|
+
}
|
|
3810
4189
|
},
|
|
3811
4190
|
methods: {
|
|
3812
4191
|
reset: function reset() {
|
|
3813
4192
|
this.currentPage = 1;
|
|
3814
4193
|
this.search();
|
|
3815
4194
|
},
|
|
4195
|
+
reload: function reload() {
|
|
4196
|
+
this.search();
|
|
4197
|
+
},
|
|
3816
4198
|
search: function search() {
|
|
3817
4199
|
var _this4 = this;
|
|
3818
|
-
if (!
|
|
4200
|
+
if (!this.requester) {
|
|
3819
4201
|
return false;
|
|
3820
4202
|
}
|
|
3821
|
-
var
|
|
4203
|
+
var reqData = Object.assign({}, this.api.data);
|
|
3822
4204
|
if (this.pagination) {
|
|
3823
|
-
Object(external_lodash_["set"])(
|
|
3824
|
-
Object(external_lodash_["set"])(
|
|
4205
|
+
Object(external_lodash_["set"])(reqData, this.remoteDataProp.currentPage, this.currentPage);
|
|
4206
|
+
Object(external_lodash_["set"])(reqData, this.remoteDataProp.pageSize, this.pageSize);
|
|
3825
4207
|
}
|
|
3826
|
-
if (typeof this.
|
|
3827
|
-
|
|
4208
|
+
if (typeof this.api.before === "function") {
|
|
4209
|
+
reqData = this.api.before.call(this, reqData);
|
|
3828
4210
|
}
|
|
3829
|
-
this.$emit("
|
|
3830
|
-
|
|
3831
|
-
|
|
4211
|
+
this.$emit("request", {
|
|
4212
|
+
request: this.requester,
|
|
4213
|
+
reqData: reqData
|
|
4214
|
+
});
|
|
4215
|
+
this.requester({
|
|
4216
|
+
url: Object(formula_["evaluate"])(this.api.url, reqData),
|
|
3832
4217
|
method: this.api.method || "POST",
|
|
3833
|
-
data:
|
|
4218
|
+
data: reqData
|
|
3834
4219
|
}).then(function (res) {
|
|
3835
|
-
_this4
|
|
3836
|
-
|
|
4220
|
+
if (typeof _this4.api.after === "function") {
|
|
4221
|
+
res = _this4.api.after.call(_this4, res);
|
|
4222
|
+
}
|
|
4223
|
+
_this4.remoteData = _this4.remoteDataProp.data ? Object(external_lodash_["get"])(res, _this4.remoteDataProp.data, []) : res;
|
|
3837
4224
|
if (_this4.pagination) {
|
|
3838
|
-
_this4.total = Object(external_lodash_["get"])(res, _this4.
|
|
4225
|
+
_this4.total = Object(external_lodash_["get"])(res, _this4.remoteDataProp.total, 0);
|
|
3839
4226
|
}
|
|
4227
|
+
_this4.$emit("success", {
|
|
4228
|
+
request: _this4.requester,
|
|
4229
|
+
reqData: reqData,
|
|
4230
|
+
resData: res
|
|
4231
|
+
});
|
|
3840
4232
|
}).catch(function (error) {
|
|
3841
|
-
_this4.$emit("loadingChange", false);
|
|
3842
4233
|
_this4.remoteData = [], _this4.total = 0;
|
|
4234
|
+
_this4.$emit("error", {
|
|
4235
|
+
request: _this4.requester,
|
|
4236
|
+
reqData: reqData,
|
|
4237
|
+
resError: error
|
|
4238
|
+
});
|
|
3843
4239
|
});
|
|
3844
4240
|
}
|
|
3845
4241
|
}
|
|
@@ -3856,8 +4252,8 @@ var components_table_column_default = /*#__PURE__*/__webpack_require__.n(compone
|
|
|
3856
4252
|
|
|
3857
4253
|
var table_component = normalizeComponent(
|
|
3858
4254
|
src_tablevue_type_script_lang_js_,
|
|
3859
|
-
|
|
3860
|
-
|
|
4255
|
+
tablevue_type_template_id_189ef3b0_render,
|
|
4256
|
+
tablevue_type_template_id_189ef3b0_staticRenderFns,
|
|
3861
4257
|
false,
|
|
3862
4258
|
null,
|
|
3863
4259
|
null,
|
|
@@ -4121,7 +4517,7 @@ datevue_type_template_id_3d682315_render._withStripped = true
|
|
|
4121
4517
|
// CONCATENATED MODULE: ./src/components/table/src/column/date.vue?vue&type=template&id=3d682315&
|
|
4122
4518
|
|
|
4123
4519
|
// EXTERNAL MODULE: external "dayjs"
|
|
4124
|
-
var external_dayjs_ = __webpack_require__(
|
|
4520
|
+
var external_dayjs_ = __webpack_require__(21);
|
|
4125
4521
|
var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_);
|
|
4126
4522
|
|
|
4127
4523
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/column/date.vue?vue&type=script&lang=js&
|
|
@@ -4308,19 +4704,19 @@ var dict_component = normalizeComponent(
|
|
|
4308
4704
|
|
|
4309
4705
|
/* harmony default export */ var dict = (dict_component.exports);
|
|
4310
4706
|
// EXTERNAL MODULE: external "element-ui/lib/dropdown"
|
|
4311
|
-
var dropdown_ = __webpack_require__(
|
|
4707
|
+
var dropdown_ = __webpack_require__(47);
|
|
4312
4708
|
var dropdown_default = /*#__PURE__*/__webpack_require__.n(dropdown_);
|
|
4313
4709
|
|
|
4314
4710
|
// EXTERNAL MODULE: external "element-ui/lib/dropdown-item"
|
|
4315
|
-
var dropdown_item_ = __webpack_require__(
|
|
4711
|
+
var dropdown_item_ = __webpack_require__(48);
|
|
4316
4712
|
var dropdown_item_default = /*#__PURE__*/__webpack_require__.n(dropdown_item_);
|
|
4317
4713
|
|
|
4318
4714
|
// EXTERNAL MODULE: external "element-ui/lib/dropdown-menu"
|
|
4319
|
-
var dropdown_menu_ = __webpack_require__(
|
|
4715
|
+
var dropdown_menu_ = __webpack_require__(49);
|
|
4320
4716
|
var dropdown_menu_default = /*#__PURE__*/__webpack_require__.n(dropdown_menu_);
|
|
4321
4717
|
|
|
4322
4718
|
// EXTERNAL MODULE: external "element-ui/lib/link"
|
|
4323
|
-
var link_ = __webpack_require__(
|
|
4719
|
+
var link_ = __webpack_require__(22);
|
|
4324
4720
|
var link_default = /*#__PURE__*/__webpack_require__.n(link_);
|
|
4325
4721
|
|
|
4326
4722
|
// CONCATENATED MODULE: ./src/utils/helper.js
|
|
@@ -4669,6 +5065,7 @@ function spliceTreeSelf(tree, idx, deleteCount) {
|
|
|
4669
5065
|
|
|
4670
5066
|
|
|
4671
5067
|
|
|
5068
|
+
|
|
4672
5069
|
/* harmony default export */ var operatevue_type_script_lang_js_ = ({
|
|
4673
5070
|
name: "Operate",
|
|
4674
5071
|
props: {
|
|
@@ -4681,7 +5078,6 @@ function spliceTreeSelf(tree, idx, deleteCount) {
|
|
|
4681
5078
|
},
|
|
4682
5079
|
items: {
|
|
4683
5080
|
type: Array,
|
|
4684
|
-
required: true,
|
|
4685
5081
|
default: function _default() {
|
|
4686
5082
|
return [];
|
|
4687
5083
|
}
|
|
@@ -4705,7 +5101,7 @@ function spliceTreeSelf(tree, idx, deleteCount) {
|
|
|
4705
5101
|
}
|
|
4706
5102
|
},
|
|
4707
5103
|
created: function created() {
|
|
4708
|
-
this.items.
|
|
5104
|
+
this.items.forEach(function (row) {
|
|
4709
5105
|
if (!row.key) {
|
|
4710
5106
|
row.key = uuid();
|
|
4711
5107
|
}
|
|
@@ -4714,7 +5110,7 @@ function spliceTreeSelf(tree, idx, deleteCount) {
|
|
|
4714
5110
|
methods: {
|
|
4715
5111
|
renderItems: function renderItems(h, scoped) {
|
|
4716
5112
|
var _this = this;
|
|
4717
|
-
var filterItems = this.items.filter(function (row) {
|
|
5113
|
+
var filterItems = Object(external_lodash_["sortBy"])(this.items, ['sort']).filter(function (row) {
|
|
4718
5114
|
if (typeof row.show === "function") {
|
|
4719
5115
|
return row.show.call(_this, scoped, row);
|
|
4720
5116
|
}
|
|
@@ -4942,12 +5338,19 @@ function table_column_extends() { table_column_extends = Object.assign ? Object.
|
|
|
4942
5338
|
required: false,
|
|
4943
5339
|
default: "Default"
|
|
4944
5340
|
},
|
|
5341
|
+
show: {
|
|
5342
|
+
type: Boolean,
|
|
5343
|
+
default: true
|
|
5344
|
+
},
|
|
4945
5345
|
slots: {
|
|
4946
5346
|
type: Object
|
|
4947
5347
|
}
|
|
4948
5348
|
},
|
|
4949
5349
|
render: function render(h) {
|
|
4950
5350
|
var _this = this;
|
|
5351
|
+
if (this.show === false) {
|
|
5352
|
+
return;
|
|
5353
|
+
}
|
|
4951
5354
|
var param = {
|
|
4952
5355
|
attrs: Object.assign({}, this.$attrs),
|
|
4953
5356
|
on: this.$listeners,
|
|
@@ -4980,8 +5383,8 @@ table_column.install = function (Vue) {
|
|
|
4980
5383
|
Vue.component(table_column.name, table_column);
|
|
4981
5384
|
};
|
|
4982
5385
|
/* harmony default export */ var components_table_column = (table_column);
|
|
4983
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table-search/src/index.vue?vue&type=template&id=
|
|
4984
|
-
var
|
|
5386
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table-search/src/index.vue?vue&type=template&id=08925b81&
|
|
5387
|
+
var srcvue_type_template_id_08925b81_render = function render() {
|
|
4985
5388
|
var _vm = this,
|
|
4986
5389
|
_c = _vm._self._c
|
|
4987
5390
|
return _c("div", { staticClass: "table-search" }, [
|
|
@@ -5030,23 +5433,33 @@ var srcvue_type_template_id_d82821d8_render = function render() {
|
|
|
5030
5433
|
_c(
|
|
5031
5434
|
"div",
|
|
5032
5435
|
{ staticClass: "table-search-table" },
|
|
5033
|
-
[
|
|
5436
|
+
[
|
|
5437
|
+
_c(
|
|
5438
|
+
"Table",
|
|
5439
|
+
_vm._b(
|
|
5440
|
+
{ ref: "table", attrs: { request: _vm.request } },
|
|
5441
|
+
"Table",
|
|
5442
|
+
_vm.tableProps,
|
|
5443
|
+
false
|
|
5444
|
+
)
|
|
5445
|
+
),
|
|
5446
|
+
],
|
|
5034
5447
|
1
|
|
5035
5448
|
),
|
|
5036
5449
|
])
|
|
5037
5450
|
}
|
|
5038
|
-
var
|
|
5039
|
-
|
|
5451
|
+
var srcvue_type_template_id_08925b81_staticRenderFns = []
|
|
5452
|
+
srcvue_type_template_id_08925b81_render._withStripped = true
|
|
5040
5453
|
|
|
5041
5454
|
|
|
5042
|
-
// CONCATENATED MODULE: ./src/components/table-search/src/index.vue?vue&type=template&id=
|
|
5455
|
+
// CONCATENATED MODULE: ./src/components/table-search/src/index.vue?vue&type=template&id=08925b81&
|
|
5043
5456
|
|
|
5044
5457
|
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/form"
|
|
5045
|
-
var components_form_ = __webpack_require__(
|
|
5458
|
+
var components_form_ = __webpack_require__(50);
|
|
5046
5459
|
var components_form_default = /*#__PURE__*/__webpack_require__.n(components_form_);
|
|
5047
5460
|
|
|
5048
5461
|
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/table"
|
|
5049
|
-
var components_table_ = __webpack_require__(
|
|
5462
|
+
var components_table_ = __webpack_require__(51);
|
|
5050
5463
|
var components_table_default = /*#__PURE__*/__webpack_require__.n(components_table_);
|
|
5051
5464
|
|
|
5052
5465
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table-search/src/index.vue?vue&type=script&lang=js&
|
|
@@ -5074,11 +5487,7 @@ var components_table_default = /*#__PURE__*/__webpack_require__.n(components_tab
|
|
|
5074
5487
|
}, this.search.form);
|
|
5075
5488
|
},
|
|
5076
5489
|
tableProps: function tableProps() {
|
|
5077
|
-
return Object(external_lodash_["merge"])({
|
|
5078
|
-
api: {
|
|
5079
|
-
request: this.request
|
|
5080
|
-
}
|
|
5081
|
-
}, this.table, {
|
|
5490
|
+
return Object(external_lodash_["merge"])(this.table, {
|
|
5082
5491
|
api: {
|
|
5083
5492
|
data: this.searchData
|
|
5084
5493
|
}
|
|
@@ -5095,23 +5504,29 @@ var components_table_default = /*#__PURE__*/__webpack_require__.n(components_tab
|
|
|
5095
5504
|
},
|
|
5096
5505
|
mounted: function mounted() {
|
|
5097
5506
|
var _this = this;
|
|
5098
|
-
if (this.search.hasInit) {
|
|
5507
|
+
if (this.search && this.search.hasInit) {
|
|
5099
5508
|
this.$nextTick(function () {
|
|
5100
5509
|
_this.searchSubmit();
|
|
5101
5510
|
});
|
|
5102
5511
|
}
|
|
5103
5512
|
},
|
|
5104
5513
|
methods: {
|
|
5105
|
-
|
|
5514
|
+
resetForm: function resetForm() {
|
|
5106
5515
|
this.$refs.form.resetFields();
|
|
5107
5516
|
},
|
|
5517
|
+
resetTable: function resetTable() {
|
|
5518
|
+
this.$refs.table.reset();
|
|
5519
|
+
},
|
|
5520
|
+
reloadTable: function reloadTable() {
|
|
5521
|
+
this.$refs.table.reload();
|
|
5522
|
+
},
|
|
5108
5523
|
searchSubmit: function searchSubmit() {
|
|
5109
5524
|
var _this2 = this;
|
|
5110
5525
|
this.$refs.form.validate(function (isValidate, errorMessage) {
|
|
5111
5526
|
if (!isValidate) {
|
|
5112
5527
|
return false;
|
|
5113
5528
|
}
|
|
5114
|
-
_this2
|
|
5529
|
+
_this2.resetTable();
|
|
5115
5530
|
});
|
|
5116
5531
|
}
|
|
5117
5532
|
}
|
|
@@ -5128,8 +5543,8 @@ var components_table_default = /*#__PURE__*/__webpack_require__.n(components_tab
|
|
|
5128
5543
|
|
|
5129
5544
|
var table_search_src_component = normalizeComponent(
|
|
5130
5545
|
components_table_search_srcvue_type_script_lang_js_,
|
|
5131
|
-
|
|
5132
|
-
|
|
5546
|
+
srcvue_type_template_id_08925b81_render,
|
|
5547
|
+
srcvue_type_template_id_08925b81_staticRenderFns,
|
|
5133
5548
|
false,
|
|
5134
5549
|
null,
|
|
5135
5550
|
null,
|
|
@@ -5196,11 +5611,11 @@ srcvue_type_template_id_2cd18efc_render._withStripped = true
|
|
|
5196
5611
|
// CONCATENATED MODULE: ./src/components/table-editable/src/index.vue?vue&type=template&id=2cd18efc&
|
|
5197
5612
|
|
|
5198
5613
|
// EXTERNAL MODULE: external "element-ui/lib/popover"
|
|
5199
|
-
var popover_ = __webpack_require__(
|
|
5614
|
+
var popover_ = __webpack_require__(52);
|
|
5200
5615
|
var popover_default = /*#__PURE__*/__webpack_require__.n(popover_);
|
|
5201
5616
|
|
|
5202
5617
|
// EXTERNAL MODULE: external "async-validator"
|
|
5203
|
-
var external_async_validator_ = __webpack_require__(
|
|
5618
|
+
var external_async_validator_ = __webpack_require__(53);
|
|
5204
5619
|
var external_async_validator_default = /*#__PURE__*/__webpack_require__.n(external_async_validator_);
|
|
5205
5620
|
|
|
5206
5621
|
// CONCATENATED MODULE: ./src/components/table-editable/src/form-item.js
|
|
@@ -5764,95 +6179,394 @@ var external_async_validator_default = /*#__PURE__*/__webpack_require__.n(extern
|
|
|
5764
6179
|
if (message) {
|
|
5765
6180
|
valid = false;
|
|
5766
6181
|
}
|
|
5767
|
-
Object.assign(invalidFields, fieldMsg);
|
|
5768
|
-
if (typeof callback === 'function' && ++count === fields.length) {
|
|
5769
|
-
callback(valid, invalidFields);
|
|
6182
|
+
Object.assign(invalidFields, fieldMsg);
|
|
6183
|
+
if (typeof callback === 'function' && ++count === fields.length) {
|
|
6184
|
+
callback(valid, invalidFields);
|
|
6185
|
+
}
|
|
6186
|
+
});
|
|
6187
|
+
});
|
|
6188
|
+
if (promise) {
|
|
6189
|
+
return promise;
|
|
6190
|
+
}
|
|
6191
|
+
},
|
|
6192
|
+
validateField: function validateField(rowIndex, props, cb) {
|
|
6193
|
+
props = [].concat(props);
|
|
6194
|
+
var fields = this.fields.filter(function (item) {
|
|
6195
|
+
return item.row && item.row.$index === rowIndex && props.indexOf(item.prop) !== -1;
|
|
6196
|
+
});
|
|
6197
|
+
if (!fields.length) {
|
|
6198
|
+
console.warn('[Element Warn]please pass correct props!');
|
|
6199
|
+
return;
|
|
6200
|
+
}
|
|
6201
|
+
fields.forEach(function (field) {
|
|
6202
|
+
field.validate('', cb);
|
|
6203
|
+
});
|
|
6204
|
+
},
|
|
6205
|
+
clearValidate: function clearValidate(rowIndex, props) {
|
|
6206
|
+
if (props === void 0) {
|
|
6207
|
+
props = [];
|
|
6208
|
+
}
|
|
6209
|
+
var fields = this.fields;
|
|
6210
|
+
if (typeof rowIndex === "number") {
|
|
6211
|
+
fields = props.length ? this.fields.filter(function (item) {
|
|
6212
|
+
return item.row && item.row.$index === rowIndex && props.indexOf(item.prop) !== -1;
|
|
6213
|
+
}) : this.fields.filter(function (item) {
|
|
6214
|
+
return item.row && item.row.$index === rowIndex;
|
|
6215
|
+
});
|
|
6216
|
+
}
|
|
6217
|
+
fields.forEach(function (field) {
|
|
6218
|
+
field.clearValidate();
|
|
6219
|
+
});
|
|
6220
|
+
},
|
|
6221
|
+
getRowField: function getRowField(row) {
|
|
6222
|
+
var fieldMap = {};
|
|
6223
|
+
var fields = this.fields.filter(function (item) {
|
|
6224
|
+
return item.row && item.row.$index === row.$index;
|
|
6225
|
+
});
|
|
6226
|
+
fields.forEach(function (item) {
|
|
6227
|
+
fieldMap[item.prop] = item;
|
|
6228
|
+
});
|
|
6229
|
+
return fieldMap;
|
|
6230
|
+
},
|
|
6231
|
+
addRow: function addRow(data, parentRow) {
|
|
6232
|
+
var _Object$assign;
|
|
6233
|
+
var rowData = Object.assign((_Object$assign = {}, _Object$assign[this.rowKey] = uuid(), _Object$assign), this.rowData, data);
|
|
6234
|
+
if (this.hasChildren && !rowData.children) {
|
|
6235
|
+
rowData.children = [];
|
|
6236
|
+
}
|
|
6237
|
+
if (parentRow) {
|
|
6238
|
+
if (!parentRow.children) {
|
|
6239
|
+
this.$set(parentRow, "children", []);
|
|
6240
|
+
}
|
|
6241
|
+
parentRow.children.push(rowData);
|
|
6242
|
+
} else {
|
|
6243
|
+
this.data.push(rowData);
|
|
6244
|
+
}
|
|
6245
|
+
},
|
|
6246
|
+
deleteByIndex: function deleteByIndex(index) {
|
|
6247
|
+
this.data && this.data.splice(index, 1);
|
|
6248
|
+
},
|
|
6249
|
+
deleteByRow: function deleteByRow(row) {
|
|
6250
|
+
var _this4 = this;
|
|
6251
|
+
spliceTreeSelf(this.data, findTreeIndex(this.data, function (item) {
|
|
6252
|
+
return item[_this4.rowKey] === row[_this4.rowKey];
|
|
6253
|
+
}), 1);
|
|
6254
|
+
}
|
|
6255
|
+
}
|
|
6256
|
+
});
|
|
6257
|
+
// CONCATENATED MODULE: ./src/components/table-editable/src/index.vue?vue&type=script&lang=js&
|
|
6258
|
+
/* harmony default export */ var components_table_editable_srcvue_type_script_lang_js_ = (table_editable_srcvue_type_script_lang_js_);
|
|
6259
|
+
// CONCATENATED MODULE: ./src/components/table-editable/src/index.vue
|
|
6260
|
+
|
|
6261
|
+
|
|
6262
|
+
|
|
6263
|
+
|
|
6264
|
+
|
|
6265
|
+
/* normalize component */
|
|
6266
|
+
|
|
6267
|
+
var table_editable_src_component = normalizeComponent(
|
|
6268
|
+
components_table_editable_srcvue_type_script_lang_js_,
|
|
6269
|
+
srcvue_type_template_id_2cd18efc_render,
|
|
6270
|
+
srcvue_type_template_id_2cd18efc_staticRenderFns,
|
|
6271
|
+
false,
|
|
6272
|
+
null,
|
|
6273
|
+
null,
|
|
6274
|
+
null
|
|
6275
|
+
|
|
6276
|
+
)
|
|
6277
|
+
|
|
6278
|
+
/* harmony default export */ var table_editable_src = (table_editable_src_component.exports);
|
|
6279
|
+
// CONCATENATED MODULE: ./src/components/table-editable/index.js
|
|
6280
|
+
|
|
6281
|
+
table_editable_src.install = function (Vue) {
|
|
6282
|
+
Vue.component(table_editable_src.name, table_editable_src);
|
|
6283
|
+
};
|
|
6284
|
+
/* harmony default export */ var table_editable = (table_editable_src);
|
|
6285
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/table-search"
|
|
6286
|
+
var table_search_ = __webpack_require__(13);
|
|
6287
|
+
var table_search_default = /*#__PURE__*/__webpack_require__.n(table_search_);
|
|
6288
|
+
|
|
6289
|
+
// EXTERNAL MODULE: external "element-ui/lib/message-box"
|
|
6290
|
+
var message_box_ = __webpack_require__(16);
|
|
6291
|
+
var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
6292
|
+
|
|
6293
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table-operate/src/index.vue?vue&type=script&lang=js&
|
|
6294
|
+
|
|
6295
|
+
|
|
6296
|
+
|
|
6297
|
+
|
|
6298
|
+
|
|
6299
|
+
/* harmony default export */ var table_operate_srcvue_type_script_lang_js_ = ({
|
|
6300
|
+
name: "TableOperate",
|
|
6301
|
+
componentName: "TableOperate",
|
|
6302
|
+
components: {
|
|
6303
|
+
TableSearch: table_search_default.a,
|
|
6304
|
+
FormDialog: form_dialog,
|
|
6305
|
+
FormViewDialog: form_view_dialog
|
|
6306
|
+
},
|
|
6307
|
+
computed: {
|
|
6308
|
+
tableProps: function tableProps() {
|
|
6309
|
+
return {
|
|
6310
|
+
request: this.request,
|
|
6311
|
+
search: this.search,
|
|
6312
|
+
table: this.table
|
|
6313
|
+
};
|
|
6314
|
+
},
|
|
6315
|
+
createProps: function createProps() {
|
|
6316
|
+
return Object.assign({
|
|
6317
|
+
dialog: {
|
|
6318
|
+
title: "添加"
|
|
6319
|
+
}
|
|
6320
|
+
}, this.create);
|
|
6321
|
+
},
|
|
6322
|
+
updateProps: function updateProps() {
|
|
6323
|
+
return Object.assign({
|
|
6324
|
+
dialog: {
|
|
6325
|
+
title: "修改"
|
|
6326
|
+
}
|
|
6327
|
+
}, this.update);
|
|
6328
|
+
},
|
|
6329
|
+
viewProps: function viewProps() {
|
|
6330
|
+
return Object.assign({
|
|
6331
|
+
dialog: {
|
|
6332
|
+
title: "查看"
|
|
6333
|
+
}
|
|
6334
|
+
}, this.view);
|
|
6335
|
+
}
|
|
6336
|
+
},
|
|
6337
|
+
props: {
|
|
6338
|
+
request: Function,
|
|
6339
|
+
search: {
|
|
6340
|
+
type: Object,
|
|
6341
|
+
default: function _default() {
|
|
6342
|
+
return {};
|
|
6343
|
+
}
|
|
6344
|
+
},
|
|
6345
|
+
table: {
|
|
6346
|
+
type: Object,
|
|
6347
|
+
default: function _default() {
|
|
6348
|
+
return {};
|
|
6349
|
+
}
|
|
6350
|
+
},
|
|
6351
|
+
create: {
|
|
6352
|
+
type: Object,
|
|
6353
|
+
default: function _default() {
|
|
6354
|
+
return null;
|
|
6355
|
+
}
|
|
6356
|
+
},
|
|
6357
|
+
update: {
|
|
6358
|
+
type: Object,
|
|
6359
|
+
default: function _default() {
|
|
6360
|
+
return null;
|
|
6361
|
+
}
|
|
6362
|
+
},
|
|
6363
|
+
delete: {
|
|
6364
|
+
type: Object,
|
|
6365
|
+
default: function _default() {
|
|
6366
|
+
return null;
|
|
6367
|
+
}
|
|
6368
|
+
},
|
|
6369
|
+
view: {
|
|
6370
|
+
type: Object,
|
|
6371
|
+
default: function _default() {
|
|
6372
|
+
return null;
|
|
6373
|
+
}
|
|
6374
|
+
},
|
|
6375
|
+
on: {
|
|
6376
|
+
type: Object,
|
|
6377
|
+
default: function _default() {
|
|
6378
|
+
return {};
|
|
6379
|
+
}
|
|
6380
|
+
},
|
|
6381
|
+
slots: {
|
|
6382
|
+
type: Object,
|
|
6383
|
+
default: function _default() {
|
|
6384
|
+
return {};
|
|
6385
|
+
}
|
|
6386
|
+
}
|
|
6387
|
+
},
|
|
6388
|
+
data: function data() {
|
|
6389
|
+
return {};
|
|
6390
|
+
},
|
|
6391
|
+
mounted: function mounted() {
|
|
6392
|
+
this.addTools();
|
|
6393
|
+
},
|
|
6394
|
+
methods: {
|
|
6395
|
+
addTools: function addTools() {
|
|
6396
|
+
// 添加按钮处理
|
|
6397
|
+
if (this.create) {
|
|
6398
|
+
var tools = this.table && this.table.tools || [];
|
|
6399
|
+
tools.unshift(Object.assign({
|
|
6400
|
+
label: "添加",
|
|
6401
|
+
loading: false,
|
|
6402
|
+
on: {
|
|
6403
|
+
click: this.handleCreate
|
|
6404
|
+
}
|
|
6405
|
+
}, this.create.tool));
|
|
6406
|
+
this.table.tools = tools;
|
|
6407
|
+
}
|
|
6408
|
+
//修改和删除按钮处理
|
|
6409
|
+
if (!(this.update || this.delete || this.view)) {
|
|
6410
|
+
return false;
|
|
6411
|
+
}
|
|
6412
|
+
var filterColumns = this.table.columns.filter(function (item) {
|
|
6413
|
+
return item.control === "Operate";
|
|
6414
|
+
});
|
|
6415
|
+
var optColumn = filterColumns && filterColumns[0];
|
|
6416
|
+
var items = optColumn && optColumn.items || [];
|
|
6417
|
+
if (this.delete) {
|
|
6418
|
+
items.unshift(Object.assign({
|
|
6419
|
+
label: "删除",
|
|
6420
|
+
loading: false,
|
|
6421
|
+
on: {
|
|
6422
|
+
click: this.handleDelete
|
|
6423
|
+
}
|
|
6424
|
+
}, this.delete.tool));
|
|
6425
|
+
}
|
|
6426
|
+
if (this.update) {
|
|
6427
|
+
items.unshift(Object.assign({
|
|
6428
|
+
label: "修改",
|
|
6429
|
+
loading: false,
|
|
6430
|
+
on: {
|
|
6431
|
+
click: this.handleUpdate
|
|
6432
|
+
}
|
|
6433
|
+
}, this.update.tool));
|
|
6434
|
+
}
|
|
6435
|
+
if (this.view) {
|
|
6436
|
+
items.unshift(Object.assign({
|
|
6437
|
+
label: "查看",
|
|
6438
|
+
loading: false,
|
|
6439
|
+
on: {
|
|
6440
|
+
click: this.handleView
|
|
5770
6441
|
}
|
|
6442
|
+
}, this.view.tool));
|
|
6443
|
+
}
|
|
6444
|
+
if (optColumn) {
|
|
6445
|
+
optColumn.items = items;
|
|
6446
|
+
} else {
|
|
6447
|
+
this.table.columns.push({
|
|
6448
|
+
control: "Operate",
|
|
6449
|
+
label: "操作",
|
|
6450
|
+
align: "center",
|
|
6451
|
+
items: items
|
|
5771
6452
|
});
|
|
5772
|
-
});
|
|
5773
|
-
if (promise) {
|
|
5774
|
-
return promise;
|
|
5775
6453
|
}
|
|
5776
6454
|
},
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
var fields = this.fields.filter(function (item) {
|
|
5780
|
-
return item.row && item.row.$index === rowIndex && props.indexOf(item.prop) !== -1;
|
|
5781
|
-
});
|
|
5782
|
-
if (!fields.length) {
|
|
5783
|
-
console.warn('[Element Warn]please pass correct props!');
|
|
5784
|
-
return;
|
|
5785
|
-
}
|
|
5786
|
-
fields.forEach(function (field) {
|
|
5787
|
-
field.validate('', cb);
|
|
5788
|
-
});
|
|
6455
|
+
handleCreate: function handleCreate() {
|
|
6456
|
+
this.$refs.createFormDialog.open();
|
|
5789
6457
|
},
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
6458
|
+
handleUpdate: function handleUpdate(rowProps, that) {
|
|
6459
|
+
var _this = this;
|
|
6460
|
+
var rowData = rowProps.row;
|
|
6461
|
+
this.$refs.updateFormDialog.open();
|
|
6462
|
+
if (this.update.detail) {
|
|
6463
|
+
var request = this.update.detail.request || this.request;
|
|
6464
|
+
request({
|
|
6465
|
+
url: Object(formula_["evaluate"])(this.update.detail.url, rowData),
|
|
6466
|
+
method: this.update.detail.method || "GET",
|
|
6467
|
+
data: rowData
|
|
6468
|
+
}).then(function (res) {
|
|
6469
|
+
_this.$refs.updateFormDialog.setFormModel(res);
|
|
6470
|
+
}).catch(function (error) {});
|
|
6471
|
+
} else {
|
|
6472
|
+
this.$nextTick(function () {
|
|
6473
|
+
_this.$refs.updateFormDialog.setFormModel(rowData);
|
|
5800
6474
|
});
|
|
5801
6475
|
}
|
|
5802
|
-
fields.forEach(function (field) {
|
|
5803
|
-
field.clearValidate();
|
|
5804
|
-
});
|
|
5805
6476
|
},
|
|
5806
|
-
|
|
5807
|
-
var
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
6477
|
+
handleDelete: function handleDelete(rowProps, that) {
|
|
6478
|
+
var _this2 = this;
|
|
6479
|
+
message_box_default.a.confirm("是否确定删除", '提示', {
|
|
6480
|
+
confirmButtonText: '确定',
|
|
6481
|
+
cancelButtonText: '取消',
|
|
6482
|
+
type: 'warning'
|
|
6483
|
+
}).then(function () {
|
|
6484
|
+
var request = _this2.delete.api.request || _this2.request;
|
|
6485
|
+
var rowData = rowProps.row;
|
|
6486
|
+
that.loading = true;
|
|
6487
|
+
request({
|
|
6488
|
+
url: Object(formula_["evaluate"])(_this2.delete.api.url, rowData),
|
|
6489
|
+
method: _this2.delete.api.method || "GET",
|
|
6490
|
+
data: rowData
|
|
6491
|
+
}).then(function (res) {
|
|
6492
|
+
that.loading = false;
|
|
6493
|
+
}).catch(function (error) {
|
|
6494
|
+
that.loading = false;
|
|
6495
|
+
});
|
|
6496
|
+
}).catch(function () {});
|
|
5815
6497
|
},
|
|
5816
|
-
|
|
5817
|
-
var
|
|
5818
|
-
var rowData =
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
this
|
|
5825
|
-
|
|
5826
|
-
|
|
6498
|
+
handleView: function handleView(rowProps, that) {
|
|
6499
|
+
var _this3 = this;
|
|
6500
|
+
var rowData = rowProps.row;
|
|
6501
|
+
this.$refs.viewFormDialog.open();
|
|
6502
|
+
if (this.view.api) {
|
|
6503
|
+
var request = this.view.api.request || this.request;
|
|
6504
|
+
request({
|
|
6505
|
+
url: Object(formula_["evaluate"])(this.view.api.url, rowData),
|
|
6506
|
+
method: this.view.api.method || "GET",
|
|
6507
|
+
data: rowData
|
|
6508
|
+
}).then(function (res) {
|
|
6509
|
+
_this3.$refs.viewFormDialog.setFormModel(res);
|
|
6510
|
+
}).catch(function (error) {});
|
|
5827
6511
|
} else {
|
|
5828
|
-
this
|
|
6512
|
+
this.$nextTick(function () {
|
|
6513
|
+
_this3.$refs.viewFormDialog.setFormModel(rowData);
|
|
6514
|
+
});
|
|
5829
6515
|
}
|
|
5830
|
-
},
|
|
5831
|
-
deleteByIndex: function deleteByIndex(index) {
|
|
5832
|
-
this.data && this.data.splice(index, 1);
|
|
5833
|
-
},
|
|
5834
|
-
deleteByRow: function deleteByRow(row) {
|
|
5835
|
-
var _this4 = this;
|
|
5836
|
-
spliceTreeSelf(this.data, findTreeIndex(this.data, function (item) {
|
|
5837
|
-
return item[_this4.rowKey] === row[_this4.rowKey];
|
|
5838
|
-
}), 1);
|
|
5839
6516
|
}
|
|
6517
|
+
},
|
|
6518
|
+
render: function render() {
|
|
6519
|
+
var h = arguments[0];
|
|
6520
|
+
return h("div", [h("div", [h(table_search_default.a, {
|
|
6521
|
+
"ref": "table",
|
|
6522
|
+
"directives": [{
|
|
6523
|
+
name: "bind",
|
|
6524
|
+
value: "tableProps"
|
|
6525
|
+
}]
|
|
6526
|
+
})]), h("div", [h(form_dialog, {
|
|
6527
|
+
"directives": [{
|
|
6528
|
+
name: "if",
|
|
6529
|
+
value: "create"
|
|
6530
|
+
}, {
|
|
6531
|
+
name: "bind",
|
|
6532
|
+
value: "createProps"
|
|
6533
|
+
}],
|
|
6534
|
+
"ref": "createFormDialog"
|
|
6535
|
+
}), h(form_dialog, {
|
|
6536
|
+
"directives": [{
|
|
6537
|
+
name: "if",
|
|
6538
|
+
value: "update"
|
|
6539
|
+
}, {
|
|
6540
|
+
name: "bind",
|
|
6541
|
+
value: "updateProps"
|
|
6542
|
+
}],
|
|
6543
|
+
"ref": "updateFormDialog"
|
|
6544
|
+
}), h(form_view_dialog, {
|
|
6545
|
+
"directives": [{
|
|
6546
|
+
name: "if",
|
|
6547
|
+
value: "view"
|
|
6548
|
+
}, {
|
|
6549
|
+
name: "bind",
|
|
6550
|
+
value: "viewProps"
|
|
6551
|
+
}],
|
|
6552
|
+
"ref": "viewFormDialog"
|
|
6553
|
+
})])]);
|
|
5840
6554
|
}
|
|
5841
6555
|
});
|
|
5842
|
-
// CONCATENATED MODULE: ./src/components/table-
|
|
5843
|
-
/* harmony default export */ var
|
|
5844
|
-
// CONCATENATED MODULE: ./src/components/table-
|
|
5845
|
-
|
|
6556
|
+
// CONCATENATED MODULE: ./src/components/table-operate/src/index.vue?vue&type=script&lang=js&
|
|
6557
|
+
/* harmony default export */ var components_table_operate_srcvue_type_script_lang_js_ = (table_operate_srcvue_type_script_lang_js_);
|
|
6558
|
+
// CONCATENATED MODULE: ./src/components/table-operate/src/index.vue
|
|
6559
|
+
var table_operate_src_render, table_operate_src_staticRenderFns
|
|
5846
6560
|
|
|
5847
6561
|
|
|
5848
6562
|
|
|
5849
6563
|
|
|
5850
6564
|
/* normalize component */
|
|
5851
6565
|
|
|
5852
|
-
var
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
6566
|
+
var table_operate_src_component = normalizeComponent(
|
|
6567
|
+
components_table_operate_srcvue_type_script_lang_js_,
|
|
6568
|
+
table_operate_src_render,
|
|
6569
|
+
table_operate_src_staticRenderFns,
|
|
5856
6570
|
false,
|
|
5857
6571
|
null,
|
|
5858
6572
|
null,
|
|
@@ -5860,15 +6574,15 @@ var table_editable_src_component = normalizeComponent(
|
|
|
5860
6574
|
|
|
5861
6575
|
)
|
|
5862
6576
|
|
|
5863
|
-
/* harmony default export */ var
|
|
5864
|
-
// CONCATENATED MODULE: ./src/components/table-
|
|
6577
|
+
/* harmony default export */ var table_operate_src = (table_operate_src_component.exports);
|
|
6578
|
+
// CONCATENATED MODULE: ./src/components/table-operate/index.js
|
|
5865
6579
|
|
|
5866
|
-
|
|
5867
|
-
Vue.component(
|
|
6580
|
+
table_operate_src.install = function (Vue) {
|
|
6581
|
+
Vue.component(table_operate_src.name, table_operate_src);
|
|
5868
6582
|
};
|
|
5869
|
-
/* harmony default export */ var
|
|
5870
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=
|
|
5871
|
-
var
|
|
6583
|
+
/* harmony default export */ var table_operate = (table_operate_src);
|
|
6584
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=template&id=39c4f843&
|
|
6585
|
+
var srcvue_type_template_id_39c4f843_render = function render() {
|
|
5872
6586
|
var _vm = this,
|
|
5873
6587
|
_c = _vm._self._c
|
|
5874
6588
|
return _c("div", [
|
|
@@ -5877,7 +6591,12 @@ var srcvue_type_template_id_0fa8c191_render = function render() {
|
|
|
5877
6591
|
[
|
|
5878
6592
|
_c(
|
|
5879
6593
|
"TableSearch",
|
|
5880
|
-
_vm._b(
|
|
6594
|
+
_vm._b(
|
|
6595
|
+
{ ref: "table", attrs: { request: _vm.request } },
|
|
6596
|
+
"TableSearch",
|
|
6597
|
+
_vm.tableProps,
|
|
6598
|
+
false
|
|
6599
|
+
)
|
|
5881
6600
|
),
|
|
5882
6601
|
],
|
|
5883
6602
|
1
|
|
@@ -5888,22 +6607,28 @@ var srcvue_type_template_id_0fa8c191_render = function render() {
|
|
|
5888
6607
|
_vm.create
|
|
5889
6608
|
? _c(
|
|
5890
6609
|
"FormDialog",
|
|
5891
|
-
_vm.
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
6610
|
+
_vm._g(
|
|
6611
|
+
_vm._b(
|
|
6612
|
+
{ ref: "createFormDialog", attrs: { request: _vm.request } },
|
|
6613
|
+
"FormDialog",
|
|
6614
|
+
_vm.createProps,
|
|
6615
|
+
false
|
|
6616
|
+
),
|
|
6617
|
+
_vm.reloadTableEvent
|
|
5896
6618
|
)
|
|
5897
6619
|
)
|
|
5898
6620
|
: _vm._e(),
|
|
5899
6621
|
_vm.update
|
|
5900
6622
|
? _c(
|
|
5901
6623
|
"FormDialog",
|
|
5902
|
-
_vm.
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
6624
|
+
_vm._g(
|
|
6625
|
+
_vm._b(
|
|
6626
|
+
{ ref: "updateFormDialog", attrs: { request: _vm.request } },
|
|
6627
|
+
"FormDialog",
|
|
6628
|
+
_vm.updateProps,
|
|
6629
|
+
false
|
|
6630
|
+
),
|
|
6631
|
+
_vm.reloadTableEvent
|
|
5907
6632
|
)
|
|
5908
6633
|
)
|
|
5909
6634
|
: _vm._e(),
|
|
@@ -5911,7 +6636,7 @@ var srcvue_type_template_id_0fa8c191_render = function render() {
|
|
|
5911
6636
|
? _c(
|
|
5912
6637
|
"FormViewDialog",
|
|
5913
6638
|
_vm._b(
|
|
5914
|
-
{ ref: "viewFormDialog" },
|
|
6639
|
+
{ ref: "viewFormDialog", attrs: { request: _vm.request } },
|
|
5915
6640
|
"FormViewDialog",
|
|
5916
6641
|
_vm.viewProps,
|
|
5917
6642
|
false
|
|
@@ -5923,19 +6648,11 @@ var srcvue_type_template_id_0fa8c191_render = function render() {
|
|
|
5923
6648
|
),
|
|
5924
6649
|
])
|
|
5925
6650
|
}
|
|
5926
|
-
var
|
|
5927
|
-
|
|
5928
|
-
|
|
6651
|
+
var srcvue_type_template_id_39c4f843_staticRenderFns = []
|
|
6652
|
+
srcvue_type_template_id_39c4f843_render._withStripped = true
|
|
5929
6653
|
|
|
5930
|
-
// CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=0fa8c191&
|
|
5931
|
-
|
|
5932
|
-
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/table-search"
|
|
5933
|
-
var table_search_ = __webpack_require__(49);
|
|
5934
|
-
var table_search_default = /*#__PURE__*/__webpack_require__.n(table_search_);
|
|
5935
6654
|
|
|
5936
|
-
//
|
|
5937
|
-
var message_box_ = __webpack_require__(50);
|
|
5938
|
-
var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
6655
|
+
// CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=39c4f843&
|
|
5939
6656
|
|
|
5940
6657
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=script&lang=js&
|
|
5941
6658
|
|
|
@@ -5943,6 +6660,7 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
5943
6660
|
|
|
5944
6661
|
|
|
5945
6662
|
|
|
6663
|
+
|
|
5946
6664
|
/* harmony default export */ var crud_srcvue_type_script_lang_js_ = ({
|
|
5947
6665
|
name: "CRUD",
|
|
5948
6666
|
componentName: "CRUD",
|
|
@@ -6033,7 +6751,14 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
6033
6751
|
}
|
|
6034
6752
|
},
|
|
6035
6753
|
data: function data() {
|
|
6036
|
-
|
|
6754
|
+
var _this = this;
|
|
6755
|
+
return {
|
|
6756
|
+
reloadTableEvent: {
|
|
6757
|
+
success: function success() {
|
|
6758
|
+
_this.reloadTable();
|
|
6759
|
+
}
|
|
6760
|
+
}
|
|
6761
|
+
};
|
|
6037
6762
|
},
|
|
6038
6763
|
created: function created() {
|
|
6039
6764
|
this.addTools();
|
|
@@ -6046,13 +6771,14 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
6046
6771
|
tools.unshift(Object.assign({
|
|
6047
6772
|
label: "添加",
|
|
6048
6773
|
loading: false,
|
|
6774
|
+
sort: 10,
|
|
6049
6775
|
on: {
|
|
6050
6776
|
click: this.handleCreate
|
|
6051
6777
|
}
|
|
6052
6778
|
}, this.create.tool));
|
|
6053
6779
|
this.table.tools = tools;
|
|
6054
6780
|
}
|
|
6055
|
-
|
|
6781
|
+
//修改,查看和删除按钮处理
|
|
6056
6782
|
if (!(this.update || this.delete || this.view)) {
|
|
6057
6783
|
return false;
|
|
6058
6784
|
}
|
|
@@ -6062,32 +6788,35 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
6062
6788
|
var optColumn = filterColumns && filterColumns[0];
|
|
6063
6789
|
var items = optColumn && optColumn.items || [];
|
|
6064
6790
|
if (this.update) {
|
|
6065
|
-
items.
|
|
6791
|
+
items.push(Object.assign({
|
|
6066
6792
|
label: "修改",
|
|
6067
6793
|
loading: false,
|
|
6794
|
+
sort: 10,
|
|
6068
6795
|
on: {
|
|
6069
6796
|
click: this.handleUpdate
|
|
6070
6797
|
}
|
|
6071
6798
|
}, this.update.tool));
|
|
6072
6799
|
}
|
|
6073
|
-
if (this.delete) {
|
|
6074
|
-
items.unshift(Object.assign({
|
|
6075
|
-
label: "删除",
|
|
6076
|
-
loading: false,
|
|
6077
|
-
on: {
|
|
6078
|
-
click: this.handleDelete
|
|
6079
|
-
}
|
|
6080
|
-
}, this.delete.tool));
|
|
6081
|
-
}
|
|
6082
6800
|
if (this.view) {
|
|
6083
|
-
items.
|
|
6801
|
+
items.push(Object.assign({
|
|
6084
6802
|
label: "查看",
|
|
6085
6803
|
loading: false,
|
|
6804
|
+
sort: 20,
|
|
6086
6805
|
on: {
|
|
6087
6806
|
click: this.handleView
|
|
6088
6807
|
}
|
|
6089
6808
|
}, this.view.tool));
|
|
6090
6809
|
}
|
|
6810
|
+
if (this.delete) {
|
|
6811
|
+
items.push(Object.assign({
|
|
6812
|
+
label: "删除",
|
|
6813
|
+
loading: false,
|
|
6814
|
+
sort: 30,
|
|
6815
|
+
on: {
|
|
6816
|
+
click: this.handleDelete
|
|
6817
|
+
}
|
|
6818
|
+
}, this.delete.tool));
|
|
6819
|
+
}
|
|
6091
6820
|
if (optColumn) {
|
|
6092
6821
|
optColumn.items = items;
|
|
6093
6822
|
} else {
|
|
@@ -6102,62 +6831,117 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
6102
6831
|
handleCreate: function handleCreate() {
|
|
6103
6832
|
this.$refs.createFormDialog.open();
|
|
6104
6833
|
},
|
|
6834
|
+
reloadTable: function reloadTable() {
|
|
6835
|
+
this.$refs.table.reloadTable();
|
|
6836
|
+
},
|
|
6837
|
+
getRequest: function getRequest(request) {
|
|
6838
|
+
if (request) {
|
|
6839
|
+
return request;
|
|
6840
|
+
}
|
|
6841
|
+
return this.request || (this.$COMPONENT || {}).request;
|
|
6842
|
+
},
|
|
6105
6843
|
handleUpdate: function handleUpdate(rowProps, that) {
|
|
6106
|
-
var
|
|
6844
|
+
var _this2 = this;
|
|
6107
6845
|
var rowData = rowProps.row;
|
|
6108
6846
|
this.$refs.updateFormDialog.open();
|
|
6109
|
-
|
|
6110
|
-
|
|
6847
|
+
var detailApi = this.update.detail || {};
|
|
6848
|
+
var request = this.getRequest(detailApi.request);
|
|
6849
|
+
var reqData = Object(external_lodash_["merge"])(detailApi.data || {}, rowData);
|
|
6850
|
+
if (typeof detailApi.before === "function") {
|
|
6851
|
+
reqData = detailApi.before.call(this, reqData);
|
|
6852
|
+
}
|
|
6853
|
+
if (detailApi.url && request) {
|
|
6854
|
+
that.loading = true;
|
|
6111
6855
|
request({
|
|
6112
|
-
url: Object(formula_["evaluate"])(
|
|
6113
|
-
method:
|
|
6114
|
-
data:
|
|
6856
|
+
url: Object(formula_["evaluate"])(detailApi.url, rowData),
|
|
6857
|
+
method: detailApi.method || "GET",
|
|
6858
|
+
data: reqData
|
|
6115
6859
|
}).then(function (res) {
|
|
6116
|
-
|
|
6117
|
-
|
|
6860
|
+
that.loading = false;
|
|
6861
|
+
if (typeof detailApi.after === "function") {
|
|
6862
|
+
res = detailApi.after.call(_this2, res);
|
|
6863
|
+
}
|
|
6864
|
+
_this2.$refs.updateFormDialog.setFormModel(res);
|
|
6865
|
+
}).catch(function (error) {
|
|
6866
|
+
that.loading = false;
|
|
6867
|
+
});
|
|
6118
6868
|
} else {
|
|
6119
6869
|
this.$nextTick(function () {
|
|
6120
|
-
|
|
6870
|
+
_this2.$refs.updateFormDialog.setFormModel(typeof detailApi.after === "function" ? detailApi.after.call(_this2, reqData) : reqData);
|
|
6121
6871
|
});
|
|
6122
6872
|
}
|
|
6123
6873
|
},
|
|
6124
6874
|
handleDelete: function handleDelete(rowProps, that) {
|
|
6125
|
-
var
|
|
6875
|
+
var _this3 = this;
|
|
6876
|
+
var deleteApi = this.delete.api;
|
|
6877
|
+
if (!deleteApi) {
|
|
6878
|
+
console.warn("缺少删除的配置");
|
|
6879
|
+
return false;
|
|
6880
|
+
}
|
|
6126
6881
|
message_box_default.a.confirm("是否确定删除", '提示', {
|
|
6127
6882
|
confirmButtonText: '确定',
|
|
6128
6883
|
cancelButtonText: '取消',
|
|
6129
6884
|
type: 'warning'
|
|
6130
6885
|
}).then(function () {
|
|
6131
|
-
var request =
|
|
6132
|
-
var
|
|
6886
|
+
var request = _this3.getRequest(deleteApi.request);
|
|
6887
|
+
var reqData = Object(external_lodash_["merge"])(deleteApi.data || {}, rowProps.row);
|
|
6888
|
+
if (typeof deleteApi.before === "function") {
|
|
6889
|
+
reqData = deleteApi.before.call(_this3, reqData);
|
|
6890
|
+
}
|
|
6133
6891
|
that.loading = true;
|
|
6134
6892
|
request({
|
|
6135
|
-
url: Object(formula_["evaluate"])(
|
|
6136
|
-
method:
|
|
6137
|
-
data:
|
|
6893
|
+
url: Object(formula_["evaluate"])(deleteApi.url, reqData),
|
|
6894
|
+
method: deleteApi.method || "GET",
|
|
6895
|
+
data: reqData
|
|
6138
6896
|
}).then(function (res) {
|
|
6139
6897
|
that.loading = false;
|
|
6898
|
+
_this3.reloadTable();
|
|
6899
|
+
_this3.$emit("deleteSuccess", {
|
|
6900
|
+
request: request,
|
|
6901
|
+
reqData: reqData,
|
|
6902
|
+
resData: res
|
|
6903
|
+
});
|
|
6140
6904
|
}).catch(function (error) {
|
|
6141
6905
|
that.loading = false;
|
|
6906
|
+
_this3.$emit("deleteError", {
|
|
6907
|
+
request: request,
|
|
6908
|
+
reqData: reqData,
|
|
6909
|
+
resError: error
|
|
6910
|
+
});
|
|
6142
6911
|
});
|
|
6143
6912
|
}).catch(function () {});
|
|
6144
6913
|
},
|
|
6145
6914
|
handleView: function handleView(rowProps, that) {
|
|
6146
|
-
var
|
|
6915
|
+
var _this4 = this;
|
|
6147
6916
|
var rowData = rowProps.row;
|
|
6148
6917
|
this.$refs.viewFormDialog.open();
|
|
6149
|
-
|
|
6150
|
-
|
|
6918
|
+
var viewApi = this.view.api || {};
|
|
6919
|
+
var request = this.getRequest(viewApi.request);
|
|
6920
|
+
var reqData = Object(external_lodash_["merge"])(viewApi.data || {}, rowData);
|
|
6921
|
+
if (typeof viewApi.before === "function") {
|
|
6922
|
+
reqData = viewApi.before.call(this, reqData);
|
|
6923
|
+
}
|
|
6924
|
+
if (viewApi.url && request) {
|
|
6925
|
+
that.loading = true;
|
|
6151
6926
|
request({
|
|
6152
|
-
url: Object(formula_["evaluate"])(
|
|
6153
|
-
method:
|
|
6154
|
-
data:
|
|
6927
|
+
url: Object(formula_["evaluate"])(viewApi.url, reqData),
|
|
6928
|
+
method: viewApi.method || "GET",
|
|
6929
|
+
data: reqData
|
|
6155
6930
|
}).then(function (res) {
|
|
6156
|
-
|
|
6157
|
-
|
|
6931
|
+
that.loading = false;
|
|
6932
|
+
if (typeof viewApi.after === "function") {
|
|
6933
|
+
res = viewApi.after.call(_this4, res);
|
|
6934
|
+
}
|
|
6935
|
+
_this4.$refs.viewFormDialog.setFormModel(res);
|
|
6936
|
+
}).catch(function (error) {
|
|
6937
|
+
that.loading = false;
|
|
6938
|
+
});
|
|
6158
6939
|
} else {
|
|
6940
|
+
if (typeof viewApi.after === "function") {
|
|
6941
|
+
reqData = viewApi.after.call(this, reqData);
|
|
6942
|
+
}
|
|
6159
6943
|
this.$nextTick(function () {
|
|
6160
|
-
|
|
6944
|
+
_this4.$refs.viewFormDialog.setFormModel(typeof viewApi.after === "function" ? viewApi.after.call(_this4, reqData) : reqData);
|
|
6161
6945
|
});
|
|
6162
6946
|
}
|
|
6163
6947
|
}
|
|
@@ -6175,8 +6959,8 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
6175
6959
|
|
|
6176
6960
|
var crud_src_component = normalizeComponent(
|
|
6177
6961
|
components_crud_srcvue_type_script_lang_js_,
|
|
6178
|
-
|
|
6179
|
-
|
|
6962
|
+
srcvue_type_template_id_39c4f843_render,
|
|
6963
|
+
srcvue_type_template_id_39c4f843_staticRenderFns,
|
|
6180
6964
|
false,
|
|
6181
6965
|
null,
|
|
6182
6966
|
null,
|
|
@@ -6192,20 +6976,20 @@ crud_src.install = function (Vue) {
|
|
|
6192
6976
|
};
|
|
6193
6977
|
/* harmony default export */ var crud = (crud_src);
|
|
6194
6978
|
// EXTERNAL MODULE: external "codemirror"
|
|
6195
|
-
var external_codemirror_ = __webpack_require__(
|
|
6979
|
+
var external_codemirror_ = __webpack_require__(19);
|
|
6196
6980
|
var external_codemirror_default = /*#__PURE__*/__webpack_require__.n(external_codemirror_);
|
|
6197
6981
|
|
|
6198
6982
|
// EXTERNAL MODULE: external "codemirror/mode/javascript/javascript"
|
|
6199
|
-
var javascript_ = __webpack_require__(
|
|
6983
|
+
var javascript_ = __webpack_require__(59);
|
|
6200
6984
|
|
|
6201
6985
|
// EXTERNAL MODULE: external "codemirror/mode/htmlmixed/htmlmixed"
|
|
6202
|
-
var htmlmixed_ = __webpack_require__(
|
|
6986
|
+
var htmlmixed_ = __webpack_require__(60);
|
|
6203
6987
|
|
|
6204
6988
|
// EXTERNAL MODULE: external "codemirror/addon/mode/simple"
|
|
6205
|
-
var simple_ = __webpack_require__(
|
|
6989
|
+
var simple_ = __webpack_require__(61);
|
|
6206
6990
|
|
|
6207
6991
|
// EXTERNAL MODULE: external "codemirror/addon/mode/multiplex"
|
|
6208
|
-
var multiplex_ = __webpack_require__(
|
|
6992
|
+
var multiplex_ = __webpack_require__(62);
|
|
6209
6993
|
|
|
6210
6994
|
// CONCATENATED MODULE: ./src/components/formula/src/codeMirror.js
|
|
6211
6995
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
@@ -6424,11 +7208,11 @@ function funcList_extends() { funcList_extends = Object.assign ? Object.assign.b
|
|
|
6424
7208
|
}
|
|
6425
7209
|
});
|
|
6426
7210
|
// EXTERNAL MODULE: external "element-ui/lib/tree"
|
|
6427
|
-
var tree_ = __webpack_require__(
|
|
7211
|
+
var tree_ = __webpack_require__(54);
|
|
6428
7212
|
var tree_default = /*#__PURE__*/__webpack_require__.n(tree_);
|
|
6429
7213
|
|
|
6430
7214
|
// EXTERNAL MODULE: external "element-ui/lib/badge"
|
|
6431
|
-
var badge_ = __webpack_require__(
|
|
7215
|
+
var badge_ = __webpack_require__(55);
|
|
6432
7216
|
var badge_default = /*#__PURE__*/__webpack_require__.n(badge_);
|
|
6433
7217
|
|
|
6434
7218
|
// CONCATENATED MODULE: ./src/components/formula/src/variableList.js
|
|
@@ -6522,7 +7306,7 @@ var badge_default = /*#__PURE__*/__webpack_require__.n(badge_);
|
|
|
6522
7306
|
"attrs": {
|
|
6523
7307
|
"value": "self"
|
|
6524
7308
|
}
|
|
6525
|
-
}, [h("label", [data.label])]), data.label && (!this.selfVariableName || data.value !== this.selfVariableName) && h("label", [data.label]), data.tag ? h("span", {
|
|
7309
|
+
}, [h("label", [data.label])]), data.label && (!this.selfVariableName || data.value !== this.selfVariableName) && h("label", [data.label]), data.label && data.tag ? h("span", {
|
|
6526
7310
|
"class": this.classPrefix + "-item-tag"
|
|
6527
7311
|
}, [data.tag]) : null]);
|
|
6528
7312
|
},
|
|
@@ -6621,32 +7405,12 @@ var badge_default = /*#__PURE__*/__webpack_require__.n(badge_);
|
|
|
6621
7405
|
"class": ["FormulaEditor-VariableList", this.selectMode && "FormulaEditor-VariableList-" + this.selectMode, this.className]
|
|
6622
7406
|
}, [this.selectMode === 'tabs' ? this.renderTab(h) : this.renderContent(h)]);
|
|
6623
7407
|
}
|
|
6624
|
-
});
|
|
6625
|
-
// CONCATENATED MODULE: ./src/components/formula/src/plugin.js
|
|
6626
|
-
/**
|
|
6627
|
-
* @file 扩展 codemirror
|
|
6628
|
-
*/
|
|
7408
|
+
});
|
|
7409
|
+
// CONCATENATED MODULE: ./src/components/formula/src/plugin.js
|
|
6629
7410
|
|
|
6630
7411
|
/**
|
|
6631
|
-
*
|
|
6632
|
-
* @param tree
|
|
6633
|
-
* @param iterator
|
|
7412
|
+
* @file 扩展 codemirror
|
|
6634
7413
|
*/
|
|
6635
|
-
function plugin_eachTree(tree, iterator, level, paths) {
|
|
6636
|
-
if (level === void 0) {
|
|
6637
|
-
level = 1;
|
|
6638
|
-
}
|
|
6639
|
-
if (paths === void 0) {
|
|
6640
|
-
paths = [];
|
|
6641
|
-
}
|
|
6642
|
-
tree.map(function (item, index) {
|
|
6643
|
-
var currentPath = paths.concat(item);
|
|
6644
|
-
iterator(item, index, level, currentPath);
|
|
6645
|
-
if (item.children && item.children.splice) {
|
|
6646
|
-
plugin_eachTree(item.children, iterator, level + 1, currentPath);
|
|
6647
|
-
}
|
|
6648
|
-
});
|
|
6649
|
-
}
|
|
6650
7414
|
function replaceStrByIndex(str, idx, key, replaceKey) {
|
|
6651
7415
|
var from = str.slice(0, idx);
|
|
6652
7416
|
var left = str.slice(idx);
|
|
@@ -6664,20 +7428,29 @@ function plugin_editorFactory(dom, cm, props) {
|
|
|
6664
7428
|
mode: props && props.evalMode ? 'text/formula' : 'text/formula-template'
|
|
6665
7429
|
});
|
|
6666
7430
|
}
|
|
6667
|
-
var
|
|
7431
|
+
var plugin_FormulaPlugin = /*#__PURE__*/function () {
|
|
6668
7432
|
function FormulaPlugin(editor, cm, getProps) {
|
|
7433
|
+
var _this = this;
|
|
6669
7434
|
this.editor = editor;
|
|
6670
7435
|
this.cm = cm;
|
|
6671
7436
|
this.getProps = getProps;
|
|
6672
|
-
|
|
7437
|
+
editor.on('change', function (editorDom) {
|
|
7438
|
+
//处理第一次初始化
|
|
7439
|
+
var val = editorDom.getDoc().getValue();
|
|
7440
|
+
var _this$getProps = _this.getProps(),
|
|
7441
|
+
value = _this$getProps.value;
|
|
7442
|
+
if (val == value) {
|
|
7443
|
+
_this.autoMarkText();
|
|
7444
|
+
}
|
|
7445
|
+
});
|
|
6673
7446
|
this.autoMarkText();
|
|
6674
7447
|
}
|
|
6675
7448
|
var _proto = FormulaPlugin.prototype;
|
|
6676
7449
|
_proto.autoMarkText = function autoMarkText() {
|
|
6677
|
-
var _this$
|
|
6678
|
-
functions = _this$
|
|
6679
|
-
variables = _this$
|
|
6680
|
-
value = _this$
|
|
7450
|
+
var _this$getProps2 = this.getProps(),
|
|
7451
|
+
functions = _this$getProps2.functions,
|
|
7452
|
+
variables = _this$getProps2.variables,
|
|
7453
|
+
value = _this$getProps2.value;
|
|
6681
7454
|
if (value) {
|
|
6682
7455
|
// todo functions 也需要自动替换
|
|
6683
7456
|
this.autoMark(variables);
|
|
@@ -6747,8 +7520,8 @@ var FormulaPlugin = /*#__PURE__*/function () {
|
|
|
6747
7520
|
};
|
|
6748
7521
|
_proto.insertContent = function insertContent(value, type) {
|
|
6749
7522
|
var from = this.editor.getCursor();
|
|
6750
|
-
var _this$
|
|
6751
|
-
evalMode = _this$
|
|
7523
|
+
var _this$getProps3 = this.getProps(),
|
|
7524
|
+
evalMode = _this$getProps3.evalMode;
|
|
6752
7525
|
if (type === 'variable') {
|
|
6753
7526
|
this.editor.replaceSelection(value.key);
|
|
6754
7527
|
var to = this.editor.getCursor();
|
|
@@ -6790,12 +7563,12 @@ var FormulaPlugin = /*#__PURE__*/function () {
|
|
|
6790
7563
|
});
|
|
6791
7564
|
};
|
|
6792
7565
|
_proto.autoMark = function autoMark(variables) {
|
|
6793
|
-
var
|
|
7566
|
+
var _this2 = this;
|
|
6794
7567
|
if (!Array.isArray(variables) || !variables.length) {
|
|
6795
7568
|
return;
|
|
6796
7569
|
}
|
|
6797
7570
|
var varMap = {};
|
|
6798
|
-
|
|
7571
|
+
eachTree(variables, function (item) {
|
|
6799
7572
|
if (item.value) {
|
|
6800
7573
|
varMap[item.value] = item.label;
|
|
6801
7574
|
}
|
|
@@ -6805,14 +7578,14 @@ var FormulaPlugin = /*#__PURE__*/function () {
|
|
|
6805
7578
|
});
|
|
6806
7579
|
var editor = this.editor;
|
|
6807
7580
|
var lines = editor.lineCount();
|
|
6808
|
-
var _this$
|
|
6809
|
-
_this$
|
|
6810
|
-
evalMode = _this$
|
|
7581
|
+
var _this$getProps4 = this.getProps(),
|
|
7582
|
+
_this$getProps4$evalM = _this$getProps4.evalMode,
|
|
7583
|
+
evalMode = _this$getProps4$evalM === void 0 ? true : _this$getProps4$evalM;
|
|
6811
7584
|
var _loop = function _loop(line) {
|
|
6812
7585
|
var content = editor.getLine(line);
|
|
6813
7586
|
// 标记方法调用
|
|
6814
7587
|
content.replace(/([A-Z]+)\s*\(/g, function (_, func, pos) {
|
|
6815
|
-
|
|
7588
|
+
_this2.markText({
|
|
6816
7589
|
line: line,
|
|
6817
7590
|
ch: pos
|
|
6818
7591
|
}, {
|
|
@@ -6830,7 +7603,7 @@ var FormulaPlugin = /*#__PURE__*/function () {
|
|
|
6830
7603
|
var encode = replaceStrByIndex(content, idx, v, REPLACE_KEY);
|
|
6831
7604
|
var reg = getRegExpByMode(evalMode, REPLACE_KEY);
|
|
6832
7605
|
if (reg.test(encode)) {
|
|
6833
|
-
|
|
7606
|
+
_this2.markText({
|
|
6834
7607
|
line: line,
|
|
6835
7608
|
ch: idx
|
|
6836
7609
|
}, {
|
|
@@ -6868,7 +7641,6 @@ function registerLaunguageMode(cm) {
|
|
|
6868
7641
|
cm.defineMode('formula', function (config, parserConfig) {
|
|
6869
7642
|
var formula = cm.getMode(config, 'javascript');
|
|
6870
7643
|
if (!parserConfig || !parserConfig.base) return formula;
|
|
6871
|
-
debugger;
|
|
6872
7644
|
return cm.multiplexingMode(cm.getMode(config, parserConfig.base), {
|
|
6873
7645
|
open: '${',
|
|
6874
7646
|
close: '}',
|
|
@@ -8427,7 +9199,7 @@ function registerLaunguageMode(cm) {
|
|
|
8427
9199
|
namespace: "其他"
|
|
8428
9200
|
}]);
|
|
8429
9201
|
// EXTERNAL MODULE: external "element-ui/lib/message"
|
|
8430
|
-
var message_ = __webpack_require__(
|
|
9202
|
+
var message_ = __webpack_require__(56);
|
|
8431
9203
|
var message_default = /*#__PURE__*/__webpack_require__.n(message_);
|
|
8432
9204
|
|
|
8433
9205
|
// CONCATENATED MODULE: ./src/components/formula/src/index.js
|
|
@@ -8440,6 +9212,8 @@ var message_default = /*#__PURE__*/__webpack_require__.n(message_);
|
|
|
8440
9212
|
|
|
8441
9213
|
|
|
8442
9214
|
|
|
9215
|
+
|
|
9216
|
+
|
|
8443
9217
|
/* harmony default export */ var formula_src = ({
|
|
8444
9218
|
name: "Formula",
|
|
8445
9219
|
componentName: "Formula",
|
|
@@ -8505,7 +9279,7 @@ var message_default = /*#__PURE__*/__webpack_require__.n(message_);
|
|
|
8505
9279
|
},
|
|
8506
9280
|
handleEditorMounted: function handleEditorMounted(cm, editor) {
|
|
8507
9281
|
var _this = this;
|
|
8508
|
-
this.editorPlugin = new
|
|
9282
|
+
this.editorPlugin = new plugin_FormulaPlugin(editor, cm, function () {
|
|
8509
9283
|
return _this.$props;
|
|
8510
9284
|
});
|
|
8511
9285
|
},
|
|
@@ -8539,6 +9313,7 @@ var message_default = /*#__PURE__*/__webpack_require__.n(message_);
|
|
|
8539
9313
|
}, 'variable');
|
|
8540
9314
|
},
|
|
8541
9315
|
handleChange: function handleChange(value) {
|
|
9316
|
+
this.$emit("input", value);
|
|
8542
9317
|
this.$emit("change", value);
|
|
8543
9318
|
},
|
|
8544
9319
|
handleFocus: function handleFocus() {
|
|
@@ -8552,6 +9327,74 @@ var message_default = /*#__PURE__*/__webpack_require__.n(message_);
|
|
|
8552
9327
|
value: "name",
|
|
8553
9328
|
label: "名称"
|
|
8554
9329
|
});
|
|
9330
|
+
},
|
|
9331
|
+
validate: function validate() {
|
|
9332
|
+
var value = this.value;
|
|
9333
|
+
try {
|
|
9334
|
+
value ? Object(formula_["parse"])(value, {
|
|
9335
|
+
evalMode: this.evalMode
|
|
9336
|
+
}) : null;
|
|
9337
|
+
} catch (e) {
|
|
9338
|
+
return "\u516C\u5F0F\u503C\u6821\u9A8C\u9519\u8BEF\uFF0C\u9519\u8BEF\u7684\u4F4D\u7F6E/\u539F\u56E0\u662F " + e.message;
|
|
9339
|
+
}
|
|
9340
|
+
return;
|
|
9341
|
+
},
|
|
9342
|
+
replaceStrByIndex: function replaceStrByIndex(str, idx, key, replaceKey) {
|
|
9343
|
+
var from = str.slice(0, idx);
|
|
9344
|
+
var left = str.slice(idx);
|
|
9345
|
+
return from + left.replace(key, replaceKey);
|
|
9346
|
+
},
|
|
9347
|
+
getRegExpByMode: function getRegExpByMode(evalMode, key) {
|
|
9348
|
+
var reg = evalMode ? "\\b" + key + "\\b" : "\\$\\{[^\\{\\}]*\\b" + key + "\\b[^\\{\\}]*\\}";
|
|
9349
|
+
return new RegExp(reg);
|
|
9350
|
+
},
|
|
9351
|
+
highlightValue: function highlightValue(value, variables, evalMode) {
|
|
9352
|
+
var _this2 = this;
|
|
9353
|
+
if (evalMode === void 0) {
|
|
9354
|
+
evalMode = true;
|
|
9355
|
+
}
|
|
9356
|
+
if (!Array.isArray(variables) || !variables.length || !value) {
|
|
9357
|
+
return;
|
|
9358
|
+
}
|
|
9359
|
+
var varMap = {};
|
|
9360
|
+
eachTree(variables, function (item) {
|
|
9361
|
+
if (item.value) {
|
|
9362
|
+
var key = item.value;
|
|
9363
|
+
varMap[key] = item.label;
|
|
9364
|
+
}
|
|
9365
|
+
});
|
|
9366
|
+
var vars = Object.keys(varMap).filter(function (item) {
|
|
9367
|
+
return item;
|
|
9368
|
+
}).sort(function (a, b) {
|
|
9369
|
+
return b.length - a.length;
|
|
9370
|
+
});
|
|
9371
|
+
var content = value || '';
|
|
9372
|
+
var html = '';
|
|
9373
|
+
|
|
9374
|
+
// 标记方法调用
|
|
9375
|
+
html = content.replace(/([A-Z]+)\s*\(/g, function (_, func, pos) {
|
|
9376
|
+
return _ && _.replace(func, "<span class=\"c-func\">" + func + "</span>");
|
|
9377
|
+
});
|
|
9378
|
+
var REPLACE_KEY = 'AMIS_FORMULA_REPLACE_KEY';
|
|
9379
|
+
vars.forEach(function (v) {
|
|
9380
|
+
var from = 0;
|
|
9381
|
+
var idx = -1;
|
|
9382
|
+
while (~(idx = content.indexOf(v, from))) {
|
|
9383
|
+
var encodeHtml = _this2.replaceStrByIndex(html, idx, v, REPLACE_KEY);
|
|
9384
|
+
var reg = _this2.getRegExpByMode(evalMode, REPLACE_KEY);
|
|
9385
|
+
|
|
9386
|
+
// 如果匹配到则高亮,没有匹配到替换成原值
|
|
9387
|
+
if (reg.test(encodeHtml)) {
|
|
9388
|
+
html = encodeHtml.replace(REPLACE_KEY, "<span class=\"c-field\">" + varMap[v] + "</span>");
|
|
9389
|
+
} else {
|
|
9390
|
+
html = encodeHtml.replace(REPLACE_KEY, v);
|
|
9391
|
+
}
|
|
9392
|
+
from = idx + v.length;
|
|
9393
|
+
}
|
|
9394
|
+
});
|
|
9395
|
+
return {
|
|
9396
|
+
html: html
|
|
9397
|
+
};
|
|
8555
9398
|
}
|
|
8556
9399
|
},
|
|
8557
9400
|
beforeDestroy: function beforeDestroy() {
|
|
@@ -8736,15 +9579,15 @@ srcvue_type_template_id_6ea89ba6_render._withStripped = true
|
|
|
8736
9579
|
// CONCATENATED MODULE: ./src/components/dialog/src/index.vue?vue&type=template&id=6ea89ba6&
|
|
8737
9580
|
|
|
8738
9581
|
// EXTERNAL MODULE: external "element-ui/src/utils/popup"
|
|
8739
|
-
var popup_ = __webpack_require__(
|
|
9582
|
+
var popup_ = __webpack_require__(17);
|
|
8740
9583
|
var popup_default = /*#__PURE__*/__webpack_require__.n(popup_);
|
|
8741
9584
|
|
|
8742
9585
|
// EXTERNAL MODULE: external "element-ui/src/mixins/migrating"
|
|
8743
|
-
var migrating_ = __webpack_require__(
|
|
9586
|
+
var migrating_ = __webpack_require__(57);
|
|
8744
9587
|
var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
|
|
8745
9588
|
|
|
8746
9589
|
// EXTERNAL MODULE: external "element-ui/src/mixins/emitter"
|
|
8747
|
-
var emitter_ = __webpack_require__(
|
|
9590
|
+
var emitter_ = __webpack_require__(18);
|
|
8748
9591
|
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
8749
9592
|
|
|
8750
9593
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dialog/src/index.vue?vue&type=script&lang=js&
|
|
@@ -8940,6 +9783,323 @@ dialog_src.install = function (Vue) {
|
|
|
8940
9783
|
Vue.component(dialog_src.name, dialog_src);
|
|
8941
9784
|
};
|
|
8942
9785
|
/* harmony default export */ var dialog = (dialog_src);
|
|
9786
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/drawer/src/index.vue?vue&type=template&id=6565c780&
|
|
9787
|
+
var srcvue_type_template_id_6565c780_render = function render() {
|
|
9788
|
+
var _vm = this,
|
|
9789
|
+
_c = _vm._self._c
|
|
9790
|
+
return _c(
|
|
9791
|
+
"transition",
|
|
9792
|
+
{
|
|
9793
|
+
attrs: { name: "el-drawer-fade" },
|
|
9794
|
+
on: { "after-enter": _vm.afterEnter, "after-leave": _vm.afterLeave },
|
|
9795
|
+
},
|
|
9796
|
+
[
|
|
9797
|
+
_c(
|
|
9798
|
+
"div",
|
|
9799
|
+
{
|
|
9800
|
+
directives: [
|
|
9801
|
+
{
|
|
9802
|
+
name: "show",
|
|
9803
|
+
rawName: "v-show",
|
|
9804
|
+
value: _vm.visible,
|
|
9805
|
+
expression: "visible",
|
|
9806
|
+
},
|
|
9807
|
+
],
|
|
9808
|
+
staticClass: "el-drawer__wrapper",
|
|
9809
|
+
attrs: { tabindex: "-1" },
|
|
9810
|
+
},
|
|
9811
|
+
[
|
|
9812
|
+
_c(
|
|
9813
|
+
"div",
|
|
9814
|
+
{
|
|
9815
|
+
staticClass: "el-drawer__container",
|
|
9816
|
+
class: _vm.visible && "el-drawer__open",
|
|
9817
|
+
attrs: { role: "document", tabindex: "-1" },
|
|
9818
|
+
on: {
|
|
9819
|
+
click: function ($event) {
|
|
9820
|
+
if ($event.target !== $event.currentTarget) return null
|
|
9821
|
+
return _vm.handleWrapperClick.apply(null, arguments)
|
|
9822
|
+
},
|
|
9823
|
+
},
|
|
9824
|
+
},
|
|
9825
|
+
[
|
|
9826
|
+
_c(
|
|
9827
|
+
"div",
|
|
9828
|
+
{
|
|
9829
|
+
ref: "drawer",
|
|
9830
|
+
staticClass: "el-drawer drawer",
|
|
9831
|
+
class: [_vm.direction, _vm.customClass],
|
|
9832
|
+
style: _vm.isHorizontal
|
|
9833
|
+
? `width: ${_vm.drawerSize}`
|
|
9834
|
+
: `height: ${_vm.drawerSize}`,
|
|
9835
|
+
attrs: {
|
|
9836
|
+
"aria-modal": "true",
|
|
9837
|
+
"aria-labelledby": "el-drawer__title",
|
|
9838
|
+
"aria-label": _vm.title,
|
|
9839
|
+
role: "dialog",
|
|
9840
|
+
tabindex: "-1",
|
|
9841
|
+
},
|
|
9842
|
+
},
|
|
9843
|
+
[
|
|
9844
|
+
_vm.withHeader
|
|
9845
|
+
? _c(
|
|
9846
|
+
"header",
|
|
9847
|
+
{
|
|
9848
|
+
staticClass: "el-drawer__header",
|
|
9849
|
+
attrs: { id: "el-drawer__title" },
|
|
9850
|
+
},
|
|
9851
|
+
[
|
|
9852
|
+
_vm._t("title", function () {
|
|
9853
|
+
return [
|
|
9854
|
+
_c(
|
|
9855
|
+
"span",
|
|
9856
|
+
{
|
|
9857
|
+
attrs: { role: "heading", title: _vm.title },
|
|
9858
|
+
},
|
|
9859
|
+
[_vm._v(_vm._s(_vm.title))]
|
|
9860
|
+
),
|
|
9861
|
+
]
|
|
9862
|
+
}),
|
|
9863
|
+
_vm.showClose
|
|
9864
|
+
? _c(
|
|
9865
|
+
"button",
|
|
9866
|
+
{
|
|
9867
|
+
staticClass: "el-drawer__close-btn",
|
|
9868
|
+
attrs: {
|
|
9869
|
+
"aria-label": `close ${
|
|
9870
|
+
_vm.title || "drawer"
|
|
9871
|
+
}`,
|
|
9872
|
+
type: "button",
|
|
9873
|
+
},
|
|
9874
|
+
on: { click: _vm.closeDrawer },
|
|
9875
|
+
},
|
|
9876
|
+
[
|
|
9877
|
+
_c("i", {
|
|
9878
|
+
staticClass:
|
|
9879
|
+
"el-dialog__close el-icon el-icon-close",
|
|
9880
|
+
}),
|
|
9881
|
+
]
|
|
9882
|
+
)
|
|
9883
|
+
: _vm._e(),
|
|
9884
|
+
],
|
|
9885
|
+
2
|
|
9886
|
+
)
|
|
9887
|
+
: _vm._e(),
|
|
9888
|
+
_vm.rendered
|
|
9889
|
+
? _c(
|
|
9890
|
+
"section",
|
|
9891
|
+
{ staticClass: "el-drawer__body" },
|
|
9892
|
+
[_vm._t("default")],
|
|
9893
|
+
2
|
|
9894
|
+
)
|
|
9895
|
+
: _vm._e(),
|
|
9896
|
+
_vm.$slots.footer
|
|
9897
|
+
? _c(
|
|
9898
|
+
"footer",
|
|
9899
|
+
{ staticClass: "el-drawer__footer" },
|
|
9900
|
+
[_vm._t("footer")],
|
|
9901
|
+
2
|
|
9902
|
+
)
|
|
9903
|
+
: _vm._e(),
|
|
9904
|
+
]
|
|
9905
|
+
),
|
|
9906
|
+
]
|
|
9907
|
+
),
|
|
9908
|
+
]
|
|
9909
|
+
),
|
|
9910
|
+
]
|
|
9911
|
+
)
|
|
9912
|
+
}
|
|
9913
|
+
var srcvue_type_template_id_6565c780_staticRenderFns = []
|
|
9914
|
+
srcvue_type_template_id_6565c780_render._withStripped = true
|
|
9915
|
+
|
|
9916
|
+
|
|
9917
|
+
// CONCATENATED MODULE: ./src/components/drawer/src/index.vue?vue&type=template&id=6565c780&
|
|
9918
|
+
|
|
9919
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/drawer/src/index.vue?vue&type=script&lang=js&
|
|
9920
|
+
|
|
9921
|
+
|
|
9922
|
+
/* harmony default export */ var drawer_srcvue_type_script_lang_js_ = ({
|
|
9923
|
+
name: 'Drawer',
|
|
9924
|
+
mixins: [popup_default.a, emitter_default.a],
|
|
9925
|
+
props: {
|
|
9926
|
+
appendToBody: {
|
|
9927
|
+
type: Boolean,
|
|
9928
|
+
default: true
|
|
9929
|
+
},
|
|
9930
|
+
beforeClose: {
|
|
9931
|
+
type: Function
|
|
9932
|
+
},
|
|
9933
|
+
customClass: {
|
|
9934
|
+
type: String,
|
|
9935
|
+
default: ''
|
|
9936
|
+
},
|
|
9937
|
+
closeOnPressEscape: {
|
|
9938
|
+
type: Boolean,
|
|
9939
|
+
default: true
|
|
9940
|
+
},
|
|
9941
|
+
destroyOnClose: {
|
|
9942
|
+
type: Boolean,
|
|
9943
|
+
default: false
|
|
9944
|
+
},
|
|
9945
|
+
modal: {
|
|
9946
|
+
type: Boolean,
|
|
9947
|
+
default: true
|
|
9948
|
+
},
|
|
9949
|
+
direction: {
|
|
9950
|
+
type: String,
|
|
9951
|
+
default: 'rtl',
|
|
9952
|
+
validator: function validator(val) {
|
|
9953
|
+
return ['ltr', 'rtl', 'ttb', 'btt'].indexOf(val) !== -1;
|
|
9954
|
+
}
|
|
9955
|
+
},
|
|
9956
|
+
modalAppendToBody: {
|
|
9957
|
+
type: Boolean,
|
|
9958
|
+
default: true
|
|
9959
|
+
},
|
|
9960
|
+
showClose: {
|
|
9961
|
+
type: Boolean,
|
|
9962
|
+
default: true
|
|
9963
|
+
},
|
|
9964
|
+
size: {
|
|
9965
|
+
type: [Number, String],
|
|
9966
|
+
default: '30%'
|
|
9967
|
+
},
|
|
9968
|
+
title: {
|
|
9969
|
+
type: String,
|
|
9970
|
+
default: ''
|
|
9971
|
+
},
|
|
9972
|
+
visible: {
|
|
9973
|
+
type: Boolean
|
|
9974
|
+
},
|
|
9975
|
+
wrapperClosable: {
|
|
9976
|
+
type: Boolean,
|
|
9977
|
+
default: true
|
|
9978
|
+
},
|
|
9979
|
+
withHeader: {
|
|
9980
|
+
type: Boolean,
|
|
9981
|
+
default: true
|
|
9982
|
+
}
|
|
9983
|
+
},
|
|
9984
|
+
computed: {
|
|
9985
|
+
isHorizontal: function isHorizontal() {
|
|
9986
|
+
return this.direction === 'rtl' || this.direction === 'ltr';
|
|
9987
|
+
},
|
|
9988
|
+
drawerSize: function drawerSize() {
|
|
9989
|
+
return typeof this.size === 'number' ? this.size + "px" : this.size;
|
|
9990
|
+
}
|
|
9991
|
+
},
|
|
9992
|
+
data: function data() {
|
|
9993
|
+
return {
|
|
9994
|
+
closed: false,
|
|
9995
|
+
prevActiveElement: null
|
|
9996
|
+
};
|
|
9997
|
+
},
|
|
9998
|
+
watch: {
|
|
9999
|
+
visible: function visible(val) {
|
|
10000
|
+
var _this = this;
|
|
10001
|
+
if (val) {
|
|
10002
|
+
this.closed = false;
|
|
10003
|
+
this.$emit('open');
|
|
10004
|
+
if (this.appendToBody) {
|
|
10005
|
+
document.body.appendChild(this.$el);
|
|
10006
|
+
}
|
|
10007
|
+
this.prevActiveElement = document.activeElement;
|
|
10008
|
+
} else {
|
|
10009
|
+
if (!this.closed) {
|
|
10010
|
+
this.$emit('close');
|
|
10011
|
+
if (this.destroyOnClose === true) {
|
|
10012
|
+
this.rendered = false;
|
|
10013
|
+
}
|
|
10014
|
+
}
|
|
10015
|
+
this.$nextTick(function () {
|
|
10016
|
+
if (_this.prevActiveElement) {
|
|
10017
|
+
_this.prevActiveElement.focus();
|
|
10018
|
+
}
|
|
10019
|
+
});
|
|
10020
|
+
}
|
|
10021
|
+
}
|
|
10022
|
+
},
|
|
10023
|
+
methods: {
|
|
10024
|
+
afterEnter: function afterEnter() {
|
|
10025
|
+
this.$emit('opened');
|
|
10026
|
+
},
|
|
10027
|
+
afterLeave: function afterLeave() {
|
|
10028
|
+
this.$emit('closed');
|
|
10029
|
+
},
|
|
10030
|
+
hide: function hide(cancel) {
|
|
10031
|
+
if (cancel !== false) {
|
|
10032
|
+
this.$emit('update:visible', false);
|
|
10033
|
+
this.$emit('close');
|
|
10034
|
+
if (this.destroyOnClose === true) {
|
|
10035
|
+
this.rendered = false;
|
|
10036
|
+
}
|
|
10037
|
+
this.closed = true;
|
|
10038
|
+
}
|
|
10039
|
+
},
|
|
10040
|
+
handleWrapperClick: function handleWrapperClick() {
|
|
10041
|
+
if (this.wrapperClosable) {
|
|
10042
|
+
this.closeDrawer();
|
|
10043
|
+
}
|
|
10044
|
+
},
|
|
10045
|
+
closeDrawer: function closeDrawer() {
|
|
10046
|
+
if (typeof this.beforeClose === 'function') {
|
|
10047
|
+
this.beforeClose(this.hide);
|
|
10048
|
+
} else {
|
|
10049
|
+
this.hide();
|
|
10050
|
+
}
|
|
10051
|
+
},
|
|
10052
|
+
handleClose: function handleClose() {
|
|
10053
|
+
// This method here will be called by PopupManger, when the `closeOnPressEscape` was set to true
|
|
10054
|
+
// pressing `ESC` will call this method, and also close the drawer.
|
|
10055
|
+
// This method also calls `beforeClose` if there was one.
|
|
10056
|
+
this.closeDrawer();
|
|
10057
|
+
}
|
|
10058
|
+
},
|
|
10059
|
+
mounted: function mounted() {
|
|
10060
|
+
if (this.visible) {
|
|
10061
|
+
this.rendered = true;
|
|
10062
|
+
this.open();
|
|
10063
|
+
if (this.appendToBody) {
|
|
10064
|
+
document.body.appendChild(this.$el);
|
|
10065
|
+
}
|
|
10066
|
+
}
|
|
10067
|
+
},
|
|
10068
|
+
destroyed: function destroyed() {
|
|
10069
|
+
// if appendToBody is true, remove DOM node after destroy
|
|
10070
|
+
if (this.appendToBody && this.$el && this.$el.parentNode) {
|
|
10071
|
+
this.$el.parentNode.removeChild(this.$el);
|
|
10072
|
+
}
|
|
10073
|
+
}
|
|
10074
|
+
});
|
|
10075
|
+
// CONCATENATED MODULE: ./src/components/drawer/src/index.vue?vue&type=script&lang=js&
|
|
10076
|
+
/* harmony default export */ var components_drawer_srcvue_type_script_lang_js_ = (drawer_srcvue_type_script_lang_js_);
|
|
10077
|
+
// CONCATENATED MODULE: ./src/components/drawer/src/index.vue
|
|
10078
|
+
|
|
10079
|
+
|
|
10080
|
+
|
|
10081
|
+
|
|
10082
|
+
|
|
10083
|
+
/* normalize component */
|
|
10084
|
+
|
|
10085
|
+
var drawer_src_component = normalizeComponent(
|
|
10086
|
+
components_drawer_srcvue_type_script_lang_js_,
|
|
10087
|
+
srcvue_type_template_id_6565c780_render,
|
|
10088
|
+
srcvue_type_template_id_6565c780_staticRenderFns,
|
|
10089
|
+
false,
|
|
10090
|
+
null,
|
|
10091
|
+
null,
|
|
10092
|
+
null
|
|
10093
|
+
|
|
10094
|
+
)
|
|
10095
|
+
|
|
10096
|
+
/* harmony default export */ var drawer_src = (drawer_src_component.exports);
|
|
10097
|
+
// CONCATENATED MODULE: ./src/components/drawer/index.js
|
|
10098
|
+
|
|
10099
|
+
drawer_src.install = function (Vue) {
|
|
10100
|
+
Vue.component(drawer_src.name, drawer_src);
|
|
10101
|
+
};
|
|
10102
|
+
/* harmony default export */ var drawer = (drawer_src);
|
|
8943
10103
|
// CONCATENATED MODULE: ./src/index.js
|
|
8944
10104
|
|
|
8945
10105
|
|
|
@@ -8956,7 +10116,10 @@ dialog_src.install = function (Vue) {
|
|
|
8956
10116
|
|
|
8957
10117
|
|
|
8958
10118
|
|
|
8959
|
-
|
|
10119
|
+
|
|
10120
|
+
|
|
10121
|
+
|
|
10122
|
+
var components = [components_form, components_form_input, components_form_item, form_group, form_dialog, form_drawer, form_view, form_view_group, form_view_dialog, components_table, components_table_column, table_search, table_editable, table_operate, crud, formula, dialog, drawer];
|
|
8960
10123
|
var install = function install(Vue, opts) {
|
|
8961
10124
|
if (opts === void 0) {
|
|
8962
10125
|
opts = {};
|
|
@@ -8983,6 +10146,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
8983
10146
|
FormItem: components_form_item,
|
|
8984
10147
|
FormGroup: form_group,
|
|
8985
10148
|
FormDialog: form_dialog,
|
|
10149
|
+
FormDrawer: form_drawer,
|
|
8986
10150
|
FormView: form_view,
|
|
8987
10151
|
FormViewGroup: form_view_group,
|
|
8988
10152
|
FormViewDialog: form_view_dialog,
|
|
@@ -8990,9 +10154,11 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
8990
10154
|
TableColumn: components_table_column,
|
|
8991
10155
|
TableSearch: table_search,
|
|
8992
10156
|
TableEditable: table_editable,
|
|
10157
|
+
TableOperate: table_operate,
|
|
8993
10158
|
Crud: crud,
|
|
8994
10159
|
Formula: formula,
|
|
8995
|
-
Dialog: dialog
|
|
10160
|
+
Dialog: dialog,
|
|
10161
|
+
Drawer: drawer
|
|
8996
10162
|
});
|
|
8997
10163
|
|
|
8998
10164
|
/***/ })
|