提交 c96a1a93 authored 作者: lihuihui's avatar lihuihui

update:编辑资源名称

上级 f9e434b2
......@@ -81,8 +81,6 @@
"refThrottled": true,
"refWithControl": true,
"resolveComponent": true,
"resolveRef": true,
"resolveUnref": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
......@@ -110,7 +108,6 @@
"useAttrs": true,
"useBase64": true,
"useBattery": true,
"useBluetooth": true,
"useBreakpoints": true,
"useBroadcastChannel": true,
"useBrowserLocation": true,
......@@ -149,7 +146,6 @@
"useEyeDropper": true,
"useFavicon": true,
"useFetch": true,
"useFileDialog": true,
"useFileSystemAccess": true,
"useFocus": true,
"useFocusWithin": true,
......@@ -158,7 +154,6 @@
"useGamepad": true,
"useGeolocation": true,
"useIdle": true,
"useImage": true,
"useInfiniteScroll": true,
"useIntersectionObserver": true,
"useInterval": true,
......@@ -180,7 +175,6 @@
"useNavigatorLanguage": true,
"useNetwork": true,
"useNow": true,
"useObjectUrl": true,
"useOffsetPagination": true,
"useOnline": true,
"usePageLeave": true,
......@@ -206,14 +200,12 @@
"useSlots": true,
"useSpeechRecognition": true,
"useSpeechSynthesis": true,
"useStepper": true,
"useStorage": true,
"useStorageAsync": true,
"useStyleTag": true,
"useSwipe": true,
"useTemplateRefsList": true,
"useTextSelection": true,
"useTextareaAutosize": true,
"useThrottle": true,
"useThrottleFn": true,
"useThrottledRefHistory": true,
......@@ -240,7 +232,6 @@
"useWindowScroll": true,
"useWindowSize": true,
"watch": true,
"watchArray": true,
"watchAtMost": true,
"watchDebounced": true,
"watchEffect": true,
......@@ -250,7 +241,6 @@
"watchPostEffect": true,
"watchSyncEffect": true,
"watchThrottled": true,
"watchTriggerable": true,
"watchWithFilter": true,
"whenever": true
}
......
......@@ -82,8 +82,6 @@ declare global {
const refThrottled: typeof import('@vueuse/core')['refThrottled']
const refWithControl: typeof import('@vueuse/core')['refWithControl']
const resolveComponent: typeof import('vue')['resolveComponent']
const resolveRef: typeof import('@vueuse/core')['resolveRef']
const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
......@@ -111,7 +109,6 @@ declare global {
const useAttrs: typeof import('vue')['useAttrs']
const useBase64: typeof import('@vueuse/core')['useBase64']
const useBattery: typeof import('@vueuse/core')['useBattery']
const useBluetooth: typeof import('@vueuse/core')['useBluetooth']
const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
......@@ -150,7 +147,6 @@ declare global {
const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper']
const useFavicon: typeof import('@vueuse/core')['useFavicon']
const useFetch: typeof import('@vueuse/core')['useFetch']
const useFileDialog: typeof import('@vueuse/core')['useFileDialog']
const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess']
const useFocus: typeof import('@vueuse/core')['useFocus']
const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
......@@ -159,7 +155,6 @@ declare global {
const useGamepad: typeof import('@vueuse/core')['useGamepad']
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
const useIdle: typeof import('@vueuse/core')['useIdle']
const useImage: typeof import('@vueuse/core')['useImage']
const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
const useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver']
const useInterval: typeof import('@vueuse/core')['useInterval']
......@@ -181,7 +176,6 @@ declare global {
const useNavigatorLanguage: typeof import('@vueuse/core')['useNavigatorLanguage']
const useNetwork: typeof import('@vueuse/core')['useNetwork']
const useNow: typeof import('@vueuse/core')['useNow']
const useObjectUrl: typeof import('@vueuse/core')['useObjectUrl']
const useOffsetPagination: typeof import('@vueuse/core')['useOffsetPagination']
const useOnline: typeof import('@vueuse/core')['useOnline']
const usePageLeave: typeof import('@vueuse/core')['usePageLeave']
......@@ -207,14 +201,12 @@ declare global {
const useSlots: typeof import('vue')['useSlots']
const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
const useStepper: typeof import('@vueuse/core')['useStepper']
const useStorage: typeof import('@vueuse/core')['useStorage']
const useStorageAsync: typeof import('@vueuse/core')['useStorageAsync']
const useStyleTag: typeof import('@vueuse/core')['useStyleTag']
const useSwipe: typeof import('@vueuse/core')['useSwipe']
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
const useTextSelection: typeof import('@vueuse/core')['useTextSelection']
const useTextareaAutosize: typeof import('@vueuse/core')['useTextareaAutosize']
const useThrottle: typeof import('@vueuse/core')['useThrottle']
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
......@@ -241,7 +233,6 @@ declare global {
const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll']
const useWindowSize: typeof import('@vueuse/core')['useWindowSize']
const watch: typeof import('vue')['watch']
const watchArray: typeof import('@vueuse/core')['watchArray']
const watchAtMost: typeof import('@vueuse/core')['watchAtMost']
const watchDebounced: typeof import('@vueuse/core')['watchDebounced']
const watchEffect: typeof import('vue')['watchEffect']
......@@ -251,7 +242,6 @@ declare global {
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
const watchThrottled: typeof import('@vueuse/core')['watchThrottled']
const watchTriggerable: typeof import('@vueuse/core')['watchTriggerable']
const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
const whenever: typeof import('@vueuse/core')['whenever']
}
......@@ -22,7 +22,7 @@ export function searchExam(params: {
paper_categories?: string
page?: number
limit?: number
paper_use_list?:any
paper_use_list?: any
}) {
return httpRequest.get(`/api/qbs/admin/v2/question-papers/resourse_ci`, { params })
}
......@@ -209,11 +209,11 @@ export function delCharacter(data: { id: string; course_id: string }) {
return httpRequest.post('/api/resource/v1/course/course/delete-chapter', data)
}
// 直播列表
export function getLiveList(params: { name: string; page?: number; ['per-page']?: string }) {
export function getLiveList(params: { name: string; page?: number;['per-page']?: string }) {
return httpRequest.get('/api/resource/v1/course/course/search-live', { params })
}
// 专业搜索
export function getMajorList(params: { name: string; page?: number; ['per-page']?: string }) {
export function getMajorList(params: { name: string; page?: number;['per-page']?: string }) {
return httpRequest.get('/api/resource/v1/course/course/search-specialty', { params })
}
// 设置章节开放规则
......
......@@ -141,6 +141,7 @@ if (props.btnInfo.resource_type === '2') {
<AppList v-bind="listOptions" ref="appList">
<template #filter-type="{ params }">
<el-tree-select
filterable
@change="typeFilter"
clearable
:props="defaultProps"
......
<script lang="ts" setup>
import { editCharacter } from '../../api'
import type { FormInstance, FormRules } from 'element-plus'
const emit = defineEmits<Emits>()
const ruleFormRef = ref<FormInstance>()
// 封面状态
const form = reactive({
name: ''
})
const rules = reactive<FormRules>({
name: [{ required: true, message: '请输入节名称', trigger: 'blur' }]
})
const props = defineProps({
isEditResourcesNameDialog: {
type: Boolean,
required: true
},
course_id: {
type: String,
required: true
},
chapterName: {
type: String,
required: true
},
sectionName: {
type: String,
required: true
},
chapterID: {
type: String,
required: true
},
resourceId: {
type: String,
required: true
}
})
interface Emits {
(e: 'update:isEditResourcesNameDialog', isEditResourcesNameDialog: boolean): void
(e: 'create'): void
}
// 取消
const handleCancel = () => {
emit('update:isEditResourcesNameDialog', false)
}
// 确定
const handleConfirm = () => {
const params = Object.assign({ resource_id: props.resourceId, id: props.chapterID, course_id: props.course_id }, form)
console.log(params, '123', props.resourceId)
editCharacter(params).then(() => {
emit('update:isEditResourcesNameDialog', false)
emit('create')
})
}
onMounted(() => {
form.name = props.sectionName
})
</script>
<template>
<el-dialog
:model-value="isEditResourcesNameDialog"
draggable
:before-close="handleCancel"
width="30%"
title="编辑:资源"
>
<el-form :model="form" :rules="rules" ref="ruleFormRef" label-width="100px" label-suffix=":">
<!-- <el-form-item label="所属章" prop="chapterName">
<p>{{ chapterName }}</p>
</el-form-item> -->
<el-form-item label="资源名称" prop="name">
<el-input v-model="form.name" maxlength="25" onkeydown="if (event.keyCode===13){return false;}"></el-input>
</el-form-item>
</el-form>
<template #footer>
<span>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</span>
</template>
</el-dialog>
</template>
......@@ -4,6 +4,8 @@ import { checkPermission } from '@/utils/permission'
import { Plus } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { getCharacter, delCharacter, getVideoDetails, dragChapterList, createCharacter, editCharacter } from '../api'
// 更改资源名称
import EditResourcesName from '../components/stepTwoComponents/EditResourcesName.vue'
import AddSectionDialog from '../components/stepTwoComponents/AddSectionDialog.vue'
import AddLiveDialog from '../components/stepTwoComponents/AddLiveDialog.vue'
import AddVideoDialog from '../components/stepTwoComponents/AddVideoDialog.vue'
......@@ -19,6 +21,10 @@ const dataSource: any = ref([])
const isShowOpenRules = ref(false)
const isShowDialog = ref(false)
const isShowSectionDialog = ref(false)
// 修改资源名称弹窗
const isEditResourcesNameDialog = ref(false)
// 资源id
const resourceId = ref('')
const isShowLiveDialog = ref(false)
const isShowAddDialog = ref(false)
const isShowExamDialog = ref(false)
......@@ -107,16 +113,22 @@ const handleAddSection = (node: any) => {
defaultExpandedKeys.value = [node.key]
}
//编辑章节
const handleEdit = (node: any) => {
isEdit.value = true
const handleEdit = (node: any, type: string) => {
chapterID.value = node.key
if (node.level === 1) {
isShowDialog.value = true
chapterName.value = node.label
if (type !== '3') {
isEdit.value = true
if (node.level === 1) {
isShowDialog.value = true
chapterName.value = node.label
} else {
chapterName.value = node.data.parent_name
sectionName.value = node.label
isShowSectionDialog.value = true
}
} else {
chapterName.value = node.data.parent_name
resourceId.value = node.data.resource.id
isEditResourcesNameDialog.value = true
sectionName.value = node.label
isShowSectionDialog.value = true
}
}
// 删除章节
......@@ -136,7 +148,6 @@ const handleAddDialog = (node: any, item: any) => {
chapterName.value = node.label
btnInfo.value = item
flag.value = true
defaultExpandedKeys.value = [node.key]
if (item.resource_type === '6' && checkPermission('v1-course-search-live')) {
isShowLiveDialog.value = true
......@@ -375,11 +386,10 @@ const handleChangeStatus = (node: any, data: any) => {
style="margin-left: 35px"
>下载</el-link
>
<!-- data.depth !== '3' 资源-->
<el-link
class="btn_edit"
v-if="data.depth !== '3'"
@click="handleEdit(node)"
@click="handleEdit(node, data.depth)"
style="margin-left: 35px"
v-permission="'v1-course-update-chapter'"
>编辑</el-link
......@@ -457,6 +467,17 @@ const handleChangeStatus = (node: any, data: any) => {
<el-button type="primary" @click="router.push('/course/my')">保存</el-button>
</div>
</AppCard>
<!-- 更改资源名称 -->
<EditResourcesName
v-if="isEditResourcesNameDialog === true"
v-model:isEditResourcesNameDialog="isEditResourcesNameDialog"
@create="handleFresh"
:chapterName="chapterName"
:chapterID="chapterID"
:course_id="id"
:sectionName="sectionName"
:resourceId="resourceId"
/>
<!-- 添加章 -->
<AddChapterDialog
v-if="isShowDialog === true"
......
......@@ -53,33 +53,34 @@ const handleClose = (val: any) => {
}
</script>
<template>
<el-dialog title="批量导入视频" :close-on-click-modal="false" :before-close="handleCancel" width="50vw">
<el-form :model="form" label-suffix=":">
<el-form-item label="视频分类" prop="classification">
<el-tree-select
node-key="id"
:render-after-expand="false"
:props="defaultProps"
v-model="form.classification"
:data="selectTree"
clearable
placeholder="视频分类"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/>
</el-form-item>
<el-form-item label="视频文件" prop="source_id" v-if="form.classification !== ''">
<UploadMultipleVideo @upload="uploadVideo" @canClose="handleClose" ref="uploadMultipleVideoRef" />
</el-form-item>
<el-form-item label="视频名称" prop="name">
<el-radio-group v-model="form.name">
<el-radio label="0">源自文件名称</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" @click="handleConfirm" :disabled="closeStatus === false">保存</el-button>
<el-button @click="handleCancel" :disabled="closeStatus === false">取消</el-button>
</template>
</el-dialog>
<!-- <el-dialog title="批量导入视频" :close-on-click-modal="false" :before-close="handleCancel" width="50vw"> -->
<el-form :model="form" label-suffix=":">
<el-form-item label="视频分类" prop="classification">
<el-tree-select
node-key="id"
:render-after-expand="false"
:props="defaultProps"
v-model="form.classification"
:data="selectTree"
clearable
placeholder="视频分类"
:default-expanded-keys="selectTree.length ? [selectTree[0]?.id] : []"
/>
</el-form-item>
<el-form-item label="视频文件" prop="source_id" v-if="form.classification !== ''">
<UploadMultipleVideo @upload="uploadVideo" @canClose="handleClose" ref="uploadMultipleVideoRef" />
</el-form-item>
<el-form-item label="视频名称" prop="name">
<el-radio-group v-model="form.name">
<el-radio label="0">源自文件名称</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<!-- <template #footer> -->
<template>
<el-button type="primary" @click="handleConfirm" :disabled="closeStatus === false">保存</el-button>
<el-button @click="handleCancel" :disabled="closeStatus === false">取消</el-button>
</template>
<!-- </el-dialog> -->
</template>
<style></style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论