cy-element-ui 1.0.41 → 1.0.43

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.
Files changed (101) hide show
  1. package/lib/alert.js +2 -2
  2. package/lib/aside.js +2 -2
  3. package/lib/autocomplete.js +2 -4
  4. package/lib/avatar.js +2 -2
  5. package/lib/backtop.js +2 -2
  6. package/lib/badge.js +2 -2
  7. package/lib/breadcrumb-item.js +2 -2
  8. package/lib/breadcrumb.js +2 -2
  9. package/lib/calendar.js +2 -2
  10. package/lib/card.js +2 -2
  11. package/lib/carousel-item.js +2 -2
  12. package/lib/carousel.js +2 -2
  13. package/lib/cascader-panel.js +2 -3
  14. package/lib/cascader.js +5 -7
  15. package/lib/checkbox-button.js +2 -2
  16. package/lib/col.js +2 -2
  17. package/lib/collapse-item.js +2 -2
  18. package/lib/collapse.js +2 -2
  19. package/lib/color-picker.js +2 -4
  20. package/lib/container.js +2 -2
  21. package/lib/date-picker.js +2 -4
  22. package/lib/descriptions-item.js +2 -2
  23. package/lib/descriptions.js +2 -2
  24. package/lib/dialog.js +2 -2
  25. package/lib/divider.js +2 -2
  26. package/lib/drawer.js +2 -2
  27. package/lib/dropdown-item.js +2 -2
  28. package/lib/dropdown-menu.js +2 -2
  29. package/lib/dropdown.js +2 -2
  30. package/lib/element-ui.common.js +26561 -13368
  31. package/lib/empty.js +2 -2
  32. package/lib/fileUpload.js +1206 -1981
  33. package/lib/footer.js +2 -2
  34. package/lib/form-item.js +10 -10
  35. package/lib/form.js +2 -2
  36. package/lib/header.js +2 -2
  37. package/lib/icon.js +66 -66
  38. package/lib/image.js +2 -2
  39. package/lib/index.js +1 -1
  40. package/lib/infinite-scroll.js +2 -2
  41. package/lib/input-number.js +11 -8
  42. package/lib/link.js +2 -2
  43. package/lib/loading.js +2 -2
  44. package/lib/main.js +2 -2
  45. package/lib/menu-item-group.js +2 -2
  46. package/lib/menu-item.js +2 -2
  47. package/lib/menu.js +2 -2
  48. package/lib/message-box.js +2 -2
  49. package/lib/message.js +2 -2
  50. package/lib/notification.js +2 -2
  51. package/lib/option-group.js +2 -2
  52. package/lib/page-header.js +2 -2
  53. package/lib/pagination.js +5 -7
  54. package/lib/popconfirm.js +2 -2
  55. package/lib/radio-button.js +2 -2
  56. package/lib/radio-group.js +2 -2
  57. package/lib/rate.js +2 -2
  58. package/lib/result.js +2 -2
  59. package/lib/row.js +2 -2
  60. package/lib/select.js +2 -3
  61. package/lib/selectDisplayInput.js +355 -0
  62. package/lib/skeleton-item.js +2 -2
  63. package/lib/skeleton.js +2 -2
  64. package/lib/slider.js +14 -13
  65. package/lib/spinner.js +99 -99
  66. package/lib/statistic.js +16 -16
  67. package/lib/step.js +2 -2
  68. package/lib/steps.js +2 -2
  69. package/lib/subTitle.js +2 -2
  70. package/lib/submenu.js +2 -2
  71. package/lib/switch.js +2 -2
  72. package/lib/tab-pane.js +2 -2
  73. package/lib/tabDialog.js +4 -4
  74. package/lib/table-column.js +2 -2
  75. package/lib/table.js +6 -8
  76. package/lib/tabs.js +2 -2
  77. package/lib/theme-chalk/base.css +1 -0
  78. package/lib/theme-chalk/fileUpload.css +1 -1
  79. package/lib/theme-chalk/index.css +1 -1
  80. package/lib/theme-chalk/selectDisplayInput.css +1 -0
  81. package/lib/theme-chalk/subTitle.css +1 -1
  82. package/lib/theme-chalk/tabDialog.css +1 -1
  83. package/lib/theme-chalk/treeSelect.css +1 -1
  84. package/lib/theme-cy/base.css +1 -0
  85. package/lib/theme-cy/fileUpload.css +1 -1
  86. package/lib/theme-cy/index.css +1 -1
  87. package/lib/theme-cy/selectDisplayInput.css +1 -0
  88. package/lib/theme-cy/subTitle.css +1 -1
  89. package/lib/theme-cy/tabDialog.css +1 -1
  90. package/lib/theme-cy/treeSelect.css +1 -1
  91. package/lib/time-picker.js +2 -4
  92. package/lib/time-select.js +2 -4
  93. package/lib/timeline-item.js +2 -2
  94. package/lib/timeline.js +2 -2
  95. package/lib/transfer.js +24 -24
  96. package/lib/tree.js +2 -2
  97. package/lib/treeSelect.js +116 -13
  98. package/lib/upload.js +2 -2
  99. package/package.json +2 -2
  100. package/packages/theme-cy/src/index.scss +1 -1
  101. package/src/index.js +1 -1
package/lib/fileUpload.js CHANGED
@@ -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 = 127);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 125);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -411,7 +411,7 @@ var i18n = function i18n(fn) {
411
411
 
412
412
  /***/ }),
413
413
 
414
- /***/ 127:
414
+ /***/ 125:
415
415
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
416
416
 
417
417
  "use strict";
@@ -633,729 +633,643 @@ render._withStripped = true
633
633
 
634
634
  // CONCATENATED MODULE: ./packages/fileUpload/src/main.vue?vue&type=template&id=dd74605c
635
635
 
636
- // EXTERNAL MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/fileUpload/src/main.vue?vue&type=script&lang=js
637
- var mainvue_type_script_lang_js = __webpack_require__(50);
638
-
639
- // CONCATENATED MODULE: ./packages/fileUpload/src/main.vue?vue&type=script&lang=js
640
- /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js["a" /* default */]);
641
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
642
- var componentNormalizer = __webpack_require__(2);
643
-
644
- // CONCATENATED MODULE: ./packages/fileUpload/src/main.vue
645
-
646
-
647
-
648
-
649
-
650
- /* normalize component */
651
-
652
- var component = Object(componentNormalizer["a" /* default */])(
653
- src_mainvue_type_script_lang_js,
654
- render,
655
- staticRenderFns,
656
- false,
657
- null,
658
- null,
659
- null
660
-
661
- )
662
-
663
- /* harmony default export */ var main = (component.exports);
664
- // CONCATENATED MODULE: ./packages/fileUpload/index.js
636
+ // EXTERNAL MODULE: ./packages/upload/index.js + 17 modules
637
+ var upload = __webpack_require__(50);
665
638
 
639
+ // EXTERNAL MODULE: ./packages/link/index.js + 5 modules
640
+ var packages_link = __webpack_require__(55);
666
641
 
667
- /* istanbul ignore next */
668
- main.install = function (Vue) {
669
- Vue.component(main.name, main);
670
- };
642
+ // EXTERNAL MODULE: ./packages/button/index.js + 5 modules
643
+ var packages_button = __webpack_require__(27);
671
644
 
672
- /* harmony default export */ var packages_fileUpload = __webpack_exports__["default"] = (main);
645
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/fileUpload/src/main.vue?vue&type=script&lang=js
646
+ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
673
647
 
674
- /***/ }),
675
648
 
676
- /***/ 13:
677
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
678
649
 
679
- "use strict";
680
- /* harmony import */ var element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
681
650
 
682
651
 
683
- /* harmony default export */ __webpack_exports__["a"] = ({
684
- methods: {
685
- t: function t() {
686
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
687
- args[_key] = arguments[_key];
652
+ /* harmony default export */ var mainvue_type_script_lang_js = ({
653
+ name: 'CyFileUpload',
654
+ component: [upload["default"], packages_link["default"], packages_button["default"]],
655
+ props: {
656
+ //
657
+ value: {
658
+ type: [Array, String],
659
+ default: function _default() {
660
+ return [];
688
661
  }
689
-
690
- return element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__[/* t */ "a"].apply(this, args);
691
- }
692
- }
693
- });
694
-
695
- /***/ }),
696
-
697
- /***/ 15:
698
- /***/ (function(module, exports) {
699
-
700
- module.exports = require("deepmerge");
701
-
702
- /***/ }),
703
-
704
- /***/ 2:
705
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
706
-
707
- "use strict";
708
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
709
- /* globals __VUE_SSR_CONTEXT__ */
710
-
711
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
712
- // This module is a runtime utility for cleaner component module output and will
713
- // be included in the final webpack user bundle.
714
-
715
- function normalizeComponent(
716
- scriptExports,
717
- render,
718
- staticRenderFns,
719
- functionalTemplate,
720
- injectStyles,
721
- scopeId,
722
- moduleIdentifier /* server only */,
723
- shadowMode /* vue-cli only */
724
- ) {
725
- // Vue.extend constructor export interop
726
- var options =
727
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
728
-
729
- // render functions
730
- if (render) {
731
- options.render = render
732
- options.staticRenderFns = staticRenderFns
733
- options._compiled = true
734
- }
735
-
736
- // functional template
737
- if (functionalTemplate) {
738
- options.functional = true
739
- }
740
-
741
- // scopedId
742
- if (scopeId) {
743
- options._scopeId = 'data-v-' + scopeId
744
- }
745
-
746
- var hook
747
- if (moduleIdentifier) {
748
- // server build
749
- hook = function (context) {
750
- // 2.3 injection
751
- context =
752
- context || // cached call
753
- (this.$vnode && this.$vnode.ssrContext) || // stateful
754
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
755
- // 2.2 with runInNewContext: true
756
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
757
- context = __VUE_SSR_CONTEXT__
758
- }
759
- // inject component styles
760
- if (injectStyles) {
761
- injectStyles.call(this, context)
762
- }
763
- // register component module identifier for async chunk inferrence
764
- if (context && context._registeredComponents) {
765
- context._registeredComponents.add(moduleIdentifier)
766
- }
767
- }
768
- // used by ssr in case component is cached and beforeCreate
769
- // never gets called
770
- options._ssrRegister = hook
771
- } else if (injectStyles) {
772
- hook = shadowMode
773
- ? function () {
774
- injectStyles.call(
775
- this,
776
- (options.functional ? this.parent : this).$root.$options.shadowRoot
777
- )
778
- }
779
- : injectStyles
780
- }
781
-
782
- if (hook) {
783
- if (options.functional) {
784
- // for template-only hot-reload because in that case the render fn doesn't
785
- // go through the normalizer
786
- options._injectStyles = hook
787
- // register for functional component in vue file
788
- var originalRender = options.render
789
- options.render = function renderWithStyleInjection(h, context) {
790
- hook.call(context)
791
- return originalRender(h, context)
792
- }
793
- } else {
794
- // inject component registration as beforeCreate hook
795
- var existing = options.beforeCreate
796
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
797
- }
798
- }
799
-
800
- return {
801
- exports: scriptExports,
802
- options: options
803
- }
804
- }
805
-
806
-
807
- /***/ }),
808
-
809
- /***/ 27:
810
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
811
-
812
- "use strict";
813
- // ESM COMPAT FLAG
814
- __webpack_require__.r(__webpack_exports__);
815
-
816
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=template&id=7105114a
817
- var render = function render() {
818
- var _vm = this,
819
- _c = _vm._self._c
820
- return _c(
821
- "button",
822
- {
823
- staticClass: "el-button",
824
- class: [
825
- _vm.type ? "el-button--" + _vm.type : "",
826
- _vm.buttonSize ? "el-button--" + _vm.buttonSize : "",
827
- {
828
- "is-disabled": _vm.buttonDisabled,
829
- "is-loading": _vm.loading,
830
- "is-plain": _vm.plain,
831
- "is-round": _vm.round,
832
- "is-circle": _vm.circle,
833
- },
834
- ],
835
- attrs: {
836
- disabled: _vm.buttonDisabled || _vm.loading,
837
- autofocus: _vm.autofocus,
838
- type: _vm.nativeType,
839
- },
840
- on: { click: _vm.handleClick },
841
- },
842
- [
843
- _vm.loading ? _c("i", { staticClass: "el-icon-loading" }) : _vm._e(),
844
- _vm.icon && !_vm.loading ? _c("i", { class: _vm.icon }) : _vm._e(),
845
- _vm.$slots.default ? _c("span", [_vm._t("default")], 2) : _vm._e(),
846
- ]
847
- )
848
- }
849
- var staticRenderFns = []
850
- render._withStripped = true
851
-
852
-
853
- // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=template&id=7105114a
854
-
855
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=script&lang=js
856
-
857
- /* harmony default export */ var buttonvue_type_script_lang_js = ({
858
- name: 'ElButton',
859
-
860
- inject: {
861
- elForm: {
862
- default: ''
863
662
  },
864
- elFormItem: {
865
- default: ''
866
- }
867
- },
868
-
869
- props: {
870
- type: {
871
- type: String,
872
- default: 'default'
663
+ // 数量限制
664
+ limit: {
665
+ type: Number,
666
+ default: 1000
873
667
  },
874
- size: String,
875
- icon: {
876
- type: String,
877
- default: ''
668
+ // 大小限制(MB)
669
+ fileSize: {
670
+ type: Number,
671
+ default: 1000
878
672
  },
879
- nativeType: {
880
- type: String,
881
- default: 'button'
673
+ // 文件类型, ['*']不限制文件类型, 例如['png', 'jpg', 'jpeg']
674
+ fileType: {
675
+ type: Array,
676
+ default: function _default() {
677
+ return ['jpg', 'jpeg', 'png', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf'];
678
+ }
882
679
  },
883
- loading: Boolean,
884
- disabled: Boolean,
885
- plain: Boolean,
886
- autofocus: Boolean,
887
- round: Boolean,
888
- circle: Boolean
680
+ // 是否显示提示
681
+ isShowTip: {
682
+ type: Boolean,
683
+ default: true
684
+ },
685
+ // 上传的图片服务器地址
686
+ uploadFileUrl: {
687
+ type: String,
688
+ default: '/system/resource_file/upload_file'
689
+ },
690
+ // 请求参数
691
+ data: {
692
+ type: Object,
693
+ default: function _default() {
694
+ return {};
695
+ }
696
+ },
697
+ // 上传时的文件字段名
698
+ name: {
699
+ type: String,
700
+ default: 'file'
701
+ },
702
+ disabled: {
703
+ type: Boolean,
704
+ default: false
705
+ },
706
+ // 是否显示预览按钮
707
+ isPreview: {
708
+ type: Boolean,
709
+ default: true
710
+ },
711
+ // 只显示上传按钮
712
+ onlyBtn: {
713
+ type: Boolean,
714
+ default: false
715
+ },
716
+ // 上传按钮 文字
717
+ btnText: {
718
+ type: String,
719
+ default: '选取文件'
720
+ },
721
+ // 上传按钮 大小
722
+ btnSize: {
723
+ type: String,
724
+ default: 'mini'
725
+ },
726
+ // 上传按钮 颜色
727
+ btnColor: {
728
+ type: String,
729
+ default: 'primary'
730
+ },
731
+ // 上传按钮 图标
732
+ btnIcon: {
733
+ type: String,
734
+ default: ''
735
+ },
736
+ // 上传按钮 是否为朴素按钮
737
+ btnPlain: {
738
+ type: Boolean,
739
+ default: false
740
+ },
741
+ // 是否显示上传成功提示
742
+ isSuccessMsg: {
743
+ type: Boolean,
744
+ default: true
745
+ },
746
+ // 是否显示下载模板按钮
747
+ showImportTemplate: {
748
+ type: Boolean,
749
+ default: false
750
+ },
751
+ // 下载模板地址
752
+ importTemplateName: {
753
+ type: String,
754
+ default: 'template.xls'
755
+ },
756
+ // 列表是否以缩略图展示
757
+ isThumbnail: {
758
+ type: Boolean,
759
+ default: false
760
+ },
761
+ // 图片预览压缩率0-1,仅isThumbnail为true有效
762
+ imgRatio: {
763
+ type: Number,
764
+ default: 1
765
+ },
766
+ // 是否允许下载
767
+ isDownload: {
768
+ type: Boolean,
769
+ default: true
770
+ },
771
+ // 删除前回调, 必须为Promise
772
+ deleteBefore: {
773
+ type: Function
774
+ },
775
+
776
+ // 服务器转发代理规则,匹配请求路径的前缀
777
+ baseUrl: {
778
+ type: String,
779
+ default: ''
780
+ },
781
+ // 获取token的方法
782
+ getToken: {
783
+ type: Function,
784
+ default: function _default() {
785
+ return '';
786
+ }
787
+ },
788
+ // 下载接口方法,必须返回一个Promise
789
+ fileDownLoad: {
790
+ type: Function,
791
+ default: function _default() {
792
+ return Promise.resolve();
793
+ }
794
+ },
795
+ // 文件预览方法
796
+ getFilePreviewUrl: {
797
+ type: Function,
798
+ default: function _default() {
799
+ return '';
800
+ }
801
+ }
802
+ },
803
+ data: function data() {
804
+ return {
805
+ fileList: [],
806
+ downloadLoading: false
807
+ };
889
808
  },
890
809
 
810
+ watch: {
811
+ value: {
812
+ handler: function handler(val) {
813
+ if (val) {
814
+ if (typeof val === 'string') {
815
+ this.fileList = [{
816
+ file_name: this.getFileName(val),
817
+ file_path: val,
818
+ id: this.createUUID()
819
+ }];
820
+ } else {
821
+ this.fileList = val.map(function (item) {
822
+ return Object.assign({}, item);
823
+ });
824
+ }
825
+ } else {
826
+ this.fileList = [];
827
+ return [];
828
+ }
829
+ },
830
+
831
+ deep: true,
832
+ immediate: true
833
+ }
834
+ },
891
835
  computed: {
892
- _elFormItemSize: function _elFormItemSize() {
893
- return (this.elFormItem || {}).elFormItemSize;
836
+ // 是否显示提示
837
+ showTip: function showTip() {
838
+ return this.isShowTip && (this.fileType && !this.fileType.includes('*') || this.fileSize);
894
839
  },
895
- buttonSize: function buttonSize() {
896
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
840
+ fileAccept: function fileAccept() {
841
+ var arr = this.fileType.includes('*') ? [] : this.fileType.map(function (item) {
842
+ return '.' + item;
843
+ });
844
+ return arr.join();
897
845
  },
898
- buttonDisabled: function buttonDisabled() {
899
- return this.$options.propsData.hasOwnProperty('disabled') ? this.disabled : (this.elForm || {}).disabled;
846
+ headers: function headers() {
847
+ return {
848
+ Authorization: 'Bearer ' + this.getToken()
849
+ };
900
850
  }
901
851
  },
902
-
903
852
  methods: {
904
- handleClick: function handleClick(evt) {
905
- this.$emit('click', evt);
906
- }
907
- }
908
- });
909
- // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=script&lang=js
910
- /* harmony default export */ var src_buttonvue_type_script_lang_js = (buttonvue_type_script_lang_js);
911
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
912
- var componentNormalizer = __webpack_require__(2);
913
-
914
- // CONCATENATED MODULE: ./packages/button/src/button.vue
853
+ /**
854
+ * 上传前校检格式和大小
855
+ */
856
+ handleBeforeUpload: function handleBeforeUpload(file) {
857
+ this.downloadLoading = true;
858
+ // 校检文件类型
859
+ if (this.fileType && !this.fileType.includes('*')) {
860
+ var fileExtension = this.getFileExtension(file.name);
861
+ if (!this.fileType.includes(fileExtension)) {
862
+ this.$message.error('\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E, \u8BF7\u4E0A\u4F20' + this.fileType.join('/') + '\u683C\u5F0F\u6587\u4EF6!');
863
+ this.downloadLoading = false;
864
+ return false;
865
+ }
866
+ }
867
+ // 校检文件大小
868
+ if (this.fileSize) {
869
+ var isLt = file.size / 1024 / 1024 < this.fileSize;
870
+ if (!isLt) {
871
+ this.$message.error('\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 ' + this.fileSize + ' MB!');
872
+ this.downloadLoading = false;
873
+ return false;
874
+ }
875
+ }
876
+ return true;
877
+ },
915
878
 
916
879
 
880
+ /**
881
+ * 文件个数超出
882
+ */
883
+ handleExceed: function handleExceed() {
884
+ if (this.limit === 1) {
885
+ this.$message.error('只能上传单个文件!');
886
+ } else {
887
+ this.$message.error('\u4E0A\u4F20\u6587\u4EF6\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7 ' + this.limit + ' \u4E2A!');
888
+ }
889
+ this.downloadLoading = false;
890
+ },
917
891
 
918
892
 
893
+ /**
894
+ * 上传失败
895
+ */
896
+ handleUploadError: function handleUploadError(err) {
897
+ this.$message.error('上传失败, 请重试');
898
+ this.downloadLoading = false;
899
+ },
919
900
 
920
- /* normalize component */
921
901
 
922
- var component = Object(componentNormalizer["a" /* default */])(
923
- src_buttonvue_type_script_lang_js,
924
- render,
925
- staticRenderFns,
926
- false,
927
- null,
928
- null,
929
- null
930
-
931
- )
902
+ /**
903
+ * 上传成功回调
904
+ */
905
+ handleUploadSuccess: function handleUploadSuccess(res, file) {
906
+ if (res.code !== 200) {
907
+ this.$message.error(res.msg);
908
+ } else {
909
+ if (this.isSuccessMsg) this.$message.success('上传成功');
910
+ this.fileList.push(res.data);
911
+ }
912
+ this.downloadLoading = false;
913
+ this.$emit('input', this.fileList);
914
+ },
932
915
 
933
- /* harmony default export */ var src_button = (component.exports);
934
- // CONCATENATED MODULE: ./packages/button/index.js
935
916
 
917
+ /**
918
+ * 删除文件
919
+ */
920
+ handleDelete: function handleDelete(index) {
921
+ var _this = this;
936
922
 
937
- /* istanbul ignore next */
938
- src_button.install = function (Vue) {
939
- Vue.component(src_button.name, src_button);
940
- };
923
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
924
+ var res;
925
+ return regeneratorRuntime.wrap(function _callee$(_context) {
926
+ while (1) {
927
+ switch (_context.prev = _context.next) {
928
+ case 0:
929
+ if (!_this.deleteBefore) {
930
+ _context.next = 13;
931
+ break;
932
+ }
941
933
 
942
- /* harmony default export */ var packages_button = __webpack_exports__["default"] = (src_button);
934
+ _context.prev = 1;
935
+ _context.next = 4;
936
+ return _this.deleteBefore(_this.fileList[index], index);
943
937
 
944
- /***/ }),
938
+ case 4:
939
+ res = _context.sent;
945
940
 
946
- /***/ 29:
947
- /***/ (function(module, exports) {
941
+ if (res) {
942
+ _context.next = 7;
943
+ break;
944
+ }
948
945
 
949
- module.exports = require("babel-helper-vue-jsx-merge-props");
946
+ return _context.abrupt('return');
950
947
 
951
- /***/ }),
948
+ case 7:
949
+ _context.next = 13;
950
+ break;
952
951
 
953
- /***/ 3:
954
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
952
+ case 9:
953
+ _context.prev = 9;
954
+ _context.t0 = _context['catch'](1);
955
955
 
956
- "use strict";
957
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return noop; });
958
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return hasOwn; });
959
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toObject; });
960
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getValueByPath; });
961
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getPropByPath; });
962
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return generateId; });
963
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return valueEquals; });
964
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return escapeRegexpString; });
965
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; });
966
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; });
967
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return coerceTruthyValueToArray; });
968
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isIE; });
969
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isEdge; });
970
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return isFirefox; });
971
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return autoprefixer; });
972
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return kebabCase; });
973
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return capitalize; });
974
- /* unused harmony export looseEqual */
975
- /* unused harmony export arrayEquals */
976
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return isEqual; });
977
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return isEmpty; });
978
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return rafThrottle; });
979
- /* unused harmony export objToArray */
980
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return isMac; });
981
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
982
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
983
- /* harmony import */ var element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
984
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
956
+ console.log(_context.t0);
957
+ return _context.abrupt('return');
985
958
 
959
+ case 13:
960
+ _this.fileList.splice(index, 1);
961
+ _this.$emit('input', _this.fileList);
986
962
 
963
+ case 15:
964
+ case 'end':
965
+ return _context.stop();
966
+ }
967
+ }
968
+ }, _callee, _this, [[1, 9]]);
969
+ }))();
970
+ },
987
971
 
988
972
 
989
- var hasOwnProperty = Object.prototype.hasOwnProperty;
973
+ /**
974
+ * 获取文件名称
975
+ */
976
+ getFileName: function getFileName(name) {
977
+ if (name.lastIndexOf('/') > -1) {
978
+ return name.slice(name.lastIndexOf('/') + 1).toLowerCase();
979
+ } else {
980
+ return name;
981
+ }
982
+ },
990
983
 
991
- function noop() {};
992
984
 
993
- function hasOwn(obj, key) {
994
- return hasOwnProperty.call(obj, key);
995
- };
985
+ /**
986
+ * 获取文件类型,后缀
987
+ */
988
+ getFileExtension: function getFileExtension(name) {
989
+ if (name.lastIndexOf('.') > -1) {
990
+ return name.slice(name.lastIndexOf('.') + 1).toLowerCase();
991
+ }
992
+ return '';
993
+ },
996
994
 
997
- function extend(to, _from) {
998
- for (var key in _from) {
999
- to[key] = _from[key];
1000
- }
1001
- return to;
1002
- };
1003
995
 
1004
- function toObject(arr) {
1005
- var res = {};
1006
- for (var i = 0; i < arr.length; i++) {
1007
- if (arr[i]) {
1008
- extend(res, arr[i]);
1009
- }
1010
- }
1011
- return res;
1012
- };
996
+ /**
997
+ * 查看 预览
998
+ */
999
+ previewFile: function previewFile(file) {
1000
+ window.open(this.getFilePreviewUrl(file));
1001
+ },
1013
1002
 
1014
- var getValueByPath = function getValueByPath(object, prop) {
1015
- prop = prop || '';
1016
- var paths = prop.split('.');
1017
- var current = object;
1018
- var result = null;
1019
- for (var i = 0, j = paths.length; i < j; i++) {
1020
- var path = paths[i];
1021
- if (!current) break;
1022
1003
 
1023
- if (i === j - 1) {
1024
- result = current[path];
1025
- break;
1026
- }
1027
- current = current[path];
1028
- }
1029
- return result;
1030
- };
1004
+ /**
1005
+ * 附件下载
1006
+ * */
1007
+ downloadAttach: function downloadAttach(file) {
1008
+ var _this2 = this;
1031
1009
 
1032
- function getPropByPath(obj, path, strict) {
1033
- var tempObj = obj;
1034
- path = path.replace(/\[(\w+)\]/g, '.$1');
1035
- path = path.replace(/^\./, '');
1010
+ if (!this.isDownload) return;
1036
1011
 
1037
- var keyArr = path.split('.');
1038
- var i = 0;
1039
- for (var len = keyArr.length; i < len - 1; ++i) {
1040
- if (!tempObj && !strict) break;
1041
- var key = keyArr[i];
1042
- if (key in tempObj) {
1043
- tempObj = tempObj[key];
1044
- } else {
1045
- if (strict) {
1046
- throw new Error('please transfer a valid prop path to form item!');
1047
- }
1048
- break;
1049
- }
1050
- }
1051
- return {
1052
- o: tempObj,
1053
- k: keyArr[i],
1054
- v: tempObj ? tempObj[keyArr[i]] : null
1055
- };
1056
- };
1012
+ var id = file.id,
1013
+ file_name = file.file_name,
1014
+ file_type = file.file_type;
1057
1015
 
1058
- var generateId = function generateId() {
1059
- return Math.floor(Math.random() * 10000);
1060
- };
1016
+ this.downloadLoading = true;
1017
+ this.fileDownLoad(id).then(function (res) {
1018
+ var blob = new Blob([res]);
1019
+ if ('download' in document.createElement('a')) {
1020
+ var link = document.createElement('a');
1021
+ link.download = file_name;
1022
+ link.style.display = 'none';
1023
+ link.href = URL.createObjectURL(blob);
1024
+ document.body.appendChild(link);
1025
+ link.click();
1026
+ URL.revokeObjectURL(link.href);
1027
+ document.body.removeChild(link);
1028
+ } else {
1029
+ navigator.msSaveBlob(blob, file_name);
1030
+ }
1031
+ _this2.downloadLoading = false;
1032
+ }).catch(function (err) {
1033
+ _this2.downloadLoading = false;
1034
+ console.log(err);
1035
+ _this2.$message.error('文件下载失败!');
1036
+ });
1037
+ },
1061
1038
 
1062
- var valueEquals = function valueEquals(a, b) {
1063
- // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
1064
- if (a === b) return true;
1065
- if (!(a instanceof Array)) return false;
1066
- if (!(b instanceof Array)) return false;
1067
- if (a.length !== b.length) return false;
1068
- for (var i = 0; i !== a.length; ++i) {
1069
- if (a[i] !== b[i]) return false;
1070
- }
1071
- return true;
1072
- };
1073
1039
 
1074
- var escapeRegexpString = function escapeRegexpString() {
1075
- var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1076
- return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
1077
- };
1040
+ /**
1041
+ * 下载模板操作
1042
+ */
1043
+ importTemplate: function importTemplate() {
1044
+ var link = document.createElement('a');
1045
+ link.style.display = 'none';
1046
+ link.setAttribute('href', '/static/' + this.importTemplateName);
1047
+ link.download = this.importTemplateName; // 下载的文件名
1048
+ document.body.appendChild(link);
1049
+ link.click();
1050
+ document.body.removeChild(link);
1051
+ },
1078
1052
 
1079
- // TODO: use native Array.find, Array.findIndex when IE support is dropped
1080
- var arrayFindIndex = function arrayFindIndex(arr, pred) {
1081
- for (var i = 0; i !== arr.length; ++i) {
1082
- if (pred(arr[i])) {
1083
- return i;
1053
+
1054
+ /**
1055
+ * 自定义生成UUID
1056
+ */
1057
+ createUUID: function createUUID() {
1058
+ return 'xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function (c) {
1059
+ var r = Math.random() * 16 | 0;
1060
+ var v = c === 'x' ? r : r & 0x3 | 0x8;
1061
+ return v.toString(16);
1062
+ });
1084
1063
  }
1085
1064
  }
1086
- return -1;
1087
- };
1065
+ });
1066
+ // CONCATENATED MODULE: ./packages/fileUpload/src/main.vue?vue&type=script&lang=js
1067
+ /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
1068
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1069
+ var componentNormalizer = __webpack_require__(2);
1088
1070
 
1089
- var arrayFind = function arrayFind(arr, pred) {
1090
- var idx = arrayFindIndex(arr, pred);
1091
- return idx !== -1 ? arr[idx] : undefined;
1092
- };
1071
+ // CONCATENATED MODULE: ./packages/fileUpload/src/main.vue
1093
1072
 
1094
- // coerce truthy value to array
1095
- var coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {
1096
- if (Array.isArray(val)) {
1097
- return val;
1098
- } else if (val) {
1099
- return [val];
1100
- } else {
1101
- return [];
1102
- }
1103
- };
1104
1073
 
1105
- var isIE = function isIE() {
1106
- return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
1107
- };
1108
1074
 
1109
- var isEdge = function isEdge() {
1110
- return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
1111
- };
1112
1075
 
1113
- var isFirefox = function isFirefox() {
1114
- return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
1115
- };
1116
1076
 
1117
- var autoprefixer = function autoprefixer(style) {
1118
- if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') return style;
1119
- var rules = ['transform', 'transition', 'animation'];
1120
- var prefixes = ['ms-', 'webkit-'];
1121
- rules.forEach(function (rule) {
1122
- var value = style[rule];
1123
- if (rule && value) {
1124
- prefixes.forEach(function (prefix) {
1125
- style[prefix + rule] = value;
1126
- });
1127
- }
1128
- });
1129
- return style;
1130
- };
1077
+ /* normalize component */
1131
1078
 
1132
- var kebabCase = function kebabCase(str) {
1133
- var hyphenateRE = /([^-])([A-Z])/g;
1134
- return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();
1135
- };
1079
+ var component = Object(componentNormalizer["a" /* default */])(
1080
+ src_mainvue_type_script_lang_js,
1081
+ render,
1082
+ staticRenderFns,
1083
+ false,
1084
+ null,
1085
+ null,
1086
+ null
1087
+
1088
+ )
1136
1089
 
1137
- var capitalize = function capitalize(str) {
1138
- if (!Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isString */ "e"])(str)) return str;
1139
- return str.charAt(0).toUpperCase() + str.slice(1);
1140
- };
1090
+ /* harmony default export */ var main = (component.exports);
1091
+ // CONCATENATED MODULE: ./packages/fileUpload/index.js
1141
1092
 
1142
- var looseEqual = function looseEqual(a, b) {
1143
- var isObjectA = Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(a);
1144
- var isObjectB = Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(b);
1145
- if (isObjectA && isObjectB) {
1146
- return JSON.stringify(a) === JSON.stringify(b);
1147
- } else if (!isObjectA && !isObjectB) {
1148
- return String(a) === String(b);
1149
- } else {
1150
- return false;
1151
- }
1093
+
1094
+ /* istanbul ignore next */
1095
+ main.install = function (Vue) {
1096
+ Vue.component(main.name, main);
1152
1097
  };
1153
1098
 
1154
- var arrayEquals = function arrayEquals(arrayA, arrayB) {
1155
- arrayA = arrayA || [];
1156
- arrayB = arrayB || [];
1099
+ /* harmony default export */ var packages_fileUpload = __webpack_exports__["default"] = (main);
1157
1100
 
1158
- if (arrayA.length !== arrayB.length) {
1159
- return false;
1160
- }
1101
+ /***/ }),
1161
1102
 
1162
- for (var i = 0; i < arrayA.length; i++) {
1163
- if (!looseEqual(arrayA[i], arrayB[i])) {
1164
- return false;
1103
+ /***/ 13:
1104
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1105
+
1106
+ "use strict";
1107
+ /* harmony import */ var element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
1108
+
1109
+
1110
+ /* harmony default export */ __webpack_exports__["a"] = ({
1111
+ methods: {
1112
+ t: function t() {
1113
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
1114
+ args[_key] = arguments[_key];
1115
+ }
1116
+
1117
+ return element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__[/* t */ "a"].apply(this, args);
1165
1118
  }
1166
1119
  }
1120
+ });
1167
1121
 
1168
- return true;
1169
- };
1122
+ /***/ }),
1170
1123
 
1171
- var isEqual = function isEqual(value1, value2) {
1172
- if (Array.isArray(value1) && Array.isArray(value2)) {
1173
- return arrayEquals(value1, value2);
1174
- }
1175
- return looseEqual(value1, value2);
1176
- };
1124
+ /***/ 15:
1125
+ /***/ (function(module, exports) {
1177
1126
 
1178
- var isEmpty = function isEmpty(val) {
1179
- // null or undefined
1180
- if (val == null) return true;
1127
+ module.exports = require("deepmerge");
1181
1128
 
1182
- if (typeof val === 'boolean') return false;
1129
+ /***/ }),
1183
1130
 
1184
- if (typeof val === 'number') return !val;
1131
+ /***/ 2:
1132
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1185
1133
 
1186
- if (val instanceof Error) return val.message === '';
1134
+ "use strict";
1135
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
1136
+ /* globals __VUE_SSR_CONTEXT__ */
1187
1137
 
1188
- switch (Object.prototype.toString.call(val)) {
1189
- // String or Array
1190
- case '[object String]':
1191
- case '[object Array]':
1192
- return !val.length;
1138
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
1139
+ // This module is a runtime utility for cleaner component module output and will
1140
+ // be included in the final webpack user bundle.
1193
1141
 
1194
- // Map or Set or File
1195
- case '[object File]':
1196
- case '[object Map]':
1197
- case '[object Set]':
1198
- {
1199
- return !val.size;
1200
- }
1201
- // Plain Object
1202
- case '[object Object]':
1203
- {
1204
- return !Object.keys(val).length;
1205
- }
1206
- }
1142
+ function normalizeComponent(
1143
+ scriptExports,
1144
+ render,
1145
+ staticRenderFns,
1146
+ functionalTemplate,
1147
+ injectStyles,
1148
+ scopeId,
1149
+ moduleIdentifier /* server only */,
1150
+ shadowMode /* vue-cli only */
1151
+ ) {
1152
+ // Vue.extend constructor export interop
1153
+ var options =
1154
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
1207
1155
 
1208
- return false;
1209
- };
1156
+ // render functions
1157
+ if (render) {
1158
+ options.render = render
1159
+ options.staticRenderFns = staticRenderFns
1160
+ options._compiled = true
1161
+ }
1210
1162
 
1211
- function rafThrottle(fn) {
1212
- var locked = false;
1213
- return function () {
1214
- var _this = this;
1163
+ // functional template
1164
+ if (functionalTemplate) {
1165
+ options.functional = true
1166
+ }
1215
1167
 
1216
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
1217
- args[_key] = arguments[_key];
1218
- }
1168
+ // scopedId
1169
+ if (scopeId) {
1170
+ options._scopeId = 'data-v-' + scopeId
1171
+ }
1219
1172
 
1220
- if (locked) return;
1221
- locked = true;
1222
- window.requestAnimationFrame(function (_) {
1223
- fn.apply(_this, args);
1224
- locked = false;
1225
- });
1226
- };
1227
- }
1173
+ var hook
1174
+ if (moduleIdentifier) {
1175
+ // server build
1176
+ hook = function (context) {
1177
+ // 2.3 injection
1178
+ context =
1179
+ context || // cached call
1180
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
1181
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
1182
+ // 2.2 with runInNewContext: true
1183
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
1184
+ context = __VUE_SSR_CONTEXT__
1185
+ }
1186
+ // inject component styles
1187
+ if (injectStyles) {
1188
+ injectStyles.call(this, context)
1189
+ }
1190
+ // register component module identifier for async chunk inferrence
1191
+ if (context && context._registeredComponents) {
1192
+ context._registeredComponents.add(moduleIdentifier)
1193
+ }
1194
+ }
1195
+ // used by ssr in case component is cached and beforeCreate
1196
+ // never gets called
1197
+ options._ssrRegister = hook
1198
+ } else if (injectStyles) {
1199
+ hook = shadowMode
1200
+ ? function () {
1201
+ injectStyles.call(
1202
+ this,
1203
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
1204
+ )
1205
+ }
1206
+ : injectStyles
1207
+ }
1228
1208
 
1229
- function objToArray(obj) {
1230
- if (Array.isArray(obj)) {
1231
- return obj;
1232
- }
1233
- return isEmpty(obj) ? [] : [obj];
1209
+ if (hook) {
1210
+ if (options.functional) {
1211
+ // for template-only hot-reload because in that case the render fn doesn't
1212
+ // go through the normalizer
1213
+ options._injectStyles = hook
1214
+ // register for functional component in vue file
1215
+ var originalRender = options.render
1216
+ options.render = function renderWithStyleInjection(h, context) {
1217
+ hook.call(context)
1218
+ return originalRender(h, context)
1219
+ }
1220
+ } else {
1221
+ // inject component registration as beforeCreate hook
1222
+ var existing = options.beforeCreate
1223
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
1224
+ }
1225
+ }
1226
+
1227
+ return {
1228
+ exports: scriptExports,
1229
+ options: options
1230
+ }
1234
1231
  }
1235
1232
 
1236
- var isMac = function isMac() {
1237
- return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
1238
- };
1239
1233
 
1240
1234
  /***/ }),
1241
1235
 
1242
- /***/ 34:
1236
+ /***/ 27:
1243
1237
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1244
1238
 
1245
1239
  "use strict";
1246
1240
  // ESM COMPAT FLAG
1247
1241
  __webpack_require__.r(__webpack_exports__);
1248
1242
 
1249
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/progress/src/progress.vue?vue&type=template&id=279ef2ef
1243
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=template&id=7105114a
1250
1244
  var render = function render() {
1251
1245
  var _vm = this,
1252
1246
  _c = _vm._self._c
1253
1247
  return _c(
1254
- "div",
1248
+ "button",
1255
1249
  {
1256
- staticClass: "el-progress",
1250
+ staticClass: "el-button",
1257
1251
  class: [
1258
- "el-progress--" + _vm.type,
1259
- _vm.status ? "is-" + _vm.status : "",
1252
+ _vm.type ? "el-button--" + _vm.type : "",
1253
+ _vm.buttonSize ? "el-button--" + _vm.buttonSize : "",
1260
1254
  {
1261
- "el-progress--without-text": !_vm.showText,
1262
- "el-progress--text-inside": _vm.textInside,
1255
+ "is-disabled": _vm.buttonDisabled,
1256
+ "is-loading": _vm.loading,
1257
+ "is-plain": _vm.plain,
1258
+ "is-round": _vm.round,
1259
+ "is-circle": _vm.circle,
1263
1260
  },
1264
1261
  ],
1265
1262
  attrs: {
1266
- role: "progressbar",
1267
- "aria-valuenow": _vm.percentage,
1268
- "aria-valuemin": "0",
1269
- "aria-valuemax": "100",
1263
+ disabled: _vm.buttonDisabled || _vm.loading,
1264
+ autofocus: _vm.autofocus,
1265
+ type: _vm.nativeType,
1270
1266
  },
1267
+ on: { click: _vm.handleClick },
1271
1268
  },
1272
1269
  [
1273
- _vm.type === "line"
1274
- ? _c("div", { staticClass: "el-progress-bar" }, [
1275
- _c(
1276
- "div",
1277
- {
1278
- staticClass: "el-progress-bar__outer",
1279
- style: {
1280
- height: _vm.strokeWidth + "px",
1281
- backgroundColor: _vm.defineBackColor,
1282
- },
1283
- },
1284
- [
1285
- _c(
1286
- "div",
1287
- {
1288
- staticClass: "el-progress-bar__inner",
1289
- style: _vm.barStyle,
1290
- },
1291
- [
1292
- _vm.showText && _vm.textInside
1293
- ? _c(
1294
- "div",
1295
- {
1296
- staticClass: "el-progress-bar__innerText",
1297
- style: { color: _vm.textColor },
1298
- },
1299
- [_vm._v(_vm._s(_vm.content))]
1300
- )
1301
- : _vm._e(),
1302
- ]
1303
- ),
1304
- ]
1305
- ),
1306
- ])
1307
- : _c(
1308
- "div",
1309
- {
1310
- staticClass: "el-progress-circle",
1311
- style: { height: _vm.width + "px", width: _vm.width + "px" },
1312
- },
1313
- [
1314
- _c("svg", { attrs: { viewBox: "0 0 100 100" } }, [
1315
- _c("path", {
1316
- staticClass: "el-progress-circle__track",
1317
- style: _vm.trailPathStyle,
1318
- attrs: {
1319
- d: _vm.trackPath,
1320
- stroke: _vm.defineBackColor,
1321
- "stroke-width": _vm.relativeStrokeWidth,
1322
- fill: "none",
1323
- },
1324
- }),
1325
- _c("path", {
1326
- staticClass: "el-progress-circle__path",
1327
- style: _vm.circlePathStyle,
1328
- attrs: {
1329
- d: _vm.trackPath,
1330
- stroke: _vm.stroke,
1331
- fill: "none",
1332
- "stroke-linecap": _vm.strokeLinecap,
1333
- "stroke-width": _vm.percentage
1334
- ? _vm.relativeStrokeWidth
1335
- : 0,
1336
- },
1337
- }),
1338
- ]),
1339
- ]
1340
- ),
1341
- _vm.showText && !_vm.textInside
1342
- ? _c(
1343
- "div",
1344
- {
1345
- staticClass: "el-progress__text",
1346
- style: {
1347
- fontSize: _vm.progressTextSize + "px",
1348
- color: _vm.textColor,
1349
- },
1350
- },
1351
- [
1352
- !_vm.status
1353
- ? [_vm._v(_vm._s(_vm.content))]
1354
- : _c("i", { class: _vm.iconClass }),
1355
- ],
1356
- 2
1357
- )
1358
- : _vm._e(),
1270
+ _vm.loading ? _c("i", { staticClass: "el-icon-loading" }) : _vm._e(),
1271
+ _vm.icon && !_vm.loading ? _c("i", { class: _vm.icon }) : _vm._e(),
1272
+ _vm.$slots.default ? _c("span", [_vm._t("default")], 2) : _vm._e(),
1359
1273
  ]
1360
1274
  )
1361
1275
  }
@@ -1363,716 +1277,798 @@ var staticRenderFns = []
1363
1277
  render._withStripped = true
1364
1278
 
1365
1279
 
1366
- // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=template&id=279ef2ef
1280
+ // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=template&id=7105114a
1367
1281
 
1368
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/progress/src/progress.vue?vue&type=script&lang=js
1282
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=script&lang=js
1283
+
1284
+ /* harmony default export */ var buttonvue_type_script_lang_js = ({
1285
+ name: 'ElButton',
1286
+
1287
+ inject: {
1288
+ elForm: {
1289
+ default: ''
1290
+ },
1291
+ elFormItem: {
1292
+ default: ''
1293
+ }
1294
+ },
1369
1295
 
1370
- /* harmony default export */ var progressvue_type_script_lang_js = ({
1371
- name: 'ElProgress',
1372
1296
  props: {
1373
1297
  type: {
1374
1298
  type: String,
1375
- default: 'line',
1376
- validator: function validator(val) {
1377
- return ['line', 'circle', 'dashboard'].indexOf(val) > -1;
1378
- }
1379
- },
1380
- percentage: {
1381
- type: Number,
1382
- default: 0,
1383
- required: true,
1384
- validator: function validator(val) {
1385
- return val >= 0 && val <= 100;
1386
- }
1387
- },
1388
- status: {
1389
- type: String,
1390
- validator: function validator(val) {
1391
- return ['success', 'exception', 'warning'].indexOf(val) > -1;
1392
- }
1393
- },
1394
- strokeWidth: {
1395
- type: Number,
1396
- default: 6
1299
+ default: 'default'
1397
1300
  },
1398
- strokeLinecap: {
1301
+ size: String,
1302
+ icon: {
1399
1303
  type: String,
1400
- default: 'round'
1401
- },
1402
- textInside: {
1403
- type: Boolean,
1404
- default: false
1405
- },
1406
- width: {
1407
- type: Number,
1408
- default: 126
1409
- },
1410
- showText: {
1411
- type: Boolean,
1412
- default: true
1413
- },
1414
- color: {
1415
- type: [String, Array, Function],
1416
1304
  default: ''
1417
1305
  },
1418
- defineBackColor: {
1419
- type: [String, Array, Function],
1420
- default: '#ebeef5'
1421
- },
1422
- textColor: {
1423
- type: [String, Array, Function],
1424
- default: '#606266'
1306
+ nativeType: {
1307
+ type: String,
1308
+ default: 'button'
1425
1309
  },
1426
- format: Function
1310
+ loading: Boolean,
1311
+ disabled: Boolean,
1312
+ plain: Boolean,
1313
+ autofocus: Boolean,
1314
+ round: Boolean,
1315
+ circle: Boolean
1427
1316
  },
1317
+
1428
1318
  computed: {
1429
- barStyle: function barStyle() {
1430
- var style = {};
1431
- style.width = this.percentage + '%';
1432
- style.backgroundColor = this.getCurrentColor(this.percentage);
1433
- return style;
1434
- },
1435
- relativeStrokeWidth: function relativeStrokeWidth() {
1436
- return (this.strokeWidth / this.width * 100).toFixed(1);
1437
- },
1438
- radius: function radius() {
1439
- if (this.type === 'circle' || this.type === 'dashboard') {
1440
- return parseInt(50 - parseFloat(this.relativeStrokeWidth) / 2, 10);
1441
- } else {
1442
- return 0;
1443
- }
1444
- },
1445
- trackPath: function trackPath() {
1446
- var radius = this.radius;
1447
- var isDashboard = this.type === 'dashboard';
1448
- return '\n\t\t\t\t\tM 50 50\n\t\t\t\t\tm 0 ' + (isDashboard ? '' : '-') + radius + '\n\t\t\t\t\ta ' + radius + ' ' + radius + ' 0 1 1 0 ' + (isDashboard ? '-' : '') + radius * 2 + '\n\t\t\t\t\ta ' + radius + ' ' + radius + ' 0 1 1 0 ' + (isDashboard ? '' : '-') + radius * 2 + '\n\t\t\t\t\t';
1449
- },
1450
- perimeter: function perimeter() {
1451
- return 2 * Math.PI * this.radius;
1452
- },
1453
- rate: function rate() {
1454
- return this.type === 'dashboard' ? 0.75 : 1;
1455
- },
1456
- strokeDashoffset: function strokeDashoffset() {
1457
- var offset = -1 * this.perimeter * (1 - this.rate) / 2;
1458
- return offset + 'px';
1459
- },
1460
- trailPathStyle: function trailPathStyle() {
1461
- return {
1462
- strokeDasharray: this.perimeter * this.rate + 'px, ' + this.perimeter + 'px',
1463
- strokeDashoffset: this.strokeDashoffset
1464
- };
1465
- },
1466
- circlePathStyle: function circlePathStyle() {
1467
- return {
1468
- strokeDasharray: this.perimeter * this.rate * (this.percentage / 100) + 'px, ' + this.perimeter + 'px',
1469
- strokeDashoffset: this.strokeDashoffset,
1470
- transition: 'stroke-dasharray 0.6s ease 0s, stroke 0.6s ease'
1471
- };
1472
- },
1473
- stroke: function stroke() {
1474
- var ret = void 0;
1475
- if (this.color) {
1476
- ret = this.getCurrentColor(this.percentage);
1477
- } else {
1478
- switch (this.status) {
1479
- case 'success':
1480
- ret = '#13ce66';
1481
- break;
1482
- case 'exception':
1483
- ret = '#ff4949';
1484
- break;
1485
- case 'warning':
1486
- ret = '#e6a23c';
1487
- break;
1488
- default:
1489
- ret = '#20a0ff';
1490
- }
1491
- }
1492
- return ret;
1493
- },
1494
- iconClass: function iconClass() {
1495
- if (this.status === 'warning') {
1496
- return 'el-icon-warning';
1497
- }
1498
- if (this.type === 'line') {
1499
- return this.status === 'success' ? 'el-icon-circle-check' : 'el-icon-circle-close';
1500
- } else {
1501
- return this.status === 'success' ? 'el-icon-check' : 'el-icon-close';
1502
- }
1319
+ _elFormItemSize: function _elFormItemSize() {
1320
+ return (this.elFormItem || {}).elFormItemSize;
1503
1321
  },
1504
- progressTextSize: function progressTextSize() {
1505
- return this.type === 'line' ? 12 + this.strokeWidth * 0.4 : this.width * 0.111111 + 2;
1322
+ buttonSize: function buttonSize() {
1323
+ return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
1506
1324
  },
1507
- content: function content() {
1508
- if (typeof this.format === 'function') {
1509
- return this.format(this.percentage) || '';
1510
- } else {
1511
- return this.percentage + '%';
1512
- }
1325
+ buttonDisabled: function buttonDisabled() {
1326
+ return this.$options.propsData.hasOwnProperty('disabled') ? this.disabled : (this.elForm || {}).disabled;
1513
1327
  }
1514
1328
  },
1329
+
1515
1330
  methods: {
1516
- getCurrentColor: function getCurrentColor(percentage) {
1517
- if (typeof this.color === 'function') {
1518
- return this.color(percentage);
1519
- } else if (typeof this.color === 'string') {
1520
- return this.color;
1521
- } else {
1522
- return this.getLevelColor(percentage);
1523
- }
1524
- },
1525
- getLevelColor: function getLevelColor(percentage) {
1526
- var colorArray = this.getColorArray().sort(function (a, b) {
1527
- return a.percentage - b.percentage;
1528
- });
1331
+ handleClick: function handleClick(evt) {
1332
+ this.$emit('click', evt);
1333
+ }
1334
+ }
1335
+ });
1336
+ // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=script&lang=js
1337
+ /* harmony default export */ var src_buttonvue_type_script_lang_js = (buttonvue_type_script_lang_js);
1338
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1339
+ var componentNormalizer = __webpack_require__(2);
1529
1340
 
1530
- for (var i = 0; i < colorArray.length; i++) {
1531
- if (colorArray[i].percentage > percentage) {
1532
- return colorArray[i].color;
1533
- }
1341
+ // CONCATENATED MODULE: ./packages/button/src/button.vue
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+ /* normalize component */
1348
+
1349
+ var component = Object(componentNormalizer["a" /* default */])(
1350
+ src_buttonvue_type_script_lang_js,
1351
+ render,
1352
+ staticRenderFns,
1353
+ false,
1354
+ null,
1355
+ null,
1356
+ null
1357
+
1358
+ )
1359
+
1360
+ /* harmony default export */ var src_button = (component.exports);
1361
+ // CONCATENATED MODULE: ./packages/button/index.js
1362
+
1363
+
1364
+ /* istanbul ignore next */
1365
+ src_button.install = function (Vue) {
1366
+ Vue.component(src_button.name, src_button);
1367
+ };
1368
+
1369
+ /* harmony default export */ var packages_button = __webpack_exports__["default"] = (src_button);
1370
+
1371
+ /***/ }),
1372
+
1373
+ /***/ 29:
1374
+ /***/ (function(module, exports) {
1375
+
1376
+ module.exports = require("babel-helper-vue-jsx-merge-props");
1377
+
1378
+ /***/ }),
1379
+
1380
+ /***/ 3:
1381
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1382
+
1383
+ "use strict";
1384
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return noop; });
1385
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return hasOwn; });
1386
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toObject; });
1387
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getValueByPath; });
1388
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getPropByPath; });
1389
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return generateId; });
1390
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return valueEquals; });
1391
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return escapeRegexpString; });
1392
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; });
1393
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; });
1394
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return coerceTruthyValueToArray; });
1395
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return isIE; });
1396
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isEdge; });
1397
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return isFirefox; });
1398
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return autoprefixer; });
1399
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return kebabCase; });
1400
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return capitalize; });
1401
+ /* unused harmony export looseEqual */
1402
+ /* unused harmony export arrayEquals */
1403
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return isEqual; });
1404
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return isEmpty; });
1405
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return rafThrottle; });
1406
+ /* unused harmony export objToArray */
1407
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return isMac; });
1408
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
1409
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
1410
+ /* harmony import */ var element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
1411
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1412
+
1413
+
1414
+
1415
+
1416
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1417
+
1418
+ function noop() {};
1419
+
1420
+ function hasOwn(obj, key) {
1421
+ return hasOwnProperty.call(obj, key);
1422
+ };
1423
+
1424
+ function extend(to, _from) {
1425
+ for (var key in _from) {
1426
+ to[key] = _from[key];
1427
+ }
1428
+ return to;
1429
+ };
1430
+
1431
+ function toObject(arr) {
1432
+ var res = {};
1433
+ for (var i = 0; i < arr.length; i++) {
1434
+ if (arr[i]) {
1435
+ extend(res, arr[i]);
1436
+ }
1437
+ }
1438
+ return res;
1439
+ };
1440
+
1441
+ var getValueByPath = function getValueByPath(object, prop) {
1442
+ prop = prop || '';
1443
+ var paths = prop.split('.');
1444
+ var current = object;
1445
+ var result = null;
1446
+ for (var i = 0, j = paths.length; i < j; i++) {
1447
+ var path = paths[i];
1448
+ if (!current) break;
1449
+
1450
+ if (i === j - 1) {
1451
+ result = current[path];
1452
+ break;
1453
+ }
1454
+ current = current[path];
1455
+ }
1456
+ return result;
1457
+ };
1458
+
1459
+ function getPropByPath(obj, path, strict) {
1460
+ var tempObj = obj;
1461
+ path = path.replace(/\[(\w+)\]/g, '.$1');
1462
+ path = path.replace(/^\./, '');
1463
+
1464
+ var keyArr = path.split('.');
1465
+ var i = 0;
1466
+ for (var len = keyArr.length; i < len - 1; ++i) {
1467
+ if (!tempObj && !strict) break;
1468
+ var key = keyArr[i];
1469
+ if (key in tempObj) {
1470
+ tempObj = tempObj[key];
1471
+ } else {
1472
+ if (strict) {
1473
+ throw new Error('please transfer a valid prop path to form item!');
1534
1474
  }
1535
- return colorArray[colorArray.length - 1].color;
1536
- },
1537
- getColorArray: function getColorArray() {
1538
- var color = this.color;
1539
- var span = 100 / color.length;
1540
- return color.map(function (seriesColor, index) {
1541
- if (typeof seriesColor === 'string') {
1542
- return {
1543
- color: seriesColor,
1544
- percentage: (index + 1) * span
1545
- };
1546
- }
1547
- return seriesColor;
1475
+ break;
1476
+ }
1477
+ }
1478
+ return {
1479
+ o: tempObj,
1480
+ k: keyArr[i],
1481
+ v: tempObj ? tempObj[keyArr[i]] : null
1482
+ };
1483
+ };
1484
+
1485
+ var generateId = function generateId() {
1486
+ return Math.floor(Math.random() * 10000);
1487
+ };
1488
+
1489
+ var valueEquals = function valueEquals(a, b) {
1490
+ // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
1491
+ if (a === b) return true;
1492
+ if (!(a instanceof Array)) return false;
1493
+ if (!(b instanceof Array)) return false;
1494
+ if (a.length !== b.length) return false;
1495
+ for (var i = 0; i !== a.length; ++i) {
1496
+ if (a[i] !== b[i]) return false;
1497
+ }
1498
+ return true;
1499
+ };
1500
+
1501
+ var escapeRegexpString = function escapeRegexpString() {
1502
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1503
+ return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
1504
+ };
1505
+
1506
+ // TODO: use native Array.find, Array.findIndex when IE support is dropped
1507
+ var arrayFindIndex = function arrayFindIndex(arr, pred) {
1508
+ for (var i = 0; i !== arr.length; ++i) {
1509
+ if (pred(arr[i])) {
1510
+ return i;
1511
+ }
1512
+ }
1513
+ return -1;
1514
+ };
1515
+
1516
+ var arrayFind = function arrayFind(arr, pred) {
1517
+ var idx = arrayFindIndex(arr, pred);
1518
+ return idx !== -1 ? arr[idx] : undefined;
1519
+ };
1520
+
1521
+ // coerce truthy value to array
1522
+ var coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {
1523
+ if (Array.isArray(val)) {
1524
+ return val;
1525
+ } else if (val) {
1526
+ return [val];
1527
+ } else {
1528
+ return [];
1529
+ }
1530
+ };
1531
+
1532
+ var isIE = function isIE() {
1533
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
1534
+ };
1535
+
1536
+ var isEdge = function isEdge() {
1537
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
1538
+ };
1539
+
1540
+ var isFirefox = function isFirefox() {
1541
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
1542
+ };
1543
+
1544
+ var autoprefixer = function autoprefixer(style) {
1545
+ if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') return style;
1546
+ var rules = ['transform', 'transition', 'animation'];
1547
+ var prefixes = ['ms-', 'webkit-'];
1548
+ rules.forEach(function (rule) {
1549
+ var value = style[rule];
1550
+ if (rule && value) {
1551
+ prefixes.forEach(function (prefix) {
1552
+ style[prefix + rule] = value;
1548
1553
  });
1549
1554
  }
1550
- }
1551
- });
1552
- // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=script&lang=js
1553
- /* harmony default export */ var src_progressvue_type_script_lang_js = (progressvue_type_script_lang_js);
1554
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1555
- var componentNormalizer = __webpack_require__(2);
1555
+ });
1556
+ return style;
1557
+ };
1556
1558
 
1557
- // CONCATENATED MODULE: ./packages/progress/src/progress.vue
1559
+ var kebabCase = function kebabCase(str) {
1560
+ var hyphenateRE = /([^-])([A-Z])/g;
1561
+ return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();
1562
+ };
1558
1563
 
1564
+ var capitalize = function capitalize(str) {
1565
+ if (!Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isString */ "e"])(str)) return str;
1566
+ return str.charAt(0).toUpperCase() + str.slice(1);
1567
+ };
1559
1568
 
1569
+ var looseEqual = function looseEqual(a, b) {
1570
+ var isObjectA = Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(a);
1571
+ var isObjectB = Object(element_ui_src_utils_types__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ "d"])(b);
1572
+ if (isObjectA && isObjectB) {
1573
+ return JSON.stringify(a) === JSON.stringify(b);
1574
+ } else if (!isObjectA && !isObjectB) {
1575
+ return String(a) === String(b);
1576
+ } else {
1577
+ return false;
1578
+ }
1579
+ };
1560
1580
 
1581
+ var arrayEquals = function arrayEquals(arrayA, arrayB) {
1582
+ arrayA = arrayA || [];
1583
+ arrayB = arrayB || [];
1561
1584
 
1585
+ if (arrayA.length !== arrayB.length) {
1586
+ return false;
1587
+ }
1562
1588
 
1563
- /* normalize component */
1589
+ for (var i = 0; i < arrayA.length; i++) {
1590
+ if (!looseEqual(arrayA[i], arrayB[i])) {
1591
+ return false;
1592
+ }
1593
+ }
1564
1594
 
1565
- var component = Object(componentNormalizer["a" /* default */])(
1566
- src_progressvue_type_script_lang_js,
1567
- render,
1568
- staticRenderFns,
1569
- false,
1570
- null,
1571
- null,
1572
- null
1573
-
1574
- )
1595
+ return true;
1596
+ };
1575
1597
 
1576
- /* harmony default export */ var progress = (component.exports);
1577
- // CONCATENATED MODULE: ./packages/progress/index.js
1598
+ var isEqual = function isEqual(value1, value2) {
1599
+ if (Array.isArray(value1) && Array.isArray(value2)) {
1600
+ return arrayEquals(value1, value2);
1601
+ }
1602
+ return looseEqual(value1, value2);
1603
+ };
1578
1604
 
1605
+ var isEmpty = function isEmpty(val) {
1606
+ // null or undefined
1607
+ if (val == null) return true;
1579
1608
 
1580
- /* istanbul ignore next */
1581
- progress.install = function (Vue) {
1582
- Vue.component(progress.name, progress);
1583
- };
1609
+ if (typeof val === 'boolean') return false;
1584
1610
 
1585
- /* harmony default export */ var packages_progress = __webpack_exports__["default"] = (progress);
1611
+ if (typeof val === 'number') return !val;
1586
1612
 
1587
- /***/ }),
1613
+ if (val instanceof Error) return val.message === '';
1588
1614
 
1589
- /***/ 4:
1590
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1615
+ switch (Object.prototype.toString.call(val)) {
1616
+ // String or Array
1617
+ case '[object String]':
1618
+ case '[object Array]':
1619
+ return !val.length;
1591
1620
 
1592
- "use strict";
1593
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
1594
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
1595
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
1596
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
1597
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
1598
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
1599
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
1600
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
1601
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1621
+ // Map or Set or File
1622
+ case '[object File]':
1623
+ case '[object Map]':
1624
+ case '[object Set]':
1625
+ {
1626
+ return !val.size;
1627
+ }
1628
+ // Plain Object
1629
+ case '[object Object]':
1630
+ {
1631
+ return !Object.keys(val).length;
1632
+ }
1633
+ }
1602
1634
 
1635
+ return false;
1636
+ };
1603
1637
 
1638
+ function rafThrottle(fn) {
1639
+ var locked = false;
1640
+ return function () {
1641
+ var _this = this;
1604
1642
 
1605
- function isString(obj) {
1606
- return Object.prototype.toString.call(obj) === '[object String]';
1607
- }
1643
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
1644
+ args[_key] = arguments[_key];
1645
+ }
1608
1646
 
1609
- function isObject(obj) {
1610
- return Object.prototype.toString.call(obj) === '[object Object]';
1647
+ if (locked) return;
1648
+ locked = true;
1649
+ window.requestAnimationFrame(function (_) {
1650
+ fn.apply(_this, args);
1651
+ locked = false;
1652
+ });
1653
+ };
1611
1654
  }
1612
1655
 
1613
- function isHtmlElement(node) {
1614
- return node && node.nodeType === Node.ELEMENT_NODE;
1656
+ function objToArray(obj) {
1657
+ if (Array.isArray(obj)) {
1658
+ return obj;
1659
+ }
1660
+ return isEmpty(obj) ? [] : [obj];
1615
1661
  }
1616
1662
 
1617
- /**
1618
- * - Inspired:
1619
- * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
1620
- */
1621
- var isFunction = function isFunction(functionToCheck) {
1622
- var getType = {};
1623
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
1663
+ var isMac = function isMac() {
1664
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
1624
1665
  };
1625
1666
 
1626
- if ( true && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
1627
- isFunction = function isFunction(obj) {
1628
- return typeof obj === 'function' || false;
1629
- };
1667
+ /***/ }),
1668
+
1669
+ /***/ 34:
1670
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1671
+
1672
+ "use strict";
1673
+ // ESM COMPAT FLAG
1674
+ __webpack_require__.r(__webpack_exports__);
1675
+
1676
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/progress/src/progress.vue?vue&type=template&id=279ef2ef
1677
+ var render = function render() {
1678
+ var _vm = this,
1679
+ _c = _vm._self._c
1680
+ return _c(
1681
+ "div",
1682
+ {
1683
+ staticClass: "el-progress",
1684
+ class: [
1685
+ "el-progress--" + _vm.type,
1686
+ _vm.status ? "is-" + _vm.status : "",
1687
+ {
1688
+ "el-progress--without-text": !_vm.showText,
1689
+ "el-progress--text-inside": _vm.textInside,
1690
+ },
1691
+ ],
1692
+ attrs: {
1693
+ role: "progressbar",
1694
+ "aria-valuenow": _vm.percentage,
1695
+ "aria-valuemin": "0",
1696
+ "aria-valuemax": "100",
1697
+ },
1698
+ },
1699
+ [
1700
+ _vm.type === "line"
1701
+ ? _c("div", { staticClass: "el-progress-bar" }, [
1702
+ _c(
1703
+ "div",
1704
+ {
1705
+ staticClass: "el-progress-bar__outer",
1706
+ style: {
1707
+ height: _vm.strokeWidth + "px",
1708
+ backgroundColor: _vm.defineBackColor,
1709
+ },
1710
+ },
1711
+ [
1712
+ _c(
1713
+ "div",
1714
+ {
1715
+ staticClass: "el-progress-bar__inner",
1716
+ style: _vm.barStyle,
1717
+ },
1718
+ [
1719
+ _vm.showText && _vm.textInside
1720
+ ? _c(
1721
+ "div",
1722
+ {
1723
+ staticClass: "el-progress-bar__innerText",
1724
+ style: { color: _vm.textColor },
1725
+ },
1726
+ [_vm._v(_vm._s(_vm.content))]
1727
+ )
1728
+ : _vm._e(),
1729
+ ]
1730
+ ),
1731
+ ]
1732
+ ),
1733
+ ])
1734
+ : _c(
1735
+ "div",
1736
+ {
1737
+ staticClass: "el-progress-circle",
1738
+ style: { height: _vm.width + "px", width: _vm.width + "px" },
1739
+ },
1740
+ [
1741
+ _c("svg", { attrs: { viewBox: "0 0 100 100" } }, [
1742
+ _c("path", {
1743
+ staticClass: "el-progress-circle__track",
1744
+ style: _vm.trailPathStyle,
1745
+ attrs: {
1746
+ d: _vm.trackPath,
1747
+ stroke: _vm.defineBackColor,
1748
+ "stroke-width": _vm.relativeStrokeWidth,
1749
+ fill: "none",
1750
+ },
1751
+ }),
1752
+ _c("path", {
1753
+ staticClass: "el-progress-circle__path",
1754
+ style: _vm.circlePathStyle,
1755
+ attrs: {
1756
+ d: _vm.trackPath,
1757
+ stroke: _vm.stroke,
1758
+ fill: "none",
1759
+ "stroke-linecap": _vm.strokeLinecap,
1760
+ "stroke-width": _vm.percentage
1761
+ ? _vm.relativeStrokeWidth
1762
+ : 0,
1763
+ },
1764
+ }),
1765
+ ]),
1766
+ ]
1767
+ ),
1768
+ _vm.showText && !_vm.textInside
1769
+ ? _c(
1770
+ "div",
1771
+ {
1772
+ staticClass: "el-progress__text",
1773
+ style: {
1774
+ fontSize: _vm.progressTextSize + "px",
1775
+ color: _vm.textColor,
1776
+ },
1777
+ },
1778
+ [
1779
+ !_vm.status
1780
+ ? [_vm._v(_vm._s(_vm.content))]
1781
+ : _c("i", { class: _vm.iconClass }),
1782
+ ],
1783
+ 2
1784
+ )
1785
+ : _vm._e(),
1786
+ ]
1787
+ )
1630
1788
  }
1789
+ var staticRenderFns = []
1790
+ render._withStripped = true
1631
1791
 
1632
1792
 
1793
+ // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=template&id=279ef2ef
1633
1794
 
1634
- var isUndefined = function isUndefined(val) {
1635
- return val === void 0;
1636
- };
1637
-
1638
- var isDefined = function isDefined(val) {
1639
- return val !== undefined && val !== null;
1640
- };
1641
-
1642
- /***/ }),
1643
-
1644
- /***/ 50:
1645
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1646
-
1647
- "use strict";
1648
- /* WEBPACK VAR INJECTION */(function(regeneratorRuntime) {/* harmony import */ var element_ui_packages_upload__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51);
1649
- /* harmony import */ var element_ui_packages_link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
1650
- /* harmony import */ var element_ui_packages_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27);
1651
- function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
1652
-
1653
-
1654
-
1655
-
1795
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/progress/src/progress.vue?vue&type=script&lang=js
1656
1796
 
1657
- /* harmony default export */ __webpack_exports__["a"] = ({
1658
- name: 'CyFileUpload',
1659
- component: [element_ui_packages_upload__WEBPACK_IMPORTED_MODULE_0__["default"], element_ui_packages_link__WEBPACK_IMPORTED_MODULE_1__["default"], element_ui_packages_button__WEBPACK_IMPORTED_MODULE_2__["default"]],
1797
+ /* harmony default export */ var progressvue_type_script_lang_js = ({
1798
+ name: 'ElProgress',
1660
1799
  props: {
1661
- //
1662
- value: {
1663
- type: [Array, String],
1664
- default: function _default() {
1665
- return [];
1800
+ type: {
1801
+ type: String,
1802
+ default: 'line',
1803
+ validator: function validator(val) {
1804
+ return ['line', 'circle', 'dashboard'].indexOf(val) > -1;
1666
1805
  }
1667
1806
  },
1668
- // 数量限制
1669
- limit: {
1670
- type: Number,
1671
- default: 1000
1672
- },
1673
- // 大小限制(MB)
1674
- fileSize: {
1807
+ percentage: {
1675
1808
  type: Number,
1676
- default: 1000
1677
- },
1678
- // 文件类型, ['*']不限制文件类型, 例如['png', 'jpg', 'jpeg']
1679
- fileType: {
1680
- type: Array,
1681
- default: function _default() {
1682
- return ['jpg', 'jpeg', 'png', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf'];
1809
+ default: 0,
1810
+ required: true,
1811
+ validator: function validator(val) {
1812
+ return val >= 0 && val <= 100;
1683
1813
  }
1684
1814
  },
1685
- // 是否显示提示
1686
- isShowTip: {
1687
- type: Boolean,
1688
- default: true
1689
- },
1690
- // 上传的图片服务器地址
1691
- uploadFileUrl: {
1815
+ status: {
1692
1816
  type: String,
1693
- default: '/system/resource_file/upload_file'
1694
- },
1695
- // 请求参数
1696
- data: {
1697
- type: Object,
1698
- default: function _default() {
1699
- return {};
1817
+ validator: function validator(val) {
1818
+ return ['success', 'exception', 'warning'].indexOf(val) > -1;
1700
1819
  }
1701
1820
  },
1702
- // 上传时的文件字段名
1703
- name: {
1704
- type: String,
1705
- default: 'file'
1706
- },
1707
- disabled: {
1708
- type: Boolean,
1709
- default: false
1710
- },
1711
- // 是否显示预览按钮
1712
- isPreview: {
1713
- type: Boolean,
1714
- default: true
1715
- },
1716
- // 只显示上传按钮
1717
- onlyBtn: {
1718
- type: Boolean,
1719
- default: false
1720
- },
1721
- // 上传按钮 文字
1722
- btnText: {
1723
- type: String,
1724
- default: '选取文件'
1725
- },
1726
- // 上传按钮 大小
1727
- btnSize: {
1728
- type: String,
1729
- default: 'mini'
1730
- },
1731
- // 上传按钮 颜色
1732
- btnColor: {
1733
- type: String,
1734
- default: 'primary'
1735
- },
1736
- // 上传按钮 图标
1737
- btnIcon: {
1738
- type: String,
1739
- default: ''
1740
- },
1741
- // 上传按钮 是否为朴素按钮
1742
- btnPlain: {
1743
- type: Boolean,
1744
- default: false
1745
- },
1746
- // 是否显示上传成功提示
1747
- isSuccessMsg: {
1748
- type: Boolean,
1749
- default: true
1750
- },
1751
- // 是否显示下载模板按钮
1752
- showImportTemplate: {
1753
- type: Boolean,
1754
- default: false
1821
+ strokeWidth: {
1822
+ type: Number,
1823
+ default: 6
1755
1824
  },
1756
- // 下载模板地址
1757
- importTemplateName: {
1825
+ strokeLinecap: {
1758
1826
  type: String,
1759
- default: 'template.xls'
1827
+ default: 'round'
1760
1828
  },
1761
- // 列表是否以缩略图展示
1762
- isThumbnail: {
1829
+ textInside: {
1763
1830
  type: Boolean,
1764
1831
  default: false
1765
1832
  },
1766
- // 图片预览压缩率0-1,仅isThumbnail为true有效
1767
- imgRatio: {
1833
+ width: {
1768
1834
  type: Number,
1769
- default: 1
1835
+ default: 126
1770
1836
  },
1771
- // 是否允许下载
1772
- isDownload: {
1837
+ showText: {
1773
1838
  type: Boolean,
1774
1839
  default: true
1775
1840
  },
1776
- // 删除前回调, 必须为Promise
1777
- deleteBefore: {
1778
- type: Function
1779
- },
1780
-
1781
- // 服务器转发代理规则,匹配请求路径的前缀
1782
- baseUrl: {
1783
- type: String,
1841
+ color: {
1842
+ type: [String, Array, Function],
1784
1843
  default: ''
1785
1844
  },
1786
- // 获取token的方法
1787
- getToken: {
1788
- type: Function,
1789
- default: function _default() {
1790
- return '';
1791
- }
1845
+ defineBackColor: {
1846
+ type: [String, Array, Function],
1847
+ default: '#ebeef5'
1792
1848
  },
1793
- // 下载接口方法,必须返回一个Promise
1794
- fileDownLoad: {
1795
- type: Function,
1796
- default: function _default() {
1797
- return Promise.resolve();
1798
- }
1849
+ textColor: {
1850
+ type: [String, Array, Function],
1851
+ default: '#606266'
1799
1852
  },
1800
- // 文件预览方法
1801
- getFilePreviewUrl: {
1802
- type: Function,
1803
- default: function _default() {
1804
- return '';
1805
- }
1806
- }
1807
- },
1808
- data: function data() {
1809
- return {
1810
- fileList: [],
1811
- downloadLoading: false
1812
- };
1813
- },
1814
-
1815
- watch: {
1816
- value: {
1817
- handler: function handler(val) {
1818
- if (val) {
1819
- if (typeof val === 'string') {
1820
- this.fileList = [{
1821
- file_name: this.getFileName(val),
1822
- file_path: val,
1823
- id: this.createUUID()
1824
- }];
1825
- } else {
1826
- this.fileList = val.map(function (item) {
1827
- return Object.assign({}, item);
1828
- });
1829
- }
1830
- } else {
1831
- this.fileList = [];
1832
- return [];
1833
- }
1834
- },
1835
-
1836
- deep: true,
1837
- immediate: true
1838
- }
1853
+ format: Function
1839
1854
  },
1840
1855
  computed: {
1841
- // 是否显示提示
1842
- showTip: function showTip() {
1843
- return this.isShowTip && (this.fileType && !this.fileType.includes('*') || this.fileSize);
1856
+ barStyle: function barStyle() {
1857
+ var style = {};
1858
+ style.width = this.percentage + '%';
1859
+ style.backgroundColor = this.getCurrentColor(this.percentage);
1860
+ return style;
1861
+ },
1862
+ relativeStrokeWidth: function relativeStrokeWidth() {
1863
+ return (this.strokeWidth / this.width * 100).toFixed(1);
1864
+ },
1865
+ radius: function radius() {
1866
+ if (this.type === 'circle' || this.type === 'dashboard') {
1867
+ return parseInt(50 - parseFloat(this.relativeStrokeWidth) / 2, 10);
1868
+ } else {
1869
+ return 0;
1870
+ }
1844
1871
  },
1845
- fileAccept: function fileAccept() {
1846
- var arr = this.fileType.includes('*') ? [] : this.fileType.map(function (item) {
1847
- return '.' + item;
1848
- });
1849
- return arr.join();
1872
+ trackPath: function trackPath() {
1873
+ var radius = this.radius;
1874
+ var isDashboard = this.type === 'dashboard';
1875
+ return '\n\t\t\t\t\tM 50 50\n\t\t\t\t\tm 0 ' + (isDashboard ? '' : '-') + radius + '\n\t\t\t\t\ta ' + radius + ' ' + radius + ' 0 1 1 0 ' + (isDashboard ? '-' : '') + radius * 2 + '\n\t\t\t\t\ta ' + radius + ' ' + radius + ' 0 1 1 0 ' + (isDashboard ? '' : '-') + radius * 2 + '\n\t\t\t\t\t';
1850
1876
  },
1851
- headers: function headers() {
1877
+ perimeter: function perimeter() {
1878
+ return 2 * Math.PI * this.radius;
1879
+ },
1880
+ rate: function rate() {
1881
+ return this.type === 'dashboard' ? 0.75 : 1;
1882
+ },
1883
+ strokeDashoffset: function strokeDashoffset() {
1884
+ var offset = -1 * this.perimeter * (1 - this.rate) / 2;
1885
+ return offset + 'px';
1886
+ },
1887
+ trailPathStyle: function trailPathStyle() {
1852
1888
  return {
1853
- Authorization: 'Bearer ' + this.getToken()
1889
+ strokeDasharray: this.perimeter * this.rate + 'px, ' + this.perimeter + 'px',
1890
+ strokeDashoffset: this.strokeDashoffset
1854
1891
  };
1855
- }
1856
- },
1857
- methods: {
1858
- /**
1859
- * 上传前校检格式和大小
1860
- */
1861
- handleBeforeUpload: function handleBeforeUpload(file) {
1862
- this.downloadLoading = true;
1863
- // 校检文件类型
1864
- if (this.fileType && !this.fileType.includes('*')) {
1865
- var fileExtension = this.getFileExtension(file.name);
1866
- if (!this.fileType.includes(fileExtension)) {
1867
- this.$message.error('\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E, \u8BF7\u4E0A\u4F20' + this.fileType.join('/') + '\u683C\u5F0F\u6587\u4EF6!');
1868
- this.downloadLoading = false;
1869
- return false;
1870
- }
1871
- }
1872
- // 校检文件大小
1873
- if (this.fileSize) {
1874
- var isLt = file.size / 1024 / 1024 < this.fileSize;
1875
- if (!isLt) {
1876
- this.$message.error('\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 ' + this.fileSize + ' MB!');
1877
- this.downloadLoading = false;
1878
- return false;
1892
+ },
1893
+ circlePathStyle: function circlePathStyle() {
1894
+ return {
1895
+ strokeDasharray: this.perimeter * this.rate * (this.percentage / 100) + 'px, ' + this.perimeter + 'px',
1896
+ strokeDashoffset: this.strokeDashoffset,
1897
+ transition: 'stroke-dasharray 0.6s ease 0s, stroke 0.6s ease'
1898
+ };
1899
+ },
1900
+ stroke: function stroke() {
1901
+ var ret = void 0;
1902
+ if (this.color) {
1903
+ ret = this.getCurrentColor(this.percentage);
1904
+ } else {
1905
+ switch (this.status) {
1906
+ case 'success':
1907
+ ret = '#13ce66';
1908
+ break;
1909
+ case 'exception':
1910
+ ret = '#ff4949';
1911
+ break;
1912
+ case 'warning':
1913
+ ret = '#e6a23c';
1914
+ break;
1915
+ default:
1916
+ ret = '#20a0ff';
1879
1917
  }
1880
1918
  }
1881
- return true;
1919
+ return ret;
1882
1920
  },
1883
-
1884
-
1885
- /**
1886
- * 文件个数超出
1887
- */
1888
- handleExceed: function handleExceed() {
1889
- if (this.limit === 1) {
1890
- this.$message.error('只能上传单个文件!');
1921
+ iconClass: function iconClass() {
1922
+ if (this.status === 'warning') {
1923
+ return 'el-icon-warning';
1924
+ }
1925
+ if (this.type === 'line') {
1926
+ return this.status === 'success' ? 'el-icon-circle-check' : 'el-icon-circle-close';
1891
1927
  } else {
1892
- this.$message.error('\u4E0A\u4F20\u6587\u4EF6\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7 ' + this.limit + ' \u4E2A!');
1928
+ return this.status === 'success' ? 'el-icon-check' : 'el-icon-close';
1893
1929
  }
1894
- this.downloadLoading = false;
1895
1930
  },
1896
-
1897
-
1898
- /**
1899
- * 上传失败
1900
- */
1901
- handleUploadError: function handleUploadError(err) {
1902
- this.$message.error('上传失败, 请重试');
1903
- this.downloadLoading = false;
1931
+ progressTextSize: function progressTextSize() {
1932
+ return this.type === 'line' ? 12 + this.strokeWidth * 0.4 : this.width * 0.111111 + 2;
1904
1933
  },
1905
-
1906
-
1907
- /**
1908
- * 上传成功回调
1909
- */
1910
- handleUploadSuccess: function handleUploadSuccess(res, file) {
1911
- if (res.code !== 200) {
1912
- this.$message.error(res.msg);
1934
+ content: function content() {
1935
+ if (typeof this.format === 'function') {
1936
+ return this.format(this.percentage) || '';
1913
1937
  } else {
1914
- if (this.isSuccessMsg) this.$message.success('上传成功');
1915
- this.fileList.push(res.data);
1938
+ return this.percentage + '%';
1939
+ }
1940
+ }
1941
+ },
1942
+ methods: {
1943
+ getCurrentColor: function getCurrentColor(percentage) {
1944
+ if (typeof this.color === 'function') {
1945
+ return this.color(percentage);
1946
+ } else if (typeof this.color === 'string') {
1947
+ return this.color;
1948
+ } else {
1949
+ return this.getLevelColor(percentage);
1916
1950
  }
1917
- this.downloadLoading = false;
1918
- this.$emit('input', this.fileList);
1919
1951
  },
1952
+ getLevelColor: function getLevelColor(percentage) {
1953
+ var colorArray = this.getColorArray().sort(function (a, b) {
1954
+ return a.percentage - b.percentage;
1955
+ });
1920
1956
 
1957
+ for (var i = 0; i < colorArray.length; i++) {
1958
+ if (colorArray[i].percentage > percentage) {
1959
+ return colorArray[i].color;
1960
+ }
1961
+ }
1962
+ return colorArray[colorArray.length - 1].color;
1963
+ },
1964
+ getColorArray: function getColorArray() {
1965
+ var color = this.color;
1966
+ var span = 100 / color.length;
1967
+ return color.map(function (seriesColor, index) {
1968
+ if (typeof seriesColor === 'string') {
1969
+ return {
1970
+ color: seriesColor,
1971
+ percentage: (index + 1) * span
1972
+ };
1973
+ }
1974
+ return seriesColor;
1975
+ });
1976
+ }
1977
+ }
1978
+ });
1979
+ // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=script&lang=js
1980
+ /* harmony default export */ var src_progressvue_type_script_lang_js = (progressvue_type_script_lang_js);
1981
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1982
+ var componentNormalizer = __webpack_require__(2);
1921
1983
 
1922
- /**
1923
- * 删除文件
1924
- */
1925
- handleDelete: function handleDelete(index) {
1926
- var _this = this;
1927
-
1928
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
1929
- var res;
1930
- return regeneratorRuntime.wrap(function _callee$(_context) {
1931
- while (1) {
1932
- switch (_context.prev = _context.next) {
1933
- case 0:
1934
- if (!_this.deleteBefore) {
1935
- _context.next = 13;
1936
- break;
1937
- }
1984
+ // CONCATENATED MODULE: ./packages/progress/src/progress.vue
1938
1985
 
1939
- _context.prev = 1;
1940
- _context.next = 4;
1941
- return _this.deleteBefore(_this.fileList[index], index);
1942
1986
 
1943
- case 4:
1944
- res = _context.sent;
1945
1987
 
1946
- if (res) {
1947
- _context.next = 7;
1948
- break;
1949
- }
1950
1988
 
1951
- return _context.abrupt('return');
1952
1989
 
1953
- case 7:
1954
- _context.next = 13;
1955
- break;
1990
+ /* normalize component */
1956
1991
 
1957
- case 9:
1958
- _context.prev = 9;
1959
- _context.t0 = _context['catch'](1);
1992
+ var component = Object(componentNormalizer["a" /* default */])(
1993
+ src_progressvue_type_script_lang_js,
1994
+ render,
1995
+ staticRenderFns,
1996
+ false,
1997
+ null,
1998
+ null,
1999
+ null
2000
+
2001
+ )
1960
2002
 
1961
- console.log(_context.t0);
1962
- return _context.abrupt('return');
2003
+ /* harmony default export */ var progress = (component.exports);
2004
+ // CONCATENATED MODULE: ./packages/progress/index.js
1963
2005
 
1964
- case 13:
1965
- _this.fileList.splice(index, 1);
1966
- _this.$emit('input', _this.fileList);
1967
2006
 
1968
- case 15:
1969
- case 'end':
1970
- return _context.stop();
1971
- }
1972
- }
1973
- }, _callee, _this, [[1, 9]]);
1974
- }))();
1975
- },
2007
+ /* istanbul ignore next */
2008
+ progress.install = function (Vue) {
2009
+ Vue.component(progress.name, progress);
2010
+ };
1976
2011
 
2012
+ /* harmony default export */ var packages_progress = __webpack_exports__["default"] = (progress);
1977
2013
 
1978
- /**
1979
- * 获取文件名称
1980
- */
1981
- getFileName: function getFileName(name) {
1982
- if (name.lastIndexOf('/') > -1) {
1983
- return name.slice(name.lastIndexOf('/') + 1).toLowerCase();
1984
- } else {
1985
- return name;
1986
- }
1987
- },
2014
+ /***/ }),
1988
2015
 
2016
+ /***/ 4:
2017
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1989
2018
 
1990
- /**
1991
- * 获取文件类型,后缀
1992
- */
1993
- getFileExtension: function getFileExtension(name) {
1994
- if (name.lastIndexOf('.') > -1) {
1995
- return name.slice(name.lastIndexOf('.') + 1).toLowerCase();
1996
- }
1997
- return '';
1998
- },
2019
+ "use strict";
2020
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
2021
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
2022
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
2023
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
2024
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
2025
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
2026
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
2027
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
2028
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1999
2029
 
2000
2030
 
2001
- /**
2002
- * 查看 预览
2003
- */
2004
- previewFile: function previewFile(file) {
2005
- window.open(this.getFilePreviewUrl(file));
2006
- },
2007
2031
 
2032
+ function isString(obj) {
2033
+ return Object.prototype.toString.call(obj) === '[object String]';
2034
+ }
2008
2035
 
2009
- /**
2010
- * 附件下载
2011
- * */
2012
- downloadAttach: function downloadAttach(file) {
2013
- var _this2 = this;
2036
+ function isObject(obj) {
2037
+ return Object.prototype.toString.call(obj) === '[object Object]';
2038
+ }
2014
2039
 
2015
- if (!this.isDownload) return;
2040
+ function isHtmlElement(node) {
2041
+ return node && node.nodeType === Node.ELEMENT_NODE;
2042
+ }
2016
2043
 
2017
- var id = file.id,
2018
- file_name = file.file_name,
2019
- file_type = file.file_type;
2044
+ /**
2045
+ * - Inspired:
2046
+ * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
2047
+ */
2048
+ var isFunction = function isFunction(functionToCheck) {
2049
+ var getType = {};
2050
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
2051
+ };
2020
2052
 
2021
- this.downloadLoading = true;
2022
- this.fileDownLoad(id).then(function (res) {
2023
- var blob = new Blob([res]);
2024
- if ('download' in document.createElement('a')) {
2025
- var link = document.createElement('a');
2026
- link.download = file_name;
2027
- link.style.display = 'none';
2028
- link.href = URL.createObjectURL(blob);
2029
- document.body.appendChild(link);
2030
- link.click();
2031
- URL.revokeObjectURL(link.href);
2032
- document.body.removeChild(link);
2033
- } else {
2034
- navigator.msSaveBlob(blob, file_name);
2035
- }
2036
- _this2.downloadLoading = false;
2037
- }).catch(function (err) {
2038
- _this2.downloadLoading = false;
2039
- console.log(err);
2040
- _this2.$message.error('文件下载失败!');
2041
- });
2042
- },
2053
+ if ( true && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
2054
+ isFunction = function isFunction(obj) {
2055
+ return typeof obj === 'function' || false;
2056
+ };
2057
+ }
2043
2058
 
2044
2059
 
2045
- /**
2046
- * 下载模板操作
2047
- */
2048
- importTemplate: function importTemplate() {
2049
- var link = document.createElement('a');
2050
- link.style.display = 'none';
2051
- link.setAttribute('href', '/static/' + this.importTemplateName);
2052
- link.download = this.importTemplateName; // 下载的文件名
2053
- document.body.appendChild(link);
2054
- link.click();
2055
- document.body.removeChild(link);
2056
- },
2057
2060
 
2061
+ var isUndefined = function isUndefined(val) {
2062
+ return val === void 0;
2063
+ };
2058
2064
 
2059
- /**
2060
- * 自定义生成UUID
2061
- */
2062
- createUUID: function createUUID() {
2063
- return 'xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx'.replace(/[x]/g, function (c) {
2064
- var r = Math.random() * 16 | 0;
2065
- var v = c === 'x' ? r : r & 0x3 | 0x8;
2066
- return v.toString(16);
2067
- });
2068
- }
2069
- }
2070
- });
2071
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(62)))
2065
+ var isDefined = function isDefined(val) {
2066
+ return val !== undefined && val !== null;
2067
+ };
2072
2068
 
2073
2069
  /***/ }),
2074
2070
 
2075
- /***/ 51:
2071
+ /***/ 50:
2076
2072
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2077
2073
 
2078
2074
  "use strict";
@@ -3164,7 +3160,7 @@ src.install = function (Vue) {
3164
3160
 
3165
3161
  /***/ }),
3166
3162
 
3167
- /***/ 56:
3163
+ /***/ 55:
3168
3164
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3169
3165
 
3170
3166
  "use strict";
@@ -3275,777 +3271,6 @@ main.install = function (Vue) {
3275
3271
 
3276
3272
  /* harmony default export */ var packages_link = __webpack_exports__["default"] = (main);
3277
3273
 
3278
- /***/ }),
3279
-
3280
- /***/ 57:
3281
- /***/ (function(module, exports) {
3282
-
3283
- var g;
3284
-
3285
- // This works in non-strict mode
3286
- g = (function() {
3287
- return this;
3288
- })();
3289
-
3290
- try {
3291
- // This works if eval is allowed (see CSP)
3292
- g = g || new Function("return this")();
3293
- } catch (e) {
3294
- // This works if the window reference is available
3295
- if (typeof window === "object") g = window;
3296
- }
3297
-
3298
- // g can still be undefined, but nothing to do about it...
3299
- // We return undefined, instead of nothing here, so it's
3300
- // easier to handle this case. if(!global) { ...}
3301
-
3302
- module.exports = g;
3303
-
3304
-
3305
- /***/ }),
3306
-
3307
- /***/ 62:
3308
- /***/ (function(module, exports, __webpack_require__) {
3309
-
3310
- /* WEBPACK VAR INJECTION */(function(global) {/**
3311
- * Copyright (c) 2014, Facebook, Inc.
3312
- * All rights reserved.
3313
- *
3314
- * This source code is licensed under the BSD-style license found in the
3315
- * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
3316
- * additional grant of patent rights can be found in the PATENTS file in
3317
- * the same directory.
3318
- */
3319
-
3320
- !(function(global) {
3321
- "use strict";
3322
-
3323
- var Op = Object.prototype;
3324
- var hasOwn = Op.hasOwnProperty;
3325
- var undefined; // More compressible than void 0.
3326
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
3327
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
3328
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
3329
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
3330
-
3331
- var inModule = typeof module === "object";
3332
- var runtime = global.regeneratorRuntime;
3333
- if (runtime) {
3334
- if (inModule) {
3335
- // If regeneratorRuntime is defined globally and we're in a module,
3336
- // make the exports object identical to regeneratorRuntime.
3337
- module.exports = runtime;
3338
- }
3339
- // Don't bother evaluating the rest of this file if the runtime was
3340
- // already defined globally.
3341
- return;
3342
- }
3343
-
3344
- // Define the runtime globally (as expected by generated code) as either
3345
- // module.exports (if we're in a module) or a new, empty object.
3346
- runtime = global.regeneratorRuntime = inModule ? module.exports : {};
3347
-
3348
- function wrap(innerFn, outerFn, self, tryLocsList) {
3349
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
3350
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
3351
- var generator = Object.create(protoGenerator.prototype);
3352
- var context = new Context(tryLocsList || []);
3353
-
3354
- // The ._invoke method unifies the implementations of the .next,
3355
- // .throw, and .return methods.
3356
- generator._invoke = makeInvokeMethod(innerFn, self, context);
3357
-
3358
- return generator;
3359
- }
3360
- runtime.wrap = wrap;
3361
-
3362
- // Try/catch helper to minimize deoptimizations. Returns a completion
3363
- // record like context.tryEntries[i].completion. This interface could
3364
- // have been (and was previously) designed to take a closure to be
3365
- // invoked without arguments, but in all the cases we care about we
3366
- // already have an existing method we want to call, so there's no need
3367
- // to create a new function object. We can even get away with assuming
3368
- // the method takes exactly one argument, since that happens to be true
3369
- // in every case, so we don't have to touch the arguments object. The
3370
- // only additional allocation required is the completion record, which
3371
- // has a stable shape and so hopefully should be cheap to allocate.
3372
- function tryCatch(fn, obj, arg) {
3373
- try {
3374
- return { type: "normal", arg: fn.call(obj, arg) };
3375
- } catch (err) {
3376
- return { type: "throw", arg: err };
3377
- }
3378
- }
3379
-
3380
- var GenStateSuspendedStart = "suspendedStart";
3381
- var GenStateSuspendedYield = "suspendedYield";
3382
- var GenStateExecuting = "executing";
3383
- var GenStateCompleted = "completed";
3384
-
3385
- // Returning this object from the innerFn has the same effect as
3386
- // breaking out of the dispatch switch statement.
3387
- var ContinueSentinel = {};
3388
-
3389
- // Dummy constructor functions that we use as the .constructor and
3390
- // .constructor.prototype properties for functions that return Generator
3391
- // objects. For full spec compliance, you may wish to configure your
3392
- // minifier not to mangle the names of these two functions.
3393
- function Generator() {}
3394
- function GeneratorFunction() {}
3395
- function GeneratorFunctionPrototype() {}
3396
-
3397
- // This is a polyfill for %IteratorPrototype% for environments that
3398
- // don't natively support it.
3399
- var IteratorPrototype = {};
3400
- IteratorPrototype[iteratorSymbol] = function () {
3401
- return this;
3402
- };
3403
-
3404
- var getProto = Object.getPrototypeOf;
3405
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
3406
- if (NativeIteratorPrototype &&
3407
- NativeIteratorPrototype !== Op &&
3408
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
3409
- // This environment has a native %IteratorPrototype%; use it instead
3410
- // of the polyfill.
3411
- IteratorPrototype = NativeIteratorPrototype;
3412
- }
3413
-
3414
- var Gp = GeneratorFunctionPrototype.prototype =
3415
- Generator.prototype = Object.create(IteratorPrototype);
3416
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
3417
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
3418
- GeneratorFunctionPrototype[toStringTagSymbol] =
3419
- GeneratorFunction.displayName = "GeneratorFunction";
3420
-
3421
- // Helper for defining the .next, .throw, and .return methods of the
3422
- // Iterator interface in terms of a single ._invoke method.
3423
- function defineIteratorMethods(prototype) {
3424
- ["next", "throw", "return"].forEach(function(method) {
3425
- prototype[method] = function(arg) {
3426
- return this._invoke(method, arg);
3427
- };
3428
- });
3429
- }
3430
-
3431
- runtime.isGeneratorFunction = function(genFun) {
3432
- var ctor = typeof genFun === "function" && genFun.constructor;
3433
- return ctor
3434
- ? ctor === GeneratorFunction ||
3435
- // For the native GeneratorFunction constructor, the best we can
3436
- // do is to check its .name property.
3437
- (ctor.displayName || ctor.name) === "GeneratorFunction"
3438
- : false;
3439
- };
3440
-
3441
- runtime.mark = function(genFun) {
3442
- if (Object.setPrototypeOf) {
3443
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
3444
- } else {
3445
- genFun.__proto__ = GeneratorFunctionPrototype;
3446
- if (!(toStringTagSymbol in genFun)) {
3447
- genFun[toStringTagSymbol] = "GeneratorFunction";
3448
- }
3449
- }
3450
- genFun.prototype = Object.create(Gp);
3451
- return genFun;
3452
- };
3453
-
3454
- // Within the body of any async function, `await x` is transformed to
3455
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
3456
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
3457
- // meant to be awaited.
3458
- runtime.awrap = function(arg) {
3459
- return { __await: arg };
3460
- };
3461
-
3462
- function AsyncIterator(generator) {
3463
- function invoke(method, arg, resolve, reject) {
3464
- var record = tryCatch(generator[method], generator, arg);
3465
- if (record.type === "throw") {
3466
- reject(record.arg);
3467
- } else {
3468
- var result = record.arg;
3469
- var value = result.value;
3470
- if (value &&
3471
- typeof value === "object" &&
3472
- hasOwn.call(value, "__await")) {
3473
- return Promise.resolve(value.__await).then(function(value) {
3474
- invoke("next", value, resolve, reject);
3475
- }, function(err) {
3476
- invoke("throw", err, resolve, reject);
3477
- });
3478
- }
3479
-
3480
- return Promise.resolve(value).then(function(unwrapped) {
3481
- // When a yielded Promise is resolved, its final value becomes
3482
- // the .value of the Promise<{value,done}> result for the
3483
- // current iteration. If the Promise is rejected, however, the
3484
- // result for this iteration will be rejected with the same
3485
- // reason. Note that rejections of yielded Promises are not
3486
- // thrown back into the generator function, as is the case
3487
- // when an awaited Promise is rejected. This difference in
3488
- // behavior between yield and await is important, because it
3489
- // allows the consumer to decide what to do with the yielded
3490
- // rejection (swallow it and continue, manually .throw it back
3491
- // into the generator, abandon iteration, whatever). With
3492
- // await, by contrast, there is no opportunity to examine the
3493
- // rejection reason outside the generator function, so the
3494
- // only option is to throw it from the await expression, and
3495
- // let the generator function handle the exception.
3496
- result.value = unwrapped;
3497
- resolve(result);
3498
- }, reject);
3499
- }
3500
- }
3501
-
3502
- if (typeof global.process === "object" && global.process.domain) {
3503
- invoke = global.process.domain.bind(invoke);
3504
- }
3505
-
3506
- var previousPromise;
3507
-
3508
- function enqueue(method, arg) {
3509
- function callInvokeWithMethodAndArg() {
3510
- return new Promise(function(resolve, reject) {
3511
- invoke(method, arg, resolve, reject);
3512
- });
3513
- }
3514
-
3515
- return previousPromise =
3516
- // If enqueue has been called before, then we want to wait until
3517
- // all previous Promises have been resolved before calling invoke,
3518
- // so that results are always delivered in the correct order. If
3519
- // enqueue has not been called before, then it is important to
3520
- // call invoke immediately, without waiting on a callback to fire,
3521
- // so that the async generator function has the opportunity to do
3522
- // any necessary setup in a predictable way. This predictability
3523
- // is why the Promise constructor synchronously invokes its
3524
- // executor callback, and why async functions synchronously
3525
- // execute code before the first await. Since we implement simple
3526
- // async functions in terms of async generators, it is especially
3527
- // important to get this right, even though it requires care.
3528
- previousPromise ? previousPromise.then(
3529
- callInvokeWithMethodAndArg,
3530
- // Avoid propagating failures to Promises returned by later
3531
- // invocations of the iterator.
3532
- callInvokeWithMethodAndArg
3533
- ) : callInvokeWithMethodAndArg();
3534
- }
3535
-
3536
- // Define the unified helper method that is used to implement .next,
3537
- // .throw, and .return (see defineIteratorMethods).
3538
- this._invoke = enqueue;
3539
- }
3540
-
3541
- defineIteratorMethods(AsyncIterator.prototype);
3542
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
3543
- return this;
3544
- };
3545
- runtime.AsyncIterator = AsyncIterator;
3546
-
3547
- // Note that simple async functions are implemented on top of
3548
- // AsyncIterator objects; they just return a Promise for the value of
3549
- // the final result produced by the iterator.
3550
- runtime.async = function(innerFn, outerFn, self, tryLocsList) {
3551
- var iter = new AsyncIterator(
3552
- wrap(innerFn, outerFn, self, tryLocsList)
3553
- );
3554
-
3555
- return runtime.isGeneratorFunction(outerFn)
3556
- ? iter // If outerFn is a generator, return the full iterator.
3557
- : iter.next().then(function(result) {
3558
- return result.done ? result.value : iter.next();
3559
- });
3560
- };
3561
-
3562
- function makeInvokeMethod(innerFn, self, context) {
3563
- var state = GenStateSuspendedStart;
3564
-
3565
- return function invoke(method, arg) {
3566
- if (state === GenStateExecuting) {
3567
- throw new Error("Generator is already running");
3568
- }
3569
-
3570
- if (state === GenStateCompleted) {
3571
- if (method === "throw") {
3572
- throw arg;
3573
- }
3574
-
3575
- // Be forgiving, per 25.3.3.3.3 of the spec:
3576
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
3577
- return doneResult();
3578
- }
3579
-
3580
- context.method = method;
3581
- context.arg = arg;
3582
-
3583
- while (true) {
3584
- var delegate = context.delegate;
3585
- if (delegate) {
3586
- var delegateResult = maybeInvokeDelegate(delegate, context);
3587
- if (delegateResult) {
3588
- if (delegateResult === ContinueSentinel) continue;
3589
- return delegateResult;
3590
- }
3591
- }
3592
-
3593
- if (context.method === "next") {
3594
- // Setting context._sent for legacy support of Babel's
3595
- // function.sent implementation.
3596
- context.sent = context._sent = context.arg;
3597
-
3598
- } else if (context.method === "throw") {
3599
- if (state === GenStateSuspendedStart) {
3600
- state = GenStateCompleted;
3601
- throw context.arg;
3602
- }
3603
-
3604
- context.dispatchException(context.arg);
3605
-
3606
- } else if (context.method === "return") {
3607
- context.abrupt("return", context.arg);
3608
- }
3609
-
3610
- state = GenStateExecuting;
3611
-
3612
- var record = tryCatch(innerFn, self, context);
3613
- if (record.type === "normal") {
3614
- // If an exception is thrown from innerFn, we leave state ===
3615
- // GenStateExecuting and loop back for another invocation.
3616
- state = context.done
3617
- ? GenStateCompleted
3618
- : GenStateSuspendedYield;
3619
-
3620
- if (record.arg === ContinueSentinel) {
3621
- continue;
3622
- }
3623
-
3624
- return {
3625
- value: record.arg,
3626
- done: context.done
3627
- };
3628
-
3629
- } else if (record.type === "throw") {
3630
- state = GenStateCompleted;
3631
- // Dispatch the exception by looping back around to the
3632
- // context.dispatchException(context.arg) call above.
3633
- context.method = "throw";
3634
- context.arg = record.arg;
3635
- }
3636
- }
3637
- };
3638
- }
3639
-
3640
- // Call delegate.iterator[context.method](context.arg) and handle the
3641
- // result, either by returning a { value, done } result from the
3642
- // delegate iterator, or by modifying context.method and context.arg,
3643
- // setting context.delegate to null, and returning the ContinueSentinel.
3644
- function maybeInvokeDelegate(delegate, context) {
3645
- var method = delegate.iterator[context.method];
3646
- if (method === undefined) {
3647
- // A .throw or .return when the delegate iterator has no .throw
3648
- // method always terminates the yield* loop.
3649
- context.delegate = null;
3650
-
3651
- if (context.method === "throw") {
3652
- if (delegate.iterator.return) {
3653
- // If the delegate iterator has a return method, give it a
3654
- // chance to clean up.
3655
- context.method = "return";
3656
- context.arg = undefined;
3657
- maybeInvokeDelegate(delegate, context);
3658
-
3659
- if (context.method === "throw") {
3660
- // If maybeInvokeDelegate(context) changed context.method from
3661
- // "return" to "throw", let that override the TypeError below.
3662
- return ContinueSentinel;
3663
- }
3664
- }
3665
-
3666
- context.method = "throw";
3667
- context.arg = new TypeError(
3668
- "The iterator does not provide a 'throw' method");
3669
- }
3670
-
3671
- return ContinueSentinel;
3672
- }
3673
-
3674
- var record = tryCatch(method, delegate.iterator, context.arg);
3675
-
3676
- if (record.type === "throw") {
3677
- context.method = "throw";
3678
- context.arg = record.arg;
3679
- context.delegate = null;
3680
- return ContinueSentinel;
3681
- }
3682
-
3683
- var info = record.arg;
3684
-
3685
- if (! info) {
3686
- context.method = "throw";
3687
- context.arg = new TypeError("iterator result is not an object");
3688
- context.delegate = null;
3689
- return ContinueSentinel;
3690
- }
3691
-
3692
- if (info.done) {
3693
- // Assign the result of the finished delegate to the temporary
3694
- // variable specified by delegate.resultName (see delegateYield).
3695
- context[delegate.resultName] = info.value;
3696
-
3697
- // Resume execution at the desired location (see delegateYield).
3698
- context.next = delegate.nextLoc;
3699
-
3700
- // If context.method was "throw" but the delegate handled the
3701
- // exception, let the outer generator proceed normally. If
3702
- // context.method was "next", forget context.arg since it has been
3703
- // "consumed" by the delegate iterator. If context.method was
3704
- // "return", allow the original .return call to continue in the
3705
- // outer generator.
3706
- if (context.method !== "return") {
3707
- context.method = "next";
3708
- context.arg = undefined;
3709
- }
3710
-
3711
- } else {
3712
- // Re-yield the result returned by the delegate method.
3713
- return info;
3714
- }
3715
-
3716
- // The delegate iterator is finished, so forget it and continue with
3717
- // the outer generator.
3718
- context.delegate = null;
3719
- return ContinueSentinel;
3720
- }
3721
-
3722
- // Define Generator.prototype.{next,throw,return} in terms of the
3723
- // unified ._invoke helper method.
3724
- defineIteratorMethods(Gp);
3725
-
3726
- Gp[toStringTagSymbol] = "Generator";
3727
-
3728
- // A Generator should always return itself as the iterator object when the
3729
- // @@iterator function is called on it. Some browsers' implementations of the
3730
- // iterator prototype chain incorrectly implement this, causing the Generator
3731
- // object to not be returned from this call. This ensures that doesn't happen.
3732
- // See https://github.com/facebook/regenerator/issues/274 for more details.
3733
- Gp[iteratorSymbol] = function() {
3734
- return this;
3735
- };
3736
-
3737
- Gp.toString = function() {
3738
- return "[object Generator]";
3739
- };
3740
-
3741
- function pushTryEntry(locs) {
3742
- var entry = { tryLoc: locs[0] };
3743
-
3744
- if (1 in locs) {
3745
- entry.catchLoc = locs[1];
3746
- }
3747
-
3748
- if (2 in locs) {
3749
- entry.finallyLoc = locs[2];
3750
- entry.afterLoc = locs[3];
3751
- }
3752
-
3753
- this.tryEntries.push(entry);
3754
- }
3755
-
3756
- function resetTryEntry(entry) {
3757
- var record = entry.completion || {};
3758
- record.type = "normal";
3759
- delete record.arg;
3760
- entry.completion = record;
3761
- }
3762
-
3763
- function Context(tryLocsList) {
3764
- // The root entry object (effectively a try statement without a catch
3765
- // or a finally block) gives us a place to store values thrown from
3766
- // locations where there is no enclosing try statement.
3767
- this.tryEntries = [{ tryLoc: "root" }];
3768
- tryLocsList.forEach(pushTryEntry, this);
3769
- this.reset(true);
3770
- }
3771
-
3772
- runtime.keys = function(object) {
3773
- var keys = [];
3774
- for (var key in object) {
3775
- keys.push(key);
3776
- }
3777
- keys.reverse();
3778
-
3779
- // Rather than returning an object with a next method, we keep
3780
- // things simple and return the next function itself.
3781
- return function next() {
3782
- while (keys.length) {
3783
- var key = keys.pop();
3784
- if (key in object) {
3785
- next.value = key;
3786
- next.done = false;
3787
- return next;
3788
- }
3789
- }
3790
-
3791
- // To avoid creating an additional object, we just hang the .value
3792
- // and .done properties off the next function object itself. This
3793
- // also ensures that the minifier will not anonymize the function.
3794
- next.done = true;
3795
- return next;
3796
- };
3797
- };
3798
-
3799
- function values(iterable) {
3800
- if (iterable) {
3801
- var iteratorMethod = iterable[iteratorSymbol];
3802
- if (iteratorMethod) {
3803
- return iteratorMethod.call(iterable);
3804
- }
3805
-
3806
- if (typeof iterable.next === "function") {
3807
- return iterable;
3808
- }
3809
-
3810
- if (!isNaN(iterable.length)) {
3811
- var i = -1, next = function next() {
3812
- while (++i < iterable.length) {
3813
- if (hasOwn.call(iterable, i)) {
3814
- next.value = iterable[i];
3815
- next.done = false;
3816
- return next;
3817
- }
3818
- }
3819
-
3820
- next.value = undefined;
3821
- next.done = true;
3822
-
3823
- return next;
3824
- };
3825
-
3826
- return next.next = next;
3827
- }
3828
- }
3829
-
3830
- // Return an iterator with no values.
3831
- return { next: doneResult };
3832
- }
3833
- runtime.values = values;
3834
-
3835
- function doneResult() {
3836
- return { value: undefined, done: true };
3837
- }
3838
-
3839
- Context.prototype = {
3840
- constructor: Context,
3841
-
3842
- reset: function(skipTempReset) {
3843
- this.prev = 0;
3844
- this.next = 0;
3845
- // Resetting context._sent for legacy support of Babel's
3846
- // function.sent implementation.
3847
- this.sent = this._sent = undefined;
3848
- this.done = false;
3849
- this.delegate = null;
3850
-
3851
- this.method = "next";
3852
- this.arg = undefined;
3853
-
3854
- this.tryEntries.forEach(resetTryEntry);
3855
-
3856
- if (!skipTempReset) {
3857
- for (var name in this) {
3858
- // Not sure about the optimal order of these conditions:
3859
- if (name.charAt(0) === "t" &&
3860
- hasOwn.call(this, name) &&
3861
- !isNaN(+name.slice(1))) {
3862
- this[name] = undefined;
3863
- }
3864
- }
3865
- }
3866
- },
3867
-
3868
- stop: function() {
3869
- this.done = true;
3870
-
3871
- var rootEntry = this.tryEntries[0];
3872
- var rootRecord = rootEntry.completion;
3873
- if (rootRecord.type === "throw") {
3874
- throw rootRecord.arg;
3875
- }
3876
-
3877
- return this.rval;
3878
- },
3879
-
3880
- dispatchException: function(exception) {
3881
- if (this.done) {
3882
- throw exception;
3883
- }
3884
-
3885
- var context = this;
3886
- function handle(loc, caught) {
3887
- record.type = "throw";
3888
- record.arg = exception;
3889
- context.next = loc;
3890
-
3891
- if (caught) {
3892
- // If the dispatched exception was caught by a catch block,
3893
- // then let that catch block handle the exception normally.
3894
- context.method = "next";
3895
- context.arg = undefined;
3896
- }
3897
-
3898
- return !! caught;
3899
- }
3900
-
3901
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3902
- var entry = this.tryEntries[i];
3903
- var record = entry.completion;
3904
-
3905
- if (entry.tryLoc === "root") {
3906
- // Exception thrown outside of any try block that could handle
3907
- // it, so set the completion value of the entire function to
3908
- // throw the exception.
3909
- return handle("end");
3910
- }
3911
-
3912
- if (entry.tryLoc <= this.prev) {
3913
- var hasCatch = hasOwn.call(entry, "catchLoc");
3914
- var hasFinally = hasOwn.call(entry, "finallyLoc");
3915
-
3916
- if (hasCatch && hasFinally) {
3917
- if (this.prev < entry.catchLoc) {
3918
- return handle(entry.catchLoc, true);
3919
- } else if (this.prev < entry.finallyLoc) {
3920
- return handle(entry.finallyLoc);
3921
- }
3922
-
3923
- } else if (hasCatch) {
3924
- if (this.prev < entry.catchLoc) {
3925
- return handle(entry.catchLoc, true);
3926
- }
3927
-
3928
- } else if (hasFinally) {
3929
- if (this.prev < entry.finallyLoc) {
3930
- return handle(entry.finallyLoc);
3931
- }
3932
-
3933
- } else {
3934
- throw new Error("try statement without catch or finally");
3935
- }
3936
- }
3937
- }
3938
- },
3939
-
3940
- abrupt: function(type, arg) {
3941
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3942
- var entry = this.tryEntries[i];
3943
- if (entry.tryLoc <= this.prev &&
3944
- hasOwn.call(entry, "finallyLoc") &&
3945
- this.prev < entry.finallyLoc) {
3946
- var finallyEntry = entry;
3947
- break;
3948
- }
3949
- }
3950
-
3951
- if (finallyEntry &&
3952
- (type === "break" ||
3953
- type === "continue") &&
3954
- finallyEntry.tryLoc <= arg &&
3955
- arg <= finallyEntry.finallyLoc) {
3956
- // Ignore the finally entry if control is not jumping to a
3957
- // location outside the try/catch block.
3958
- finallyEntry = null;
3959
- }
3960
-
3961
- var record = finallyEntry ? finallyEntry.completion : {};
3962
- record.type = type;
3963
- record.arg = arg;
3964
-
3965
- if (finallyEntry) {
3966
- this.method = "next";
3967
- this.next = finallyEntry.finallyLoc;
3968
- return ContinueSentinel;
3969
- }
3970
-
3971
- return this.complete(record);
3972
- },
3973
-
3974
- complete: function(record, afterLoc) {
3975
- if (record.type === "throw") {
3976
- throw record.arg;
3977
- }
3978
-
3979
- if (record.type === "break" ||
3980
- record.type === "continue") {
3981
- this.next = record.arg;
3982
- } else if (record.type === "return") {
3983
- this.rval = this.arg = record.arg;
3984
- this.method = "return";
3985
- this.next = "end";
3986
- } else if (record.type === "normal" && afterLoc) {
3987
- this.next = afterLoc;
3988
- }
3989
-
3990
- return ContinueSentinel;
3991
- },
3992
-
3993
- finish: function(finallyLoc) {
3994
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
3995
- var entry = this.tryEntries[i];
3996
- if (entry.finallyLoc === finallyLoc) {
3997
- this.complete(entry.completion, entry.afterLoc);
3998
- resetTryEntry(entry);
3999
- return ContinueSentinel;
4000
- }
4001
- }
4002
- },
4003
-
4004
- "catch": function(tryLoc) {
4005
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
4006
- var entry = this.tryEntries[i];
4007
- if (entry.tryLoc === tryLoc) {
4008
- var record = entry.completion;
4009
- if (record.type === "throw") {
4010
- var thrown = record.arg;
4011
- resetTryEntry(entry);
4012
- }
4013
- return thrown;
4014
- }
4015
- }
4016
-
4017
- // The context.catch method must only be called with a location
4018
- // argument that corresponds to a known catch block.
4019
- throw new Error("illegal catch attempt");
4020
- },
4021
-
4022
- delegateYield: function(iterable, resultName, nextLoc) {
4023
- this.delegate = {
4024
- iterator: values(iterable),
4025
- resultName: resultName,
4026
- nextLoc: nextLoc
4027
- };
4028
-
4029
- if (this.method === "next") {
4030
- // Deliberately forget the last sent value so that we don't
4031
- // accidentally pass it on to the delegate.
4032
- this.arg = undefined;
4033
- }
4034
-
4035
- return ContinueSentinel;
4036
- }
4037
- };
4038
- })(
4039
- // Among the various tricks for obtaining a reference to the global
4040
- // object, this seems to be the most reliable technique that does not
4041
- // use indirect eval (which violates Content Security Policy).
4042
- typeof global === "object" ? global :
4043
- typeof window === "object" ? window :
4044
- typeof self === "object" ? self : this
4045
- );
4046
-
4047
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(57)))
4048
-
4049
3274
  /***/ })
4050
3275
 
4051
3276
  /******/ });