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

updates:一期二期部分页面优化

上级 5ff09657
...@@ -39,16 +39,21 @@ const bytesToSize = (bytes: number) => { ...@@ -39,16 +39,21 @@ const bytesToSize = (bytes: number) => {
</el-icon> </el-icon>
<div class="tool-pop-btn"> <div class="tool-pop-btn">
<router-link v-if="props.data.auth_edit" :to="`${props.path}/update?id=${props.data.id}`"> <router-link v-if="props.data.auth_edit" :to="`${props.path}/update?id=${props.data.id}`">
<div class="edit-btn">编辑</div> <div class="edit-btn btn">编辑</div>
</router-link> </router-link>
<router-link v-permission="props.permission.view" :to="`${props.path}/view?id=${props.data.id}`"> <router-link v-permission="props.permission.view" :to="`${props.path}/view?id=${props.data.id}`">
<div class="view-btn">查看</div> <div class="view-btn btn">查看</div>
</router-link> </router-link>
</div> </div>
</div> </div>
<div class="card-item-bottom"> <div class="card-item-bottom">
<div class="item-t"> <div class="item-t">
<div class="text">{{ props.data.created_operator_name }}/{{ props.data.organ_id_name }}</div> <el-popover trigger="hover" placement="right">
<div v-html="props.data.created_operator_name + '/' + props.data.organ_id_name"></div>
<template #reference>
<div class="text">{{ props.data.created_operator_name }}/{{ props.data.organ_id_name }}</div>
</template>
</el-popover>
<div :class="props.data.status == 1 ? 'tag green' : 'tag'">{{ props.data.status_name }}</div> <div :class="props.data.status == 1 ? 'tag green' : 'tag'">{{ props.data.status_name }}</div>
</div> </div>
<div class="item-b"> <div class="item-b">
...@@ -126,14 +131,15 @@ const bytesToSize = (bytes: number) => { ...@@ -126,14 +131,15 @@ const bytesToSize = (bytes: number) => {
.edit-btn { .edit-btn {
width: 113px; width: 113px;
line-height: 32px; line-height: 32px;
border: 1px solid #d3d3d3;
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
color: #ffffff; color: #ffffff;
margin: 0 auto 12px; margin: 0 auto 12px;
cursor: pointer; cursor: pointer;
background: #aa1941;
} }
.view-btn { .view-btn {
width: 113px; width: 113px;
line-height: 32px; line-height: 32px;
...@@ -145,6 +151,10 @@ const bytesToSize = (bytes: number) => { ...@@ -145,6 +151,10 @@ const bytesToSize = (bytes: number) => {
margin: 0 auto; margin: 0 auto;
cursor: pointer; cursor: pointer;
} }
.btn:hover {
background: none;
border: 1px solid #d3d3d3;
}
} }
} }
} }
......
...@@ -144,12 +144,16 @@ const typeFilter = () => { ...@@ -144,12 +144,16 @@ const typeFilter = () => {
size="70%" size="70%"
:title="`添加${props.btnInfo.btn_name}`" :title="`添加${props.btnInfo.btn_name}`"
> >
<div class="btn-box">
<el-button type="primary" @click="handleSave">保存</el-button>
</div>
<div class="video-head"> <div class="video-head">
<el-tabs @tab-change="tabChange" v-model="tabValue"> <el-tabs @tab-change="tabChange" v-model="tabValue">
<el-tab-pane label="我的资源" name="1"></el-tab-pane> <el-tab-pane label="我的资源" name="1"></el-tab-pane>
<el-tab-pane label="公开资源" name="2"></el-tab-pane> <el-tab-pane label="公开资源" name="2"></el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<AppList v-bind="listOptions" ref="appList" @select="handleSelection"> <AppList v-bind="listOptions" ref="appList" @select="handleSelection">
<template #filter-type="{ params }"> <template #filter-type="{ params }">
<el-tree-select <el-tree-select
...@@ -164,13 +168,15 @@ const typeFilter = () => { ...@@ -164,13 +168,15 @@ const typeFilter = () => {
/> />
</template> </template>
</AppList> </AppList>
<div class="btn-box" style="display: flex; justify-content: center">
<el-button type="primary" @click="handleSave">保存</el-button>
</div>
</el-drawer> </el-drawer>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-table__header-wrapper .el-checkbox) { :deep(.el-table__header-wrapper .el-checkbox) {
display: none; display: none;
} }
.btn-box {
display: flex;
justify-content: flex-end;
margin-bottom: -20px;
}
</style> </style>
...@@ -3,7 +3,6 @@ import { getVideoList, createCharacter, getCourseListSearch, getLessonList, getO ...@@ -3,7 +3,6 @@ import { getVideoList, createCharacter, getCourseListSearch, getLessonList, getO
import CardListItem from './CardListItem.vue' import CardListItem from './CardListItem.vue'
import { useGetCategoryList } from '@/composables/useGetCategoryList' import { useGetCategoryList } from '@/composables/useGetCategoryList'
const appList = ref() const appList = ref()
const currentResource: any = $ref('')
// 资源出处 tab触发 // 资源出处 tab触发
const tabValue = ref('1') const tabValue = ref('1')
const path = ref('') const path = ref('')
...@@ -90,13 +89,13 @@ const handleCancel = () => { ...@@ -90,13 +89,13 @@ const handleCancel = () => {
emit('update:isShowAddDialog', false) emit('update:isShowAddDialog', false)
} }
// 保存 添加 // 保存 添加
const handleSave = () => { const handleAdd = (val: any) => {
const params: any = { const params: any = {
name: tableData.list.filter((item: any) => item.id === currentResource)[0]?.name, name: val.name,
course_id: props.course_id, course_id: props.course_id,
resource_type: props.btnInfo.resource_type, resource_type: props.btnInfo.resource_type,
parent_id: props.chapterID, parent_id: props.chapterID,
resource_id: currentResource resource_id: val.id
} }
createCharacter(params).then(() => { createCharacter(params).then(() => {
emit('update:isShowAddDialog', false) emit('update:isShowAddDialog', false)
...@@ -142,26 +141,20 @@ if (props.btnInfo.resource_type === '2') { ...@@ -142,26 +141,20 @@ if (props.btnInfo.resource_type === '2') {
<template #body="{ data }"> <template #body="{ data }">
<div class="card-list" v-if="data.length"> <div class="card-list" v-if="data.length">
<div class="card-list-con"> <div class="card-list-con">
<el-radio-group v-model="currentResource"> <CardListItem
<div style="position: relative" v-for="(item, index) in data" :key="index"> v-for="(item, index) in data"
<el-radio :key="index"
v-model="item.check_status" :tabIndex="tabValue"
:label="item.id" :data="item"
style="position: absolute; right: 15px; bottom: 22px" :path="path"
> @add="handleAdd"
{{ '' }}</el-radio >
> </CardListItem>
<CardListItem :tabIndex="tabValue" :data="item" :path="path"> </CardListItem>
</div>
</el-radio-group>
</div> </div>
</div> </div>
<el-empty v-else description="暂无数据" /> <el-empty v-else description="暂无数据" />
</template> </template>
</AppList> </AppList>
<div class="btn-box" style="display: flex; justify-content: center">
<el-button type="primary" @click="handleSave">保存</el-button>
</div>
</el-drawer> </el-drawer>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<script setup lang="ts"> <script setup lang="ts">
const props: any = defineProps<{ data: object; tabIndex: string; path: string }>() const props: any = defineProps<{ data: object; tabIndex: string; path: string }>()
const emit = defineEmits<Emits>()
interface Emits {
(e: 'add', id: object): void
}
const handleAdd = () => {
emit('add', props.data)
}
</script> </script>
<template> <template>
<!-- <div>{{ props.data }}</div> -->
<div class="card-item"> <div class="card-item">
<div class="card-item-top"> <div class="card-item-top">
<div class="title">{{ props.data.name }}</div>
<!-- <img :src="props.data.cover" /> -->
<div class="cover-img" :style="`background-image:url(${props.data.cover})`"></div> <div class="cover-img" :style="`background-image:url(${props.data.cover})`"></div>
<div class="tool-pop-btn"> <div class="tool-pop-btn">
<div style="min-width: 100%"> <div style="min-width: 100%">
<!-- <router-link v-if="props.data.auth_edit" :to="`/resource/video/update?id=${props.data.id}`"> <div class="edit-btn btn" @click="handleAdd">添加</div>
<div class="edit-btn">编辑</div>
</router-link> -->
</div> </div>
<div style="min-width: 100%"> <div style="min-width: 100%">
<router-link v-if="props.data.auth_view" :to="`${props.path}?id=${props.data.id}`"> <router-link v-if="props.data.auth_view" :to="`${props.path}?id=${props.data.id}`">
<div class="view-btn">查看</div> <div class="view-btn btn">查看</div>
</router-link> </router-link>
</div> </div>
</div> </div>
...@@ -85,13 +87,13 @@ const props: any = defineProps<{ data: object; tabIndex: string; path: string }> ...@@ -85,13 +87,13 @@ const props: any = defineProps<{ data: object; tabIndex: string; path: string }>
.edit-btn { .edit-btn {
width: 113px; width: 113px;
line-height: 32px; line-height: 32px;
border: 1px solid #d3d3d3;
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
color: #ffffff; color: #ffffff;
margin: 0 auto 12px; margin: 0 auto 12px;
cursor: pointer; cursor: pointer;
background: #aa1941;
} }
.view-btn { .view-btn {
width: 113px; width: 113px;
...@@ -104,6 +106,10 @@ const props: any = defineProps<{ data: object; tabIndex: string; path: string }> ...@@ -104,6 +106,10 @@ const props: any = defineProps<{ data: object; tabIndex: string; path: string }>
margin: 0 auto; margin: 0 auto;
cursor: pointer; cursor: pointer;
} }
.btn:hover {
background: none;
border: 1px solid #d3d3d3;
}
} }
} }
} }
......
<script setup lang="ts"> <script setup lang="ts">
import { createCourse, getCourseDetails, updateCourse } from '../api' import { createCourse, getCourseDetails, updateCourse, getMajorList } from '../api'
// getMajorList //
// setStatus // setStatus
import { useGetCategoryList } from '@/composables/useGetCategoryList' import { useGetCategoryList } from '@/composables/useGetCategoryList'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
...@@ -20,8 +20,8 @@ const route = useRoute() ...@@ -20,8 +20,8 @@ const route = useRoute()
const router = useRouter() const router = useRouter()
const id = route.query.id as string const id = route.query.id as string
// const majorList: any = ref([]) const majorList: any = ref([])
// const allMajorList: any = ref([]) const allMajorList: any = ref([])
// is 编辑 新建 // is 编辑 新建
const isUpdate = $computed(() => { const isUpdate = $computed(() => {
...@@ -47,7 +47,7 @@ const electiveType = computed<ICourseList[]>(() => { ...@@ -47,7 +47,7 @@ const electiveType = computed<ICourseList[]>(() => {
}) })
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList() let { list: selectTree }: any = useGetCategoryList()
const defaultProps = { children: 'children', label: 'category_name', value: 'id' } const defaultProps = { children: 'children', label: 'category_name', value: 'id' }
// form // form
...@@ -65,8 +65,8 @@ const form = reactive<Record<string, any>>({ ...@@ -65,8 +65,8 @@ const form = reactive<Record<string, any>>({
previous_preparation: '', previous_preparation: '',
target: '', target: '',
exam_id: '', exam_id: '',
live_id: '' live_id: '',
// specialty_id: '' specialty_id: []
}) })
// 表单验证 // 表单验证
...@@ -79,8 +79,8 @@ const rules = reactive<FormRules>({ ...@@ -79,8 +79,8 @@ const rules = reactive<FormRules>({
{ required: true, message: '请输入学分' }, { required: true, message: '请输入学分' },
{ pattern: /\d/, message: '请输入数字' } { pattern: /\d/, message: '请输入数字' }
], ],
lecturer_id: [{ required: true, message: '请添加课程讲师' }] lecturer_id: [{ required: true, message: '请添加课程讲师' }],
// specialty_id: [{ required: true, message: '请选择适用专业' }] specialty_id: [{ required: true, message: '请选择适用专业' }]
}) })
// 课程封面dialog // 课程封面dialog
...@@ -107,9 +107,12 @@ let loading = $ref<boolean>(false) ...@@ -107,9 +107,12 @@ let loading = $ref<boolean>(false)
function fetchDetail() { function fetchDetail() {
loading = true loading = true
getCourseDetails({ id }).then((res: any) => { getCourseDetails({ id }).then((res: any) => {
console.log(res.data)
Object.assign(form, res.data) Object.assign(form, res.data)
examList.value = res.data.examinations examList.value = res.data.examinations
form.exam_id = res.data.examinations.map((item: any) => item.id).toString() form.exam_id = res.data.examinations.map((item: any) => item.id).toString()
form.specialty_id = res.data.specialty.map((item: any) => item.id)
console.log(form.specialty_id, 'form.specialty_id')
loading = false loading = false
}) })
} }
...@@ -119,7 +122,6 @@ onMounted(() => { ...@@ -119,7 +122,6 @@ onMounted(() => {
watchEffect(() => { watchEffect(() => {
form.lecturer_id = setDefaultData(form.lecturers) form.lecturer_id = setDefaultData(form.lecturers)
// form.exam_id = setDefaultData(examList.value)
form.live_id = setDefaultData(form.meetings) form.live_id = setDefaultData(form.meetings)
}) })
...@@ -129,6 +131,7 @@ watch( ...@@ -129,6 +131,7 @@ watch(
ruleFormRef?.validateField('lecturer_id') ruleFormRef?.validateField('lecturer_id')
} }
) )
function setDefaultData(data: any[] = []) { function setDefaultData(data: any[] = []) {
return data.map((item: any) => item.id).join() return data.map((item: any) => item.id).join()
} }
...@@ -145,6 +148,8 @@ function handleSubmit() { ...@@ -145,6 +148,8 @@ function handleSubmit() {
} }
// 创建课程 // 创建课程
function handleCreate() { function handleCreate() {
form.specialty_id = form.specialty_id.toString()
createCourse(form).then((res: any) => { createCourse(form).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
// 操作第二部 // 操作第二部
...@@ -157,6 +162,8 @@ function handleCreate() { ...@@ -157,6 +162,8 @@ function handleCreate() {
} }
// 修改课程 // 修改课程
function handleUpdate() { function handleUpdate() {
console.log(form, '0000')
form.specialty_id = form.specialty_id.toString()
updateCourse(form).then((res: any) => { updateCourse(form).then((res: any) => {
if (res.code === 0) { if (res.code === 0) {
// 操作第二部 // 操作第二部
...@@ -170,18 +177,19 @@ function handleUpdate() { ...@@ -170,18 +177,19 @@ function handleUpdate() {
// const handleMajorList = (query: string) => { // const handleMajorList = (query: string) => {
// if (query) { // if (query) {
// getMajorList({ name: query, 'per-page': '100' }).then((res: any) => { getMajorList({ name: '', 'per-page': '100' }).then((res: any) => {
// majorList.value = res.data.list majorList.value = res.data.list
// majorList.value.forEach((item: any) => { majorList.value.forEach((item: any) => {
// const findItem = allMajorList.value.find((cItem: any) => cItem.id === item.id) console.log(item, 'ppp')
// if (!findItem) { const findItem = allMajorList.value.find((cItem: any) => cItem.id === item.id)
// allMajorList.value.push(item) if (!findItem) {
// } allMajorList.value.push(item)
// }) }
// }) })
// } else { })
// majorList.value = [] // } else {
// } // majorList.value = []
// }
// } // }
</script> </script>
...@@ -214,22 +222,18 @@ function handleUpdate() { ...@@ -214,22 +222,18 @@ function handleUpdate() {
style="width: 100%" style="width: 100%"
v-model="form.classification" v-model="form.classification"
:data="selectTree" :data="selectTree"
node-key="id"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
placeholder="请选择课程分类"
/> />
</el-form-item> </el-form-item>
<el-form-item label="课程学分" prop="credit"> <el-form-item label="课程学分" prop="credit">
<el-input v-model="form.credit" maxlength="3" /> <el-input v-model="form.credit" maxlength="3" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="适用专业" prop="specialty_id"> <el-form-item label="适用专业" prop="specialty_id">
<el-select <el-select v-model="form.specialty_id" placeholder="请选择适用专业" style="width: 100%" clearable multiple>
v-model="form.specialty_id" <!-- :remote-method="handleMajorList" -->
placeholder="请选择适用专业"
style="width: 100%"
clearable
filterable
remote
:remote-method="handleMajorList"
:loading="loading"
>
<el-option <el-option
v-for="(item, index) in majorList" v-for="(item, index) in majorList"
:key="index" :key="index"
...@@ -237,7 +241,7 @@ function handleUpdate() { ...@@ -237,7 +241,7 @@ function handleUpdate() {
:value="item.id" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> --> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-form <el-form
......
...@@ -17,24 +17,22 @@ const copyCourse = () => { ...@@ -17,24 +17,22 @@ const copyCourse = () => {
} }
</script> </script>
<template> <template>
<!-- <div>{{ props.data }}</div> -->
<div class="card-item"> <div class="card-item">
<div class="card-item-top"> <div class="card-item-top">
<div class="title">{{ props.data.name }}</div> <div class="title">{{ props.data.name }}</div>
<!-- <img :src="props.data.cover" /> -->
<div class="cover-img" :style="`background-image:url(${props.data.cover})`"></div> <div class="cover-img" :style="`background-image:url(${props.data.cover})`"></div>
<div class="tool-pop-btn"> <div class="tool-pop-btn">
<div style="min-width: 100%"> <div style="min-width: 100%">
<router-link v-if="props.data.auth_edit" :to="`/course/update-course?id=${props.data.id}`"> <router-link v-if="props.data.auth_edit" :to="`/course/update-course?id=${props.data.id}`">
<div class="edit-btn">编辑</div> <div class="edit-btn btn">编辑</div>
</router-link> </router-link>
</div> </div>
<div style="min-width: 100%"> <div style="min-width: 100%">
<router-link v-if="props.data.auth_view" :to="`/course/my/view?id=${props.data.id}`"> <router-link v-if="props.data.auth_view" :to="`/course/my/view?id=${props.data.id}`">
<div class="view-btn">查看</div> <div class="view-btn btn">查看</div>
</router-link> </router-link>
<div style="min-width: 100%" v-if="props.data.auth_copy"> <div style="min-width: 100%" v-if="props.data.auth_copy">
<div class="copy-btn" plain @click="copyCourse">复制</div> <div class="copy-btn btn" plain @click="copyCourse">复制</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -105,12 +103,12 @@ const copyCourse = () => { ...@@ -105,12 +103,12 @@ const copyCourse = () => {
.edit-btn { .edit-btn {
width: 113px; width: 113px;
line-height: 32px; line-height: 32px;
border: 1px solid #d3d3d3;
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
color: #ffffff; color: #ffffff;
margin: 0 auto 5px; margin: 0 auto 5px;
background: #aa1941;
cursor: pointer; cursor: pointer;
} }
.view-btn { .view-btn {
...@@ -132,7 +130,11 @@ const copyCourse = () => { ...@@ -132,7 +130,11 @@ const copyCourse = () => {
font-size: 14px; font-size: 14px;
color: #ffffff; color: #ffffff;
margin: 5px auto; margin: 5px auto;
background: #aa1941;
cursor: pointer; cursor: pointer;
}
.btn:hover {
background: none;
border: 1px solid #d3d3d3; border: 1px solid #d3d3d3;
} }
} }
......
...@@ -69,12 +69,12 @@ const bytesToSize = (bytes: number) => { ...@@ -69,12 +69,12 @@ const bytesToSize = (bytes: number) => {
justify-content: space-around; justify-content: space-around;
.item { .item {
padding-top: 15px; padding-top: 15px;
min-width: 110px; min-width: 19%;
height: 140px; height: 140px;
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
border-radius: 6px; border-radius: 6px;
box-sizing: border-box; box-sizing: border-box;
margin-right: 20px; margin-right: 1%;
margin-top: 20px; margin-top: 20px;
// &:nth-child(1) { // &:nth-child(1) {
// .icon { // .icon {
......
...@@ -93,6 +93,7 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string) ...@@ -93,6 +93,7 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string)
color: #ffffff; color: #ffffff;
margin-bottom: 20px; margin-bottom: 20px;
cursor: pointer; cursor: pointer;
text-indent: 1em;
} }
} }
} }
......
...@@ -14,88 +14,6 @@ watch( ...@@ -14,88 +14,6 @@ watch(
} }
) )
interface IBasicInfo {
icon: string
label: string
value: string
key: string
}
const basicInfo = computed((): IBasicInfo[] => {
const basicList = [
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon1.png',
label: '课程类型',
value: '',
key: 'online_type_name'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon2.png',
label: '课程分类',
value: '',
key: 'classification_name'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon3.png',
label: '课程学分',
value: '',
key: 'credit'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon14.png',
label: '适用专业',
value: '',
key: 'specialty'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon4.png',
label: '创建人',
value: '',
key: 'created_operator_name'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon6.png',
label: '更新人',
value: '',
key: 'updated_operator_name'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon13.png',
label: '负责人',
value: '',
key: 'belong_operator_name'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon5.png',
label: '选课类型',
value: '',
key: 'elective_type_name'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon7.png',
label: '是否有效',
value: '',
key: 'status_name'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon8.png',
label: '创建时间',
value: '',
key: 'created_time'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon9.png',
label: '更新时间',
value: '',
key: 'updated_time'
}
]
basicList.map((item: any) => {
item.value = props?.data[item.key] || '-'
return item
})
return basicList
})
const add0 = (m: number) => { const add0 = (m: number) => {
return m < 10 ? '0' + m : m return m < 10 ? '0' + m : m
} }
...@@ -178,50 +96,32 @@ const liveOptions = computed(() => { ...@@ -178,50 +96,32 @@ const liveOptions = computed(() => {
</script> </script>
<template> <template>
<div class="info-box"> <div class="info-box">
<div class="top-info"> <div class="info_title">课程授权信息</div>
<div class="cover"></div>
<div class="infos">
<div class="item" v-for="item in basicInfo" :key="item.key">
<img :src="item.icon" />
<div class="item-right">
<div class="label">{{ item.label }}</div>
<div class="value">{{ item.value.toString() || '-' }}</div>
</div>
</div>
</div>
</div>
<div class="bottom-info"> <div class="bottom-info">
<div class="lecturer-list">
<div v-for="item in props.data.lecturers" :key="item.id">
<el-popover :title="item.name" trigger="hover" placement="right">
<div v-html="item.summarize"></div>
<template #reference>
<div class="item">
<div class="avatar" :style="`background-image:url(${item.avatar})`"></div>
<div class="name">{{ item.name }}</div>
</div>
</template>
</el-popover>
</div>
</div>
<div class="other-info"> <div class="other-info">
<div class="item"> <div class="item">
<img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon11.png" /> <img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon11.png" />
<div class="label">课程所属部门</div> <div>
<div class="value">{{ props.data.organ_id_name }}</div> <div class="label">课程所属部门</div>
<div class="value">{{ props.data.organ_id_name }}</div>
</div>
</div> </div>
<div class="item"> <div class="item">
<img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon12.png" /> <img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon12.png" />
<div class="label">课程公开信息</div> <div>
<div class="value">{{ props.data.department_public_name }}</div> <div class="label">课程公开信息</div>
<div class="value">{{ props.data.platform_public_name }}</div> <div class="value">{{ props.data.department_public_name }}</div>
<div class="value">{{ props.data.platform_public_name }}</div>
</div>
</div> </div>
<div class="item"> <div class="item">
<img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon15.png" /> <img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon15.png" />
<div class="label">课程授权信息</div> <div>
<div class="value" v-for="(item, index) in props.data.auth_departments" :key="index"> <div class="label">课程授权信息</div>
{{ item.department_name }} <div class="value" v-for="(item, index) in props.data.auth_departments" :key="index">
{{ item.department_name }}
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -250,66 +150,43 @@ const liveOptions = computed(() => { ...@@ -250,66 +150,43 @@ const liveOptions = computed(() => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.info-box { .info-box {
background: #f7f7f7; // background: #f7f7f7;
background: #fff;
border-radius: 10px; border-radius: 10px;
padding: 25px 17px; padding: 25px 17px;
} }
.top-info { .info_title {
display: flex; font-size: 18px;
.cover { font-weight: 500;
min-width: 240px; color: #333333;
height: 180px; opacity: 1;
background: url(https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course_default.png);
background-size: cover;
}
.infos {
padding-left: 20px;
display: flex;
flex-wrap: wrap;
.item {
width: 180px;
display: flex;
align-items: center;
height: fit-content;
margin: 10px 0 0;
.item-right {
margin-left: 15px;
.label {
font-size: 14px;
line-height: 100%;
color: #999999;
margin-bottom: 8px;
}
.value {
font-size: 16px;
font-weight: 500;
line-height: 100%;
color: #333333;
}
}
}
}
} }
.bottom-info { .bottom-info {
display: flex; display: flex;
padding-top: 20px; padding-top: 20px;
.other-info { .other-info {
width: 594px; width: 100%;
background: #ebe4d9; height: 140px;
background: rgba(244, 244, 244, 0.39);
border-radius: 6px; border-radius: 6px;
display: flex; display: flex;
padding: 64px 0 38px; justify-content: space-around;
padding: 27px 55px 24px 32px;
box-sizing: border-box;
.item { .item {
flex: 1; display: flex;
&:nth-child(2) { align-items: center;
// height: 150px; justify-content: center;
border-left: 1px solid #ddb67c; border-right: 1px dashed #ddb67c;
border-right: 1px solid #ddb67c; width: 33%;
&:last-child {
border: none;
} }
img { img {
width: 52px; width: 52px;
height: 52px;
display: block; display: block;
margin: 0 auto;
} }
.label { .label {
font-size: 14px; font-size: 14px;
...@@ -317,7 +194,8 @@ const liveOptions = computed(() => { ...@@ -317,7 +194,8 @@ const liveOptions = computed(() => {
color: #666666; color: #666666;
padding-top: 10px; padding-top: 10px;
padding-bottom: 13px; padding-bottom: 13px;
text-align: center; text-align: left;
margin-left: 15px;
} }
.value { .value {
font-size: 16px; font-size: 16px;
...@@ -325,7 +203,8 @@ const liveOptions = computed(() => { ...@@ -325,7 +203,8 @@ const liveOptions = computed(() => {
line-height: 100%; line-height: 100%;
color: #333333; color: #333333;
margin-bottom: 10px; margin-bottom: 10px;
text-align: center; text-align: left;
margin-left: 15px;
} }
} }
} }
......
<script setup lang="ts">
const props: any = defineProps({
data: {
type: Object
}
})
interface IBasicInfo {
icon: string
label: string
value: string
key: string
border: string
}
const basicInfo = computed((): IBasicInfo[] => {
const basicList = [
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon1.png',
label: '课程类型',
value: '',
key: 'online_type_name',
border: '1'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon5.png',
label: '选课类型',
value: '',
key: 'elective_type_name',
border: '1'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon3.png',
label: '课程学分',
value: '',
key: 'credit',
border: '1'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon13.png',
label: '负责人',
value: '',
key: 'belong_operator_name',
border: '1'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon8.png',
label: '创建时间',
value: '',
key: 'created_time',
border: '0'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon2.png',
label: '课程分类',
value: '',
key: 'classification_name',
border: '1'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon14.png',
label: '适用专业',
value: '',
key: 'specialty',
border: '1'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon7.png',
label: '是否有效',
value: '',
key: 'status_name',
border: '1'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon6.png',
label: '更新人',
value: '',
key: 'updated_operator_name',
border: '1'
},
{
icon: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course-view-icon9.png',
label: '更新时间',
value: '',
key: 'updated_time',
border: '0'
}
]
basicList.map((item: any) => {
item.value = props?.data[item.key] || '-'
return item
})
return basicList
})
</script>
<template>
<div class="top-info">
<div class="cover"></div>
<div class="info">
<div class="info-list">
<div
class="item"
v-for="item in basicInfo"
:key="item.key"
:style="item.border === '1' ? 'border-right:1px dashed #BFBFBF' : 'border-right:none'"
>
<img :src="item.icon" />
<div class="item-right">
<div class="label">{{ item.label }}</div>
<div class="value">{{ item.value.toString() || '-' }}</div>
</div>
</div>
</div>
<div class="lecturer-list">
<div class="list-name">讲师</div>
<div v-for="item in props.data.lecturers" :key="item.id">
<el-popover :title="item.name" trigger="hover" placement="right">
<div v-html="item.summarize"></div>
<template #reference>
<div class="item">
<div class="avatar" :style="`background-image:url(${item.avatar})`"></div>
<div class="name">{{ item.name }}</div>
</div>
</template>
</el-popover>
</div>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
.top-info {
display: flex;
justify-content: center;
background: #fff;
border-radius: 10px;
padding: 25px 20px;
.cover {
min-width: 240px;
height: 180px;
background: url(https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/course_default.png);
background-size: cover;
border-radius: 6px;
}
.info {
display: flex;
flex-direction: column;
align-items: flex-start;
box-sizing: border-box;
width: calc(100vw - 400px);
.info-list {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
.item {
width: 15%;
display: flex;
align-items: center;
height: fit-content;
margin-left: 2%;
margin-bottom: 21px;
.item-right {
margin-left: 15px;
.label {
font-size: 14px;
line-height: 100%;
color: #999999;
margin-bottom: 8px;
}
.value {
font-size: 16px;
font-weight: 500;
line-height: 100%;
color: #333333;
}
}
}
}
.lecturer-list {
width: 230px;
display: flex;
justify-content: center;
.list-name {
width: 18px;
height: 40px;
font-size: 18px;
font-weight: 500;
line-height: 26px;
color: #333333;
opacity: 1;
}
.item {
margin-left: 25px;
width: 115px;
display: flex;
justify-content: center;
align-items: center;
.avatar {
width: 40px;
height: 40px;
background-size: cover;
border-radius: 50%;
margin: 0 auto;
}
.name {
text-align: center;
font-size: 16px;
font-weight: 500;
line-height: 100%;
color: #333333;
margin-top: 10px;
}
}
}
}
}
</style>
...@@ -100,5 +100,6 @@ const changeVideo = (index: number) => { ...@@ -100,5 +100,6 @@ const changeVideo = (index: number) => {
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
color: #fff;
} }
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
import { getCourseList } from '../api' import { getCourseList } from '../api'
import CardListItem from '../components/CardListItem.vue' import CardListItem from '../components/CardListItem.vue'
import { Expand, PictureFilled } from '@element-plus/icons-vue' import { PictureFilled } from '@element-plus/icons-vue'
import { useProjectList } from '@/composables/useGetProjectList' import { useProjectList } from '@/composables/useGetProjectList'
import { useUserStore } from '@/stores/user' import { useUserStore } from '@/stores/user'
...@@ -87,7 +87,14 @@ const changeCard = () => { ...@@ -87,7 +87,14 @@ const changeCard = () => {
<el-tab-pane label="部门课程" name="2"></el-tab-pane> <el-tab-pane label="部门课程" name="2"></el-tab-pane>
<el-tab-pane label="公开课程" name="3"></el-tab-pane> <el-tab-pane label="公开课程" name="3"></el-tab-pane>
</el-tabs> </el-tabs>
<el-icon class="video-head-icon" @click="changeCard"><Expand /></el-icon> <div class="video-head-icon" @click="changeCard">
<img
v-if="!isCard"
src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_card.png"
alt=""
/>
<img v-else src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_list.png" alt="" />
</div>
</div> </div>
<div class="video-tool-btn"> <div class="video-tool-btn">
<router-link v-if="tabValue === '1'" to="/course/update-course"> <router-link v-if="tabValue === '1'" to="/course/update-course">
......
<script setup lang="ts"> <script setup lang="ts">
import ViewCourseInfo from '../components/ViewCourseInfo.vue' import ViewCourseInfo from '../components/ViewCourseInfo.vue'
import ViewCourseInfoTop from '../components/ViewCourseInfoTop.vue'
import ViewCourseChapter from '../components/ViewCourseChapter.vue' import ViewCourseChapter from '../components/ViewCourseChapter.vue'
import Operation from '../components/Operation.vue' import Operation from '../components/Operation.vue'
import { getViewCourseDetails } from '../api' import { getViewCourseDetails } from '../api'
...@@ -29,11 +30,14 @@ const handleFresh = () => { ...@@ -29,11 +30,14 @@ const handleFresh = () => {
<AppCard title="查阅课程"> <AppCard title="查阅课程">
<Operation :data="courseDetails" @update="handleFresh"></Operation> <Operation :data="courseDetails" @update="handleFresh"></Operation>
<div class="course-view"> <div class="course-view">
<ViewCourseInfoTop :data="courseDetails"></ViewCourseInfoTop>
<div class="course-left_info"> <div class="course-left_info">
<ViewCourseInfo :data="courseDetails"></ViewCourseInfo> <ViewCourseInfo :data="courseDetails" class="info_bottom"></ViewCourseInfo>
<ViewCourseChapter <ViewCourseChapter
v-if="Object.keys(courseDetails).length" v-if="Object.keys(courseDetails).length"
:data="courseDetails.chapters[0]?.children || []" :data="courseDetails.chapters[0]?.children || []"
class="info_chapter"
></ViewCourseChapter> ></ViewCourseChapter>
</div> </div>
</div> </div>
...@@ -41,10 +45,19 @@ const handleFresh = () => { ...@@ -41,10 +45,19 @@ const handleFresh = () => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.course-view { .course-view {
border: 1px solid #bfbfbf;
border-radius: 10px;
display: flex; display: flex;
flex-direction: column;
.course-left_info { .course-left_info {
width: 840px;
display: flex; display: flex;
.info_bottom {
width: 67%;
}
.info_chapter {
width: 25%;
}
} }
} }
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
import { getCourseList } from '../api' import { getCourseList } from '../api'
import CardListItem from '@/components/base/CardListItem.vue' import CardListItem from '@/components/base/CardListItem.vue'
import { Expand } from '@element-plus/icons-vue'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { useGetCategoryList } from '@/composables/useGetCategoryList' import { useGetCategoryList } from '@/composables/useGetCategoryList'
import { useProjectList } from '@/composables/useGetProjectList' import { useProjectList } from '@/composables/useGetProjectList'
...@@ -17,7 +16,7 @@ const store = useMapStore() ...@@ -17,7 +16,7 @@ const store = useMapStore()
const departmentList: any = useProjectList('', '79806610719731712').departmentList const departmentList: any = useProjectList('', '79806610719731712').departmentList
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList() let { list: selectTree }: any = useGetCategoryList()
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
...@@ -99,10 +98,21 @@ const typeFilter = () => { ...@@ -99,10 +98,21 @@ const typeFilter = () => {
<el-tab-pane label="部门资源" name="2"></el-tab-pane> <el-tab-pane label="部门资源" name="2"></el-tab-pane>
<el-tab-pane label="公开资源" name="3"></el-tab-pane> <el-tab-pane label="公开资源" name="3"></el-tab-pane>
</el-tabs> </el-tabs>
<el-icon class="video-head-icon" @click="changeCard"><Expand /></el-icon> <div class="video-head-icon" @click="changeCard">
<img
v-if="!isCard"
src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_card.png"
alt=""
/>
<img v-else src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_list.png" alt="" />
</div>
</div> </div>
<div class="video-tool-btn"> <div class="video-tool-btn">
<router-link v-if="tabValue === '1'" v-permission="'v1-resource-courseware-create'" to="/resource/courseware/update"> <router-link
v-if="tabValue === '1'"
v-permission="'v1-resource-courseware-create'"
to="/resource/courseware/update"
>
<el-button type="primary" round>新建课件资源</el-button> <el-button type="primary" round>新建课件资源</el-button>
</router-link> </router-link>
</div> </div>
...@@ -110,11 +120,13 @@ const typeFilter = () => { ...@@ -110,11 +120,13 @@ const typeFilter = () => {
<template #header-aside></template> <template #header-aside></template>
<template #filter-type="{ params }"> <template #filter-type="{ params }">
<el-tree-select <el-tree-select
node-key="id"
@change="typeFilter" @change="typeFilter"
clearable clearable
:props="defaultProps" :props="defaultProps"
v-model="params.classification" v-model="params.classification"
:data="selectTree" :data="selectTree"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/> />
</template> </template>
<template v-if="tabValue == '3' && isAdmin" #filter-department="{ params }"> <template v-if="tabValue == '3' && isAdmin" #filter-department="{ params }">
......
...@@ -31,7 +31,7 @@ if (isUpdate) { ...@@ -31,7 +31,7 @@ if (isUpdate) {
} }
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList() let { list: selectTree }: any = useGetCategoryList()
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
...@@ -173,6 +173,8 @@ const changeProtocol = (data: any) => { ...@@ -173,6 +173,8 @@ const changeProtocol = (data: any) => {
v-model="form.classification" v-model="form.classification"
:data="selectTree" :data="selectTree"
placeholder="请选择课件分类" placeholder="请选择课件分类"
node-key="id"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/> />
</el-form-item> </el-form-item>
<el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:"> <el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:">
......
...@@ -40,16 +40,16 @@ const bytesToSize = (bytes: number) => { ...@@ -40,16 +40,16 @@ const bytesToSize = (bytes: number) => {
<style lang="scss" scoped> <style lang="scss" scoped>
.statistics-list { .statistics-list {
display: flex; display: flex;
flex-wrap: wrap; // flex-wrap: wrap;
margin-top: -20px; margin-top: -20px;
.item { .item {
padding-top: 15px; padding-top: 15px;
min-width: 110px; min-width: 10%;
height: 140px; height: 140px;
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
border-radius: 6px; border-radius: 6px;
box-sizing: border-box; box-sizing: border-box;
margin-right: 20px; margin-right: 1%;
margin-top: 20px; margin-top: 20px;
&:nth-child(1) { &:nth-child(1) {
.icon { .icon {
......
<script setup lang="ts"> <script setup lang="ts">
import { getLessonList } from '../api' import { getLessonList } from '../api'
import CardListItem from '@/components/base/CardListItem.vue' import CardListItem from '@/components/base/CardListItem.vue'
import { Expand } from '@element-plus/icons-vue'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { useGetCategoryList } from '@/composables/useGetCategoryList' import { useGetCategoryList } from '@/composables/useGetCategoryList'
import { useProjectList } from '@/composables/useGetProjectList' import { useProjectList } from '@/composables/useGetProjectList'
...@@ -25,7 +24,7 @@ const changeCard = () => { ...@@ -25,7 +24,7 @@ const changeCard = () => {
const departmentList: any = useProjectList('', '79806610719731712').departmentList const departmentList: any = useProjectList('', '79806610719731712').departmentList
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList() let { list: selectTree }: any = useGetCategoryList()
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
...@@ -99,10 +98,21 @@ const typeFilter = () => { ...@@ -99,10 +98,21 @@ const typeFilter = () => {
<el-tab-pane label="部门资源" name="2"></el-tab-pane> <el-tab-pane label="部门资源" name="2"></el-tab-pane>
<el-tab-pane label="公开资源" name="3"></el-tab-pane> <el-tab-pane label="公开资源" name="3"></el-tab-pane>
</el-tabs> </el-tabs>
<el-icon class="video-head-icon" @click="changeCard"><Expand /></el-icon> <div class="video-head-icon" @click="changeCard">
<img
v-if="!isCard"
src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_card.png"
alt=""
/>
<img v-else src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_list.png" alt="" />
</div>
</div> </div>
<div class="video-tool-btn"> <div class="video-tool-btn">
<router-link v-if="tabValue === '1'" v-permission="'v1-resource-lesson-plan-create'" to="/resource/lessonplan/update"> <router-link
v-if="tabValue === '1'"
v-permission="'v1-resource-lesson-plan-create'"
to="/resource/lessonplan/update"
>
<el-button type="primary" round>新建教案资源</el-button> <el-button type="primary" round>新建教案资源</el-button>
</router-link> </router-link>
</div> </div>
...@@ -110,11 +120,13 @@ const typeFilter = () => { ...@@ -110,11 +120,13 @@ const typeFilter = () => {
<template #header-aside></template> <template #header-aside></template>
<template #filter-type="{ params }"> <template #filter-type="{ params }">
<el-tree-select <el-tree-select
node-key="id"
@change="typeFilter" @change="typeFilter"
clearable clearable
:props="defaultProps" :props="defaultProps"
v-model="params.classification" v-model="params.classification"
:data="selectTree" :data="selectTree"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/> />
</template> </template>
<template v-if="tabValue == '3' && isAdmin" #filter-department="{ params }"> <template v-if="tabValue == '3' && isAdmin" #filter-department="{ params }">
......
...@@ -31,7 +31,7 @@ if (isUpdate) { ...@@ -31,7 +31,7 @@ if (isUpdate) {
} }
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList() let { list: selectTree }: any = useGetCategoryList()
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
...@@ -171,6 +171,8 @@ const changeProtocol = (data: any) => { ...@@ -171,6 +171,8 @@ const changeProtocol = (data: any) => {
style="width: 100%" style="width: 100%"
v-model="form.classification" v-model="form.classification"
:data="selectTree" :data="selectTree"
node-key="id"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/> />
</el-form-item> </el-form-item>
<el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:"> <el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:">
......
<script setup lang="ts"> <script setup lang="ts">
import { getOtherList } from '../api' import { getOtherList } from '../api'
import CardListItem from '@/components/base/CardListItem.vue' import CardListItem from '@/components/base/CardListItem.vue'
import { Expand } from '@element-plus/icons-vue'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { useProjectList } from '@/composables/useGetProjectList' import { useProjectList } from '@/composables/useGetProjectList'
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
...@@ -100,7 +99,14 @@ const typeFilter = () => { ...@@ -100,7 +99,14 @@ const typeFilter = () => {
<el-tab-pane label="部门资源" name="2"></el-tab-pane> <el-tab-pane label="部门资源" name="2"></el-tab-pane>
<el-tab-pane label="公开资源" name="3"></el-tab-pane> <el-tab-pane label="公开资源" name="3"></el-tab-pane>
</el-tabs> </el-tabs>
<el-icon class="video-head-icon" @click="changeCard"><Expand /></el-icon> <div class="video-head-icon" @click="changeCard">
<img
v-if="!isCard"
src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_card.png"
alt=""
/>
<img v-else src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_list.png" alt="" />
</div>
</div> </div>
<div class="video-tool-btn"> <div class="video-tool-btn">
<router-link <router-link
......
...@@ -10,19 +10,24 @@ const props: any = defineProps<{ data: object; tabIndex: string }>() ...@@ -10,19 +10,24 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
<div class="tool-pop-btn"> <div class="tool-pop-btn">
<div style="min-width: 100%"> <div style="min-width: 100%">
<router-link v-if="props.data.auth_edit" :to="`/resource/video/update?id=${props.data.id}`"> <router-link v-if="props.data.auth_edit" :to="`/resource/video/update?id=${props.data.id}`">
<div class="edit-btn">编辑</div> <div class="edit-btn btn">编辑</div>
</router-link> </router-link>
</div> </div>
<div style="min-width: 100%"> <div style="min-width: 100%">
<router-link v-if="props.data.auth_view" :to="`/resource/video/view?id=${props.data.id}`"> <router-link v-if="props.data.auth_view" :to="`/resource/video/view?id=${props.data.id}`">
<div class="view-btn">查看</div> <div class="view-btn btn">查看</div>
</router-link> </router-link>
</div> </div>
</div> </div>
</div> </div>
<div class="card-item-bottom"> <div class="card-item-bottom">
<div class="item-t"> <div class="item-t">
<div class="text">{{ props.data.created_operator_name }}/{{ props.data.organ_id_name }}</div> <el-popover trigger="hover" placement="right">
<div v-html="props.data.created_operator_name + '/' + props.data.organ_id_name"></div>
<template #reference>
<div class="text">{{ props.data.created_operator_name }}/{{ props.data.organ_id_name }}</div>
</template>
</el-popover>
<div :class="props.data.status == 1 ? 'tag green' : 'tag'">{{ props.data.status_name }}</div> <div :class="props.data.status == 1 ? 'tag green' : 'tag'">{{ props.data.status_name }}</div>
</div> </div>
<div class="item-b"> <div class="item-b">
...@@ -82,7 +87,7 @@ const props: any = defineProps<{ data: object; tabIndex: string }>() ...@@ -82,7 +87,7 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
.edit-btn { .edit-btn {
width: 113px; width: 113px;
line-height: 32px; line-height: 32px;
border: 1px solid #d3d3d3; background: #aa1941;
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
...@@ -90,6 +95,10 @@ const props: any = defineProps<{ data: object; tabIndex: string }>() ...@@ -90,6 +95,10 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
margin: 0 auto 12px; margin: 0 auto 12px;
cursor: pointer; cursor: pointer;
} }
.btn:hover {
background: none;
border: 1px solid #d3d3d3;
}
.view-btn { .view-btn {
width: 113px; width: 113px;
line-height: 32px; line-height: 32px;
......
<script setup lang="ts"> <script setup lang="ts">
import { getVideoList } from '../api' import { getVideoList } from '../api'
import CardListItem from '../components/CardListItem.vue' import CardListItem from '../components/CardListItem.vue'
import { Expand, PictureFilled } from '@element-plus/icons-vue' import { PictureFilled } from '@element-plus/icons-vue'
import { useGetCategoryList } from '@/composables/useGetCategoryList' import { useGetCategoryList } from '@/composables/useGetCategoryList'
import { useProjectList } from '@/composables/useGetProjectList' import { useProjectList } from '@/composables/useGetProjectList'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
...@@ -17,13 +17,12 @@ const store = useMapStore() ...@@ -17,13 +17,12 @@ const store = useMapStore()
const departmentList: any = useProjectList('', '79806610719731712').departmentList const departmentList: any = useProjectList('', '79806610719731712').departmentList
// 筛选下拉选择tree 视频分类 // 筛选下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList() let { list: selectTree }: any = useGetCategoryList()
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
value: 'id' value: 'id'
} }
// 资源出处 tab触发 // 资源出处 tab触发
const tabValue = ref('1') const tabValue = ref('1')
const appList = ref() const appList = ref()
...@@ -101,7 +100,14 @@ const changeCard = () => { ...@@ -101,7 +100,14 @@ const changeCard = () => {
<el-tab-pane label="部门资源" name="2"></el-tab-pane> <el-tab-pane label="部门资源" name="2"></el-tab-pane>
<el-tab-pane label="公开资源" name="3"></el-tab-pane> <el-tab-pane label="公开资源" name="3"></el-tab-pane>
</el-tabs> </el-tabs>
<el-icon class="video-head-icon" @click="changeCard"><Expand /></el-icon> <div class="video-head-icon" @click="changeCard">
<img
v-if="!isCard"
src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_card.png"
alt=""
/>
<img v-else src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/center_resource/change_list.png" alt="" />
</div>
</div> </div>
<div class="video-tool-btn"> <div class="video-tool-btn">
<router-link <router-link
...@@ -132,11 +138,13 @@ const changeCard = () => { ...@@ -132,11 +138,13 @@ const changeCard = () => {
</template> </template>
<template #filter-type="{ params }"> <template #filter-type="{ params }">
<el-tree-select <el-tree-select
node-key="id"
@change="typeFilter" @change="typeFilter"
clearable clearable
:props="defaultProps" :props="defaultProps"
v-model="params.classification" v-model="params.classification"
:data="selectTree" :data="selectTree"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/> />
</template> </template>
<template v-if="tabValue == '3' && isAdmin" #filter-department="{ params }"> <template v-if="tabValue == '3' && isAdmin" #filter-department="{ params }">
......
...@@ -27,7 +27,7 @@ if (isUpdate) { ...@@ -27,7 +27,7 @@ if (isUpdate) {
} }
// 下拉选择tree 视频分类 // 下拉选择tree 视频分类
let { list: selectTree } = useGetCategoryList() let { list: selectTree }: any = useGetCategoryList()
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'category_name', label: 'category_name',
...@@ -175,6 +175,8 @@ const changeProtocol = (data: any) => { ...@@ -175,6 +175,8 @@ const changeProtocol = (data: any) => {
style="width: 100%" style="width: 100%"
v-model="form.data.classification" v-model="form.data.classification"
:data="selectTree" :data="selectTree"
node-key="id"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/> />
</el-form-item> </el-form-item>
<el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:"> <el-form-item label="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;知识点:">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论