IDepartment.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <div style="margin-top: -30px;padding: 10px;">
  3. <el-button type="text" @click="setValueNull()" > 选择所有部门 </el-button>
  4. <div>
  5. <h1 align="center"> 机关各科室 </h1>
  6. <el-row>
  7. <el-col :span="8" v-for="item in userDepartments" v-if="item.menuId==0">
  8. <el-button type="text" @click="selectDepartment(item)" >
  9. {{ item.department}}
  10. </el-button>
  11. </el-col>
  12. </el-row>
  13. </div>
  14. <div>
  15. <h1 align="center"> 局属各单位 </h1>
  16. <el-row>
  17. <el-col :span="8" v-for="item in userDepartments" v-if="item.menuId==1">
  18. <el-button type="text" @click="selectDepartment(item)" >
  19. {{ item.department}}
  20. </el-button>
  21. </el-col>
  22. </el-row>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. import { mapGetters } from "vuex";
  28. export default {
  29. name: "dropSelect",
  30. data() {
  31. return {
  32. };
  33. },
  34. computed: {
  35. ...mapGetters("user", ["userDepartments"])
  36. },
  37. methods: {
  38. setValueNull() {
  39. this.$emit("select", { departmentId: 0, department: "" });
  40. },
  41. selectDepartment(item){
  42. this.$emit("select", item );
  43. }
  44. },
  45. };
  46. </script>
  47. <style>
  48. .el-scrollbar {
  49. display: block !important;
  50. }
  51. .el-select {
  52. display: inline;
  53. }
  54. </style>