|
@@ -1,4 +1,4 @@
|
|
|
-import { PropType, defineComponent, ref } from 'vue';
|
|
|
+import { PropType, computed, defineComponent, ref } from 'vue';
|
|
|
import styles from './index.module.less';
|
|
|
import {
|
|
|
NButton,
|
|
@@ -7,17 +7,22 @@ import {
|
|
|
NImage,
|
|
|
NTag,
|
|
|
NModal,
|
|
|
- NProgress
|
|
|
+ NProgress,
|
|
|
+ NTooltip
|
|
|
} from 'naive-ui';
|
|
|
import pTag from './images/p-tag.png';
|
|
|
import eTag from './images/e-tag.png';
|
|
|
import pEdit from './images/p-edit.png';
|
|
|
import eEdit from './images/e-edit.png';
|
|
|
-import pDelete from './images/p-delete.svg';
|
|
|
-import eDelete from './images/e-delete.svg';
|
|
|
+import pDelete from './images/p-delete.png';
|
|
|
+import eDelete from './images/e-delete.png';
|
|
|
import iconDelete from './images/icon-delete.png';
|
|
|
+import eBackLook from './images/e-back-look.png';
|
|
|
+import eReport from './images/e-report.png';
|
|
|
+import eMessage from './images/e-message.png';
|
|
|
import { useUserStore } from '/src/store/modules/users';
|
|
|
import CardPreview from '/src/components/card-preview';
|
|
|
+import { vaildUrl } from '/src/utils/urlUtils';
|
|
|
type ItemType = {
|
|
|
id: string | number;
|
|
|
trainingType: 'PRACTICE' | 'EVALUATION';
|
|
@@ -74,6 +79,36 @@ export default defineComponent({
|
|
|
previewShow.value = true;
|
|
|
};
|
|
|
|
|
|
+ const reportSrc = ref('');
|
|
|
+ const detailVisiable = ref(false);
|
|
|
+ const gotoRecode = (row: any) => {
|
|
|
+ console.log(row.id, 'gotoRecode');
|
|
|
+ const tockn = userStore.getToken;
|
|
|
+ reportSrc.value =
|
|
|
+ vaildUrl() +
|
|
|
+ `/instrument/#/evaluat-report?id=${row.id}&Authorization=${tockn}`;
|
|
|
+ detailVisiable.value = true;
|
|
|
+ };
|
|
|
+
|
|
|
+ const isPass = computed(() => {
|
|
|
+ const item = props.item;
|
|
|
+ if (item) {
|
|
|
+ if (item.trainingType === 'EVALUATION') {
|
|
|
+ return (item.trainingTimes || 0) >= (item.allTimes || 0)
|
|
|
+ ? '#6CFFC1'
|
|
|
+ : '#FF7794';
|
|
|
+ } else {
|
|
|
+ return (item.trainingTimes
|
|
|
+ ? parseInt(item.trainingTimes / 60 + '')
|
|
|
+ : 0) >= (item.allTimes || 0)
|
|
|
+ ? '#6CFFC1'
|
|
|
+ : '#FF7794';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
return () => (
|
|
|
<div
|
|
|
class={[
|
|
@@ -139,9 +174,11 @@ export default defineComponent({
|
|
|
type="circle"
|
|
|
rail-color={'8b8b8b'}
|
|
|
color={
|
|
|
- props.item.trainingType === 'EVALUATION'
|
|
|
- ? '#FF7E65'
|
|
|
- : '#44B3FF'
|
|
|
+ // props.item.trainingType === 'EVALUATION'
|
|
|
+ // ? '#FF7E65'
|
|
|
+ // : '#44B3FF'
|
|
|
+
|
|
|
+ isPass.value ? '#6CFFC1' : '#FF7794'
|
|
|
}
|
|
|
style="width: 120px; margin: 0 0 10px;">
|
|
|
<div class={styles.BProgress}>
|
|
@@ -161,7 +198,6 @@ export default defineComponent({
|
|
|
)}
|
|
|
|
|
|
<p>
|
|
|
- {' '}
|
|
|
{props.item.trainingType === 'EVALUATION'
|
|
|
? '学生分数'
|
|
|
: '实际练习'}{' '}
|
|
@@ -204,9 +240,20 @@ export default defineComponent({
|
|
|
e.stopPropagation();
|
|
|
emit('edit', props.item);
|
|
|
}}>
|
|
|
- <img
|
|
|
- src={props.item.trainingType === 'EVALUATION' ? eEdit : pEdit}
|
|
|
- />
|
|
|
+ <NTooltip showArrow={false}>
|
|
|
+ {{
|
|
|
+ trigger: () => (
|
|
|
+ <img
|
|
|
+ src={
|
|
|
+ props.item.trainingType === 'EVALUATION'
|
|
|
+ ? eEdit
|
|
|
+ : pEdit
|
|
|
+ }
|
|
|
+ />
|
|
|
+ ),
|
|
|
+ default: '编辑'
|
|
|
+ }}
|
|
|
+ </NTooltip>
|
|
|
</n-button>
|
|
|
{props.type === 'homework' && (
|
|
|
<n-button
|
|
@@ -218,17 +265,78 @@ export default defineComponent({
|
|
|
// onDelete();
|
|
|
removeVisiable.value = true;
|
|
|
}}>
|
|
|
- <img
|
|
|
- src={
|
|
|
- props.item.trainingType === 'EVALUATION'
|
|
|
- ? eDelete
|
|
|
- : pDelete
|
|
|
- }
|
|
|
- />
|
|
|
+ <NTooltip showArrow={false}>
|
|
|
+ {{
|
|
|
+ trigger: () => (
|
|
|
+ <img
|
|
|
+ src={
|
|
|
+ props.item.trainingType === 'EVALUATION'
|
|
|
+ ? eDelete
|
|
|
+ : pDelete
|
|
|
+ }
|
|
|
+ />
|
|
|
+ ),
|
|
|
+ default: '删除'
|
|
|
+ }}
|
|
|
+ </NTooltip>
|
|
|
</n-button>
|
|
|
)}
|
|
|
</NSpace>
|
|
|
)}
|
|
|
+
|
|
|
+ {props.isDisabled && !props.isCLassWork ? (
|
|
|
+ <>
|
|
|
+ <NSpace size={6}>
|
|
|
+ <n-button
|
|
|
+ quaternary
|
|
|
+ disabled={props.isDelete}
|
|
|
+ class={styles.operation}
|
|
|
+ onClick={(e: MouseEvent) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ removeVisiable.value = true;
|
|
|
+ }}>
|
|
|
+ <NTooltip showArrow={false}>
|
|
|
+ {{
|
|
|
+ trigger: () => <img src={eReport} />,
|
|
|
+ default: '评测报告'
|
|
|
+ }}
|
|
|
+ </NTooltip>
|
|
|
+ </n-button>
|
|
|
+ <n-button
|
|
|
+ quaternary
|
|
|
+ disabled={props.isDelete}
|
|
|
+ class={styles.operation}
|
|
|
+ onClick={(e: MouseEvent) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ removeVisiable.value = true;
|
|
|
+ }}>
|
|
|
+ <NTooltip showArrow={false}>
|
|
|
+ {{
|
|
|
+ trigger: () => <img src={eBackLook} />,
|
|
|
+ default: '查看回放'
|
|
|
+ }}
|
|
|
+ </NTooltip>
|
|
|
+ </n-button>
|
|
|
+ {/* <n-button
|
|
|
+ quaternary
|
|
|
+ disabled={props.isDelete}
|
|
|
+ class={styles.operation}
|
|
|
+ onClick={(e: MouseEvent) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ removeVisiable.value = true;
|
|
|
+ }}>
|
|
|
+ <NTooltip showArrow={false}>
|
|
|
+ {{
|
|
|
+ trigger: () => <img src={eMessage} />,
|
|
|
+ default: '写评语'
|
|
|
+ }}
|
|
|
+ </NTooltip>
|
|
|
+ </n-button> */}
|
|
|
+ </NSpace>
|
|
|
+ </>
|
|
|
+ ) : (
|
|
|
+ ''
|
|
|
+ )}
|
|
|
</div>
|
|
|
|
|
|
{/* 判断是否下架 */}
|
|
@@ -277,6 +385,20 @@ export default defineComponent({
|
|
|
title: props.item.musicName
|
|
|
}}
|
|
|
/>
|
|
|
+
|
|
|
+ <NModal
|
|
|
+ v-model:show={detailVisiable.value}
|
|
|
+ preset="card"
|
|
|
+ class={['modalTitle background', styles.reportModel]}
|
|
|
+ title={'评测报告'}>
|
|
|
+ <div class={styles.reportContainer} style={{ lineHeight: 0 }}>
|
|
|
+ <iframe
|
|
|
+ width={'100%'}
|
|
|
+ height={'450px'}
|
|
|
+ frameborder="0"
|
|
|
+ src={reportSrc.value}></iframe>
|
|
|
+ </div>
|
|
|
+ </NModal>
|
|
|
</div>
|
|
|
);
|
|
|
}
|