123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547 |
- <template>
- <div class="homePage">
- <!-- <div class="leftMenu">
- <div class="logoSty">
- <img src="../assets/logoG.png" alt="">
- </div>
- <div class="firstLevel">
- <div class="firstLevel_icon" v-for="item in leftLevelData" :key="item.index" @click="changeRoute(item)">
- <div class="firstLevel_img" :class="getBac(item.showBac)">
- <img :src="item.image">
- </div>
- <div class="firstLevel_title">
- <span>{{item.name}}</span>
- </div>
- </div>
- </div>
- </div> -->
- <div class="frameMain" :style="allHeight">
- <div class="treeList">
- <p>全业务域对标考评系统</p>
- <el-tree ref="tree" :data="forecastDatas" :props="defaultProps" highlight-current node-key="id"
- :default-expanded-keys="expendData" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
- <template #default="{ node, data }">
- <span class="custom-tree-node">
- <el-icon size="small" v-if="node.level === 1 && data.id !== '0'"><FolderOpened /></el-icon>
- <span v-if="data.id === '0'" style="margin-left:17px;font-size:14px;line-height:35px;display:inline-block">{{node.label}}</span>
- <span v-else style="margin-left:5px;font-size:14px;line-height:35px;display:inline-block">{{node.label}}</span>
- </span>
- </template>
- </el-tree>
- </div>
- <div class="homeMain" :style="mainHeight">
- <div style="height:40px">
- <el-tag
- v-for="tag in routeTags"
- :key="tag.name"
- closable
- size="large"
- class="tagArr"
- effect="dark"
- :type="tag.type"
- @close="handleClose(tag)"
- @click="handleShowPage(tag)"
- >
- <span>{{ tag.name }}</span>
- </el-tag>
- </div>
- <div class="mainMessage">
- <router-view></router-view>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Assessment from "../assets/indexIcon/Assessment.png"
- export default {
- data() {
- return {
- leftLevelData: [],
- forecastDatas: [],
- expendData: ['0'],
- routeTags: [],
- defaultProps: {
- children: 'children',
- label: 'label',
- }
- }
- },
- created(){
- this.leftLevelData = [
- // {
- // index: '/index',
- // name: '系统门户',
- // image: gateway,
- // showBac: true
- // },
- // {
- // index: '/benchmark',
- // name: '对标业务',
- // image: benchmarking
- // },
- {
- index: '/assessment',
- name: '考评业务',
- image: Assessment
- },
- // {
- // index: '/configure',
- // name: '系统配置',
- // image: configure
- // }
- ]
- this.forecastDatas = [
- // {
- // id: '0',
- // label: '系统首页',
- // path: '/home'
- // },
- {
- id: '1',
- label: '对标业务',
- children: [
- {
- id: '1-1',
- label: '排行榜',
- },
- {
- id: '1-2',
- label: '分类对标',
- },
- {
- id: '1-3',
- label: '综合对标',
- },
- {
- id: '1-4',
- label: '立标管理',
- },
- {
- id: '1-5',
- label: '寻标管理',
- },
- {
- id: '1-6',
- label: '达标管理',
- },
- {
- id: '1-7',
- label: '超标管理',
- },
- {
- id: '1-8',
- label: '对标报告'
- }
- ]
- },
- {
- id: '2',
- label: '考评业务',
- children: [
- {
- id: '2-1',
- label: '考评总览'
- },
- {
- id: '2-2',
- label: '考评启动',
- path: '/assessment/evaluationStart'
- },
- {
- id: '2-3',
- label: '考评修订'
- },
- {
- id: '2-4',
- label: '考评目标分解'
- },
- {
- id: '2-5',
- label: '月/季度考评'
- },
- {
- id: '2-6',
- label: '考评项对标'
- },
- {
- id: '2-7',
- label: '考评项预警'
- },
- {
- id: '2-8',
- label: '年度考评'
- },
- {
- id: '2-9',
- label: '人员考评'
- },
- {
- id: '2-10',
- label: '任期考评'
- },
- {
- id: '2-11',
- label: '考评监督'
- },
- {
- id: '2-12',
- label: '考评评级'
- },
- {
- id: '2-13',
- label: '考评报告'
- },
- {
- id: '2-14',
- label: '考评公告'
- },
- {
- id: '2-15',
- label: '奖金及薪资总额调整'
- },
- ]
- },
- {
- id: '3',
- label: '对标考评知识库',
- children: [
- {
- id: '3-1',
- label: '对标指标标准',
- },
- {
- id: '3-2',
- label: '对标算法规则',
- },
- {
- id: '3-3',
- label: '对标预警规则',
- },
- {
- id: '3-4',
- label: '考评得分规则',
- path: '/knowledgePage/scoringRules'
- },
- {
- id: '3-5',
- label: '考评评级规则',
- },
- {
- id: '3-6',
- label: '考评预警规则',
- },
- ]
- },
- {
- id: '4',
- label: '对标体系配置',
- children: [
- {
- id: '4-1',
- label: '对标指标管理',
- },
- {
- id: '4-2',
- label: '指标规则配置',
- },
- {
- id: '4-3',
- label: '对标结构配置',
- },
- ]
- },
- {
- id: '5',
- label: '考评体系配置',
- children: [
- {
- id: '5-1',
- label: '考评指标管理',
- path: '/evaluationSystem/evaluationIndex'
- },
- {
- id: '5-2',
- label: '考评规则配置',
- path: '/evaluationSystem/evaluationRules'
- },
- {
- id: '5-3',
- label: '考评单位配置',
- path: '/evaluationSystem/company'
- },
- {
- id: '5-4',
- label: '考评部门配置',
- path: '/evaluationSystem/department'
- },
- {
- id: '5-5',
- label: '考评人员配置',
- path: '/evaluationSystem/personnel'
- },
- ]
- },
- {
- id: '6',
- label: '基础信息配置',
- children: [
- {
- id: '6-1',
- label: '人员权限配置',
- },
- {
- id: '6-2',
- label: '工作流程配置',
- }
- ]
- }
- ]
- if (window.localStorage.getItem('routeTags')) {
- this.routeTags = JSON.parse(window.localStorage.getItem('routeTags'))
- if (this.$route?.path === '/') {
- this.$router.push({ path: this.routeTags[0].path})
- }
- // this.$nextTick(() =>{
- // if (this.$refs.tree) {
- // this.$refs.tree.setCurrentKey(this.routeTags[0].id)
- // this.expendData = [this.routeTags[0].id]
- // }
- // })
- } else {
- this.routeTags = [
- {
- id: '5-1',
- label: '考评指标管理',
- path: '/evaluationSystem/evaluationIndex'
- }
- ]
- window.localStorage.setItem('routeTags', JSON.stringify(this.routeTags))
- }
-
- },
- mounted() {
- this.$nextTick(() => {
- if (this.$route?.path) {
- let path = this.$route.path
- this.expendData = []
- for(let i =0; i<this.forecastDatas.length; i++) {
- let item = this.forecastDatas[i]
- if (item.id !== '0') {
- for(let j =0; j<item.children.length; j++) {
- let it = item.children[j]
- if (it.path === path) {
- if (this.$refs.tree) {
- this.$refs.tree.setCurrentKey(it.id)
- this.expendData = [item.id]
- }
- }
- }
- } else {
- if (this.$refs.tree) {
- this.$refs.tree.setCurrentKey(item.id)
- this.expendData = [item.id]
- }
- }
- }
- }
- })
- },
- computed:{
- mainHeight() {
- return {
- // 'height': document.documentElement.clientHeight-50 + 'px'
- 'width': '84%',
- 'height': '95vh'
- }
- },
- allHeight() {
- return {
- 'width': '100%',
- // 'height': document.documentElement.clientHeight-40 + 'px'
- 'height': '96vh'
- }
- },
- },
- 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(val) {
- if (val.path) {
- this.$router.push({ path: val.path})
- let showM = 0
- this.routeTags.forEach(item =>{
- if (item.name === val.label) {
- showM++
- }
- })
- if (showM === 0) {
- this.routeTags.push({
- id: val.id,
- name: val.label,
- path: val.path
- })
- }
- window.localStorage.setItem('routeTags', JSON.stringify(this.routeTags))
- }
- if (val.id === '0') {
- let node = this.$refs.tree.getNode(val)
- this.handleNodeExpand(val, node)
- }
- },
- handleNodeExpand(data, node) {
- node.parent.childNodes.forEach(item =>{
- if (data.id !== item.data.id) {
- item.expanded = false
- }
- })
- },
- 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.path})
- let node = this.$refs.tree.getNode(tag)
- this.handleNodeExpand(tag, tag.id === '0'?node:node.parent)
- this.$refs.tree.setCurrentKey(tag.id)
- this.expendData = [tag.id]
- }
- }
- }
- </script>
- <style lang="less">
- .homePage{
- display: flex;
- padding: 10px 10px;
- .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;
- padding: 10px 0;
- display: flex;
- .treeList{
- margin-left: 5px;
- width: 15%;
- // background: #fff;
- border-radius: 20px;
- p{
- font-size: 18px;
- font-family: '微软雅黑';
- font-weight: bold;
- color: #171e28;
- position: relative;
- left: 30px;
- top: 5px;
- letter-spacing: 1px;
- }
- .el-tree{
- position: relative;
- top: 30px;
- padding: 0 0 0 20px;
- background: transparent;
- .el-tree-node{
- .el-tree-node__content{
- height: 35px;
- .custom-tree-node{
- height: 35px;
- }
- }
- .el-tree-node__children{
- .el-tree-node__content{
- height: 35px;
- .custom-tree-node{
- height: 35px;
- }
- }
- }
- }
- }
- .el-tree--highlight-current
- .el-tree-node.is-current
- > .el-tree-node__content {
- background-color: rgba(135, 206, 235, 0.2);
- color: #007aab;
- font-weight: bold;
- border-radius: 5px;
- }
- }
- .homeMain{
- .tagArr{
- height: 25px;
- margin-right: 10px;
- cursor: pointer;
- }
- .mainMessage{
- width: 100%;
- padding-top: 10px;
- background: #fff;
- border-radius: 20px;
- }
- }
- }
- }
- </style>
|