rmt-fileupload 0.2.18 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -1
- package/lib/rmt-fileupload.common.js +173 -195
- package/lib/rmt-fileupload.umd.js +179 -201
- package/lib/rmt-fileupload.umd.min.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Project setup
|
|
4
4
|
```
|
|
5
|
-
npm install
|
|
5
|
+
npm install --registry=https://registry.npmmirror.com
|
|
6
6
|
```
|
|
7
7
|
|
|
8
8
|
### Compiles and hot-reloads for development
|
|
@@ -20,5 +20,21 @@ npm run build
|
|
|
20
20
|
npm run lint
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
|
|
24
|
+
### 打包发布需要的内容
|
|
25
|
+
```
|
|
26
|
+
npm run lib
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 发布
|
|
30
|
+
需要在https://www.npmjs.com/settings/pengbei.tech/tokens/ 生成一个可绕行2FA的token,然后替换本地 ~/.npmrc 中的TOKEN,
|
|
31
|
+
```
|
|
32
|
+
echo "//registry.npmjs.org/:_authToken=你的token" >> ~/.npmrc
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
npm publish
|
|
37
|
+
```
|
|
38
|
+
|
|
23
39
|
### Customize configuration
|
|
24
40
|
See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
@@ -3591,7 +3591,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, "@font-face{font-family:element-icons;s
|
|
|
3591
3591
|
|
|
3592
3592
|
/***/ }),
|
|
3593
3593
|
|
|
3594
|
-
/***/
|
|
3594
|
+
/***/ 4594:
|
|
3595
3595
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3596
3596
|
|
|
3597
3597
|
"use strict";
|
|
@@ -3610,7 +3610,7 @@ var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require
|
|
|
3610
3610
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
3611
3611
|
var ___CSS_LOADER_URL_REPLACEMENT_0___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___);
|
|
3612
3612
|
// Module
|
|
3613
|
-
___CSS_LOADER_EXPORT___.push([module.id, ".el-breadcrumb__inner[data-v-
|
|
3613
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".el-breadcrumb__inner[data-v-8420ab38],.el-breadcrumb__inner a[data-v-8420ab38]{font-weight:400!important}.el-upload input[type=file][data-v-8420ab38]{display:none!important}.el-upload__input[data-v-8420ab38]{display:none}.cell .el-tag[data-v-8420ab38]{margin-right:0}.small-padding .cell[data-v-8420ab38]{padding-left:5px;padding-right:5px}.fixed-width .el-button--mini[data-v-8420ab38]{padding:7px 10px;width:60px}.status-col .cell[data-v-8420ab38]{padding:0 10px;text-align:center}.status-col .cell .el-tag[data-v-8420ab38]{margin-right:0}.el-dialog[data-v-8420ab38]{transform:none;left:0;position:relative;margin:0 auto}.upload-container .el-upload[data-v-8420ab38]{width:100%}.upload-container .el-upload .el-upload-dragger[data-v-8420ab38]{width:100%;height:200px}.el-dropdown-menu a[data-v-8420ab38]{display:block}.el-range-editor.el-input__inner[data-v-8420ab38]{display:inline-flex!important}.el-range-separator[data-v-8420ab38]{box-sizing:content-box}.el-menu--collapse>div>.el-submenu>.el-submenu__title .el-submenu__icon-arrow[data-v-8420ab38]{display:none}.el-image .image-slot[data-v-8420ab38]{display:flex;justify-content:center;align-items:center;width:100%;height:100%;background:#f5f7fa;color:#909399}.is-disabled[data-v-8420ab38],.is-disabled .el-upload[data-v-8420ab38]{cursor:not-allowed}.el-tabs__header[data-v-8420ab38]{overflow:hidden;margin:0}.el-tabs__new-tab[data-v-8420ab38]{background-size:100% 100%;width:24px;height:24px;border:none;margin-right:16px}.el-tabs__new-tab *[data-v-8420ab38]{display:none}.el-form>.el-tabs>.el-tabs__header[data-v-8420ab38]{box-shadow:0 5px 20px rgba(10,25,38,.1);background-color:#fff;border-radius:0 0 8px 8px;padding-left:16px}.el-form>.el-tabs>.el-tabs__content[data-v-8420ab38]{margin-top:16px;box-shadow:0 5px 20px rgba(10,25,38,.1);border-radius:8px}.el-form>.el-tabs>.el-tabs__content .el-tab-pane .el-tabs__header[data-v-8420ab38]{padding-left:16px;background-color:#f2f4f6}.el-form>.el-tabs>.el-tabs__content .el-tab-pane .el-tabs__header .el-tabs__item[data-v-8420ab38]{font-size:16px;font-weight:400;line-height:45px;height:45px;padding:0 16px;border:none}.el-form>.el-tabs>.el-tabs__content .el-tab-pane .el-tabs__header .el-tabs__item.is-active[data-v-8420ab38]{background-color:#fff;border-radius:8px 8px 0 0}.el-form>.el-tabs>.el-tabs__content .el-tab-pane .el-tabs__header .el-tabs__item:focus.is-active.is-focus[data-v-8420ab38]:not(:active){box-shadow:none}.el-form>.el-tabs>.el-tabs__content .el-tab-pane .el-tabs__content[data-v-8420ab38]{background-color:#fff}.el-form>.el-tabs>.el-tabs__content .el-form[data-v-8420ab38]{margin-top:16px}.el-form>.el-tabs .el-tabs__item[data-v-8420ab38]{font-size:16px;font-weight:700}.el-form .el-tabs__nav-wrap[data-v-8420ab38]{margin-bottom:0}.el-form .el-tabs__nav-wrap[data-v-8420ab38]:after{display:none}.el-tabs--card>.el-tabs__header[data-v-8420ab38],.el-tabs--card>.el-tabs__header .el-tabs__nav[data-v-8420ab38]{border:none}.el-tabs--card>.el-tabs__header .el-tabs__item .el-icon-close[data-v-8420ab38]{width:14px;opacity:0}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .el-icon-close[data-v-8420ab38]{opacity:1}.el-image[data-v-8420ab38]{background-size:100% 100%}.el-image .el-image__error[data-v-8420ab38]{display:none}.btn-big .el-upload button.el-button--primary[data-v-8420ab38]{font-size:14px;line-height:19px;padding:10px 16px 11px;background-color:#0090ff;border:none}.el-button--medium.is-circle[data-v-8420ab38]{padding:13px 12px 12px;box-shadow:0 5px 20px rgba(10,25,38,.1);border:none;width:40px;height:40px}.el-icon-edit[data-v-8420ab38],.el-icon-refresh-left[data-v-8420ab38]{width:16px;height:15px;background-size:100% 100%}.el-icon-edit[data-v-8420ab38]:before,.el-icon-refresh-left[data-v-8420ab38]:before{display:none}[data-v-8420ab38]:export{theme:#1890ff}.network-img[data-v-8420ab38]{font-size:14px;line-height:19px;padding:10px 16px 11px;background-color:#00c5c5;border:none}.row-img-box[data-v-8420ab38]{display:flex;flex-direction:column;align-items:center}.row-img-box .img-btn-box[data-v-8420ab38]{display:flex;padding:16px 0}.upload-file-uploader[data-v-8420ab38]{margin-bottom:5px}.upload-file-list .el-upload-list__item[data-v-8420ab38]{border:1px solid #e4e7ed;line-height:2;margin-bottom:10px;position:relative}.upload-file-list .ele-upload-list__item-content[data-v-8420ab38]{display:flex;justify-content:space-between;align-items:center;color:inherit}.ele-upload-list__item-content-action .el-link[data-v-8420ab38]{margin-right:10px}.rmt-thumb-new[data-v-8420ab38]{width:160px;height:160px;order-radius:3px;background:url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ") no-repeat}.has-upload[data-v-8420ab38]{background:none}.single-image-upload[data-v-8420ab38]{border-radius:3px;overflow:hidden;display:inline-block}.single-image-upload .default-lable[data-v-8420ab38]{display:flex;justify-content:center;align-items:center;width:100%;height:100%;background:#f5f7fa;color:#909399}.single-image-upload .el-image[data-v-8420ab38]{vertical-align:top}", ""]);
|
|
3614
3614
|
// Exports
|
|
3615
3615
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
3616
3616
|
|
|
@@ -3782,19 +3782,19 @@ var update = add("f03fd9b8", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
3782
3782
|
|
|
3783
3783
|
/***/ }),
|
|
3784
3784
|
|
|
3785
|
-
/***/
|
|
3785
|
+
/***/ 5744:
|
|
3786
3786
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
3787
3787
|
|
|
3788
3788
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
3789
3789
|
|
|
3790
3790
|
// load the styles
|
|
3791
|
-
var content = __webpack_require__(
|
|
3791
|
+
var content = __webpack_require__(4594);
|
|
3792
3792
|
if(content.__esModule) content = content.default;
|
|
3793
3793
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
3794
3794
|
if(content.locals) module.exports = content.locals;
|
|
3795
3795
|
// add the styles to the DOM
|
|
3796
3796
|
var add = (__webpack_require__(4402)/* ["default"] */ .Z)
|
|
3797
|
-
var update = add("
|
|
3797
|
+
var update = add("66743890", content, true, {"sourceMap":false,"shadowMode":false});
|
|
3798
3798
|
|
|
3799
3799
|
/***/ }),
|
|
3800
3800
|
|
|
@@ -4242,185 +4242,10 @@ if (typeof window !== 'undefined') {
|
|
|
4242
4242
|
;// CONCATENATED MODULE: external "vue"
|
|
4243
4243
|
var external_vue_namespaceObject = require("vue");
|
|
4244
4244
|
var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_namespaceObject);
|
|
4245
|
-
;// CONCATENATED MODULE: ./node_modules
|
|
4246
|
-
var render = function
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
return _c('div', {
|
|
4250
|
-
staticClass: "upload-file"
|
|
4251
|
-
}, [_vm.type == 'default' ? _c('div', [_c('el-upload', {
|
|
4252
|
-
ref: "upload",
|
|
4253
|
-
staticClass: "upload-file-uploader",
|
|
4254
|
-
attrs: {
|
|
4255
|
-
"multiple": "",
|
|
4256
|
-
"action": _vm.domain + _vm.uploadFileUrl,
|
|
4257
|
-
"before-upload": _vm.handleBeforeUpload,
|
|
4258
|
-
"file-list": _vm.fileList,
|
|
4259
|
-
"limit": _vm.limit,
|
|
4260
|
-
"on-error": _vm.handleUploadError,
|
|
4261
|
-
"on-exceed": _vm.handleExceed,
|
|
4262
|
-
"on-success": _vm.handleUploadSuccess,
|
|
4263
|
-
"show-file-list": false,
|
|
4264
|
-
"headers": _vm.headers,
|
|
4265
|
-
"data": _vm.data
|
|
4266
|
-
}
|
|
4267
|
-
}, [_c('el-button', {
|
|
4268
|
-
attrs: {
|
|
4269
|
-
"size": "mini",
|
|
4270
|
-
"type": "primary",
|
|
4271
|
-
"disabled": _vm.disabled
|
|
4272
|
-
}
|
|
4273
|
-
}, [_vm._v(_vm._s(_vm.label))]), _vm.showTip ? _c('div', {
|
|
4274
|
-
staticClass: "el-upload__tip",
|
|
4275
|
-
attrs: {
|
|
4276
|
-
"slot": "tip"
|
|
4277
|
-
},
|
|
4278
|
-
slot: "tip"
|
|
4279
|
-
}, [_vm.fileType ? [_vm._v(" 支持拓展名 "), _c('b', {
|
|
4280
|
-
staticStyle: {
|
|
4281
|
-
"color": "#f56c6c"
|
|
4282
|
-
}
|
|
4283
|
-
}, [_vm._v(_vm._s(_vm.fileType.join("/")))])] : _vm._e(), _vm._v(" 的文件 ")], 2) : _vm._e()], 1), _c('transition-group', {
|
|
4284
|
-
staticClass: "upload-file-list el-upload-list el-upload-list--text",
|
|
4285
|
-
attrs: {
|
|
4286
|
-
"name": "el-fade-in-linear",
|
|
4287
|
-
"tag": "ul"
|
|
4288
|
-
}
|
|
4289
|
-
}, _vm._l(_vm.fileList, function (file, index) {
|
|
4290
|
-
return _c('li', {
|
|
4291
|
-
key: file.url,
|
|
4292
|
-
staticClass: "el-upload-list__item ele-upload-list__item-content"
|
|
4293
|
-
}, [_c('el-link', {
|
|
4294
|
-
attrs: {
|
|
4295
|
-
"href": `${file.url}`,
|
|
4296
|
-
"underline": false,
|
|
4297
|
-
"target": "_blank"
|
|
4298
|
-
}
|
|
4299
|
-
}, [_c('span', {
|
|
4300
|
-
staticClass: "el-icon-document"
|
|
4301
|
-
}, [_vm._v(" " + _vm._s(file.name) + " ")])]), _c('div', {
|
|
4302
|
-
staticClass: "ele-upload-list__item-content-action"
|
|
4303
|
-
}, [_c('el-link', {
|
|
4304
|
-
attrs: {
|
|
4305
|
-
"underline": false,
|
|
4306
|
-
"type": "danger"
|
|
4307
|
-
},
|
|
4308
|
-
on: {
|
|
4309
|
-
"click": function ($event) {
|
|
4310
|
-
return _vm.handleDelete(index);
|
|
4311
|
-
}
|
|
4312
|
-
}
|
|
4313
|
-
}, [_vm._v("删除")])], 1)], 1);
|
|
4314
|
-
}), 0)], 1) : _vm._e(), _vm.type == 'single-thumb' ? _c('div', {
|
|
4315
|
-
class: 'single-image-upload' + (_vm.disabled ? ' is-disabled ' : '')
|
|
4316
|
-
}, [_c('el-upload', {
|
|
4317
|
-
staticClass: "avatar-uploader",
|
|
4318
|
-
attrs: {
|
|
4319
|
-
"action": _vm.domain + _vm.uploadFileUrl,
|
|
4320
|
-
"show-file-list": false,
|
|
4321
|
-
"on-error": _vm.handleUploadError,
|
|
4322
|
-
"on-success": _vm.handleSuccess,
|
|
4323
|
-
"before-upload": _vm.handleBeforeUpload,
|
|
4324
|
-
"headers": _vm.headers,
|
|
4325
|
-
"data": _vm.data,
|
|
4326
|
-
"disabled": _vm.disabled
|
|
4327
|
-
}
|
|
4328
|
-
}, [_vm.imageUrl ? [_c('el-image', {
|
|
4329
|
-
style: 'width: ' + _vm.width + 'px; height: ' + _vm.height + 'px',
|
|
4330
|
-
attrs: {
|
|
4331
|
-
"src": _vm.imageUrl
|
|
4332
|
-
}
|
|
4333
|
-
})] : [_c('div', {
|
|
4334
|
-
staticClass: "default-lable",
|
|
4335
|
-
style: 'width: ' + _vm.width + 'px; height: ' + _vm.height + 'px'
|
|
4336
|
-
}, [_c('div', {
|
|
4337
|
-
staticClass: "image-slot"
|
|
4338
|
-
}, [_c('i', {
|
|
4339
|
-
staticClass: "el-icon-plus"
|
|
4340
|
-
}), _vm._v(_vm._s(_vm.label))])])], _vm.showTip ? _c('div', {
|
|
4341
|
-
staticClass: "el-upload__tip",
|
|
4342
|
-
attrs: {
|
|
4343
|
-
"slot": "tip"
|
|
4344
|
-
},
|
|
4345
|
-
slot: "tip"
|
|
4346
|
-
}, [_vm.fileType ? [_vm._v(" 支持拓展名 "), _c('b', {
|
|
4347
|
-
staticStyle: {
|
|
4348
|
-
"color": "#f56c6c"
|
|
4349
|
-
}
|
|
4350
|
-
}, [_vm._v(_vm._s(_vm.fileType.join("/")))])] : _vm._e(), _vm._v(" 的文件 ")], 2) : _vm._e()], 2)], 1) : _vm._e(), _vm.type == 'rmt-thumb-new' ? _c('div', {
|
|
4351
|
-
class: 'single-file-upload' + (_vm.disabled ? ' is-disabled ' : '')
|
|
4352
|
-
}, [_c('div', {
|
|
4353
|
-
staticClass: "prize-row row-img-box"
|
|
4354
|
-
}, [_c('el-image', {
|
|
4355
|
-
staticClass: "rmt-thumb-new",
|
|
4356
|
-
class: _vm.hasUpload ? ' has-upload' : '',
|
|
4357
|
-
attrs: {
|
|
4358
|
-
"shape": "square",
|
|
4359
|
-
"fit": "fill",
|
|
4360
|
-
"src": _vm.imageUrl
|
|
4361
|
-
}
|
|
4362
|
-
}), _c('div', {
|
|
4363
|
-
staticClass: "img-btn-box"
|
|
4364
|
-
}, [_vm.isNetwork ? _c('el-button', {
|
|
4365
|
-
staticClass: "btn-big network-img",
|
|
4366
|
-
attrs: {
|
|
4367
|
-
"type": "success",
|
|
4368
|
-
"size": "mini"
|
|
4369
|
-
},
|
|
4370
|
-
on: {
|
|
4371
|
-
"click": _vm.uploadNetworkImg
|
|
4372
|
-
}
|
|
4373
|
-
}, [_vm._v("网络图片 ")]) : _vm._e(), _vm.isNetwork ? _c('div', {
|
|
4374
|
-
staticStyle: {
|
|
4375
|
-
"width": "16px"
|
|
4376
|
-
}
|
|
4377
|
-
}) : _vm._e(), _c('el-upload', {
|
|
4378
|
-
staticClass: "avatar-uploader",
|
|
4379
|
-
attrs: {
|
|
4380
|
-
"action": _vm.domain + _vm.uploadFileUrl,
|
|
4381
|
-
"show-file-list": false,
|
|
4382
|
-
"on-error": _vm.handleUploadError,
|
|
4383
|
-
"on-success": _vm.handleSuccess,
|
|
4384
|
-
"before-upload": _vm.handleBeforeUpload,
|
|
4385
|
-
"headers": _vm.headers,
|
|
4386
|
-
"data": _vm.data,
|
|
4387
|
-
"disabled": _vm.disabled
|
|
4388
|
-
}
|
|
4389
|
-
}, [_vm.showButton ? _c('el-button', {
|
|
4390
|
-
attrs: {
|
|
4391
|
-
"size": "mini",
|
|
4392
|
-
"type": "primary",
|
|
4393
|
-
"disabled": _vm.disabled
|
|
4394
|
-
}
|
|
4395
|
-
}, [_vm._v(_vm._s(_vm.label))]) : _vm._e()], 1)], 1), _vm.showTip ? _c('div', {
|
|
4396
|
-
staticClass: "el-upload__tip",
|
|
4397
|
-
attrs: {
|
|
4398
|
-
"slot": "tip"
|
|
4399
|
-
},
|
|
4400
|
-
slot: "tip"
|
|
4401
|
-
}, [_vm.fileType ? [_vm._v(" 支持拓展名 "), _c('b', {
|
|
4402
|
-
staticStyle: {
|
|
4403
|
-
"color": "#f56c6c"
|
|
4404
|
-
}
|
|
4405
|
-
}, [_vm._v(_vm._s(_vm.fileType.join("/")))])] : _vm._e(), _vm._v(" 的文件 ")], 2) : _vm._e()], 1)]) : _vm._e(), _vm.type === 'igw-media' ? _c('div', [_c('el-upload', {
|
|
4406
|
-
ref: "upload",
|
|
4407
|
-
staticClass: "upload-file-uploader",
|
|
4408
|
-
attrs: {
|
|
4409
|
-
"multiple": "",
|
|
4410
|
-
"action": _vm.domain + _vm.uploadFileUrl,
|
|
4411
|
-
"before-upload": _vm.handleBeforeUpload,
|
|
4412
|
-
"file-list": _vm.fileList,
|
|
4413
|
-
"limit": _vm.limit,
|
|
4414
|
-
"on-error": _vm.handleUploadError,
|
|
4415
|
-
"on-exceed": _vm.handleExceed,
|
|
4416
|
-
"on-success": _vm.handleUploadSuccess,
|
|
4417
|
-
"show-file-list": false,
|
|
4418
|
-
"headers": _vm.headers,
|
|
4419
|
-
"data": _vm.data
|
|
4420
|
-
}
|
|
4421
|
-
}, [_vm._t("default")], 2)], 1) : _vm._e()]);
|
|
4422
|
-
};
|
|
4423
|
-
var staticRenderFns = [];
|
|
4245
|
+
;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=template&id=8420ab38&scoped=true&
|
|
4246
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"upload-file"},[(_vm.type=='default')?_c('div',[_c('el-upload',{ref:"upload",staticClass:"upload-file-uploader",attrs:{"multiple":"","action":_vm.domain + _vm.uploadFileUrl,"before-upload":_vm.handleBeforeUpload,"file-list":_vm.fileList,"limit":_vm.limit,"on-error":_vm.handleUploadError,"on-exceed":_vm.handleExceed,"on-success":_vm.handleUploadSuccess,"show-file-list":false,"headers":_vm.headers,"data":_vm.postData}},[_c('el-button',{attrs:{"size":"mini","type":"primary","disabled":_vm.disabled}},[_vm._v(_vm._s(_vm.label))]),(_vm.showTip)?_c('div',{staticClass:"el-upload__tip",attrs:{"slot":"tip"},slot:"tip"},[(_vm.fileType)?[_vm._v(" 支持拓展名 "),_c('b',{staticStyle:{"color":"#f56c6c"}},[_vm._v(_vm._s(_vm.fileType.join("/")))])]:_vm._e(),_vm._v(" 的文件 ")],2):_vm._e()],1),_c('transition-group',{staticClass:"upload-file-list el-upload-list el-upload-list--text",attrs:{"name":"el-fade-in-linear","tag":"ul"}},_vm._l((_vm.fileList),function(file,index){return _c('li',{key:file.url,staticClass:"el-upload-list__item ele-upload-list__item-content"},[_c('el-link',{attrs:{"href":("" + (file.url)),"underline":false,"target":"_blank"}},[_c('span',{staticClass:"el-icon-document"},[_vm._v(" "+_vm._s(file.name)+" ")])]),_c('div',{staticClass:"ele-upload-list__item-content-action"},[_c('el-link',{attrs:{"underline":false,"type":"danger"},on:{"click":function($event){return _vm.handleDelete(index)}}},[_vm._v("删除")])],1)],1)}),0)],1):_vm._e(),(_vm.type=='single-thumb')?_c('div',{class:'single-image-upload'+ (_vm.disabled?' is-disabled ':'')},[_c('el-upload',{staticClass:"avatar-uploader",attrs:{"action":_vm.domain + _vm.uploadFileUrl,"show-file-list":false,"on-error":_vm.handleUploadError,"on-success":_vm.handleSuccess,"before-upload":_vm.handleBeforeUpload,"headers":_vm.headers,"data":_vm.postData,"disabled":_vm.disabled}},[(_vm.imageUrl)?[_c('el-image',{style:('width: ' + _vm.width + 'px; height: ' + _vm.height + 'px'),attrs:{"src":_vm.imageUrl}})]:[_c('div',{staticClass:"default-lable",style:('width: ' + _vm.width + 'px; height: ' + _vm.height + 'px')},[_c('div',{staticClass:"image-slot"},[_c('i',{staticClass:"el-icon-plus"}),_vm._v(_vm._s(_vm.label))])])],(_vm.showTip)?_c('div',{staticClass:"el-upload__tip",attrs:{"slot":"tip"},slot:"tip"},[(_vm.fileType)?[_vm._v(" 支持拓展名 "),_c('b',{staticStyle:{"color":"#f56c6c"}},[_vm._v(_vm._s(_vm.fileType.join("/")))])]:_vm._e(),_vm._v(" 的文件 ")],2):_vm._e()],2)],1):_vm._e(),(_vm.type=='rmt-thumb-new')?_c('div',{class:'single-file-upload'+ (_vm.disabled?' is-disabled ':'')},[_c('div',{staticClass:"prize-row row-img-box"},[_c('el-image',{staticClass:"rmt-thumb-new",class:_vm.hasUpload?' has-upload':'',attrs:{"shape":"square","fit":"fill","src":_vm.imageUrl}}),_c('div',{staticClass:"img-btn-box"},[(_vm.isNetwork)?_c('el-button',{staticClass:"btn-big network-img",attrs:{"type":"success","size":"mini"},on:{"click":_vm.uploadNetworkImg}},[_vm._v("网络图片 ")]):_vm._e(),(_vm.isNetwork)?_c('div',{staticStyle:{"width":"16px"}}):_vm._e(),_c('el-upload',{staticClass:"avatar-uploader",attrs:{"action":_vm.domain + _vm.uploadFileUrl,"show-file-list":false,"on-error":_vm.handleUploadError,"on-success":_vm.handleSuccess,"before-upload":_vm.handleBeforeUpload,"headers":_vm.headers,"data":_vm.postData,"disabled":_vm.disabled}},[(_vm.showButton)?_c('el-button',{attrs:{"size":"mini","type":"primary","disabled":_vm.disabled}},[_vm._v(_vm._s(_vm.label))]):_vm._e()],1)],1),(_vm.showTip)?_c('div',{staticClass:"el-upload__tip",attrs:{"slot":"tip"},slot:"tip"},[(_vm.fileType)?[_vm._v(" 支持拓展名 "),_c('b',{staticStyle:{"color":"#f56c6c"}},[_vm._v(_vm._s(_vm.fileType.join("/")))])]:_vm._e(),_vm._v(" 的文件 ")],2):_vm._e()],1)]):_vm._e(),(_vm.type === 'igw-media')?_c('div',[_c('el-upload',{ref:"upload",staticClass:"upload-file-uploader",attrs:{"multiple":"","action":_vm.domain + _vm.uploadFileUrl,"before-upload":_vm.handleBeforeUpload,"file-list":_vm.fileList,"limit":_vm.limit,"on-error":_vm.handleUploadError,"on-exceed":_vm.handleExceed,"on-success":_vm.handleUploadSuccess,"show-file-list":false,"headers":_vm.headers,"data":_vm.postData}},[_vm._t("default")],2)],1):_vm._e()])}
|
|
4247
|
+
var staticRenderFns = []
|
|
4248
|
+
|
|
4424
4249
|
|
|
4425
4250
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
4426
4251
|
var es_array_push = __webpack_require__(7658);
|
|
@@ -5189,6 +5014,100 @@ function uploadNetworkImg(params) {
|
|
|
5189
5014
|
});
|
|
5190
5015
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=script&lang=js&
|
|
5191
5016
|
|
|
5017
|
+
//
|
|
5018
|
+
//
|
|
5019
|
+
//
|
|
5020
|
+
//
|
|
5021
|
+
//
|
|
5022
|
+
//
|
|
5023
|
+
//
|
|
5024
|
+
//
|
|
5025
|
+
//
|
|
5026
|
+
//
|
|
5027
|
+
//
|
|
5028
|
+
//
|
|
5029
|
+
//
|
|
5030
|
+
//
|
|
5031
|
+
//
|
|
5032
|
+
//
|
|
5033
|
+
//
|
|
5034
|
+
//
|
|
5035
|
+
//
|
|
5036
|
+
//
|
|
5037
|
+
//
|
|
5038
|
+
//
|
|
5039
|
+
//
|
|
5040
|
+
//
|
|
5041
|
+
//
|
|
5042
|
+
//
|
|
5043
|
+
//
|
|
5044
|
+
//
|
|
5045
|
+
//
|
|
5046
|
+
//
|
|
5047
|
+
//
|
|
5048
|
+
//
|
|
5049
|
+
//
|
|
5050
|
+
//
|
|
5051
|
+
//
|
|
5052
|
+
//
|
|
5053
|
+
//
|
|
5054
|
+
//
|
|
5055
|
+
//
|
|
5056
|
+
//
|
|
5057
|
+
//
|
|
5058
|
+
//
|
|
5059
|
+
//
|
|
5060
|
+
//
|
|
5061
|
+
//
|
|
5062
|
+
//
|
|
5063
|
+
//
|
|
5064
|
+
//
|
|
5065
|
+
//
|
|
5066
|
+
//
|
|
5067
|
+
//
|
|
5068
|
+
//
|
|
5069
|
+
//
|
|
5070
|
+
//
|
|
5071
|
+
//
|
|
5072
|
+
//
|
|
5073
|
+
//
|
|
5074
|
+
//
|
|
5075
|
+
//
|
|
5076
|
+
//
|
|
5077
|
+
//
|
|
5078
|
+
//
|
|
5079
|
+
//
|
|
5080
|
+
//
|
|
5081
|
+
//
|
|
5082
|
+
//
|
|
5083
|
+
//
|
|
5084
|
+
//
|
|
5085
|
+
//
|
|
5086
|
+
//
|
|
5087
|
+
//
|
|
5088
|
+
//
|
|
5089
|
+
//
|
|
5090
|
+
//
|
|
5091
|
+
//
|
|
5092
|
+
//
|
|
5093
|
+
//
|
|
5094
|
+
//
|
|
5095
|
+
//
|
|
5096
|
+
//
|
|
5097
|
+
//
|
|
5098
|
+
//
|
|
5099
|
+
//
|
|
5100
|
+
//
|
|
5101
|
+
//
|
|
5102
|
+
//
|
|
5103
|
+
//
|
|
5104
|
+
//
|
|
5105
|
+
//
|
|
5106
|
+
//
|
|
5107
|
+
//
|
|
5108
|
+
//
|
|
5109
|
+
//
|
|
5110
|
+
|
|
5192
5111
|
// import { rmtFileUpload } from "./index.js";
|
|
5193
5112
|
|
|
5194
5113
|
/* harmony default export */ var rmtFileUploadvue_type_script_lang_js_ = ({
|
|
@@ -5268,11 +5187,20 @@ function uploadNetworkImg(params) {
|
|
|
5268
5187
|
type: String,
|
|
5269
5188
|
default: "/upload/upload"
|
|
5270
5189
|
},
|
|
5271
|
-
//
|
|
5190
|
+
// 上传的图片服务器地址新版本
|
|
5272
5191
|
uploadDomain: {
|
|
5273
5192
|
type: String,
|
|
5274
5193
|
default: 'https://attachment.pengbei.tech'
|
|
5275
5194
|
},
|
|
5195
|
+
enableV1CmsApi: {
|
|
5196
|
+
type: Boolean,
|
|
5197
|
+
default: true
|
|
5198
|
+
},
|
|
5199
|
+
// V1版本上传接口 https://www.sc.sgcc.com.cn/rmt_x/cms/admin/sys/upload/upload?format=json&type=video&source=3
|
|
5200
|
+
uploadV1CmsApi: {
|
|
5201
|
+
type: String,
|
|
5202
|
+
default: ''
|
|
5203
|
+
},
|
|
5276
5204
|
// 获取token的接口地址
|
|
5277
5205
|
tokenDomain: {
|
|
5278
5206
|
type: String,
|
|
@@ -5353,21 +5281,34 @@ function uploadNetworkImg(params) {
|
|
|
5353
5281
|
}
|
|
5354
5282
|
},
|
|
5355
5283
|
created() {
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5284
|
+
if (!this.enableV1CmsApi) {
|
|
5285
|
+
rmtFileUploadSdk.isTokenExpired(() => {
|
|
5286
|
+
this.headers['X-Key'] = rmtFileUploadSdk.getCookies('X-Key');
|
|
5287
|
+
this.headers['X-Token'] = rmtFileUploadSdk.getCookies('X-Token');
|
|
5288
|
+
this.domain = rmtFileUploadSdk.getCookies('domain') || this.uploadDomain;
|
|
5289
|
+
}, this.tokenDomain);
|
|
5290
|
+
}
|
|
5361
5291
|
},
|
|
5362
5292
|
computed: {
|
|
5363
5293
|
// 是否显示提示
|
|
5364
5294
|
showTip() {
|
|
5365
5295
|
return this.isShowTip && (this.fileType || this.fileSize);
|
|
5296
|
+
},
|
|
5297
|
+
postData() {
|
|
5298
|
+
if (this.enableV1CmsApi) {
|
|
5299
|
+
return {
|
|
5300
|
+
format: 'json',
|
|
5301
|
+
type: 'image'
|
|
5302
|
+
};
|
|
5303
|
+
} else {
|
|
5304
|
+
return this.data;
|
|
5305
|
+
}
|
|
5366
5306
|
}
|
|
5367
5307
|
},
|
|
5368
5308
|
methods: {
|
|
5369
5309
|
// 上传前校检格式和大小
|
|
5370
5310
|
async handleBeforeUpload(file) {
|
|
5311
|
+
console.log('handleBeforeUpload file', file);
|
|
5371
5312
|
var that = this;
|
|
5372
5313
|
if (typeof that.beforeFun == 'function') {
|
|
5373
5314
|
that.beforeFun(file);
|
|
@@ -5402,6 +5343,11 @@ function uploadNetworkImg(params) {
|
|
|
5402
5343
|
// 判断token是否过期
|
|
5403
5344
|
var isTokenOk = function () {
|
|
5404
5345
|
return new Promise((resolve, reject) => {
|
|
5346
|
+
if (that.enableV1CmsApi) {
|
|
5347
|
+
// V1CmsApi不校验token
|
|
5348
|
+
resolve(true);
|
|
5349
|
+
return;
|
|
5350
|
+
}
|
|
5405
5351
|
rmtFileUploadSdk.isTokenExpired(() => {
|
|
5406
5352
|
that.headers['X-Key'] = rmtFileUploadSdk.getCookies('X-Key');
|
|
5407
5353
|
that.headers['X-Token'] = rmtFileUploadSdk.getCookies('X-Token');
|
|
@@ -5434,6 +5380,7 @@ function uploadNetworkImg(params) {
|
|
|
5434
5380
|
},
|
|
5435
5381
|
// 上传失败
|
|
5436
5382
|
handleUploadError(res) {
|
|
5383
|
+
console.log('handleUploadError', res);
|
|
5437
5384
|
var that = this;
|
|
5438
5385
|
that.$message.error("上传失败,请重试");
|
|
5439
5386
|
that.$modal.closeLoading();
|
|
@@ -5443,8 +5390,10 @@ function uploadNetworkImg(params) {
|
|
|
5443
5390
|
},
|
|
5444
5391
|
// 上传成功回调
|
|
5445
5392
|
handleUploadSuccess(res) {
|
|
5393
|
+
console.log('handleUploadSuccess', res);
|
|
5446
5394
|
var that = this;
|
|
5447
5395
|
if (res.data && res.data.url) {
|
|
5396
|
+
// 新附件服务数据格式
|
|
5448
5397
|
that.$message.success("上传成功");
|
|
5449
5398
|
that.uploadList.push({
|
|
5450
5399
|
FileName: res.data.originalFileName,
|
|
@@ -5459,6 +5408,22 @@ function uploadNetworkImg(params) {
|
|
|
5459
5408
|
if (typeof that.successFun == 'function') {
|
|
5460
5409
|
that.successFun(res);
|
|
5461
5410
|
}
|
|
5411
|
+
} else if (that.enableV1CmsApi && res.url) {
|
|
5412
|
+
// 旧附件服务数据格式
|
|
5413
|
+
that.$message.success("上传成功");
|
|
5414
|
+
that.uploadList.push({
|
|
5415
|
+
FileName: res.fileName,
|
|
5416
|
+
url: res.url
|
|
5417
|
+
});
|
|
5418
|
+
if (that.uploadList.length === that.number) {
|
|
5419
|
+
that.fileList = that.fileList.concat(that.uploadList);
|
|
5420
|
+
that.uploadList = [];
|
|
5421
|
+
that.number = 0;
|
|
5422
|
+
that.$emit("input", that.listToString(that.fileList));
|
|
5423
|
+
}
|
|
5424
|
+
if (typeof that.successFun == 'function') {
|
|
5425
|
+
that.successFun(res);
|
|
5426
|
+
}
|
|
5462
5427
|
} else {
|
|
5463
5428
|
that.$message.error(res.message || "上传失败");
|
|
5464
5429
|
if (typeof that.errorFun == 'function') {
|
|
@@ -5512,11 +5477,24 @@ function uploadNetworkImg(params) {
|
|
|
5512
5477
|
that.hasUpload = true;
|
|
5513
5478
|
// that.$emit("input", res.data.url);
|
|
5514
5479
|
|
|
5480
|
+
if (typeof that.successFun == 'function') {
|
|
5481
|
+
that.successFun(res);
|
|
5482
|
+
}
|
|
5483
|
+
} else if (that.enableV1CmsApi && res.url) {
|
|
5484
|
+
// 旧附件服务数据格式
|
|
5485
|
+
that.$message.success("上传成功");
|
|
5486
|
+
that.uploadList = [{
|
|
5487
|
+
FileName: res.fileName,
|
|
5488
|
+
url: res.url
|
|
5489
|
+
}];
|
|
5490
|
+
that.imageUrl = res.url;
|
|
5491
|
+
that.$emit("input", that.listToString(that.uploadList));
|
|
5492
|
+
that.hasUpload = true;
|
|
5515
5493
|
if (typeof that.successFun == 'function') {
|
|
5516
5494
|
that.successFun(res);
|
|
5517
5495
|
}
|
|
5518
5496
|
} else {
|
|
5519
|
-
this.$message.error("上传失败");
|
|
5497
|
+
this.$message.error("上传失败 2");
|
|
5520
5498
|
if (typeof that.errorFun == 'function') {
|
|
5521
5499
|
that.errorFun(res);
|
|
5522
5500
|
}
|
|
@@ -5561,9 +5539,9 @@ function uploadNetworkImg(params) {
|
|
|
5561
5539
|
});
|
|
5562
5540
|
;// CONCATENATED MODULE: ./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=script&lang=js&
|
|
5563
5541
|
/* harmony default export */ var rmtFileUpload_rmtFileUploadvue_type_script_lang_js_ = (rmtFileUploadvue_type_script_lang_js_);
|
|
5564
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=style&index=0&id=
|
|
5565
|
-
var
|
|
5566
|
-
;// CONCATENATED MODULE: ./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=style&index=0&id=
|
|
5542
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=style&index=0&id=8420ab38&prod&scoped=true&lang=scss&
|
|
5543
|
+
var rmtFileUploadvue_type_style_index_0_id_8420ab38_prod_scoped_true_lang_scss_ = __webpack_require__(5744);
|
|
5544
|
+
;// CONCATENATED MODULE: ./packages/rmtFileUpload/rmtFileUpload.vue?vue&type=style&index=0&id=8420ab38&prod&scoped=true&lang=scss&
|
|
5567
5545
|
|
|
5568
5546
|
;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
|
|
5569
5547
|
/* globals __VUE_SSR_CONTEXT__ */
|
|
@@ -5678,7 +5656,7 @@ var component = normalizeComponent(
|
|
|
5678
5656
|
staticRenderFns,
|
|
5679
5657
|
false,
|
|
5680
5658
|
null,
|
|
5681
|
-
"
|
|
5659
|
+
"8420ab38",
|
|
5682
5660
|
null
|
|
5683
5661
|
|
|
5684
5662
|
)
|