index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <div id="detail">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <el-col :span="24" class="top">
  6. <top></top>
  7. </el-col>
  8. <el-col :span="24" class="main">
  9. <div class="w_1200">
  10. <el-col :span="5" class="left">
  11. <el-col :span="24" class="top">
  12. <i class="el-icon-s-unfold"></i>
  13. <span>个人中心</span>
  14. </el-col>
  15. <el-col :span="24" class="menus">
  16. <!-- <el-col class="menuList" :span="24" v-for="(item, index) in menuList" :key="index">
  17. <p @click="changeMenu(item.name, index)" :style="`color:${menuIndex == index ? menuColor : ''}`">
  18. {{ item.name }}
  19. </p>
  20. </el-col> -->
  21. <el-menu :default-active="num" @select="selectMenu" text-color="black" active-text-color="#044b79">
  22. <el-menu-item index="1">
  23. <template slot="title">
  24. <span>基本信息</span>
  25. </template>
  26. </el-menu-item>
  27. <el-menu-item index="2">
  28. <template slot="title">
  29. <span>需求管理</span>
  30. </template>
  31. </el-menu-item>
  32. <el-menu-item index="3">
  33. <template slot="title">
  34. <span>信息管理</span>
  35. </template>
  36. </el-menu-item>
  37. <el-menu-item index="4">
  38. <template slot="title">
  39. <span>人员管理</span>
  40. </template>
  41. </el-menu-item>
  42. <el-menu-item index="5">
  43. <template slot="title">
  44. <span>部门管理</span>
  45. </template>
  46. </el-menu-item>
  47. <el-menu-item index="6">
  48. <template slot="title">
  49. <span>职务管理</span>
  50. </template>
  51. </el-menu-item>
  52. <el-menu-item index="7">
  53. <template slot="title">
  54. <span>修改密码</span>
  55. </template>
  56. </el-menu-item>
  57. <el-menu-item index="8">
  58. <template slot="title">
  59. <span @click="logoutBtn()">退出登录</span>
  60. </template>
  61. </el-menu-item>
  62. </el-menu>
  63. </el-col>
  64. </el-col>
  65. <el-col :span="18" class="right">
  66. <span v-if="columnName == '基本信息'">
  67. <el-col :span="24" class="infoTop"> <span>|</span><span>基本信息</span> </el-col>
  68. <pinfo></pinfo>
  69. </span>
  70. <span v-else-if="columnName == '需求管理'">
  71. <el-col :span="24" class="infoTop"> <span>|</span><span>需求管理</span> </el-col>
  72. <demand></demand>
  73. </span>
  74. <span v-else-if="columnName == '信息管理'">
  75. <el-col :span="24" class="infoTop" style="margin-bottom:0;"> <span>|</span><span>信息管理</span> </el-col>
  76. <el-col :span="24">
  77. <infoAdmin></infoAdmin>
  78. </el-col>
  79. </span>
  80. <span v-else-if="columnName == '人员管理'">
  81. <el-col :span="24" class="infoTop"> <span>|</span><span>人员管理</span> </el-col>
  82. </span>
  83. <span v-else-if="columnName == '部门管理'">
  84. <el-col :span="24" class="infoTop"> <span>|</span><span>部门管理</span> </el-col>
  85. </span>
  86. <span v-else-if="columnName == '职务管理'">
  87. <el-col :span="24" class="infoTop"> <span>|</span><span>职务管理</span> </el-col>
  88. </span>
  89. <span v-else-if="columnName == '修改密码'">
  90. <el-col :span="24" class="infoTop"> <span>|</span><span>修改密码</span> </el-col>
  91. <uppasswd></uppasswd>
  92. </span>
  93. <span v-else-if="columnName == '退出登录'">
  94. 退出登录
  95. </span>
  96. </el-col>
  97. </div>
  98. </el-col>
  99. <el-col :span="24" class="foot">
  100. <div class="w_1200">
  101. <foot></foot>
  102. </div>
  103. </el-col>
  104. </el-col>
  105. </el-row>
  106. </div>
  107. </template>
  108. <script>
  109. import top from '@/layout/common/top.vue';
  110. import foot from '@/layout/common/foot.vue';
  111. import infoAdmin from './parts/infoAdmin.vue';
  112. import demand from '@/views/pcenter/demand.vue';
  113. import pinfo from '@/views/pcenter/pinfo.vue';
  114. import uppasswd from '@/views/pcenter/uppasswd.vue';
  115. import { mapState, createNamespacedHelpers } from 'vuex';
  116. const { mapActions: login } = createNamespacedHelpers('login');
  117. export default {
  118. name: 'detail',
  119. props: {},
  120. components: {
  121. top,
  122. foot,
  123. infoAdmin, //信息管理
  124. pinfo,
  125. uppasswd,
  126. demand,
  127. },
  128. data: function() {
  129. return {
  130. columnName: '基本信息',
  131. num: '1',
  132. };
  133. },
  134. created() {
  135. this.selectMenu();
  136. },
  137. methods: {
  138. ...login({ logout: 'logout' }),
  139. // 选择栏目
  140. selectMenu(key) {
  141. if (key == 1) {
  142. this.columnName = '基本信息';
  143. } else if (key == 2) {
  144. this.columnName = '需求管理';
  145. } else if (key == 3) {
  146. this.columnName = '信息管理';
  147. } else if (key == 4) {
  148. this.columnName = '人员管理';
  149. } else if (key == 5) {
  150. this.columnName = '部门管理';
  151. } else if (key == 6) {
  152. this.columnName = '职务管理';
  153. } else if (key == 7) {
  154. this.columnName = '修改密码';
  155. } else if (key == 8) {
  156. this.columnName = '退出登录';
  157. }
  158. },
  159. // 点击选择菜单
  160. changeMenu(name, index) {
  161. this.menuIndex = index;
  162. this.columnName = name;
  163. this.menuColor = 'rgb(5,73,130)';
  164. },
  165. // 退出登录
  166. logoutBtn() {
  167. this.logout();
  168. this.$router.push({ path: '/' });
  169. },
  170. },
  171. computed: {
  172. ...mapState(['user']),
  173. pageTitle() {
  174. return `${this.$route.meta.title}`;
  175. },
  176. },
  177. metaInfo() {
  178. return { title: this.$route.meta.title };
  179. },
  180. };
  181. </script>
  182. <style lang="less" scoped>
  183. .w_1200 {
  184. width: 1200px;
  185. margin: 0 auto;
  186. }
  187. .style {
  188. .menu {
  189. height: 70px;
  190. margin: 0 0 10px 0;
  191. }
  192. .main {
  193. min-height: 600px;
  194. margin: 0 0 10px 0;
  195. .left {
  196. min-height: 600px;
  197. background: #fff;
  198. margin: 0 10px 0 0;
  199. .top {
  200. height: 60px;
  201. line-height: 60px;
  202. background-color: #054982;
  203. color: #fff;
  204. font-size: 25px;
  205. font-weight: 600;
  206. letter-spacing: 2px;
  207. text-align: center;
  208. }
  209. /deep/.el-menu-item {
  210. height: 50px;
  211. line-height: 50px;
  212. text-align: center;
  213. border-bottom: 1px solid #ccc;
  214. span {
  215. font-size: 20px;
  216. font-weight: bold;
  217. }
  218. }
  219. }
  220. .right {
  221. width: 78%;
  222. min-height: 600px;
  223. background: #fff;
  224. }
  225. }
  226. .foot {
  227. height: 135px;
  228. }
  229. }
  230. .infoTop {
  231. height: 50px;
  232. border-bottom: 1px dashed #ccc;
  233. margin: 0 auto;
  234. margin-bottom: 20px;
  235. float: none;
  236. width: 98%;
  237. padding: 20px 0 5px 0;
  238. }
  239. .infoTop span {
  240. font-size: 20px;
  241. color: #005293;
  242. font-weight: bold;
  243. margin-right: 10px;
  244. }
  245. </style>