import { computed, defineComponent, ref } from 'vue'; import { NImage, NDivider, NButton, NModal, useMessage, ImageRenderToolbarProps } from 'naive-ui'; import TheNoticeBar from '/src/components/TheNoticeBar'; import styles from './index.module.less'; import { PageEnum } from '/src/enums/pageEnum'; import nodata from '../images/nomore.png'; import CardPreview from '/src/components/card-preview'; import { checkUrlType, iframeDislableKeyboard } from '/src/utils'; import { useUserStore } from '/src/store/modules/users'; import { vaildMusicScoreUrl } from '/src/utils/urlUtils'; export default defineComponent({ name: 'work-item', props: { item: { type: Object, default: () => ({}) } }, setup(props) { const userStore = useUserStore(); const message = useMessage(); const previewShow = ref(false); const preivewItem = ref({ type: 'MUSIC', content: props.item.musicId, title: props.item.musicName }); const reportSrc = ref(''); const detailVisiable = ref(false); // const isDownload = computed(() => { // if ( // props.item.fileList?.expireFlag && // props.item.fileList?.fileType === 'EVALUATION' // ) { // return true; // } else { // return false; // } // }); return () => (
{/* ("文件类型:评测:EVALUATION,IMG:图片,SOUND:音频,VIDEO:视频") private String fileType; */} {!props.item.fileList?.fileType && ( )} {props.item.fileList?.fileType === 'IMG' && ( { // return [ // nodes.prev, // nodes.next, // nodes.rotateCounterclockwise, // nodes.rotateClockwise, // nodes.resizeToOriginalSize, // nodes.zoomOut, // nodes.close // ]; // }} /> )} {props.item.fileList?.fileType === 'SOUND' && (
{ preivewItem.value.content = props.item.fileList?.filePath; preivewItem.value.title = props.item.musicName; preivewItem.value.type = 'SONG'; previewShow.value = true; }}>
)} {props.item.fileList?.fileType === 'EVALUATION' && (checkUrlType(props.item.fileList?.content) === 'video' ? (
{props.item.trainingType === 'EVALUATION' ? '评测' : '练习'}
{props.item.typeList?.map((type: string, index: number) => ( <> {type} {props.item.typeList.length - 1 > index && ( )} ))}
{props.item.trainingType === 'EVALUATION' ? (
{props.item.trainingTimes}
) : (
{props.item.trainingTimes ? parseInt(props.item.trainingTimes / 60 + '') : 0} 分钟
)}
); } });