123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426 |
- <template>
- <div class="homePage">
- <div class="frameMain" :style="allHeight">
- <div class="menuList">
- <el-menu
- :default-active="$route.path"
- router
- :unique-opened="true"
- :default-openeds="openeds"
- @select="handleNodeClick"
- text-color="#fff"
- background-color="#184FB4"
- active-text-color="#fff">
- <!-- 引入组件 -->
- <menu-tree :menuData="forecastDatas"></menu-tree>
- </el-menu>
- </div>
- <div class="homeMain" :style="mainHeight">
- <div class="homeMain_tag">
- <el-tag
- v-for="tag in routeTags"
- :key="tag.name"
- closable
- size="large"
- class="tagArr"
- effect="dark"
- :type="tag.index === $route.path ? '': 'info'"
- @close="handleClose(tag)"
- @click="handleShowPage(tag)"
- >
- <span>{{ tag.name }}</span>
- </el-tag>
- </div>
- <div class="mainMessage" :style="viewHeight">
- <router-view></router-view>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import MenuTree from '../components/menuTreeconfig.vue'
- import homeImg from '../assets/menuImg/home.png'
- import yewuImg from '../assets/menuImg/yewu.png'
- import tixiImg from '../assets/menuImg/tixi.png'
- import zhishikuImg from '../assets/menuImg/zhishiku.png'
- import quanxianImg from '../assets/menuImg/quanxian.png'
- export default {
- components: {MenuTree},
- data() {
- return {
- forecastDatas: [],
- expendData: ['0'],
- openeds:[],
- routeTags: [],
- defaultProps: {
- children: 'children',
- label: 'label',
- }
- }
- },
- created(){
- this.forecastDatas = [
- {
- index: '/home',
- name: '考评首页',
- img: homeImg
- },
- {
- index: '1',
- name: '考评业务',
- img: yewuImg,
- children: [
- {
- index: '/assessment/evaluationStart',
- name: '考评目标启动',
- },
- {
- index: '/assessment/monthQuarter',
- name: '月/季度目标考评'
- },
- {
- index: '',
- name: '年度目标考评'
- },
- {
- index: '',
- name: '考评项对标'
- },
- {
- index: '',
- name: '考评项预警'
- },
- {
- index: '',
- name: '人员考评'
- },
- {
- index: '',
- name: '任期考评'
- },
- {
- index: '',
- name: '考评监督'
- },
- {
- index: '',
- name: '考评评级'
- },
- {
- index: '',
- name: '考评报告'
- },
- {
- index: '',
- name: '考评公告'
- },
- {
- index: '',
- name: '单位考核结果应用'
- },
- {
- index: '',
- name: '部门考核结果应用'
- }
- ]
- },
- {
- index: '2',
- name: '考评体系配置',
- img: tixiImg,
- children: [
- {
- index: '/evaluationSystem/evaluationIndex',
- name: '考评指标管理',
- },
- {
- index: '/evaluationSystem/evaluationRules',
- name: '考评规则配置',
- },
- {
- index: '/evaluationSystem/company',
- name: '单位权重配置',
- },
- {
- index: '/evaluationSystem/department',
- name: '考评部门配置',
- },
- {
- index: '/evaluationSystem/personnel',
- name: '考评人员配置',
- },
- {
- index: '',
- name: '业绩考核系数配置',
- },
- {
- index: '',
- name: '党建考核系数配置',
- },
- ]
- },
- {
- index: '3',
- name: '考评知识库',
- img: zhishikuImg,
- children: [
- {
- index: '/knowledgePage/scoringRules',
- name: '考评得分规则',
- },
- {
- name: '考评评级规则',
- },
- {
- name: '考评预警规则',
- }
- ]
- },
- {
- index: '4',
- name: '基础信息配置',
- img: quanxianImg,
- children: [
- {
- index: '',
- name: '人员权限配置',
- },
- {
- index: '',
- name: '工作流程配置',
- }
- ]
- }
- ]
- if (window.localStorage.getItem('routeTags')) {
- this.routeTags = JSON.parse(window.localStorage.getItem('routeTags'))
- if (this.$route?.path === '/') {
- this.$router.push({ path: this.routeTags[0].index})
- }
- } else {
- this.routeTags = [
- {
- index: '/home',
- name: '考评首页'
- }
- ]
- this.$router.push({ path: this.routeTags[0].index})
- window.localStorage.setItem('routeTags', JSON.stringify(this.routeTags))
- }
-
- },
- mounted() {
- },
- computed:{
- mainHeight() {
- return {
- // 'height': document.documentElement.clientHeight-50 + 'px'
- 'height': '100vh'
- }
- },
- allHeight() {
- return {
- 'width': '100%',
- // 'height': document.documentElement.clientHeight-40 + 'px'
- 'height': '100vh'
- }
- },
- viewHeight() {
- return {
- 'width': '100%',
- // 'height': document.documentElement.clientHeight-40 + 'px'
- 'height': '91vh'
- }
- }
- },
- methods:{
- getBac(val) {
- let strWea = ''
- debugger
- if (val) {
- strWea = 'changeBacksty'
- } else {
- strWea = 'defaultBacksty'
- }
- return strWea
- },
- changeRoute(item) {
- if (item.index) {
- this.$router.push({ path: item.index})
- }
- },
- handleNodeClick(index, indexPath) {
- if (indexPath) {
- this.forecastDatas.forEach(it =>{
- if (it.index !== '') {
- if (it.index === indexPath[0]) {
- if (!it.children) {
- let showM = 0
- this.routeTags.forEach(item =>{
- if (item.name === it.name) {
- showM++
- }
- })
- if (showM === 0) {
- this.routeTags.push(it)
- }
- } else {
- it.children.forEach(iv =>{
- if (iv.index !== '') {
- if (iv.index === indexPath[1]) {
- let showM = 0
- this.routeTags.forEach(item =>{
- if (item.name === iv.name) {
- showM++
- }
- })
- if (showM === 0) {
- this.routeTags.push(iv)
- }
- }
- }
- })
- }
- }
- }
- })
- window.localStorage.setItem('routeTags', JSON.stringify(this.routeTags))
- }
- },
- handleClose(tag) {
- if (this.routeTags.length > 1) {
- this.routeTags.splice(this.routeTags.indexOf(tag), 1)
- window.localStorage.setItem('routeTags', JSON.stringify(this.routeTags))
- }
- },
- handleShowPage(tag) {
- this.$router.push({ path: tag.index})
- }
- }
- }
- </script>
- <style lang="less">
- .homePage{
- display: flex;
- .leftMenu{
- width: 70px;
- .logoSty{
- padding: 10px 0 0 10px;
- img{
- width: 35px;
- height: 35px;
- }
- }
- .firstLevel{
- margin-top: 30px;
- .firstLevel_icon{
- margin-bottom: 30px;
- cursor: pointer;
- .firstLevel_img{
- width: 35px;
- height: 37px;
- text-align: center;
- border-radius: 5px;
- position: relative;
- left: 10px;
- img{
- position: relative;
- top: 6px;
- width: 20px;
- height: 20px;
- }
- &:hover{
- background: rgba(255,255,255,.2);
- }
- }
- .changeBacksty{
- background: rgba(255,255,255,.2);
- }
- .defaultBacksty{
- background: rgba(255,255,255,0);
- }
- .firstLevel_title{
- margin-left: 5px;
- span{
- font-size: 12px;
- color: #fff;
- }
- }
- }
- }
- }
- .frameMain{
- // background: #f3f7f8;
- border-radius: 30px;
- display: flex;
- .menuList{
- width: 13vw;
- height: 100vh;
- background-color: #184FB4;
- .el-menu{
- .el-sub-menu{
- .el-menu--inline{
- .el-menu-item{
- height: 30px;
- margin-bottom: 10px;
- border-radius: 15px 0 0 15px;
- width: 90%;
- position: relative;
- left: 12%;
- padding-left: 15px;
- }
- .el-menu-item:hover, .el-menu-item.is-active{
- background-color: #fff;
- border-radius: 15px 0 0 15px;
- color: #2778FF;
- width: 90%;
- position: relative;
- left: 12%;
- padding-left: 15px;
- }
- .el-sub-menu__title:hover{
- background-color: #1063CB !important;
- }
- }
- }
- }
- }
- .homeMain{
- width: 86vw;
- .homeMain_tag{
- height:60px;
- border-bottom: 1px solid #D6DBEA;
- .tagArr{
- height: 33px;
- margin-left: 10px;
- cursor: pointer;
- position: relative;
- top: 28px;
- }
- .el-tag--dark{
- background-color: #184FB4;
- border: 1px solid #184FB4;
- }
- .el-tag--info{
- background-color: #E6EBF5;
- border: 1px solid #E6EBF5;
- color: #9DA5BE;
- .el-tag__close{
- color: #9DA5BE;
- }
- }
- }
- .mainMessage{
- // width: 85vw;
- // height: 91vh;
- padding: 0 10px;
- // background: #fff;
- border-radius: 20px;
- }
- }
- }
- }
- </style>
|