Commit 73a12a59 authored by chenqikuai's avatar chenqikuai

feat: 新增同级操作权限

parent de34a83b
......@@ -8,10 +8,10 @@
>
<a-select
class="header-select-item mx-3 my-2"
@change="value => handleSelectChange(value, index)"
@change="(value) => handleSelectChange(value, index)"
:placeholder="item.placeholder"
:value="item.value"
:disabled="index + 1 + 1 <= userLevel ? true : item.disable"
:disabled="item.disable"
>
<a-select-option :value="option.ID" :key="option.ID" v-for="option in item.options">{{
option.Name
......@@ -56,7 +56,6 @@ export default Vue.extend({
const baseList = [...this.fooList]
baseList[index].value = value
const newList = baseList.map((i, idx) => {
idx > index && console.log(i)
return {
...i,
options: idx > index ? [] : i.options,
......@@ -99,7 +98,7 @@ export default Vue.extend({
this.setFooList(newList)
},
resetList() {
const list = this.fooList.map(i => {
const list = this.fooList.map((i) => {
return {
...i,
disable: false,
......
<template>
<!-- 新增弹窗 -->
<a-modal v-model="show" :title="title" :centered="true" footer="" :level="level">
<a-modal
v-model="show"
:title="title"
:centered="true"
footer=""
:level="level"
width="600px"
:after-close="afterClose"
>
<a-form-model
:model="form"
:label-col="{ span: 8 }"
......@@ -47,8 +55,15 @@
</a-form-model-item>
<a-form-model-item label="岗位角色" v-show="modalMode === eAddManagerModalMode.create">
<span class="text-sm text-black mr-2">{{ theRole }}</span>
<!-- <a-switch @change="onChange" v-show="isManager" /> -->
<!-- <span class="ml-2" v-show="isManager">可对同级管理员进行管理调配</span> -->
<a-switch
v-model="form.same_level"
v-show="newRole === eNewRoleRelatedToBackEnd.BackAdmin && isManager"
/>
<span
class="ml-2 text-xs whitespace-nowrap"
v-show="newRole === eNewRoleRelatedToBackEnd.BackAdmin && isManager"
>可对同级管理员进行管理调配</span
>
</a-form-model-item>
<a-form-model-item label="用户所在机构层级">
<span class="text-sm text-black">{{ searchLevel | filterLevel }}</span>
......@@ -128,6 +143,8 @@ import { fooList } from '@/components/HeaderSelect2/const'
import StaffService from '@/service/StaffService'
import AddressService from '@/service/AddressService'
import { phonePattern } from '@/const/pattern/index'
import { getUserMsg } from '@/utils/userMsg/userMsg'
import { eNewRoleRelatedToBackEnd } from '@/types/role'
Vue.use(Switch)
......@@ -136,6 +153,9 @@ export default Vue.extend({
HeaderSelect,
},
computed: {
newRole() {
return getUserMsg()?.newRole
},
formRules() {
const rules: any = {
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
......@@ -179,8 +199,6 @@ export default Vue.extend({
delete rules.tel
}
console.log(rules)
return rules
},
levelOptions() {
......@@ -263,11 +281,16 @@ export default Vue.extend({
fooProp2: undefined as number | undefined,
fooProp3: undefined as number | undefined,
level: eLevel.firstLevel_branch,
same_level: false,
},
outletName: '',
eNewRoleRelatedToBackEnd,
}
},
methods: {
afterClose() {
this.form.same_level = false
},
handleLevelChange(value: any) {
this.form.level = value
},
......@@ -283,9 +306,11 @@ export default Vue.extend({
this.fooList = list
let branchDetailMsg: iBranchDetailMsg = undefined as unknown as iBranchDetailMsg
if (this.modalMode === eAddManagerModalMode.create) {
console.log(this.branchDetailMsg, 'show this.branchDetailMsg')
branchDetailMsg = this.branchDetailMsg
} else if (this.modalMode === eAddManagerModalMode.edit) {
branchDetailMsg = this.personalMsg.branchDetailMsg
console.log(this.personalMsg.branchDetailMsg, 'show this.personalMsg.branchDetailMsg')
this.form.level = this.level
this.form.name = this.personalMsg.name
}
......@@ -347,9 +372,17 @@ export default Vue.extend({
if (this.modalMode === eAddManagerModalMode.edit) {
await fetchOptionListForEverySettledBranchEdit(this.fooList)
}
/* 调配时 设置disable,限制可选的范围*/
if (this.modalMode === eAddManagerModalMode.edit) {
this.fooList.map((foo, index) => {
if (index + 1 + 1 <= this.searchLevel2) {
foo.disable = true
}
})
}
this.fooList = [...this.fooList]
await this.fetchNextOptions()
console.log(this.fooList, 'show foolist')
},
async fetchNextOptions() {
const fooIndex = this.fooList.findIndex((item) => item.value === undefined)
......@@ -397,9 +430,9 @@ export default Vue.extend({
},
createManager() {
StaffService.getInstance()
.addNextLevel({
.addManagement({
attr: {
add_same_level: false,
privilege: this.form.same_level || false,
},
level: this.searchLevel,
name: this.form.name,
......@@ -417,7 +450,7 @@ export default Vue.extend({
StaffService.getInstance()
.addAcm({
attr: {
add_same_level: false,
privilege: false,
},
level: this.searchLevel,
name: this.form.name,
......
......@@ -52,7 +52,7 @@
<a @click="getSecondarySubClientList(record)">查看</a>
</span>
<!-- 操作 -->
<p slot="action" slot-scope="text, record">
<div slot="action" slot-scope="text, record" class="whitespace-nowrap">
<span
v-if="
record.status === tableStatus.disable_notOnPosition ||
......@@ -107,7 +107,16 @@
<a-divider type="vertical" />
<a @click="inJob(record.uuid)">在岗</a>
</span>
</p>
<div v-if="newRole === eNewRoleRelatedToBackEnd.BackAdmin && isManagement(role)">
同级操作权限:
<a-switch
:checked="record.attr.privilege"
checked-children="开"
un-checked-children="关"
@change="sameLevelRoleChange(record.uuid, $event)"
></a-switch>
</div>
</div>
</a-table>
<!-- 操作Modal -->
<a-modal
......@@ -128,7 +137,7 @@ import Vue, { PropType } from 'vue'
import { firstLevelManager } from '@/mock/index'
import { staff, iStaffQueryResItem } from '@/types/staff'
import { eUserStatusAction, eUserStatus } from '@/types/user'
import { eRole, eNewRoleRelatedToBackEnd } from '@/types/role'
import { eRole, eNewRoleRelatedToBackEnd, isManagement } from '@/types/role'
import { eLevel } from '@/types/level'
import { getColumns } from '@/const/columns/userManagerCol'
import { userModal } from './const'
......@@ -138,7 +147,7 @@ import { mapActions, mapMutations, mapState } from 'vuex'
import StaffService from '@/service/StaffService'
import { message } from 'ant-design-vue'
import { eAddManagerModalMode, eTypeOfOperatedObject } from '@/store/UserManagement/types'
import LiveService from '@/service/LiveService'
import { getUserMsg } from '@/utils/userMsg/userMsg'
const staff = new StaffService()
......@@ -175,10 +184,14 @@ export default Vue.extend({
id: '',
params: {} as any,
currentRecord: {} as iStaffQueryResItem,
eNewRoleRelatedToBackEnd,
eRole,
}
},
computed: {
newRole() {
return getUserMsg()?.newRole
},
firstLevelManager(): Array<staff> {
return firstLevelManager
},
......@@ -192,6 +205,7 @@ export default Vue.extend({
total: this.$store.state.platformUserManagement.total,
}
},
dataSource() {
return this.$store.state.platformUserManagement.list
},
......@@ -206,6 +220,18 @@ export default Vue.extend({
} as any),
},
methods: {
isManagement,
async sameLevelRoleChange(uuid: string, checked: boolean) {
// console.log(uuid, checked)
await StaffService.getInstance().switchSameLevelPrivilege({
same_level: checked,
uuid,
})
this.platformSave({
page: 1,
})
this.getLists()
},
...mapMutations('platformUserManagement', {
platformSave: 'save',
}),
......@@ -275,11 +301,12 @@ export default Vue.extend({
name: string
value: number
}[]
const role =
this.$route.query.role === eNewRoleRelatedToBackEnd.ACM
? eTypeOfOperatedObject.clientManager
: eTypeOfOperatedObject.manager
console.log(this.level, 'show level')
// console.log(this.level, 'show level')
this.$store.commit('UserManagement/save', {
modalMode: eAddManagerModalMode.edit,
......@@ -287,9 +314,8 @@ export default Vue.extend({
searchLevel: this.level,
searchLevel2: rankVal.length,
branchDetailMsg: {
//
fb: rankVal[0].name,
fb_id: rankVal[0].value,
fb: (rankVal[0] && rankVal[0].name) || undefined,
fb_id: (rankVal[0] && rankVal[0].value) || undefined,
sb: (rankVal[1] && rankVal[1].name) || undefined,
sb_id: (rankVal[1] && rankVal[1].value) || undefined,
fsb: (rankVal[2] && rankVal[2].name) || undefined,
......@@ -380,6 +406,9 @@ export default Vue.extend({
.then((res) => {
if (res.code === 200) {
message.success('操作成功')
this.platformSave({
page: 1,
})
this.getLists()
}
})
......@@ -397,6 +426,9 @@ export default Vue.extend({
StaffService.getInstance()
.deleteStaff(this.id)
.then(() => {
this.platformSave({
page: 1,
})
this.getLists()
})
}
......@@ -544,8 +576,8 @@ export default Vue.extend({
// this.$refresh()
},
tableLoading(n) {
console.log(n, 'loading')
console.log('---------------===============')
// console.log(n, 'loading')
// console.log('---------------===============')
},
},
})
......
import { eRole } from '@/types/role'
import StaffService from '@/service/StaffService'
import { eNewRoleRelatedToBackEnd, eRole } from '@/types/role'
import RouterUtil from '@/utils/router'
import { getOldRoleFromUserMsg } from '@/utils/user'
import { getUserMsg } from '@/utils/userMsg/userMsg'
import { menuList } from '@/views/Root/getMenuList'
......@@ -72,20 +74,20 @@ function getRedirectRouteName() {
}
}
router.beforeEach((to, from, next) => {
console.log({ from, to })
router.beforeEach(async (to, from, next) => {
// console.log({ from, to })
const redirectRouteName = getRedirectRouteName()
const usermsg = getUserMsg()
if (usermsg === undefined) {
/* 没登录 */
/* 没登录 */
if (redirectRouteName === undefined) {
if (to.name == 'adminLogin' || to.name == 'login') {
console.log(1)
// console.log(1)
next()
} else {
console.log(2)
// console.log(2)
next({
name: 'login',
})
......@@ -93,7 +95,7 @@ router.beforeEach((to, from, next) => {
} else {
if (to.name === redirectRouteName) {
next()
console.log(1)
// console.log(1)
} else {
next({
name: redirectRouteName,
......@@ -101,15 +103,37 @@ router.beforeEach((to, from, next) => {
}
}
} else {
console.log(3)
/* 登录 */
// console.log(3)
/* 登录 */
const roles = (to.meta as { roles?: eRole[] }).roles
const oldRole = getOldRoleFromUserMsg(usermsg)
console.log(oldRole, roles, oldRole && roles && roles.includes(oldRole))
// console.log(oldRole, roles, oldRole && roles && roles.includes(oldRole))
const userHasRoleInCurPage =
oldRole !== undefined && roles !== undefined && roles.includes(oldRole)
if (userHasRoleInCurPage) {
console.log(4)
// console.log(4)
next()
} else {
const isManagerUser = usermsg.newRole === eNewRoleRelatedToBackEnd.Management
const gotoSeeSameLevel = RouterUtil.getInstance().isGotoSeeSameLevelStaff(
usermsg.level,
to.path
)
// console.log(isManagerUser, gotoSeeSameLevel, 'isManagerUser , gotoSeeSameLevel')
const hasSameLevelRole = await (() => {
if (isManagerUser && gotoSeeSameLevel) {
return StaffService.getInstance()
.getAttr()
.then((ret) => ret.code === 200 && !!ret.data.privilege)
} else {
return false
}
})()
// console.log(hasSameLevelRole, 'show hasSameLevelRole')
/* 如果当前用是管理员、而且是去查看同级管理员、并且有同级操作权限,则给用户展示要去的页面 */
if (isManagerUser && gotoSeeSameLevel && hasSameLevelRole) {
next()
} else {
if (oldRole == eRole.platform_management) {
......@@ -126,6 +150,7 @@ router.beforeEach((to, from, next) => {
}
}
}
}
})
export default router
......@@ -15,7 +15,7 @@ export default class StaffService {
addAcm(data: {
attr: {
add_same_level: boolean
privilege: boolean
}
level: number
name: string
......@@ -30,9 +30,9 @@ export default class StaffService {
})
}
addNextLevel(data: {
addManagement(data: {
attr: {
add_same_level: boolean
privilege: boolean
}
level: number
name: string
......@@ -41,24 +41,7 @@ export default class StaffService {
second_sub_branch: number
}) {
return baseAxios<{ data: any }>({
url: '/staff/add/next_level',
method: 'post',
data,
})
}
addSameLevel(data: {
attr: {
add_same_level: boolean
}
level: number
name: string
password: string
phone: string
second_sub_branch: number
}) {
return baseAxios<{ data: any }>({
url: '/staff/add/same_level',
url: '/staff/add/management',
method: 'post',
data,
})
......@@ -196,7 +179,7 @@ export default class StaffService {
getAttr() {
return baseAxios<{
add_same_level: boolean
privilege: boolean
live_broad: { day_type: number; time_section: string }
role: eNewRoleRelatedToBackEnd
}>({
......@@ -204,4 +187,12 @@ export default class StaffService {
method: 'get',
})
}
switchSameLevelPrivilege(data: { same_level: boolean; uuid: string }) {
return baseAxios({
url: '/staff/switchSameLevelPrivilege',
method: 'post',
data,
})
}
}
......@@ -10,7 +10,7 @@ const baseAxios = axios.create({
baseAxios.interceptors.response.use(
(value: AxiosResponse<iRet>) => {
const ret = value.data
if (ret.code === 3000 || ret.code === 507) {
if (ret.code === 3000) {
// 这里是要做什么来着
} else if (ret.code !== undefined && ret.code !== 200) {
if ([504, 503, 1008].includes(ret.code)) {
......
......@@ -32,11 +32,15 @@ export default <Module<iUserManagementState, unknown>>{
address: '',
},
address: '',
sameLevelRoleOfManager: false,
},
mutations: {
save(state, payload) {
Object.assign(state, payload)
},
setSameLevelRoleOfManager(state, have) {
state.sameLevelRoleOfManager = have
},
},
actions: {
async initFooList(
......
......@@ -40,4 +40,5 @@ export interface iUserManagementState {
personalMsg: iPersonalMsg /* 调配人员时 该人员的个人信息 */
address: string /* 新地址 */
refreshMark: number /* 供表格刷新的标记,组件监听refreshMark,若变化,则刷新表格 */
sameLevelRoleOfManager: boolean /* 管理员是否有同级操作权限 */
}
......@@ -51,7 +51,7 @@ export default <Module<iPlatformModuleState, unknown>>{
},
async queryUser({ state, commit }) {
state.loading = true
console.log(state)
// console.log(state)
StaffService.getInstance()
.queryStaff({
end: state.end,
......@@ -74,6 +74,11 @@ export default <Module<iPlatformModuleState, unknown>>{
list: res.data.item,
total: res.data.total,
})
} else {
commit('save', {
list: [],
total: 0,
})
}
state.loading = false
})
......
......@@ -19,9 +19,11 @@ export enum eNewRoleRelatedToBackEnd {
PlatformAdmin = '平台管理员',
}
// export function getRole(level:number,role:number,userType?:number):eRole{
// let userrole: eRole
// if( level == 1 && role == )
// return userrole
// }
export function isManagement(role: eRole) {
return (
role === eRole.firstLevel_branch ||
role === eRole.secondary_branch ||
role === eRole.firstLevel_sub_branch ||
role === eRole.secondary_sub_branch
)
}
import router from '@/router'
import { eLevel } from '@/types/level'
import { eNewRoleRelatedToBackEnd } from '@/types/role'
export default class RouterUtil {
......@@ -42,4 +43,13 @@ export default class RouterUtil {
ssb_id: (rankVal[3] && rankVal[3].value && Number(rankVal[3].value)) || undefined,
}
}
isGotoSeeSameLevelStaff(level: eLevel, path: string) {
return (
(level === 1 && path === '/backend/user/firstLevel') ||
(level === 2 && path === '/backend/user/secondary') ||
(level === 3 && path === '/backend/user/firstSub') ||
(level === 4 && path === '/backend/user/secondarySub')
)
}
}
......@@ -16,9 +16,7 @@
<!-- 数据源 -->
<span>数据:</span>
<a-radio-group @change="handleChangeSource" v-model="chartType">
<a-radio-button :value="eBarChart.not_login_dau">
全局日活
</a-radio-button>
<a-radio-button :value="eBarChart.not_login_dau"> 全局日活 </a-radio-button>
<a-radio-button :value="eBarChart.login_dau"> 注册日活 </a-radio-button>
</a-radio-group>
<!-- 日期范围 -->
......@@ -31,15 +29,7 @@
<div
v-show="isEmpty"
style="width: 1100px; line-height: 384px"
class="
emptyContainer
h-96
mx-auto
text-center text-xl
font-semibold
mb-5
mt-5
"
class="emptyContainer h-96 mx-auto text-center text-xl font-semibold mb-5 mt-5"
>
暂无数据
</div>
......@@ -60,9 +50,7 @@ import * as echarts from 'echarts'
import { eBarChart } from './const'
import DashboardService from '@/service/DashboardService/index'
import { formatDate } from '@/utils/time/transfer'
Vue.use(Row)
.use(Col)
.use(Radio)
Vue.use(Row).use(Col).use(Radio)
export default Vue.extend({
components: {
......@@ -166,12 +154,12 @@ export default Vue.extend({
this.option.xAxis.data = []
this.isEmpty = ret.data.length == 0 ? true : false
if (!this.isEmpty) {
ret.data.map(data => {
ret.data.map((data) => {
// 真实数据
this.option.series[0].data.push(data.value)
this.option.xAxis.data.push(formatDate(data.time * 1000))
})
console.log('y', this.option.series[0].data, 'x', this.option.xAxis.data)
// console.log('y', this.option.series[0].data, 'x', this.option.xAxis.data)
}
}
},
......
......@@ -4,7 +4,7 @@
v-for="(item, index) in fooList"
:key="index"
class="header-select-item mx-3 my-2"
@change="value => handleSelectChange(value, index)"
@change="(value) => handleSelectChange(value, index)"
:placeholder="item.placeholder"
:value="item.value"
:disabled="item.disable"
......@@ -26,6 +26,7 @@ import { fooList } from './const'
import Vue, { PropType } from 'vue'
import { iOutLet } from '@/service/StaffService/types'
import { getUserMsg } from '@/utils/userMsg/userMsg'
export default Vue.extend({
props: {
......@@ -46,7 +47,7 @@ export default Vue.extend({
handleSelectChange(value: number, index: number) {
this.fooList[index].value = value
const newList = this.fooList.map((i, idx) => {
idx > index && console.log(i)
// idx > index && console.log(i)
return {
...i,
options: idx > index ? [] : i.options,
......@@ -87,7 +88,7 @@ export default Vue.extend({
this.setFooList(newList)
},
resetList() {
const list = this.fooList.map(i => {
const list = this.fooList.map((i) => {
return {
...i,
disable: false,
......@@ -100,17 +101,20 @@ export default Vue.extend({
async init() {
const selfOutLet = await getSelfOutLet()
this.resetList()
this.$nextTick(() => {
this.$nextTick(async () => {
if (this.role === eNewRoleRelatedToBackEnd.BackAdmin) {
this.initBackAdmin(selfOutLet)
} else if (this.level === eLevel.firstLevel_branch) {
this.init_firstLevel(selfOutLet)
} else {
const hasSameLevelRole = await this.getRoleOFSameLevel()
if (this.level === eLevel.firstLevel_branch) {
this.init_firstLevel(selfOutLet, hasSameLevelRole)
} else if (this.level === eLevel.secondary_branch) {
this.init_secondLevel(selfOutLet)
this.init_secondLevel(selfOutLet, hasSameLevelRole)
} else if (this.level === eLevel.firstLevel_sub_branch) {
this.init_first_sub_Level(selfOutLet)
this.init_first_sub_Level(selfOutLet, hasSameLevelRole)
} else if (this.level === eLevel.secondary_sub_branch) {
this.init_second_sub_Level(selfOutLet)
this.init_second_sub_Level(selfOutLet, hasSameLevelRole)
}
}
})
},
......@@ -130,55 +134,78 @@ export default Vue.extend({
this.setFooList(newList)
}
},
async init_firstLevel(selfOutLet: iOutLet) {
async init_firstLevel(selfOutLet: iOutLet, sameLevelRole: boolean) {
const { fid, first_branch, sid, second_branch } = selfOutLet
const list = this.initFooListBasicValues(selfOutLet, eLevel.firstLevel_branch)
const list = await this.initFooListBasicValues(
selfOutLet,
eLevel.firstLevel_branch,
sameLevelRole
)
this.setFooList(list)
const ret = await StaffService.getInstance().getBranch({
level: eLevel.secondary_branch,
level: sameLevelRole ? eLevel.firstLevel_branch : eLevel.secondary_branch,
page_size: 300,
parent_id: sid,
parent_id: sameLevelRole ? undefined : fid,
})
if (ret.code === 200) {
this.fooList[1].options = ret.data.item
this.fooList[sameLevelRole ? 0 : 1].options = ret.data.item
}
this.setFooList(this.fooList)
},
async init_secondLevel(selfOutLet: iOutLet) {
async init_secondLevel(selfOutLet: iOutLet, sameLevelRole: boolean) {
const { fid, first_branch, sid, second_branch } = selfOutLet
const list = this.initFooListBasicValues(selfOutLet, eLevel.secondary_branch)
const list = await this.initFooListBasicValues(
selfOutLet,
eLevel.secondary_branch,
sameLevelRole
)
this.setFooList(list)
const ret = await StaffService.getInstance().getBranch({
level: eLevel.firstLevel_sub_branch,
level: sameLevelRole ? eLevel.secondary_branch : eLevel.firstLevel_sub_branch,
page_size: 300,
parent_id: sid,
parent_id: sameLevelRole ? fid : sid,
})
if (ret.code === 200) {
this.fooList[2].options = ret.data.item
this.fooList[sameLevelRole ? 1 : 2].options = ret.data.item
}
this.setFooList(this.fooList)
},
async init_first_sub_Level(selfOutLet: iOutLet) {
async init_first_sub_Level(selfOutLet: iOutLet, sameLevelRole: boolean) {
const { fid, first_branch, sid, second_branch, fs_id, first_sub_branch } = selfOutLet
const list = this.initFooListBasicValues(selfOutLet, eLevel.firstLevel_sub_branch)
const list = await this.initFooListBasicValues(
selfOutLet,
eLevel.firstLevel_sub_branch,
sameLevelRole
)
this.setFooList(list)
const ret = await StaffService.getInstance().getBranch({
level: eLevel.secondary_sub_branch,
page_size: 1000,
parent_id: fs_id,
level: sameLevelRole ? eLevel.firstLevel_sub_branch : eLevel.secondary_sub_branch,
page_size: 300,
parent_id: sameLevelRole ? sid : fs_id,
})
if (ret.code === 200) {
this.fooList[3].options = ret.data.item
this.fooList[sameLevelRole ? 2 : 3].options = ret.data.item
}
this.setFooList(this.fooList)
},
init_second_sub_Level(selfOutLet: iOutLet) {
this.initFooListBasicValues(selfOutLet, eLevel.secondary_sub_branch)
async init_second_sub_Level(selfOutLet: iOutLet, sameLevelRole: boolean) {
await this.initFooListBasicValues(selfOutLet, eLevel.secondary_sub_branch, sameLevelRole)
this.$nextTick(() => {
this.setFooList(this.fooList)
})
},
initFooListBasicValues(selfOutLet: iOutLet, level: eLevel) {
async getRoleOFSameLevel() {
let hasSameLevelRole = false
if (getUserMsg()?.newRole === eNewRoleRelatedToBackEnd.Management) {
const attrRet = await StaffService.getInstance().getAttr()
if (attrRet.code === 200) {
hasSameLevelRole = attrRet.data.privilege
}
}
this.$store.commit('UserManagement/setSameLevelRoleOfManager', hasSameLevelRole)
return hasSameLevelRole
},
async initFooListBasicValues(selfOutLet: iOutLet, level: eLevel, sameLevelRole: boolean) {
let list = this.fooList
const {
fid,
......@@ -224,6 +251,10 @@ export default Vue.extend({
list[3].options = [{ ID: ss_id, Name: second_sub_branch }]
list[3].disable = true
}
if (sameLevelRole) {
list[level - 1].disable = false
list[level - 1].value = undefined
}
return list
},
popupScroll1(e: Event) {
......
......@@ -50,7 +50,11 @@
:loading="loading"
>导入</a-button
>
<a-button type="primary" style="margin-right: 10px" @click="clickDownloadTemplate"
<a-button
type="primary"
v-if="isBackAdmin"
style="margin-right: 10px"
@click="clickDownloadTemplate"
>模板下载</a-button
>
<input
......@@ -145,7 +149,6 @@ export default Vue.extend({
}
},
mounted() {
console.log('foolish', this.fooList)
this.clearPostion()
},
methods: {
......@@ -204,7 +207,6 @@ export default Vue.extend({
},
setFooList(v: any[]) {
this.fooList = [...v]
// this.setLevel(v)
},
async getBranchList() {
const userLevel = getUserMsg()?.level
......@@ -215,8 +217,6 @@ export default Vue.extend({
page: 5,
page_size: PAGE_SIZE,
})
console.log(ret)
},
query() {
const levelList = []
......@@ -233,20 +233,7 @@ export default Vue.extend({
break
}
}
if (levelList.length == 0) {
this.$message.info({
content: '请先选择相应分区',
icon: () => {
return this.$createElement('Icon', {
style: { color: '#3E4FAF' },
props: { type: 'exclamation-circle' },
})
},
})
// this.$message.info({content:"请通过选择或者输入详细地址搜索",icon:()=>{return this.$createElement('Icon',{style:{color:'#3E4FAF'},props:{type:'exclamation-circle'}})}})
} else {
this.selectTables(levelList)
}
},
getRoles(path: string) {
const _path = '/backend/user' + path
......@@ -259,7 +246,7 @@ export default Vue.extend({
return roles
},
async checkPermission(path: string) {
console.log('in checkPermission')
// console.log('in checkPermission')
// 获取跳转路由的权限列表
const roles = this.getRoles(path)
......@@ -285,7 +272,7 @@ export default Vue.extend({
this.queryLoading = true
const ret = await StaffService.getInstance().getAttr()
this.queryLoading = false
return ret.code === 200 && ret.data.add_same_level
return ret.code === 200 && ret.data.privilege
} else {
return false
}
......@@ -297,7 +284,7 @@ export default Vue.extend({
const basePath = '/backend/user'
// 判断账户权限
const permission = await this.checkPermission(_path)
console.log(permission, 'show permission')
// console.log(permission, 'show permission')
if (!permission) {
message.error('当前账号无此权限')
......@@ -306,6 +293,23 @@ export default Vue.extend({
}
},
async selectTables(arr: Array<{ value: number; name: string }>) {
if (
arr.length === 0 &&
this.role === eNewRoleRelatedToBackEnd.Management &&
!this.$store.state.UserManagement.sameLevelRoleOfManager
) {
this.$message.info({
content: '请先选择相应分区',
icon: () => {
return this.$createElement('Icon', {
style: { color: '#3E4FAF' },
props: { type: 'exclamation-circle' },
})
},
})
return
}
const query = {
rankVal: JSON.stringify(arr),
role: this.search,
......@@ -348,8 +352,8 @@ export default Vue.extend({
},
reset() {
;(this.$refs.headerSelect as any).init()
this.search = eNewRoleRelatedToBackEnd.Management
this.type = bank['一级分行']
this.search = eNewRoleRelatedToBackEnd.ACM
this.type = bank['二级支行']
},
},
})
......
......@@ -4,7 +4,7 @@
<a-layout-header>
<div class="flex justify-between items-center h-full">
<div class="text-center text-lg my-3 flex font-semibold">
<img src="../../assets/org_logo.png" class=" w-7 h-7 mr-2" />
<img src="../../assets/org_logo.png" class="w-7 h-7 mr-2" />
浙江省中小企业协会综合服务平台
</div>
<div>
......@@ -38,7 +38,7 @@
</div>
</a-layout-header>
<a-layout>
<a-layout-sider width="240" style="background: white; min-height:100vh">
<a-layout-sider width="240" style="background: white; min-height: 100vh">
<a-menu
style="width: 240px"
:open-keys.sync="openKeys"
......@@ -126,14 +126,14 @@ export default Vue.extend({
computed: {
role(): eRole | undefined {
const msg = getUserMsg()
return ((msg && getOldRoleFromUserMsg(msg)) as unknown) as eRole | undefined
return (msg && getOldRoleFromUserMsg(msg)) as unknown as eRole | undefined
},
menuList(): iMenuList {
// console.log(this.role, "show this.role");
return (this.role !== undefined && getMenuList(this.role)) || []
},
filteredMenuList(): iMenuList {
return this.menuList.filter(i => !i.hiddeInMenu)
return this.menuList.filter((i) => !i.hiddeInMenu)
},
selectedKeys(): Array<String> {
return [(this.$route.meta as { selectedName: string }).selectedName]
......@@ -141,7 +141,7 @@ export default Vue.extend({
phone() {
// let trip = JSON.parse(window.localStorage.getItem('userName')as any); //取
let name = localStorage.getItem('userName')
console.log(name, 'this name')
// console.log(name, 'this name')
return name
},
},
......@@ -178,11 +178,11 @@ export default Vue.extend({
},
handleClickMenu(e: { key: string; keyPath: string[] }) {
const list: iMenuItem[] = []
this.menuList.forEach(item => {
this.menuList.forEach((item) => {
const children = item.children
if (children && children.length !== 0) {
/* 有子菜单 */
children?.forEach(i => {
children?.forEach((i) => {
list.push(i)
})
} else {
......@@ -190,7 +190,7 @@ export default Vue.extend({
list.push(item)
}
})
const item = list.find(i => i.routeName === e.key)
const item = list.find((i) => i.routeName === e.key)
item &&
this.$router.push({
name: item.routeName,
......@@ -200,7 +200,7 @@ export default Vue.extend({
return menu.children && menu.children.length !== 0
},
logout() {
userService.logout().then(res => {
userService.logout().then((res) => {
if (res.code === 200) {
const role = getUserMsg()?.newRole
window.localStorage.clear()
......
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