@v2coding/ui 1.4.2 → 1.4.3
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/dist/v2coding-ui.esm.js +43 -10
- package/dist/v2coding-ui.min.js +1 -1
- package/dist/v2coding-ui.ssr.js +48 -15
- package/package.json +1 -1
package/dist/v2coding-ui.esm.js
CHANGED
|
@@ -118,7 +118,8 @@ const DefaultSetting = {
|
|
|
118
118
|
|
|
119
119
|
},
|
|
120
120
|
uploadType: 'oss',
|
|
121
|
-
uploadSignUrl: '/aliyun/oss'
|
|
121
|
+
uploadSignUrl: '/aliyun/oss',
|
|
122
|
+
uploadPreviewServer: null
|
|
122
123
|
};
|
|
123
124
|
var DefaultSetting$1 = DefaultSetting;
|
|
124
125
|
|
|
@@ -4994,6 +4995,14 @@ var script$l = {
|
|
|
4994
4995
|
type: Boolean,
|
|
4995
4996
|
default: false
|
|
4996
4997
|
},
|
|
4998
|
+
uploadPreviewServer: {
|
|
4999
|
+
type: String,
|
|
5000
|
+
default: () => {
|
|
5001
|
+
var _getSetting3;
|
|
5002
|
+
|
|
5003
|
+
return (_getSetting3 = getSetting()) === null || _getSetting3 === void 0 ? void 0 : _getSetting3.uploadPreviewServer;
|
|
5004
|
+
}
|
|
5005
|
+
},
|
|
4997
5006
|
customUpload: Function,
|
|
4998
5007
|
needCreateAttachment: {
|
|
4999
5008
|
type: Boolean,
|
|
@@ -5133,6 +5142,14 @@ var script$l = {
|
|
|
5133
5142
|
this.$emit('deleteUpload', url);
|
|
5134
5143
|
},
|
|
5135
5144
|
|
|
5145
|
+
getPreviewUrl(url) {
|
|
5146
|
+
if (this.uploadPreviewServer) {
|
|
5147
|
+
return `${this.uploadPreviewServer}?fileUrl=${url}`;
|
|
5148
|
+
}
|
|
5149
|
+
|
|
5150
|
+
return url;
|
|
5151
|
+
},
|
|
5152
|
+
|
|
5136
5153
|
getFileName(url) {
|
|
5137
5154
|
const pathname = decodeURI(new URL(url).pathname);
|
|
5138
5155
|
return pathname.substring(pathname.lastIndexOf('/') + 1);
|
|
@@ -5195,7 +5212,7 @@ var __vue_render__$l = function () {
|
|
|
5195
5212
|
staticClass: "el-icon-document"
|
|
5196
5213
|
}, [_vm._v(" ")]), _vm._v(" "), _c('a', {
|
|
5197
5214
|
attrs: {
|
|
5198
|
-
"href": url,
|
|
5215
|
+
"href": _vm.getPreviewUrl(url),
|
|
5199
5216
|
"target": "_blank",
|
|
5200
5217
|
"title": _vm.getFileName(url)
|
|
5201
5218
|
}
|
|
@@ -5217,8 +5234,8 @@ var __vue_staticRenderFns__$l = [];
|
|
|
5217
5234
|
|
|
5218
5235
|
const __vue_inject_styles__$l = function (inject) {
|
|
5219
5236
|
if (!inject) return;
|
|
5220
|
-
inject("data-v-
|
|
5221
|
-
source: ".ui-file-upload-field[data-v-
|
|
5237
|
+
inject("data-v-c89bbdda_0", {
|
|
5238
|
+
source: ".ui-file-upload-field[data-v-c89bbdda]{width:100%}.ui-file-upload-field .uploader[data-v-c89bbdda]{margin-bottom:5px}.ui-file-upload-field .uploader.disabled[data-v-c89bbdda] .el-upload{cursor:not-allowed;pointer-events:none}.ui-file-upload-field .uploader.disabled[data-v-c89bbdda] .el-upload .upload-btn{color:#888c94;background-color:#edeef0}.ui-file-upload-field .upload-btn[data-v-c89bbdda]{padding:5px 10px;line-height:1;background-color:#409eff;color:#fff;font-size:12px;transition:background-color .3s}.ui-file-upload-field .upload-btn[data-v-c89bbdda]:hover{background-color:#0d84ff}.ui-file-upload-field .files[data-v-c89bbdda]{max-width:100%}.ui-file-upload-field .files .file[data-v-c89bbdda]{color:#606266;font-size:14px;transition:all .3s;cursor:pointer;display:grid;grid-template-columns:14px auto 28px;align-items:center;max-width:100%}.ui-file-upload-field .files .file a[data-v-c89bbdda]{color:#606266;transition:all .3s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-file-upload-field .files .file .close[data-v-c89bbdda]{color:transparent;width:28px;text-align:center;visibility:hidden;transition:color .3s;font-weight:700}.ui-file-upload-field .files .file[data-v-c89bbdda]:hover{background-color:#f5f7fa}.ui-file-upload-field .files .file:hover a[data-v-c89bbdda]{color:var(--color-primary)}.ui-file-upload-field .files .file:hover .close[data-v-c89bbdda]{color:#409eff;visibility:visible}",
|
|
5222
5239
|
map: undefined,
|
|
5223
5240
|
media: undefined
|
|
5224
5241
|
});
|
|
@@ -5226,7 +5243,7 @@ const __vue_inject_styles__$l = function (inject) {
|
|
|
5226
5243
|
/* scoped */
|
|
5227
5244
|
|
|
5228
5245
|
|
|
5229
|
-
const __vue_scope_id__$l = "data-v-
|
|
5246
|
+
const __vue_scope_id__$l = "data-v-c89bbdda";
|
|
5230
5247
|
/* module identifier */
|
|
5231
5248
|
|
|
5232
5249
|
const __vue_module_identifier__$l = undefined;
|
|
@@ -5257,6 +5274,22 @@ var script$k = {
|
|
|
5257
5274
|
type: String,
|
|
5258
5275
|
default: '上传图片'
|
|
5259
5276
|
}
|
|
5277
|
+
},
|
|
5278
|
+
computed: {
|
|
5279
|
+
previewSrcList() {
|
|
5280
|
+
if (!this.previewBtn) {
|
|
5281
|
+
return [];
|
|
5282
|
+
}
|
|
5283
|
+
|
|
5284
|
+
if (this.uploadPreviewServer) {
|
|
5285
|
+
return this.pickerValue.map(url => {
|
|
5286
|
+
return this.getPreviewUrl(url);
|
|
5287
|
+
});
|
|
5288
|
+
}
|
|
5289
|
+
|
|
5290
|
+
return this.pickerValue;
|
|
5291
|
+
}
|
|
5292
|
+
|
|
5260
5293
|
}
|
|
5261
5294
|
};
|
|
5262
5295
|
|
|
@@ -5283,8 +5316,8 @@ var __vue_render__$k = function () {
|
|
|
5283
5316
|
"height": "100%"
|
|
5284
5317
|
},
|
|
5285
5318
|
attrs: {
|
|
5286
|
-
"src": url,
|
|
5287
|
-
"preview-src-list": _vm.
|
|
5319
|
+
"src": _vm.getPreviewUrl(url),
|
|
5320
|
+
"preview-src-list": _vm.previewSrcList,
|
|
5288
5321
|
"fit": "contain"
|
|
5289
5322
|
}
|
|
5290
5323
|
}), _vm._v(" "), _vm.hasDeleteBtn ? _c('div', {
|
|
@@ -5326,8 +5359,8 @@ var __vue_staticRenderFns__$k = [];
|
|
|
5326
5359
|
|
|
5327
5360
|
const __vue_inject_styles__$k = function (inject) {
|
|
5328
5361
|
if (!inject) return;
|
|
5329
|
-
inject("data-v-
|
|
5330
|
-
source: ".ui-image-upload-field[data-v-
|
|
5362
|
+
inject("data-v-2c075646_0", {
|
|
5363
|
+
source: ".ui-image-upload-field[data-v-2c075646]{width:100%;display:flex;flex-direction:row;flex-wrap:wrap}.ui-image-upload-field .uploader.disabled[data-v-2c075646] .el-upload{cursor:not-allowed;pointer-events:none}.ui-image-upload-field .uploader.disabled[data-v-2c075646] .el-upload .upload-btn{background:#edeef0;color:#888c94}.ui-image-upload-field .item[data-v-2c075646]{position:relative;display:flex;justify-content:center;align-items:center;overflow:hidden;width:140px;height:140px;margin-bottom:10px;margin-right:10px;border:1px dashed #d0d2d7;padding:8px;border-radius:2px;box-sizing:border-box}.ui-image-upload-field .item .remove[data-v-2c075646]{position:absolute;top:0;right:0;width:24px;height:24px;background-color:rgba(0,0,0,.7);border-radius:0 0 0 22px;cursor:pointer}.ui-image-upload-field .item .remove .el-icon-close[data-v-2c075646]{position:absolute;top:4px;right:4px;color:#fff;font-size:14px}.ui-image-upload-field .item.upload-btn[data-v-2c075646]{background:#f7f8f9;display:flex;flex-direction:column;align-items:center;justify-content:center;border:none;color:#409eff}.ui-image-upload-field .item.upload-btn>.el-icon-plus[data-v-2c075646]{font-size:1.6em}.ui-image-upload-field .item.upload-btn>span[data-v-2c075646]{font-size:16px;line-height:1.2;margin-top:5px}.ui-image-upload-field .item:hover .modal[data-v-2c075646]{visibility:visible}.ui-image-upload-field[data-v-2c075646] .preview{display:inline-block;width:auto;max-width:60%;left:50%;transform:translateX(-50%)}",
|
|
5331
5364
|
map: undefined,
|
|
5332
5365
|
media: undefined
|
|
5333
5366
|
});
|
|
@@ -5335,7 +5368,7 @@ const __vue_inject_styles__$k = function (inject) {
|
|
|
5335
5368
|
/* scoped */
|
|
5336
5369
|
|
|
5337
5370
|
|
|
5338
|
-
const __vue_scope_id__$k = "data-v-
|
|
5371
|
+
const __vue_scope_id__$k = "data-v-2c075646";
|
|
5339
5372
|
/* module identifier */
|
|
5340
5373
|
|
|
5341
5374
|
const __vue_module_identifier__$k = undefined;
|