user.vue 915 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <script setup lang="ts">
  2. import { reactive } from "vue";
  3. import UserList from "./modules/user-list.vue";
  4. defineOptions({
  5. name: "user"
  6. });
  7. const pageData: any = reactive({
  8. mode: "table",
  9. orgInfo: {}
  10. });
  11. const handleSwitchMode = (mode: String) => {
  12. pageData.mode = mode;
  13. if (pageData.mode === "table") {
  14. pageData.orgInfo = {};
  15. }
  16. };
  17. </script>
  18. <template>
  19. <el-card :shadow="'never'">
  20. <template #default>
  21. <template v-if="pageData.mode !== 'table'">
  22. <el-col :span="19">
  23. <user-list
  24. :mode="pageData.mode"
  25. :org-info="pageData.orgInfo"
  26. @switch-mode="handleSwitchMode"
  27. />
  28. </el-col>
  29. </template>
  30. <template v-else>
  31. <user-list
  32. :mode="pageData.mode"
  33. :org-info="pageData.orgInfo"
  34. @switch-mode="handleSwitchMode"
  35. />
  36. </template>
  37. </template>
  38. </el-card>
  39. </template>