From 96915c592b7cac1ff6a7ee1312c1083bd0c3d256 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期四, 18 七月 2024 17:42:45 +0800
Subject: [PATCH] 测试完成
---
src/components/Regular/index.vue | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/src/components/Regular/index.vue b/src/components/Regular/index.vue
index e71b7be..091e957 100644
--- a/src/components/Regular/index.vue
+++ b/src/components/Regular/index.vue
@@ -150,6 +150,27 @@
>
</div>
</el-form-item>
+ <el-form-item label="閫夐」鏂囦欢" prop="sickness">
+ <div style="width: 40vw">
+ <el-upload
+ class="upload-demo"
+ :action="uploadImgUrl"
+ :headers="headers"
+ :accept="'image/*,video/*'"
+ :on-success="handleChange.bind(this, item)"
+ >
+ <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
+ </el-upload>
+ <div style="margin: 20px">
+ <el-image
+ style="width: 100px; height: 100px"
+ :src="item.picturePath"
+ :preview-src-list="[...item.picturePath]"
+ >
+ </el-image>
+ </div>
+ </div>
+ </el-form-item>
<el-row :gutter="10">
<el-col :span="16" v-if="intent">
@@ -205,6 +226,7 @@
<script>
import store from "@/store";
+import { getToken } from "@/utils/auth";
export default {
data() {
@@ -217,6 +239,10 @@
url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
},
],
+ headers: {
+ Authorization: "Bearer " + getToken(),
+ },
+ uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/uploadSort",
whether: 1, //1涓哄叧閿瘝锛�2涓哄惁瀹氬叧閿瘝
inputValue: "",
inputVisible: false,
@@ -364,6 +390,13 @@
console.log(this.TargetoptionList);
this.$emit("handleSelectionChange", selection);
},
+ // 閫夐」鏂囦欢涓婁紶
+ handleChange(item, response, file, fileList) {
+ let index = this.TargetoptionList.findIndex(
+ (obj) => obj.id == item.id && obj.name == item.name
+ );
+ this.TargetoptionList[index].picturePath = response.url;
+ },
},
};
</script>
--
Gitblit v1.9.3