Commit 83c3a523 by hank

fix bug

parent 91e678b4
...@@ -46,37 +46,39 @@ ...@@ -46,37 +46,39 @@
<div class="btn-con"> <div class="btn-con">
<span class="index">序号{{index2}}</span> <span class="index">序号{{index2}}</span>
</div> </div>
<div class="list-item-list" v-for="(item3, index3) in item2" :key="index3"> <div class="list-item-list">
<div v-if="(index3 != 'schemaIndex' && index3 != 'index')"> <div class="list-item-list-item" v-for="(item3, index3) in item2" :key="index3">
<input <div v-if="(index3 != 'schemaIndex' && index3 != 'index')">
v-if="item.modelSchema[isSchemaIndex(item2)][index3].type === 'text'" <input
:placeholder="item.modelSchema[isSchemaIndex(item2)][index3].description" v-if="item.modelSchema[isSchemaIndex(item2)][index3].type === 'text'"
class="edit-input edit-input-list-item" :placeholder="item.modelSchema[isSchemaIndex(item2)][index3].description"
type="text" class="edit-input edit-input-list-item"
@blur="onBlur" type="text"
v-model="item2[index3]" @blur="onBlur"
@keyup="valueChange2()" v-model="item2[index3]"
/> @keyup="valueChange2()"
<div> />
<van-uploader <div>
result-type="dataUrl" <van-uploader
v-if="item.modelSchema[isSchemaIndex(item2)][index3].type == 'image' || item.modelSchema[isSchemaIndex(item2)][index3].type == 'video'" result-type="dataUrl"
:accept="item.modelSchema[isSchemaIndex(item2)][index3].type == 'image' ? 'image/*' : 'video/*'" v-if="item.modelSchema[isSchemaIndex(item2)][index3].type == 'image' || item.modelSchema[isSchemaIndex(item2)][index3].type == 'video'"
@click.native="uploadListItem(item.dataKey,index2, index3)" :accept="item.modelSchema[isSchemaIndex(item2)][index3].type == 'image' ? 'image/*' : 'video/*'"
:after-read="uploadAfter" @click.native="uploadListItem(item.dataKey,index2, index3)"
> :after-read="uploadAfter"
<!-- <van-button type="info">上传</van-button> --> >
<img <!-- <van-button type="info">上传</van-button> -->
v-if="item.modelSchema[isSchemaIndex(item2)][index3].type === 'image'" <img
:src="getHostUrl(item2[index3])" v-if="item.modelSchema[isSchemaIndex(item2)][index3].type === 'image'"
class="edit-input edit-input-image" :src="getHostUrl(item2[index3])"
/> class="edit-input edit-input-image"
<video />
class="edit-input-video" <video
:src="getHostUrl(item2[index3])" class="edit-input-video"
v-if="item.modelSchema[isSchemaIndex(item2)][index3].type === 'video'" :src="getHostUrl(item2[index3])"
></video> v-if="item.modelSchema[isSchemaIndex(item2)][index3].type === 'video'"
</van-uploader> ></video>
</van-uploader>
</div>
</div> </div>
</div> </div>
<div class="list-item-delete"> <div class="list-item-delete">
...@@ -163,7 +165,7 @@ export default { ...@@ -163,7 +165,7 @@ export default {
components: { components: {
selectDataCom, selectDataCom,
VueCropper VueCropper
}, },
created() { created() {
console.log(this.schemaData); console.log(this.schemaData);
}, },
...@@ -252,7 +254,7 @@ export default { ...@@ -252,7 +254,7 @@ export default {
uploadAfter(file) { uploadAfter(file) {
// console.log(file); // console.log(file);
if (String(file.file.type).indexOf("image") !== -1) { if (String(file.file.type).indexOf("image") !== -1) {
this.$emit("setClipImg", true) this.$emit("setClipImg", true);
this.VueCropperOption.img = file.content; this.VueCropperOption.img = file.content;
} else { } else {
this.uploadFile(file.file); this.uploadFile(file.file);
...@@ -275,7 +277,7 @@ export default { ...@@ -275,7 +277,7 @@ export default {
this.$emit("setList", this.schemaData); this.$emit("setList", this.schemaData);
}, },
saveCropper() { saveCropper() {
this.$emit("setClipImg", false) this.$emit("setClipImg", false);
this.VueCropperOption.img = ""; this.VueCropperOption.img = "";
this.$refs.cropper.getCropBlob(data => { this.$refs.cropper.getCropBlob(data => {
console.log(data); console.log(data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment