BUG 140
This commit is contained in:
@@ -40,6 +40,10 @@ import AiImage from '../AiImage/AiImage'
|
|||||||
export default {
|
export default {
|
||||||
name: 'AiUploader',
|
name: 'AiUploader',
|
||||||
components: {AiImage},
|
components: {AiImage},
|
||||||
|
model:{
|
||||||
|
prop: 'def',
|
||||||
|
event: 'input'
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
limit: {default: 1}, //数量
|
limit: {default: 1}, //数量
|
||||||
placeholder: {default: '添加图片'}, // 文字提示
|
placeholder: {default: '添加图片'}, // 文字提示
|
||||||
@@ -86,7 +90,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
remove(index) {
|
remove(index) {
|
||||||
this.fileList.splice(index, 1)
|
this.fileList.splice(index, 1)
|
||||||
this.$emit('list', this.fileList)
|
this.$emit('input', this.fileList)
|
||||||
},
|
},
|
||||||
upload(wait) {
|
upload(wait) {
|
||||||
let count = this.limit - (this.fileList?.length || 0)
|
let count = this.limit - (this.fileList?.length || 0)
|
||||||
@@ -145,8 +149,6 @@ export default {
|
|||||||
this.$u.toast('上传成功!')
|
this.$u.toast('上传成功!')
|
||||||
if (this.action.endsWith('/file/add')) {
|
if (this.action.endsWith('/file/add')) {
|
||||||
this.fileList.push({url: res.data?.[0]?.split(";")?.[0], id: res.data?.[0]?.split(";")?.[1]})
|
this.fileList.push({url: res.data?.[0]?.split(";")?.[0], id: res.data?.[0]?.split(";")?.[1]})
|
||||||
this.$emit('input', [...this.fileList])
|
|
||||||
this.$emit('change', [...this.fileList])
|
|
||||||
} else if (this.action == '/admin/file/add2') {
|
} else if (this.action == '/admin/file/add2') {
|
||||||
let info = res.data
|
let info = res.data
|
||||||
this.$emit('update:fileId', info?.id)
|
this.$emit('update:fileId', info?.id)
|
||||||
@@ -155,7 +157,7 @@ export default {
|
|||||||
this.fileList.push({url: res.data?.split(";")?.[0], id: res.data?.split(";")?.[1]})
|
this.fileList.push({url: res.data?.split(";")?.[0], id: res.data?.split(";")?.[1]})
|
||||||
}
|
}
|
||||||
this.$emit("update:def", this.fileList)
|
this.$emit("update:def", this.fileList)
|
||||||
this.$emit("list", this.fileList)
|
this.$emit("input", this.fileList)
|
||||||
} else {
|
} else {
|
||||||
this.$u.toast(res.msg)
|
this.$u.toast(res.msg)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<i :style="{opacity: item.mustFill === '1' ? 1 : 0}">*</i>
|
<i :style="{opacity: item.mustFill === '1' ? 1 : 0}">*</i>
|
||||||
<h2>请上传{{ item.annexName }}</h2>
|
<h2>请上传{{ item.annexName }}</h2>
|
||||||
</div>
|
</div>
|
||||||
<AiUploader :def="[{url:item.src}]" preview @list="imgs=>handleImage(item,imgs)" :limit="1"/>
|
<AiUploader :def="[{url:item.src}]" preview @input="imgs=>handleImage(item,imgs)" :limit="1"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="service-example" v-if="exampleList.length">
|
<div class="service-example" v-if="exampleList.length">
|
||||||
|
|||||||
@@ -9,7 +9,9 @@
|
|||||||
<AiItem label="所属网格" :value="info.girdName"/>
|
<AiItem label="所属网格" :value="info.girdName"/>
|
||||||
<AiItem label="上报时间" :value="info.createTime"/>
|
<AiItem label="上报时间" :value="info.createTime"/>
|
||||||
<AiItem label="照片" top-label>
|
<AiItem label="照片" top-label>
|
||||||
<image v-for="(item, index) in info.files" @click="preview(item.url)" :key="index" :src="item.url"/>
|
<div class="flex wrap">
|
||||||
|
<image class="fill imageItem" v-for="(item, index) in info.files" @click="preview(item.url)" :key="index" :src="item.url"/>
|
||||||
|
</div>
|
||||||
<span v-if="!info.files.length">暂无照片</span>
|
<span v-if="!info.files.length">暂无照片</span>
|
||||||
</AiItem>
|
</AiItem>
|
||||||
</AiGroup>
|
</AiGroup>
|
||||||
@@ -17,7 +19,9 @@
|
|||||||
<AiGroup title="处理详情" v-if="info.eventStatus > 1" description noBorder labelColor="#999">
|
<AiGroup title="处理详情" v-if="info.eventStatus > 1" description noBorder labelColor="#999">
|
||||||
<AiItem label="处理结果" top-label :value="result.doExplain"/>
|
<AiItem label="处理结果" top-label :value="result.doExplain"/>
|
||||||
<AiItem label="照片" top-label>
|
<AiItem label="照片" top-label>
|
||||||
<image v-for="(item, index) in result.files" @click="preview(item.url)" :key="index" :src="item.url"/>
|
<div class="flex wrap">
|
||||||
|
<image class="fill imageItem" v-for="(item, index) in result.files" @click="preview(item.url)" :key="index" :src="item.url"/>
|
||||||
|
</div>
|
||||||
<span v-if="!result.files.length">暂无照片</span>
|
<span v-if="!result.files.length">暂无照片</span>
|
||||||
</AiItem>
|
</AiItem>
|
||||||
</AiGroup>
|
</AiGroup>
|
||||||
@@ -163,5 +167,17 @@ export default {
|
|||||||
background: #FF4466;
|
background: #FF4466;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.imageItem {
|
||||||
|
min-width: 30%;
|
||||||
|
height: 30vw;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-right: 16px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
|
||||||
|
&:nth-of-type(3n) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user