|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="container-box">
|
|
|
- <div class="control-btn">
|
|
|
+ <div class="control-btn" v-if="hasPermisson()">
|
|
|
<div class="btn" :class="{ 'btn-active': activeName === 'default' }" @click="activeName = 'default'">默认数据</div>
|
|
|
<div class="btn" :class="{ 'btn-active': activeName === 'show' }" @click="activeName = 'show'">展示数据</div>
|
|
|
</div>
|
|
|
@@ -10,12 +10,24 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref } from 'vue';
|
|
|
+import { onMounted, ref } from 'vue';
|
|
|
import Default from './components/default/Default.vue';
|
|
|
import Show from './components/show/Show.vue';
|
|
|
+import { useUserStore } from '@/store/modules/user';
|
|
|
+
|
|
|
+const userStore = useUserStore();
|
|
|
+// const userInfo: object = userStore.getUserInfo || {};
|
|
|
|
|
|
const activeName = ref('default');
|
|
|
|
|
|
+const hasPermisson = () => {
|
|
|
+ return userStore.checkPermission("question_mock_edit_admin");
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ hasPermisson();
|
|
|
+})
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|