@idooel/components 0.0.0 → 0.0.1

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('moment'), require('@idooel/shared')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'moment', '@idooel/shared'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.__ele__components__ = {}, global.moment, global.shared));
5
- })(this, (function (exports, moment, shared) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@idooel/shared'), require('moment')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@idooel/shared', 'moment'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.__ele__umd__components__ = {}, global.shared, global.moment));
5
+ })(this, (function (exports, shared, moment) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -333,11 +333,11 @@
333
333
  /* style */
334
334
  const __vue_inject_styles__$9 = function (inject) {
335
335
  if (!inject) return
336
- inject("data-v-5fda0f1a_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
336
+ inject("data-v-560c97a2_0", { source: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", map: {"version":3,"sources":[],"names":[],"mappings":"","file":"index.vue"}, media: undefined });
337
337
 
338
338
  };
339
339
  /* scoped */
340
- const __vue_scope_id__$9 = "data-v-5fda0f1a";
340
+ const __vue_scope_id__$9 = "data-v-560c97a2";
341
341
  /* module identifier */
342
342
  const __vue_module_identifier__$9 = undefined;
343
343
  /* functional template */
@@ -425,11 +425,11 @@
425
425
  /* style */
426
426
  const __vue_inject_styles__$8 = function (inject) {
427
427
  if (!inject) return
428
- inject("data-v-5e39810d_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
428
+ inject("data-v-499435e8_0", { source: "\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["index.vue"],"names":[],"mappings":";;AAEA,oCAAoC","file":"index.vue"}, media: undefined });
429
429
 
430
430
  };
431
431
  /* scoped */
432
- const __vue_scope_id__$8 = "data-v-5e39810d";
432
+ const __vue_scope_id__$8 = "data-v-499435e8";
433
433
  /* module identifier */
434
434
  const __vue_module_identifier__$8 = undefined;
435
435
  /* functional template */
@@ -455,17 +455,638 @@
455
455
 
456
456
  __vue_component__$8.install = Vue => Vue.component(__vue_component__$8.name, __vue_component__$8);
457
457
 
458
- //
459
- //
460
- //
461
- //
462
- //
463
- //
464
- //
465
- //
466
- //
467
- //
458
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
459
+ // require the crypto API and do not support built-in fallback to lower quality random number
460
+ // generators (like Math.random()).
461
+ let getRandomValues;
462
+ const rnds8 = new Uint8Array(16);
463
+ function rng() {
464
+ // lazy load so that environments that need to polyfill have a chance to do so
465
+ if (!getRandomValues) {
466
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
467
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
468
+ if (!getRandomValues) {
469
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
470
+ }
471
+ }
472
+ return getRandomValues(rnds8);
473
+ }
474
+
475
+ var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
476
+
477
+ function validate(uuid) {
478
+ return typeof uuid === 'string' && REGEX.test(uuid);
479
+ }
480
+
481
+ /**
482
+ * Convert array of 16 byte values to UUID string format of the form:
483
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
484
+ */
468
485
 
486
+ const byteToHex = [];
487
+ for (let i = 0; i < 256; ++i) {
488
+ byteToHex.push((i + 0x100).toString(16).slice(1));
489
+ }
490
+ function unsafeStringify(arr, offset = 0) {
491
+ // Note: Be careful editing this code! It's been tuned for performance
492
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
493
+ return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
494
+ }
495
+
496
+ function parse$1(uuid) {
497
+ if (!validate(uuid)) {
498
+ throw TypeError('Invalid UUID');
499
+ }
500
+ let v;
501
+ const arr = new Uint8Array(16); // Parse ########-....-....-....-............
502
+
503
+ arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
504
+ arr[1] = v >>> 16 & 0xff;
505
+ arr[2] = v >>> 8 & 0xff;
506
+ arr[3] = v & 0xff; // Parse ........-####-....-....-............
507
+
508
+ arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
509
+ arr[5] = v & 0xff; // Parse ........-....-####-....-............
510
+
511
+ arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
512
+ arr[7] = v & 0xff; // Parse ........-....-....-####-............
513
+
514
+ arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
515
+ arr[9] = v & 0xff; // Parse ........-....-....-....-############
516
+ // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
517
+
518
+ arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
519
+ arr[11] = v / 0x100000000 & 0xff;
520
+ arr[12] = v >>> 24 & 0xff;
521
+ arr[13] = v >>> 16 & 0xff;
522
+ arr[14] = v >>> 8 & 0xff;
523
+ arr[15] = v & 0xff;
524
+ return arr;
525
+ }
526
+
527
+ function stringToBytes(str) {
528
+ str = unescape(encodeURIComponent(str)); // UTF8 escape
529
+
530
+ const bytes = [];
531
+ for (let i = 0; i < str.length; ++i) {
532
+ bytes.push(str.charCodeAt(i));
533
+ }
534
+ return bytes;
535
+ }
536
+ const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
537
+ const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
538
+ function v35(name, version, hashfunc) {
539
+ function generateUUID(value, namespace, buf, offset) {
540
+ var _namespace;
541
+ if (typeof value === 'string') {
542
+ value = stringToBytes(value);
543
+ }
544
+ if (typeof namespace === 'string') {
545
+ namespace = parse$1(namespace);
546
+ }
547
+ if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
548
+ throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
549
+ } // Compute hash of namespace and value, Per 4.3
550
+ // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
551
+ // hashfunc([...namespace, ... value])`
552
+
553
+ let bytes = new Uint8Array(16 + value.length);
554
+ bytes.set(namespace);
555
+ bytes.set(value, namespace.length);
556
+ bytes = hashfunc(bytes);
557
+ bytes[6] = bytes[6] & 0x0f | version;
558
+ bytes[8] = bytes[8] & 0x3f | 0x80;
559
+ if (buf) {
560
+ offset = offset || 0;
561
+ for (let i = 0; i < 16; ++i) {
562
+ buf[offset + i] = bytes[i];
563
+ }
564
+ return buf;
565
+ }
566
+ return unsafeStringify(bytes);
567
+ } // Function#name is not settable on some platforms (#270)
568
+
569
+ try {
570
+ generateUUID.name = name; // eslint-disable-next-line no-empty
571
+ } catch (err) {} // For CommonJS default export support
572
+
573
+ generateUUID.DNS = DNS;
574
+ generateUUID.URL = URL;
575
+ return generateUUID;
576
+ }
577
+
578
+ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
579
+ var native = {
580
+ randomUUID
581
+ };
582
+
583
+ function v4(options, buf, offset) {
584
+ if (native.randomUUID && !buf && !options) {
585
+ return native.randomUUID();
586
+ }
587
+ options = options || {};
588
+ const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
589
+
590
+ rnds[6] = rnds[6] & 0x0f | 0x40;
591
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
592
+
593
+ if (buf) {
594
+ offset = offset || 0;
595
+ for (let i = 0; i < 16; ++i) {
596
+ buf[offset + i] = rnds[i];
597
+ }
598
+ return buf;
599
+ }
600
+ return unsafeStringify(rnds);
601
+ }
602
+
603
+ // Adapted from Chris Veness' SHA1 code at
604
+ // http://www.movable-type.co.uk/scripts/sha1.html
605
+ function f(s, x, y, z) {
606
+ switch (s) {
607
+ case 0:
608
+ return x & y ^ ~x & z;
609
+ case 1:
610
+ return x ^ y ^ z;
611
+ case 2:
612
+ return x & y ^ x & z ^ y & z;
613
+ case 3:
614
+ return x ^ y ^ z;
615
+ }
616
+ }
617
+ function ROTL(x, n) {
618
+ return x << n | x >>> 32 - n;
619
+ }
620
+ function sha1(bytes) {
621
+ const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
622
+ const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
623
+ if (typeof bytes === 'string') {
624
+ const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
625
+
626
+ bytes = [];
627
+ for (let i = 0; i < msg.length; ++i) {
628
+ bytes.push(msg.charCodeAt(i));
629
+ }
630
+ } else if (!Array.isArray(bytes)) {
631
+ // Convert Array-like to Array
632
+ bytes = Array.prototype.slice.call(bytes);
633
+ }
634
+ bytes.push(0x80);
635
+ const l = bytes.length / 4 + 2;
636
+ const N = Math.ceil(l / 16);
637
+ const M = new Array(N);
638
+ for (let i = 0; i < N; ++i) {
639
+ const arr = new Uint32Array(16);
640
+ for (let j = 0; j < 16; ++j) {
641
+ arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
642
+ }
643
+ M[i] = arr;
644
+ }
645
+ M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
646
+ M[N - 1][14] = Math.floor(M[N - 1][14]);
647
+ M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
648
+ for (let i = 0; i < N; ++i) {
649
+ const W = new Uint32Array(80);
650
+ for (let t = 0; t < 16; ++t) {
651
+ W[t] = M[i][t];
652
+ }
653
+ for (let t = 16; t < 80; ++t) {
654
+ W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
655
+ }
656
+ let a = H[0];
657
+ let b = H[1];
658
+ let c = H[2];
659
+ let d = H[3];
660
+ let e = H[4];
661
+ for (let t = 0; t < 80; ++t) {
662
+ const s = Math.floor(t / 20);
663
+ const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
664
+ e = d;
665
+ d = c;
666
+ c = ROTL(b, 30) >>> 0;
667
+ b = a;
668
+ a = T;
669
+ }
670
+ H[0] = H[0] + a >>> 0;
671
+ H[1] = H[1] + b >>> 0;
672
+ H[2] = H[2] + c >>> 0;
673
+ H[3] = H[3] + d >>> 0;
674
+ H[4] = H[4] + e >>> 0;
675
+ }
676
+ return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
677
+ }
678
+
679
+ const v5 = v35('v5', 0x50, sha1);
680
+ var uuidv5 = v5;
681
+
682
+ const ESCAPE = {
683
+ "n": "\n",
684
+ "f": "\f",
685
+ "r": "\r",
686
+ "t": " ",
687
+ "v": "\v"
688
+ };
689
+ const CONSTANTS = {
690
+ "null": data => null,
691
+ "true": data => true,
692
+ "false": data => false,
693
+ "undefined": data => void 0
694
+ };
695
+ const OPERATORS = {
696
+ "+": (data, a, b) => a(data) + b(data),
697
+ "-": (data, a, b) => a(data) - b(data),
698
+ "*": (data, a, b) => a(data) * b(data),
699
+ "/": (data, a, b) => a(data) / b(data),
700
+ "%": (data, a, b) => a(data) % b(data),
701
+ "===": (data, a, b) => a(data) === b(data),
702
+ "!==": (data, a, b) => a(data) !== b(data),
703
+ "==": (data, a, b) => a(data) == b(data),
704
+ "!=": (data, a, b) => a(data) != b(data),
705
+ "<": (data, a, b) => a(data) < b(data),
706
+ ">": (data, a, b) => a(data) > b(data),
707
+ "<=": (data, a, b) => a(data) <= b(data),
708
+ ">=": (data, a, b) => a(data) >= b(data),
709
+ "&&": (data, a, b) => a(data) && b(data),
710
+ "||": (data, a, b) => a(data) || b(data),
711
+ "!": (data, a) => !a(data)
712
+ };
713
+ function isNumber(char) {
714
+ return char >= "0" && char <= "9" && typeof char === "string";
715
+ }
716
+ function isExpOperator(char) {
717
+ return char === "-" || char === "+" || isNumber(char);
718
+ }
719
+ function isIdent(char) {
720
+ return char >= "a" && char <= "z" || char >= "A" && char <= "Z" || char === "_" || char === "$";
721
+ }
722
+ class Expression {
723
+ constructor(content) {
724
+ if (!content) throw new Error("invalid expression");
725
+ this.content = content;
726
+ }
727
+ lex() {
728
+ let content = this.content;
729
+ let length = content.length;
730
+ let index = 0;
731
+ let tokens = [];
732
+ while (index < length) {
733
+ let char = content.charAt(index);
734
+ if (char === '"' || char === "'") {
735
+ let start = ++index;
736
+ let escape = false;
737
+ let value = "";
738
+ let token;
739
+ while (index < length) {
740
+ let c = content.charAt(index);
741
+ if (escape) {
742
+ if (c === "u") {
743
+ let hex = content.substring(index + 1, index + 5);
744
+ if (!hex.match(/[\da-f]{4}/i)) {
745
+ throw new Error(`invalid expression: ${content}, invalid unicode escape [\\u${hex}]`);
746
+ }
747
+ index += 4;
748
+ value += String.fromCharCode(parseInt(hex, 16));
749
+ } else {
750
+ let rep = ESCAPE[c];
751
+ value = value + (rep || c);
752
+ }
753
+ escape = false;
754
+ } else if (c === "\\") {
755
+ escape = true;
756
+ } else if (c === char) {
757
+ index++;
758
+ token = {
759
+ index: start,
760
+ constant: true,
761
+ text: char + value + char,
762
+ value
763
+ };
764
+ break;
765
+ } else {
766
+ value += c;
767
+ }
768
+ index++;
769
+ }
770
+ if (!token) {
771
+ throw new Error(`invalid expression: ${content}`);
772
+ } else {
773
+ tokens.push(token);
774
+ }
775
+ } else if (isNumber(char) || char === "." && isNumber(content.charAt(index + 1))) {
776
+ let start = index;
777
+ let value = "";
778
+ while (index < length) {
779
+ let c = content.charAt(index).toLowerCase();
780
+ if (c === "." || isNumber(c)) {
781
+ value += c;
782
+ } else {
783
+ let c2 = content.charAt(index + 1);
784
+ if (c === "e" && isExpOperator(c2)) {
785
+ value += c;
786
+ } else if (isExpOperator(c) && c2 && isNumber(c2) && value.charAt(value.length - 1) === "e") {
787
+ value += c;
788
+ } else if (isExpOperator(c) && (!c2 || !isNumber(c2)) && value.charAt(value.length - 1) == "e") {
789
+ throw new Error(`invalid expression: ${content}`);
790
+ } else {
791
+ break;
792
+ }
793
+ }
794
+ index++;
795
+ }
796
+ tokens.push({
797
+ index: start,
798
+ constant: true,
799
+ text: value,
800
+ value: Number(value)
801
+ });
802
+ } else if (isIdent(char)) {
803
+ let start = index;
804
+ while (index < length) {
805
+ let c = content.charAt(index);
806
+ if (!(isIdent(c) || isNumber(c))) {
807
+ break;
808
+ }
809
+ index++;
810
+ }
811
+ tokens.push({
812
+ index: start,
813
+ text: content.slice(start, index),
814
+ identifier: true
815
+ });
816
+ } else if ("(){}[].,:?".indexOf(char) >= 0) {
817
+ tokens.push({
818
+ index,
819
+ text: char
820
+ });
821
+ index++;
822
+ } else if (char === " " || char === "\r" || char === " " || char === "\n" || char === "\v" || char === "\xA0") {
823
+ index++;
824
+ } else {
825
+ let char2 = char + content.charAt(index + 1);
826
+ let char3 = char2 + content.charAt(index + 2);
827
+ let op1 = OPERATORS[char];
828
+ let op2 = OPERATORS[char2];
829
+ let op3 = OPERATORS[char3];
830
+ if (op1 || op2 || op3) {
831
+ let text = op3 ? char3 : op2 ? char2 : char;
832
+ tokens.push({
833
+ index,
834
+ text,
835
+ operator: true
836
+ });
837
+ index += text.length;
838
+ } else {
839
+ throw new Error(`invalid expression: ${content}`);
840
+ }
841
+ }
842
+ }
843
+ this.tokens = tokens;
844
+ return tokens;
845
+ }
846
+ parse() {
847
+ let tokens = this.lex();
848
+ let func;
849
+ let token = tokens[0];
850
+ let text = token.text;
851
+ if (tokens.length > 0 && text !== "}" && text !== ")" && text !== "]") {
852
+ func = this.expression();
853
+ }
854
+ return data => func && func(data);
855
+ }
856
+ expect(text) {
857
+ let tokens = this.tokens;
858
+ let token = tokens[0];
859
+ if (!text || text === (token && token.text)) {
860
+ return tokens.shift();
861
+ }
862
+ }
863
+ consume(text) {
864
+ if (!this.tokens.length) throw new Error(`parse expression error: ${this.content}`);
865
+ let token = this.expect(text);
866
+ if (!token) throw new Error(`parse expression error: ${this.content}`);
867
+ return token;
868
+ }
869
+ expression() {
870
+ return this.ternary();
871
+ }
872
+ ternary() {
873
+ let left = this.logicalOR();
874
+ if (this.expect("?")) {
875
+ let middle = this.expression();
876
+ this.consume(":");
877
+ let right = this.expression();
878
+ return data => left(data) ? middle(data) : right(data);
879
+ }
880
+ return left;
881
+ }
882
+ binary(left, op, right) {
883
+ let fn = OPERATORS[op];
884
+ return data => fn(data, left, right);
885
+ }
886
+ unary() {
887
+ let token;
888
+ if (this.expect("+")) {
889
+ return this.primary();
890
+ } else if (token = this.expect("-")) {
891
+ return this.binary(data => 0, token.text, this.unary());
892
+ } else if (token = this.expect("!")) {
893
+ let fn = OPERATORS[token.text];
894
+ let right = this.unary();
895
+ return data => fn(data, right);
896
+ } else {
897
+ return this.primary();
898
+ }
899
+ }
900
+ logicalOR() {
901
+ let left = this.logicalAND();
902
+ let token;
903
+ while (token = this.expect("||")) {
904
+ left = this.binary(left, token.text, this.logicalAND());
905
+ }
906
+ return left;
907
+ }
908
+ logicalAND() {
909
+ let left = this.equality();
910
+ let token;
911
+ while (token = this.expect("&&")) {
912
+ left = this.binary(left, token.text, this.equality());
913
+ }
914
+ return left;
915
+ }
916
+ equality() {
917
+ let left = this.relational();
918
+ let token;
919
+ while (token = this.expect("==") || this.expect("!=") || this.expect("===") || this.expect("!==")) {
920
+ left = this.binary(left, token.text, this.relational());
921
+ }
922
+ return left;
923
+ }
924
+ relational() {
925
+ let left = this.additive();
926
+ let token;
927
+ while (token = this.expect("<") || this.expect(">") || this.expect("<=") || this.expect(">=")) {
928
+ left = this.binary(left, token.text, this.additive());
929
+ }
930
+ return left;
931
+ }
932
+ additive() {
933
+ let left = this.multiplicative();
934
+ let token;
935
+ while (token = this.expect("+") || this.expect("-")) {
936
+ left = this.binary(left, token.text, this.multiplicative());
937
+ }
938
+ return left;
939
+ }
940
+ multiplicative() {
941
+ let left = this.unary();
942
+ let token;
943
+ while (token = this.expect("*") || this.expect("/") || this.expect("%")) {
944
+ left = this.binary(left, token.text, this.unary());
945
+ }
946
+ return left;
947
+ }
948
+ primary() {
949
+ let token = this.tokens[0];
950
+ let primary;
951
+ if (this.expect("(")) {
952
+ primary = this.expression();
953
+ this.consume(")");
954
+ } else if (this.expect("[")) {
955
+ primary = this.array();
956
+ } else if (this.expect("{")) {
957
+ primary = this.object();
958
+ } else if (token.identifier && token.text in CONSTANTS) {
959
+ primary = CONSTANTS[this.consume().text];
960
+ } else if (token.identifier) {
961
+ primary = this.identifier();
962
+ } else if (token.constant) {
963
+ primary = this.constant();
964
+ } else {
965
+ throw new Error(`parse expression error: ${this.content}`);
966
+ }
967
+ let next;
968
+ let context;
969
+ while (next = this.expect("(") || this.expect("[") || this.expect(".")) {
970
+ if (next.text === "(") {
971
+ primary = this.functionCall(primary, context);
972
+ context = null;
973
+ } else if (next.text === "[") {
974
+ context = primary;
975
+ primary = this.objectIndex(primary);
976
+ } else {
977
+ context = primary;
978
+ primary = this.fieldAccess(primary);
979
+ }
980
+ }
981
+ return primary;
982
+ }
983
+ fieldAccess(object) {
984
+ let getter = this.identifier();
985
+ return data => {
986
+ let o = object(data);
987
+ return o && getter(o);
988
+ };
989
+ }
990
+ objectIndex(object) {
991
+ let indexFn = this.expression();
992
+ this.consume("]");
993
+ return data => {
994
+ let o = object(data);
995
+ let key = indexFn(data) + "";
996
+ return o && o[key];
997
+ };
998
+ }
999
+ functionCall(func, context) {
1000
+ let args = [];
1001
+ if (this.tokens[0].text !== ")") {
1002
+ do {
1003
+ args.push(this.expression());
1004
+ } while (this.expect(","));
1005
+ }
1006
+ this.consume(")");
1007
+ return data => {
1008
+ let callContext = context && context(data);
1009
+ let fn = func(data, callContext);
1010
+ return fn && fn.apply(callContext, args.length ? args.map(arg => arg(data)) : null);
1011
+ };
1012
+ }
1013
+ array() {
1014
+ let elements = [];
1015
+ let token = this.tokens[0];
1016
+ if (token.text !== "]") {
1017
+ do {
1018
+ if (this.tokens[0].text === "]") break;
1019
+ elements.push(this.expression());
1020
+ } while (this.expect(","));
1021
+ }
1022
+ this.consume("]");
1023
+ return data => elements.map(element => element(data));
1024
+ }
1025
+ object() {
1026
+ let keys = [];
1027
+ let values = [];
1028
+ let token = this.tokens[0];
1029
+ if (token.text !== "}") {
1030
+ do {
1031
+ token = this.tokens[0];
1032
+ if (token.text === "}") break;
1033
+ token = this.consume();
1034
+ if (token.constant) {
1035
+ keys.push(token.value);
1036
+ } else if (token.identifier) {
1037
+ keys.push(token.text);
1038
+ } else {
1039
+ throw new Error(`parse expression error: ${this.content}`);
1040
+ }
1041
+ this.consume(":");
1042
+ values.push(this.expression());
1043
+ } while (this.expect(","));
1044
+ }
1045
+ this.consume("}");
1046
+ return data => {
1047
+ let object = {};
1048
+ for (let i = 0, length = values.length; i < length; i++) {
1049
+ object[keys[i]] = values[i](data);
1050
+ }
1051
+ return object;
1052
+ };
1053
+ }
1054
+ identifier() {
1055
+ let id = this.consume().text;
1056
+ let token = this.tokens[0];
1057
+ let token2 = this.tokens[1];
1058
+ let token3 = this.tokens[2];
1059
+ while (token && token.text === "." && token2 && token2.identifier && token3 && token3.text !== "(") {
1060
+ id += this.consume().text + this.consume().text;
1061
+ token = this.tokens[0];
1062
+ token2 = this.tokens[1];
1063
+ token3 = this.tokens[2];
1064
+ }
1065
+ return data => {
1066
+ let elements = id.split(".");
1067
+ let key;
1068
+ for (let i = 0; elements.length > 1; i++) {
1069
+ key = elements.shift();
1070
+ data = data[key];
1071
+ if (!data) break;
1072
+ }
1073
+ key = elements.shift();
1074
+ return data && data[key];
1075
+ };
1076
+ }
1077
+ constant() {
1078
+ let value = this.consume().value;
1079
+ return data => value;
1080
+ }
1081
+ }
1082
+ const parse = (expression, props = {}) => {
1083
+ if (!expression) throw new Error("expression is required");
1084
+ const execParse = new Expression(expression).parse();
1085
+ return execParse(props);
1086
+ };
1087
+
1088
+ //
1089
+ const MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002';
469
1090
  var script$7 = {
470
1091
  props: {
471
1092
  record: {
@@ -476,7 +1097,64 @@
476
1097
  default: () => []
477
1098
  }
478
1099
  },
1100
+ computed: {
1101
+ menuKeyDelimiter() {
1102
+ return uuidv5('_', MENU_KEY_NAMESPACE);
1103
+ }
1104
+ },
479
1105
  methods: {
1106
+ execDropdownOptExpression(dataSource = []) {
1107
+ const ret = dataSource.map(item => {
1108
+ const {
1109
+ show
1110
+ } = item;
1111
+ if (shared.type.isUndefined(show)) {
1112
+ return item;
1113
+ } else if (shared.type.isBool(show)) {
1114
+ if (show) return item;
1115
+ } else if (shared.type.isStr(show)) {
1116
+ const parseRet = parse(show, {
1117
+ ...this.record,
1118
+ _route: shared.route.searchToQueryParams(window.location.search)
1119
+ });
1120
+ if (parseRet) return item;
1121
+ }
1122
+ }).filter(item => item);
1123
+ console.log('ret', ret);
1124
+ return ret;
1125
+ },
1126
+ handleClickConfirm(props) {
1127
+ //TODO generate event by special rule
1128
+ const {
1129
+ eventName,
1130
+ value
1131
+ } = props;
1132
+ this.$emit(eventName, {
1133
+ key: value,
1134
+ record: this.record
1135
+ });
1136
+ },
1137
+ handleDropdownClick(props) {
1138
+ const {
1139
+ key
1140
+ } = props;
1141
+ const [parent, child] = key.split(this.menuKeyDelimiter);
1142
+ if (!parent || !child) {
1143
+ throw new Error('key is required');
1144
+ }
1145
+ const currentDropdown = this.dataSource.find(item => item.key === parent);
1146
+ const currentClickTarget = currentDropdown.optionList.find(item => item.value === child);
1147
+ const {
1148
+ eventName,
1149
+ type
1150
+ } = currentClickTarget;
1151
+ //TODO generate event by special rule
1152
+ if (type === 'confirm') return;
1153
+ this.$emit(eventName, {
1154
+ key: child,
1155
+ record: this.record
1156
+ });
1157
+ },
480
1158
  handleClickText(props) {
481
1159
  const {
482
1160
  eventName,
@@ -507,17 +1185,71 @@
507
1185
  { key: idx, staticClass: "table-action__item" },
508
1186
  [
509
1187
  item.type == "text"
1188
+ ? [_c("span", [_vm._v(_vm._s(item.label))])]
1189
+ : item.type == "dropdown"
510
1190
  ? [
511
1191
  _c(
512
- "span",
513
- {
514
- on: {
515
- click: function ($event) {
516
- return _vm.handleClickText(item)
1192
+ "a-dropdown",
1193
+ [
1194
+ _c(
1195
+ "a-menu",
1196
+ {
1197
+ attrs: { slot: "overlay" },
1198
+ on: { click: _vm.handleDropdownClick },
1199
+ slot: "overlay",
517
1200
  },
518
- },
519
- },
520
- [_vm._v(_vm._s(item.label))]
1201
+ _vm._l(
1202
+ _vm.execDropdownOptExpression(item.optionList),
1203
+ function (opt) {
1204
+ return _c(
1205
+ "a-menu-item",
1206
+ {
1207
+ key:
1208
+ "" +
1209
+ (item.key || "") +
1210
+ _vm.menuKeyDelimiter +
1211
+ (opt.value || ""),
1212
+ },
1213
+ [
1214
+ opt.type == "confirm"
1215
+ ? [
1216
+ _c(
1217
+ "a-popconfirm",
1218
+ {
1219
+ attrs: { title: opt.message },
1220
+ on: {
1221
+ confirm: function ($event) {
1222
+ return _vm.handleClickConfirm(opt)
1223
+ },
1224
+ },
1225
+ },
1226
+ [
1227
+ _vm._v(
1228
+ "\n " +
1229
+ _vm._s(opt.label) +
1230
+ "\n "
1231
+ ),
1232
+ ]
1233
+ ),
1234
+ ]
1235
+ : [
1236
+ _vm._v(
1237
+ "\n " +
1238
+ _vm._s(opt.label) +
1239
+ "\n "
1240
+ ),
1241
+ ],
1242
+ ],
1243
+ 2
1244
+ )
1245
+ }
1246
+ ),
1247
+ 1
1248
+ ),
1249
+ _vm._v(" "),
1250
+ _c("span", [_vm._v(_vm._s(item.label))]),
1251
+ ],
1252
+ 1
521
1253
  ),
522
1254
  ]
523
1255
  : _vm._e(),
@@ -534,11 +1266,11 @@
534
1266
  /* style */
535
1267
  const __vue_inject_styles__$7 = function (inject) {
536
1268
  if (!inject) return
537
- inject("data-v-bea55e74_0", { source: ".g-table__action[data-v-bea55e74] {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item[data-v-bea55e74] {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item[data-v-bea55e74]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/table/src/action.vue","action.vue"],"names":[],"mappings":"AA+BA;EACA,aAAA;EACA,mBAAA;AC9BA;AD+BA;EACA,eAAA;EACA,cAAA;EACA,iBAAA;EACA,eAAA;AC7BA;AD8BA;EACA,cAAA;AC5BA;;AAEA,qCAAqC","file":"action.vue","sourcesContent":["<template>\n <div class=\"g-table__action\">\n <div class=\"table-action__item\" v-for=\"(item, idx) in dataSource\" :key=\"idx\">\n <template v-if=\"item.type == 'text'\">\n <span @click=\"handleClickText(item)\">{{ item.label }}</span>\n </template>\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n record: {\n type: Object\n },\n dataSource: {\n type: Array,\n default: () => []\n }\n },\n methods: {\n handleClickText (props) {\n const { eventName, key } = props\n this.$emit(eventName, { key, record: this.record })\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-table__action {\n display: flex;\n flex-direction: row;\n .table-action__item {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n &:first-child {\n margin-left: 0;\n }\n }\n}\n</style>",".g-table__action {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */"]}, media: undefined });
1269
+ inject("data-v-675c4232_0", { source: ".g-table__action[data-v-675c4232] {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item[data-v-675c4232] {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item[data-v-675c4232]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\table\\src\\action.vue","action.vue"],"names":[],"mappings":"AA0FA;EACA,aAAA;EACA,mBAAA;ACzFA;AD0FA;EACA,eAAA;EACA,cAAA;EACA,iBAAA;EACA,eAAA;ACxFA;ADyFA;EACA,cAAA;ACvFA;;AAEA,qCAAqC","file":"action.vue","sourcesContent":["<template>\r\n <div class=\"g-table__action\">\r\n <div class=\"table-action__item\" v-for=\"(item, idx) in dataSource\" :key=\"idx\">\r\n <template v-if=\"item.type == 'text'\">\r\n <span>{{ item.label }}</span>\r\n </template>\r\n <template v-else-if=\"item.type == 'dropdown'\">\r\n <a-dropdown>\r\n <a-menu slot=\"overlay\" @click=\"handleDropdownClick\">\r\n <a-menu-item :key=\"`${item.key || ''}${menuKeyDelimiter}${opt.value || ''}`\" v-for=\"opt in execDropdownOptExpression(item.optionList)\">\r\n <template v-if=\"opt.type == 'confirm'\">\r\n <a-popconfirm :title=\"opt.message\" @confirm=\"handleClickConfirm(opt)\">\r\n {{ opt.label }}\r\n </a-popconfirm>\r\n </template>\r\n <template v-else>\r\n {{ opt.label }}\r\n </template>\r\n </a-menu-item>\r\n </a-menu>\r\n <span>{{ item.label }}</span>\r\n </a-dropdown>\r\n </template>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { v5 as uuidv5 } from 'uuid'\r\nimport { type, route } from '@idooel/shared'\r\nimport { parse } from '@idooel/expression'\r\nconst MENU_KEY_NAMESPACE = 'f7b3b8b0-1b7b-11ec-9621-0242ac130002'\r\nexport default {\r\n props: {\r\n record: {\r\n type: Object\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n }\r\n },\r\n computed: {\r\n menuKeyDelimiter () {\r\n return uuidv5('_', MENU_KEY_NAMESPACE)\r\n }\r\n },\r\n methods: {\r\n execDropdownOptExpression (dataSource = []) {\r\n const ret = dataSource.map(item => {\r\n const { show } = item\r\n if (type.isUndefined(show)) {\r\n return item\r\n } else if (type.isBool(show)) {\r\n if (show) return item\r\n } else if (type.isStr(show)) {\r\n const parseRet = parse(show, { ...this.record, _route: route.searchToQueryParams(window.location.search) })\r\n if (parseRet) return item\r\n }\r\n }).filter(item => item)\r\n console.log('ret', ret)\r\n return ret\r\n },\r\n handleClickConfirm (props) {\r\n //TODO generate event by special rule\r\n const { eventName, value } = props\r\n this.$emit(eventName, { key: value, record: this.record })\r\n },\r\n handleDropdownClick (props) {\r\n const { key } = props\r\n const [parent, child] = key.split(this.menuKeyDelimiter)\r\n if (!parent || !child) {\r\n throw new Error('key is required')\r\n }\r\n const currentDropdown = this.dataSource.find(item => item.key === parent)\r\n const currentClickTarget = currentDropdown.optionList.find(item => item.value === child)\r\n const { eventName, type } = currentClickTarget\r\n //TODO generate event by special rule\r\n if (type === 'confirm') return\r\n this.$emit(eventName, { key: child, record: this.record })\r\n },\r\n handleClickText (props) {\r\n const { eventName, key } = props\r\n this.$emit(eventName, { key, record: this.record })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-table__action {\r\n display: flex;\r\n flex-direction: row;\r\n .table-action__item {\r\n font-size: 14px;\r\n color: #409EFF;\r\n margin-left: 16px;\r\n cursor: pointer;\r\n &:first-child {\r\n margin-left: 0;\r\n }\r\n }\r\n}\r\n</style>",".g-table__action {\n display: flex;\n flex-direction: row;\n}\n.g-table__action .table-action__item {\n font-size: 14px;\n color: #409EFF;\n margin-left: 16px;\n cursor: pointer;\n}\n.g-table__action .table-action__item:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=action.vue.map */"]}, media: undefined });
538
1270
 
539
1271
  };
540
1272
  /* scoped */
541
- const __vue_scope_id__$7 = "data-v-bea55e74";
1273
+ const __vue_scope_id__$7 = "data-v-675c4232";
542
1274
  /* module identifier */
543
1275
  const __vue_module_identifier__$7 = undefined;
544
1276
  /* functional template */
@@ -677,11 +1409,11 @@
677
1409
  /* style */
678
1410
  const __vue_inject_styles__$6 = function (inject) {
679
1411
  if (!inject) return
680
- inject("data-v-baf82bc6_0", { source: ".g-table__wrapper[data-v-baf82bc6] {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper .g-table__pagination[data-v-baf82bc6] {\n margin-top: 8px;\n display: flex;\n flex-direction: row;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/table/src/index.vue","index.vue"],"names":[],"mappings":"AA4EA;EACA,aAAA;EACA,kBAAA;AC3EA;AD8EA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;AC5EA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"g-table__wrapper\">\n <a-table\n :pagination=\"false\"\n :loading=\"loading\"\n :columns=\"columns\"\n :row-class-name=\"setRowClassName\"\n :data-source=\"dataSource\"\n :scroll=\"{ x: 1500, y: 500 }\">\n <template slot=\"action\" slot-scope=\"record\">\n <Actions v-on=\"$listeners\" :data-source=\"actions\" :record=\"record\"></Actions>\n </template>\n </a-table>\n <div class=\"g-table__pagination\">\n <a-pagination\n :show-total=\"total => `共 ${total} 条数据`\"\n show-size-changer \n show-quick-jumper\n :pageSize=\"pageSize\"\n :pageSizeOptions=\"pageSizeOptions\"\n @change=\"onChangePagination\" \n :total=\"total\">\n </a-pagination>\n </div>\n </div>\n</template>\n\n<script>\nimport Actions from './action.vue'\nexport default {\n name: 'ele-table',\n components: {\n Actions\n },\n props: {\n actions: {\n type: Array,\n default: () => []\n },\n total: {\n type: Number,\n default: 0\n },\n loading: {\n type: Boolean,\n default: false\n },\n columns: {\n type: Array,\n default: () => []\n },\n dataSource: {\n type: Array,\n default: () => []\n },\n pageSize: {\n type: Number,\n default: 10\n },\n pageSizeOptions: {\n type: Array,\n default: () => ['10', '20', '30', '40']\n }\n },\n methods: {\n setRowClassName (record, idx) {\n return idx % 2 === 0 ? 'g-table__row--even' : 'g-table__row--odd'\n },\n onChangePagination (page, pagrSize) {\n this.$emit('change-page', page, pagrSize)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-table__wrapper {\n padding: 16px;\n padding-top: unset;\n .g-table__row--even {}\n .g-table__row--odd {}\n .g-table__pagination {\n margin-top: 8px;\n display: flex;\n flex-direction: row;\n justify-content: end;\n }\n}\n</style>",".g-table__wrapper {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper .g-table__pagination {\n margin-top: 8px;\n display: flex;\n flex-direction: row;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
1412
+ inject("data-v-76f50d74_0", { source: ".g-table__wrapper[data-v-76f50d74] {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper .g-table__pagination[data-v-76f50d74] {\n margin-top: 8px;\n display: flex;\n flex-direction: row;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\table\\src\\index.vue","index.vue"],"names":[],"mappings":"AA4EA;EACA,aAAA;EACA,kBAAA;AC3EA;AD8EA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,oBAAA;AC5EA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-table__wrapper\">\r\n <a-table\r\n :pagination=\"false\"\r\n :loading=\"loading\"\r\n :columns=\"columns\"\r\n :row-class-name=\"setRowClassName\"\r\n :data-source=\"dataSource\"\r\n :scroll=\"{ x: 1500, y: 500 }\">\r\n <template slot=\"action\" slot-scope=\"record\">\r\n <Actions v-on=\"$listeners\" :data-source=\"actions\" :record=\"record\"></Actions>\r\n </template>\r\n </a-table>\r\n <div class=\"g-table__pagination\">\r\n <a-pagination\r\n :show-total=\"total => `共 ${total} 条数据`\"\r\n show-size-changer \r\n show-quick-jumper\r\n :pageSize=\"pageSize\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n @change=\"onChangePagination\" \r\n :total=\"total\">\r\n </a-pagination>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport Actions from './action.vue'\r\nexport default {\r\n name: 'ele-table',\r\n components: {\r\n Actions\r\n },\r\n props: {\r\n actions: {\r\n type: Array,\r\n default: () => []\r\n },\r\n total: {\r\n type: Number,\r\n default: 0\r\n },\r\n loading: {\r\n type: Boolean,\r\n default: false\r\n },\r\n columns: {\r\n type: Array,\r\n default: () => []\r\n },\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n },\r\n pageSize: {\r\n type: Number,\r\n default: 10\r\n },\r\n pageSizeOptions: {\r\n type: Array,\r\n default: () => ['10', '20', '30', '40']\r\n }\r\n },\r\n methods: {\r\n setRowClassName (record, idx) {\r\n return idx % 2 === 0 ? 'g-table__row--even' : 'g-table__row--odd'\r\n },\r\n onChangePagination (page, pagrSize) {\r\n this.$emit('change-page', page, pagrSize)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-table__wrapper {\r\n padding: 16px;\r\n padding-top: unset;\r\n .g-table__row--even {}\r\n .g-table__row--odd {}\r\n .g-table__pagination {\r\n margin-top: 8px;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: end;\r\n }\r\n}\r\n</style>",".g-table__wrapper {\n padding: 16px;\n padding-top: unset;\n}\n.g-table__wrapper .g-table__pagination {\n margin-top: 8px;\n display: flex;\n flex-direction: row;\n justify-content: end;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
681
1413
 
682
1414
  };
683
1415
  /* scoped */
684
- const __vue_scope_id__$6 = "data-v-baf82bc6";
1416
+ const __vue_scope_id__$6 = "data-v-76f50d74";
685
1417
  /* module identifier */
686
1418
  const __vue_module_identifier__$6 = undefined;
687
1419
  /* functional template */
@@ -860,11 +1592,11 @@
860
1592
  /* style */
861
1593
  const __vue_inject_styles__$5 = function (inject) {
862
1594
  if (!inject) return
863
- inject("data-v-6969e1ac_0", { source: ".g-tree__wrapper[data-v-6969e1ac] {\n overflow: hidden;\n}\n.g-tree__wrapper[data-v-6969e1ac] .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/tree/src/index.vue","index.vue"],"names":[],"mappings":"AAwFA;EACA,gBAAA;ACvFA;ADwFA;EACA,uBAAA;EACA,gBAAA;EACA,mBAAA;ACtFA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"g-tree__wrapper\">\n <a-tree\n v-if=\"innerTreeData.length\"\n :tree-data=\"innerTreeData\"\n @select=\"selectTreeNode\"\n :replaceFields=\"replaceFields\"\n :default-expanded-keys=\"defaultExpandedKeys\"\n :default-selected-keys=\"defaultSelectedKeys\"\n blockNode \n :show-icon=\"showIcon\">\n <template #title=\"{ title }\">\n <span :title=\"title\" class=\"tree-node__title\">\n {{ title }}\n </span>\n </template>\n <template slot=\"custom\" slot-scope=\"{ scopedSlots }\">\n <a-icon :type=\"scopedSlots.iconName\"></a-icon>\n </template>\n </a-tree>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'ele-tree',\n props: {\n treeData: {\n type: Array,\n default: () => []\n },\n replaceFields: {\n type: Object,\n default: () => ({\n title: 'title',\n key: 'id',\n children: 'children'\n })\n },\n defaultExpandedKeys: {\n type: Array\n },\n defaultSelectedKeys: {\n type: Array\n },\n showIcon: {\n type: Boolean,\n default: true\n }\n },\n data () {\n return {}\n },\n computed: {\n innerTreeData () {\n return this.treeData\n // return [\n // {\n // title: 'parent 1',\n // key: 1,\n // scopedSlots: {\n // icon: 'custom',\n // iconName: 'smile-o'\n // },\n // children: [\n // {\n // title: '2',\n // key: 2,\n // scopedSlots: {\n // icon: 'custom',\n // iconName: 'frown-o'\n // }\n // }\n // ]\n // }\n // ]\n }\n },\n methods: {\n refreshTreeStatus (props = {}) {},\n selectTreeNode (selectedKeys, e) {\n this.$emit('select', selectedKeys, e)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-tree__wrapper {\n overflow: hidden;\n ::v-deep .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n}\n</style>",".g-tree__wrapper {\n overflow: hidden;\n}\n.g-tree__wrapper ::v-deep .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
1595
+ inject("data-v-712762c3_0", { source: ".g-tree__wrapper[data-v-712762c3] {\n overflow: hidden;\n}\n.g-tree__wrapper[data-v-712762c3] .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\tree\\src\\index.vue","index.vue"],"names":[],"mappings":"AAwFA;EACA,gBAAA;ACvFA;ADwFA;EACA,uBAAA;EACA,gBAAA;EACA,mBAAA;ACtFA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"g-tree__wrapper\">\r\n <a-tree\r\n v-if=\"innerTreeData.length\"\r\n :tree-data=\"innerTreeData\"\r\n @select=\"selectTreeNode\"\r\n :replaceFields=\"replaceFields\"\r\n :default-expanded-keys=\"defaultExpandedKeys\"\r\n :default-selected-keys=\"defaultSelectedKeys\"\r\n blockNode \r\n :show-icon=\"showIcon\">\r\n <template #title=\"{ title }\">\r\n <span :title=\"title\" class=\"tree-node__title\">\r\n {{ title }}\r\n </span>\r\n </template>\r\n <template slot=\"custom\" slot-scope=\"{ scopedSlots }\">\r\n <a-icon :type=\"scopedSlots.iconName\"></a-icon>\r\n </template>\r\n </a-tree>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'ele-tree',\r\n props: {\r\n treeData: {\r\n type: Array,\r\n default: () => []\r\n },\r\n replaceFields: {\r\n type: Object,\r\n default: () => ({\r\n title: 'title',\r\n key: 'id',\r\n children: 'children'\r\n })\r\n },\r\n defaultExpandedKeys: {\r\n type: Array\r\n },\r\n defaultSelectedKeys: {\r\n type: Array\r\n },\r\n showIcon: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n data () {\r\n return {}\r\n },\r\n computed: {\r\n innerTreeData () {\r\n return this.treeData\r\n // return [\r\n // {\r\n // title: 'parent 1',\r\n // key: 1,\r\n // scopedSlots: {\r\n // icon: 'custom',\r\n // iconName: 'smile-o'\r\n // },\r\n // children: [\r\n // {\r\n // title: '2',\r\n // key: 2,\r\n // scopedSlots: {\r\n // icon: 'custom',\r\n // iconName: 'frown-o'\r\n // }\r\n // }\r\n // ]\r\n // }\r\n // ]\r\n }\r\n },\r\n methods: {\r\n refreshTreeStatus (props = {}) {},\r\n selectTreeNode (selectedKeys, e) {\r\n this.$emit('select', selectedKeys, e)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-tree__wrapper {\r\n overflow: hidden;\r\n ::v-deep .ant-tree-node-content-wrapper {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n }\r\n}\r\n</style>",".g-tree__wrapper {\n overflow: hidden;\n}\n.g-tree__wrapper ::v-deep .ant-tree-node-content-wrapper {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
864
1596
 
865
1597
  };
866
1598
  /* scoped */
867
- const __vue_scope_id__$5 = "data-v-6969e1ac";
1599
+ const __vue_scope_id__$5 = "data-v-712762c3";
868
1600
  /* module identifier */
869
1601
  const __vue_module_identifier__$5 = undefined;
870
1602
  /* functional template */
@@ -926,11 +1658,11 @@
926
1658
  /* style */
927
1659
  const __vue_inject_styles__$4 = function (inject) {
928
1660
  if (!inject) return
929
- inject("data-v-07e596bf_0", { source: ".g-search__label[data-v-07e596bf] {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title[data-v-07e596bf], .g-search__label .label__suffix[data-v-07e596bf] {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix[data-v-07e596bf] {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/composite-components/search-area/src/label.vue","label.vue"],"names":[],"mappings":"AAkBA;EACA,iBAAA;EACA,gBAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;ACjBA;ADkBA;EACA,eAAA;EACA,0BAAA;EACA,mBAAA;AChBA;ADkBA;EACA,gBAAA;AChBA;;AAEA,oCAAoC","file":"label.vue","sourcesContent":["<template>\n <div class=\"g-search__label\">\n <span class=\"label__title\">{{ label }}</span>\n <span class=\"label__suffix\">:</span>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n label: {\n type: String\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.g-search__label {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n .label__title, .label__suffix {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n }\n .label__suffix {\n margin-left: 4px;\n }\n}\n</style>",".g-search__label {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title, .g-search__label .label__suffix {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */"]}, media: undefined });
1661
+ inject("data-v-40e71716_0", { source: ".g-search__label[data-v-40e71716] {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title[data-v-40e71716], .g-search__label .label__suffix[data-v-40e71716] {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix[data-v-40e71716] {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\composite-components\\search-area\\src\\label.vue","label.vue"],"names":[],"mappings":"AAkBA;EACA,iBAAA;EACA,gBAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;ACjBA;ADkBA;EACA,eAAA;EACA,0BAAA;EACA,mBAAA;AChBA;ADkBA;EACA,gBAAA;AChBA;;AAEA,oCAAoC","file":"label.vue","sourcesContent":["<template>\r\n <div class=\"g-search__label\">\r\n <span class=\"label__title\">{{ label }}</span>\r\n <span class=\"label__suffix\">:</span>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n props: {\r\n label: {\r\n type: String\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.g-search__label {\r\n /* width: 69px; */\r\n flex-basis: 69px;\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n .label__title, .label__suffix {\r\n font-size: 14px;\r\n color: rgba(0, 0, 0, 0.88);\r\n white-space: nowrap;\r\n }\r\n .label__suffix {\r\n margin-left: 4px;\r\n }\r\n}\r\n</style>",".g-search__label {\n /* width: 69px; */\n flex-basis: 69px;\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n}\n.g-search__label .label__title, .g-search__label .label__suffix {\n font-size: 14px;\n color: rgba(0, 0, 0, 0.88);\n white-space: nowrap;\n}\n.g-search__label .label__suffix {\n margin-left: 4px;\n}\n\n/*# sourceMappingURL=label.vue.map */"]}, media: undefined });
930
1662
 
931
1663
  };
932
1664
  /* scoped */
933
- const __vue_scope_id__$4 = "data-v-07e596bf";
1665
+ const __vue_scope_id__$4 = "data-v-40e71716";
934
1666
  /* module identifier */
935
1667
  const __vue_module_identifier__$4 = undefined;
936
1668
  /* functional template */
@@ -998,7 +1730,7 @@
998
1730
  this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {
999
1731
  switch (item.type) {
1000
1732
  case 'DatePicker':
1001
- ret[item.name] = moment__default["default"](item._value).isValid() ? moment__default["default"](item._value).format(item.format) : null;
1733
+ ret[item.name] = typeof item._value == 'undefined' ? undefined : moment__default["default"](item._value).format(item.format);
1002
1734
  break;
1003
1735
  default:
1004
1736
  ret[item.name] = item._value;
@@ -1014,7 +1746,7 @@
1014
1746
  this.$set(item, '_value', null);
1015
1747
  break;
1016
1748
  case 'DatePicker':
1017
- this.$set(item, '_value', null);
1749
+ this.$set(item, '_value', undefined);
1018
1750
  break;
1019
1751
  default:
1020
1752
  this.$set(item, '_value', null);
@@ -1144,11 +1876,11 @@
1144
1876
  /* style */
1145
1877
  const __vue_inject_styles__$3 = function (inject) {
1146
1878
  if (!inject) return
1147
- inject("data-v-33e73d00_0", { source: ".search-area__wrapper[data-v-33e73d00] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-33e73d00] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-33e73d00] {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/composite-components/search-area/src/index.vue","index.vue"],"names":[],"mappings":"AAgHA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;AC/GA;ADiHA;EACA,YAAA;AC/GA;ADkHA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AChHA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"search-area__wrapper\">\n <a-row :gutter=\"gutter\">\n <a-col :span=\"item.span || span\" v-for=\"(item, idx) in innerDataSource\" :key=\"idx\">\n <div v-if=\"item.type == '_action'\" class=\"search-area__item search-area--action\">\n <ele-button icon=\"search\" type=\"primary\" @click=\"handleClickSearch\">查询</ele-button>\n <ele-button style=\"margin-left:8px;\" icon=\"reload\" @click=\"handleClickReset\">重置</ele-button>\n </div>\n <div v-else class=\"search-area__item\">\n <template v-if=\"item.type == 'Input'\">\n <Label :label=\"item.label\"></Label>\n <ele-input v-model=\"item._value\"></ele-input>\n </template>\n <template v-else-if=\"item.type == 'Select'\">\n <Label :label=\"item.label\"></Label>\n <ele-select v-model=\"item._value\" :data-source=\"item.optionList\"></ele-select>\n </template>\n <template v-else-if=\"item.type == 'DatePicker'\">\n <Label :label=\"item.label\"></Label>\n <ele-date v-model=\"item._value\" :format=\"item.format\"></ele-date>\n </template>\n </div>\n </a-col>\n </a-row>\n </div>\n</template>\n\n<script>\nimport EleInput from '../../../input/src/index.vue'\nimport EleSelect from '../../../select/src/index.vue'\nimport ELeButton from '../../../button/src/index.vue'\nimport EleDate from '../../../date/src/index.vue'\nimport Label from './label.vue'\nimport moment from 'moment'\nexport default {\n name: 'ele-search-area',\n components: {\n EleInput,\n EleSelect,\n ELeButton,\n Label,\n EleDate\n },\n props: {\n gutter: {\n type: [Number, Array, Object],\n default: () => ([\n 16, 8\n ])\n },\n span: {\n type: Number,\n default: 8\n },\n dataSource: {\n type: Array,\n required: true\n }\n },\n computed: {\n actionColOffset () {\n return ((24 / this.span) - 1) * this.span\n },\n innerDataSource () {\n return [...this.dataSource, { type: '_action' }]\n }\n },\n methods: {\n handleClickSearch () {\n const querys = this.extractValues()\n this.$emit('search', querys)\n },\n extractValues () {\n let ret = {}\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\n switch (item.type) {\n case 'DatePicker':\n ret[item.name] = moment(item._value).isValid() ? moment(item._value).format(item.format) : null\n break\n default:\n ret[item.name] = item._value\n break\n }\n })\n return ret\n },\n handleClickReset () {\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\n switch (item.type) {\n case 'Select':\n this.$set(item, '_value', null)\n break\n case 'DatePicker':\n this.$set(item, '_value', null)\n break\n default:\n this.$set(item, '_value', null)\n break\n }\n })\n //TODO defaultValue\n const querys = this.extractValues()\n this.$emit('search', querys)\n },\n onChangeSelect (value, props) {\n this.$set(props, '_value', value)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n ::v-deep .ant-col {\n &:last-child {\n float: right;\n }\n }\n .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n}\n</style>",".search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper ::v-deep .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
1879
+ inject("data-v-1b430d4f_0", { source: ".search-area__wrapper[data-v-1b430d4f] {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper[data-v-1b430d4f] .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item[data-v-1b430d4f] {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\composite-components\\search-area\\src\\index.vue","index.vue"],"names":[],"mappings":"AAgHA;EACA,iBAAA;EACA,kBAAA;EACA,mBAAA;AC/GA;ADiHA;EACA,YAAA;AC/GA;ADkHA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;AChHA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"search-area__wrapper\">\r\n <a-row :gutter=\"gutter\">\r\n <a-col :span=\"item.span || span\" v-for=\"(item, idx) in innerDataSource\" :key=\"idx\">\r\n <div v-if=\"item.type == '_action'\" class=\"search-area__item search-area--action\">\r\n <ele-button icon=\"search\" type=\"primary\" @click=\"handleClickSearch\">查询</ele-button>\r\n <ele-button style=\"margin-left:8px;\" icon=\"reload\" @click=\"handleClickReset\">重置</ele-button>\r\n </div>\r\n <div v-else class=\"search-area__item\">\r\n <template v-if=\"item.type == 'Input'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-input v-model=\"item._value\"></ele-input>\r\n </template>\r\n <template v-else-if=\"item.type == 'Select'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-select v-model=\"item._value\" :data-source=\"item.optionList\"></ele-select>\r\n </template>\r\n <template v-else-if=\"item.type == 'DatePicker'\">\r\n <Label :label=\"item.label\"></Label>\r\n <ele-date v-model=\"item._value\" :format=\"item.format\"></ele-date>\r\n </template>\r\n </div>\r\n </a-col>\r\n </a-row>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleInput from '../../../input/src/index.vue'\r\nimport EleSelect from '../../../select/src/index.vue'\r\nimport ELeButton from '../../../button/src/index.vue'\r\nimport EleDate from '../../../date/src/index.vue'\r\nimport Label from './label.vue'\r\nimport moment from 'moment'\r\nexport default {\r\n name: 'ele-search-area',\r\n components: {\r\n EleInput,\r\n EleSelect,\r\n ELeButton,\r\n Label,\r\n EleDate\r\n },\r\n props: {\r\n gutter: {\r\n type: [Number, Array, Object],\r\n default: () => ([\r\n 16, 8\r\n ])\r\n },\r\n span: {\r\n type: Number,\r\n default: 8\r\n },\r\n dataSource: {\r\n type: Array,\r\n required: true\r\n }\r\n },\r\n computed: {\r\n actionColOffset () {\r\n return ((24 / this.span) - 1) * this.span\r\n },\r\n innerDataSource () {\r\n return [...this.dataSource, { type: '_action' }]\r\n }\r\n },\r\n methods: {\r\n handleClickSearch () {\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n extractValues () {\r\n let ret = {}\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n switch (item.type) {\r\n case 'DatePicker':\r\n ret[item.name] = typeof item._value == 'undefined' ? undefined : moment(item._value).format(item.format)\r\n break\r\n default:\r\n ret[item.name] = item._value\r\n break\r\n }\r\n })\r\n return ret\r\n },\r\n handleClickReset () {\r\n this.innerDataSource.filter(item => item.type !== '_action').forEach(item => {\r\n switch (item.type) {\r\n case 'Select':\r\n this.$set(item, '_value', null)\r\n break\r\n case 'DatePicker':\r\n this.$set(item, '_value', undefined)\r\n break\r\n default:\r\n this.$set(item, '_value', null)\r\n break\r\n }\r\n })\r\n //TODO defaultValue\r\n const querys = this.extractValues()\r\n this.$emit('search', querys)\r\n },\r\n onChangeSelect (value, props) {\r\n this.$set(props, '_value', value)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.search-area__wrapper {\r\n padding-top: 16px;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n ::v-deep .ant-col {\r\n &:last-child {\r\n float: right;\r\n }\r\n }\r\n .search-area__item {\r\n height: 32px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n }\r\n}\r\n</style>",".search-area__wrapper {\n padding-top: 16px;\n padding-left: 16px;\n padding-right: 16px;\n}\n.search-area__wrapper ::v-deep .ant-col:last-child {\n float: right;\n}\n.search-area__wrapper .search-area__item {\n height: 32px;\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
1148
1880
 
1149
1881
  };
1150
1882
  /* scoped */
1151
- const __vue_scope_id__$3 = "data-v-33e73d00";
1883
+ const __vue_scope_id__$3 = "data-v-1b430d4f";
1152
1884
  /* module identifier */
1153
1885
  const __vue_module_identifier__$3 = undefined;
1154
1886
  /* functional template */
@@ -1226,11 +1958,11 @@
1226
1958
  /* style */
1227
1959
  const __vue_inject_styles__$2 = function (inject) {
1228
1960
  if (!inject) return
1229
- inject("data-v-72ce5986_0", { source: ".button-group__wrapper[data-v-72ce5986] {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn[data-v-72ce5986] {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn[data-v-72ce5986]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/composite-components/button-group/src/index.vue","index.vue"],"names":[],"mappings":"AAmCA;EACA,aAAA;EACA,kBAAA;EACA,mBAAA;AClCA;ADmCA;EACA,gBAAA;ACjCA;ADkCA;EACA,cAAA;AChCA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div class=\"button-group__wrapper\">\n <ele-button \n v-for=\"(item, idx) in dataSource\" \n :type=\"item.type\"\n :icon=\"item.icon\"\n @click=\"handleClick(item)\" \n :key=\"idx\">\n {{ item.label }}\n </ele-button>\n </div>\n</template>\n\n<script>\nimport EleButton from '../../../button/src/index.vue'\nexport default {\n name: 'ele-button-group',\n components: {\n EleButton\n },\n props: {\n dataSource: {\n type: Array,\n default: () => []\n }\n },\n methods: {\n handleClick (props) {\n this.$emit('click', props)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.button-group__wrapper {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n .ant-btn {\n margin-left: 8px;\n &:first-child {\n margin-left: 0;\n }\n }\n}\n</style>",".button-group__wrapper {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
1961
+ inject("data-v-09a1629e_0", { source: ".button-group__wrapper[data-v-09a1629e] {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn[data-v-09a1629e] {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn[data-v-09a1629e]:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\composite-components\\button-group\\src\\index.vue","index.vue"],"names":[],"mappings":"AAmCA;EACA,aAAA;EACA,kBAAA;EACA,mBAAA;AClCA;ADmCA;EACA,gBAAA;ACjCA;ADkCA;EACA,cAAA;AChCA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div class=\"button-group__wrapper\">\r\n <ele-button \r\n v-for=\"(item, idx) in dataSource\" \r\n :type=\"item.type\"\r\n :icon=\"item.icon\"\r\n @click=\"handleClick(item)\" \r\n :key=\"idx\">\r\n {{ item.label }}\r\n </ele-button>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport EleButton from '../../../button/src/index.vue'\r\nexport default {\r\n name: 'ele-button-group',\r\n components: {\r\n EleButton\r\n },\r\n props: {\r\n dataSource: {\r\n type: Array,\r\n default: () => []\r\n }\r\n },\r\n methods: {\r\n handleClick (props) {\r\n this.$emit('click', props)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.button-group__wrapper {\r\n display: flex;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n .ant-btn {\r\n margin-left: 8px;\r\n &:first-child {\r\n margin-left: 0;\r\n }\r\n }\r\n}\r\n</style>",".button-group__wrapper {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n}\n.button-group__wrapper .ant-btn {\n margin-left: 8px;\n}\n.button-group__wrapper .ant-btn:first-child {\n margin-left: 0;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
1230
1962
 
1231
1963
  };
1232
1964
  /* scoped */
1233
- const __vue_scope_id__$2 = "data-v-72ce5986";
1965
+ const __vue_scope_id__$2 = "data-v-09a1629e";
1234
1966
  /* module identifier */
1235
1967
  const __vue_module_identifier__$2 = undefined;
1236
1968
  /* functional template */
@@ -1254,63 +1986,6 @@
1254
1986
  undefined
1255
1987
  );
1256
1988
 
1257
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
1258
- // require the crypto API and do not support built-in fallback to lower quality random number
1259
- // generators (like Math.random()).
1260
- let getRandomValues;
1261
- const rnds8 = new Uint8Array(16);
1262
- function rng() {
1263
- // lazy load so that environments that need to polyfill have a chance to do so
1264
- if (!getRandomValues) {
1265
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
1266
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
1267
- if (!getRandomValues) {
1268
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1269
- }
1270
- }
1271
- return getRandomValues(rnds8);
1272
- }
1273
-
1274
- /**
1275
- * Convert array of 16 byte values to UUID string format of the form:
1276
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1277
- */
1278
-
1279
- const byteToHex = [];
1280
- for (let i = 0; i < 256; ++i) {
1281
- byteToHex.push((i + 0x100).toString(16).slice(1));
1282
- }
1283
- function unsafeStringify(arr, offset = 0) {
1284
- // Note: Be careful editing this code! It's been tuned for performance
1285
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1286
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
1287
- }
1288
-
1289
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1290
- var native = {
1291
- randomUUID
1292
- };
1293
-
1294
- function v4(options, buf, offset) {
1295
- if (native.randomUUID && !buf && !options) {
1296
- return native.randomUUID();
1297
- }
1298
- options = options || {};
1299
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1300
-
1301
- rnds[6] = rnds[6] & 0x0f | 0x40;
1302
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1303
-
1304
- if (buf) {
1305
- offset = offset || 0;
1306
- for (let i = 0; i < 16; ++i) {
1307
- buf[offset + i] = rnds[i];
1308
- }
1309
- return buf;
1310
- }
1311
- return unsafeStringify(rnds);
1312
- }
1313
-
1314
1989
  //
1315
1990
  var script$1 = {
1316
1991
  name: 'ele-tree-table-model',
@@ -1658,11 +2333,11 @@
1658
2333
  /* style */
1659
2334
  const __vue_inject_styles__$1 = function (inject) {
1660
2335
  if (!inject) return
1661
- inject("data-v-47f01802_0", { source: ".model__tree-table[data-v-47f01802] {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.model__tree-table .model__tree--wrapper[data-v-47f01802] {\n width: 240px;\n background: #fff;\n flex-shrink: 0;\n padding: 16px;\n box-sizing: border-box;\n margin-right: 16px;\n overflow-y: auto;\n}\n.model__tree-table .model__table--wrapper[data-v-47f01802] {\n min-width: 0;\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["/Users/huangshan/Goldgov/front/ganjiao/base-elearning-frontend-model/packages/components/packages/tree-table-model/src/index.vue","index.vue"],"names":[],"mappings":"AA8QA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;AC7QA;AD8QA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;AC5QA;AD8QA;EACA,YAAA;EACA,gBAAA;AC5QA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <section class=\"model__tree-table\">\n <section :ref=\"modelTreeWrapper\" class=\"model__tree--wrapper\">\n <ele-tree \n :tree-data=\"treeData\"\n :defaultExpandedKeys=\"defaultExpandedKeys\"\n :defaultSelectedKeys=\"defaultSelectedKeys\"\n @select=\"selectTreeNode\"\n :replace-fields=\"treeMeta.replaceFields || replaceFields\">\n </ele-tree>\n </section>\n <section :ref=\"modelTableWrapper\" class=\"model__table--wrapper\">\n <ele-search-area :ref=\"searchArea\" @search=\"onSearch\" :data-source=\"searchMeta.elements\"></ele-search-area>\n <ele-button-group :ref=\"buttonGroup\" @click=\"handleClickButtonGroup\" style=\"margin-top: 16px\" :data-source=\"getButtonGroupElements\"></ele-button-group>\n <ele-table\n v-on=\"$listeners\"\n :loading=\"loading\" \n :columns=\"columns\"\n :total=\"total\"\n :actions=\"actions\"\n :pageSize=\"pageSize\"\n :pageSizeOptions=\"pageSizeOptions\"\n :data-source=\"tableData\"\n @change-page=\"onChangePage\" \n style=\"margin-top: 8px;\"\n ></ele-table>\n </section>\n </section>\n</template>\n\n<script>\nimport EleTree from '../../tree/src/index.vue'\nimport EleTable from '../../table/src/index.vue'\nimport EleSearchArea from '../../composite-components/search-area/src/index.vue'\nimport EleButtonGroup from '../../composite-components/button-group/src/index.vue'\nimport { type, net } from '@idooel/shared'\nimport { v4 as uuidv4 } from 'uuid'\nexport default {\n name: 'ele-tree-table-model',\n components: {\n EleTree,\n EleTable,\n EleSearchArea,\n EleButtonGroup\n },\n props: {\n treeMeta: {\n type: Object,\n default: () => ({})\n },\n searchMeta: {\n type: Object,\n default: () => ({})\n },\n buttonGroupMeta: {\n typeof: Object,\n default: () => ({})\n },\n tableMeta: {\n type: Object,\n default: () => ({})\n }\n },\n data () {\n return {\n treeData: [],\n tableData: [],\n defaultExpandedKeys: [],\n defaultSelectedKeys: [],\n replaceFields: {\n title: 'title',\n children: 'children',\n key: 'id'\n },\n loading: false,\n total: 0,\n tableQuerys: {},\n resizeObserverModelTableWrapper: null,\n modelTableWrapperHeight: 0,\n currentTreeNodeData: {}\n }\n },\n computed: {\n buttonGroup () {\n return uuidv4()\n },\n searchArea () {\n return uuidv4()\n },\n modelTreeWrapper () {\n return uuidv4()\n },\n modelTableWrapper () {\n return uuidv4()\n },\n actions () {\n const { operations } = this.tableMeta\n return operations.elements\n },\n pageSize () {\n const { page = {} } = this.tableMeta\n return page.pageSize || 10\n },\n pageSizeOptions () {\n const { page = {} } = this.tableMeta\n return page.pageSizeOptions || ['10', '20', '30', '40']\n },\n columns () {\n const { columns, operations } = this.tableMeta\n if (type.get(columns) === 'array') {\n const columnsOptions = columns.map(item => {\n if (item.render) {\n return {\n title: item.title,\n dataIndex: item.dataIndex,\n width: item.width,\n align: item.align,\n fixed: item.fixed,\n customRender: (text, record, index) => {\n const { $createElement } = this\n return item.render.call(this, { h: $createElement, ctx: this }, typeof text == 'string' ? text : text[item.dataIndex], record, index)\n }\n }\n }\n return {\n title: item.title,\n dataIndex: item.dataIndex,\n width: item.width,\n align: item.align,\n fixed: item.fixed\n }\n })\n if (operations) {\n return [\n ...columnsOptions,\n {\n title: '操作',\n width: operations.width,\n key: 'action',\n fixed: 'right',\n scopedSlots: { customRender: 'action' }\n }\n ]\n }\n return columnsOptions\n } else {\n console.error('Error: columns is invalid, please check it')\n return []\n }\n },\n getButtonGroupElements () {\n const { elements } = this.buttonGroupMeta\n if (type.get(elements) === 'function') {\n return elements.call(this)\n } else if (type.get(elements) === 'array') {\n return elements\n } else {\n return []\n }\n }\n },\n async created () {\n this.treeData = await this.requestTreeData()\n const [defaultTreeNode = {}] = this.treeData\n this.defaultExpandedKeys = [defaultTreeNode[this.replaceFields.key]]\n this.defaultSelectedKeys = [defaultTreeNode[this.replaceFields.key]]\n const { fieldMap } = this.tableMeta\n this.currentTreeNodeData = defaultTreeNode\n this.tableData = await this.requestTableData(this.execTableFieldMap(fieldMap, defaultTreeNode))\n },\n methods: {\n handleClickButtonGroup (props) {\n const { eventName } = props\n this.$emit(eventName, { currentTreeNode: this.currentTreeNodeData })\n },\n watchViewPort () {\n const modelTableWrapper = this.$refs[this.modelTableWrapper]\n console.log(modelTableWrapper.getBoundingClientRect())\n const { top } = modelTableWrapper.getBoundingClientRect()\n this.$refs[this.modelTreeWrapper].style.height = `calc(100vh - ${top}px)`\n },\n async onSearch (props) {\n this.tableQuerys = Object.assign(this.tableQuerys, props)\n this.tableData = await this.requestTableData()\n },\n execTableFieldMap (fieldMap = {}, props) {\n let ret = {}\n const keys = Object.keys(fieldMap)\n keys.forEach(key => {\n const field = fieldMap[key]\n ret[field] = props[key]\n })\n return ret\n },\n async selectTreeNode (selectedKeys, e) {\n const { fieldMap } = this.tableMeta\n this.currentTreeNodeData = e.node.$vnode.data.props.dataRef\n const execFieldMapRet = this.execTableFieldMap(fieldMap, e.node.$vnode.data.props.dataRef)\n this.tableData = await this.requestTableData(execFieldMapRet)\n },\n async requestTreeData () {\n const { url, requestType } = this.treeMeta\n const ret = await net.get(\n url\n ).then(resp => {\n const { data } = resp || {}\n return data\n })\n return ret\n },\n async onChangePage (page, pageSize) {\n this.tableData = await this.requestTableData({ currentPage: page, pageSize })\n },\n async requestTableData (props = {}) {\n const { url, requestType, page = {} } = this.tableMeta\n const { pageSize = 10 } = page\n this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: 1, pageSize }, props)\n const ret = await net.get(\n url,\n this.tableQuerys\n ).then(resp => {\n const { data = [], count } = resp || {}\n this.total = count\n return data.map(item => {\n return {\n key: uuidv4(),\n ...item\n }\n })\n })\n return ret\n },\n refreshTreeStatus (props = {}) {},\n refreshTableStatus (props = {}) {},\n getModelTableWrapperHeight () {},\n setModelTreeWrapperHeight (height) {\n this.$refs[this.modelTreeWrapper].style.height = height\n },\n setModelTableWrapperHeight () {\n const { top } = this.$refs[this.modelTableWrapper].getBoundingClientRect()\n const height = `calc(100vh - ${top}px)`\n this.$refs[this.modelTableWrapper].style.height = height\n this.setModelTreeWrapperHeight(height)\n },\n getSearchAreaHeight () {\n return this.$refs[this.searchArea].$el.clientHeight\n },\n getButtonGroupHeight () {\n return this.$refs[this.buttonGroup].$el.clientHeight\n }\n },\n mounted () {\n //TODO\n // this.setModelTableWrapperHeight()\n // this.resizeObserverModelTableWrapper = new ResizeObserver(entries => {\n // for (let entry of entries) {\n // this.modelTableWrapperHeight = entry.contentRect.height\n // console.log('this.modelTableWrapperHeight:', this.modelTableWrapperHeight)\n // console.log('getSearchAreaHeight', this.getSearchAreaHeight())\n // console.log('getButtonGroupHeight', this.getButtonGroupHeight())\n // const tableHeight = this.modelTableWrapperHeight - this.getSearchAreaHeight() - this.getButtonGroupHeight()\n // console.log('tableHeight', tableHeight)\n // }\n // })\n // this.resizeObserverModelTableWrapper.observe(this.$refs[this.modelTableWrapper])\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.model__tree-table {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n .model__tree--wrapper {\n width: 240px;\n background: #fff;\n flex-shrink: 0;\n padding: 16px;\n box-sizing: border-box;\n margin-right: 16px;\n overflow-y: auto;\n }\n .model__table--wrapper {\n min-width: 0;\n background: #fff;\n }\n}\n</style>",".model__tree-table {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.model__tree-table .model__tree--wrapper {\n width: 240px;\n background: #fff;\n flex-shrink: 0;\n padding: 16px;\n box-sizing: border-box;\n margin-right: 16px;\n overflow-y: auto;\n}\n.model__tree-table .model__table--wrapper {\n min-width: 0;\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
2336
+ inject("data-v-3d8af946_0", { source: ".model__tree-table[data-v-3d8af946] {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.model__tree-table .model__tree--wrapper[data-v-3d8af946] {\n width: 240px;\n background: #fff;\n flex-shrink: 0;\n padding: 16px;\n box-sizing: border-box;\n margin-right: 16px;\n overflow-y: auto;\n}\n.model__tree-table .model__table--wrapper[data-v-3d8af946] {\n min-width: 0;\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["E:\\work\\code\\ganjiao\\ganjian-monorepo\\packages\\components\\packages\\tree-table-model\\src\\index.vue","index.vue"],"names":[],"mappings":"AA8QA;EACA,uBAAA;EACA,aAAA;EACA,mBAAA;EACA,WAAA;AC7QA;AD8QA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,sBAAA;EACA,kBAAA;EACA,gBAAA;AC5QA;AD8QA;EACA,YAAA;EACA,gBAAA;AC5QA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <section class=\"model__tree-table\">\r\n <section :ref=\"modelTreeWrapper\" class=\"model__tree--wrapper\">\r\n <ele-tree \r\n :tree-data=\"treeData\"\r\n :defaultExpandedKeys=\"defaultExpandedKeys\"\r\n :defaultSelectedKeys=\"defaultSelectedKeys\"\r\n @select=\"selectTreeNode\"\r\n :replace-fields=\"treeMeta.replaceFields || replaceFields\">\r\n </ele-tree>\r\n </section>\r\n <section :ref=\"modelTableWrapper\" class=\"model__table--wrapper\">\r\n <ele-search-area :ref=\"searchArea\" @search=\"onSearch\" :data-source=\"searchMeta.elements\"></ele-search-area>\r\n <ele-button-group :ref=\"buttonGroup\" @click=\"handleClickButtonGroup\" style=\"margin-top: 16px\" :data-source=\"getButtonGroupElements\"></ele-button-group>\r\n <ele-table\r\n v-on=\"$listeners\"\r\n :loading=\"loading\" \r\n :columns=\"columns\"\r\n :total=\"total\"\r\n :actions=\"actions\"\r\n :pageSize=\"pageSize\"\r\n :pageSizeOptions=\"pageSizeOptions\"\r\n :data-source=\"tableData\"\r\n @change-page=\"onChangePage\" \r\n style=\"margin-top: 8px;\"\r\n ></ele-table>\r\n </section>\r\n </section>\r\n</template>\r\n\r\n<script>\r\nimport EleTree from '../../tree/src/index.vue'\r\nimport EleTable from '../../table/src/index.vue'\r\nimport EleSearchArea from '../../composite-components/search-area/src/index.vue'\r\nimport EleButtonGroup from '../../composite-components/button-group/src/index.vue'\r\nimport { type, net } from '@idooel/shared'\r\nimport { v4 as uuidv4 } from 'uuid'\r\nexport default {\r\n name: 'ele-tree-table-model',\r\n components: {\r\n EleTree,\r\n EleTable,\r\n EleSearchArea,\r\n EleButtonGroup\r\n },\r\n props: {\r\n treeMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n searchMeta: {\r\n type: Object,\r\n default: () => ({})\r\n },\r\n buttonGroupMeta: {\r\n typeof: Object,\r\n default: () => ({})\r\n },\r\n tableMeta: {\r\n type: Object,\r\n default: () => ({})\r\n }\r\n },\r\n data () {\r\n return {\r\n treeData: [],\r\n tableData: [],\r\n defaultExpandedKeys: [],\r\n defaultSelectedKeys: [],\r\n replaceFields: {\r\n title: 'title',\r\n children: 'children',\r\n key: 'id'\r\n },\r\n loading: false,\r\n total: 0,\r\n tableQuerys: {},\r\n resizeObserverModelTableWrapper: null,\r\n modelTableWrapperHeight: 0,\r\n currentTreeNodeData: {}\r\n }\r\n },\r\n computed: {\r\n buttonGroup () {\r\n return uuidv4()\r\n },\r\n searchArea () {\r\n return uuidv4()\r\n },\r\n modelTreeWrapper () {\r\n return uuidv4()\r\n },\r\n modelTableWrapper () {\r\n return uuidv4()\r\n },\r\n actions () {\r\n const { operations } = this.tableMeta\r\n return operations.elements\r\n },\r\n pageSize () {\r\n const { page = {} } = this.tableMeta\r\n return page.pageSize || 10\r\n },\r\n pageSizeOptions () {\r\n const { page = {} } = this.tableMeta\r\n return page.pageSizeOptions || ['10', '20', '30', '40']\r\n },\r\n columns () {\r\n const { columns, operations } = this.tableMeta\r\n if (type.get(columns) === 'array') {\r\n const columnsOptions = columns.map(item => {\r\n if (item.render) {\r\n return {\r\n title: item.title,\r\n dataIndex: item.dataIndex,\r\n width: item.width,\r\n align: item.align,\r\n fixed: item.fixed,\r\n customRender: (text, record, index) => {\r\n const { $createElement } = this\r\n return item.render.call(this, { h: $createElement, ctx: this }, typeof text == 'string' ? text : text[item.dataIndex], record, index)\r\n }\r\n }\r\n }\r\n return {\r\n title: item.title,\r\n dataIndex: item.dataIndex,\r\n width: item.width,\r\n align: item.align,\r\n fixed: item.fixed\r\n }\r\n })\r\n if (operations) {\r\n return [\r\n ...columnsOptions,\r\n {\r\n title: '操作',\r\n width: operations.width,\r\n key: 'action',\r\n fixed: 'right',\r\n scopedSlots: { customRender: 'action' }\r\n }\r\n ]\r\n }\r\n return columnsOptions\r\n } else {\r\n console.error('Error: columns is invalid, please check it')\r\n return []\r\n }\r\n },\r\n getButtonGroupElements () {\r\n const { elements } = this.buttonGroupMeta\r\n if (type.get(elements) === 'function') {\r\n return elements.call(this)\r\n } else if (type.get(elements) === 'array') {\r\n return elements\r\n } else {\r\n return []\r\n }\r\n }\r\n },\r\n async created () {\r\n this.treeData = await this.requestTreeData()\r\n const [defaultTreeNode = {}] = this.treeData\r\n this.defaultExpandedKeys = [defaultTreeNode[this.replaceFields.key]]\r\n this.defaultSelectedKeys = [defaultTreeNode[this.replaceFields.key]]\r\n const { fieldMap } = this.tableMeta\r\n this.currentTreeNodeData = defaultTreeNode\r\n this.tableData = await this.requestTableData(this.execTableFieldMap(fieldMap, defaultTreeNode))\r\n },\r\n methods: {\r\n handleClickButtonGroup (props) {\r\n const { eventName } = props\r\n this.$emit(eventName, { currentTreeNode: this.currentTreeNodeData })\r\n },\r\n watchViewPort () {\r\n const modelTableWrapper = this.$refs[this.modelTableWrapper]\r\n console.log(modelTableWrapper.getBoundingClientRect())\r\n const { top } = modelTableWrapper.getBoundingClientRect()\r\n this.$refs[this.modelTreeWrapper].style.height = `calc(100vh - ${top}px)`\r\n },\r\n async onSearch (props) {\r\n this.tableQuerys = Object.assign(this.tableQuerys, props)\r\n this.tableData = await this.requestTableData()\r\n },\r\n execTableFieldMap (fieldMap = {}, props) {\r\n let ret = {}\r\n const keys = Object.keys(fieldMap)\r\n keys.forEach(key => {\r\n const field = fieldMap[key]\r\n ret[field] = props[key]\r\n })\r\n return ret\r\n },\r\n async selectTreeNode (selectedKeys, e) {\r\n const { fieldMap } = this.tableMeta\r\n this.currentTreeNodeData = e.node.$vnode.data.props.dataRef\r\n const execFieldMapRet = this.execTableFieldMap(fieldMap, e.node.$vnode.data.props.dataRef)\r\n this.tableData = await this.requestTableData(execFieldMapRet)\r\n },\r\n async requestTreeData () {\r\n const { url, requestType } = this.treeMeta\r\n const ret = await net.get(\r\n url\r\n ).then(resp => {\r\n const { data } = resp || {}\r\n return data\r\n })\r\n return ret\r\n },\r\n async onChangePage (page, pageSize) {\r\n this.tableData = await this.requestTableData({ currentPage: page, pageSize })\r\n },\r\n async requestTableData (props = {}) {\r\n const { url, requestType, page = {} } = this.tableMeta\r\n const { pageSize = 10 } = page\r\n this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: 1, pageSize }, props)\r\n const ret = await net.get(\r\n url,\r\n this.tableQuerys\r\n ).then(resp => {\r\n const { data = [], count } = resp || {}\r\n this.total = count\r\n return data.map(item => {\r\n return {\r\n key: uuidv4(),\r\n ...item\r\n }\r\n })\r\n })\r\n return ret\r\n },\r\n refreshTreeStatus (props = {}) {},\r\n refreshTableStatus (props = {}) {},\r\n getModelTableWrapperHeight () {},\r\n setModelTreeWrapperHeight (height) {\r\n this.$refs[this.modelTreeWrapper].style.height = height\r\n },\r\n setModelTableWrapperHeight () {\r\n const { top } = this.$refs[this.modelTableWrapper].getBoundingClientRect()\r\n const height = `calc(100vh - ${top}px)`\r\n this.$refs[this.modelTableWrapper].style.height = height\r\n this.setModelTreeWrapperHeight(height)\r\n },\r\n getSearchAreaHeight () {\r\n return this.$refs[this.searchArea].$el.clientHeight\r\n },\r\n getButtonGroupHeight () {\r\n return this.$refs[this.buttonGroup].$el.clientHeight\r\n }\r\n },\r\n mounted () {\r\n //TODO\r\n // this.setModelTableWrapperHeight()\r\n // this.resizeObserverModelTableWrapper = new ResizeObserver(entries => {\r\n // for (let entry of entries) {\r\n // this.modelTableWrapperHeight = entry.contentRect.height\r\n // console.log('this.modelTableWrapperHeight:', this.modelTableWrapperHeight)\r\n // console.log('getSearchAreaHeight', this.getSearchAreaHeight())\r\n // console.log('getButtonGroupHeight', this.getButtonGroupHeight())\r\n // const tableHeight = this.modelTableWrapperHeight - this.getSearchAreaHeight() - this.getButtonGroupHeight()\r\n // console.log('tableHeight', tableHeight)\r\n // }\r\n // })\r\n // this.resizeObserverModelTableWrapper.observe(this.$refs[this.modelTableWrapper])\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.model__tree-table {\r\n background: transparent;\r\n display: flex;\r\n flex-direction: row;\r\n width: 100%;\r\n .model__tree--wrapper {\r\n width: 240px;\r\n background: #fff;\r\n flex-shrink: 0;\r\n padding: 16px;\r\n box-sizing: border-box;\r\n margin-right: 16px;\r\n overflow-y: auto;\r\n }\r\n .model__table--wrapper {\r\n min-width: 0;\r\n background: #fff;\r\n }\r\n}\r\n</style>",".model__tree-table {\n background: transparent;\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.model__tree-table .model__tree--wrapper {\n width: 240px;\n background: #fff;\n flex-shrink: 0;\n padding: 16px;\n box-sizing: border-box;\n margin-right: 16px;\n overflow-y: auto;\n}\n.model__tree-table .model__table--wrapper {\n min-width: 0;\n background: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
1662
2337
 
1663
2338
  };
1664
2339
  /* scoped */
1665
- const __vue_scope_id__$1 = "data-v-47f01802";
2340
+ const __vue_scope_id__$1 = "data-v-3d8af946";
1666
2341
  /* module identifier */
1667
2342
  const __vue_module_identifier__$1 = undefined;
1668
2343
  /* functional template */
@@ -1698,6 +2373,13 @@
1698
2373
  [__vue_component__$1.name]: __vue_component__$1
1699
2374
  },
1700
2375
  computed: {
2376
+ modelNameValidator() {
2377
+ const target = models.find(model => model.name === this.modelName);
2378
+ return {
2379
+ existed: !!target,
2380
+ message: !!target ? '' : `Model <span style="color:red;">${this.modelName}</span> not found`
2381
+ };
2382
+ },
1701
2383
  genModelRef() {
1702
2384
  return v4();
1703
2385
  }
@@ -1717,7 +2399,7 @@
1717
2399
  var _vm = this;
1718
2400
  var _h = _vm.$createElement;
1719
2401
  var _c = _vm._self._c || _h;
1720
- return _vm.modelName
2402
+ return _vm.modelNameValidator.existed
1721
2403
  ? _c(
1722
2404
  _vm.modelName,
1723
2405
  _vm._g(
@@ -1747,7 +2429,9 @@
1747
2429
  _vm.$listeners
1748
2430
  )
1749
2431
  )
1750
- : _c("div", [_vm._v("未正确配置模版")])
2432
+ : _c("div", {
2433
+ domProps: { innerHTML: _vm._s(_vm.modelNameValidator.message) },
2434
+ })
1751
2435
  };
1752
2436
  var __vue_staticRenderFns__ = [];
1753
2437
  __vue_render__._withStripped = true;
@@ -1805,8 +2489,10 @@
1805
2489
  exports.EleInput = __vue_component__$9;
1806
2490
  exports.EleSelect = __vue_component__$8;
1807
2491
  exports.EleTable = __vue_component__$6;
2492
+ exports.EleTpl = __vue_component__;
1808
2493
  exports.EleTree = __vue_component__$5;
1809
2494
  exports["default"] = install;
2495
+ exports.models = models;
1810
2496
 
1811
2497
  Object.defineProperty(exports, '__esModule', { value: true });
1812
2498