This commit is contained in:
xielue 2023-10-24 11:09:20 +08:00
parent 77869921c0
commit 263b7cc9bf
1 changed files with 45 additions and 7 deletions

View File

@ -7,8 +7,21 @@
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, beforeEditMethod: beforeEditMethod }">
<vxe-column title="图片" width="110" align="center">
<template #default="{ row }">
<img v-if="row.component_img" style="width:50px;height:50px;" :src="row.component_img"
<div v-if="row.component_img" style="position: relative;" class="imgbox">
<img style="width:50px;height:50px;" :src="row.component_img"
@click.stop="$hevueImgPreview(row.component_img)" />
<div class="imgicons" style="position:absolute;right:0px;top:0px;">
<div>
<a @click="imgDel({ row })"> <a-icon type="close-circle" /></a>
</div>
<div>
<a-upload name="file" accept="image/*" :before-upload="beforeUpload" :show-upload-list="false">
<a @click="uploadClick({ row })"> <a-icon type="edit" /></a>
</a-upload>
</div>
</div>
</div>
<span v-else>
<a-upload name="file" accept="image/*" :before-upload="beforeUpload" :show-upload-list="false">
<a-button type="link" @click="uploadClick({ row })">上传图片</a-button>
@ -59,11 +72,15 @@
:params="{ data: options_user_type }" formatter='formatEnum'></vxe-column> -->
<vxe-column field="spec" title="规格" align="center" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
<vxe-column field="surface" title="表面工艺" align="center" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
<vxe-column field="inlay" title="镶件材料" align="center" width="160" :edit-render="{ name: '$input', props: {} }"></vxe-column>
<vxe-column field="spec" title="规格" align="center" width="160"
:edit-render="{ name: '$input', props: {} }"></vxe-column>
<vxe-column field="surface" title="表面工艺" align="center" width="160"
:edit-render="{ name: '$input', props: {} }"></vxe-column>
<vxe-column field="inlay" title="镶件材料" align="center" width="160"
:edit-render="{ name: '$input', props: {} }"></vxe-column>
<vxe-column field="remark" title="备注" align="center" width="auto" :edit-render="{ name: '$input', props: {} }"></vxe-column>
<vxe-column field="remark" title="备注" align="center" width="auto"
:edit-render="{ name: '$input', props: {} }"></vxe-column>
@ -697,6 +714,18 @@ export default {
return false
},
imgDel({ row }) {
row.component_img = "";
this.$mk.post({
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/upload`,
data: { id: row.id, image: "" },
useBigInt: true
}).then(a => {
console.log(a);
});
},
uploadClick({ row }) {
@ -751,4 +780,13 @@ export default {
.oplinks2 i {
margin-left: 5px;
}
.imgicons {
display: none;
;
}
.imgbox:hover .imgicons {
display: block;
}
</style>