提交 324ea9ae authored 作者: 王鹏飞's avatar 王鹏飞

feat: 优化样式和页面内容展示

上级 fd7bc1bd
...@@ -132,15 +132,15 @@ export const menus: IMenuItem[] = [ ...@@ -132,15 +132,15 @@ export const menus: IMenuItem[] = [
name: '类别管理', name: '类别管理',
path: '/admin/category', path: '/admin/category',
}, },
{ // {
icon: Coordinate, // icon: Coordinate,
name: '资源审核管理', // name: '资源审核管理',
path: '/admin/audit', // path: '/admin/audit',
}, // },
], ],
}, },
{ {
tag: 'v1-backend', tag: 'v1-backend-data-dictionary-list',
name: '系统管理', name: '系统管理',
path: '/system', path: '/system',
children: [ children: [
......
...@@ -48,13 +48,13 @@ function genNavClassName(data: IMenuItem) { ...@@ -48,13 +48,13 @@ function genNavClassName(data: IMenuItem) {
<div class="app-header-right"> <div class="app-header-right">
<el-dropdown v-if="userInfo"> <el-dropdown v-if="userInfo">
<div class="avatar"> <div class="avatar">
<img :src="userInfo.avatar || '/avatar.png'" /> <img :src="userInfo.avatar || '/default.jpg'" />
</div> </div>
<template #dropdown> <template #dropdown>
<el-dropdown-menu style="width: 280px"> <el-dropdown-menu style="width: 280px">
<div class="app-header-user"> <div class="app-header-user">
<div class="app-header-user-avatar"> <div class="app-header-user-avatar">
<img :src="userInfo.avatar || '/center_resource/avatar.png'" /> <img :src="userInfo.avatar || '/default.jpg'" />
</div> </div>
<div class="app-header-user-main"> <div class="app-header-user-main">
<h3>{{ userInfo.name }}</h3> <h3>{{ userInfo.name }}</h3>
......
...@@ -56,7 +56,7 @@ const handleRes = function (item: any) { ...@@ -56,7 +56,7 @@ const handleRes = function (item: any) {
.chapter-box { .chapter-box {
width: 300px; width: 300px;
background: #aa1941; background: #aa1941;
margin-left: 20px; margin: 0 20px;
height: fit-content; height: fit-content;
border-radius: 10px; border-radius: 10px;
height: 800px; height: 800px;
...@@ -100,15 +100,15 @@ const handleRes = function (item: any) { ...@@ -100,15 +100,15 @@ const handleRes = function (item: any) {
border-bottom: 1px dotted #e06386; border-bottom: 1px dotted #e06386;
margin-top: 30px; margin-top: 30px;
.order { .order {
width: 26px; width: 20px;
margin-right: 7px; margin-right: 7px;
.order-number { .order-number {
width: 26px; width: 20px;
height: 26px; height: 20px;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
border-radius: 50%; border-radius: 50%;
font-size: 16px; font-size: 16px;
line-height: 26px; line-height: 20px;
color: #aa1941; color: #aa1941;
text-align: center; text-align: center;
} }
...@@ -121,7 +121,6 @@ const handleRes = function (item: any) { ...@@ -121,7 +121,6 @@ const handleRes = function (item: any) {
line-height: 1.5; line-height: 1.5;
color: #ffffff; color: #ffffff;
margin-bottom: 20px; margin-bottom: 20px;
margin-top: 2px;
cursor: pointer; cursor: pointer;
word-break: break-all; word-break: break-all;
} }
...@@ -131,8 +130,6 @@ const handleRes = function (item: any) { ...@@ -131,8 +130,6 @@ const handleRes = function (item: any) {
color: #ffffff; color: #ffffff;
margin-bottom: 20px; margin-bottom: 20px;
cursor: pointer; cursor: pointer;
margin-left: 15px;
cursor: pointer;
word-break: break-all; word-break: break-all;
text-align: left; text-align: left;
} }
...@@ -142,8 +139,7 @@ const handleRes = function (item: any) { ...@@ -142,8 +139,7 @@ const handleRes = function (item: any) {
color: #ffffff; color: #ffffff;
margin-top: 10px; margin-top: 10px;
cursor: pointer; cursor: pointer;
margin-left: 30px; margin-left: 20px;
cursor: pointer;
word-break: break-all; word-break: break-all;
text-align: left; text-align: left;
} }
......
...@@ -341,7 +341,6 @@ const handleDetail = (row: any) => { ...@@ -341,7 +341,6 @@ const handleDetail = (row: any) => {
max-height: 100px; max-height: 100px;
background: rgb(239, 239, 239); background: rgb(239, 239, 239);
overflow-y: auto; overflow-y: auto;
text-indent: 2em;
line-height: 1.5; line-height: 1.5;
padding: 20px 20px; padding: 20px 20px;
color: #333; color: #333;
......
<script setup lang="ts"> <script setup lang="ts">
const props: any = defineProps({ const props: any = defineProps({
data: { data: {
type: Object type: Object,
} },
}) })
interface IBasicInfo { interface IBasicInfo {
...@@ -20,42 +20,42 @@ const basicInfo = computed((): IBasicInfo[] => { ...@@ -20,42 +20,42 @@ const basicInfo = computed((): IBasicInfo[] => {
label: '课程类型', label: '课程类型',
value: '', value: '',
key: 'online_type_name', key: 'online_type_name',
border: '1' border: '1',
}, },
{ {
icon: '/center_resource/course-view-icon5.png', icon: '/center_resource/course-view-icon5.png',
label: '选课类型', label: '选课类型',
value: '', value: '',
key: 'elective_type_name', key: 'elective_type_name',
border: '1' border: '1',
}, },
{ {
icon: '/center_resource/course-view-icon3.png', icon: '/center_resource/course-view-icon3.png',
label: '课程学分', label: '课程学分',
value: '', value: '',
key: 'credit', key: 'credit',
border: '1' border: '1',
}, },
{ {
icon: '/center_resource/course-view-icon13.png', icon: '/center_resource/course-view-icon13.png',
label: '负责人', label: '负责人',
value: '', value: '',
key: 'belong_operator_name', key: 'belong_operator_name',
border: '1' border: '1',
}, },
{ {
icon: '/center_resource/course-view-icon8.png', icon: '/center_resource/course-view-icon8.png',
label: '创建时间', label: '创建时间',
value: '', value: '',
key: 'created_time', key: 'created_time',
border: '0' border: '0',
}, },
{ {
icon: '/center_resource/course-view-icon2.png', icon: '/center_resource/course-view-icon2.png',
label: '课程分类', label: '课程分类',
value: '', value: '',
key: 'classification_name', key: 'classification_name',
border: '1' border: '1',
}, },
{ {
...@@ -63,29 +63,29 @@ const basicInfo = computed((): IBasicInfo[] => { ...@@ -63,29 +63,29 @@ const basicInfo = computed((): IBasicInfo[] => {
label: '适用专业', label: '适用专业',
value: '', value: '',
key: 'specialty', key: 'specialty',
border: '1' border: '1',
}, },
{ {
icon: '/center_resource/course-view-icon7.png', icon: '/center_resource/course-view-icon7.png',
label: '是否有效', label: '是否有效',
value: '', value: '',
key: 'status_name', key: 'status_name',
border: '1' border: '1',
}, },
{ {
icon: '/center_resource/course-view-icon6.png', icon: '/center_resource/course-view-icon6.png',
label: '更新人', label: '更新人',
value: '', value: '',
key: 'updated_operator_name', key: 'updated_operator_name',
border: '1' border: '1',
}, },
{ {
icon: '/center_resource/course-view-icon9.png', icon: '/center_resource/course-view-icon9.png',
label: '更新时间', label: '更新时间',
value: '', value: '',
key: 'updated_time', key: 'updated_time',
border: '0' border: '0',
} },
] ]
basicList.map((item: any) => { basicList.map((item: any) => {
...@@ -119,11 +119,9 @@ const statusStyle = (item: any) => { ...@@ -119,11 +119,9 @@ const statusStyle = (item: any) => {
<template #reference> <template #reference>
<div class="cover-name"> <div class="cover-name">
{{ props.data.name }} {{ props.data.name }}
<!-- {{ props.data.belong_operator_name }} -->
</div> </div>
</template> </template>
</el-popover> </el-popover>
<div class="cover-operator">{{ props.data.belong_operator_name }}</div>
</div> </div>
<div class="info"> <div class="info">
<div class="info-list"> <div class="info-list">
...@@ -184,6 +182,7 @@ const statusStyle = (item: any) => { ...@@ -184,6 +182,7 @@ const statusStyle = (item: any) => {
background: #fff; background: #fff;
border-radius: 10px; border-radius: 10px;
padding: 25px 20px; padding: 25px 20px;
gap: 20px;
.cover { .cover {
min-width: 240px; min-width: 240px;
height: 180px; height: 180px;
...@@ -196,20 +195,24 @@ const statusStyle = (item: any) => { ...@@ -196,20 +195,24 @@ const statusStyle = (item: any) => {
} }
.cover-name { .cover-name {
position: absolute; position: absolute;
top: 50%; top: 0;
left: 50%; right: 0;
width: 100%; bottom: 0;
transform: translate(-50%, -50%); left: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
line-height: 37px; line-height: 37px;
font-size: 20px; font-size: 20px;
color: #ffffff; color: #ffffff;
padding-left: 16px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
text-align: center; text-align: center;
cursor: pointer; border-radius: 6px;
} }
.cover-operator { .cover-operator {
position: absolute; position: absolute;
...@@ -230,29 +233,18 @@ const statusStyle = (item: any) => { ...@@ -230,29 +233,18 @@ const statusStyle = (item: any) => {
box-sizing: border-box; box-sizing: border-box;
width: calc(100vw - 400px); width: calc(100vw - 400px);
.info-list { .info-list {
display: flex; flex: 1;
justify-content: space-around; display: grid;
flex-wrap: wrap; grid-template-columns: repeat(5, 1fr);
.item:nth-child(5) { gap: 0 20px;
width: 20%;
}
.item:nth-child(10) {
width: 20%;
}
.item:nth-child(1) {
width: 20%;
}
.item:nth-child(6) {
width: 20%;
}
.item { .item {
width: 15%;
display: flex; display: flex;
align-items: center; align-items: start;
height: fit-content; height: fit-content;
flex-wrap: nowrap; flex-wrap: nowrap;
margin-left: 2%;
margin-bottom: 32px; margin-bottom: 32px;
box-sizing: border-box;
padding: 0 20px;
.item-right { .item-right {
margin-left: 15px; margin-left: 15px;
.label { .label {
......
...@@ -65,7 +65,7 @@ const handleFresh = () => { ...@@ -65,7 +65,7 @@ const handleFresh = () => {
.course-left_info { .course-left_info {
display: flex; display: flex;
.info_bottom { .info_bottom {
width: 67%; width: 75%;
} }
.info_chapter { .info_chapter {
width: 25%; width: 25%;
......
...@@ -5,26 +5,23 @@ import { ElMessage } from 'element-plus' ...@@ -5,26 +5,23 @@ import { ElMessage } from 'element-plus'
const prop = defineProps({ const prop = defineProps({
data: { data: {
type: Array, type: Array,
default: () => [] default: () => [],
} },
}) })
const router = useRouter() const router = useRouter()
const listOptions = { const listOptions = {
columns: [ columns: [
{ label: '排名', slots: 'table-ranking', align: 'center' }, { label: '排名', slots: 'table-ranking', align: 'center', width: 100 },
{ label: '关联使用', slots: 'table-relation', align: 'center' }, { label: '关联使用', slots: 'table-relation', align: 'center' },
{ label: '资源名称', prop: 'name', align: 'center' }, { label: '资源名称', prop: 'name', align: 'center' },
{ label: '资源类型', slots: 'table-type', align: 'center' }, { label: '资源类型', slots: 'table-type', align: 'center' },
{ label: '所在部门', prop: 'organ_id_name', align: 'center' }, { label: '所在部门', prop: 'organ_id_name', align: 'center' },
{ label: '更新人', prop: 'created_operator_name', align: 'center' }, { label: '更新人', prop: 'created_operator_name', align: 'center' },
{ label: '操作', slots: 'table-operate', align: 'center', fixed: 'right' } { label: '操作', slots: 'table-operate', align: 'center', fixed: 'right', width: 100 },
], ],
data: prop.data.map((item: any) => { data: prop.data,
item.name = `${item.name.slice(0, 10)}...`
return item
})
} }
const resourceType = (name: string, isGetPath: number) => { const resourceType = (name: string, isGetPath: number) => {
...@@ -34,21 +31,21 @@ const resourceType = (name: string, isGetPath: number) => { ...@@ -34,21 +31,21 @@ const resourceType = (name: string, isGetPath: number) => {
视频: '/resource/video/view', 视频: '/resource/video/view',
课件: '/resource/courseware/view', 课件: '/resource/courseware/view',
教案: '/resource/lessonplan/view', 教案: '/resource/lessonplan/view',
其他资料: '/resource/other/view' 其他资料: '/resource/other/view',
} }
} else if (isGetPath === 2) { } else if (isGetPath === 2) {
path = { path = {
视频: 1, 视频: 1,
课件: 2, 课件: 2,
教案: 3, 教案: 3,
其他资料: 4 其他资料: 4,
} }
} else { } else {
path = { path = {
视频: 'v1-resource-video-view', 视频: 'v1-resource-video-view',
课件: 'v1-resource-courseware-view', 课件: 'v1-resource-courseware-view',
教案: 'v1-resource-lesson-plan-view', 教案: 'v1-resource-lesson-plan-view',
其他资料: 'v1-resource-other-information-view' 其他资料: 'v1-resource-other-information-view',
} }
} }
return path[name] return path[name]
...@@ -59,8 +56,8 @@ const viewDetails = (row: { id: string; resource_type: string }) => { ...@@ -59,8 +56,8 @@ const viewDetails = (row: { id: string; resource_type: string }) => {
router.push({ router.push({
path: resourceType(row.resource_type, 1), path: resourceType(row.resource_type, 1),
query: { query: {
id: row.id id: row.id,
} },
}) })
} else { } else {
ElMessage('暂无权限查阅') ElMessage('暂无权限查阅')
......
...@@ -6,24 +6,21 @@ const router = useRouter() ...@@ -6,24 +6,21 @@ const router = useRouter()
const prop = defineProps({ const prop = defineProps({
data: { data: {
type: Array, type: Array,
default: () => [] default: () => [],
} },
}) })
const listOptions = { const listOptions = {
columns: [ columns: [
{ label: '排名', slots: 'table-ranking', align: 'center' }, { label: '排名', slots: 'table-ranking', align: 'center', width: 100 },
{ label: '资源名称', prop: 'name', align: 'center' }, { label: '资源名称', prop: 'name', align: 'center' },
{ label: '资源类型', slots: 'table-type', align: 'center' }, { label: '资源类型', slots: 'table-type', align: 'center' },
{ label: '所在部门', prop: 'organ_id_name', align: 'center' }, { label: '所在部门', prop: 'organ_id_name', align: 'center' },
{ label: '更新人', prop: 'created_operator_name', align: 'center' }, { label: '更新人', prop: 'created_operator_name', align: 'center' },
{ label: '更新时间', prop: 'updated_time', align: 'center' }, { label: '更新时间', prop: 'updated_time', align: 'center' },
{ label: '操作', slots: 'table-operate', align: 'center', fixed: 'right' } { label: '操作', slots: 'table-operate', align: 'center', fixed: 'right', width: 100 },
], ],
data: prop.data.map((item: any) => { data: prop.data,
item.name = item.name.length > 10 ? `${item.name.slice(0, 10)}...` : item.name
return item
})
} }
const resourceType = (name: string, isGetPath: number) => { const resourceType = (name: string, isGetPath: number) => {
...@@ -33,21 +30,21 @@ const resourceType = (name: string, isGetPath: number) => { ...@@ -33,21 +30,21 @@ const resourceType = (name: string, isGetPath: number) => {
视频: '/resource/video/view', 视频: '/resource/video/view',
课件: '/resource/courseware/view', 课件: '/resource/courseware/view',
教案: '/resource/lessonplan/view', 教案: '/resource/lessonplan/view',
其他资料: '/resource/other/view' 其他资料: '/resource/other/view',
} }
} else if (isGetPath === 2) { } else if (isGetPath === 2) {
path = { path = {
视频: 1, 视频: 1,
课件: 2, 课件: 2,
教案: 3, 教案: 3,
其他资料: 4 其他资料: 4,
} }
} else { } else {
path = { path = {
视频: 'v1-resource-video-view', 视频: 'v1-resource-video-view',
课件: 'v1-resource-courseware-view', 课件: 'v1-resource-courseware-view',
教案: 'v1-resource-lesson-plan-view', 教案: 'v1-resource-lesson-plan-view',
其他资料: 'v1-resource-other-information-view' 其他资料: 'v1-resource-other-information-view',
} }
} }
return path[name] return path[name]
...@@ -58,8 +55,8 @@ const viewDetails = (row: { id: string; auth_view: boolean; resource_type: strin ...@@ -58,8 +55,8 @@ const viewDetails = (row: { id: string; auth_view: boolean; resource_type: strin
router.push({ router.push({
path: resourceType(row.resource_type, 1), path: resourceType(row.resource_type, 1),
query: { query: {
id: row.id id: row.id,
} },
}) })
} else { } else {
ElMessage('暂无权限查阅') ElMessage('暂无权限查阅')
......
...@@ -7,24 +7,21 @@ const router = useRouter() ...@@ -7,24 +7,21 @@ const router = useRouter()
const prop = defineProps({ const prop = defineProps({
data: { data: {
type: Array, type: Array,
default: () => [] default: () => [],
} },
}) })
const listOptions = { const listOptions = {
columns: [ columns: [
{ label: '排名', slots: 'table-ranking', align: 'center' }, { label: '排名', slots: 'table-ranking', align: 'center', width: 100 },
{ label: '资源名称', prop: 'name', align: 'center' }, { label: '资源名称', prop: 'name', align: 'center' },
{ label: '资源类型', slots: 'table-type', align: 'center' }, { label: '资源类型', slots: 'table-type', align: 'center' },
{ label: '所在部门', prop: 'organ_id_name', align: 'center' }, { label: '所在部门', prop: 'organ_id_name', align: 'center' },
{ label: '更新人', prop: 'created_operator_name', align: 'center' }, { label: '更新人', prop: 'created_operator_name', align: 'center' },
{ label: '更新时间', prop: 'updated_time', align: 'center' }, { label: '更新时间', prop: 'updated_time', align: 'center' },
{ label: '操作', slots: 'table-operate', align: 'center', fixed: 'right' } { label: '操作', slots: 'table-operate', align: 'center', fixed: 'right', width: 100 },
], ],
data: prop.data.map((item: any) => { data: prop.data,
item.name = `${item.name.slice(0, 10)}...`
return item
})
} }
const resourceType = (name: string, isGetPath: number) => { const resourceType = (name: string, isGetPath: number) => {
...@@ -34,21 +31,21 @@ const resourceType = (name: string, isGetPath: number) => { ...@@ -34,21 +31,21 @@ const resourceType = (name: string, isGetPath: number) => {
视频: '/resource/video/view', 视频: '/resource/video/view',
课件: '/resource/courseware/view', 课件: '/resource/courseware/view',
教案: '/resource/lessonplan/view', 教案: '/resource/lessonplan/view',
其他资料: '/resource/other/view' 其他资料: '/resource/other/view',
} }
} else if (isGetPath === 2) { } else if (isGetPath === 2) {
path = { path = {
视频: 1, 视频: 1,
课件: 2, 课件: 2,
教案: 3, 教案: 3,
其他资料: 4 其他资料: 4,
} }
} else { } else {
path = { path = {
视频: 'v1-resource-video-view', 视频: 'v1-resource-video-view',
课件: 'v1-resource-courseware-view', 课件: 'v1-resource-courseware-view',
教案: 'v1-resource-lesson-plan-view', 教案: 'v1-resource-lesson-plan-view',
其他资料: 'v1-resource-other-information-view' 其他资料: 'v1-resource-other-information-view',
} }
} }
return path[name] return path[name]
...@@ -59,8 +56,8 @@ const viewDetails = (row: { id: string; resource_type: string }) => { ...@@ -59,8 +56,8 @@ const viewDetails = (row: { id: string; resource_type: string }) => {
router.push({ router.push({
path: resourceType(row.resource_type, 1), path: resourceType(row.resource_type, 1),
query: { query: {
id: row.id id: row.id,
} },
}) })
} else { } else {
ElMessage('暂无权限查阅') ElMessage('暂无权限查阅')
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论