From 12ce06c69440bf1bf581fca19aa38e7920bee01b Mon Sep 17 00:00:00 2001 From: yxh <172933527@qq.com> Date: 星期一, 27 十一月 2023 08:59:04 +0800 Subject: [PATCH] Merge branch 'wulong' of http://116.62.18.175:6699/r/~yxh/smartor-web into yxh01 --- src/views/patient/patient/profile/index.vue | 83 ++++++++++++++++++++++++++++++++++------- 1 files changed, 69 insertions(+), 14 deletions(-) diff --git a/src/views/patient/patient/profile/index.vue b/src/views/patient/patient/profile/index.vue index 2bef9ad..709759f 100644 --- a/src/views/patient/patient/profile/index.vue +++ b/src/views/patient/patient/profile/index.vue @@ -11,10 +11,34 @@ <div>鍚村ぇ榫�</div> </div></el-col > - <el-col :span="4" + <el-col :span="8" ><div class="xinz-inf"> - <div class="addtag">锛嬫柊澧炴爣绛�</div> - <div class="tagvalue">蹇冭绠�</div> + <el-tag + :key="tag" + v-for="tag in dynamicTags" + closable + :disable-transitions="false" + @close="handleClose(tag)" + > + {{ tag }} + </el-tag> + <el-input + class="input-new-tag" + v-if="inputVisible" + v-model="inputValue" + ref="saveTagInput" + size="small" + @keyup.enter.native="handleInputConfirm" + @blur="handleInputConfirm" + > + </el-input> + <el-button + v-else + class="button-new-tag" + size="small" + @click="showInput" + >+ 鏂板鏍囩</el-button + > </div></el-col > <el-col :span="4" @@ -315,6 +339,9 @@ activeName: "health", //涓�绫诲鑸� sonactiveName: "outpatient", //鍋ュ悍鐩戞祴瀵艰埅 sontwoactiveName: "blood", //鍖荤枟妗f瀵艰埅 + dynamicTags: ["鏍囩涓�", "鏍囩浜�", "鏍囩涓�"], + inputVisible: false, + inputValue: "", // 鏌ヨ鍙傛暟 queryParams: { pageNum: 1, @@ -385,15 +412,27 @@ this.loading = false; }); }, - // getUser() { - // getUserProfile().then((response) => { - // this.user = response.data; - // this.roleGroup = response.roleGroup; - // this.postGroup = response.postGroup; - // }); - // }, handleClick(tab, event) { console.log(tab, event); + }, + handleClose(tag) { + this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1); + }, + + showInput() { + this.inputVisible = true; + this.$nextTick((_) => { + this.$refs.saveTagInput.$refs.input.focus(); + }); + }, + + handleInputConfirm() { + let inputValue = this.inputValue; + if (inputValue) { + this.dynamicTags.push(inputValue); + } + this.inputVisible = false; + this.inputValue = ""; }, // 琛�鍘嬪浘琛ㄩ儴鍒� @@ -680,11 +719,27 @@ } } .xinz-inf { - display: flex; font-size: 18px; - cursor: pointer; - .addtag{ - + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + line-height: 48px; + + .el-tag + .el-tag { + margin-left: 10px; + } + .button-new-tag { + margin-left: 10px; + height: 32px; + line-height: 30px; + padding-top: 0; + padding-bottom: 0; + } + .input-new-tag { + width: 90px; + margin-left: 10px; + vertical-align: bottom; } } } -- Gitblit v1.9.3