|
@@ -2,14 +2,14 @@
|
|
|
<div class="fx-row">
|
|
|
<el-button v-show="!inputVisible" class="el-icon-search" circle @click="inputVisible=!inputVisible"></el-button>
|
|
|
<transition>
|
|
|
- <el-popover ref="pop" trigger="manual" :class="{'zero-padding-popover':details.length>0}">
|
|
|
+ <el-popover ref="pop" trigger="manual" :popper-class="details.length>0?'zero-padding-popover':''">
|
|
|
<i v-if="searching" class="el-icon-loading"></i>
|
|
|
- <span v-else-if="details.length">暂无结果</span>
|
|
|
- <template v-else>
|
|
|
- <el-button plain type="text" v-for="stu in details" @click="handleStudentClick(stu)">
|
|
|
- {{ stu.studentName }}({{ stu.className }}) {{ stu.userName }}
|
|
|
+ <span v-else-if="!details.length">暂无结果</span>
|
|
|
+ <div v-else class="fx-column">
|
|
|
+ <el-button plain type="text" v-for="stu in details" class="ml0 pl10 pr10" @click="handleStudentClick(stu)">
|
|
|
+ {{ stu.studentName }}<span v-if="stu.className">({{ stu.className }})</span> {{ stu.userName }}
|
|
|
</el-button>
|
|
|
- </template>
|
|
|
+ </div>
|
|
|
<el-input slot="reference" v-show="inputVisible" v-model="keywords" placeholder="姓名/学号/账号"
|
|
|
@blur="handleInputBlur" clearable>
|
|
|
<el-button :disabled="searching" slot="prepend" class="el-icon-caret-left" circle
|
|
@@ -66,7 +66,8 @@ export default {
|
|
|
keywords: this.keywords
|
|
|
}
|
|
|
searchElectiveGenerationDetails(params).then(res => {
|
|
|
- this.details = res.data
|
|
|
+ const safeResults = (res.data || []).slice(0, params.pageSize)
|
|
|
+ this.details = safeResults
|
|
|
this.$refs.pop.doShow()
|
|
|
}).finally(() => {
|
|
|
this.searching = false
|