提交 4b374cd5 authored 作者: lihuihui's avatar lihuihui
...@@ -2,21 +2,30 @@ import type { IMenuItem } from '@/types' ...@@ -2,21 +2,30 @@ import type { IMenuItem } from '@/types'
import { VideoCamera, Suitcase, Collection, Files, Monitor, Edit, User, Filter, Coordinate, Notebook, Picture } from '@element-plus/icons-vue' import { VideoCamera, Suitcase, Collection, Files, Monitor, Edit, User, Filter, Coordinate, Notebook, Picture } from '@element-plus/icons-vue'
export const menus: IMenuItem[] = [ export const menus: IMenuItem[] = [
{ {
tag: 'v1-resource',
name: '资源管理', name: '资源管理',
path: '/resource', path: '/resource',
children: [ children: [
{ {
tag: 'v1-resource-video-list',
icon: VideoCamera, icon: VideoCamera,
name: '视频', name: '视频',
path: '/resource/video' path: '/resource/video'
}, },
{ icon: Suitcase, name: '课件', path: '/resource/courseware' },
{ {
tag: 'v1-resource-courseware-list',
icon: Suitcase,
name: '课件',
path: '/resource/courseware'
},
{
tag: 'v1-resource-lesson-plan-list',
icon: Collection, icon: Collection,
name: '教案', name: '教案',
path: '/resource/lessonplan' path: '/resource/lessonplan'
}, },
{ {
tag: 'v1-resource-other-information-list',
icon: Files, icon: Files,
name: '其他资料', name: '其他资料',
path: '/resource/other' path: '/resource/other'
...@@ -32,15 +41,18 @@ export const menus: IMenuItem[] = [ ...@@ -32,15 +41,18 @@ export const menus: IMenuItem[] = [
] ]
}, },
{ {
tag: 'v1-course',
name: '课程管理', name: '课程管理',
path: '/course', path: '/course',
children: [ children: [
{ {
tag: 'v1-course-list',
icon: Monitor, icon: Monitor,
name: '我的课程', name: '我的课程',
path: '/course/my' path: '/course/my'
}, },
{ {
tag: 'v1-course-create',
icon: Edit, icon: Edit,
name: '新建课程', name: '新建课程',
path: '/course/create' path: '/course/create'
...@@ -48,15 +60,18 @@ export const menus: IMenuItem[] = [ ...@@ -48,15 +60,18 @@ export const menus: IMenuItem[] = [
] ]
}, },
{ {
tag: 'v1-backend',
name: '后台管理', name: '后台管理',
path: '/admin', path: '/admin',
children: [ children: [
{ {
tag: 'v1-backend-lecturer-list',
icon: User, icon: User,
name: '讲师管理', name: '讲师管理',
path: '/admin/teacher' path: '/admin/teacher'
}, },
{ {
tag: 'v1-backend-category-list',
icon: Filter, icon: Filter,
name: '类别管理', name: '类别管理',
path: '/admin/category' path: '/admin/category'
...@@ -69,15 +84,18 @@ export const menus: IMenuItem[] = [ ...@@ -69,15 +84,18 @@ export const menus: IMenuItem[] = [
] ]
}, },
{ {
tag: 'v1-backend',
name: '系统管理', name: '系统管理',
path: '/system', path: '/system',
children: [ children: [
{ {
tag: 'v1-backend-data-dictionary-list',
icon: Notebook, icon: Notebook,
name: '数据字典', name: '数据字典',
path: '/system/dictionary' path: '/system/dictionary'
}, },
{ {
tag: 'v1-backend-cover-list',
icon: Picture, icon: Picture,
name: '封面管理', name: '封面管理',
path: '/system/cover' path: '/system/cover'
......
...@@ -173,7 +173,14 @@ defineExpose({ refetch, tableRef }) ...@@ -173,7 +173,14 @@ defineExpose({ refetch, tableRef })
<!-- 主体 --> <!-- 主体 -->
<div class="table-list-bd"> <div class="table-list-bd">
<slot name="body" v-bind="{ data: dataList }"> <slot name="body" v-bind="{ data: dataList }">
<el-table :data="dataList" v-loading="loading" v-bind="$attrs" style="height: 100%" ref="tableRef"> <el-table
:data="dataList"
v-loading="loading"
v-bind="$attrs"
style="height: 100%"
ref="tableRef"
:header-cell-style="{ background: '#EFEFEF' }"
>
<el-table-column v-bind="item" v-for="item in columns" :key="item.prop"> <el-table-column v-bind="item" v-for="item in columns" :key="item.prop">
<template #default="scope" v-if="item.slots || item.computed"> <template #default="scope" v-if="item.slots || item.computed">
<slot :name="item.slots" v-bind="scope" v-if="item.slots"></slot> <slot :name="item.slots" v-bind="scope" v-if="item.slots"></slot>
...@@ -213,6 +220,7 @@ defineExpose({ refetch, tableRef }) ...@@ -213,6 +220,7 @@ defineExpose({ refetch, tableRef })
// flex-direction: column; // flex-direction: column;
// box-sizing: border-box; // box-sizing: border-box;
// } // }
.table-list-hd { .table-list-hd {
display: flex; display: flex;
margin-bottom: 10px; margin-bottom: 10px;
......
...@@ -34,15 +34,15 @@ const defaultActive = computed(() => { ...@@ -34,15 +34,15 @@ const defaultActive = computed(() => {
<nav class="nav"> <nav class="nav">
<el-menu :default-active="defaultActive" :router="true" class="app-menu"> <el-menu :default-active="defaultActive" :router="true" class="app-menu">
<template v-for="item in menuList" :key="item.path"> <template v-for="item in menuList" :key="item.path">
<el-sub-menu :index="item.path" v-if="item.children"> <el-sub-menu :index="item.path" v-permission="item.tag" v-if="item.children">
<template #title> <template #title>
<el-icon><component :is="item.icon"></component></el-icon>{{ item.name }} <el-icon><component :is="item.icon"></component></el-icon>{{ item.name }}
</template> </template>
<el-menu-item :index="subitem.path" v-for="subitem in item.children" :key="subitem.path"> <el-menu-item :index="subitem.path" v-for="subitem in item.children" :key="subitem.path" v-permission="subitem.tag">
{{ subitem.name }} {{ subitem.name }}
</el-menu-item> </el-menu-item>
</el-sub-menu> </el-sub-menu>
<el-menu-item :index="item.path" v-else> <el-menu-item :index="item.path" v-permission="item.tag" v-else>
<el-icon><component :is="item.icon"></component></el-icon>{{ item.name }} <el-icon><component :is="item.icon"></component></el-icon>{{ item.name }}
</el-menu-item> </el-menu-item>
</template> </template>
......
...@@ -35,7 +35,7 @@ function genNavClassName(data: IMenuItem) { ...@@ -35,7 +35,7 @@ function genNavClassName(data: IMenuItem) {
<h1 class="app-name">统一资源管理平台</h1> <h1 class="app-name">统一资源管理平台</h1>
</div> </div>
<div class="app-header-nav"> <div class="app-header-nav">
<div class="app-header-nav-item" v-for="(item, index) in menus" :key="index" :class="genNavClassName(item)"> <div class="app-header-nav-item" v-for="(item, index) in menus" :key="index" :class="genNavClassName(item)" v-permission="item.tag">
<router-link :to="item.path">{{ item.name }}</router-link> <router-link :to="item.path">{{ item.name }}</router-link>
</div> </div>
</div> </div>
......
...@@ -78,8 +78,9 @@ const handleCancel = () => { ...@@ -78,8 +78,9 @@ const handleCancel = () => {
} }
// 确认提交表单 // 确认提交表单
const handleConfirm = () => { const handleConfirm = () => {
console.log(props.isEdit, '00000')
if (props.isEdit) { if (props.isEdit) {
const params = Object.assign({ id: props.editData.idd }, categoryForm) const params = Object.assign({ id: props.editData.id }, categoryForm)
updateCategory(params).then(() => { updateCategory(params).then(() => {
ElMessage.success('更新类别成功') ElMessage.success('更新类别成功')
emit('update:dialogVisible', false) emit('update:dialogVisible', false)
...@@ -96,7 +97,7 @@ const handleConfirm = () => { ...@@ -96,7 +97,7 @@ const handleConfirm = () => {
} }
onMounted(() => { onMounted(() => {
console.log(props.prevCategoryName, 'props.prevCategoryName') console.log(props.editData.id, '0000')
categoryForm.depth = parseInt(props.editData?.depth) + 1 || 0 categoryForm.depth = parseInt(props.editData?.depth) + 1 || 0
categoryForm.parent_id = props.editData?.id categoryForm.parent_id = props.editData?.id
categoryName.value = props.prevCategoryName categoryName.value = props.prevCategoryName
......
<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('')
...@@ -179,7 +179,6 @@ const rebuildData = (value: any, arr: any) => { ...@@ -179,7 +179,6 @@ const rebuildData = (value: any, arr: any) => {
} }
let newArr: any = [] let newArr: any = []
arr.forEach((element: any) => { arr.forEach((element: any) => {
console.log(element, 'element')
// indexOf用来判读当前节点name字段是否包含所搜索的字符串value // indexOf用来判读当前节点name字段是否包含所搜索的字符串value
// 返回值:包含则返回索引值,反之返回-1 // 返回值:包含则返回索引值,反之返回-1
if (element.category_name.indexOf(value) > -1) { if (element.category_name.indexOf(value) > -1) {
...@@ -207,7 +206,7 @@ const rebuildData = (value: any, arr: any) => { ...@@ -207,7 +206,7 @@ const rebuildData = (value: any, arr: any) => {
} }
onMounted(() => { onMounted(() => {
useSortable() checkPermission('v1-backend-category-drag') && useSortable()
}) })
</script> </script>
<template> <template>
...@@ -222,11 +221,29 @@ onMounted(() => { ...@@ -222,11 +221,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>
......
...@@ -42,6 +42,14 @@ const submitForm = async (formEl: FormInstance | undefined) => { ...@@ -42,6 +42,14 @@ const submitForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return if (!formEl) return
await formEl.validate(valid => { await formEl.validate(valid => {
if (valid) { if (valid) {
if (ruleForm.education !== '') {
ruleForm.education = store
.getMapValuesByKey('teacher_level')
.filter(item => item.value === ruleForm.education)[0].label
}
// if (ruleForm.avatar === '') {
// ruleForm.avatar = 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png'
// }
const params = Object.assign({}, ruleForm) const params = Object.assign({}, ruleForm)
createTeacher(params).then(() => { createTeacher(params).then(() => {
ElMessage.success('创建讲师成功') ElMessage.success('创建讲师成功')
...@@ -56,28 +64,28 @@ const submitForm = async (formEl: FormInstance | undefined) => { ...@@ -56,28 +64,28 @@ const submitForm = async (formEl: FormInstance | undefined) => {
<AppCard title="添加讲师"> <AppCard title="添加讲师">
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="120px" class="demo-ruleForm"> <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="120px" class="demo-ruleForm">
<el-row> <el-row>
<el-col :span="6"> <el-col :span="8">
<el-form-item label="讲师姓名:" prop="name"> <el-form-item label="讲师姓名:" prop="name">
<el-input v-model="ruleForm.name" style="width: 250px" placeholder="请输入讲师姓名" /> <el-input v-model="ruleForm.name" style="width: 300px" placeholder="请输入讲师姓名" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="8">
<el-form-item label="讲师职位:" prop="title"> <el-form-item label="讲师职位:" prop="title">
<el-input v-model="ruleForm.title" style="width: 250px" placeholder="请输入讲师职位" /> <el-input v-model="ruleForm.title" style="width: 300px" placeholder="请输入讲师职位" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="8">
<el-form-item label="讲师学历:" prop="education"> <el-form-item label="讲师学历:" prop="education">
<el-select v-model="ruleForm.education" clearable style="width: 250px" placeholder="请选择讲师学历"> <el-select v-model="ruleForm.education" clearable style="width: 300px" placeholder="请选择讲师学历">
<el-option v-for="(item, index) in levelList" :key="index" :label="item.label" :value="item.value" /> <el-option v-for="(item, index) in levelList" :key="index" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="8">
<el-form-item label="讲师任职机构:" prop="office"> <el-form-item label="讲师任职机构:" prop="office">
<el-input v-model="ruleForm.office" style="width: 250px" placeholder="请输入讲师任职机构" /> <el-input v-model="ruleForm.office" style="width: 300px" placeholder="请输入讲师任职机构" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -4,9 +4,14 @@ import { ElMessage } from 'element-plus' ...@@ -4,9 +4,14 @@ import { ElMessage } from 'element-plus'
import type { FormRules, FormInstance } from 'element-plus' import type { FormRules, FormInstance } from 'element-plus'
import VEditor from '@/components/tinymce/Index.vue' import VEditor from '@/components/tinymce/Index.vue'
import AppUpload from '@/components/base/AppUpload.vue' import AppUpload from '@/components/base/AppUpload.vue'
import { useMapStore } from '@/stores/map'
const store = useMapStore()
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const appList = ref() const appList = ref()
const levelList = store.getMapValuesByKey('teacher_level')
const imgDefault = $ref('https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png')
const id = route.query.id as string const id = route.query.id as string
const title = route.query.title as string const title = route.query.title as string
...@@ -50,20 +55,26 @@ const handleDelete = (row: any) => { ...@@ -50,20 +55,26 @@ const handleDelete = (row: any) => {
} }
const getTeacherInfo = () => { const getTeacherInfo = () => {
getTeacherDetail({ id: id }).then(res => { getTeacherDetail({ id: id }).then(res => {
console.log(res.data)
Object.keys(ruleForm).forEach(key => { Object.keys(ruleForm).forEach(key => {
ruleForm[key] = res.data[key] ruleForm[key] = res.data[key]
}) })
if (ruleForm.avatar === '') {
ruleForm.avatar = imgDefault
}
}) })
} }
// 更新讲师 // 更新讲师
const handleUpdate = async (formEl: FormInstance | undefined) => { const handleUpdate = async (formEl: FormInstance | undefined) => {
console.log('0000')
if (!formEl) return if (!formEl) return
await formEl.validate(valid => { await formEl.validate(valid => {
if (valid) { if (valid) {
const params = Object.assign({}, ruleForm) const params = Object.assign({}, ruleForm)
params.education = store
.getMapValuesByKey('teacher_level')
.filter(item => item.label === ruleForm.education)[0].label
updateTeacher(params).then(() => { updateTeacher(params).then(() => {
ElMessage.success('创建讲师成功') ElMessage.success('更新讲师成功')
router.push('/admin/teacher') router.push('/admin/teacher')
}) })
} }
...@@ -82,8 +93,7 @@ onMounted(() => { ...@@ -82,8 +93,7 @@ onMounted(() => {
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="讲师图片:" prop="avatar"> <el-form-item label="讲师图片:" prop="avatar">
<img v-if="isEdit === '1' && ruleForm.avatar !== ''" :src="ruleForm.avatar" class="avatar_box1" /> <el-image v-if="isEdit === '1'" :src="ruleForm.avatar || imgDefault" class="avatar_box1" fit="contain" />
<div class="avatar_box" v-else-if="isEdit === '1' && ruleForm.avatar === ''">暂无讲师图片</div>
<AppUpload v-model="ruleForm.avatar" v-else /> <AppUpload v-model="ruleForm.avatar" v-else />
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -95,7 +105,15 @@ onMounted(() => { ...@@ -95,7 +105,15 @@ onMounted(() => {
<el-input v-model="ruleForm.title" :disabled="isEdit === '1'" /> <el-input v-model="ruleForm.title" :disabled="isEdit === '1'" />
</el-form-item> </el-form-item>
<el-form-item label="讲师学历:" prop="education"> <el-form-item label="讲师学历:" prop="education">
<el-input v-model="ruleForm.education" :disabled="isEdit === '1'" /> <el-select
v-model="ruleForm.education"
clearable
style="width: 250px"
placeholder="请选择讲师学历"
:disabled="isEdit === '1'"
>
<el-option v-for="(item, index) in levelList" :key="index" :label="item.label" :value="item.value" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="讲师任职机构:" prop="office"> <el-form-item label="讲师任职机构:" prop="office">
<el-input v-model="ruleForm.office" :disabled="isEdit === '1'" /> <el-input v-model="ruleForm.office" :disabled="isEdit === '1'" />
...@@ -143,6 +161,7 @@ onMounted(() => { ...@@ -143,6 +161,7 @@ onMounted(() => {
border: 1px dashed #ccc; border: 1px dashed #ccc;
} }
.avatar_box1 { .avatar_box1 {
width: 150px; max-width: 150px;
height: 200px;
} }
</style> </style>
...@@ -20,7 +20,8 @@ const listOptions = $computed(() => { ...@@ -20,7 +20,8 @@ const listOptions = $computed(() => {
prop: 'education', prop: 'education',
label: '讲师学历:', label: '讲师学历:',
placeholder: '请选择讲师学历', placeholder: '请选择讲师学历',
options: store.getMapValuesByKey('teacher_level') options: store.getMapValuesByKey('teacher_level'),
valueKey: 'label'
} }
], ],
columns: [ columns: [
...@@ -29,7 +30,11 @@ const listOptions = $computed(() => { ...@@ -29,7 +30,11 @@ const listOptions = $computed(() => {
{ label: '讲师姓名', prop: 'name', align: 'center' }, { label: '讲师姓名', prop: 'name', align: 'center' },
{ label: '讲师任职机构', prop: 'office', align: 'center' }, { label: '讲师任职机构', prop: 'office', align: 'center' },
{ label: '讲师职位', prop: 'title', align: 'center' }, { label: '讲师职位', prop: 'title', align: 'center' },
{ label: '讲师学历', prop: 'education', align: 'center' }, {
label: '讲师学历',
prop: 'education',
align: 'center'
},
{ label: '创建时间', prop: 'created_time', align: 'center' }, { label: '创建时间', prop: 'created_time', align: 'center' },
{ label: '操作', slots: 'table-operate', width: 230, align: 'center' } { label: '操作', slots: 'table-operate', width: 230, align: 'center' }
] ]
...@@ -67,30 +72,40 @@ const handleDetail = (row: any) => { ...@@ -67,30 +72,40 @@ const handleDetail = (row: any) => {
} }
}) })
} }
const imgDefault = ref('https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png')
</script> </script>
<template> <template>
<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 }">
<el-image <el-image
:src="row.avatar" :src="row.avatar || imgDefault"
alt="" alt=""
style="width: 50px; height: 50px" style="width: 50px; height: 50px"
:preview-src-list="[row.avatar]" :preview-src-list="[row.avatar] || [imgDefault]"
:initial-index="4" :initial-index="4"
fit="contain" fit="contain"
:preview-teleported="true" :preview-teleported="true"
/></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>
......
...@@ -79,7 +79,7 @@ const listOptions = $computed(() => { ...@@ -79,7 +79,7 @@ const listOptions = $computed(() => {
<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>
......
import type { Component } from 'vue' import type { Component } from 'vue'
export interface IMenuItem { export interface IMenuItem {
tag?: string
name: string name: string
path: string path: string
icon?: Component icon?: Component
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论