cy-element-ui 1.0.39 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/lib/alert.js +13 -31
- package/lib/aside.js +77 -84
- package/lib/autocomplete.js +3969 -268
- package/lib/avatar.js +108 -108
- package/lib/backtop.js +118 -136
- package/lib/badge.js +112 -133
- package/lib/breadcrumb-item.js +8 -21
- package/lib/breadcrumb.js +8 -14
- package/lib/button-group.js +8 -14
- package/lib/button.js +8 -33
- package/lib/calendar.js +1549 -109
- package/lib/card.js +96 -104
- package/lib/carousel-item.js +456 -135
- package/lib/carousel.js +191 -179
- package/lib/cascader-panel.js +2275 -209
- package/lib/cascader.js +6410 -349
- package/lib/checkbox-button.js +52 -62
- package/lib/checkbox-group.js +51 -20
- package/lib/checkbox.js +51 -75
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +829 -170
- package/lib/collapse.js +112 -118
- package/lib/color-picker.js +3917 -258
- package/lib/container.js +88 -95
- package/lib/date-picker.js +8736 -4669
- package/lib/descriptions-item.js +2 -2
- package/lib/descriptions.js +63 -8
- package/lib/dialog.js +1213 -75
- package/lib/divider.js +104 -120
- package/lib/drawer.js +897 -173
- package/lib/dropdown-item.js +47 -31
- package/lib/dropdown-menu.js +2275 -81
- package/lib/dropdown.js +1072 -136
- package/lib/element-ui.common.js +910 -4903
- package/lib/empty.js +625 -169
- package/lib/fileUpload.js +3593 -520
- package/lib/footer.js +77 -84
- package/lib/form-item.js +450 -99
- package/lib/form.js +33 -28
- package/lib/header.js +77 -84
- package/lib/icon.js +67 -72
- package/lib/image.js +1400 -152
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +311 -21
- package/lib/input-number.js +1438 -100
- package/lib/input.js +511 -151
- package/lib/link.js +9 -33
- package/lib/loading.js +808 -90
- package/lib/main.js +64 -71
- package/lib/menu-item-group.js +8 -20
- package/lib/menu-item.js +2912 -59
- package/lib/menu.js +745 -54
- package/lib/message-box.js +2556 -184
- package/lib/message.js +1117 -64
- package/lib/notification.js +1114 -67
- package/lib/option-group.js +47 -27
- package/lib/option.js +404 -43
- package/lib/page-header.js +683 -94
- package/lib/pagination.js +6078 -170
- package/lib/popconfirm.js +3514 -263
- package/lib/popover.js +2594 -93
- package/lib/progress.js +9 -62
- package/lib/radio-button.js +48 -55
- package/lib/radio-group.js +47 -26
- package/lib/radio.js +52 -67
- package/lib/rate.js +760 -152
- package/lib/result.js +39 -89
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +735 -50
- package/lib/select.js +4294 -326
- package/lib/skeleton-item.js +13 -33
- package/lib/skeleton.js +116 -143
- package/lib/slider.js +4285 -254
- package/lib/spinner.js +100 -108
- package/lib/statistic.js +9627 -161
- package/lib/step.js +140 -186
- package/lib/steps.js +514 -111
- package/lib/subTitle.js +91 -100
- package/lib/submenu.js +2444 -123
- package/lib/switch.js +483 -67
- package/lib/tab-pane.js +10 -24
- package/lib/tabDialog.js +1548 -71
- package/lib/table-column.js +880 -32
- package/lib/table.js +4530 -744
- package/lib/tabs.js +432 -23
- package/lib/tag.js +4 -4
- package/lib/theme-chalk/gulpfile.js +27 -0
- package/lib/time-picker.js +5016 -566
- package/lib/time-select.js +4976 -313
- package/lib/timeline-item.js +114 -156
- package/lib/timeline.js +82 -82
- package/lib/tooltip.js +2566 -41
- package/lib/transfer.js +2143 -247
- package/lib/tree.js +1387 -180
- package/lib/treeSelect.js +3426 -153
- package/lib/upload.js +1154 -207
- package/package.json +10 -11
- package/packages/input-number/src/input-number.vue +7 -4
- package/packages/selectDisplayInput/index.js +8 -0
- package/packages/selectDisplayInput/src/main.vue +75 -0
- package/packages/theme-chalk/gulpfile.js +27 -0
- package/packages/theme-cy/gulpfile.js +27 -0
- package/packages/theme-cy/src/base.scss +3 -0
- package/packages/theme-cy/src/index.scss +1 -0
- package/packages/theme-cy/src/selectDisplayInput.scss +76 -0
- package/packages/theme-cy/src/treeSelect.scss +9 -4
- package/packages/treeSelect/src/main.vue +79 -0
- package/src/index.js +7 -4
- package/types/element-ui.d.ts +5 -1
- package/types/selectDisplayInput.d.ts +5 -0
- package/CHANGELOG.md +0 -280
- /package/{packages/theme-cy/lib → lib/theme-chalk}/base.css +0 -0
- /package/{packages/theme-cy/lib → lib/theme-chalk}/element.css +0 -0
- /package/{packages/theme-cy/lib → lib/theme-chalk}/fileUpload.css +0 -0
- /package/{packages/theme-cy/lib → lib/theme-chalk}/index.css +0 -0
- /package/{packages/theme-cy/lib → lib/theme-chalk}/subTitle.css +0 -0
- /package/{packages/theme-cy/lib → lib/theme-chalk}/tabDialog.css +0 -0
- /package/{packages/theme-cy/lib → lib/theme-chalk}/treeSelect.css +0 -0
package/lib/fileUpload.js
CHANGED
|
@@ -82,135 +82,346 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 127);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
89
89
|
|
|
90
90
|
/***/ 0:
|
|
91
|
+
/***/ (function(module, exports) {
|
|
92
|
+
|
|
93
|
+
module.exports = require("vue");
|
|
94
|
+
|
|
95
|
+
/***/ }),
|
|
96
|
+
|
|
97
|
+
/***/ 11:
|
|
91
98
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
92
99
|
|
|
93
100
|
"use strict";
|
|
94
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
|
95
|
-
/* globals __VUE_SSR_CONTEXT__ */
|
|
96
101
|
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
// be included in the final webpack user bundle.
|
|
102
|
+
// EXPORTS
|
|
103
|
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ t; });
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
scriptExports,
|
|
103
|
-
render,
|
|
104
|
-
staticRenderFns,
|
|
105
|
-
functionalTemplate,
|
|
106
|
-
injectStyles,
|
|
107
|
-
scopeId,
|
|
108
|
-
moduleIdentifier /* server only */,
|
|
109
|
-
shadowMode /* vue-cli only */
|
|
110
|
-
) {
|
|
111
|
-
// Vue.extend constructor export interop
|
|
112
|
-
var options =
|
|
113
|
-
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
105
|
+
// UNUSED EXPORTS: use, i18n
|
|
114
106
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
107
|
+
// CONCATENATED MODULE: ./src/locale/lang/zh-CN.js
|
|
108
|
+
/* harmony default export */ var zh_CN = ({
|
|
109
|
+
el: {
|
|
110
|
+
colorpicker: {
|
|
111
|
+
confirm: '确定',
|
|
112
|
+
clear: '清空'
|
|
113
|
+
},
|
|
114
|
+
datepicker: {
|
|
115
|
+
now: '此刻',
|
|
116
|
+
today: '今天',
|
|
117
|
+
cancel: '取消',
|
|
118
|
+
clear: '清空',
|
|
119
|
+
confirm: '确定',
|
|
120
|
+
selectDate: '选择日期',
|
|
121
|
+
selectTime: '选择时间',
|
|
122
|
+
startDate: '开始日期',
|
|
123
|
+
startTime: '开始时间',
|
|
124
|
+
endDate: '结束日期',
|
|
125
|
+
endTime: '结束时间',
|
|
126
|
+
prevYear: '前一年',
|
|
127
|
+
nextYear: '后一年',
|
|
128
|
+
prevMonth: '上个月',
|
|
129
|
+
nextMonth: '下个月',
|
|
130
|
+
year: '年',
|
|
131
|
+
month1: '1 月',
|
|
132
|
+
month2: '2 月',
|
|
133
|
+
month3: '3 月',
|
|
134
|
+
month4: '4 月',
|
|
135
|
+
month5: '5 月',
|
|
136
|
+
month6: '6 月',
|
|
137
|
+
month7: '7 月',
|
|
138
|
+
month8: '8 月',
|
|
139
|
+
month9: '9 月',
|
|
140
|
+
month10: '10 月',
|
|
141
|
+
month11: '11 月',
|
|
142
|
+
month12: '12 月',
|
|
143
|
+
// week: '周次',
|
|
144
|
+
weeks: {
|
|
145
|
+
sun: '日',
|
|
146
|
+
mon: '一',
|
|
147
|
+
tue: '二',
|
|
148
|
+
wed: '三',
|
|
149
|
+
thu: '四',
|
|
150
|
+
fri: '五',
|
|
151
|
+
sat: '六'
|
|
152
|
+
},
|
|
153
|
+
months: {
|
|
154
|
+
jan: '一月',
|
|
155
|
+
feb: '二月',
|
|
156
|
+
mar: '三月',
|
|
157
|
+
apr: '四月',
|
|
158
|
+
may: '五月',
|
|
159
|
+
jun: '六月',
|
|
160
|
+
jul: '七月',
|
|
161
|
+
aug: '八月',
|
|
162
|
+
sep: '九月',
|
|
163
|
+
oct: '十月',
|
|
164
|
+
nov: '十一月',
|
|
165
|
+
dec: '十二月'
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
select: {
|
|
169
|
+
loading: '加载中',
|
|
170
|
+
noMatch: '无匹配数据',
|
|
171
|
+
noData: '无数据',
|
|
172
|
+
placeholder: '请选择'
|
|
173
|
+
},
|
|
174
|
+
cascader: {
|
|
175
|
+
noMatch: '无匹配数据',
|
|
176
|
+
loading: '加载中',
|
|
177
|
+
placeholder: '请选择',
|
|
178
|
+
noData: '暂无数据'
|
|
179
|
+
},
|
|
180
|
+
pagination: {
|
|
181
|
+
goto: '前往',
|
|
182
|
+
pagesize: '条/页',
|
|
183
|
+
total: '共 {total} 条',
|
|
184
|
+
pageClassifier: '页'
|
|
185
|
+
},
|
|
186
|
+
messagebox: {
|
|
187
|
+
title: '提示',
|
|
188
|
+
confirm: '确定',
|
|
189
|
+
cancel: '取消',
|
|
190
|
+
error: '输入的数据不合法!'
|
|
191
|
+
},
|
|
192
|
+
upload: {
|
|
193
|
+
deleteTip: '按 delete 键可删除',
|
|
194
|
+
delete: '删除',
|
|
195
|
+
preview: '查看图片',
|
|
196
|
+
continue: '继续上传'
|
|
197
|
+
},
|
|
198
|
+
table: {
|
|
199
|
+
emptyText: '暂无数据',
|
|
200
|
+
confirmFilter: '筛选',
|
|
201
|
+
resetFilter: '重置',
|
|
202
|
+
clearFilter: '全部',
|
|
203
|
+
sumText: '合计'
|
|
204
|
+
},
|
|
205
|
+
tree: {
|
|
206
|
+
emptyText: '暂无数据'
|
|
207
|
+
},
|
|
208
|
+
transfer: {
|
|
209
|
+
noMatch: '无匹配数据',
|
|
210
|
+
noData: '无数据',
|
|
211
|
+
titles: ['列表 1', '列表 2'],
|
|
212
|
+
filterPlaceholder: '请输入搜索内容',
|
|
213
|
+
noCheckedFormat: '共 {total} 项',
|
|
214
|
+
hasCheckedFormat: '已选 {checked}/{total} 项'
|
|
215
|
+
},
|
|
216
|
+
image: {
|
|
217
|
+
error: '加载失败'
|
|
218
|
+
},
|
|
219
|
+
pageHeader: {
|
|
220
|
+
title: '返回'
|
|
221
|
+
},
|
|
222
|
+
popconfirm: {
|
|
223
|
+
confirmButtonText: '确定',
|
|
224
|
+
cancelButtonText: '取消'
|
|
225
|
+
},
|
|
226
|
+
empty: {
|
|
227
|
+
description: '暂无数据'
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
// EXTERNAL MODULE: external "vue"
|
|
232
|
+
var external_vue_ = __webpack_require__(0);
|
|
233
|
+
var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
|
|
234
|
+
|
|
235
|
+
// EXTERNAL MODULE: external "deepmerge"
|
|
236
|
+
var external_deepmerge_ = __webpack_require__(15);
|
|
237
|
+
var external_deepmerge_default = /*#__PURE__*/__webpack_require__.n(external_deepmerge_);
|
|
238
|
+
|
|
239
|
+
// EXTERNAL MODULE: ./src/utils/util.js
|
|
240
|
+
var util = __webpack_require__(3);
|
|
241
|
+
|
|
242
|
+
// CONCATENATED MODULE: ./src/locale/format.js
|
|
243
|
+
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; };
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
|
|
248
|
+
/**
|
|
249
|
+
* String format template
|
|
250
|
+
* - Inspired:
|
|
251
|
+
* https://github.com/Matt-Esch/string-template/index.js
|
|
252
|
+
*/
|
|
253
|
+
/* harmony default export */ var format = (function (Vue) {
|
|
254
|
+
/**
|
|
255
|
+
* template
|
|
256
|
+
*
|
|
257
|
+
* @param {String} string
|
|
258
|
+
* @param {Array} ...args
|
|
259
|
+
* @return {String}
|
|
260
|
+
*/
|
|
121
261
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
262
|
+
function template(string) {
|
|
263
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
264
|
+
args[_key - 1] = arguments[_key];
|
|
265
|
+
}
|
|
126
266
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
267
|
+
if (args.length === 1 && _typeof(args[0]) === 'object') {
|
|
268
|
+
args = args[0];
|
|
269
|
+
}
|
|
131
270
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
hook = function (context) {
|
|
136
|
-
// 2.3 injection
|
|
137
|
-
context =
|
|
138
|
-
context || // cached call
|
|
139
|
-
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
140
|
-
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
141
|
-
// 2.2 with runInNewContext: true
|
|
142
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
143
|
-
context = __VUE_SSR_CONTEXT__
|
|
144
|
-
}
|
|
145
|
-
// inject component styles
|
|
146
|
-
if (injectStyles) {
|
|
147
|
-
injectStyles.call(this, context)
|
|
148
|
-
}
|
|
149
|
-
// register component module identifier for async chunk inferrence
|
|
150
|
-
if (context && context._registeredComponents) {
|
|
151
|
-
context._registeredComponents.add(moduleIdentifier)
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
// used by ssr in case component is cached and beforeCreate
|
|
155
|
-
// never gets called
|
|
156
|
-
options._ssrRegister = hook
|
|
157
|
-
} else if (injectStyles) {
|
|
158
|
-
hook = shadowMode
|
|
159
|
-
? function () {
|
|
160
|
-
injectStyles.call(
|
|
161
|
-
this,
|
|
162
|
-
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
: injectStyles
|
|
166
|
-
}
|
|
271
|
+
if (!args || !args.hasOwnProperty) {
|
|
272
|
+
args = {};
|
|
273
|
+
}
|
|
167
274
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
// for template-only hot-reload because in that case the render fn doesn't
|
|
171
|
-
// go through the normalizer
|
|
172
|
-
options._injectStyles = hook
|
|
173
|
-
// register for functional component in vue file
|
|
174
|
-
var originalRender = options.render
|
|
175
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
176
|
-
hook.call(context)
|
|
177
|
-
return originalRender(h, context)
|
|
178
|
-
}
|
|
179
|
-
} else {
|
|
180
|
-
// inject component registration as beforeCreate hook
|
|
181
|
-
var existing = options.beforeCreate
|
|
182
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
183
|
-
}
|
|
184
|
-
}
|
|
275
|
+
return string.replace(RE_NARGS, function (match, prefix, i, index) {
|
|
276
|
+
var result = void 0;
|
|
185
277
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
278
|
+
if (string[index - 1] === '{' && string[index + match.length] === '}') {
|
|
279
|
+
return i;
|
|
280
|
+
} else {
|
|
281
|
+
result = Object(util["j" /* hasOwn */])(args, i) ? args[i] : null;
|
|
282
|
+
if (result === null || result === undefined) {
|
|
283
|
+
return '';
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return result;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return template;
|
|
292
|
+
});
|
|
293
|
+
// CONCATENATED MODULE: ./src/locale/index.js
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
var locale_format = format(external_vue_default.a);
|
|
300
|
+
var lang = zh_CN;
|
|
301
|
+
var merged = false;
|
|
302
|
+
var locale_i18nHandler = function i18nHandler() {
|
|
303
|
+
var vuei18n = Object.getPrototypeOf(this || external_vue_default.a).$t;
|
|
304
|
+
if (typeof vuei18n === 'function' && !!external_vue_default.a.locale) {
|
|
305
|
+
if (!merged) {
|
|
306
|
+
merged = true;
|
|
307
|
+
external_vue_default.a.locale(external_vue_default.a.config.lang, external_deepmerge_default()(lang, external_vue_default.a.locale(external_vue_default.a.config.lang) || {}, { clone: true }));
|
|
308
|
+
}
|
|
309
|
+
return vuei18n.apply(this, arguments);
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
var t = function t(path, options) {
|
|
314
|
+
var value = locale_i18nHandler.apply(this, arguments);
|
|
315
|
+
if (value !== null && value !== undefined) return value;
|
|
316
|
+
|
|
317
|
+
var array = path.split('.');
|
|
318
|
+
var current = lang;
|
|
319
|
+
|
|
320
|
+
for (var i = 0, j = array.length; i < j; i++) {
|
|
321
|
+
var property = array[i];
|
|
322
|
+
value = current[property];
|
|
323
|
+
if (i === j - 1) return locale_format(value, options);
|
|
324
|
+
if (!value) return '';
|
|
325
|
+
current = value;
|
|
326
|
+
}
|
|
327
|
+
return '';
|
|
328
|
+
};
|
|
191
329
|
|
|
330
|
+
var use = function use(l) {
|
|
331
|
+
lang = l || lang;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
var i18n = function i18n(fn) {
|
|
335
|
+
locale_i18nHandler = fn || locale_i18nHandler;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
/* harmony default export */ var locale = ({ use: use, t: t, i18n: i18n });
|
|
192
339
|
|
|
193
340
|
/***/ }),
|
|
194
341
|
|
|
195
|
-
/***/
|
|
196
|
-
/***/ (function(module,
|
|
342
|
+
/***/ 12:
|
|
343
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
344
|
+
|
|
345
|
+
"use strict";
|
|
346
|
+
/* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Show migrating guide in browser console.
|
|
350
|
+
*
|
|
351
|
+
* Usage:
|
|
352
|
+
* import Migrating from 'element-ui/src/mixins/migrating';
|
|
353
|
+
*
|
|
354
|
+
* mixins: [Migrating]
|
|
355
|
+
*
|
|
356
|
+
* add getMigratingConfig method for your component.
|
|
357
|
+
* getMigratingConfig() {
|
|
358
|
+
* return {
|
|
359
|
+
* props: {
|
|
360
|
+
* 'allow-no-selection': 'allow-no-selection is removed.',
|
|
361
|
+
* 'selection-mode': 'selection-mode is removed.'
|
|
362
|
+
* },
|
|
363
|
+
* events: {
|
|
364
|
+
* selectionchange: 'selectionchange is renamed to selection-change.'
|
|
365
|
+
* }
|
|
366
|
+
* };
|
|
367
|
+
* },
|
|
368
|
+
*/
|
|
369
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
370
|
+
mounted: function mounted() {
|
|
371
|
+
if (true) return;
|
|
372
|
+
if (!this.$vnode) return;
|
|
373
|
+
|
|
374
|
+
var _getMigratingConfig = this.getMigratingConfig(),
|
|
375
|
+
_getMigratingConfig$p = _getMigratingConfig.props,
|
|
376
|
+
props = _getMigratingConfig$p === undefined ? {} : _getMigratingConfig$p,
|
|
377
|
+
_getMigratingConfig$e = _getMigratingConfig.events,
|
|
378
|
+
events = _getMigratingConfig$e === undefined ? {} : _getMigratingConfig$e;
|
|
379
|
+
|
|
380
|
+
var _$vnode = this.$vnode,
|
|
381
|
+
data = _$vnode.data,
|
|
382
|
+
componentOptions = _$vnode.componentOptions;
|
|
383
|
+
|
|
384
|
+
var definedProps = data.attrs || {};
|
|
385
|
+
var definedEvents = componentOptions.listeners || {};
|
|
386
|
+
|
|
387
|
+
for (var propName in definedProps) {
|
|
388
|
+
propName = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "q"])(propName); // compatible with camel case
|
|
389
|
+
if (props[propName]) {
|
|
390
|
+
console.warn('[Element Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
for (var eventName in definedEvents) {
|
|
395
|
+
eventName = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "q"])(eventName); // compatible with camel case
|
|
396
|
+
if (events[eventName]) {
|
|
397
|
+
console.warn('[Element Migrating][' + this.$options.name + '][Event]: ' + events[eventName]);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
},
|
|
197
401
|
|
|
198
|
-
|
|
402
|
+
methods: {
|
|
403
|
+
getMigratingConfig: function getMigratingConfig() {
|
|
404
|
+
return {
|
|
405
|
+
props: {},
|
|
406
|
+
events: {}
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
});
|
|
199
411
|
|
|
200
412
|
/***/ }),
|
|
201
413
|
|
|
202
|
-
/***/
|
|
414
|
+
/***/ 127:
|
|
203
415
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
204
416
|
|
|
205
417
|
"use strict";
|
|
206
418
|
// ESM COMPAT FLAG
|
|
207
419
|
__webpack_require__.r(__webpack_exports__);
|
|
208
420
|
|
|
209
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??
|
|
210
|
-
var render = function () {
|
|
211
|
-
var _vm = this
|
|
212
|
-
|
|
213
|
-
var _c = _vm._self._c || _h
|
|
421
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/fileUpload/src/main.vue?vue&type=template&id=dd74605c
|
|
422
|
+
var render = function render() {
|
|
423
|
+
var _vm = this,
|
|
424
|
+
_c = _vm._self._c
|
|
214
425
|
return _c(
|
|
215
426
|
"div",
|
|
216
427
|
{ staticClass: "cy-file-upload" },
|
|
@@ -422,514 +633,2619 @@ render._withStripped = true
|
|
|
422
633
|
|
|
423
634
|
// CONCATENATED MODULE: ./packages/fileUpload/src/main.vue?vue&type=template&id=dd74605c
|
|
424
635
|
|
|
425
|
-
// EXTERNAL MODULE:
|
|
426
|
-
var
|
|
427
|
-
var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
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);
|
|
428
638
|
|
|
429
|
-
//
|
|
430
|
-
var
|
|
431
|
-
|
|
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);
|
|
432
643
|
|
|
433
|
-
//
|
|
434
|
-
var button_ = __webpack_require__(13);
|
|
435
|
-
var button_default = /*#__PURE__*/__webpack_require__.n(button_);
|
|
644
|
+
// CONCATENATED MODULE: ./packages/fileUpload/src/main.vue
|
|
436
645
|
|
|
437
|
-
// 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
|
|
438
|
-
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"); }); }; }
|
|
439
646
|
|
|
440
|
-
//
|
|
441
|
-
//
|
|
442
|
-
//
|
|
443
|
-
//
|
|
444
|
-
//
|
|
445
|
-
//
|
|
446
|
-
//
|
|
447
|
-
//
|
|
448
|
-
//
|
|
449
|
-
//
|
|
450
|
-
//
|
|
451
|
-
//
|
|
452
|
-
//
|
|
453
|
-
//
|
|
454
|
-
//
|
|
455
|
-
//
|
|
456
|
-
//
|
|
457
|
-
//
|
|
458
|
-
//
|
|
459
|
-
//
|
|
460
|
-
//
|
|
461
|
-
//
|
|
462
|
-
//
|
|
463
|
-
//
|
|
464
|
-
//
|
|
465
|
-
//
|
|
466
|
-
//
|
|
467
|
-
//
|
|
468
|
-
//
|
|
469
|
-
//
|
|
470
|
-
//
|
|
471
|
-
//
|
|
472
|
-
//
|
|
473
|
-
//
|
|
474
|
-
//
|
|
475
|
-
//
|
|
476
|
-
//
|
|
477
|
-
//
|
|
478
|
-
//
|
|
479
|
-
//
|
|
480
|
-
//
|
|
481
|
-
//
|
|
482
|
-
//
|
|
483
|
-
//
|
|
484
|
-
//
|
|
485
|
-
//
|
|
486
|
-
//
|
|
487
|
-
//
|
|
488
|
-
//
|
|
489
|
-
//
|
|
490
|
-
//
|
|
491
|
-
//
|
|
492
|
-
//
|
|
493
|
-
//
|
|
494
|
-
//
|
|
495
|
-
//
|
|
496
|
-
//
|
|
497
|
-
//
|
|
498
|
-
//
|
|
499
|
-
//
|
|
500
|
-
//
|
|
501
|
-
//
|
|
502
|
-
//
|
|
503
|
-
//
|
|
504
|
-
//
|
|
505
|
-
//
|
|
506
|
-
//
|
|
507
|
-
//
|
|
508
647
|
|
|
509
648
|
|
|
510
649
|
|
|
650
|
+
/* normalize component */
|
|
511
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
|
+
)
|
|
512
662
|
|
|
513
|
-
/* harmony default export */ var
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
return ['jpg', 'jpeg', 'png', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf'];
|
|
539
|
-
}
|
|
540
|
-
},
|
|
541
|
-
// 是否显示提示
|
|
542
|
-
isShowTip: {
|
|
543
|
-
type: Boolean,
|
|
544
|
-
default: true
|
|
545
|
-
},
|
|
546
|
-
// 上传的图片服务器地址
|
|
547
|
-
uploadFileUrl: {
|
|
548
|
-
type: String,
|
|
549
|
-
default: '/system/resource_file/upload_file'
|
|
550
|
-
},
|
|
551
|
-
// 请求参数
|
|
552
|
-
data: {
|
|
553
|
-
type: Object,
|
|
554
|
-
default: function _default() {
|
|
555
|
-
return {};
|
|
663
|
+
/* harmony default export */ var main = (component.exports);
|
|
664
|
+
// CONCATENATED MODULE: ./packages/fileUpload/index.js
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
/* istanbul ignore next */
|
|
668
|
+
main.install = function (Vue) {
|
|
669
|
+
Vue.component(main.name, main);
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
/* harmony default export */ var packages_fileUpload = __webpack_exports__["default"] = (main);
|
|
673
|
+
|
|
674
|
+
/***/ }),
|
|
675
|
+
|
|
676
|
+
/***/ 13:
|
|
677
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
678
|
+
|
|
679
|
+
"use strict";
|
|
680
|
+
/* harmony import */ var element_ui_src_locale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
|
|
681
|
+
|
|
682
|
+
|
|
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];
|
|
556
688
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
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
|
+
},
|
|
864
|
+
elFormItem: {
|
|
865
|
+
default: ''
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
|
|
869
|
+
props: {
|
|
870
|
+
type: {
|
|
871
|
+
type: String,
|
|
872
|
+
default: 'default'
|
|
873
|
+
},
|
|
874
|
+
size: String,
|
|
875
|
+
icon: {
|
|
876
|
+
type: String,
|
|
877
|
+
default: ''
|
|
878
|
+
},
|
|
879
|
+
nativeType: {
|
|
880
|
+
type: String,
|
|
881
|
+
default: 'button'
|
|
882
|
+
},
|
|
883
|
+
loading: Boolean,
|
|
884
|
+
disabled: Boolean,
|
|
885
|
+
plain: Boolean,
|
|
886
|
+
autofocus: Boolean,
|
|
887
|
+
round: Boolean,
|
|
888
|
+
circle: Boolean
|
|
889
|
+
},
|
|
890
|
+
|
|
891
|
+
computed: {
|
|
892
|
+
_elFormItemSize: function _elFormItemSize() {
|
|
893
|
+
return (this.elFormItem || {}).elFormItemSize;
|
|
894
|
+
},
|
|
895
|
+
buttonSize: function buttonSize() {
|
|
896
|
+
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
|
897
|
+
},
|
|
898
|
+
buttonDisabled: function buttonDisabled() {
|
|
899
|
+
return this.$options.propsData.hasOwnProperty('disabled') ? this.disabled : (this.elForm || {}).disabled;
|
|
900
|
+
}
|
|
901
|
+
},
|
|
902
|
+
|
|
903
|
+
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
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
/* normalize component */
|
|
921
|
+
|
|
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
|
+
)
|
|
932
|
+
|
|
933
|
+
/* harmony default export */ var src_button = (component.exports);
|
|
934
|
+
// CONCATENATED MODULE: ./packages/button/index.js
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
/* istanbul ignore next */
|
|
938
|
+
src_button.install = function (Vue) {
|
|
939
|
+
Vue.component(src_button.name, src_button);
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
/* harmony default export */ var packages_button = __webpack_exports__["default"] = (src_button);
|
|
943
|
+
|
|
944
|
+
/***/ }),
|
|
945
|
+
|
|
946
|
+
/***/ 29:
|
|
947
|
+
/***/ (function(module, exports) {
|
|
948
|
+
|
|
949
|
+
module.exports = require("babel-helper-vue-jsx-merge-props");
|
|
950
|
+
|
|
951
|
+
/***/ }),
|
|
952
|
+
|
|
953
|
+
/***/ 3:
|
|
954
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
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; };
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
990
|
+
|
|
991
|
+
function noop() {};
|
|
992
|
+
|
|
993
|
+
function hasOwn(obj, key) {
|
|
994
|
+
return hasOwnProperty.call(obj, key);
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
function extend(to, _from) {
|
|
998
|
+
for (var key in _from) {
|
|
999
|
+
to[key] = _from[key];
|
|
1000
|
+
}
|
|
1001
|
+
return to;
|
|
1002
|
+
};
|
|
1003
|
+
|
|
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
|
+
};
|
|
1013
|
+
|
|
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
|
+
|
|
1023
|
+
if (i === j - 1) {
|
|
1024
|
+
result = current[path];
|
|
1025
|
+
break;
|
|
1026
|
+
}
|
|
1027
|
+
current = current[path];
|
|
1028
|
+
}
|
|
1029
|
+
return result;
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
function getPropByPath(obj, path, strict) {
|
|
1033
|
+
var tempObj = obj;
|
|
1034
|
+
path = path.replace(/\[(\w+)\]/g, '.$1');
|
|
1035
|
+
path = path.replace(/^\./, '');
|
|
1036
|
+
|
|
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
|
+
};
|
|
1057
|
+
|
|
1058
|
+
var generateId = function generateId() {
|
|
1059
|
+
return Math.floor(Math.random() * 10000);
|
|
1060
|
+
};
|
|
1061
|
+
|
|
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
|
+
|
|
1074
|
+
var escapeRegexpString = function escapeRegexpString() {
|
|
1075
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1076
|
+
return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
|
|
1077
|
+
};
|
|
1078
|
+
|
|
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;
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
return -1;
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
var arrayFind = function arrayFind(arr, pred) {
|
|
1090
|
+
var idx = arrayFindIndex(arr, pred);
|
|
1091
|
+
return idx !== -1 ? arr[idx] : undefined;
|
|
1092
|
+
};
|
|
1093
|
+
|
|
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
|
+
|
|
1105
|
+
var isIE = function isIE() {
|
|
1106
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
|
|
1107
|
+
};
|
|
1108
|
+
|
|
1109
|
+
var isEdge = function isEdge() {
|
|
1110
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1113
|
+
var isFirefox = function isFirefox() {
|
|
1114
|
+
return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
|
|
1115
|
+
};
|
|
1116
|
+
|
|
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
|
+
};
|
|
1131
|
+
|
|
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
|
+
};
|
|
1136
|
+
|
|
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
|
+
};
|
|
1141
|
+
|
|
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
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
var arrayEquals = function arrayEquals(arrayA, arrayB) {
|
|
1155
|
+
arrayA = arrayA || [];
|
|
1156
|
+
arrayB = arrayB || [];
|
|
1157
|
+
|
|
1158
|
+
if (arrayA.length !== arrayB.length) {
|
|
1159
|
+
return false;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
for (var i = 0; i < arrayA.length; i++) {
|
|
1163
|
+
if (!looseEqual(arrayA[i], arrayB[i])) {
|
|
1164
|
+
return false;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
return true;
|
|
1169
|
+
};
|
|
1170
|
+
|
|
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
|
+
};
|
|
1177
|
+
|
|
1178
|
+
var isEmpty = function isEmpty(val) {
|
|
1179
|
+
// null or undefined
|
|
1180
|
+
if (val == null) return true;
|
|
1181
|
+
|
|
1182
|
+
if (typeof val === 'boolean') return false;
|
|
1183
|
+
|
|
1184
|
+
if (typeof val === 'number') return !val;
|
|
1185
|
+
|
|
1186
|
+
if (val instanceof Error) return val.message === '';
|
|
1187
|
+
|
|
1188
|
+
switch (Object.prototype.toString.call(val)) {
|
|
1189
|
+
// String or Array
|
|
1190
|
+
case '[object String]':
|
|
1191
|
+
case '[object Array]':
|
|
1192
|
+
return !val.length;
|
|
1193
|
+
|
|
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
|
+
}
|
|
1207
|
+
|
|
1208
|
+
return false;
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
function rafThrottle(fn) {
|
|
1212
|
+
var locked = false;
|
|
1213
|
+
return function () {
|
|
1214
|
+
var _this = this;
|
|
1215
|
+
|
|
1216
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
1217
|
+
args[_key] = arguments[_key];
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
if (locked) return;
|
|
1221
|
+
locked = true;
|
|
1222
|
+
window.requestAnimationFrame(function (_) {
|
|
1223
|
+
fn.apply(_this, args);
|
|
1224
|
+
locked = false;
|
|
1225
|
+
});
|
|
1226
|
+
};
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
function objToArray(obj) {
|
|
1230
|
+
if (Array.isArray(obj)) {
|
|
1231
|
+
return obj;
|
|
1232
|
+
}
|
|
1233
|
+
return isEmpty(obj) ? [] : [obj];
|
|
1234
|
+
}
|
|
1235
|
+
|
|
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
|
+
|
|
1240
|
+
/***/ }),
|
|
1241
|
+
|
|
1242
|
+
/***/ 34:
|
|
1243
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1244
|
+
|
|
1245
|
+
"use strict";
|
|
1246
|
+
// ESM COMPAT FLAG
|
|
1247
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1248
|
+
|
|
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
|
|
1250
|
+
var render = function render() {
|
|
1251
|
+
var _vm = this,
|
|
1252
|
+
_c = _vm._self._c
|
|
1253
|
+
return _c(
|
|
1254
|
+
"div",
|
|
1255
|
+
{
|
|
1256
|
+
staticClass: "el-progress",
|
|
1257
|
+
class: [
|
|
1258
|
+
"el-progress--" + _vm.type,
|
|
1259
|
+
_vm.status ? "is-" + _vm.status : "",
|
|
1260
|
+
{
|
|
1261
|
+
"el-progress--without-text": !_vm.showText,
|
|
1262
|
+
"el-progress--text-inside": _vm.textInside,
|
|
1263
|
+
},
|
|
1264
|
+
],
|
|
1265
|
+
attrs: {
|
|
1266
|
+
role: "progressbar",
|
|
1267
|
+
"aria-valuenow": _vm.percentage,
|
|
1268
|
+
"aria-valuemin": "0",
|
|
1269
|
+
"aria-valuemax": "100",
|
|
1270
|
+
},
|
|
1271
|
+
},
|
|
1272
|
+
[
|
|
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(),
|
|
1359
|
+
]
|
|
1360
|
+
)
|
|
1361
|
+
}
|
|
1362
|
+
var staticRenderFns = []
|
|
1363
|
+
render._withStripped = true
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
// CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=template&id=279ef2ef
|
|
1367
|
+
|
|
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
|
|
1369
|
+
|
|
1370
|
+
/* harmony default export */ var progressvue_type_script_lang_js = ({
|
|
1371
|
+
name: 'ElProgress',
|
|
1372
|
+
props: {
|
|
1373
|
+
type: {
|
|
1374
|
+
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
|
|
1397
|
+
},
|
|
1398
|
+
strokeLinecap: {
|
|
1399
|
+
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
|
+
default: ''
|
|
1417
|
+
},
|
|
1418
|
+
defineBackColor: {
|
|
1419
|
+
type: [String, Array, Function],
|
|
1420
|
+
default: '#ebeef5'
|
|
1421
|
+
},
|
|
1422
|
+
textColor: {
|
|
1423
|
+
type: [String, Array, Function],
|
|
1424
|
+
default: '#606266'
|
|
1425
|
+
},
|
|
1426
|
+
format: Function
|
|
1427
|
+
},
|
|
1428
|
+
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
|
+
}
|
|
1503
|
+
},
|
|
1504
|
+
progressTextSize: function progressTextSize() {
|
|
1505
|
+
return this.type === 'line' ? 12 + this.strokeWidth * 0.4 : this.width * 0.111111 + 2;
|
|
1506
|
+
},
|
|
1507
|
+
content: function content() {
|
|
1508
|
+
if (typeof this.format === 'function') {
|
|
1509
|
+
return this.format(this.percentage) || '';
|
|
1510
|
+
} else {
|
|
1511
|
+
return this.percentage + '%';
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
},
|
|
1515
|
+
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
|
+
});
|
|
1529
|
+
|
|
1530
|
+
for (var i = 0; i < colorArray.length; i++) {
|
|
1531
|
+
if (colorArray[i].percentage > percentage) {
|
|
1532
|
+
return colorArray[i].color;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
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;
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
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);
|
|
1556
|
+
|
|
1557
|
+
// CONCATENATED MODULE: ./packages/progress/src/progress.vue
|
|
1558
|
+
|
|
1559
|
+
|
|
1560
|
+
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
/* normalize component */
|
|
1564
|
+
|
|
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
|
+
)
|
|
1575
|
+
|
|
1576
|
+
/* harmony default export */ var progress = (component.exports);
|
|
1577
|
+
// CONCATENATED MODULE: ./packages/progress/index.js
|
|
1578
|
+
|
|
1579
|
+
|
|
1580
|
+
/* istanbul ignore next */
|
|
1581
|
+
progress.install = function (Vue) {
|
|
1582
|
+
Vue.component(progress.name, progress);
|
|
1583
|
+
};
|
|
1584
|
+
|
|
1585
|
+
/* harmony default export */ var packages_progress = __webpack_exports__["default"] = (progress);
|
|
1586
|
+
|
|
1587
|
+
/***/ }),
|
|
1588
|
+
|
|
1589
|
+
/***/ 4:
|
|
1590
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1591
|
+
|
|
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; };
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
|
|
1605
|
+
function isString(obj) {
|
|
1606
|
+
return Object.prototype.toString.call(obj) === '[object String]';
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
function isObject(obj) {
|
|
1610
|
+
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
function isHtmlElement(node) {
|
|
1614
|
+
return node && node.nodeType === Node.ELEMENT_NODE;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
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]';
|
|
1624
|
+
};
|
|
1625
|
+
|
|
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
|
+
};
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
|
|
1633
|
+
|
|
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
|
+
|
|
1656
|
+
|
|
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"]],
|
|
1660
|
+
props: {
|
|
1661
|
+
// 值
|
|
1662
|
+
value: {
|
|
1663
|
+
type: [Array, String],
|
|
1664
|
+
default: function _default() {
|
|
1665
|
+
return [];
|
|
1666
|
+
}
|
|
1667
|
+
},
|
|
1668
|
+
// 数量限制
|
|
1669
|
+
limit: {
|
|
1670
|
+
type: Number,
|
|
1671
|
+
default: 1000
|
|
1672
|
+
},
|
|
1673
|
+
// 大小限制(MB)
|
|
1674
|
+
fileSize: {
|
|
1675
|
+
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'];
|
|
1683
|
+
}
|
|
1684
|
+
},
|
|
1685
|
+
// 是否显示提示
|
|
1686
|
+
isShowTip: {
|
|
1687
|
+
type: Boolean,
|
|
1688
|
+
default: true
|
|
1689
|
+
},
|
|
1690
|
+
// 上传的图片服务器地址
|
|
1691
|
+
uploadFileUrl: {
|
|
1692
|
+
type: String,
|
|
1693
|
+
default: '/system/resource_file/upload_file'
|
|
1694
|
+
},
|
|
1695
|
+
// 请求参数
|
|
1696
|
+
data: {
|
|
1697
|
+
type: Object,
|
|
1698
|
+
default: function _default() {
|
|
1699
|
+
return {};
|
|
1700
|
+
}
|
|
1701
|
+
},
|
|
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
|
|
1755
|
+
},
|
|
1756
|
+
// 下载模板地址
|
|
1757
|
+
importTemplateName: {
|
|
1758
|
+
type: String,
|
|
1759
|
+
default: 'template.xls'
|
|
1760
|
+
},
|
|
1761
|
+
// 列表是否以缩略图展示
|
|
1762
|
+
isThumbnail: {
|
|
1763
|
+
type: Boolean,
|
|
1764
|
+
default: false
|
|
1765
|
+
},
|
|
1766
|
+
// 图片预览压缩率0-1,仅isThumbnail为true有效
|
|
1767
|
+
imgRatio: {
|
|
1768
|
+
type: Number,
|
|
1769
|
+
default: 1
|
|
1770
|
+
},
|
|
1771
|
+
// 是否允许下载
|
|
1772
|
+
isDownload: {
|
|
1773
|
+
type: Boolean,
|
|
1774
|
+
default: true
|
|
1775
|
+
},
|
|
1776
|
+
// 删除前回调, 必须为Promise
|
|
1777
|
+
deleteBefore: {
|
|
1778
|
+
type: Function
|
|
1779
|
+
},
|
|
1780
|
+
|
|
1781
|
+
// 服务器转发代理规则,匹配请求路径的前缀
|
|
1782
|
+
baseUrl: {
|
|
1783
|
+
type: String,
|
|
1784
|
+
default: ''
|
|
1785
|
+
},
|
|
1786
|
+
// 获取token的方法
|
|
1787
|
+
getToken: {
|
|
1788
|
+
type: Function,
|
|
1789
|
+
default: function _default() {
|
|
1790
|
+
return '';
|
|
1791
|
+
}
|
|
1792
|
+
},
|
|
1793
|
+
// 下载接口方法,必须返回一个Promise
|
|
1794
|
+
fileDownLoad: {
|
|
1795
|
+
type: Function,
|
|
1796
|
+
default: function _default() {
|
|
1797
|
+
return Promise.resolve();
|
|
1798
|
+
}
|
|
1799
|
+
},
|
|
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
|
+
}
|
|
1839
|
+
},
|
|
1840
|
+
computed: {
|
|
1841
|
+
// 是否显示提示
|
|
1842
|
+
showTip: function showTip() {
|
|
1843
|
+
return this.isShowTip && (this.fileType && !this.fileType.includes('*') || this.fileSize);
|
|
1844
|
+
},
|
|
1845
|
+
fileAccept: function fileAccept() {
|
|
1846
|
+
var arr = this.fileType.includes('*') ? [] : this.fileType.map(function (item) {
|
|
1847
|
+
return '.' + item;
|
|
1848
|
+
});
|
|
1849
|
+
return arr.join();
|
|
1850
|
+
},
|
|
1851
|
+
headers: function headers() {
|
|
1852
|
+
return {
|
|
1853
|
+
Authorization: 'Bearer ' + this.getToken()
|
|
1854
|
+
};
|
|
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;
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
return true;
|
|
1882
|
+
},
|
|
1883
|
+
|
|
1884
|
+
|
|
1885
|
+
/**
|
|
1886
|
+
* 文件个数超出
|
|
1887
|
+
*/
|
|
1888
|
+
handleExceed: function handleExceed() {
|
|
1889
|
+
if (this.limit === 1) {
|
|
1890
|
+
this.$message.error('只能上传单个文件!');
|
|
1891
|
+
} else {
|
|
1892
|
+
this.$message.error('\u4E0A\u4F20\u6587\u4EF6\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7 ' + this.limit + ' \u4E2A!');
|
|
1893
|
+
}
|
|
1894
|
+
this.downloadLoading = false;
|
|
1895
|
+
},
|
|
1896
|
+
|
|
1897
|
+
|
|
1898
|
+
/**
|
|
1899
|
+
* 上传失败
|
|
1900
|
+
*/
|
|
1901
|
+
handleUploadError: function handleUploadError(err) {
|
|
1902
|
+
this.$message.error('上传失败, 请重试');
|
|
1903
|
+
this.downloadLoading = false;
|
|
1904
|
+
},
|
|
1905
|
+
|
|
1906
|
+
|
|
1907
|
+
/**
|
|
1908
|
+
* 上传成功回调
|
|
1909
|
+
*/
|
|
1910
|
+
handleUploadSuccess: function handleUploadSuccess(res, file) {
|
|
1911
|
+
if (res.code !== 200) {
|
|
1912
|
+
this.$message.error(res.msg);
|
|
1913
|
+
} else {
|
|
1914
|
+
if (this.isSuccessMsg) this.$message.success('上传成功');
|
|
1915
|
+
this.fileList.push(res.data);
|
|
1916
|
+
}
|
|
1917
|
+
this.downloadLoading = false;
|
|
1918
|
+
this.$emit('input', this.fileList);
|
|
1919
|
+
},
|
|
1920
|
+
|
|
1921
|
+
|
|
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
|
+
}
|
|
1938
|
+
|
|
1939
|
+
_context.prev = 1;
|
|
1940
|
+
_context.next = 4;
|
|
1941
|
+
return _this.deleteBefore(_this.fileList[index], index);
|
|
1942
|
+
|
|
1943
|
+
case 4:
|
|
1944
|
+
res = _context.sent;
|
|
1945
|
+
|
|
1946
|
+
if (res) {
|
|
1947
|
+
_context.next = 7;
|
|
1948
|
+
break;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
return _context.abrupt('return');
|
|
1952
|
+
|
|
1953
|
+
case 7:
|
|
1954
|
+
_context.next = 13;
|
|
1955
|
+
break;
|
|
1956
|
+
|
|
1957
|
+
case 9:
|
|
1958
|
+
_context.prev = 9;
|
|
1959
|
+
_context.t0 = _context['catch'](1);
|
|
1960
|
+
|
|
1961
|
+
console.log(_context.t0);
|
|
1962
|
+
return _context.abrupt('return');
|
|
1963
|
+
|
|
1964
|
+
case 13:
|
|
1965
|
+
_this.fileList.splice(index, 1);
|
|
1966
|
+
_this.$emit('input', _this.fileList);
|
|
1967
|
+
|
|
1968
|
+
case 15:
|
|
1969
|
+
case 'end':
|
|
1970
|
+
return _context.stop();
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}, _callee, _this, [[1, 9]]);
|
|
1974
|
+
}))();
|
|
1975
|
+
},
|
|
1976
|
+
|
|
1977
|
+
|
|
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
|
+
},
|
|
1988
|
+
|
|
1989
|
+
|
|
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
|
+
},
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
/**
|
|
2002
|
+
* 查看 预览
|
|
2003
|
+
*/
|
|
2004
|
+
previewFile: function previewFile(file) {
|
|
2005
|
+
window.open(this.getFilePreviewUrl(file));
|
|
2006
|
+
},
|
|
2007
|
+
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* 附件下载
|
|
2011
|
+
* */
|
|
2012
|
+
downloadAttach: function downloadAttach(file) {
|
|
2013
|
+
var _this2 = this;
|
|
2014
|
+
|
|
2015
|
+
if (!this.isDownload) return;
|
|
2016
|
+
|
|
2017
|
+
var id = file.id,
|
|
2018
|
+
file_name = file.file_name,
|
|
2019
|
+
file_type = file.file_type;
|
|
2020
|
+
|
|
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
|
+
},
|
|
2043
|
+
|
|
2044
|
+
|
|
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
|
+
|
|
2058
|
+
|
|
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)))
|
|
2072
|
+
|
|
2073
|
+
/***/ }),
|
|
2074
|
+
|
|
2075
|
+
/***/ 51:
|
|
2076
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2077
|
+
|
|
2078
|
+
"use strict";
|
|
2079
|
+
// ESM COMPAT FLAG
|
|
2080
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2081
|
+
|
|
2082
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=template&id=f52834b0
|
|
2083
|
+
var upload_listvue_type_template_id_f52834b0_render = function render() {
|
|
2084
|
+
var _vm = this,
|
|
2085
|
+
_c = _vm._self._c
|
|
2086
|
+
return _c(
|
|
2087
|
+
"transition-group",
|
|
2088
|
+
{
|
|
2089
|
+
class: [
|
|
2090
|
+
"el-upload-list",
|
|
2091
|
+
"el-upload-list--" + _vm.listType,
|
|
2092
|
+
{ "is-disabled": _vm.disabled },
|
|
2093
|
+
],
|
|
2094
|
+
attrs: { tag: "ul", name: "el-list" },
|
|
2095
|
+
},
|
|
2096
|
+
_vm._l(_vm.files, function (file) {
|
|
2097
|
+
return _c(
|
|
2098
|
+
"li",
|
|
2099
|
+
{
|
|
2100
|
+
key: file.uid,
|
|
2101
|
+
class: [
|
|
2102
|
+
"el-upload-list__item",
|
|
2103
|
+
"is-" + file.status,
|
|
2104
|
+
_vm.focusing ? "focusing" : "",
|
|
2105
|
+
],
|
|
2106
|
+
attrs: { tabindex: "0" },
|
|
2107
|
+
on: {
|
|
2108
|
+
keydown: function ($event) {
|
|
2109
|
+
if (
|
|
2110
|
+
!$event.type.indexOf("key") &&
|
|
2111
|
+
_vm._k($event.keyCode, "delete", [8, 46], $event.key, [
|
|
2112
|
+
"Backspace",
|
|
2113
|
+
"Delete",
|
|
2114
|
+
"Del",
|
|
2115
|
+
])
|
|
2116
|
+
)
|
|
2117
|
+
return null
|
|
2118
|
+
!_vm.disabled && _vm.$emit("remove", file)
|
|
2119
|
+
},
|
|
2120
|
+
focus: function ($event) {
|
|
2121
|
+
_vm.focusing = true
|
|
2122
|
+
},
|
|
2123
|
+
blur: function ($event) {
|
|
2124
|
+
_vm.focusing = false
|
|
2125
|
+
},
|
|
2126
|
+
click: function ($event) {
|
|
2127
|
+
_vm.focusing = false
|
|
2128
|
+
},
|
|
2129
|
+
},
|
|
2130
|
+
},
|
|
2131
|
+
[
|
|
2132
|
+
_vm._t(
|
|
2133
|
+
"default",
|
|
2134
|
+
function () {
|
|
2135
|
+
return [
|
|
2136
|
+
file.status !== "uploading" &&
|
|
2137
|
+
["picture-card", "picture"].indexOf(_vm.listType) > -1
|
|
2138
|
+
? _c("img", {
|
|
2139
|
+
staticClass: "el-upload-list__item-thumbnail",
|
|
2140
|
+
attrs: { src: file.url, alt: "" },
|
|
2141
|
+
})
|
|
2142
|
+
: _vm._e(),
|
|
2143
|
+
_c(
|
|
2144
|
+
"a",
|
|
2145
|
+
{
|
|
2146
|
+
staticClass: "el-upload-list__item-name",
|
|
2147
|
+
on: {
|
|
2148
|
+
click: function ($event) {
|
|
2149
|
+
return _vm.handleClick(file)
|
|
2150
|
+
},
|
|
2151
|
+
},
|
|
2152
|
+
},
|
|
2153
|
+
[
|
|
2154
|
+
_c("i", { staticClass: "el-icon-document" }),
|
|
2155
|
+
_vm._v(_vm._s(file.name) + "\n\t\t\t"),
|
|
2156
|
+
]
|
|
2157
|
+
),
|
|
2158
|
+
_c(
|
|
2159
|
+
"label",
|
|
2160
|
+
{ staticClass: "el-upload-list__item-status-label" },
|
|
2161
|
+
[
|
|
2162
|
+
_c("i", {
|
|
2163
|
+
class: {
|
|
2164
|
+
"el-icon-upload-success": true,
|
|
2165
|
+
"el-icon-circle-check": _vm.listType === "text",
|
|
2166
|
+
"el-icon-check":
|
|
2167
|
+
["picture-card", "picture"].indexOf(_vm.listType) >
|
|
2168
|
+
-1,
|
|
2169
|
+
},
|
|
2170
|
+
}),
|
|
2171
|
+
]
|
|
2172
|
+
),
|
|
2173
|
+
!_vm.disabled
|
|
2174
|
+
? _c("i", {
|
|
2175
|
+
staticClass: "el-icon-close",
|
|
2176
|
+
on: {
|
|
2177
|
+
click: function ($event) {
|
|
2178
|
+
return _vm.$emit("remove", file)
|
|
2179
|
+
},
|
|
2180
|
+
},
|
|
2181
|
+
})
|
|
2182
|
+
: _vm._e(),
|
|
2183
|
+
!_vm.disabled
|
|
2184
|
+
? _c("i", { staticClass: "el-icon-close-tip" }, [
|
|
2185
|
+
_vm._v(_vm._s(_vm.t("el.upload.deleteTip"))),
|
|
2186
|
+
])
|
|
2187
|
+
: _vm._e(),
|
|
2188
|
+
file.status === "uploading"
|
|
2189
|
+
? _c("el-progress", {
|
|
2190
|
+
attrs: {
|
|
2191
|
+
type:
|
|
2192
|
+
_vm.listType === "picture-card" ? "circle" : "line",
|
|
2193
|
+
"stroke-width": _vm.listType === "picture-card" ? 6 : 2,
|
|
2194
|
+
percentage: _vm.parsePercentage(file.percentage),
|
|
2195
|
+
},
|
|
2196
|
+
})
|
|
2197
|
+
: _vm._e(),
|
|
2198
|
+
_vm.listType === "picture-card"
|
|
2199
|
+
? _c(
|
|
2200
|
+
"span",
|
|
2201
|
+
{ staticClass: "el-upload-list__item-actions" },
|
|
2202
|
+
[
|
|
2203
|
+
_vm.handlePreview && _vm.listType === "picture-card"
|
|
2204
|
+
? _c(
|
|
2205
|
+
"span",
|
|
2206
|
+
{
|
|
2207
|
+
staticClass: "el-upload-list__item-preview",
|
|
2208
|
+
on: {
|
|
2209
|
+
click: function ($event) {
|
|
2210
|
+
return _vm.handlePreview(file)
|
|
2211
|
+
},
|
|
2212
|
+
},
|
|
2213
|
+
},
|
|
2214
|
+
[_c("i", { staticClass: "el-icon-zoom-in" })]
|
|
2215
|
+
)
|
|
2216
|
+
: _vm._e(),
|
|
2217
|
+
!_vm.disabled
|
|
2218
|
+
? _c(
|
|
2219
|
+
"span",
|
|
2220
|
+
{
|
|
2221
|
+
staticClass: "el-upload-list__item-delete",
|
|
2222
|
+
on: {
|
|
2223
|
+
click: function ($event) {
|
|
2224
|
+
return _vm.$emit("remove", file)
|
|
2225
|
+
},
|
|
2226
|
+
},
|
|
2227
|
+
},
|
|
2228
|
+
[_c("i", { staticClass: "el-icon-delete" })]
|
|
2229
|
+
)
|
|
2230
|
+
: _vm._e(),
|
|
2231
|
+
]
|
|
2232
|
+
)
|
|
2233
|
+
: _vm._e(),
|
|
2234
|
+
]
|
|
2235
|
+
},
|
|
2236
|
+
{ file: file }
|
|
2237
|
+
),
|
|
2238
|
+
],
|
|
2239
|
+
2
|
|
2240
|
+
)
|
|
2241
|
+
}),
|
|
2242
|
+
0
|
|
2243
|
+
)
|
|
2244
|
+
}
|
|
2245
|
+
var staticRenderFns = []
|
|
2246
|
+
upload_listvue_type_template_id_f52834b0_render._withStripped = true
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=template&id=f52834b0
|
|
2250
|
+
|
|
2251
|
+
// EXTERNAL MODULE: ./src/mixins/locale.js
|
|
2252
|
+
var locale = __webpack_require__(13);
|
|
2253
|
+
|
|
2254
|
+
// EXTERNAL MODULE: ./packages/progress/index.js + 5 modules
|
|
2255
|
+
var progress = __webpack_require__(34);
|
|
2256
|
+
|
|
2257
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=script&lang=js
|
|
2258
|
+
|
|
2259
|
+
|
|
2260
|
+
|
|
2261
|
+
|
|
2262
|
+
/* harmony default export */ var upload_listvue_type_script_lang_js = ({
|
|
2263
|
+
|
|
2264
|
+
name: 'ElUploadList',
|
|
2265
|
+
|
|
2266
|
+
mixins: [locale["a" /* default */]],
|
|
2267
|
+
|
|
2268
|
+
data: function data() {
|
|
2269
|
+
return {
|
|
2270
|
+
focusing: false
|
|
2271
|
+
};
|
|
2272
|
+
},
|
|
2273
|
+
|
|
2274
|
+
components: { ElProgress: progress["default"] },
|
|
2275
|
+
|
|
2276
|
+
props: {
|
|
2277
|
+
files: {
|
|
2278
|
+
type: Array,
|
|
2279
|
+
default: function _default() {
|
|
2280
|
+
return [];
|
|
2281
|
+
}
|
|
2282
|
+
},
|
|
2283
|
+
disabled: {
|
|
2284
|
+
type: Boolean,
|
|
2285
|
+
default: false
|
|
2286
|
+
},
|
|
2287
|
+
handlePreview: Function,
|
|
2288
|
+
listType: String
|
|
2289
|
+
},
|
|
2290
|
+
methods: {
|
|
2291
|
+
parsePercentage: function parsePercentage(val) {
|
|
2292
|
+
return parseInt(val, 10);
|
|
2293
|
+
},
|
|
2294
|
+
handleClick: function handleClick(file) {
|
|
2295
|
+
this.handlePreview && this.handlePreview(file);
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
});
|
|
2299
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=script&lang=js
|
|
2300
|
+
/* harmony default export */ var src_upload_listvue_type_script_lang_js = (upload_listvue_type_script_lang_js);
|
|
2301
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
2302
|
+
var componentNormalizer = __webpack_require__(2);
|
|
2303
|
+
|
|
2304
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-list.vue
|
|
2305
|
+
|
|
2306
|
+
|
|
2307
|
+
|
|
2308
|
+
|
|
2309
|
+
|
|
2310
|
+
/* normalize component */
|
|
2311
|
+
|
|
2312
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
2313
|
+
src_upload_listvue_type_script_lang_js,
|
|
2314
|
+
upload_listvue_type_template_id_f52834b0_render,
|
|
2315
|
+
staticRenderFns,
|
|
2316
|
+
false,
|
|
2317
|
+
null,
|
|
2318
|
+
null,
|
|
2319
|
+
null
|
|
2320
|
+
|
|
2321
|
+
)
|
|
2322
|
+
|
|
2323
|
+
/* harmony default export */ var upload_list = (component.exports);
|
|
2324
|
+
// EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props"
|
|
2325
|
+
var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(29);
|
|
2326
|
+
var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_);
|
|
2327
|
+
|
|
2328
|
+
// CONCATENATED MODULE: ./packages/upload/src/ajax.js
|
|
2329
|
+
function getError(action, option, xhr) {
|
|
2330
|
+
var msg = void 0;
|
|
2331
|
+
if (xhr.response) {
|
|
2332
|
+
msg = '' + (xhr.response.error || xhr.response);
|
|
2333
|
+
} else if (xhr.responseText) {
|
|
2334
|
+
msg = '' + xhr.responseText;
|
|
2335
|
+
} else {
|
|
2336
|
+
msg = 'fail to post ' + action + ' ' + xhr.status;
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
var err = new Error(msg);
|
|
2340
|
+
err.status = xhr.status;
|
|
2341
|
+
err.method = 'post';
|
|
2342
|
+
err.url = action;
|
|
2343
|
+
return err;
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2346
|
+
function getBody(xhr) {
|
|
2347
|
+
var text = xhr.responseText || xhr.response;
|
|
2348
|
+
if (!text) {
|
|
2349
|
+
return text;
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
try {
|
|
2353
|
+
return JSON.parse(text);
|
|
2354
|
+
} catch (e) {
|
|
2355
|
+
return text;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
function upload(option) {
|
|
2360
|
+
if (typeof XMLHttpRequest === 'undefined') {
|
|
2361
|
+
return;
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
var xhr = new XMLHttpRequest();
|
|
2365
|
+
var action = option.action;
|
|
2366
|
+
|
|
2367
|
+
if (xhr.upload) {
|
|
2368
|
+
xhr.upload.onprogress = function progress(e) {
|
|
2369
|
+
if (e.total > 0) {
|
|
2370
|
+
e.percent = e.loaded / e.total * 100;
|
|
2371
|
+
}
|
|
2372
|
+
option.onProgress(e);
|
|
2373
|
+
};
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
var formData = new FormData();
|
|
2377
|
+
|
|
2378
|
+
if (option.data) {
|
|
2379
|
+
Object.keys(option.data).forEach(function (key) {
|
|
2380
|
+
formData.append(key, option.data[key]);
|
|
2381
|
+
});
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
formData.append(option.filename, option.file, option.file.name);
|
|
2385
|
+
|
|
2386
|
+
xhr.onerror = function error(e) {
|
|
2387
|
+
option.onError(e);
|
|
2388
|
+
};
|
|
2389
|
+
|
|
2390
|
+
xhr.onload = function onload() {
|
|
2391
|
+
if (xhr.status < 200 || xhr.status >= 300) {
|
|
2392
|
+
return option.onError(getError(action, option, xhr));
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
option.onSuccess(getBody(xhr));
|
|
2396
|
+
};
|
|
2397
|
+
|
|
2398
|
+
xhr.open('post', action, true);
|
|
2399
|
+
|
|
2400
|
+
if (option.withCredentials && 'withCredentials' in xhr) {
|
|
2401
|
+
xhr.withCredentials = true;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
var headers = option.headers || {};
|
|
2405
|
+
|
|
2406
|
+
for (var item in headers) {
|
|
2407
|
+
if (headers.hasOwnProperty(item) && headers[item] !== null) {
|
|
2408
|
+
xhr.setRequestHeader(item, headers[item]);
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
xhr.send(formData);
|
|
2412
|
+
return xhr;
|
|
2413
|
+
}
|
|
2414
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=template&id=7a1289f9
|
|
2415
|
+
var upload_draggervue_type_template_id_7a1289f9_render = function render() {
|
|
2416
|
+
var _vm = this,
|
|
2417
|
+
_c = _vm._self._c
|
|
2418
|
+
return _c(
|
|
2419
|
+
"div",
|
|
2420
|
+
{
|
|
2421
|
+
staticClass: "el-upload-dragger",
|
|
2422
|
+
class: {
|
|
2423
|
+
"is-dragover": _vm.dragover,
|
|
2424
|
+
},
|
|
2425
|
+
on: {
|
|
2426
|
+
drop: function ($event) {
|
|
2427
|
+
$event.preventDefault()
|
|
2428
|
+
return _vm.onDrop.apply(null, arguments)
|
|
2429
|
+
},
|
|
2430
|
+
dragover: function ($event) {
|
|
2431
|
+
$event.preventDefault()
|
|
2432
|
+
return _vm.onDragover.apply(null, arguments)
|
|
2433
|
+
},
|
|
2434
|
+
dragleave: function ($event) {
|
|
2435
|
+
$event.preventDefault()
|
|
2436
|
+
_vm.dragover = false
|
|
2437
|
+
},
|
|
2438
|
+
},
|
|
2439
|
+
},
|
|
2440
|
+
[_vm._t("default")],
|
|
2441
|
+
2
|
|
2442
|
+
)
|
|
2443
|
+
}
|
|
2444
|
+
var upload_draggervue_type_template_id_7a1289f9_staticRenderFns = []
|
|
2445
|
+
upload_draggervue_type_template_id_7a1289f9_render._withStripped = true
|
|
2446
|
+
|
|
2447
|
+
|
|
2448
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=template&id=7a1289f9
|
|
2449
|
+
|
|
2450
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js
|
|
2451
|
+
|
|
2452
|
+
/* harmony default export */ var upload_draggervue_type_script_lang_js = ({
|
|
2453
|
+
name: 'ElUploadDrag',
|
|
2454
|
+
props: {
|
|
2455
|
+
disabled: Boolean
|
|
2456
|
+
},
|
|
2457
|
+
inject: {
|
|
2458
|
+
uploader: {
|
|
2459
|
+
default: ''
|
|
2460
|
+
}
|
|
2461
|
+
},
|
|
2462
|
+
data: function data() {
|
|
2463
|
+
return {
|
|
2464
|
+
dragover: false
|
|
2465
|
+
};
|
|
2466
|
+
},
|
|
2467
|
+
|
|
2468
|
+
methods: {
|
|
2469
|
+
onDragover: function onDragover() {
|
|
2470
|
+
if (!this.disabled) {
|
|
2471
|
+
this.dragover = true;
|
|
2472
|
+
}
|
|
2473
|
+
},
|
|
2474
|
+
onDrop: function onDrop(e) {
|
|
2475
|
+
if (this.disabled || !this.uploader) return;
|
|
2476
|
+
var accept = this.uploader.accept;
|
|
2477
|
+
this.dragover = false;
|
|
2478
|
+
if (!accept) {
|
|
2479
|
+
this.$emit('file', e.dataTransfer.files);
|
|
2480
|
+
return;
|
|
2481
|
+
}
|
|
2482
|
+
this.$emit('file', [].slice.call(e.dataTransfer.files).filter(function (file) {
|
|
2483
|
+
var type = file.type,
|
|
2484
|
+
name = file.name;
|
|
2485
|
+
|
|
2486
|
+
var extension = name.indexOf('.') > -1 ? '.' + name.split('.').pop() : '';
|
|
2487
|
+
var baseType = type.replace(/\/.*$/, '');
|
|
2488
|
+
return accept.split(',').map(function (type) {
|
|
2489
|
+
return type.trim();
|
|
2490
|
+
}).filter(function (type) {
|
|
2491
|
+
return type;
|
|
2492
|
+
}).some(function (acceptedType) {
|
|
2493
|
+
if (/\..+$/.test(acceptedType)) {
|
|
2494
|
+
return extension === acceptedType;
|
|
2495
|
+
}
|
|
2496
|
+
if (/\/\*$/.test(acceptedType)) {
|
|
2497
|
+
return baseType === acceptedType.replace(/\/\*$/, '');
|
|
2498
|
+
}
|
|
2499
|
+
if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
|
|
2500
|
+
return type === acceptedType;
|
|
2501
|
+
}
|
|
2502
|
+
return false;
|
|
2503
|
+
});
|
|
2504
|
+
}));
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
});
|
|
2508
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js
|
|
2509
|
+
/* harmony default export */ var src_upload_draggervue_type_script_lang_js = (upload_draggervue_type_script_lang_js);
|
|
2510
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue
|
|
2511
|
+
|
|
2512
|
+
|
|
2513
|
+
|
|
2514
|
+
|
|
2515
|
+
|
|
2516
|
+
/* normalize component */
|
|
2517
|
+
|
|
2518
|
+
var upload_dragger_component = Object(componentNormalizer["a" /* default */])(
|
|
2519
|
+
src_upload_draggervue_type_script_lang_js,
|
|
2520
|
+
upload_draggervue_type_template_id_7a1289f9_render,
|
|
2521
|
+
upload_draggervue_type_template_id_7a1289f9_staticRenderFns,
|
|
2522
|
+
false,
|
|
2523
|
+
null,
|
|
2524
|
+
null,
|
|
2525
|
+
null
|
|
2526
|
+
|
|
2527
|
+
)
|
|
2528
|
+
|
|
2529
|
+
/* harmony default export */ var upload_dragger = (upload_dragger_component.exports);
|
|
2530
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload.vue?vue&type=script&lang=js
|
|
2531
|
+
|
|
2532
|
+
|
|
2533
|
+
|
|
2534
|
+
|
|
2535
|
+
|
|
2536
|
+
/* harmony default export */ var uploadvue_type_script_lang_js = ({
|
|
2537
|
+
inject: ['uploader'],
|
|
2538
|
+
components: {
|
|
2539
|
+
UploadDragger: upload_dragger
|
|
2540
|
+
},
|
|
2541
|
+
props: {
|
|
2542
|
+
type: String,
|
|
2543
|
+
action: {
|
|
579
2544
|
type: String,
|
|
580
|
-
|
|
2545
|
+
required: true
|
|
581
2546
|
},
|
|
582
|
-
|
|
583
|
-
|
|
2547
|
+
name: {
|
|
2548
|
+
type: String,
|
|
2549
|
+
default: 'file'
|
|
2550
|
+
},
|
|
2551
|
+
data: Object,
|
|
2552
|
+
headers: Object,
|
|
2553
|
+
withCredentials: Boolean,
|
|
2554
|
+
multiple: Boolean,
|
|
2555
|
+
accept: String,
|
|
2556
|
+
onStart: Function,
|
|
2557
|
+
onProgress: Function,
|
|
2558
|
+
onSuccess: Function,
|
|
2559
|
+
onError: Function,
|
|
2560
|
+
beforeUpload: Function,
|
|
2561
|
+
drag: Boolean,
|
|
2562
|
+
onPreview: {
|
|
2563
|
+
type: Function,
|
|
2564
|
+
default: function _default() {}
|
|
2565
|
+
},
|
|
2566
|
+
onRemove: {
|
|
2567
|
+
type: Function,
|
|
2568
|
+
default: function _default() {}
|
|
2569
|
+
},
|
|
2570
|
+
fileList: Array,
|
|
2571
|
+
autoUpload: Boolean,
|
|
2572
|
+
listType: String,
|
|
2573
|
+
httpRequest: {
|
|
2574
|
+
type: Function,
|
|
2575
|
+
default: upload
|
|
2576
|
+
},
|
|
2577
|
+
disabled: Boolean,
|
|
2578
|
+
limit: Number,
|
|
2579
|
+
onExceed: Function
|
|
2580
|
+
},
|
|
2581
|
+
|
|
2582
|
+
data: function data() {
|
|
2583
|
+
return {
|
|
2584
|
+
mouseover: false,
|
|
2585
|
+
reqs: {}
|
|
2586
|
+
};
|
|
2587
|
+
},
|
|
2588
|
+
|
|
2589
|
+
|
|
2590
|
+
methods: {
|
|
2591
|
+
isImage: function isImage(str) {
|
|
2592
|
+
return str.indexOf('image') !== -1;
|
|
2593
|
+
},
|
|
2594
|
+
handleChange: function handleChange(ev) {
|
|
2595
|
+
var files = ev.target.files;
|
|
2596
|
+
|
|
2597
|
+
if (!files) return;
|
|
2598
|
+
this.uploadFiles(files);
|
|
2599
|
+
},
|
|
2600
|
+
uploadFiles: function uploadFiles(files) {
|
|
2601
|
+
var _this = this;
|
|
2602
|
+
|
|
2603
|
+
if (this.limit && this.fileList.length + files.length > this.limit) {
|
|
2604
|
+
this.onExceed && this.onExceed(files, this.fileList);
|
|
2605
|
+
return;
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
var postFiles = Array.prototype.slice.call(files);
|
|
2609
|
+
if (!this.multiple) {
|
|
2610
|
+
postFiles = postFiles.slice(0, 1);
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
if (postFiles.length === 0) {
|
|
2614
|
+
return;
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2617
|
+
postFiles.forEach(function (rawFile) {
|
|
2618
|
+
_this.onStart(rawFile);
|
|
2619
|
+
if (_this.autoUpload) _this.upload(rawFile);
|
|
2620
|
+
});
|
|
2621
|
+
},
|
|
2622
|
+
upload: function upload(rawFile) {
|
|
2623
|
+
var _this2 = this;
|
|
2624
|
+
|
|
2625
|
+
this.$refs.input.value = null;
|
|
2626
|
+
|
|
2627
|
+
if (!this.beforeUpload) {
|
|
2628
|
+
return this.post(rawFile);
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
var before = this.beforeUpload(rawFile);
|
|
2632
|
+
if (before && before.then) {
|
|
2633
|
+
before.then(function (processedFile) {
|
|
2634
|
+
var fileType = Object.prototype.toString.call(processedFile);
|
|
2635
|
+
|
|
2636
|
+
if (fileType === '[object File]' || fileType === '[object Blob]') {
|
|
2637
|
+
if (fileType === '[object Blob]') {
|
|
2638
|
+
processedFile = new File([processedFile], rawFile.name, {
|
|
2639
|
+
type: rawFile.type
|
|
2640
|
+
});
|
|
2641
|
+
}
|
|
2642
|
+
for (var p in rawFile) {
|
|
2643
|
+
if (rawFile.hasOwnProperty(p)) {
|
|
2644
|
+
processedFile[p] = rawFile[p];
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
_this2.post(processedFile);
|
|
2648
|
+
} else {
|
|
2649
|
+
_this2.post(rawFile);
|
|
2650
|
+
}
|
|
2651
|
+
}, function () {
|
|
2652
|
+
_this2.onRemove(null, rawFile);
|
|
2653
|
+
});
|
|
2654
|
+
} else if (before !== false) {
|
|
2655
|
+
this.post(rawFile);
|
|
2656
|
+
} else {
|
|
2657
|
+
this.onRemove(null, rawFile);
|
|
2658
|
+
}
|
|
2659
|
+
},
|
|
2660
|
+
abort: function abort(file) {
|
|
2661
|
+
var reqs = this.reqs;
|
|
2662
|
+
|
|
2663
|
+
if (file) {
|
|
2664
|
+
var uid = file;
|
|
2665
|
+
if (file.uid) uid = file.uid;
|
|
2666
|
+
if (reqs[uid]) {
|
|
2667
|
+
reqs[uid].abort();
|
|
2668
|
+
}
|
|
2669
|
+
} else {
|
|
2670
|
+
Object.keys(reqs).forEach(function (uid) {
|
|
2671
|
+
if (reqs[uid]) reqs[uid].abort();
|
|
2672
|
+
delete reqs[uid];
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
},
|
|
2676
|
+
post: function post(rawFile) {
|
|
2677
|
+
var _this3 = this;
|
|
2678
|
+
|
|
2679
|
+
var uid = rawFile.uid;
|
|
2680
|
+
|
|
2681
|
+
var options = {
|
|
2682
|
+
headers: this.headers,
|
|
2683
|
+
withCredentials: this.withCredentials,
|
|
2684
|
+
file: rawFile,
|
|
2685
|
+
data: this.data,
|
|
2686
|
+
filename: this.name,
|
|
2687
|
+
action: this.action,
|
|
2688
|
+
onProgress: function onProgress(e) {
|
|
2689
|
+
_this3.onProgress(e, rawFile);
|
|
2690
|
+
},
|
|
2691
|
+
onSuccess: function onSuccess(res) {
|
|
2692
|
+
_this3.onSuccess(res, rawFile);
|
|
2693
|
+
delete _this3.reqs[uid];
|
|
2694
|
+
},
|
|
2695
|
+
onError: function onError(err) {
|
|
2696
|
+
_this3.onError(err, rawFile);
|
|
2697
|
+
delete _this3.reqs[uid];
|
|
2698
|
+
}
|
|
2699
|
+
};
|
|
2700
|
+
var req = this.httpRequest(options);
|
|
2701
|
+
this.reqs[uid] = req;
|
|
2702
|
+
if (req && req.then) {
|
|
2703
|
+
req.then(options.onSuccess, options.onError);
|
|
2704
|
+
}
|
|
2705
|
+
},
|
|
2706
|
+
handleClick: function handleClick() {
|
|
2707
|
+
if (!this.disabled) {
|
|
2708
|
+
this.$refs.input.value = null;
|
|
2709
|
+
this.$refs.input.click();
|
|
2710
|
+
}
|
|
2711
|
+
},
|
|
2712
|
+
handleKeydown: function handleKeydown(e) {
|
|
2713
|
+
if (e.target !== e.currentTarget) return;
|
|
2714
|
+
if (e.keyCode === 13 || e.keyCode === 32) {
|
|
2715
|
+
this.handleClick();
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
},
|
|
2719
|
+
|
|
2720
|
+
render: function render(h) {
|
|
2721
|
+
var handleClick = this.handleClick,
|
|
2722
|
+
drag = this.drag,
|
|
2723
|
+
name = this.name,
|
|
2724
|
+
handleChange = this.handleChange,
|
|
2725
|
+
multiple = this.multiple,
|
|
2726
|
+
accept = this.accept,
|
|
2727
|
+
listType = this.listType,
|
|
2728
|
+
uploadFiles = this.uploadFiles,
|
|
2729
|
+
disabled = this.disabled,
|
|
2730
|
+
handleKeydown = this.handleKeydown;
|
|
2731
|
+
|
|
2732
|
+
var data = {
|
|
2733
|
+
class: {
|
|
2734
|
+
'el-upload': true
|
|
2735
|
+
},
|
|
2736
|
+
on: {
|
|
2737
|
+
click: handleClick,
|
|
2738
|
+
keydown: handleKeydown
|
|
2739
|
+
}
|
|
2740
|
+
};
|
|
2741
|
+
data.class['el-upload--' + listType] = true;
|
|
2742
|
+
return h(
|
|
2743
|
+
'div',
|
|
2744
|
+
external_babel_helper_vue_jsx_merge_props_default()([data, {
|
|
2745
|
+
attrs: { tabindex: '0' }
|
|
2746
|
+
}]),
|
|
2747
|
+
[drag ? h(
|
|
2748
|
+
'upload-dragger',
|
|
2749
|
+
{
|
|
2750
|
+
attrs: { disabled: disabled },
|
|
2751
|
+
on: {
|
|
2752
|
+
'file': uploadFiles
|
|
2753
|
+
}
|
|
2754
|
+
},
|
|
2755
|
+
[this.$slots.default]
|
|
2756
|
+
) : this.$slots.default, h('input', { 'class': 'el-upload__input', attrs: { type: 'file', name: name, multiple: multiple, accept: accept },
|
|
2757
|
+
ref: 'input', on: {
|
|
2758
|
+
'change': handleChange
|
|
2759
|
+
}
|
|
2760
|
+
})]
|
|
2761
|
+
);
|
|
2762
|
+
}
|
|
2763
|
+
});
|
|
2764
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload.vue?vue&type=script&lang=js
|
|
2765
|
+
/* harmony default export */ var src_uploadvue_type_script_lang_js = (uploadvue_type_script_lang_js);
|
|
2766
|
+
// CONCATENATED MODULE: ./packages/upload/src/upload.vue
|
|
2767
|
+
var upload_render, upload_staticRenderFns
|
|
2768
|
+
|
|
2769
|
+
|
|
2770
|
+
|
|
2771
|
+
|
|
2772
|
+
/* normalize component */
|
|
2773
|
+
|
|
2774
|
+
var upload_component = Object(componentNormalizer["a" /* default */])(
|
|
2775
|
+
src_uploadvue_type_script_lang_js,
|
|
2776
|
+
upload_render,
|
|
2777
|
+
upload_staticRenderFns,
|
|
2778
|
+
false,
|
|
2779
|
+
null,
|
|
2780
|
+
null,
|
|
2781
|
+
null
|
|
2782
|
+
|
|
2783
|
+
)
|
|
2784
|
+
|
|
2785
|
+
/* harmony default export */ var src_upload = (upload_component.exports);
|
|
2786
|
+
// EXTERNAL MODULE: ./src/mixins/migrating.js
|
|
2787
|
+
var migrating = __webpack_require__(12);
|
|
2788
|
+
|
|
2789
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/index.vue?vue&type=script&lang=js
|
|
2790
|
+
|
|
2791
|
+
|
|
2792
|
+
|
|
2793
|
+
|
|
2794
|
+
|
|
2795
|
+
|
|
2796
|
+
function noop() {}
|
|
2797
|
+
|
|
2798
|
+
/* harmony default export */ var srcvue_type_script_lang_js = ({
|
|
2799
|
+
name: 'ElUpload',
|
|
2800
|
+
|
|
2801
|
+
mixins: [migrating["a" /* default */]],
|
|
2802
|
+
|
|
2803
|
+
components: {
|
|
2804
|
+
ElProgress: progress["default"],
|
|
2805
|
+
UploadList: upload_list,
|
|
2806
|
+
Upload: src_upload
|
|
2807
|
+
},
|
|
2808
|
+
|
|
2809
|
+
provide: function provide() {
|
|
2810
|
+
return {
|
|
2811
|
+
uploader: this
|
|
2812
|
+
};
|
|
2813
|
+
},
|
|
2814
|
+
|
|
2815
|
+
|
|
2816
|
+
inject: {
|
|
2817
|
+
elForm: {
|
|
2818
|
+
default: ''
|
|
2819
|
+
}
|
|
2820
|
+
},
|
|
2821
|
+
|
|
2822
|
+
props: {
|
|
2823
|
+
action: {
|
|
584
2824
|
type: String,
|
|
585
|
-
|
|
2825
|
+
required: true
|
|
586
2826
|
},
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
2827
|
+
headers: {
|
|
2828
|
+
type: Object,
|
|
2829
|
+
default: function _default() {
|
|
2830
|
+
return {};
|
|
2831
|
+
}
|
|
591
2832
|
},
|
|
592
|
-
|
|
593
|
-
|
|
2833
|
+
data: Object,
|
|
2834
|
+
multiple: Boolean,
|
|
2835
|
+
name: {
|
|
594
2836
|
type: String,
|
|
595
|
-
default: ''
|
|
596
|
-
},
|
|
597
|
-
// 上传按钮 是否为朴素按钮
|
|
598
|
-
btnPlain: {
|
|
599
|
-
type: Boolean,
|
|
600
|
-
default: false
|
|
2837
|
+
default: 'file'
|
|
601
2838
|
},
|
|
602
|
-
|
|
603
|
-
|
|
2839
|
+
drag: Boolean,
|
|
2840
|
+
dragger: Boolean,
|
|
2841
|
+
withCredentials: Boolean,
|
|
2842
|
+
showFileList: {
|
|
604
2843
|
type: Boolean,
|
|
605
2844
|
default: true
|
|
606
2845
|
},
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
type: Boolean,
|
|
610
|
-
default: false
|
|
611
|
-
},
|
|
612
|
-
// 下载模板地址
|
|
613
|
-
importTemplateName: {
|
|
2846
|
+
accept: String,
|
|
2847
|
+
type: {
|
|
614
2848
|
type: String,
|
|
615
|
-
default: '
|
|
2849
|
+
default: 'select'
|
|
616
2850
|
},
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
// 图片预览压缩率0-1,仅isThumbnail为true有效
|
|
623
|
-
imgRatio: {
|
|
624
|
-
type: Number,
|
|
625
|
-
default: 1
|
|
2851
|
+
beforeUpload: Function,
|
|
2852
|
+
beforeRemove: Function,
|
|
2853
|
+
onRemove: {
|
|
2854
|
+
type: Function,
|
|
2855
|
+
default: noop
|
|
626
2856
|
},
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
default: true
|
|
2857
|
+
onChange: {
|
|
2858
|
+
type: Function,
|
|
2859
|
+
default: noop
|
|
631
2860
|
},
|
|
632
|
-
|
|
633
|
-
deleteBefore: {
|
|
2861
|
+
onPreview: {
|
|
634
2862
|
type: Function
|
|
635
2863
|
},
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
type: String,
|
|
640
|
-
default: ''
|
|
2864
|
+
onSuccess: {
|
|
2865
|
+
type: Function,
|
|
2866
|
+
default: noop
|
|
641
2867
|
},
|
|
642
|
-
|
|
643
|
-
getToken: {
|
|
2868
|
+
onProgress: {
|
|
644
2869
|
type: Function,
|
|
645
|
-
default:
|
|
646
|
-
return '';
|
|
647
|
-
}
|
|
2870
|
+
default: noop
|
|
648
2871
|
},
|
|
649
|
-
|
|
650
|
-
fileDownLoad: {
|
|
2872
|
+
onError: {
|
|
651
2873
|
type: Function,
|
|
2874
|
+
default: noop
|
|
2875
|
+
},
|
|
2876
|
+
fileList: {
|
|
2877
|
+
type: Array,
|
|
652
2878
|
default: function _default() {
|
|
653
|
-
return
|
|
2879
|
+
return [];
|
|
654
2880
|
}
|
|
655
2881
|
},
|
|
656
|
-
|
|
657
|
-
|
|
2882
|
+
autoUpload: {
|
|
2883
|
+
type: Boolean,
|
|
2884
|
+
default: true
|
|
2885
|
+
},
|
|
2886
|
+
listType: {
|
|
2887
|
+
type: String,
|
|
2888
|
+
default: 'text' // text,picture,picture-card
|
|
2889
|
+
},
|
|
2890
|
+
httpRequest: Function,
|
|
2891
|
+
disabled: Boolean,
|
|
2892
|
+
limit: Number,
|
|
2893
|
+
onExceed: {
|
|
658
2894
|
type: Function,
|
|
659
|
-
default:
|
|
660
|
-
return '';
|
|
661
|
-
}
|
|
2895
|
+
default: noop
|
|
662
2896
|
}
|
|
663
2897
|
},
|
|
2898
|
+
|
|
664
2899
|
data: function data() {
|
|
665
2900
|
return {
|
|
666
|
-
|
|
667
|
-
|
|
2901
|
+
uploadFiles: [],
|
|
2902
|
+
dragOver: false,
|
|
2903
|
+
draging: false,
|
|
2904
|
+
tempIndex: 1
|
|
668
2905
|
};
|
|
669
2906
|
},
|
|
670
2907
|
|
|
671
|
-
watch: {
|
|
672
|
-
value: {
|
|
673
|
-
handler: function handler(val) {
|
|
674
|
-
if (val) {
|
|
675
|
-
if (typeof val === 'string') {
|
|
676
|
-
this.fileList = [{
|
|
677
|
-
file_name: this.getFileName(val),
|
|
678
|
-
file_path: val,
|
|
679
|
-
id: this.createUUID()
|
|
680
|
-
}];
|
|
681
|
-
} else {
|
|
682
|
-
this.fileList = val.map(function (item) {
|
|
683
|
-
return Object.assign({}, item);
|
|
684
|
-
});
|
|
685
|
-
}
|
|
686
|
-
} else {
|
|
687
|
-
this.fileList = [];
|
|
688
|
-
return [];
|
|
689
|
-
}
|
|
690
|
-
},
|
|
691
2908
|
|
|
692
|
-
|
|
693
|
-
|
|
2909
|
+
computed: {
|
|
2910
|
+
uploadDisabled: function uploadDisabled() {
|
|
2911
|
+
return this.disabled || (this.elForm || {}).disabled;
|
|
694
2912
|
}
|
|
695
2913
|
},
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
2914
|
+
|
|
2915
|
+
watch: {
|
|
2916
|
+
listType: function listType(type) {
|
|
2917
|
+
if (type === 'picture-card' || type === 'picture') {
|
|
2918
|
+
this.uploadFiles = this.uploadFiles.map(function (file) {
|
|
2919
|
+
if (!file.url && file.raw) {
|
|
2920
|
+
try {
|
|
2921
|
+
file.url = URL.createObjectURL(file.raw);
|
|
2922
|
+
} catch (err) {
|
|
2923
|
+
console.error('[Element Error][Upload]', err);
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
return file;
|
|
2927
|
+
});
|
|
2928
|
+
}
|
|
706
2929
|
},
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
2930
|
+
|
|
2931
|
+
fileList: {
|
|
2932
|
+
immediate: true,
|
|
2933
|
+
handler: function handler(fileList) {
|
|
2934
|
+
var _this = this;
|
|
2935
|
+
|
|
2936
|
+
this.uploadFiles = fileList.map(function (item) {
|
|
2937
|
+
item.uid = item.uid || Date.now() + _this.tempIndex++;
|
|
2938
|
+
item.status = item.status || 'success';
|
|
2939
|
+
return item;
|
|
2940
|
+
});
|
|
2941
|
+
}
|
|
711
2942
|
}
|
|
712
2943
|
},
|
|
2944
|
+
|
|
713
2945
|
methods: {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
if (!isLt) {
|
|
732
|
-
this.$message.error('\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 ' + this.fileSize + ' MB!');
|
|
733
|
-
this.downloadLoading = false;
|
|
734
|
-
return false;
|
|
2946
|
+
handleStart: function handleStart(rawFile) {
|
|
2947
|
+
rawFile.uid = Date.now() + this.tempIndex++;
|
|
2948
|
+
var file = {
|
|
2949
|
+
status: 'ready',
|
|
2950
|
+
name: rawFile.name,
|
|
2951
|
+
size: rawFile.size,
|
|
2952
|
+
percentage: 0,
|
|
2953
|
+
uid: rawFile.uid,
|
|
2954
|
+
raw: rawFile
|
|
2955
|
+
};
|
|
2956
|
+
|
|
2957
|
+
if (this.listType === 'picture-card' || this.listType === 'picture') {
|
|
2958
|
+
try {
|
|
2959
|
+
file.url = URL.createObjectURL(rawFile);
|
|
2960
|
+
} catch (err) {
|
|
2961
|
+
console.error('[Element Error][Upload]', err);
|
|
2962
|
+
return;
|
|
735
2963
|
}
|
|
736
2964
|
}
|
|
737
|
-
|
|
2965
|
+
|
|
2966
|
+
this.uploadFiles.push(file);
|
|
2967
|
+
this.onChange(file, this.uploadFiles);
|
|
738
2968
|
},
|
|
2969
|
+
handleProgress: function handleProgress(ev, rawFile) {
|
|
2970
|
+
var file = this.getFile(rawFile);
|
|
2971
|
+
this.onProgress(ev, file, this.uploadFiles);
|
|
2972
|
+
file.status = 'uploading';
|
|
2973
|
+
file.percentage = ev.percent || 0;
|
|
2974
|
+
},
|
|
2975
|
+
handleSuccess: function handleSuccess(res, rawFile) {
|
|
2976
|
+
var file = this.getFile(rawFile);
|
|
739
2977
|
|
|
2978
|
+
if (file) {
|
|
2979
|
+
file.status = 'success';
|
|
2980
|
+
file.response = res;
|
|
740
2981
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
*/
|
|
744
|
-
handleExceed: function handleExceed() {
|
|
745
|
-
if (this.limit === 1) {
|
|
746
|
-
this.$message.error('只能上传单个文件!');
|
|
747
|
-
} else {
|
|
748
|
-
this.$message.error('\u4E0A\u4F20\u6587\u4EF6\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7 ' + this.limit + ' \u4E2A!');
|
|
2982
|
+
this.onSuccess(res, file, this.uploadFiles);
|
|
2983
|
+
this.onChange(file, this.uploadFiles);
|
|
749
2984
|
}
|
|
750
|
-
this.downloadLoading = false;
|
|
751
2985
|
},
|
|
2986
|
+
handleError: function handleError(err, rawFile) {
|
|
2987
|
+
var file = this.getFile(rawFile);
|
|
2988
|
+
var fileList = this.uploadFiles;
|
|
752
2989
|
|
|
2990
|
+
file.status = 'fail';
|
|
753
2991
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
this.$message.error('上传失败, 请重试');
|
|
759
|
-
this.downloadLoading = false;
|
|
2992
|
+
fileList.splice(fileList.indexOf(file), 1);
|
|
2993
|
+
|
|
2994
|
+
this.onError(err, file, this.uploadFiles);
|
|
2995
|
+
this.onChange(file, this.uploadFiles);
|
|
760
2996
|
},
|
|
2997
|
+
handleRemove: function handleRemove(file, raw) {
|
|
2998
|
+
var _this2 = this;
|
|
761
2999
|
|
|
3000
|
+
if (raw) {
|
|
3001
|
+
file = this.getFile(raw);
|
|
3002
|
+
}
|
|
3003
|
+
var doRemove = function doRemove() {
|
|
3004
|
+
_this2.abort(file);
|
|
3005
|
+
var fileList = _this2.uploadFiles;
|
|
3006
|
+
fileList.splice(fileList.indexOf(file), 1);
|
|
3007
|
+
_this2.onRemove(file, fileList);
|
|
3008
|
+
};
|
|
762
3009
|
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
3010
|
+
if (!this.beforeRemove) {
|
|
3011
|
+
doRemove();
|
|
3012
|
+
} else if (typeof this.beforeRemove === 'function') {
|
|
3013
|
+
var before = this.beforeRemove(file, this.uploadFiles);
|
|
3014
|
+
if (before && before.then) {
|
|
3015
|
+
before.then(function () {
|
|
3016
|
+
doRemove();
|
|
3017
|
+
}, noop);
|
|
3018
|
+
} else if (before !== false) {
|
|
3019
|
+
doRemove();
|
|
3020
|
+
}
|
|
772
3021
|
}
|
|
773
|
-
this.downloadLoading = false;
|
|
774
|
-
this.$emit('input', this.fileList);
|
|
775
3022
|
},
|
|
3023
|
+
getFile: function getFile(rawFile) {
|
|
3024
|
+
var fileList = this.uploadFiles;
|
|
3025
|
+
var target = void 0;
|
|
3026
|
+
fileList.every(function (item) {
|
|
3027
|
+
target = rawFile.uid === item.uid ? item : null;
|
|
3028
|
+
return !target;
|
|
3029
|
+
});
|
|
3030
|
+
return target;
|
|
3031
|
+
},
|
|
3032
|
+
abort: function abort(file) {
|
|
3033
|
+
this.$refs['upload-inner'].abort(file);
|
|
3034
|
+
},
|
|
3035
|
+
clearFiles: function clearFiles() {
|
|
3036
|
+
this.uploadFiles = [];
|
|
3037
|
+
},
|
|
3038
|
+
submit: function submit() {
|
|
3039
|
+
var _this3 = this;
|
|
3040
|
+
|
|
3041
|
+
this.uploadFiles.filter(function (file) {
|
|
3042
|
+
return file.status === 'ready';
|
|
3043
|
+
}).forEach(function (file) {
|
|
3044
|
+
_this3.$refs['upload-inner'].upload(file.raw);
|
|
3045
|
+
});
|
|
3046
|
+
},
|
|
3047
|
+
getMigratingConfig: function getMigratingConfig() {
|
|
3048
|
+
return {
|
|
3049
|
+
props: {
|
|
3050
|
+
'default-file-list': 'default-file-list is renamed to file-list.',
|
|
3051
|
+
'show-upload-list': 'show-upload-list is renamed to show-file-list.',
|
|
3052
|
+
'thumbnail-mode': 'thumbnail-mode has been deprecated, you can implement the same effect according to this case: http://element.eleme.io/#/zh-CN/component/upload#yong-hu-tou-xiang-shang-chuan'
|
|
3053
|
+
}
|
|
3054
|
+
};
|
|
3055
|
+
}
|
|
3056
|
+
},
|
|
776
3057
|
|
|
3058
|
+
beforeDestroy: function beforeDestroy() {
|
|
3059
|
+
this.uploadFiles.forEach(function (file) {
|
|
3060
|
+
if (file.url && file.url.indexOf('blob:') === 0) {
|
|
3061
|
+
URL.revokeObjectURL(file.url);
|
|
3062
|
+
}
|
|
3063
|
+
});
|
|
3064
|
+
},
|
|
3065
|
+
render: function render(h) {
|
|
3066
|
+
var _this4 = this;
|
|
3067
|
+
|
|
3068
|
+
var uploadList = void 0;
|
|
3069
|
+
|
|
3070
|
+
if (this.showFileList) {
|
|
3071
|
+
uploadList = h(
|
|
3072
|
+
upload_list,
|
|
3073
|
+
{
|
|
3074
|
+
attrs: {
|
|
3075
|
+
disabled: this.uploadDisabled,
|
|
3076
|
+
listType: this.listType,
|
|
3077
|
+
files: this.uploadFiles,
|
|
3078
|
+
|
|
3079
|
+
handlePreview: this.onPreview },
|
|
3080
|
+
on: {
|
|
3081
|
+
'remove': this.handleRemove
|
|
3082
|
+
}
|
|
3083
|
+
},
|
|
3084
|
+
[function (props) {
|
|
3085
|
+
if (_this4.$scopedSlots.file) {
|
|
3086
|
+
return _this4.$scopedSlots.file({
|
|
3087
|
+
file: props.file
|
|
3088
|
+
});
|
|
3089
|
+
}
|
|
3090
|
+
}]
|
|
3091
|
+
);
|
|
3092
|
+
}
|
|
777
3093
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
3094
|
+
var uploadData = {
|
|
3095
|
+
props: {
|
|
3096
|
+
type: this.type,
|
|
3097
|
+
drag: this.drag,
|
|
3098
|
+
action: this.action,
|
|
3099
|
+
multiple: this.multiple,
|
|
3100
|
+
'before-upload': this.beforeUpload,
|
|
3101
|
+
'with-credentials': this.withCredentials,
|
|
3102
|
+
headers: this.headers,
|
|
3103
|
+
name: this.name,
|
|
3104
|
+
data: this.data,
|
|
3105
|
+
accept: this.accept,
|
|
3106
|
+
fileList: this.uploadFiles,
|
|
3107
|
+
autoUpload: this.autoUpload,
|
|
3108
|
+
listType: this.listType,
|
|
3109
|
+
disabled: this.uploadDisabled,
|
|
3110
|
+
limit: this.limit,
|
|
3111
|
+
'on-exceed': this.onExceed,
|
|
3112
|
+
'on-start': this.handleStart,
|
|
3113
|
+
'on-progress': this.handleProgress,
|
|
3114
|
+
'on-success': this.handleSuccess,
|
|
3115
|
+
'on-error': this.handleError,
|
|
3116
|
+
'on-preview': this.onPreview,
|
|
3117
|
+
'on-remove': this.handleRemove,
|
|
3118
|
+
'http-request': this.httpRequest
|
|
3119
|
+
},
|
|
3120
|
+
ref: 'upload-inner'
|
|
3121
|
+
};
|
|
783
3122
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
if (!_this.deleteBefore) {
|
|
791
|
-
_context.next = 13;
|
|
792
|
-
break;
|
|
793
|
-
}
|
|
3123
|
+
var trigger = this.$slots.trigger || this.$slots.default;
|
|
3124
|
+
var uploadComponent = h(
|
|
3125
|
+
'upload',
|
|
3126
|
+
uploadData,
|
|
3127
|
+
[trigger]
|
|
3128
|
+
);
|
|
794
3129
|
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
3130
|
+
return h('div', [this.listType === 'picture-card' ? uploadList : '', this.$slots.trigger ? [uploadComponent, this.$slots.default] : uploadComponent, this.$slots.tip, this.listType !== 'picture-card' ? uploadList : '']);
|
|
3131
|
+
}
|
|
3132
|
+
});
|
|
3133
|
+
// CONCATENATED MODULE: ./packages/upload/src/index.vue?vue&type=script&lang=js
|
|
3134
|
+
/* harmony default export */ var upload_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
|
|
3135
|
+
// CONCATENATED MODULE: ./packages/upload/src/index.vue
|
|
3136
|
+
var src_render, src_staticRenderFns
|
|
798
3137
|
|
|
799
|
-
case 4:
|
|
800
|
-
res = _context.sent;
|
|
801
3138
|
|
|
802
|
-
if (res) {
|
|
803
|
-
_context.next = 7;
|
|
804
|
-
break;
|
|
805
|
-
}
|
|
806
3139
|
|
|
807
|
-
return _context.abrupt('return');
|
|
808
3140
|
|
|
809
|
-
|
|
810
|
-
_context.next = 13;
|
|
811
|
-
break;
|
|
3141
|
+
/* normalize component */
|
|
812
3142
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
3143
|
+
var src_component = Object(componentNormalizer["a" /* default */])(
|
|
3144
|
+
upload_srcvue_type_script_lang_js,
|
|
3145
|
+
src_render,
|
|
3146
|
+
src_staticRenderFns,
|
|
3147
|
+
false,
|
|
3148
|
+
null,
|
|
3149
|
+
null,
|
|
3150
|
+
null
|
|
3151
|
+
|
|
3152
|
+
)
|
|
816
3153
|
|
|
817
|
-
|
|
818
|
-
|
|
3154
|
+
/* harmony default export */ var src = (src_component.exports);
|
|
3155
|
+
// CONCATENATED MODULE: ./packages/upload/index.js
|
|
819
3156
|
|
|
820
|
-
case 13:
|
|
821
|
-
_this.fileList.splice(index, 1);
|
|
822
|
-
_this.$emit('input', _this.fileList);
|
|
823
3157
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
}
|
|
829
|
-
}, _callee, _this, [[1, 9]]);
|
|
830
|
-
}))();
|
|
831
|
-
},
|
|
3158
|
+
/* istanbul ignore next */
|
|
3159
|
+
src.install = function (Vue) {
|
|
3160
|
+
Vue.component(src.name, src);
|
|
3161
|
+
};
|
|
832
3162
|
|
|
3163
|
+
/* harmony default export */ var packages_upload = __webpack_exports__["default"] = (src);
|
|
833
3164
|
|
|
834
|
-
|
|
835
|
-
* 获取文件名称
|
|
836
|
-
*/
|
|
837
|
-
getFileName: function getFileName(name) {
|
|
838
|
-
if (name.lastIndexOf('/') > -1) {
|
|
839
|
-
return name.slice(name.lastIndexOf('/') + 1).toLowerCase();
|
|
840
|
-
} else {
|
|
841
|
-
return name;
|
|
842
|
-
}
|
|
843
|
-
},
|
|
3165
|
+
/***/ }),
|
|
844
3166
|
|
|
3167
|
+
/***/ 56:
|
|
3168
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
845
3169
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
getFileExtension: function getFileExtension(name) {
|
|
850
|
-
if (name.lastIndexOf('.') > -1) {
|
|
851
|
-
return name.slice(name.lastIndexOf('.') + 1).toLowerCase();
|
|
852
|
-
}
|
|
853
|
-
return '';
|
|
854
|
-
},
|
|
3170
|
+
"use strict";
|
|
3171
|
+
// ESM COMPAT FLAG
|
|
3172
|
+
__webpack_require__.r(__webpack_exports__);
|
|
855
3173
|
|
|
3174
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/link/src/main.vue?vue&type=template&id=4fa504fb
|
|
3175
|
+
var render = function render() {
|
|
3176
|
+
var _vm = this,
|
|
3177
|
+
_c = _vm._self._c
|
|
3178
|
+
return _c(
|
|
3179
|
+
"a",
|
|
3180
|
+
_vm._b(
|
|
3181
|
+
{
|
|
3182
|
+
class: [
|
|
3183
|
+
"el-link",
|
|
3184
|
+
_vm.type ? `el-link--${_vm.type}` : "",
|
|
3185
|
+
_vm.disabled && "is-disabled",
|
|
3186
|
+
_vm.underline && !_vm.disabled && "is-underline",
|
|
3187
|
+
],
|
|
3188
|
+
attrs: { href: _vm.disabled ? null : _vm.href },
|
|
3189
|
+
on: { click: _vm.handleClick },
|
|
3190
|
+
},
|
|
3191
|
+
"a",
|
|
3192
|
+
_vm.$attrs,
|
|
3193
|
+
false
|
|
3194
|
+
),
|
|
3195
|
+
[
|
|
3196
|
+
_vm.icon ? _c("i", { class: _vm.icon }) : _vm._e(),
|
|
3197
|
+
_vm.$slots.default
|
|
3198
|
+
? _c("span", { staticClass: "el-link--inner" }, [_vm._t("default")], 2)
|
|
3199
|
+
: _vm._e(),
|
|
3200
|
+
_vm.$slots.icon
|
|
3201
|
+
? [_vm.$slots.icon ? _vm._t("icon") : _vm._e()]
|
|
3202
|
+
: _vm._e(),
|
|
3203
|
+
],
|
|
3204
|
+
2
|
|
3205
|
+
)
|
|
3206
|
+
}
|
|
3207
|
+
var staticRenderFns = []
|
|
3208
|
+
render._withStripped = true
|
|
856
3209
|
|
|
857
|
-
/**
|
|
858
|
-
* 查看 预览
|
|
859
|
-
*/
|
|
860
|
-
previewFile: function previewFile(file) {
|
|
861
|
-
window.open(this.getFilePreviewUrl(file));
|
|
862
|
-
},
|
|
863
3210
|
|
|
3211
|
+
// CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=template&id=4fa504fb
|
|
864
3212
|
|
|
865
|
-
|
|
866
|
-
* 附件下载
|
|
867
|
-
* */
|
|
868
|
-
downloadAttach: function downloadAttach(file) {
|
|
869
|
-
var _this2 = this;
|
|
3213
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/link/src/main.vue?vue&type=script&lang=js
|
|
870
3214
|
|
|
871
|
-
if (!this.isDownload) return;
|
|
872
3215
|
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
file_type = file.file_type;
|
|
3216
|
+
/* harmony default export */ var mainvue_type_script_lang_js = ({
|
|
3217
|
+
name: 'ElLink',
|
|
876
3218
|
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
var link = document.createElement('a');
|
|
882
|
-
link.download = file_name;
|
|
883
|
-
link.style.display = 'none';
|
|
884
|
-
link.href = URL.createObjectURL(blob);
|
|
885
|
-
document.body.appendChild(link);
|
|
886
|
-
link.click();
|
|
887
|
-
URL.revokeObjectURL(link.href);
|
|
888
|
-
document.body.removeChild(link);
|
|
889
|
-
} else {
|
|
890
|
-
navigator.msSaveBlob(blob, file_name);
|
|
891
|
-
}
|
|
892
|
-
_this2.downloadLoading = false;
|
|
893
|
-
}).catch(function (err) {
|
|
894
|
-
_this2.downloadLoading = false;
|
|
895
|
-
console.log(err);
|
|
896
|
-
_this2.$message.error('文件下载失败!');
|
|
897
|
-
});
|
|
3219
|
+
props: {
|
|
3220
|
+
type: {
|
|
3221
|
+
type: String,
|
|
3222
|
+
default: 'default'
|
|
898
3223
|
},
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
* 下载模板操作
|
|
903
|
-
*/
|
|
904
|
-
importTemplate: function importTemplate() {
|
|
905
|
-
var link = document.createElement('a');
|
|
906
|
-
link.style.display = 'none';
|
|
907
|
-
link.setAttribute('href', '/static/' + this.importTemplateName);
|
|
908
|
-
link.download = this.importTemplateName; // 下载的文件名
|
|
909
|
-
document.body.appendChild(link);
|
|
910
|
-
link.click();
|
|
911
|
-
document.body.removeChild(link);
|
|
3224
|
+
underline: {
|
|
3225
|
+
type: Boolean,
|
|
3226
|
+
default: true
|
|
912
3227
|
},
|
|
3228
|
+
disabled: Boolean,
|
|
3229
|
+
href: String,
|
|
3230
|
+
icon: String
|
|
3231
|
+
},
|
|
913
3232
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
var v = c === 'x' ? r : r & 0x3 | 0x8;
|
|
922
|
-
return v.toString(16);
|
|
923
|
-
});
|
|
3233
|
+
methods: {
|
|
3234
|
+
handleClick: function handleClick(event) {
|
|
3235
|
+
if (!this.disabled) {
|
|
3236
|
+
if (!this.href) {
|
|
3237
|
+
this.$emit('click', event);
|
|
3238
|
+
}
|
|
3239
|
+
}
|
|
924
3240
|
}
|
|
925
3241
|
}
|
|
926
3242
|
});
|
|
927
|
-
// CONCATENATED MODULE: ./packages/
|
|
3243
|
+
// CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=script&lang=js
|
|
928
3244
|
/* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
|
|
929
3245
|
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
930
|
-
var componentNormalizer = __webpack_require__(
|
|
3246
|
+
var componentNormalizer = __webpack_require__(2);
|
|
931
3247
|
|
|
932
|
-
// CONCATENATED MODULE: ./packages/
|
|
3248
|
+
// CONCATENATED MODULE: ./packages/link/src/main.vue
|
|
933
3249
|
|
|
934
3250
|
|
|
935
3251
|
|
|
@@ -949,7 +3265,7 @@ var component = Object(componentNormalizer["a" /* default */])(
|
|
|
949
3265
|
)
|
|
950
3266
|
|
|
951
3267
|
/* harmony default export */ var main = (component.exports);
|
|
952
|
-
// CONCATENATED MODULE: ./packages/
|
|
3268
|
+
// CONCATENATED MODULE: ./packages/link/index.js
|
|
953
3269
|
|
|
954
3270
|
|
|
955
3271
|
/* istanbul ignore next */
|
|
@@ -957,21 +3273,778 @@ main.install = function (Vue) {
|
|
|
957
3273
|
Vue.component(main.name, main);
|
|
958
3274
|
};
|
|
959
3275
|
|
|
960
|
-
/* harmony default export */ var
|
|
3276
|
+
/* harmony default export */ var packages_link = __webpack_exports__["default"] = (main);
|
|
961
3277
|
|
|
962
3278
|
/***/ }),
|
|
963
3279
|
|
|
964
|
-
/***/
|
|
3280
|
+
/***/ 57:
|
|
965
3281
|
/***/ (function(module, exports) {
|
|
966
3282
|
|
|
967
|
-
|
|
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
|
+
|
|
968
3304
|
|
|
969
3305
|
/***/ }),
|
|
970
3306
|
|
|
971
|
-
/***/
|
|
972
|
-
/***/ (function(module, exports) {
|
|
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
|
+
}
|
|
973
3413
|
|
|
974
|
-
|
|
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)))
|
|
975
4048
|
|
|
976
4049
|
/***/ })
|
|
977
4050
|
|