完善店铺游戏设置的权限
This commit is contained in:
parent
736614cae9
commit
3ee310513b
@ -24,6 +24,7 @@
|
|||||||
name="shop"
|
name="shop"
|
||||||
required
|
required
|
||||||
class="w100"
|
class="w100"
|
||||||
|
v-if="userLevel === 1"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in allDepts"
|
v-for="item in allDepts"
|
||||||
@ -71,6 +72,8 @@ import { Component, Vue, Watch } from 'vue-property-decorator'
|
|||||||
import { getGames, IGameData } from '@/api/game'
|
import { getGames, IGameData } from '@/api/game'
|
||||||
import Sticky from '@/components/Sticky/index.vue'
|
import Sticky from '@/components/Sticky/index.vue'
|
||||||
import { getShopGameInfo, getShops, saveShopGameInfo } from '@/api/shop'
|
import { getShopGameInfo, getShops, saveShopGameInfo } from '@/api/shop'
|
||||||
|
import { checkPermission } from '@/utils/permission'
|
||||||
|
import { UserModule } from '@/store/modules/user'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
name: 'GameSetting',
|
name: 'GameSetting',
|
||||||
@ -98,9 +101,17 @@ export default class extends Vue {
|
|||||||
hasVersion: 1
|
hasVersion: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get userLevel() {
|
||||||
|
return UserModule.level
|
||||||
|
}
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
await this.getList()
|
await this.getList()
|
||||||
await this.getRemoteDeptList('')
|
if (UserModule.level === 1) {
|
||||||
|
await this.getRemoteDeptList('')
|
||||||
|
} else {
|
||||||
|
this.shop = UserModule.department
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('shop')
|
@Watch('shop')
|
||||||
@ -152,6 +163,9 @@ export default class extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async getRemoteDeptList(name: string) {
|
private async getRemoteDeptList(name: string) {
|
||||||
|
if (UserModule.level > 1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const { data } = await getShops({ key: name })
|
const { data } = await getShops({ key: name })
|
||||||
if (!data.records) return
|
if (!data.records) return
|
||||||
this.allDepts = data.records
|
this.allDepts = data.records
|
||||||
|
Loading…
x
Reference in New Issue
Block a user