|
@@ -8,7 +8,8 @@ import {
|
|
NTag,
|
|
NTag,
|
|
NModal,
|
|
NModal,
|
|
NProgress,
|
|
NProgress,
|
|
- NTooltip
|
|
|
|
|
|
+ NTooltip,
|
|
|
|
+ useMessage
|
|
} from 'naive-ui';
|
|
} from 'naive-ui';
|
|
import pTag from './images/p-tag.png';
|
|
import pTag from './images/p-tag.png';
|
|
import eTag from './images/e-tag.png';
|
|
import eTag from './images/e-tag.png';
|
|
@@ -23,6 +24,8 @@ import eMessage from './images/e-message.png';
|
|
import { useUserStore } from '/src/store/modules/users';
|
|
import { useUserStore } from '/src/store/modules/users';
|
|
import CardPreview from '/src/components/card-preview';
|
|
import CardPreview from '/src/components/card-preview';
|
|
import { vaildUrl } from '/src/utils/urlUtils';
|
|
import { vaildUrl } from '/src/utils/urlUtils';
|
|
|
|
+import { musicPracticeRecordDetail } from '/src/views/prepare-lessons/api';
|
|
|
|
+import { checkUrlType } from '/src/utils';
|
|
type ItemType = {
|
|
type ItemType = {
|
|
id: string | number;
|
|
id: string | number;
|
|
trainingType: 'PRACTICE' | 'EVALUATION';
|
|
trainingType: 'PRACTICE' | 'EVALUATION';
|
|
@@ -32,6 +35,8 @@ type ItemType = {
|
|
typeList: string[];
|
|
typeList: string[];
|
|
allTimes?: number;
|
|
allTimes?: number;
|
|
trainingTimes?: number;
|
|
trainingTimes?: number;
|
|
|
|
+ recordId?: string | number; // 评测记录编号
|
|
|
|
+ musicPracticeRecordId?: string | number;
|
|
};
|
|
};
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
@@ -66,7 +71,7 @@ export default defineComponent({
|
|
emits: ['click', 'delete', 'edit', 'offShelf'],
|
|
emits: ['click', 'delete', 'edit', 'offShelf'],
|
|
setup(props, { emit }) {
|
|
setup(props, { emit }) {
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
-
|
|
|
|
|
|
+ const message = useMessage();
|
|
const removeVisiable = ref(false);
|
|
const removeVisiable = ref(false);
|
|
const previewShow = ref(false);
|
|
const previewShow = ref(false);
|
|
const preivewItem = ref({
|
|
const preivewItem = ref({
|
|
@@ -82,13 +87,17 @@ export default defineComponent({
|
|
// window.open(src, '_blank');
|
|
// window.open(src, '_blank');
|
|
// console.log(props.item, 'item');
|
|
// console.log(props.item, 'item');
|
|
// console.log(props.item, '1212');
|
|
// console.log(props.item, '1212');
|
|
|
|
+ preivewItem.value = {
|
|
|
|
+ type: 'MUSIC',
|
|
|
|
+ content: props.item.musicId,
|
|
|
|
+ title: props.item.musicName
|
|
|
|
+ };
|
|
previewShow.value = true;
|
|
previewShow.value = true;
|
|
};
|
|
};
|
|
|
|
|
|
const reportSrc = ref('');
|
|
const reportSrc = ref('');
|
|
const detailVisiable = ref(false);
|
|
const detailVisiable = ref(false);
|
|
const gotoRecode = (row: any) => {
|
|
const gotoRecode = (row: any) => {
|
|
- console.log(row.id, 'gotoRecode');
|
|
|
|
const tockn = userStore.getToken;
|
|
const tockn = userStore.getToken;
|
|
reportSrc.value =
|
|
reportSrc.value =
|
|
vaildUrl() +
|
|
vaildUrl() +
|
|
@@ -96,6 +105,39 @@ export default defineComponent({
|
|
detailVisiable.value = true;
|
|
detailVisiable.value = true;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const onBackLook = async () => {
|
|
|
|
+ try {
|
|
|
|
+ if (!props.item?.musicPracticeRecordId) {
|
|
|
|
+ message.error('暂无数据');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const { data } = await musicPracticeRecordDetail({
|
|
|
|
+ id: props.item.musicPracticeRecordId
|
|
|
|
+ });
|
|
|
|
+ if (data.videoFilePath || data.recordFilePath) {
|
|
|
|
+ let lookTitle = '';
|
|
|
|
+ if (data.videoFilePath) {
|
|
|
|
+ lookTitle = checkUrlType(data.videoFilePath);
|
|
|
|
+ } else {
|
|
|
|
+ lookTitle = checkUrlType(data.recordFilePath);
|
|
|
|
+ }
|
|
|
|
+ const lookUrl = data.videoFilePath || data.recordFilePath;
|
|
|
|
+ preivewItem.value.content = lookUrl;
|
|
|
|
+ preivewItem.value.title = props.item.musicName;
|
|
|
|
+ if (lookTitle === 'video') {
|
|
|
|
+ preivewItem.value.type = 'VIDEO';
|
|
|
|
+ } else if (lookTitle === 'audio') {
|
|
|
|
+ preivewItem.value.type = 'SONG';
|
|
|
|
+ }
|
|
|
|
+ previewShow.value = true;
|
|
|
|
+ } else {
|
|
|
|
+ message.error('暂无数据');
|
|
|
|
+ }
|
|
|
|
+ } catch {
|
|
|
|
+ //
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
const isPass = computed(() => {
|
|
const isPass = computed(() => {
|
|
const item = props.item;
|
|
const item = props.item;
|
|
if (item) {
|
|
if (item) {
|
|
@@ -115,6 +157,18 @@ export default defineComponent({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ const isDownload = computed(() => {
|
|
|
|
+ if (
|
|
|
|
+ props.isDisabled &&
|
|
|
|
+ !props.isCLassWork &&
|
|
|
|
+ props.item.trainingType === 'EVALUATION'
|
|
|
|
+ ) {
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
return () => (
|
|
return () => (
|
|
<div
|
|
<div
|
|
class={[
|
|
class={[
|
|
@@ -296,13 +350,13 @@ export default defineComponent({
|
|
props.item.trainingType === 'EVALUATION' ? (
|
|
props.item.trainingType === 'EVALUATION' ? (
|
|
<>
|
|
<>
|
|
<NSpace size={6}>
|
|
<NSpace size={6}>
|
|
- {/* <n-button
|
|
|
|
|
|
+ <n-button
|
|
quaternary
|
|
quaternary
|
|
disabled={props.isDelete}
|
|
disabled={props.isDelete}
|
|
class={styles.operation}
|
|
class={styles.operation}
|
|
onClick={(e: MouseEvent) => {
|
|
onClick={(e: MouseEvent) => {
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
- removeVisiable.value = true;
|
|
|
|
|
|
+ gotoRecode({ id: props.item.recordId });
|
|
}}>
|
|
}}>
|
|
<NTooltip showArrow={false}>
|
|
<NTooltip showArrow={false}>
|
|
{{
|
|
{{
|
|
@@ -317,7 +371,9 @@ export default defineComponent({
|
|
class={styles.operation}
|
|
class={styles.operation}
|
|
onClick={(e: MouseEvent) => {
|
|
onClick={(e: MouseEvent) => {
|
|
e.stopPropagation();
|
|
e.stopPropagation();
|
|
- onDetail();
|
|
|
|
|
|
+ // onDetail();
|
|
|
|
+ // musicPracticeRecordId;
|
|
|
|
+ onBackLook();
|
|
}}>
|
|
}}>
|
|
<NTooltip showArrow={false}>
|
|
<NTooltip showArrow={false}>
|
|
{{
|
|
{{
|
|
@@ -325,7 +381,7 @@ export default defineComponent({
|
|
default: '查看回放'
|
|
default: '查看回放'
|
|
}}
|
|
}}
|
|
</NTooltip>
|
|
</NTooltip>
|
|
- </n-button> */}
|
|
|
|
|
|
+ </n-button>
|
|
{/* <n-button
|
|
{/* <n-button
|
|
quaternary
|
|
quaternary
|
|
disabled={props.isDelete}
|
|
disabled={props.isDelete}
|
|
@@ -389,6 +445,7 @@ export default defineComponent({
|
|
<CardPreview
|
|
<CardPreview
|
|
v-model:show={previewShow.value}
|
|
v-model:show={previewShow.value}
|
|
item={preivewItem.value}
|
|
item={preivewItem.value}
|
|
|
|
+ isDownload={isDownload.value}
|
|
/>
|
|
/>
|
|
|
|
|
|
<NModal
|
|
<NModal
|