admin_user.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div>
  3. <el-select v-model="select_val" @change="handleChange" placeholder="请选择">
  4. <el-option
  5. v-for="item in options"
  6. :key="item.uid"
  7. :label="item.real_name"
  8. :value="item.uid">
  9. </el-option>
  10. </el-select>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. select_val: "",
  18. options: [
  19. ]
  20. }
  21. },
  22. props: {
  23. change:{
  24. type: Function,
  25. },
  26. value:{
  27. }
  28. },
  29. watch:{
  30. value:function (newVal,oldVal) {
  31. this.select_val = newVal;
  32. }
  33. },
  34. mounted() {
  35. this.select_val = this.value;
  36. this.getCateGory()
  37. },
  38. methods: {
  39. handleChange(value) {
  40. this.$emit('input',value);
  41. if(typeof(this.change)=="function")
  42. {
  43. this.change(value);
  44. }
  45. },
  46. async getCateGory() {
  47. const res = await this.$post('/uapi/pub/list/admin/admin_user/list')
  48. this.options = res.data
  49. }
  50. }
  51. }
  52. </script>
  53. <style scoped>
  54. .screenfull-svg {
  55. display: inline-block;
  56. cursor: pointer;
  57. fill: #5a5e66;;
  58. width: 20px;
  59. height: 20px;
  60. vertical-align: 10px;
  61. }
  62. </style>