123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624 |
- <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">
- <div style="width: 90%;overflow: hidden;">
- <el-tag v-for="tag in routeTags" :key="tag.index" 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="settingMsg">
- <span>{{userName}}</span>
- <img :src="closeBtn" @click="closeSys" v-if="isSinglePoint">
- </div>
- </div>
- <div class="mainMessage" :style="$route.path === '/home' ? '': 'padding: 0 10px;'">
- <router-view></router-view>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import MenuTree from '../components/menuTreeconfig.vue'
- import homeImg from '../assets/menuImg/home.png'
- import taskImg from '../assets/menuImg/task.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'
- import tonggaoImg from '../assets/menuImg/tonggao.png'
- import benbuImg from '../assets/menuImg/benbu.png'
- import renyuanImg from '../assets/menuImg/renyuan.png'
- import closeBtn from '../assets/getwayImg/closeBtn.png'
- import {
- getToken,
- removeToken
- } from '../api/auth'
- import {
- apiPostremoveByToken,
- apiGetMenuData
- } from '../api/api'
- export default {
- components: {
- MenuTree
- },
- // inject: ['reload'],
- data() {
- return {
- forecastDatas: [],
- expendData: ['0'],
- openeds: [],
- routeTags: [],
- defaultProps: {
- children: 'children',
- label: 'label',
- },
- closeBtn: closeBtn,
- userName: '',
- isSinglePoint: true
- }
- },
- created() {
- this.getMenuData()
- // this.forecastDatas = [{
- // index: '/home',
- // name: '考评首页',
- // img: homeImg
- // },
- // {
- // index: '/taskCenter',
- // name: '任务中心',
- // img: taskImg
- // },
- // {
- // index: '/notification',
- // name: '通告管理',
- // img: tonggaoImg
- // },
- // {
- // index: '1',
- // name: '考评体系配置',
- // img: tixiImg,
- // children: [{
- // index: '/evaluationSystem/evaluationIndex',
- // name: '考评指标管理',
- // },
- // {
- // index: '/evaluationSystem/evaluationRules',
- // name: '考评规则配置',
- // },
- // {
- // index: '/evaluationSystem/company',
- // name: '单位权重配置',
- // },
- // {
- // index: '/baseInfomation/moreBrand',
- // name: '单位营业收入',
- // },
- // {
- // index: '/evaluationSystem/achievementK',
- // name: '业绩考核系数配置',
- // },
- // {
- // index: '/evaluationSystem/partyBuildingK',
- // name: '党建考核系数配置',
- // },
- // {
- // index: '/evaluationSystem/multiSequence',
- // name: '多序列计算指标',
- // },
- // {
- // index: '/evaluationSystem/department',
- // name: '部门考评配置',
- // },
- // {
- // index: '/evaluationSystem/personnel',
- // name: '人员考评配置',
- // },
- // ]
- // },
- // {
- // index: '2',
- // name: '单位考评业务',
- // img: yewuImg,
- // children: [{
- // index: '/assessment/evaluationStart',
- // name: '单位考评目标启动',
- // },
- // {
- // index: '/assessment/evaluationAmendment',
- // name: '单位考评目标修订',
- // },
- // {
- // index: '/assessment/evaluationMonth',
- // name: '单位月度考评'
- // },
- // {
- // index: '/assessment/evaluationQuarter',
- // name: '单位季度考评'
- // },
- // {
- // index: '/assessment/evaluationYear',
- // name: '单位年度考评'
- // },
- // {
- // index: '/assessment/evaluationBenchmarkingIndic',
- // name: '考评对标分析'
- // },
- // {
- // index: '/assessment/evaluationWarning',
- // name: '考评预警'
- // },
- // {
- // index: '/assessment/evaluationUnitRating',
- // name: '单位考评评级'
- // },
- // {
- // index: '/assessment/evaluationReport',
- // name: '考评报告'
- // },
- // ]
- // },
- // {
- // index: '3',
- // name: '本部考评业务',
- // img: benbuImg,
- // children: [{
- // index: '/assessment/evaluationDeptStart',
- // name: '业绩指标计划',
- // },
- // {
- // index: '/assessment/evaluationDeptBusiness',
- // name: '业绩指标考评'
- // },
- // {
- // index: '/assessment/evaluationDeptRating',
- // name: '部门考评评级'
- // },
- // {
- // index: '/assessment/assessmentApplication',
- // name: '绩效结果考核申报'
- // }
- // ]
- // },
- // {
- // index: '5',
- // name: '基础信息配置',
- // img: quanxianImg,
- // children: [{
- // index: '/baseInfomation/baseDataDictionary',
- // name: '数据字典配置',
- // },{
- // index: '/baseInfomation/baseBinSection',
- // name: '业务属性配置',
- // },
- // {
- // index: '/baseInfomation/baseBinStage',
- // name: '业务阶段配置',
- // },
- // {
- // index: '/baseInfomation/baseIndicatorType',
- // name: '指标分类配置',
- // },
- // {
- // index: '',
- // href: '',
- // name: '人员权限配置',
- // },
- // {
- // index: '',
- // name: '工作流程配置',
- // }
- // ]
- // },
- // {
- // index: '6',
- // name: '对标考评规则',
- // img: zhishikuImg,
- // children: [{
- // index: '/evaluationknowledge/scoringRules',
- // name: '考评得分规则',
- // },
- // {
- // index: '/evaluationknowledge/evalRatingRules',
- // name: '考评评级规则',
- // },
- // {
- // index: '/evaluationknowledge/earlyWarningRule',
- // name: '考评预警规则',
- // }
- // ]
- // },
- // ]
- if (window.sessionStorage.getItem('routeTags')) {
- this.routeTags = JSON.parse(window.sessionStorage.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.sessionStorage.setItem('routeTags', JSON.stringify(this.routeTags))
- }
- if (window.sessionStorage.getItem('user')) {
- let obj = JSON.parse(window.sessionStorage.getItem('user'))
- this.userName = obj.name
- }
- },
- 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: {
- // 获取菜单数据
- getMenuData() {
- let that = this
- that.isSinglePoint = window.localStorage.getItem('singlePoint') === 'singlePoint' ? false : true
- apiGetMenuData().then(datas => {
- if (datas && datas.data) {
- let arrDef = [{
- index: '/home',
- name: '考评首页',
- img: homeImg
- },
- {
- index: '/taskCenter',
- name: '任务中心',
- img: taskImg
- }
- ]
- let arr = []
- for (let i = 0; i < datas.data.length; i++) {
- let item = datas.data[i]
- let obj = {
- index: item.href,
- name: item.name
- }
- // if (item.name === '考评首页') {
- // obj.img = homeImg
- // } else if (item.name === '任务中心') {
- // obj.img = taskImg
- // } else
- if (item.name === '通告管理') {
- obj.img = tonggaoImg
- } else if (item.name === '考评体系配置') {
- obj.img = tixiImg
- obj.children = that.changeMenuData(item.children)
- } else if (item.name === '单位考评业务') {
- obj.img = yewuImg
- obj.children = that.changeMenuData(item.children)
- } else if (item.name === '本部考评业务') {
- obj.img = benbuImg
- obj.children = that.changeMenuData(item.children)
- } else if (item.name === '本部人员考评') {
- obj.img = renyuanImg
- obj.children = that.changeMenuData(item.children)
- } else if (item.name === '基础信息配置') {
- obj.img = quanxianImg
- obj.children = that.changeMenuData(item.children)
- } else if (item.name === '对标考评规则') {
- obj.img = zhishikuImg
- obj.children = that.changeMenuData(item.children)
- }
- arr.push(obj)
- }
- that.forecastDatas = arrDef.concat(arr)
- }
- })
- },
- changeMenuData(data) {
- let childArr = []
- data.forEach(item => {
- let obj = {
- index: item.href,
- name: item.name
- }
- childArr.push(obj)
- })
- return childArr
- },
- 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
- })
- }
- },
- closeSys() {
- let that = this
- apiPostremoveByToken(window.localStorage.getItem('token')).then(datas => {
- if (datas.code === 200) {
- // removeToken('token')
- // removeToken('code')
- // removeToken('purview')
- window.localStorage.removeItem('code')
- window.localStorage.removeItem('purview')
- window.localStorage.removeItem('token')
- window.sessionStorage.clear()
- that.$router.push({
- path: "/login"
- })
- }
- })
- },
- 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) {
- let obj = {
- index: it.index,
- name: it.name
- }
- this.routeTags.push(obj)
- }
- } 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.sessionStorage.setItem('routeTags', JSON.stringify(this.routeTags))
- }
- },
- handleClose(tag) {
- if (this.routeTags.length > 1) {
- this.routeTags.splice(this.routeTags.indexOf(tag), 1)
- this.$router.push({
- path: this.routeTags[this.routeTags.length - 1].index
- })
- window.sessionStorage.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;
- display: flex;
- .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;
- }
- }
- .settingMsg {
- width: 10%;
- padding-top: 20px;
- span {
- // width: 80%;
- // display: inline-block;
- position: relative;
- top: -5px;
- font-size: 18px;
- font-family: '微软雅黑';
- font-weight: bold;
- color: #171e28;
- }
- img {
- position: relative;
- left: 10px;
- cursor: pointer
- }
- }
- }
- .mainMessage {
- width: 100%;
- height: 91vh;
- // padding: 0 10px;
- // background: #fff;
- border-radius: 20px;
- }
- }
- }
- }
- </style>
|