index.vue 8.4 KB

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