studio.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div>
  3. <v-navigation-drawer
  4. v-model="drawer"
  5. app
  6. clipped
  7. >
  8. <router-link :to="`/user/${this.$store.state.userInfo.id}`">
  9. <v-row justify="center" align="center">
  10. <v-col cols="12" style="text-align: center">
  11. <v-avatar size="62">
  12. <v-img :src="this.$store.state.userInfo.avatarUrl" />
  13. </v-avatar>
  14. </v-col>
  15. </v-row>
  16. <v-row justify="center" align="center">
  17. <v-col cols="12" style="text-align: center">
  18. {{ this.$store.state.userInfo.username }}
  19. </v-col>
  20. </v-row>
  21. </router-link>
  22. <router-link v-for="item in items" :key="item.text" :to="item.link">
  23. <v-list-item
  24. link
  25. >
  26. <v-list-item-action>
  27. <v-icon>{{ item.icon }}</v-icon>
  28. </v-list-item-action>
  29. <v-list-item-content>
  30. <v-list-item-title>
  31. {{ item.text }}
  32. </v-list-item-title>
  33. </v-list-item-content>
  34. </v-list-item>
  35. </router-link>
  36. <v-divider />
  37. <div v-if="CheckPower.checkPower(this.$store.state.userInfo) == 'admin'">
  38. <router-link v-for="item in adminList" :key="item.text" :to="item.link">
  39. <v-list-item
  40. link
  41. >
  42. <v-list-item-action>
  43. <v-icon>{{ item.icon }}</v-icon>
  44. </v-list-item-action>
  45. <v-list-item-content>
  46. <v-list-item-title>
  47. {{ item.text }}
  48. </v-list-item-title>
  49. </v-list-item-content>
  50. </v-list-item>
  51. </router-link>
  52. </div>
  53. </v-navigation-drawer>
  54. <v-app-bar
  55. :clipped-left="$vuetify.breakpoint.lgAndUp"
  56. app
  57. color="red"
  58. dark
  59. >
  60. <v-app-bar-nav-icon @click.stop="drawer = !drawer" />
  61. <v-toolbar-title
  62. style="width: 300px"
  63. class="ml-0 pl-4"
  64. >
  65. <span class="hidden-sm-and-down">{{ this.$store.state.webInfo.name }} Studio 创作中心</span>
  66. </v-toolbar-title>
  67. <v-text-field
  68. flat
  69. solo-inverted
  70. hide-details
  71. prepend-inner-icon="mdi-magnify"
  72. label="搜索"
  73. class="hidden-sm-and-down"
  74. />
  75. <v-spacer />
  76. <v-tooltip bottom>
  77. <template v-slot:activator="{ on, attrs }">
  78. <v-btn
  79. icon
  80. v-bind="attrs"
  81. v-on="on"
  82. @click="goToPublish"
  83. >
  84. <v-icon>mdi-video-plus</v-icon>
  85. </v-btn>
  86. </template>
  87. <span>发布</span>
  88. </v-tooltip>
  89. <v-tooltip bottom>
  90. <template v-slot:activator="{ on, attrs }">
  91. <v-btn
  92. icon
  93. v-bind="attrs"
  94. v-on="on"
  95. >
  96. <v-icon>mdi-bell</v-icon>
  97. </v-btn>
  98. </template>
  99. <span>通知</span>
  100. </v-tooltip>
  101. <!-- 登陆后 -->
  102. <Head v-if="this.$store.state.userInfo" />
  103. <!-- 未登录 -->
  104. <v-btn
  105. v-if="this.$store.state.userInfo == null"
  106. outlined
  107. @click="goToLoginPage"
  108. >
  109. <v-icon left dark>mdi-account</v-icon> 登录
  110. </v-btn>
  111. </v-app-bar>
  112. <v-main>
  113. <router-view />
  114. </v-main>
  115. </div>
  116. </template>
  117. <script>
  118. import Head from '@/layout/components/head.vue'
  119. import CheckPower from '@/utils/check-power.vue'
  120. export default {
  121. components: {
  122. Head
  123. },
  124. data: () => ({
  125. CheckPower,
  126. drawer: true,
  127. items: [
  128. { icon: 'mdi-application', text: '信息中心', link: '/studio' },
  129. { icon: 'mdi-filmstrip-box-multiple', text: '投稿列表', link: '/studio/list' },
  130. { icon: 'mdi-upload', text: '投稿', link: '/studio/upload' },
  131. { icon: 'mdi-database', text: '数据分析', link: '/studio/data' },
  132. { icon: 'mdi-account-multiple', text: '粉丝管理', link: '/studio/fans' }
  133. // { icon: 'mdi-history', text: '历史记录', link: '/history' },
  134. // { icon: 'mdi-playlist-play', text: '稍后再看', link: '/playlist' }
  135. ],
  136. adminList: [
  137. { icon: 'mdi-application', text: '邀请码', link: '/studio/admin/invitation' },
  138. { icon: 'mdi-video', text: '待审核', link: '/studio/admin/examine' },
  139. { icon: 'mdi-filmstrip-box-multiple', text: '投稿列表', link: '/studio/admin/article/list' },
  140. { icon: 'mdi-file', text: '文件列表', link: '/studio/admin/file/list' },
  141. { icon: 'mdi-account-multiple', text: '用户列表', link: '/studio/admin/userlist' },
  142. { icon: 'mdi-square-edit-outline', text: '网页设置', link: '/studio/admin/websetting' },
  143. { icon: 'mdi-playlist-edit', text: '分类管理', link: '/studio/admin/category' }
  144. ]
  145. }),
  146. mounted() {
  147. },
  148. created() {
  149. this.$vuetify.theme.dark = this.$store.state.darkThemOpen
  150. },
  151. methods: {
  152. goToLoginPage() {
  153. this.$router.push('/login')
  154. },
  155. goToPublish() {
  156. if (this.$route.path === '/studio/upload') {
  157. return
  158. }
  159. this.$router.push('/studio/upload')
  160. },
  161. goToUserHome() {
  162. this.$router.push('/user/' + this.$store.state.userInfo.id)
  163. }
  164. }
  165. }
  166. </script>
  167. <style scoped>
  168. a {
  169. text-decoration: none;
  170. }
  171. </style>