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

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

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