widget.qw 1.0.56 → 1.0.58
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/build/style.css +4 -4
- package/build/widget.qw.es.js +33 -12
- package/build/widget.qw.umd.js +33 -12
- package/package.json +1 -1
- package/src/components/DatetimePicker/index.vue +12 -1
- package/src/components/image_picker.vue +9 -2
- package/src/components/images_picker.vue +9 -2
- package/src/util/image_util.js +2 -2
- package/src/views/datetimepicker/index.vue +1 -1
package/build/style.css
CHANGED
|
@@ -387,18 +387,18 @@
|
|
|
387
387
|
color: #969799;
|
|
388
388
|
margin-right: 5px;
|
|
389
389
|
}
|
|
390
|
-
[data-v-
|
|
390
|
+
[data-v-0c9127e8] .label {
|
|
391
391
|
color: #000 !important;
|
|
392
392
|
}
|
|
393
|
-
[data-v-
|
|
393
|
+
[data-v-0c9127e8] .van-field__control:disabled {
|
|
394
394
|
color: #000 !important;
|
|
395
395
|
cursor: not-allowed;
|
|
396
396
|
opacity: 1;
|
|
397
397
|
-webkit-text-fill-color: #000;
|
|
398
|
-
}.widget[data-v-
|
|
398
|
+
}.widget[data-v-8a570fc4] {
|
|
399
399
|
text-align: center;
|
|
400
400
|
}
|
|
401
|
-
.widget .btn[data-v-
|
|
401
|
+
.widget .btn[data-v-8a570fc4] {
|
|
402
402
|
position: fixed;
|
|
403
403
|
bottom: 1rem;
|
|
404
404
|
left: 0;
|
package/build/widget.qw.es.js
CHANGED
|
@@ -10171,8 +10171,8 @@ const compress_image = (file) => __async(this, null, function* () {
|
|
|
10171
10171
|
return new Promise((resolve, reject) => {
|
|
10172
10172
|
new Compressor(file, {
|
|
10173
10173
|
quality: 0.7,
|
|
10174
|
-
maxWidth:
|
|
10175
|
-
maxHeight:
|
|
10174
|
+
maxWidth: 800,
|
|
10175
|
+
maxHeight: 800,
|
|
10176
10176
|
success(result) {
|
|
10177
10177
|
console.log("\u538B\u7F29\u540E\u7684\u56FE\u7247", result);
|
|
10178
10178
|
let compress_file = blob2file(result, result.name);
|
|
@@ -17068,6 +17068,10 @@ const _sfc_main$o = {
|
|
|
17068
17068
|
type: Boolean,
|
|
17069
17069
|
default: false
|
|
17070
17070
|
},
|
|
17071
|
+
disabled: {
|
|
17072
|
+
type: Boolean,
|
|
17073
|
+
default: false
|
|
17074
|
+
},
|
|
17071
17075
|
defaultnow: {
|
|
17072
17076
|
type: Boolean,
|
|
17073
17077
|
default: false
|
|
@@ -17121,6 +17125,11 @@ const _sfc_main$o = {
|
|
|
17121
17125
|
modelValue.value = "";
|
|
17122
17126
|
}
|
|
17123
17127
|
});
|
|
17128
|
+
const rightIcon = computed(() => {
|
|
17129
|
+
if (isReadonly.value || isDisabled.value)
|
|
17130
|
+
return "";
|
|
17131
|
+
return "arrow";
|
|
17132
|
+
});
|
|
17124
17133
|
watch(() => props.modelValue, (n, o) => {
|
|
17125
17134
|
if (!props.defaultnow)
|
|
17126
17135
|
return;
|
|
@@ -17150,9 +17159,9 @@ const _sfc_main$o = {
|
|
|
17150
17159
|
placeholder: props.placeholder,
|
|
17151
17160
|
required: unref(isRequired),
|
|
17152
17161
|
rules: props.rules,
|
|
17153
|
-
"right-icon":
|
|
17162
|
+
"right-icon": unref(rightIcon),
|
|
17154
17163
|
onClickRightIcon: onToggleShow
|
|
17155
|
-
}, null, 8, ["modelValue", "label", "disabled", "readonly", "placeholder", "required", "rules"])) : createCommentVNode("", true), createVNode(_sfc_main$p, {
|
|
17164
|
+
}, null, 8, ["modelValue", "label", "disabled", "readonly", "placeholder", "required", "rules", "right-icon"])) : createCommentVNode("", true), createVNode(_sfc_main$p, {
|
|
17156
17165
|
isShow: data2.isShow,
|
|
17157
17166
|
"onUpdate:isShow": _cache[1] || (_cache[1] = ($event) => data2.isShow = $event),
|
|
17158
17167
|
modelValue: unref(modelValue),
|
|
@@ -18439,7 +18448,7 @@ const _sfc_main$k = {
|
|
|
18439
18448
|
}
|
|
18440
18449
|
};
|
|
18441
18450
|
var UserSelector = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-6c4b4fc8"]]);
|
|
18442
|
-
var image_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-
|
|
18451
|
+
var image_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-0c9127e8] .label {\n color: #000 !important;\n}\n[data-v-0c9127e8] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
|
|
18443
18452
|
const _hoisted_1$c = {
|
|
18444
18453
|
class: "image-box"
|
|
18445
18454
|
};
|
|
@@ -18516,6 +18525,10 @@ const _sfc_main$j = {
|
|
|
18516
18525
|
modelValue.value = "";
|
|
18517
18526
|
return Promise.resolve(e);
|
|
18518
18527
|
};
|
|
18528
|
+
const onPreview = (e) => {
|
|
18529
|
+
console.log("onPreview", e);
|
|
18530
|
+
window.open(e.url, "_blank");
|
|
18531
|
+
};
|
|
18519
18532
|
watch(() => props.modelValue, (newVal, oldVal) => {
|
|
18520
18533
|
if (!props.modelValue) {
|
|
18521
18534
|
files.value = [];
|
|
@@ -18549,7 +18562,8 @@ const _sfc_main$j = {
|
|
|
18549
18562
|
afterRead: onAfterRead,
|
|
18550
18563
|
disabled: unref(isDisabled),
|
|
18551
18564
|
deletable: !unref(isDisabled),
|
|
18552
|
-
"before-delete": onBeforeDelete
|
|
18565
|
+
"before-delete": onBeforeDelete,
|
|
18566
|
+
onClickPreview: onPreview
|
|
18553
18567
|
}, null, 8, ["modelValue", "capture", "disabled", "deletable"])) : (openBlock(), createBlock(_component_van_uploader, {
|
|
18554
18568
|
key: 1,
|
|
18555
18569
|
modelValue: files.value,
|
|
@@ -18559,15 +18573,16 @@ const _sfc_main$j = {
|
|
|
18559
18573
|
afterRead: onAfterRead,
|
|
18560
18574
|
disabled: unref(isDisabled),
|
|
18561
18575
|
deletable: !unref(isDisabled),
|
|
18562
|
-
"before-delete": onBeforeDelete
|
|
18576
|
+
"before-delete": onBeforeDelete,
|
|
18577
|
+
onClickPreview: onPreview
|
|
18563
18578
|
}, null, 8, ["modelValue", "disabled", "deletable"]))])]),
|
|
18564
18579
|
_: 1
|
|
18565
18580
|
}, 8, ["label", "required", "rules", "placeholder"])) : createCommentVNode("", true);
|
|
18566
18581
|
};
|
|
18567
18582
|
}
|
|
18568
18583
|
};
|
|
18569
|
-
var ImagePicker = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-
|
|
18570
|
-
var images_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-
|
|
18584
|
+
var ImagePicker = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-0c9127e8"]]);
|
|
18585
|
+
var images_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-8a570fc4] {\n text-align: center;\n}\n.widget .btn[data-v-8a570fc4] {\n position: fixed;\n bottom: 1rem;\n left: 0;\n right: 0;\n margin: auto auto;\n color: white;\n font-size: 14px;\n background: rgb(58, 136, 255);\n padding: 8px 35px;\n width: 100px;\n text-align: center;\n display: inline-block;\n border-radius: 2px;\n}")();
|
|
18571
18586
|
const _hoisted_1$b = {
|
|
18572
18587
|
class: "image-box"
|
|
18573
18588
|
};
|
|
@@ -18656,6 +18671,10 @@ const _sfc_main$i = {
|
|
|
18656
18671
|
emit("update:modelValue", newUrls);
|
|
18657
18672
|
return Promise.resolve(e);
|
|
18658
18673
|
};
|
|
18674
|
+
const onPreview = (e) => {
|
|
18675
|
+
console.log("onPreview", e);
|
|
18676
|
+
window.open(e.url, "_blank");
|
|
18677
|
+
};
|
|
18659
18678
|
watch(() => props.modelValue, (newVal, oldVal) => {
|
|
18660
18679
|
if (!props.modelValue || props.modelValue.length < 1) {
|
|
18661
18680
|
files.value = [];
|
|
@@ -18691,7 +18710,8 @@ const _sfc_main$i = {
|
|
|
18691
18710
|
disabled: unref(isDisabled),
|
|
18692
18711
|
deletable: !unref(isDisabled),
|
|
18693
18712
|
afterRead: onAfterRead,
|
|
18694
|
-
"before-delete": onBeforeDelete
|
|
18713
|
+
"before-delete": onBeforeDelete,
|
|
18714
|
+
onClickPreview: onPreview
|
|
18695
18715
|
}, null, 8, ["modelValue", "max-count", "capture", "disabled", "deletable"])) : (openBlock(), createBlock(_component_van_uploader, {
|
|
18696
18716
|
key: 1,
|
|
18697
18717
|
modelValue: files.value,
|
|
@@ -18701,14 +18721,15 @@ const _sfc_main$i = {
|
|
|
18701
18721
|
disabled: unref(isDisabled),
|
|
18702
18722
|
deletable: !unref(isDisabled),
|
|
18703
18723
|
afterRead: onAfterRead,
|
|
18704
|
-
"before-delete": onBeforeDelete
|
|
18724
|
+
"before-delete": onBeforeDelete,
|
|
18725
|
+
onClickPreview: onPreview
|
|
18705
18726
|
}, null, 8, ["modelValue", "max-count", "disabled", "deletable"]))])]),
|
|
18706
18727
|
_: 1
|
|
18707
18728
|
}, 8, ["label", "required", "rules", "placeholder"]);
|
|
18708
18729
|
};
|
|
18709
18730
|
}
|
|
18710
18731
|
};
|
|
18711
|
-
var ImagesPicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-
|
|
18732
|
+
var ImagesPicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-8a570fc4"]]);
|
|
18712
18733
|
var FilePicker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-a0846250] .label {\n color: #000 !important;\n}\n[data-v-a0846250] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
|
|
18713
18734
|
const _hoisted_1$a = {
|
|
18714
18735
|
class: "image-box"
|
package/build/widget.qw.umd.js
CHANGED
|
@@ -10174,8 +10174,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
10174
10174
|
return new Promise((resolve, reject) => {
|
|
10175
10175
|
new Compressor(file, {
|
|
10176
10176
|
quality: 0.7,
|
|
10177
|
-
maxWidth:
|
|
10178
|
-
maxHeight:
|
|
10177
|
+
maxWidth: 800,
|
|
10178
|
+
maxHeight: 800,
|
|
10179
10179
|
success(result) {
|
|
10180
10180
|
console.log("\u538B\u7F29\u540E\u7684\u56FE\u7247", result);
|
|
10181
10181
|
let compress_file = blob2file(result, result.name);
|
|
@@ -17071,6 +17071,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17071
17071
|
type: Boolean,
|
|
17072
17072
|
default: false
|
|
17073
17073
|
},
|
|
17074
|
+
disabled: {
|
|
17075
|
+
type: Boolean,
|
|
17076
|
+
default: false
|
|
17077
|
+
},
|
|
17074
17078
|
defaultnow: {
|
|
17075
17079
|
type: Boolean,
|
|
17076
17080
|
default: false
|
|
@@ -17124,6 +17128,11 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17124
17128
|
modelValue.value = "";
|
|
17125
17129
|
}
|
|
17126
17130
|
});
|
|
17131
|
+
const rightIcon = vue.computed(() => {
|
|
17132
|
+
if (isReadonly.value || isDisabled.value)
|
|
17133
|
+
return "";
|
|
17134
|
+
return "arrow";
|
|
17135
|
+
});
|
|
17127
17136
|
vue.watch(() => props.modelValue, (n, o) => {
|
|
17128
17137
|
if (!props.defaultnow)
|
|
17129
17138
|
return;
|
|
@@ -17153,9 +17162,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
17153
17162
|
placeholder: props.placeholder,
|
|
17154
17163
|
required: vue.unref(isRequired),
|
|
17155
17164
|
rules: props.rules,
|
|
17156
|
-
"right-icon":
|
|
17165
|
+
"right-icon": vue.unref(rightIcon),
|
|
17157
17166
|
onClickRightIcon: onToggleShow
|
|
17158
|
-
}, null, 8, ["modelValue", "label", "disabled", "readonly", "placeholder", "required", "rules"])) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$p, {
|
|
17167
|
+
}, null, 8, ["modelValue", "label", "disabled", "readonly", "placeholder", "required", "rules", "right-icon"])) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$p, {
|
|
17159
17168
|
isShow: data2.isShow,
|
|
17160
17169
|
"onUpdate:isShow": _cache[1] || (_cache[1] = ($event) => data2.isShow = $event),
|
|
17161
17170
|
modelValue: vue.unref(modelValue),
|
|
@@ -18442,7 +18451,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18442
18451
|
}
|
|
18443
18452
|
};
|
|
18444
18453
|
var UserSelector = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-6c4b4fc8"]]);
|
|
18445
|
-
var image_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-
|
|
18454
|
+
var image_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-0c9127e8] .label {\n color: #000 !important;\n}\n[data-v-0c9127e8] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
|
|
18446
18455
|
const _hoisted_1$c = {
|
|
18447
18456
|
class: "image-box"
|
|
18448
18457
|
};
|
|
@@ -18519,6 +18528,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18519
18528
|
modelValue.value = "";
|
|
18520
18529
|
return Promise.resolve(e);
|
|
18521
18530
|
};
|
|
18531
|
+
const onPreview = (e) => {
|
|
18532
|
+
console.log("onPreview", e);
|
|
18533
|
+
window.open(e.url, "_blank");
|
|
18534
|
+
};
|
|
18522
18535
|
vue.watch(() => props.modelValue, (newVal, oldVal) => {
|
|
18523
18536
|
if (!props.modelValue) {
|
|
18524
18537
|
files.value = [];
|
|
@@ -18552,7 +18565,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18552
18565
|
afterRead: onAfterRead,
|
|
18553
18566
|
disabled: vue.unref(isDisabled),
|
|
18554
18567
|
deletable: !vue.unref(isDisabled),
|
|
18555
|
-
"before-delete": onBeforeDelete
|
|
18568
|
+
"before-delete": onBeforeDelete,
|
|
18569
|
+
onClickPreview: onPreview
|
|
18556
18570
|
}, null, 8, ["modelValue", "capture", "disabled", "deletable"])) : (vue.openBlock(), vue.createBlock(_component_van_uploader, {
|
|
18557
18571
|
key: 1,
|
|
18558
18572
|
modelValue: files.value,
|
|
@@ -18562,15 +18576,16 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18562
18576
|
afterRead: onAfterRead,
|
|
18563
18577
|
disabled: vue.unref(isDisabled),
|
|
18564
18578
|
deletable: !vue.unref(isDisabled),
|
|
18565
|
-
"before-delete": onBeforeDelete
|
|
18579
|
+
"before-delete": onBeforeDelete,
|
|
18580
|
+
onClickPreview: onPreview
|
|
18566
18581
|
}, null, 8, ["modelValue", "disabled", "deletable"]))])]),
|
|
18567
18582
|
_: 1
|
|
18568
18583
|
}, 8, ["label", "required", "rules", "placeholder"])) : vue.createCommentVNode("", true);
|
|
18569
18584
|
};
|
|
18570
18585
|
}
|
|
18571
18586
|
};
|
|
18572
|
-
var ImagePicker = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-
|
|
18573
|
-
var images_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-
|
|
18587
|
+
var ImagePicker = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-0c9127e8"]]);
|
|
18588
|
+
var images_picker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".widget[data-v-8a570fc4] {\n text-align: center;\n}\n.widget .btn[data-v-8a570fc4] {\n position: fixed;\n bottom: 1rem;\n left: 0;\n right: 0;\n margin: auto auto;\n color: white;\n font-size: 14px;\n background: rgb(58, 136, 255);\n padding: 8px 35px;\n width: 100px;\n text-align: center;\n display: inline-block;\n border-radius: 2px;\n}")();
|
|
18574
18589
|
const _hoisted_1$b = {
|
|
18575
18590
|
class: "image-box"
|
|
18576
18591
|
};
|
|
@@ -18659,6 +18674,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18659
18674
|
emit("update:modelValue", newUrls);
|
|
18660
18675
|
return Promise.resolve(e);
|
|
18661
18676
|
};
|
|
18677
|
+
const onPreview = (e) => {
|
|
18678
|
+
console.log("onPreview", e);
|
|
18679
|
+
window.open(e.url, "_blank");
|
|
18680
|
+
};
|
|
18662
18681
|
vue.watch(() => props.modelValue, (newVal, oldVal) => {
|
|
18663
18682
|
if (!props.modelValue || props.modelValue.length < 1) {
|
|
18664
18683
|
files.value = [];
|
|
@@ -18694,7 +18713,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18694
18713
|
disabled: vue.unref(isDisabled),
|
|
18695
18714
|
deletable: !vue.unref(isDisabled),
|
|
18696
18715
|
afterRead: onAfterRead,
|
|
18697
|
-
"before-delete": onBeforeDelete
|
|
18716
|
+
"before-delete": onBeforeDelete,
|
|
18717
|
+
onClickPreview: onPreview
|
|
18698
18718
|
}, null, 8, ["modelValue", "max-count", "capture", "disabled", "deletable"])) : (vue.openBlock(), vue.createBlock(_component_van_uploader, {
|
|
18699
18719
|
key: 1,
|
|
18700
18720
|
modelValue: files.value,
|
|
@@ -18704,14 +18724,15 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18704
18724
|
disabled: vue.unref(isDisabled),
|
|
18705
18725
|
deletable: !vue.unref(isDisabled),
|
|
18706
18726
|
afterRead: onAfterRead,
|
|
18707
|
-
"before-delete": onBeforeDelete
|
|
18727
|
+
"before-delete": onBeforeDelete,
|
|
18728
|
+
onClickPreview: onPreview
|
|
18708
18729
|
}, null, 8, ["modelValue", "max-count", "disabled", "deletable"]))])]),
|
|
18709
18730
|
_: 1
|
|
18710
18731
|
}, 8, ["label", "required", "rules", "placeholder"]);
|
|
18711
18732
|
};
|
|
18712
18733
|
}
|
|
18713
18734
|
};
|
|
18714
|
-
var ImagesPicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-
|
|
18735
|
+
var ImagesPicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-8a570fc4"]]);
|
|
18715
18736
|
var FilePicker_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "[data-v-a0846250] .label {\n color: #000 !important;\n}\n[data-v-a0846250] .van-field__control:disabled {\n color: #000 !important;\n cursor: not-allowed;\n opacity: 1;\n -webkit-text-fill-color: #000;\n}")();
|
|
18716
18737
|
const _hoisted_1$a = {
|
|
18717
18738
|
class: "image-box"
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
readonly
|
|
6
6
|
clearable
|
|
7
7
|
:placeholder="props.placeholder" :required="isRequired" :rules="props.rules"
|
|
8
|
-
right-icon="
|
|
8
|
+
:right-icon="rightIcon"
|
|
9
9
|
@click-right-icon="onToggleShow">
|
|
10
10
|
</van-field>
|
|
11
11
|
|
|
@@ -33,6 +33,10 @@ const props = defineProps({
|
|
|
33
33
|
type: Boolean,
|
|
34
34
|
default: false
|
|
35
35
|
},
|
|
36
|
+
disabled:{
|
|
37
|
+
type:Boolean,
|
|
38
|
+
default:false
|
|
39
|
+
},
|
|
36
40
|
defaultnow: {
|
|
37
41
|
type: Boolean,
|
|
38
42
|
default: false
|
|
@@ -84,6 +88,13 @@ const formatTime = computed({
|
|
|
84
88
|
}
|
|
85
89
|
})
|
|
86
90
|
|
|
91
|
+
const rightIcon = computed(()=>{
|
|
92
|
+
if(isReadonly.value || isDisabled.value)
|
|
93
|
+
return ''
|
|
94
|
+
|
|
95
|
+
return 'arrow'
|
|
96
|
+
})
|
|
97
|
+
|
|
87
98
|
// 默认当前时间
|
|
88
99
|
watch(
|
|
89
100
|
() => props.modelValue,
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
<div class="image-box">
|
|
6
6
|
<van-uploader v-if="props.capture" v-model="files" :max-count="1" :capture="props.capture"
|
|
7
7
|
accept="image/jpeg,image/png" :afterRead="onAfterRead" :disabled="isDisabled"
|
|
8
|
-
:deletable="!isDisabled" :before-delete="onBeforeDelete"
|
|
8
|
+
:deletable="!isDisabled" :before-delete="onBeforeDelete"
|
|
9
|
+
@click-preview="onPreview" />
|
|
9
10
|
<van-uploader v-else v-model="files" :max-count="1" accept="image/jpeg,image/png"
|
|
10
11
|
:afterRead="onAfterRead" :disabled="isDisabled" :deletable="!isDisabled"
|
|
11
|
-
:before-delete="onBeforeDelete"
|
|
12
|
+
:before-delete="onBeforeDelete"
|
|
13
|
+
@click-preview="onPreview" />
|
|
12
14
|
</div>
|
|
13
15
|
</template>
|
|
14
16
|
</van-field>
|
|
@@ -91,6 +93,11 @@ const onBeforeDelete = (e) => {
|
|
|
91
93
|
return Promise.resolve(e)
|
|
92
94
|
}
|
|
93
95
|
|
|
96
|
+
const onPreview = (e) => {
|
|
97
|
+
console.log('onPreview', e)
|
|
98
|
+
window.open(e.url, "_blank");
|
|
99
|
+
}
|
|
100
|
+
|
|
94
101
|
watch(() => props.modelValue,
|
|
95
102
|
(newVal, oldVal) => {
|
|
96
103
|
if (!props.modelValue) {
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
<div class="image-box">
|
|
6
6
|
<van-uploader v-if="props.capture" v-model="files" :max-count="props.max" :capture="props.capture"
|
|
7
7
|
accept="image/jpeg,image/png" :disabled="isDisabled" :deletable="!isDisabled"
|
|
8
|
-
:afterRead="onAfterRead" :before-delete="onBeforeDelete"
|
|
8
|
+
:afterRead="onAfterRead" :before-delete="onBeforeDelete"
|
|
9
|
+
@click-preview="onPreview" />
|
|
9
10
|
<van-uploader v-else v-model="files" :max-count="props.max" accept="image/jpeg,image/png"
|
|
10
11
|
:disabled="isDisabled" :deletable="!isDisabled" :afterRead="onAfterRead"
|
|
11
|
-
:before-delete="onBeforeDelete"
|
|
12
|
+
:before-delete="onBeforeDelete"
|
|
13
|
+
@click-preview="onPreview" />
|
|
12
14
|
</div>
|
|
13
15
|
</template>
|
|
14
16
|
</van-field>
|
|
@@ -102,6 +104,11 @@ const onBeforeDelete = (e) => {
|
|
|
102
104
|
return Promise.resolve(e)
|
|
103
105
|
}
|
|
104
106
|
|
|
107
|
+
const onPreview = (e) => {
|
|
108
|
+
console.log('onPreview', e)
|
|
109
|
+
window.open(e.url, "_blank");
|
|
110
|
+
}
|
|
111
|
+
|
|
105
112
|
watch(() => props.modelValue,
|
|
106
113
|
(newVal, oldVal) => {
|
|
107
114
|
if (!props.modelValue || props.modelValue.length < 1) {
|
package/src/util/image_util.js
CHANGED
|
@@ -5,8 +5,8 @@ export const compress_image = async (file) => {
|
|
|
5
5
|
return new Promise((resolve, reject) => {
|
|
6
6
|
new Compressor(file, {
|
|
7
7
|
quality: 0.7,
|
|
8
|
-
maxWidth:
|
|
9
|
-
maxHeight:
|
|
8
|
+
maxWidth: 800,
|
|
9
|
+
maxHeight: 800,
|
|
10
10
|
success(result) {
|
|
11
11
|
console.log('压缩后的图片', result);
|
|
12
12
|
let compress_file = blob2file(result, result.name)
|