EditPerson.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div class="manage-root edit-person" v-if="info">
  3. <Header />
  4. <div class="manage-root-contain">
  5. <nav-menu
  6. class="manage-root-contain-left"
  7. :activeMenuIndex="activeMenuIndex"
  8. ></nav-menu>
  9. <div
  10. class="manage-root-contain-right personnel-manage-right"
  11. :class="[isPhone ? 'manage-root-contain-right-phone' : '']"
  12. >
  13. <breadcrumb
  14. :breadcrumbList="breadcrumbList"
  15. class="breadcrumb-box"
  16. :class="[isPhone ? 'breadcrumb-box-phone' : '']"
  17. ></breadcrumb>
  18. <setting
  19. :page="$route.query.page ? $route.query.page : 'editOrgPerson'"
  20. :info="info"
  21. @getInfo="getInfo"
  22. @changeBread="changeBread"
  23. ></setting>
  24. </div>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  30. //例如:import 《组件名称》from ‘《组件路径》';
  31. import Header from "../../components/Header.vue";
  32. import NavMenu from "../../components/NavMenu.vue";
  33. import Breadcrumb from "../../components/Breadcrumb.vue";
  34. import Setting from "../../components/Setting.vue";
  35. import { getLogin } from "@/api/ajax";
  36. export default {
  37. //import引入的组件需要注入到对象中才能使用
  38. components: { Header, NavMenu, Breadcrumb, Setting },
  39. props: {},
  40. data() {
  41. //这里存放数据
  42. return {
  43. activeMenuIndex: "organize_manage",
  44. breadcrumbList: [],
  45. tableHeight: "", // 表格高度
  46. id: this.$route.query.id ? this.$route.query.id : "",
  47. info: null,
  48. isPhone: false,
  49. };
  50. },
  51. //计算属性 类似于data概念
  52. computed: {},
  53. //监控data中数据变化
  54. watch: {},
  55. //方法集合
  56. methods: {
  57. //计算table高度(动态设置table高度)
  58. getTableHeight() {
  59. let tableH = 434; //距离页面下方的高度
  60. let tableHeightDetil = window.innerHeight - tableH;
  61. if (tableHeightDetil <= 300) {
  62. this.tableHeight = 300;
  63. } else {
  64. this.tableHeight = window.innerHeight - tableH;
  65. }
  66. },
  67. // 获取机构信息
  68. getInfo() {
  69. let MethodName = "/OrgServer/Manager/PersonManager/GetPersonInfo";
  70. let data = {
  71. id: this.id,
  72. };
  73. getLogin(MethodName, data)
  74. .then((res) => {
  75. if (res.status === 1) {
  76. let breadcrumb = [
  77. {
  78. icon: "school-line",
  79. url: "",
  80. text: "",
  81. },
  82. {
  83. icon: "",
  84. url: "",
  85. text: "机构管理",
  86. },
  87. {
  88. icon: "",
  89. url: "",
  90. text: res.person.org_name,
  91. },
  92. {
  93. icon: "",
  94. url: "",
  95. text: "人员信息",
  96. },
  97. ];
  98. this.breadcrumbList = breadcrumb;
  99. this.info = res.person;
  100. }
  101. })
  102. .catch(() => {});
  103. },
  104. // 修改面包屑
  105. changeBread(list) {
  106. this.breadcrumbList = list;
  107. },
  108. },
  109. //生命周期 - 创建完成(可以访问当前this实例)
  110. created() {
  111. const regExp = /Android|webOS|iPhone|BlackBerry|IEMobile|Opera Mini/i;
  112. this.isPhone = regExp.test(navigator.userAgent) && window.innerWidth < 860;
  113. this.getTableHeight();
  114. if (this.id) {
  115. this.getInfo();
  116. }
  117. },
  118. //生命周期 - 挂载完成(可以访问DOM元素)
  119. mounted() {},
  120. //生命周期-创建之前
  121. beforeCreated() {},
  122. //生命周期-挂载之前
  123. beforeMount() {},
  124. //生命周期-更新之前
  125. beforUpdate() {},
  126. //生命周期-更新之后
  127. updated() {},
  128. //生命周期-销毁之前
  129. beforeDestory() {},
  130. //生命周期-销毁完成
  131. destoryed() {},
  132. //如果页面有keep-alive缓存功能,这个函数会触发
  133. activated() {},
  134. };
  135. </script>
  136. <style lang="scss" scoped>
  137. /* @import url(); 引入css类 */
  138. .manage-root-contain-right-phone {
  139. .personal-inner {
  140. min-height: calc(100vh - 124px);
  141. height: auto;
  142. }
  143. }
  144. </style>