From c7d2fb7b04ea184df7c03a615ccda9bd172bb527 Mon Sep 17 00:00:00 2001 From: linwenling <3256558519@qq.com> Date: 星期三, 09 八月 2023 21:19:07 +0800 Subject: [PATCH] 家庭模块的三个图标 --- ruoyi-ui/src/views/doctor/index.vue | 161 +++++++++++++++++++++++++++++++---------------------- 1 files changed, 95 insertions(+), 66 deletions(-) diff --git a/ruoyi-ui/src/views/doctor/index.vue b/ruoyi-ui/src/views/doctor/index.vue index e098f5e..3b51e15 100644 --- a/ruoyi-ui/src/views/doctor/index.vue +++ b/ruoyi-ui/src/views/doctor/index.vue @@ -52,19 +52,10 @@ </el-form-item> <el-form-item label="绫诲埆" prop="type"> - <el-select - v-model="queryParams.type" - placeholder="鎵�鏈夌被鍒�" - clearable - style="width: 240px" - @keyup.enter.native="handleQuery" - > - <el-option - v-for="item in typeOptions" - :key="item.value" - :label="item.label" - :value="item.value" - /> + <el-select v-model="queryParams.type" placeholder="鎵�鏈夌被鍒�" clearable + style="width: 240px" @keyup.enter.native="handleQuery"> + <el-option v-for="item in typeOptions" + :key="item.value" :label="item.label" :value="item.value"/> </el-select> </el-form-item> @@ -192,13 +183,13 @@ </div> <el-table v-loading="loading" :data="doctorList" :row-key="getRowId" ref="multipleTable" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;"> - <el-table-column type="selection" :reserve-selection="true" width="25" align="center" /> + <el-table-column type="selection" :reserve-selection="true" width="55" align="center" /> <el-table-column fixed label="搴忓彿" sortable type="index" align="center" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60"/> - <el-table-column label="绫诲瀷" prop="type" sortable width="80" align="center"> - <template slot-scope="scope">{{ getSrc(scope.row.type) }}</template> -<!-- <template slot-scope="scope">{{scope.row.type? scope.row.type: '鈥斺�斺�斺��'}}</template>--> + <el-table-column label="绫诲埆" prop="type" sortable width="80" align="center"> +<!-- <template slot-scope="scope">{{ getSrc(scope.row.type) }}</template>--> + <template slot-scope="scope">{{scope.row.type? scope.row.type: '鈥斺�斺�斺��'}}</template> </el-table-column> - <el-table-column label="鐥囩姸" prop="symptom" sortable :show-overflow-tooltip="true" width="120" align="center" > + <el-table-column label="鐥囩姸" prop="symptom" sortable :show-overflow-tooltip="true" width="120" align="center" > <template slot-scope="scope">{{scope.row.symptom? scope.row.symptom: '鈥斺�斺�斺��'}}</template> </el-table-column> <el-table-column label="鎸佺画鏃堕棿" prop="duration" sortable :show-overflow-tooltip="true" width="160" align="center" > @@ -224,22 +215,23 @@ <el-table-column label="鐢靛瓙鏂囦欢" prop="url" width="160" align="center"> <template slot-scope="scope" > <div @click="handleCheck(scope.row)"> - <img - class="el-upload-list__item-thumbnail" - src="../../assets/images/deviceLis.png" - alt="" - style="width: 35px; height: 35px;" - fit="cover" - v-if="scope.row.url !== ','" - > - <img - class="el-upload-list__item-thumbnail" - src="../../assets/images/deviceA.png" - alt="" - style="width: 35px; height: 35px;" - fit="cover" - v-if="scope.row.url ===',' " - ></div> + <img + class="el-upload-list__item-thumbnail" + src="../../assets/images/deviceLis.png" + alt="" + style="width: 35px; height: 35px;" + fit="cover" + v-if="!(scope.row.url === '' || scope.row.url === ',' || scope.row.url === null)" + > + <img + v-else + class="el-upload-list__item-thumbnail" + src="../../assets/images/deviceA.png" + alt="" + style="width: 35px; height: 35px;" + fit="cover" + + ></div> </template> </el-table-column> @@ -284,11 +276,12 @@ <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px"> - <el-form-item label="绫诲瀷" prop="type"> + <el-form-item label="绫诲埆" prop="type"> <el-select v-model="formDat.type" placeholder="璇烽�夋嫨绫诲埆" clearable :style="{width: '100%'}" > <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value" ></el-option> </el-select> + <el-input v-model="newOption" v-if="showInput" placeholder="鑻ユ湭鍦ㄤ笂杩伴�夐」涓壘鍒板搴旂被鍒紝璇峰湪姝よ緭鍏ユ柊鐨勭被鍒�" @change="addNewOption"></el-input> </el-form-item> <el-form-item label="鐥囩姸" prop="symptom"> @@ -399,7 +392,7 @@ //瀵煎叆鎺ュ彛鍑芥暟 -import {listDoctor,enload,getDoctor, addDoctor,updateDoctor, delDoctor,uploadPic} from "@/api/doctor/index"; +import {listDoctor,enload,getDoctor, addDoctor,updateDoctor, delDoctor,uploadPic,listType} from "@/api/doctor/index"; import { Notification, MessageBox, Message, Loading } from 'element-ui' export default { @@ -424,6 +417,7 @@ total: 0, // 灏忓尰鐢熻〃鏍兼暟鎹� doctorList: [], + typeList:[], // 寮瑰嚭灞傛爣棰� title: "", // 鏄惁鏄剧ず寮瑰嚭灞� @@ -437,12 +431,10 @@ // 鏃ユ湡鑼冨洿 dateRange: [], // 鏁版嵁鑼冨洿閫夐」 - fot:[".jpg",".jif"], - fileList:[ - ], - fileListOther:[ - - ], + fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx', + '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'], + fileList:[], + fileListOther:[], dsb:true, btn:false, fit:['fill'], @@ -488,8 +480,8 @@ rules: { type: [{ - required: true, - message: '璇疯緭鍏ョ被鍨�', + // required: true, + message: '璇疯緭鍏ョ被鍒�', trigger: 'blur' }], symptom: [{ @@ -529,21 +521,15 @@ trigger: 'blur' }], }, - typeOptions: [{ - value:'绁炵粡绉�', - label:'绁炵粡绉�' - },{ - value:'鐗欑', - label:'鐗欑' - },{ - value:'鍐呯', - label:'鍐呯' - }], + typeOptions: [], + newOption: undefined, + showInput: true }; }, created() { this.getList(); - this.getCateInfor() + // this.getCateInfor(); + this.getTypeOptions(); // for (let i = 0; i < this.contactList.length; i++) { // this.formDat[i] = this.contactList[i]; // } @@ -563,6 +549,15 @@ return "statistics-warning-row"; } }, + //绫诲埆 + addNewOption() { + const newOption = this.newOption.trim(); + if (newOption && !this.typeOptions.includes(newOption)) { + this.typeOptions.push(newOption); + this.$set(this.formDat, 'type', newOption); // 鏇存柊formDat.type鐨勫�间负鏂扮殑閫夐」 + } + }, + /** 鏌ヨ璁板綍鍒楄〃 */ getList() { this.loading = true; @@ -572,23 +567,48 @@ // alert(123) // console.log(response.data) this.doctorList = response.data.data; - this.total = response.data.total; this.loading = false; } ); + listType(this.queryParams).then(response => { + this.typeList = response.data; + this.total = response.data.total; + // console.log( this.typeList ) + // 鍦ㄥ洖璋冨嚱鏁颁腑璋冪敤 getTypeOptions() + this.getTypeOptions(); + this.loading = false; + } + ); }, - /** 鏌ヨ绫诲埆淇℃伅 */ - getCateInfor() - { - let _this = this - getCategory().then(response=>{ + getTypeOptions() { + const filteredOptions = this.typeList.filter(item => typeof item === 'string' && item !== ''); + // 鍒涘缓涓�涓┖瀵硅薄鐢ㄤ簬瀛樺偍鍞竴鐨勫瓧绗︿覆閫夐」 + const uniqueOptions = {}; + // 鏋勫缓涓嬫媺閫夐」鍒楄〃 + this.typeOptions = filteredOptions.reduce((options, option) => { + if (!uniqueOptions[option]) { + uniqueOptions[option] = true; + options.push({ + label: option, + value: option + }); + } + return options; + }, []); - response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ - _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) - }) - }) - }, + }, + /** 鏌ヨ绫诲埆淇℃伅 */ + // getCateInfor() + // { + // let _this = this + // getCategory().then(response=>{ + // + // response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{ + // _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]}) + // }) + // }) + // }, //绫诲埆閫夋嫨 getSrc(type) { if (type === '绁炵粡绉�'){ @@ -801,6 +821,15 @@ }).catch(() => { Message({ message: "瀵煎叆澶辫触", type: 'error' })}); } + }, + watch: { + type(value) { + if (value === '') { + this.showInput = true; + } else { + this.showInput = false; + } + } } }; </script> -- Gitblit v1.9.1