|
|
@@ -40,13 +40,29 @@
|
|
|
<div class="type-tag">{{ useDateFormat(item.createTime, 'YYYY-MM-DD') }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="card-bottom space-y-2">
|
|
|
- <h2>{{ item.courseName }}</h2>
|
|
|
+ <div class="course-foot">
|
|
|
+ <div class="title">{{ item.courseName }}</div>
|
|
|
<div class="desc">{{ item.courseDesc || '暂无描述' }}</div>
|
|
|
- <div>
|
|
|
- <el-button size="small" type="primary" :icon="Edit" @click.stop="handleChange('edit', item)">编辑</el-button>
|
|
|
- <el-button size="small" type="danger" :icon="Delete" @click.stop="handleChange('delete', item)">删除</el-button>
|
|
|
- <el-button size="small" type="info" :icon="CopyDocument" @click.stop="handleChange('copy', item)">复制</el-button>
|
|
|
+ <div class="flex h-[32px] flex-row items-center justify-between">
|
|
|
+ <div class="action-desc flex h-full flex-row items-center gap-1">
|
|
|
+ <i class="iconfont-sys"></i>
|
|
|
+ <span>{{ useDateFormat(item.createTime, 'YYYY-MM-DD') }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="course-action">
|
|
|
+ <el-dropdown placement="bottom-end" trigger="hover">
|
|
|
+ <div class="action-btn mt-[2px] flex h-[28px] w-[38px] items-center justify-center rounded-md">
|
|
|
+ <el-icon><MoreFilled /></el-icon>
|
|
|
+ </div>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item :icon="Tickets" @click="handleChange('detail', item)">详情 </el-dropdown-item>
|
|
|
+ <el-dropdown-item :icon="Edit" @click="handleChange('edit', item)">编辑 </el-dropdown-item>
|
|
|
+ <el-dropdown-item :icon="Delete" @click="handleChange('delete', item)">删除 </el-dropdown-item>
|
|
|
+ <el-dropdown-item :icon="CopyDocument" @click="handleChange('copy', item)">复制 </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -55,10 +71,12 @@
|
|
|
<div style="margin-top: 16vh" v-if="data.length === 0 && !props.loading">
|
|
|
<ElEmpty :description="`暂无课程数据`" />
|
|
|
</div>
|
|
|
+ <courseDetail ref="courseDetailRef" />
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
- import { Picture as IconPicture, Delete, CopyDocument, Edit } from '@element-plus/icons-vue'
|
|
|
+ import { Picture as IconPicture, Delete, CopyDocument, Edit, Tickets, MoreFilled } from '@element-plus/icons-vue'
|
|
|
import { useDateFormat } from '@vueuse/core'
|
|
|
+ import courseDetail from './course-detail.vue'
|
|
|
import cover1 from '@imgs/cover/img5.webp'
|
|
|
import cover2 from '@imgs/cover/img2.webp'
|
|
|
import cover3 from '@imgs/cover/img3.webp'
|
|
|
@@ -92,20 +110,32 @@
|
|
|
emit('update:checkedList', newChecked)
|
|
|
}
|
|
|
|
|
|
+ // 课程详情
|
|
|
+ const courseDetailRef = ref()
|
|
|
+
|
|
|
const handleChange = (type: string, item: Course) => {
|
|
|
switch (type) {
|
|
|
+ case 'detail':
|
|
|
+ courseDetailRef.value.show(item)
|
|
|
+ break
|
|
|
case 'delete':
|
|
|
- ElMessageBox.confirm('确定删除课程吗?', '提示', {
|
|
|
+ ElMessageBox.confirm(`确定删除课程【${item.courseName}】吗?`, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => emit('handle', 'delete', item))
|
|
|
break
|
|
|
+ case 'copy':
|
|
|
+ ElMessageBox.confirm(`确定复制课程【${item.courseName}】吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'info'
|
|
|
+ }).then(() => emit('handle', 'copy', item))
|
|
|
+ break
|
|
|
default:
|
|
|
emit('handle', type, item)
|
|
|
break
|
|
|
}
|
|
|
- return true
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -145,10 +175,8 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .card-bottom {
|
|
|
- padding: 5px 10px;
|
|
|
-
|
|
|
- h2 {
|
|
|
+ .course-foot {
|
|
|
+ .title {
|
|
|
font-size: 16px;
|
|
|
font-weight: 500;
|
|
|
color: #333;
|
|
|
@@ -156,47 +184,28 @@
|
|
|
@include ellipsis();
|
|
|
}
|
|
|
.desc {
|
|
|
- font-size: 12px;
|
|
|
+ font-size: 14px;
|
|
|
font-weight: 500;
|
|
|
color: var(--art-text-gray-600);
|
|
|
|
|
|
@include ellipsis();
|
|
|
}
|
|
|
+ .action-desc {
|
|
|
+ font-size: 14px;
|
|
|
+ color: var(--art-text-gray-600);
|
|
|
+ }
|
|
|
+ .action-btn {
|
|
|
+ cursor: pointer;
|
|
|
+ transition: background-color 0.2s ease;
|
|
|
+ border: 1px solid var(--art-border-dashed-color);
|
|
|
|
|
|
- .info {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- width: 100%;
|
|
|
- height: 25px;
|
|
|
- margin-top: 6px;
|
|
|
- line-height: 25px;
|
|
|
-
|
|
|
- .text {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- color: var(--art-text-gray-600);
|
|
|
-
|
|
|
- i {
|
|
|
- margin-right: 5px;
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
-
|
|
|
- span {
|
|
|
- font-size: 13px;
|
|
|
- color: var(--art-gray-600);
|
|
|
- }
|
|
|
-
|
|
|
- .line {
|
|
|
- width: 1px;
|
|
|
- height: 12px;
|
|
|
- margin: 0 15px;
|
|
|
- background-color: var(--art-border-dashed-color);
|
|
|
- }
|
|
|
+ &:hover {
|
|
|
+ background-color: var(--art-gray-200);
|
|
|
}
|
|
|
|
|
|
- .el-button {
|
|
|
- opacity: 1;
|
|
|
- transition: all 0.3s;
|
|
|
+ i {
|
|
|
+ // font-size: 20px;
|
|
|
+ color: var(--art-text-gray-700);
|
|
|
}
|
|
|
}
|
|
|
}
|