提交 dffcb0db authored 作者: matian's avatar matian

chore:后台管理和系统管理增加权限

上级 145c0912
<script setup lang="ts"> <script setup lang="ts">
import Sortable from 'sortablejs' import Sortable from 'sortablejs'
import type { MoveEvent, SortableEvent } from 'sortablejs' import type { MoveEvent, SortableEvent } from 'sortablejs'
import AddDialog from '../components/AddDialog.vue'
import { getCategoryList, delCategory, moveCategory } from '../api' import { getCategoryList, delCategory, moveCategory } from '../api'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { checkPermission } from '@/utils/permission'
import AddDialog from '../components/AddDialog.vue'
import AppList from '@/components/base/AppList.vue' import AppList from '@/components/base/AppList.vue'
const appList = $ref<null | InstanceType<typeof AppList>>(null) const appList = $ref<null | InstanceType<typeof AppList>>(null)
const prevCategoryName = ref('') const prevCategoryName = ref('')
...@@ -207,7 +207,7 @@ const rebuildData = (value: any, arr: any) => { ...@@ -207,7 +207,7 @@ const rebuildData = (value: any, arr: any) => {
} }
onMounted(() => { onMounted(() => {
useSortable() checkPermission('v1-backend-category-drag') && useSortable()
}) })
</script> </script>
<template> <template>
...@@ -222,11 +222,29 @@ onMounted(() => { ...@@ -222,11 +222,29 @@ onMounted(() => {
border border
stripe stripe
> >
<el-button type="primary" @click="handleAddCategory" style="margin-bottom: 20px">新增类别</el-button> <el-button
type="primary"
@click="handleAddCategory"
style="margin-bottom: 20px"
v-permission="'v1-backend-category-create'"
>新增类别</el-button
>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-link type="primary" style="margin-right: 5px" @click="handleEdit(row)">编辑</el-link> <el-link
<el-link type="primary" style="margin-right: 5px" @click="handleAddRow(row)">新增</el-link> type="primary"
<el-link type="primary" @click="handleDelete(row)">删除</el-link> style="margin-right: 5px"
@click="handleEdit(row)"
v-permission="'v1-backend-category-update'"
>编辑</el-link
>
<el-link
type="primary"
style="margin-right: 5px"
@click="handleAddRow(row)"
v-permission="'v1-backend-category-create'"
>新增</el-link
>
<el-link type="primary" @click="handleDelete(row)" v-permission="'v1-backend-category-delete'">删除</el-link>
</template> </template>
</AppList> </AppList>
</AppCard> </AppCard>
......
...@@ -78,7 +78,9 @@ const handleDetail = (row: any) => { ...@@ -78,7 +78,9 @@ const handleDetail = (row: any) => {
<AppCard title="讲师管理"> <AppCard title="讲师管理">
<AppList v-bind="listOptions" ref="appList" border stripe> <AppList v-bind="listOptions" ref="appList" border stripe>
<router-link to="/admin/teacher/add"> <router-link to="/admin/teacher/add">
<el-button type="primary" round style="margin-bottom: 20px">添加讲师</el-button> <el-button type="primary" round style="margin-bottom: 20px" v-permission="'v1-backend-lecturer-create'"
>添加讲师</el-button
>
</router-link> </router-link>
<template #header-aside> </template> <template #header-aside> </template>
<template #table-img="{ row }"> <template #table-img="{ row }">
...@@ -93,9 +95,15 @@ const handleDetail = (row: any) => { ...@@ -93,9 +95,15 @@ const handleDetail = (row: any) => {
/></template> /></template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-space> <el-space>
<el-link type="primary" plain @click="handleDetail(row)">查看</el-link> <el-link type="primary" plain @click="handleDetail(row)" v-permission="'v1-backend-lecturer-view'"
<el-link type="primary" plain @click="handleUpdate(row)">更新</el-link> >查看</el-link
<el-link type="primary" plain @click="handleDelete(row)">删除</el-link> >
<el-link type="primary" plain @click="handleUpdate(row)" v-permission="'v1-backend-lecturer-update'"
>更新</el-link
>
<el-link type="primary" plain @click="handleDelete(row)" v-permission="'v1-backend-lecturer-delete'"
>删除</el-link
>
</el-space> </el-space>
</template> </template>
</AppList> </AppList>
......
...@@ -85,7 +85,7 @@ const defaultProps = { ...@@ -85,7 +85,7 @@ const defaultProps = {
<el-icon class="video-head-icon" @click="isCard = !isCard"><Expand /></el-icon> <el-icon class="video-head-icon" @click="isCard = !isCard"><Expand /></el-icon>
</div> </div>
<div class="video-tool-btn"> <div class="video-tool-btn">
<router-link to="/resource/video/update"> <router-link to="/resource/video/update" v-permission="'v1-resource-video-create'">
<el-button type="primary" round>新建视频资源</el-button> <el-button type="primary" round>新建视频资源</el-button>
</router-link> </router-link>
</div> </div>
......
...@@ -75,7 +75,14 @@ const handleEdit = (row: any) => { ...@@ -75,7 +75,14 @@ const handleEdit = (row: any) => {
<AppCard title="封面管理"> <AppCard title="封面管理">
<AppList v-bind="listOptions" ref="appList" border stripe> <AppList v-bind="listOptions" ref="appList" border stripe>
<template #header-aside> </template> <template #header-aside> </template>
<el-button type="primary" round @click="handleAdd" style="margin-bottom: 20px">新增封面</el-button> <el-button
type="primary"
round
@click="handleAdd"
style="margin-bottom: 20px"
v-permission="'v1-backend-cover-create'"
>新增封面</el-button
>
<template #table-cover="{ row }"> <template #table-cover="{ row }">
<el-image <el-image
...@@ -89,8 +96,10 @@ const handleEdit = (row: any) => { ...@@ -89,8 +96,10 @@ const handleEdit = (row: any) => {
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-space> <el-space>
<el-link type="primary" plain @click="handleEdit(row)">编辑</el-link> <el-link type="primary" plain @click="handleEdit(row)" v-permission="'v1-backend-cover-update'">编辑</el-link>
<el-link type="primary" plain @click="handleDelete(row)">删除</el-link> <el-link type="primary" plain @click="handleDelete(row)" v-permission="'v1-backend-cover-delete'"
>删除</el-link
>
</el-space> </el-space>
</template> </template>
<template v-if="isShowDialog === true"> <template v-if="isShowDialog === true">
......
...@@ -100,7 +100,13 @@ const handleUpdate = () => { ...@@ -100,7 +100,13 @@ const handleUpdate = () => {
<AppCard title="数据字典"> <AppCard title="数据字典">
<AppList v-bind="listOptions" ref="appList" border stripe> <AppList v-bind="listOptions" ref="appList" border stripe>
<el-row> <el-row>
<el-button type="primary" @click="handleAdd" style="margin-bottom: 20px" v-permission="'test1'">新增字典</el-button> <el-button
type="primary"
@click="handleAdd"
style="margin-bottom: 20px"
v-permission="'v1-backend-data-dictionary-create'"
>新增字典</el-button
>
</el-row> </el-row>
<template v-slot:created_time_start="{ params }"> <template v-slot:created_time_start="{ params }">
<el-date-picker v-model="params.created_time_start" type="date" placeholder="开始时间"> </el-date-picker> <el-date-picker v-model="params.created_time_start" type="date" placeholder="开始时间"> </el-date-picker>
...@@ -111,9 +117,16 @@ const handleUpdate = () => { ...@@ -111,9 +117,16 @@ const handleUpdate = () => {
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-space> <el-space>
<el-link type="primary" plain @click="handleEdit(row)">编辑</el-link> <el-link type="primary" plain @click="handleEdit(row)" v-permission="'v1-backend-data-dictionary-update'"
<el-link type="primary" plain @click="handleList(row)">列表</el-link> >编辑</el-link
<el-link type="primary" plain @click="handleDelete(row)">删除</el-link> >
<el-link type="primary" plain @click="handleList(row)" v-permission="'v1-backend-data-dictionary-value-list'"
>列表</el-link
>
<el-link type="primary" plain @click="handleDelete(row)" v-permission="'v1-backend-data-dictionary-delete'"
>删除</el-link
>
</el-space> </el-space>
</template> </template>
<template v-if="isShowDialog === true"> <template v-if="isShowDialog === true">
......
...@@ -63,12 +63,26 @@ const handleUpdate = () => { ...@@ -63,12 +63,26 @@ const handleUpdate = () => {
<AppCard title="字典列表"> <AppCard title="字典列表">
<AppList v-bind="listOptions" ref="appList"> <AppList v-bind="listOptions" ref="appList">
<el-row> <el-row>
<el-button type="primary" @click="handleAdd">新增</el-button> <el-button type="primary" @click="handleAdd" v-permission="'v1-backend-data-dictionary-value-create'"
>新增</el-button
>
</el-row> </el-row>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-space> <el-space>
<el-link type="primary" plain @click="handleEdit(row)">编辑</el-link> <el-link
<el-link type="primary" plain @click="handleDelete(row)">删除</el-link> type="primary"
plain
@click="handleEdit(row)"
v-permission="'v1-backend-data-dictionary-value-update'"
>编辑</el-link
>
<el-link
type="primary"
plain
@click="handleDelete(row)"
v-permission="'v1-backend-data-dictionary-value-delete'"
>删除</el-link
>
</el-space> </el-space>
</template> </template>
</AppList> </AppList>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论