Merge branch 'dev_product' of https://git.cloud.tencent.com/joylink/jl-nclient into dev_product

This commit is contained in:
fan 2019-10-10 13:56:50 +08:00
commit 697deaa887
3 changed files with 33 additions and 18 deletions

View File

@ -155,7 +155,7 @@
if (operate.selection && operate.selection.length) { if (operate.selection && operate.selection.length) {
operate.selection.forEach(elem => { operate.selection.forEach(elem => {
if (operate.commit) { if (operate.commit) {
this.updateTableValue(elem.code, { result: `${$t('menu.menuDialog.senedMessageOne')} ,${this.timeout} ${$t('menu.menuDialog.senedMessageTwo')}` }, false); this.updateTableValue(elem.code, { result: `${this.$t('menu.menuDialog.senedMessageOne')} ,${this.timeout} ${this.$t('menu.menuDialog.senedMessageTwo')}` }, false);
} else if (operate.cancel) { } else if (operate.cancel) {
this.updateTableValue(elem.code, { result: '' }, false); this.updateTableValue(elem.code, { result: '' }, false);
} }
@ -359,7 +359,7 @@
} }
this.selection.forEach((elem, index) => { this.selection.forEach((elem, index) => {
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`); operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
}); });
this.disabledSure = true; this.disabledSure = true;
@ -384,7 +384,7 @@
} }
this.selection.forEach((elem, index) => { this.selection.forEach((elem, index) => {
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`); operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
}); });
this.disabledSure = true; this.disabledSure = true;
@ -409,7 +409,7 @@
} }
this.selection.forEach((elem, index) => { this.selection.forEach((elem, index) => {
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`); operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
}); });
this.disabledSure = true; this.disabledSure = true;

View File

@ -154,7 +154,7 @@
childType: this.$t('menu.passiveDialog.childTypeTips'), childType: this.$t('menu.passiveDialog.childTypeTips'),
timeSummary: this.$t('menu.passiveDialog.controlModeSummary'), timeSummary: this.$t('menu.passiveDialog.controlModeSummary'),
recommendedOperation: '', recommendedOperation: '',
alarmDetail: `${$t('menu.passiveDialog.controlModeTransfer')} ${this.operate.name}${$t('menu.passiveDialog.alarmDetailOne')}${operate.currentMode == '01' ? this.$t('menu.passiveDialog.stationToCentral') : this.$t('menu.passiveDialog.centralToStation') }` alarmDetail: `${this.$t('menu.passiveDialog.controlModeTransfer')} ${this.operate.name}${this.$t('menu.passiveDialog.alarmDetailOne')}${operate.currentMode == '01' ? this.$t('menu.passiveDialog.stationToCentral') : this.$t('menu.passiveDialog.centralToStation') }`
} }
this.dialogShow = true; this.dialogShow = true;
this.$nextTick(function () { this.$nextTick(function () {

View File

@ -29,21 +29,37 @@ function hasPermission(roles, route, parentsRoles) {
if (route.meta && route.meta.roles) { if (route.meta && route.meta.roles) {
// 如果存在本级路由则使用自己的roles过滤 // 如果存在本级路由则使用自己的roles过滤
// debugger; // debugger;
if (getSessionStorage('design')) { // if (getSessionStorage('design')) {
if (route.meta.roles.indexOf(userDesign)===-1) { // if (route.meta.roles.indexOf(userDesign)===-1) {
route.hidden = true; // route.hidden = true;
} else { // } else {
if (!(route.meta.roles.indexOf(admin)>=0 && roles.indexOf(admin)>=0)) { // if ((route.meta.roles.indexOf(admin)>=0 && roles.indexOf(admin)>=0)) {
route.hidden = true; // route.hidden = false;
} // } else if (route.meta.roles.indexOf(user)>=0 && roles.indexOf(user)>=0) {
} // route.hidden = false;
// } else {
// route.hidden = true;
// }
// }
// } else {
// if (route.meta.roles.indexOf(userDesign)>0) {
// route.hidden = true;
// }
// }
// return roles.some(role => route.meta.roles.indexOf(role) >= 0);
if (getSessionStorage('design')) {
roles= roles.filter(function (role) {
return route.meta.roles.indexOf(role) >= 0;
});
const result=roles.every(role => route.meta.roles.indexOf(role) >= 0);
return result && ((roles.indexOf(admin)>=0 && route.meta.roles.indexOf(admin)>=0) || (roles.indexOf(user)>=0 && route.meta.roles.indexOf(user)>=0 ));
} else { } else {
if (route.meta.roles.indexOf(userDesign)>0) { roles= roles.filter(function (role) {
route.hidden = true; return route.meta.roles.indexOf(role) >= 0;
} });
return roles.some(role => route.meta.roles.indexOf(role) >= 0) && route.meta.roles.indexOf(userDesign)<0;
} }
return roles.some(role => route.meta.roles.indexOf(role) >= 0);
} else if (parentsRoles) { } else if (parentsRoles) {
// 如果没有本级路由,有父级路由,则使用父级路由过滤 // 如果没有本级路由,有父级路由,则使用父级路由过滤
return roles.some(role => parentsRoles.indexOf(role) >= 0); return roles.some(role => parentsRoles.indexOf(role) >= 0);
@ -107,7 +123,6 @@ const permission = {
// 生成其他权限路由 // 生成其他权限路由
GenerateRoutes({ commit }, data) { GenerateRoutes({ commit }, data) {
return new Promise(resolve => { return new Promise(resolve => {
// debugger;
const { roles } = convertRouterRoles(data); const { roles } = convertRouterRoles(data);
let accessedRouters; let accessedRouters;
// if (roles.indexOf(superAdmin) >= 0) { // if (roles.indexOf(superAdmin) >= 0) {