功能调整
parent
30617a4c76
commit
897cc864f1
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div class="tz-tips" @click="showTips = !showTips" @mouseenter="showTips = true" @mouseleave="showTips = false">
|
||||
{{short}}
|
||||
<div class="tz-tip" v-if="showTips">{{whole}}</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
content:{
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
len:{
|
||||
type: Number,
|
||||
default: 7
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
short: '',
|
||||
whole: '',
|
||||
showTips: false
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.whole =this.content
|
||||
if(this.content.length>this.len){
|
||||
this.short = this.content.substring(0,this.len)+".."
|
||||
}else{
|
||||
this.short = this.content
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
content:{
|
||||
handler(nv,ov){
|
||||
this.whole =this.content
|
||||
if(this.content.length>this.len){
|
||||
this.short = this.content.substring(0,this.len)+".."
|
||||
}else{
|
||||
this.short = this.content
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.tz-tips{
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tz-tip{
|
||||
position:absolute;
|
||||
display: block;
|
||||
background: wheat;
|
||||
white-space: nowrap;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
z-index: 9999;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
let baseUrl = '/api/system/'
|
||||
export function list(schoolId) {
|
||||
return request({
|
||||
url: baseUrl+'grade?schoolId='+schoolId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue