You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.6 KiB
70 lines
1.6 KiB
<template>
|
|
<span class="e-select-view">
|
|
{{content}}
|
|
</span>
|
|
</template>
|
|
<style type="text/scss" lang="scss">
|
|
|
|
</style>
|
|
<script>
|
|
import api from "@/api";
|
|
|
|
export default {
|
|
name: "e-select-view",
|
|
data() {
|
|
return {
|
|
content:''
|
|
}
|
|
},
|
|
props:{
|
|
value:[String,Number],
|
|
module:{
|
|
type:String,
|
|
required:true
|
|
},
|
|
select:{
|
|
type:[String,Number],
|
|
required: true
|
|
},
|
|
show:{
|
|
type:[String,Number],
|
|
required: true
|
|
}
|
|
},
|
|
watch: {
|
|
value(){
|
|
this.getValue();
|
|
}
|
|
},
|
|
computed: {},
|
|
methods: {
|
|
getValue(){
|
|
if(this.value){
|
|
this.$post(api.search.selectView , {
|
|
table:this.module,
|
|
key:this.select,
|
|
value:this.value
|
|
}).then(res=>{
|
|
if(res.code == api.code.OK && res.data)
|
|
{
|
|
this.content = res.data[this.show];
|
|
}else{
|
|
this.content = '';
|
|
}
|
|
})
|
|
}else{
|
|
this.content = '';
|
|
}
|
|
|
|
}
|
|
},
|
|
created() {
|
|
this.getValue();
|
|
},
|
|
mounted() {
|
|
},
|
|
destroyed() {
|
|
}
|
|
}
|
|
</script>
|