优化
This commit is contained in:
parent
258fbde75d
commit
db396d943c
@ -2,6 +2,7 @@
|
||||
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import Mixin from './mixins/gload'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import './utils/elementConfig'
|
||||
@ -12,6 +13,7 @@ import VConsole from 'vconsole'
|
||||
import VueCookie from 'vue-cookies'
|
||||
import { debounce, departGetForm, personlGetForm, handleInput, messageSuccess, loading, loadingClose } from '@/utils/common'
|
||||
import { format } from '@/utils/dateFormat'
|
||||
Vue.mixin(Mixin)
|
||||
// }
|
||||
|
||||
// let hostList = ['lzmanagement.ldxinyong.com']
|
||||
|
||||
20
src/mixins/gload.js
Normal file
20
src/mixins/gload.js
Normal file
@ -0,0 +1,20 @@
|
||||
// src/mixins/index.js
|
||||
import { mapGetters } from 'vuex'
|
||||
let mixin = {
|
||||
data () {
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['auth'])
|
||||
},
|
||||
methods: {
|
||||
loadPage (routerName, param) {
|
||||
if (param) {
|
||||
this.$router.push({name: routerName, query: param})
|
||||
} else {
|
||||
this.$router.push({name: routerName})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
export default mixin
|
||||
@ -1,5 +1,6 @@
|
||||
const getters = {
|
||||
permission_routes: state => state.user.routes,
|
||||
userInfo: state => state.user.info
|
||||
userInfo: state => state.user.info,
|
||||
auth: state => state.user.auth
|
||||
}
|
||||
export default getters
|
||||
|
||||
@ -2,16 +2,19 @@ import { getDepList } from '@/api/report'
|
||||
const user = {
|
||||
state: {
|
||||
deplist: [],
|
||||
info: JSON.parse(localStorage.getItem('info')) || {}
|
||||
info: JSON.parse(localStorage.getItem('info')) || {},
|
||||
auth: JSON.parse(localStorage.getItem('auth')) || {}
|
||||
|
||||
},
|
||||
mutations: {
|
||||
SET_USER_INFO: (state, info) => {
|
||||
console.log('state: ', state)
|
||||
console.log('info: ', info)
|
||||
localStorage.setItem('info', JSON.stringify(info))
|
||||
state.info = info
|
||||
},
|
||||
SET_USER_AUTH: (state, auth) => {
|
||||
localStorage.setItem('auth', JSON.stringify(auth))
|
||||
state.auth = auth
|
||||
},
|
||||
SET_DEPLIST: (state, list = []) => {
|
||||
state.deplist = list
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item >
|
||||
<el-button type="primary" size="small" @click="$router.push({name:'initiate'})">发起考核</el-button>
|
||||
<el-button type="primary" :disabled='!auth.startAm' size="small" @click="$router.push({name:'initiate'})">发起考核</el-button>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item >
|
||||
<el-button size="small" >导入历史绩效</el-button>
|
||||
@ -53,12 +53,14 @@
|
||||
width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled='!auth.seeAm'
|
||||
@click="handlePush(scope.row.id)"
|
||||
type="text"
|
||||
size="small">
|
||||
查 看
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled='!auth.deleteAm'
|
||||
@click="handleDelete(scope.row.id)"
|
||||
type="text"
|
||||
size="small">
|
||||
|
||||
@ -5,10 +5,11 @@
|
||||
<div class="table-left">维度</div>
|
||||
<div class="table-header-flex name">名称</div>
|
||||
<div class="table-header-flex">考核标准</div>
|
||||
<div class="table-header-flex" v-if="tableInfo.result || auth.showResult">结果值</div>
|
||||
<div class="table-header-flex" v-if="tableInfo.result || tableAuth.showResult">结果值</div>
|
||||
<div class="table-header-flex quanzhomng" style="flex:none;">权重({{obj.weight*100}}%)</div>
|
||||
<div class="table-header-flex" v-if="tableInfo.score || auth.showScore">上级评分</div>
|
||||
<div class="table-header-flex" v-if="tableInfo.score || auth.showScore">评分说明</div>
|
||||
<div class="table-header-flex" style="flex:none;width:130px;" v-if="tableInfo.score || tableAuth.showScore">上级评分</div>
|
||||
<div class="table-header-flex quanzhomng" style="flex:none;" v-if="tableInfo.score || tableAuth.showScore">得分</div>
|
||||
<div class="table-header-flex" v-if="tableInfo.score || tableAuth.showScore">评分说明</div>
|
||||
</div>
|
||||
<!-- <div v-if="obj.recortModelDtos.length === 0" class='listNone'>
|
||||
<div>
|
||||
@ -16,7 +17,7 @@
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div v-for="(item,index) in ((tableInfo.score || auth.showScore)?obj.recortModelDtos:obj.recortModelDtos.slice(0,obj.recortModelDtos.length-1))" :key="index" class="table-content">
|
||||
<div v-for="(item,index) in ((tableInfo.score || tableAuth.showScore)?obj.recortModelDtos:obj.recortModelDtos.slice(0,obj.recortModelDtos.length-1))" :key="index" class="table-content">
|
||||
<div class="table-content-left table-left">
|
||||
<!-- {{item.name}} -->
|
||||
<div v-for="(i,indexs) in item.name" :key="indexs">
|
||||
@ -33,16 +34,16 @@
|
||||
{{child.keyResult || ''}}
|
||||
</pre>
|
||||
</div>
|
||||
<div v-if="tableInfo.result || auth.showResult">
|
||||
<div v-if="tableInfo.result || tableAuth.showResult">
|
||||
<el-input v-if="tableInfo.result" type="textarea" size="mini" placeholder="请输入内容" v-model="child.checkResult" clearable></el-input>
|
||||
<pre v-else>{{child.checkResult || '--'}}</pre>
|
||||
</div>
|
||||
<div class="quanzhomng" style="flex:none;">
|
||||
{{( Math.round((child.checkWeight * 100) * 1000) / 1000 )}}%
|
||||
</div>
|
||||
<div v-if="tableInfo.score || auth.showScore">
|
||||
<div v-if="tableInfo.score || tableAuth.showScore" style="flex:none;width:130px;">
|
||||
<!-- gradeGroupId=== 1 下拉 -->
|
||||
<el-select v-if="tableInfo.score && obj.gradeGroupId===1" style="width:140px;" size="mini" v-model="child.scoreDtos[child.scoreDtos.length-1].acquireScore">
|
||||
<el-select v-if="tableInfo.score && obj.gradeGroupId===1" style="width:115px;" size="mini" v-model="child.scoreDtos[child.scoreDtos.length-1].acquireScore">
|
||||
<el-option
|
||||
v-for="item in scoreList"
|
||||
:key="item.id"
|
||||
@ -50,10 +51,13 @@
|
||||
:value="item.score">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input v-if="tableInfo.score && obj.gradeGroupId===2" style="width:120px;" size="mini" placeholder="请输入评分值" v-model="child.superScore" clearable></el-input>
|
||||
<el-input v-if="tableInfo.score && obj.gradeGroupId===2" style="width:115px;" size="mini" placeholder="请输入评分值" v-model="child.scoreDtos[child.scoreDtos.length-1].acquireScore" clearable></el-input>
|
||||
<span v-if="!tableInfo.score">{{handleScore(child.scoreDtos[child.scoreDtos.length-1].acquireScore)}}</span>
|
||||
</div>
|
||||
<div style="padding:10px;" v-if="tableInfo.score || auth.showScore">
|
||||
<div class="quanzhomng" style="flex:none;" v-if="tableInfo.score || tableAuth.showScore">
|
||||
<span>{{child.scoreDtos[child.scoreDtos.length-1].acquireScore || '--'}}</span>
|
||||
</div>
|
||||
<div style="padding:10px;" v-if="tableInfo.score || tableAuth.showScore">
|
||||
<el-input v-if="tableInfo.score" style="width:200px;" size="mini" type="textarea" placeholder="请输入内容" v-model="child.scoreComment" clearable></el-input>
|
||||
<span v-else>{{child.scoreComment || '--'}}</span>
|
||||
</div>
|
||||
@ -64,16 +68,17 @@
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div v-if="tableInfo.result || auth.showResult">
|
||||
<div v-if="tableInfo.result || tableAuth.showResult">
|
||||
</div>
|
||||
<div class="quanzhomng" style="flex:none;">
|
||||
</div>
|
||||
<div v-if="tableInfo.score">
|
||||
<div style="padding:10px;flex:none;width:130px;" v-if="tableInfo.score || tableAuth.showScore">
|
||||
{{score.scoreLevel}}
|
||||
</div>
|
||||
<div style="width:140px;" v-if="tableInfo.score || auth.showScore">
|
||||
{{handleGetScorc()}}
|
||||
<div class="quanzhomng" style="flex:none;" v-if="tableInfo.score || tableAuth.showScore">
|
||||
{{score.lastScore}}
|
||||
</div>
|
||||
<div style="padding:10px;" v-if="tableInfo.score || auth.showScore">
|
||||
<div style="padding:10px;" v-if="tableInfo.score || tableAuth.showScore">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -124,7 +129,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
auth: {
|
||||
tableAuth: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
@ -137,33 +142,44 @@ export default {
|
||||
loadingZan: false,
|
||||
input: '',
|
||||
scoreList: []
|
||||
// score: {
|
||||
// lastScore: '',
|
||||
// scoreLevel: ''
|
||||
// }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
score () {
|
||||
const result = this.obj.recortModelDtos.reduce((result, i) => {
|
||||
i.detailDtos.map(j => {
|
||||
j.scoreDtos.map(k => {
|
||||
const str = j.calculate.replace(/{\w+}/g, (i) => {
|
||||
i = i.replace(/{|}/g, '')
|
||||
return k[i]
|
||||
})
|
||||
let a = eval(str)
|
||||
result += a
|
||||
})
|
||||
})
|
||||
return result
|
||||
}, 0)
|
||||
const arr = this.scoreList.filter(i => i.minScore <= result && i.maxScore > result)
|
||||
return {
|
||||
lastScore: result.toFixed(3),
|
||||
scoreLevel: arr.length > 0 ? arr[0].name : ''
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.handleGrt375()
|
||||
},
|
||||
methods: {
|
||||
handleGetScorc (obj = this.obj) {
|
||||
const result = obj.recortModelDtos.reduce((result, i) => {
|
||||
i.detailDtos.map(j => {
|
||||
const str = j.calculate.replace(/{\w+}/g, (i) => {
|
||||
i = i.replace(/{|}/g, '')
|
||||
return j[i]
|
||||
})
|
||||
let a = eval(str)
|
||||
result += a
|
||||
})
|
||||
return result
|
||||
}, 0)
|
||||
return result.toFixed(3)
|
||||
},
|
||||
handleScore (item) {
|
||||
console.log('this.scoreList: ', this.scoreList)
|
||||
return this.scoreList.filter(i => i.score === item).length > 0 ? this.scoreList.filter(i => i.score === item)[0].name : 0
|
||||
},
|
||||
async handleGetNext () {
|
||||
this.loadingTi = true
|
||||
let res1 = await apiSaveDetail(this.obj)
|
||||
let res1 = await apiSaveDetail(Object.assign({}, this.score, this.obj))
|
||||
if (res1.code !== 200) {
|
||||
this.$message.error(res1.msg)
|
||||
this.loadingTi = false
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
</div>
|
||||
<div class="performance-content-bottom">
|
||||
<tables
|
||||
:auth='formList.auth'
|
||||
:tableAuth='formList.auth'
|
||||
:tableInfo.sync='tableInfo'
|
||||
v-if="obj.recortModelDtos.length !==0"
|
||||
:obj='obj'
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<!-- handleGetList handleChoose -->
|
||||
<el-button
|
||||
size="small"
|
||||
v-if='auth.amMore'
|
||||
@click="handleMore"
|
||||
plain
|
||||
>更多</el-button>
|
||||
@ -127,6 +128,7 @@
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-button
|
||||
|
||||
@click="handleLook(scope.row.id)"
|
||||
type="text"
|
||||
size="small"
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
text-color="#52575b"
|
||||
active-text-color="#3ba1ff"
|
||||
>
|
||||
<el-menu-item index="0">考评组设置</el-menu-item>
|
||||
<el-menu-item index="1">权限设置</el-menu-item>
|
||||
<el-menu-item v-if="auth.evaluationSet" index="0">考评组设置</el-menu-item>
|
||||
<el-menu-item v-if="auth.roleSet" index="1">权限设置</el-menu-item>
|
||||
</el-menu>
|
||||
<ground-table class="kaoping" v-if="activeIndex==='0'"></ground-table>
|
||||
<div v-else-if="activeIndex==='1'">
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
新增考评组<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="handleToEidt" >新增考评组</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="handleToEidtCopy" > 复制考评组</el-dropdown-item>
|
||||
<el-dropdown-item :disabled='!auth.evaluationAddSet' @click.native="handleToEidt" >新增考评组</el-dropdown-item>
|
||||
<el-dropdown-item :disabled='!auth.evaluationAddSet' @click.native="handleToEidtCopy" > 复制考评组</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-form-item>
|
||||
@ -40,12 +40,14 @@
|
||||
width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled='!auth.evaluationEditSet'
|
||||
@click="handlePush(scope.row.id)"
|
||||
type="text"
|
||||
size="small">
|
||||
编 辑
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled='!auth.evaluationDeleteSet'
|
||||
@click="handleDelete(scope.row.id)"
|
||||
type="text"
|
||||
size="small">
|
||||
|
||||
@ -18,9 +18,9 @@
|
||||
<div class="home-left-enter-title commonFont">快捷入口</div>
|
||||
<div class="home-left-enter-content">
|
||||
<div class="boderAndRadius commonFont noSelect" @click="handleGetMoreToDo('assessment')">考核管理</div>
|
||||
<div class="boderAndRadius commonFont noSelect" @click="handleGetMoreToDo('workbench-group')" >考评组</div>
|
||||
<div class="boderAndRadius commonFont noSelect" @click="handleGetMoreToDo('initiate')">发起考核</div>
|
||||
<div class="boderAndRadius commonFont noSelect" @click="handleGetMoreToDo('1')">指标库</div>
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.evaluationGroupManager" @click="handleGetMoreToDo('workbench-group')" >考评组</div>
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.launchEvaluation" @click="handleGetMoreToDo('initiate')">发起考核</div>
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.indexData" @click="handleGetMoreToDo('1')">指标库</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -33,11 +33,12 @@ export default {
|
||||
token: this.$cookies.get('token')
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
computed: {
|
||||
},
|
||||
beforeMount () {},
|
||||
mounted () {},
|
||||
methods: {
|
||||
...mapMutations(['SET_USER_INFO']),
|
||||
...mapMutations(['SET_USER_INFO', 'SET_USER_AUTH']),
|
||||
handleClick () {
|
||||
this.isShow = !this.isShow
|
||||
},
|
||||
@ -45,14 +46,16 @@ export default {
|
||||
localStorage.setItem('input', this.input)
|
||||
const params = {'userName': this.input, 'password': 'admin', 'uuid': '', 'verify': this.verify, 'verifyCode': this.verify}
|
||||
let res = await apiLogin(params)
|
||||
console.log('res: ', res)
|
||||
if (res.code === 200) {
|
||||
this.SET_USER_AUTH(res.data)
|
||||
this.token = res.token
|
||||
this.$cookies.set('token', res.token, res.expire)
|
||||
let ress = await apiUserInfo()
|
||||
if (ress.code === 200) {
|
||||
this.SET_USER_INFO(ress.user)
|
||||
}
|
||||
location.reload()
|
||||
// location.reload()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user