homePage.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <template>
  2. <div class="homePage">
  3. <div class="frameMain" :style="allHeight">
  4. <div class="menuList">
  5. <el-menu
  6. :default-active="$route.path"
  7. router
  8. :unique-opened="true"
  9. :default-openeds="openeds"
  10. @select="handleNodeClick"
  11. text-color="#fff"
  12. background-color="#184FB4"
  13. active-text-color="#fff">
  14. <!-- 引入组件 -->
  15. <menu-tree :menuData="forecastDatas"></menu-tree>
  16. </el-menu>
  17. </div>
  18. <div class="homeMain" :style="mainHeight">
  19. <div class="homeMain_tag">
  20. <el-tag
  21. v-for="tag in routeTags"
  22. :key="tag.name"
  23. closable
  24. size="large"
  25. class="tagArr"
  26. effect="dark"
  27. :type="tag.index === $route.path ? '': 'info'"
  28. @close="handleClose(tag)"
  29. @click="handleShowPage(tag)"
  30. >
  31. <span>{{ tag.name }}</span>
  32. </el-tag>
  33. </div>
  34. <div class="mainMessage" :style="viewHeight">
  35. <router-view></router-view>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. import MenuTree from '../components/menuTreeconfig.vue'
  43. import homeImg from '../assets/menuImg/home.png'
  44. import yewuImg from '../assets/menuImg/yewu.png'
  45. import tixiImg from '../assets/menuImg/tixi.png'
  46. import zhishikuImg from '../assets/menuImg/zhishiku.png'
  47. import quanxianImg from '../assets/menuImg/quanxian.png'
  48. export default {
  49. components: {MenuTree},
  50. data() {
  51. return {
  52. forecastDatas: [],
  53. expendData: ['0'],
  54. openeds:[],
  55. routeTags: [],
  56. defaultProps: {
  57. children: 'children',
  58. label: 'label',
  59. }
  60. }
  61. },
  62. created(){
  63. this.forecastDatas = [
  64. {
  65. index: '/home',
  66. name: '考评首页',
  67. img: homeImg
  68. },
  69. {
  70. index: '1',
  71. name: '考评业务',
  72. img: yewuImg,
  73. children: [
  74. {
  75. index: '/assessment/evaluationStart',
  76. name: '考评目标启动',
  77. },
  78. {
  79. index: '/assessment/monthQuarter',
  80. name: '月/季度目标考评'
  81. },
  82. {
  83. index: '',
  84. name: '年度目标考评'
  85. },
  86. {
  87. index: '',
  88. name: '考评项对标'
  89. },
  90. {
  91. index: '',
  92. name: '考评项预警'
  93. },
  94. {
  95. index: '',
  96. name: '人员考评'
  97. },
  98. {
  99. index: '',
  100. name: '任期考评'
  101. },
  102. {
  103. index: '',
  104. name: '考评监督'
  105. },
  106. {
  107. index: '',
  108. name: '考评评级'
  109. },
  110. {
  111. index: '',
  112. name: '考评报告'
  113. },
  114. {
  115. index: '',
  116. name: '考评公告'
  117. },
  118. {
  119. index: '',
  120. name: '单位考核结果应用'
  121. },
  122. {
  123. index: '',
  124. name: '部门考核结果应用'
  125. }
  126. ]
  127. },
  128. {
  129. index: '2',
  130. name: '考评体系配置',
  131. img: tixiImg,
  132. children: [
  133. {
  134. index: '/evaluationSystem/evaluationIndex',
  135. name: '考评指标管理',
  136. },
  137. {
  138. index: '/evaluationSystem/evaluationRules',
  139. name: '考评规则配置',
  140. },
  141. {
  142. index: '/evaluationSystem/company',
  143. name: '单位权重配置',
  144. },
  145. {
  146. index: '/evaluationSystem/department',
  147. name: '考评部门配置',
  148. },
  149. {
  150. index: '/evaluationSystem/personnel',
  151. name: '考评人员配置',
  152. },
  153. {
  154. index: '',
  155. name: '业绩考核系数配置',
  156. },
  157. {
  158. index: '',
  159. name: '党建考核系数配置',
  160. },
  161. ]
  162. },
  163. {
  164. index: '3',
  165. name: '考评知识库',
  166. img: zhishikuImg,
  167. children: [
  168. {
  169. index: '/knowledgePage/scoringRules',
  170. name: '考评得分规则',
  171. },
  172. {
  173. name: '考评评级规则',
  174. },
  175. {
  176. name: '考评预警规则',
  177. }
  178. ]
  179. },
  180. {
  181. index: '4',
  182. name: '基础信息配置',
  183. img: quanxianImg,
  184. children: [
  185. {
  186. index: '',
  187. name: '人员权限配置',
  188. },
  189. {
  190. index: '',
  191. name: '工作流程配置',
  192. }
  193. ]
  194. }
  195. ]
  196. if (window.localStorage.getItem('routeTags')) {
  197. this.routeTags = JSON.parse(window.localStorage.getItem('routeTags'))
  198. if (this.$route?.path === '/') {
  199. this.$router.push({ path: this.routeTags[0].index})
  200. }
  201. } else {
  202. this.routeTags = [
  203. {
  204. index: '/home',
  205. name: '考评首页'
  206. }
  207. ]
  208. this.$router.push({ path: this.routeTags[0].index})
  209. window.localStorage.setItem('routeTags', JSON.stringify(this.routeTags))
  210. }
  211. },
  212. mounted() {
  213. },
  214. computed:{
  215. mainHeight() {
  216. return {
  217. // 'height': document.documentElement.clientHeight-50 + 'px'
  218. 'height': '100vh'
  219. }
  220. },
  221. allHeight() {
  222. return {
  223. 'width': '100%',
  224. // 'height': document.documentElement.clientHeight-40 + 'px'
  225. 'height': '100vh'
  226. }
  227. },
  228. viewHeight() {
  229. return {
  230. 'width': '100%',
  231. // 'height': document.documentElement.clientHeight-40 + 'px'
  232. 'height': '91vh'
  233. }
  234. }
  235. },
  236. methods:{
  237. getBac(val) {
  238. let strWea = ''
  239. debugger
  240. if (val) {
  241. strWea = 'changeBacksty'
  242. } else {
  243. strWea = 'defaultBacksty'
  244. }
  245. return strWea
  246. },
  247. changeRoute(item) {
  248. if (item.index) {
  249. this.$router.push({ path: item.index})
  250. }
  251. },
  252. handleNodeClick(index, indexPath) {
  253. if (indexPath) {
  254. this.forecastDatas.forEach(it =>{
  255. if (it.index !== '') {
  256. if (it.index === indexPath[0]) {
  257. if (!it.children) {
  258. let showM = 0
  259. this.routeTags.forEach(item =>{
  260. if (item.name === it.name) {
  261. showM++
  262. }
  263. })
  264. if (showM === 0) {
  265. this.routeTags.push(it)
  266. }
  267. } else {
  268. it.children.forEach(iv =>{
  269. if (iv.index !== '') {
  270. if (iv.index === indexPath[1]) {
  271. let showM = 0
  272. this.routeTags.forEach(item =>{
  273. if (item.name === iv.name) {
  274. showM++
  275. }
  276. })
  277. if (showM === 0) {
  278. this.routeTags.push(iv)
  279. }
  280. }
  281. }
  282. })
  283. }
  284. }
  285. }
  286. })
  287. window.localStorage.setItem('routeTags', JSON.stringify(this.routeTags))
  288. }
  289. },
  290. handleClose(tag) {
  291. if (this.routeTags.length > 1) {
  292. this.routeTags.splice(this.routeTags.indexOf(tag), 1)
  293. window.localStorage.setItem('routeTags', JSON.stringify(this.routeTags))
  294. }
  295. },
  296. handleShowPage(tag) {
  297. this.$router.push({ path: tag.index})
  298. }
  299. }
  300. }
  301. </script>
  302. <style lang="less">
  303. .homePage{
  304. display: flex;
  305. .leftMenu{
  306. width: 70px;
  307. .logoSty{
  308. padding: 10px 0 0 10px;
  309. img{
  310. width: 35px;
  311. height: 35px;
  312. }
  313. }
  314. .firstLevel{
  315. margin-top: 30px;
  316. .firstLevel_icon{
  317. margin-bottom: 30px;
  318. cursor: pointer;
  319. .firstLevel_img{
  320. width: 35px;
  321. height: 37px;
  322. text-align: center;
  323. border-radius: 5px;
  324. position: relative;
  325. left: 10px;
  326. img{
  327. position: relative;
  328. top: 6px;
  329. width: 20px;
  330. height: 20px;
  331. }
  332. &:hover{
  333. background: rgba(255,255,255,.2);
  334. }
  335. }
  336. .changeBacksty{
  337. background: rgba(255,255,255,.2);
  338. }
  339. .defaultBacksty{
  340. background: rgba(255,255,255,0);
  341. }
  342. .firstLevel_title{
  343. margin-left: 5px;
  344. span{
  345. font-size: 12px;
  346. color: #fff;
  347. }
  348. }
  349. }
  350. }
  351. }
  352. .frameMain{
  353. // background: #f3f7f8;
  354. border-radius: 30px;
  355. display: flex;
  356. .menuList{
  357. width: 13vw;
  358. height: 100vh;
  359. background-color: #184FB4;
  360. .el-menu{
  361. .el-sub-menu{
  362. .el-menu--inline{
  363. .el-menu-item{
  364. height: 30px;
  365. margin-bottom: 10px;
  366. border-radius: 15px 0 0 15px;
  367. width: 90%;
  368. position: relative;
  369. left: 12%;
  370. padding-left: 15px;
  371. }
  372. .el-menu-item:hover, .el-menu-item.is-active{
  373. background-color: #fff;
  374. border-radius: 15px 0 0 15px;
  375. color: #2778FF;
  376. width: 90%;
  377. position: relative;
  378. left: 12%;
  379. padding-left: 15px;
  380. }
  381. .el-sub-menu__title:hover{
  382. background-color: #1063CB !important;
  383. }
  384. }
  385. }
  386. }
  387. }
  388. .homeMain{
  389. width: 86vw;
  390. .homeMain_tag{
  391. height:60px;
  392. border-bottom: 1px solid #D6DBEA;
  393. .tagArr{
  394. height: 33px;
  395. margin-left: 10px;
  396. cursor: pointer;
  397. position: relative;
  398. top: 28px;
  399. }
  400. .el-tag--dark{
  401. background-color: #184FB4;
  402. border: 1px solid #184FB4;
  403. }
  404. .el-tag--info{
  405. background-color: #E6EBF5;
  406. border: 1px solid #E6EBF5;
  407. color: #9DA5BE;
  408. .el-tag__close{
  409. color: #9DA5BE;
  410. }
  411. }
  412. }
  413. .mainMessage{
  414. // width: 85vw;
  415. // height: 91vh;
  416. padding: 0 10px;
  417. // background: #fff;
  418. border-radius: 20px;
  419. }
  420. }
  421. }
  422. }
  423. </style>