mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-20 00:06:47 +08:00
t
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<div class="options">
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<div class="inname">选项{{ item.id }}</div>
|
||||
<div class="inname">选项{{ curItem.id }}</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
<a-input
|
||||
@@ -12,7 +12,6 @@
|
||||
show-count
|
||||
:maxlength="30"
|
||||
style="border-radius: 8px"
|
||||
@change="handleInput"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -20,15 +19,15 @@
|
||||
</div>
|
||||
<div class="name uploadContent">
|
||||
<a-upload
|
||||
v-show="!item.imgVal"
|
||||
v-show="!curItem.imgVal"
|
||||
class="in uploadBtn"
|
||||
:show-upload-list="false"
|
||||
:before-upload="beforeUpload"
|
||||
>
|
||||
<div class="addimg">+添加图片</div>
|
||||
</a-upload>
|
||||
<div v-show="item.imgVal" class="picture" style="position: relative">
|
||||
<img class="pictureimg" :src="item.imgVal" />
|
||||
<div v-show="curItem.imgVal" class="picture" style="position: relative">
|
||||
<img class="pictureimg" :src="curItem.imgVal" />
|
||||
<div class="picturename" v-show="hasImgName">{{ hasImgName }}</div>
|
||||
<img
|
||||
style="
|
||||
@@ -67,17 +66,18 @@ export default {
|
||||
hasImgName: "",
|
||||
});
|
||||
|
||||
const handleInput = () => {
|
||||
emit("input", { id: curItem.value.id, val: curItem.value.inputVal });
|
||||
};
|
||||
const handleDel = () => {
|
||||
handleCancel();
|
||||
emit("del", { id: curItem.value.id, optionId: curItem.value.optionId });
|
||||
};
|
||||
const handleCancel = () => {
|
||||
state.hasImgName = "";
|
||||
emit("delImg", { id: curItem.value.id });
|
||||
};
|
||||
const handleDel = () => {
|
||||
handleCancel();
|
||||
emit("del", {
|
||||
id: curItem.value.id,
|
||||
optionId: curItem.value.optionId,
|
||||
});
|
||||
};
|
||||
|
||||
const beforeUpload = (file) => {
|
||||
const isJpgOrPng =
|
||||
file.type === "image/jpg" ||
|
||||
@@ -99,7 +99,6 @@ export default {
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
console.log(file);
|
||||
fileUp(formData).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
state.hasImgName = file.name;
|
||||
@@ -112,7 +111,6 @@ export default {
|
||||
return {
|
||||
...toRefs(state),
|
||||
curItem,
|
||||
handleInput,
|
||||
handleDel,
|
||||
handleCancel,
|
||||
beforeUpload,
|
||||
|
||||
Reference in New Issue
Block a user