diff --git a/src/components/ali-player/index.vue b/src/components/ali-player/index.vue index e90ebd0..45dc1ad 100644 --- a/src/components/ali-player/index.vue +++ b/src/components/ali-player/index.vue @@ -13,7 +13,14 @@ defineOptions({ const props = defineProps({ source: { type: [String, Array], - required: true, + default: "", + }, + vid: { + type: String, + default: "", + }, + playAuth: { + type: String, default: "", }, cover: { @@ -32,9 +39,9 @@ const props = defineProps({ const visibility = useDocumentVisibility(); onMounted(() => { watch( - () => props.source, + [() => props.source, () => props.vid, () => props.playAuth], () => { - if (props.source) fnCreateAliPlayer(); + if (props.source || (props.vid && props.playAuth)) fnCreateAliPlayer(); }, { immediate: true, @@ -61,6 +68,8 @@ const fnCreateAliPlayer = async () => { { id: "J_prismPlayer", source: props.source, + vid: props.vid, + playauth: props.playAuth, cover: props.cover, width: props.width, height: props.height, diff --git a/src/components/video/index.vue b/src/components/video/index.vue index 84c90a9..19561ed 100644 --- a/src/components/video/index.vue +++ b/src/components/video/index.vue @@ -1,6 +1,11 @@ @@ -16,12 +21,20 @@ defineOptions({ const props = defineProps({ src: { type: String, - required: true, + default: "", + }, + vid: { + type: String, + default: "", + }, + playAuth: { + type: String, + default: "", }, visible: { type: Boolean, - default: false, required: true, + default: false, }, }); const emits = defineEmits(["update:visible"]); diff --git a/src/views/platform_resource_library/courseware/data.vue b/src/views/platform_resource_library/courseware/data.vue index 7004aaa..375f041 100644 --- a/src/views/platform_resource_library/courseware/data.vue +++ b/src/views/platform_resource_library/courseware/data.vue @@ -93,8 +93,15 @@ @@ -136,12 +151,14 @@ import { } from "@/request/platform_resource_library.js"; import useListData from "@/assets/js/useListData.js"; import { reactive } from "vue"; -import { serialNumber } from "@/assets/js/utils.js"; +import { interceptTheSuffix, serialNumber } from "@/assets/js/utils.js"; import LayoutTable from "@/components/table/index.vue"; // import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js"; import { debounce } from "throttle-debounce"; import { ElMessage, ElMessageBox } from "element-plus"; import { useRouter } from "vue-router"; +import LayoutPdf from "@/components/pdf/index.vue"; +import LayoutTxt from "@/components/txt/index.vue"; const router = useRouter(); const { list, pagination, searchForm, fnGetData, fnResetPagination } = @@ -152,6 +169,14 @@ const data = reactive({ { value: "0", label: "启用" }, { value: "1", label: "禁用" }, ], + pdfDialog: { + src: "", + visible: false, + }, + txtDialog: { + src: "", + visible: false, + }, }); // const buttonJurisdiction = await useButtonJurisdiction("courseware"); 原项目没找到在哪用 @@ -162,6 +187,11 @@ const fnAdd = debounce(1000, async (DATACOURSEWARE_ID) => { ElMessage.success("添加成功"); fnResetPagination(); }); + +const fnPreviewPdf = (FILEPATH) => { + data.pdfDialog.visible = true; + data.pdfDialog.src = FILEPATH; +}; diff --git a/src/views/platform_resource_library/courseware/video.vue b/src/views/platform_resource_library/courseware/video.vue index d24e409..c65d151 100644 --- a/src/views/platform_resource_library/courseware/video.vue +++ b/src/views/platform_resource_library/courseware/video.vue @@ -104,8 +104,9 @@