Commit a9507283 authored by zhangderong's avatar zhangderong

Merge branch 'Ztext1' of git.quantgroup.cn:ui/recruiting-management into Ztext1

parents d802fbb4 22923a51
......@@ -3,13 +3,13 @@
<Col span="3" class="aside" style="width:17%;height:100%">
<img src="https://o7oe0d6qz.qnssl.com/image/homelogo.png" alt="" style="height:60px">
<Menu style="width: 100%;" ref='subMenu' :active-name="vSubName" :open-names="vName" @on-select="go">
<template v-for="menu in childMenu" >
<Submenu :name="menu.name" :key="menu.name" v-show='!(isadmin==false&&menu.item=="账户管理")'>
<template v-for="(menu, index) in childMenu" >
<Submenu :name="menu.name" :key="menu.name" v-show='!(isAdmin==false&&menu.item=="账户管理")'>
<template slot="title">
<Icon type="ios-paper"/>
<Icon :type="menu.icon"/>
{{menu.item}}
</template>
<MenuItem v-for="child in menu.child" :key="child.name" :name="child.name" @click="go">{{child.item}}</MenuItem>
<MenuItem v-for="child in menu.child" :key="child.name" :name="child.name" @click="go" :active-name="vSubName">{{child.item}}</MenuItem>
</Submenu>
</template>
</Menu>
......@@ -43,6 +43,7 @@ import localstorage from '../service/localstorage.service.js'
data() {
return {
massage:'',
isAdmin: false,
arr:[],
biaoshi:'',
channelARR:[],
......@@ -53,45 +54,131 @@ import localstorage from '../service/localstorage.service.js'
xiabiao:'',
itemSelect:'',
type:'',
name: '1',
hName: '1',
vName: ['1'],
vSubName: '1-1',
typearr:['"ios-apps-outline"','"ios-list"','"ios-paper-outline"','"ios-cloud-upload-outline"','"ios-contact-outline"','"ios-mail-outline"','"ios-qr-scanner"'],
hName: '',
vName: ['1-1', '2-1', '3-1', '4-1'],
vSubName: '1-1-1',
menuList: [
{ name: '1', item: '简历管理', child: [{ name: '1', item: '全部管理', child: [{ name: '1-1', item:'全部简历', route: '/allResume' }] },
{ name: '2', item: '渠道简历', child: [] }]},
{ name: '2', item: '面试管理', child: [{ name: '1', item: '面试管理', child: [{ name: '1-1', item:'全部简历', route: '/interview' }] }] },
{ name: '3', item: '上传简历', child: [{ name: '1', item: '上传简历', child: [{ name: '1-1', item:'上传简历', route: '/upload' }] }] },
{ name: '4', item: '系统管理', child: [{ name: '1', item: '账户管理', child: [{ name: '1-1', item:'账户管理', route: '/account' }] },
{ name: '2', item: '邮箱管理', child: [{ name: '2-1', item:'邮箱管理', route: '/emailMange' }] },
{ name: '3', item: '二维码管理', child: [{ name: '3-1', item:'二维码管理', route: '/QRcode' }] }
{ name: '1',
item: '简历管理',
child: [
{
name: '1-1',
item: '全部管理',
icon: 'ios-apps-outline',
child: [
{
name: '1-1-1',
item:'全部简历',
route: '/allResume'
}
]
},
{ name: '1-2',
item: '渠道简历',
icon: 'ios-list',
child: []
}]
},
{ name: '2',
item: '面试管理',
child: [
{ name: '2-1',
item: '面试管理',
icon: 'ios-paper-outline',
child: [
{ name: '2-1-1',
item:'全部简历',
route: '/interview'
}]
}]
},
{ name: '3',
item: '上传简历',
child: [{
name: '3-1',
item: '上传简历',
icon: 'ios-cloud-upload-outline',
child: [
{ name: '3-1-1',
item:'上传简历',
route: '/upload'
}]
}]
},
{ name: '4',
item: '系统管理',
child: [{
name: '4-1',
item: '账户管理',
icon: 'ios-contact-outline',
child: [{
name: '4-1-1',
item:'账户管理',
route: '/account'
}]
},
{ name: '4-2',
item: '邮箱管理',
icon:'ios-mail-outline',
child: [{
name: '4-2-1',
item:'邮箱管理',
route: '/emailMange'
}]},
{ name: '4-3',
item: '二维码管理',
icon: 'ios-qr-scanner',
child: [
{ name: '4-3-1',
item:'二维码管理',
route: '/QRcode'
}]}
] },
],
childMenu: [{ name: '1', item: '全部简历', child: [{ name: '1-1', item:'全部简历', route: '' }] },
{ name: '2', item: '渠道简历', child: [{ name: 'name', item:'item', route: 'router' }] }]
childMenu: [{ name: '1-1', item: '全部管理', child: [{ name: '1-1-1', item:'全部简历', route: '/allResume' }] },
{ name: '1-2', item: '渠道简历', child: [] }]
}
},
watch:{
$route(to,from){
if (to.params.fromInterview){
this.getActiveName()
}
}
},
methods: {
go(name) {
let vName = name.split('-')[0]
const menu = this.childMenu.filter(v => vName === v.name)
const route = menu.length === 1 ? menu[0].child.filter(v => name === v.name)[0].route :''
this.$router.push(route)
this.vSubName = name
this.childMenu.map(par => {
par.child.map(child => {
if (child.name == name) {
this.$router.push(child.route)
}
})
})
},
selectMenu(name) {
selectMenu(name, type) {
// type是否为刷新页面
this.hName = name
const menus = this.menuList.filter(v => name === v.name)
this.childMenu = menus.length > 0 ? menus[0].child : [{ name: '1', item: '全部简历', child: [{ name: '1-1', item:'全部简历', route: '/user/login' }] }]
if(name=='4' &&this.isadmin==false){
this.vSubName='2-1'
}else{
this.vSubName='1-1'
this.childMenu = menus.length > 0 ? menus[0].child : [{ name: '1-1', item: '全部管理', child: [{ name: '1-1-1', item:'全部简历', route: '/allResume' }] },{ name: '1-2', item: '渠道简历', child: [] }]
if (!type) { // 点击菜单默认展示第一个菜单
this.vName = []
this.vName[0] = ((name == '4') && this.isAdmin && this.childMenu[0].name) || ((name == '4') && !this.isAdmin && this.childMenu[1].name) || this.childMenu[0].name
this.vSubName = ((name == '4') && this.isAdmin && this.childMenu[0].child[0].name) || ((name == '4') && !this.isAdmin && this.childMenu[1].child[0].name) || this.childMenu[0].child[0].name
}
if (name == '1') { // 简历管理模块需要加载渠道简历
this.getChannelMenu()
}
if(name=='1'){
this.menuList[0].child[1].child=[]
this.a()
if (type&&this.$route.path.indexOf('channel') > -1) {
this.vSubName = this.$route.path.split('/')[2]
}
this.$nextTick(() => {
this.$refs.subMenu.updateOpened();
this.$refs.subMenu.updateActiveName();
})
this.go(this.vSubName)
},
// 获取个人信息
......@@ -110,12 +197,13 @@ import localstorage from '../service/localstorage.service.js'
}
})
},
a(){
getChannelMenu(){
this.menuList[0].child[1].child = []
getChannelMassage().then(res=>{
this.channelARR=res.data.body
this.channelARR.map((item,index) => {
var obj = {
name: `2-${index+1}`,
name: `${item.sourceName}`,
item: item.sourceName,
route: `/channel/${item.sourceCode}`
}
......@@ -123,39 +211,42 @@ import localstorage from '../service/localstorage.service.js'
})
})
},
c(){
this.typearr.map((item,index)=>{
this.type=item
console.log(item)
})
},
getActiveName () {
getActiveName (change) {
let pathName = this.$route.path
if (pathName.indexOf('channel') > -1) {
this.hName = '1'
this.vSubName = pathName.split('/')[2]
this.vName = []
this.vName.push('1-2')
this.selectMenu(this.hName, 'refresh')
return
}
this.menuList.map(parent => {
parent.child.map(child => {
child.child.map(grandson => {
if (grandson.route == this.$route.path) {
if (grandson.route == pathName) {
this.vSubName = grandson.name
this.hName = parent.name
this.vName = []
this.vName.push(child.name)
}
})
})
})
this.selectMenu(this.hName)
this.selectMenu(this.hName, 'refresh')
},
// 判断是否为超级管理员
judgeadmin(){
judeAdmin().then(res=>{
this.isadmin=res.data.body
this.isAdmin=res.data.body
})
}
},
mounted() {
this.getmassage()
// this.getMenu()
this.getActiveName()
this.judgeadmin()
this.c()
}
}
</script>
......
......@@ -1037,7 +1037,7 @@ import Router from 'vue-router';
},
// 跳转到面试管理
tointerview(){
this.$router.push('/interview')
this.$router.push({name:'interview',params:{fromInterview:true}})
},
// 刷新列表
pushlist(){
......
......@@ -179,7 +179,7 @@ import {getuploadNumber,uploadfile,serchList,serchRESUMEdetail,deleteREsumeUPLOa
import {
sapi
} from '../../config/env.config'
import ajax from '../../service/ajax'
import {uploadFile} from '../../service/ajax'
export default {
data () {
return {
......@@ -289,7 +289,7 @@ import ajax from '../../service/ajax'
return
}
this.uploadModal = true
ajax({
uploadFile({
headers: this.headers,
data: this.dataList,
batchNum: this.batchNum,
......@@ -298,7 +298,9 @@ import ajax from '../../service/ajax'
appendName: 'batchNum',
appendFile: 'recFile',
onProgress: e => {
setTimeout(() => {
this.handleProgress(e);
}, 200)
},
onSuccess: res => {
this.handleSuccess(res, this.files);
......@@ -320,18 +322,18 @@ import ajax from '../../service/ajax'
let data = res.body
for(let key in data){
let code = data[key].code
if (code == '900') {
this.$Notice.error({render:(h) => {return h('div', {style: {
paddingRight: '10px',
fontSize: '14px',
color: '#17233d'
}}, '您的账号已在其他地方登录,如不是您个人操作,请及时修改密码')}})
this.$router.replace({name: 'login'})
}
if (code == '902') {
Notice.error({title:'cookie已失效,请重新登录'})
this.$router.replace({name: 'login'})
}
// if (code == '900') {
// this.$Notice.error({render:(h) => {return h('div', {style: {
// paddingRight: '10px',
// fontSize: '14px',
// color: '#17233d'
// }}, '您的账号已在其他地方登录,如不是您个人操作,请及时修改密码')}})
// this.$router.replace({name: 'login'})
// }
// if (code == '902') {
// Notice.error({title:'cookie已失效,请重新登录'})
// this.$router.replace({name: 'login'})
// }
this.Code=data[key].code
this.Massage=data[key].message
this.dataList.map(item => {
......
// https://github.com/ElemeFE/element/blob/dev/packages/upload/src/ajax.js
import axios from './http.service.js'
function getError(action, option, xhr) {
const msg = `fail to post ${action} ${xhr.status}'`;
const err = new Error(msg);
......@@ -21,7 +21,29 @@ function getBody(xhr) {
return text;
}
}
export function uploadFile (option) {
const action = option.action;
const formData = new FormData();
if (option.data) {
option.data.map(item => {
formData.append(option.appendFile, item.data)
})
}
formData.append(option.appendName, option.batchNum);
axios.post(action, formData, {
onUploadProgress: function(progressEvent){
if (progressEvent.total > 0) {
progressEvent.percent = (progressEvent.loaded / progressEvent.total * 100);
}
option.onProgress(progressEvent);
}
}).then((res) => {
option.onSuccess(res.data)
}).catch((error) => {
option.onError(error)
})
}
export default function upload(option) {
if (typeof XMLHttpRequest === 'undefined') {
return;
......@@ -33,7 +55,7 @@ export default function upload(option) {
if (xhr.upload) {
xhr.upload.onprogress = function progress(e) {
if (e.total > 0) {
e.percent = e.loaded / e.total * 100;
e.percent = (e.loaded / e.total * 100 -10 );
}
option.onProgress(e);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment