From b09476a8669551619c1f8b57158c064b13499437 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期四, 18 七月 2024 15:48:22 +0800 Subject: [PATCH] 测试完成 --- src/components/Regular/index.vue | 73 ++++++++++++++++++++++++++++++++++-- 1 files changed, 68 insertions(+), 5 deletions(-) diff --git a/src/components/Regular/index.vue b/src/components/Regular/index.vue index 1789177..091e957 100644 --- a/src/components/Regular/index.vue +++ b/src/components/Regular/index.vue @@ -3,7 +3,7 @@ <div class="topicxq" v-for="item in TargetoptionList"> <el-row :gutter="10"> <el-col :span="12" - ><el-form-item label="閫夐」鍚�"> + ><el-form-item label="閫夐」鍚嶇О"> <el-input type="text" placeholder="璇疯緭鍏�" @@ -13,6 +13,14 @@ </el-input> </el-form-item ></el-col> <el-col :span="12" + ><el-form-item label="棰勮鍊�"> + <el-radio-group v-model="item.isabnormal"> + <el-radio :label="1">鏄�</el-radio> + <el-radio :label="0">鍚�</el-radio> + </el-radio-group> + </el-form-item></el-col + > + <el-col :span="12" v-if="intent" ><el-form-item label="閫夐」鑺傜偣"> <el-input type="text" @@ -23,7 +31,19 @@ </el-input> </el-form-item ></el-col> </el-row> - <el-row :gutter="10"> + <el-row :gutter="10" v-if="!intent"> + <el-col :span="20" + ><el-form-item label="閫夐」璇存槑"> + <el-input + type="text" + placeholder="璇疯緭鍏�" + v-model="item.optiondesc" + show-word-limit + > + </el-input> </el-form-item + ></el-col> + </el-row> + <el-row :gutter="10" v-if="intent"> <el-col :span="12" ><el-form-item label="澶勭悊"> <el-input @@ -130,9 +150,30 @@ > </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"> + <el-col :span="16" v-if="intent"> <el-form-item label="璇煶鏂囦欢"> <el-upload class="upload-demo" @@ -147,7 +188,7 @@ </el-upload> </el-form-item></el-col > - <el-col :span="8"> + <el-col :span="intent ? 8 : 22"> <div style="text-align: right; padding-right: 10px"> <el-button v-if="controlsc" @@ -185,6 +226,7 @@ <script> import store from "@/store"; +import { getToken } from "@/utils/auth"; export default { data() { @@ -197,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, @@ -215,6 +261,10 @@ default: () => [], }, controlsc: { + type: Boolean, + default: true, + }, + intent: { type: Boolean, default: true, }, @@ -251,8 +301,12 @@ } regex = regex.slice(0, -1); regexno = regexno.slice(0, -1); + if (regexno) { + hostregexno = "^(?!.*(?:" + `${regexno}` + ")).*$"; + } else { + hostregexno = ""; + } hostregex = "(?=.*(?:" + `${regex}` + ")).*$"; - hostregexno = "^(?!.(?:" + `${regexno}` + ")).*$"; this.TargetoptionList[index].targetregex = hostregex; this.TargetoptionList[index].targetregex2 = hostregexno; console.log(hostregex, "纭畾瀛楀尮閰�"); @@ -285,7 +339,9 @@ this.generateRegex(item); }, handleInputConfirm(row) { + console.log(this.TargetoptionList, "TargetoptionList"); let index = this.TargetoptionList.indexOf(row); + console.log(1112); if (this.whether == 1 && this.inputValue) { if ( this.TargetoptionList[index].dynamiccruxs.indexOf(this.inputValue) == @@ -334,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