@v2coding/ui 0.1.16 → 0.1.19
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 +4 -0
- package/dist/v2coding-ui.esm.js +81 -32
- package/dist/v2coding-ui.min.js +2 -2
- package/dist/v2coding-ui.ssr.js +84 -34
- package/package.json +1 -1
package/dist/v2coding-ui.ssr.js
CHANGED
|
@@ -4802,6 +4802,35 @@ var ColorField = __vue_component__$r;var Upload = {
|
|
|
4802
4802
|
};
|
|
4803
4803
|
});
|
|
4804
4804
|
});
|
|
4805
|
+
},
|
|
4806
|
+
aws: function aws(url, params, file) {
|
|
4807
|
+
var getSignature = function getSignature(params) {
|
|
4808
|
+
return Axios.getInstance().get(url, {
|
|
4809
|
+
params: params
|
|
4810
|
+
});
|
|
4811
|
+
};
|
|
4812
|
+
|
|
4813
|
+
return getSignature(params).then(function (result) {
|
|
4814
|
+
if (!result.success) {
|
|
4815
|
+
return result;
|
|
4816
|
+
}
|
|
4817
|
+
|
|
4818
|
+
var _result$data2 = result.data,
|
|
4819
|
+
url = _result$data2.url,
|
|
4820
|
+
putUrl = _result$data2.putUrl;
|
|
4821
|
+
return Axios.getInstance().put(putUrl, file.file, {
|
|
4822
|
+
headers: {
|
|
4823
|
+
'Content-Type': 'multipart/form-data'
|
|
4824
|
+
}
|
|
4825
|
+
}).then(function () {
|
|
4826
|
+
return {
|
|
4827
|
+
success: true,
|
|
4828
|
+
data: {
|
|
4829
|
+
url: url
|
|
4830
|
+
}
|
|
4831
|
+
};
|
|
4832
|
+
});
|
|
4833
|
+
});
|
|
4805
4834
|
}
|
|
4806
4835
|
};var _excluded$7 = ["upload"];
|
|
4807
4836
|
var quillRedefine = function quillRedefine(config) {
|
|
@@ -5093,6 +5122,7 @@ var script$p = {
|
|
|
5093
5122
|
type: Boolean,
|
|
5094
5123
|
default: false
|
|
5095
5124
|
},
|
|
5125
|
+
customUpload: Function,
|
|
5096
5126
|
needCreateAttachment: {
|
|
5097
5127
|
type: Boolean,
|
|
5098
5128
|
default: false
|
|
@@ -5152,41 +5182,61 @@ var script$p = {
|
|
|
5152
5182
|
}
|
|
5153
5183
|
|
|
5154
5184
|
this.uploading = true;
|
|
5155
|
-
var uploadServer = Upload[this.uploadType] || Upload.default;
|
|
5156
|
-
uploadServer(this.url, {
|
|
5157
|
-
filename: file.name
|
|
5158
|
-
}, {
|
|
5159
|
-
file: file,
|
|
5160
|
-
filename: this.filename
|
|
5161
|
-
}).then(function (result) {
|
|
5162
|
-
var _result$data;
|
|
5163
5185
|
|
|
5164
|
-
|
|
5186
|
+
if (typeof this.customUpload === 'function') {
|
|
5187
|
+
var done = function done(url) {
|
|
5188
|
+
_this.onChange([].concat(_toConsumableArray(_this.pickerValue), [url]).join(','));
|
|
5165
5189
|
|
|
5166
|
-
|
|
5167
|
-
|
|
5190
|
+
_this.handleAttachment(file, url);
|
|
5191
|
+
};
|
|
5168
5192
|
|
|
5169
|
-
|
|
5170
|
-
|
|
5193
|
+
this.customUpload({
|
|
5194
|
+
file: file,
|
|
5195
|
+
filename: this.filename,
|
|
5196
|
+
done: done
|
|
5197
|
+
});
|
|
5198
|
+
} else {
|
|
5199
|
+
var uploadServer = Upload[this.uploadType] || Upload.default;
|
|
5200
|
+
uploadServer(this.url, {
|
|
5201
|
+
filename: file.name
|
|
5202
|
+
}, {
|
|
5203
|
+
file: file,
|
|
5204
|
+
filename: this.filename
|
|
5205
|
+
}).then(function (result) {
|
|
5206
|
+
var _result$data;
|
|
5171
5207
|
|
|
5172
|
-
|
|
5208
|
+
_this.uploading = false;
|
|
5173
5209
|
|
|
5174
|
-
|
|
5210
|
+
if (!(result !== null && result !== void 0 && result.success)) {
|
|
5211
|
+
_this.$message.error(result.message || '上传失败');
|
|
5175
5212
|
|
|
5176
|
-
|
|
5213
|
+
return;
|
|
5214
|
+
}
|
|
5177
5215
|
|
|
5178
|
-
|
|
5216
|
+
_this.$message.success('上传成功');
|
|
5179
5217
|
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5218
|
+
var url = result === null || result === void 0 ? void 0 : (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.url;
|
|
5219
|
+
|
|
5220
|
+
_this.onChange([].concat(_toConsumableArray(_this.pickerValue), [url]).join(','));
|
|
5221
|
+
|
|
5222
|
+
_this.$emit('afterUpload', result);
|
|
5223
|
+
|
|
5224
|
+
_this.handleAttachment(file, url);
|
|
5225
|
+
}).catch(function () {
|
|
5226
|
+
_this.uploading = false;
|
|
5227
|
+
});
|
|
5228
|
+
}
|
|
5229
|
+
},
|
|
5230
|
+
handleAttachment: function handleAttachment(file, url) {
|
|
5231
|
+
var _this2 = this;
|
|
5232
|
+
|
|
5233
|
+
if (this.needCreateAttachment && typeof this.createAttachment === 'function') {
|
|
5234
|
+
this.createAttachment(file, url).then(function (result) {
|
|
5235
|
+
_this2.$emit('create-attachment', result);
|
|
5236
|
+
}).catch(function (error) {
|
|
5237
|
+
_this2.$emit('create-attachment', error);
|
|
5238
|
+
});
|
|
5239
|
+
}
|
|
5190
5240
|
},
|
|
5191
5241
|
remove: function remove(url) {
|
|
5192
5242
|
console.log(this.pickerValue);
|
|
@@ -5205,7 +5255,7 @@ var script$p = {
|
|
|
5205
5255
|
this.$emit('deleteUpload', url);
|
|
5206
5256
|
},
|
|
5207
5257
|
getFileName: function getFileName(url) {
|
|
5208
|
-
var pathname = new URL(url).pathname;
|
|
5258
|
+
var pathname = decodeURI(new URL(url).pathname);
|
|
5209
5259
|
return pathname.substring(pathname.lastIndexOf('/') + 1);
|
|
5210
5260
|
}
|
|
5211
5261
|
}
|
|
@@ -5244,8 +5294,8 @@ var __vue_render__$o = function __vue_render__() {
|
|
|
5244
5294
|
class: {
|
|
5245
5295
|
disabled: _vm.uploading
|
|
5246
5296
|
}
|
|
5247
|
-
}, [_vm._v("浏览...")])]) : _vm._e(), _vm._ssrNode(" <div class=\"files\" data-v-
|
|
5248
|
-
return !!url ? "<div class=\"file\" data-v-
|
|
5297
|
+
}, [_vm._v("浏览...")])]) : _vm._e(), _vm._ssrNode(" <div class=\"files\" data-v-adbfc424>" + _vm._ssrList(_vm.pickerValue, function (url, index) {
|
|
5298
|
+
return !!url ? "<div class=\"file\" data-v-adbfc424><i class=\"el-icon-document\" data-v-adbfc424> </i> <a" + _vm._ssrAttr("href", url) + " target=\"_blank\"" + _vm._ssrAttr("title", _vm.getFileName(url)) + " data-v-adbfc424>" + _vm._ssrEscape(_vm._s(_vm.getFileName(url))) + "</a> " + (_vm.hasDeleteBtn ? "<span class=\"close\" data-v-adbfc424><i class=\"el-icon-close\" data-v-adbfc424></i></span>" : "<!---->") + "</div>" : "<!---->";
|
|
5249
5299
|
}) + "</div>")], 2);
|
|
5250
5300
|
};
|
|
5251
5301
|
|
|
@@ -5254,8 +5304,8 @@ var __vue_staticRenderFns__$o = [];
|
|
|
5254
5304
|
|
|
5255
5305
|
var __vue_inject_styles__$p = function __vue_inject_styles__(inject) {
|
|
5256
5306
|
if (!inject) return;
|
|
5257
|
-
inject("data-v-
|
|
5258
|
-
source: ".ui-file-upload-field[data-v-
|
|
5307
|
+
inject("data-v-adbfc424_0", {
|
|
5308
|
+
source: ".ui-file-upload-field[data-v-adbfc424]{width:100%}.ui-file-upload-field .uploader[data-v-adbfc424]{margin-bottom:5px}.ui-file-upload-field .uploader.disabled[data-v-adbfc424] .el-upload{cursor:not-allowed;pointer-events:none}.ui-file-upload-field .uploader.disabled[data-v-adbfc424] .el-upload .upload-btn{color:#888c94;background-color:#edeef0}.ui-file-upload-field .upload-btn[data-v-adbfc424]{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-adbfc424]:hover{background-color:#0d84ff}.ui-file-upload-field .files[data-v-adbfc424]{max-width:100%}.ui-file-upload-field .files .file[data-v-adbfc424]{color:#606266;font-size:14px;transition:all .3s;cursor:pointer;display:flex;align-items:center;max-width:100%}.ui-file-upload-field .files .file a[data-v-adbfc424]{flex:1;color:#606266;transition:all .3s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-file-upload-field .files .file .close[data-v-adbfc424]{color:transparent;width:28px;text-align:center;visibility:hidden;transition:color .3s;font-weight:700}.ui-file-upload-field .files .file[data-v-adbfc424]:hover{background-color:#f5f7fa}.ui-file-upload-field .files .file:hover a[data-v-adbfc424]{color:var(--color-primary)}.ui-file-upload-field .files .file:hover .close[data-v-adbfc424]{color:#409eff;visibility:visible}",
|
|
5259
5309
|
map: undefined,
|
|
5260
5310
|
media: undefined
|
|
5261
5311
|
});
|
|
@@ -5263,10 +5313,10 @@ var __vue_inject_styles__$p = function __vue_inject_styles__(inject) {
|
|
|
5263
5313
|
/* scoped */
|
|
5264
5314
|
|
|
5265
5315
|
|
|
5266
|
-
var __vue_scope_id__$p = "data-v-
|
|
5316
|
+
var __vue_scope_id__$p = "data-v-adbfc424";
|
|
5267
5317
|
/* module identifier */
|
|
5268
5318
|
|
|
5269
|
-
var __vue_module_identifier__$p = "data-v-
|
|
5319
|
+
var __vue_module_identifier__$p = "data-v-adbfc424";
|
|
5270
5320
|
/* functional template */
|
|
5271
5321
|
|
|
5272
5322
|
var __vue_is_functional_template__$p = false;
|