|
@@ -1,4 +1,4 @@
|
|
|
-import { PropType, defineComponent } from 'vue';
|
|
|
+import { PropType, defineComponent, ref } from 'vue';
|
|
|
import styles from './index.module.less';
|
|
|
import {
|
|
|
NButton,
|
|
@@ -6,14 +6,13 @@ import {
|
|
|
NSpace,
|
|
|
NImage,
|
|
|
NTag,
|
|
|
- useDialog,
|
|
|
+ NModal,
|
|
|
NProgress
|
|
|
} from 'naive-ui';
|
|
|
import pTag from './images/p-tag.svg';
|
|
|
import eTag from './images/e-tag.svg';
|
|
|
import pEdit from './images/p-edit.svg';
|
|
|
import eEdit from './images/e-edit.svg';
|
|
|
-import iconPause from './images/icon-pause.svg';
|
|
|
import pDelete from './images/p-delete.svg';
|
|
|
import eDelete from './images/e-delete.svg';
|
|
|
import iconDelete from './images/icon-delete.png';
|
|
@@ -61,21 +60,8 @@ export default defineComponent({
|
|
|
emits: ['click', 'delete', 'edit', 'offShelf'],
|
|
|
setup(props, { emit }) {
|
|
|
const userStore = useUserStore();
|
|
|
- const dialog = useDialog();
|
|
|
-
|
|
|
- const onDelete = () => {
|
|
|
- const dialogT = dialog.warning({
|
|
|
- title: '提示',
|
|
|
- content: '您确定是否删除?',
|
|
|
- positiveText: '确定',
|
|
|
- negativeText: '取消',
|
|
|
- onPositiveClick: () => {
|
|
|
- dialogT.loading = true;
|
|
|
- emit('delete', props.item);
|
|
|
- }
|
|
|
- });
|
|
|
- };
|
|
|
|
|
|
+ const removeVisiable = ref(false);
|
|
|
const onDetail = () => {
|
|
|
const origin = /(localhost|192)/.test(location.host)
|
|
|
? 'https://dev.kt.colexiu.com'
|
|
@@ -83,9 +69,6 @@ export default defineComponent({
|
|
|
const src = `${origin}/instrument?platform=pc&modelType=practise&id=${props.item.musicId}&Authorization=${userStore.getToken}`;
|
|
|
window.open(src, '_blank');
|
|
|
};
|
|
|
- function rgba(arg0: number, arg1: number, arg2: number, arg3: number) {
|
|
|
- throw new Error('Function not implemented.');
|
|
|
- }
|
|
|
|
|
|
return () => (
|
|
|
<div
|
|
@@ -130,20 +113,23 @@ export default defineComponent({
|
|
|
{props.item.trainingType === 'EVALUATION'
|
|
|
? '评测模式'
|
|
|
: '练习模式'}
|
|
|
- {props.isDisabled ? null : <img src={iconPause} />}
|
|
|
</NButton>
|
|
|
)}
|
|
|
</div>
|
|
|
<div class={styles['train-content']}>
|
|
|
-
|
|
|
<NImage src={props.item.coverImg} previewDisabled objectFit="cover" />
|
|
|
{props.isDisabled && !props.isCLassWork ? (
|
|
|
<div class={styles.disPreview}>
|
|
|
<NProgress
|
|
|
percentage={
|
|
|
- props.item.trainingType === 'EVALUATION' ? (Number(props.item.trainingTimes) /
|
|
|
- Number(props.item.allTimes)) *
|
|
|
- 100 : ((Number(props.item.trainingTimes) / 60) / Number(props.item.allTimes) * 100)
|
|
|
+ props.item.trainingType === 'EVALUATION'
|
|
|
+ ? (Number(props.item.trainingTimes) /
|
|
|
+ Number(props.item.allTimes)) *
|
|
|
+ 100
|
|
|
+ : (Number(props.item.trainingTimes) /
|
|
|
+ 60 /
|
|
|
+ Number(props.item.allTimes)) *
|
|
|
+ 100
|
|
|
}
|
|
|
offset-degree={180}
|
|
|
type="circle"
|
|
@@ -154,7 +140,6 @@ export default defineComponent({
|
|
|
: '#44B3FF'
|
|
|
}
|
|
|
style="width: 120px; margin: 0 0 10px;">
|
|
|
-
|
|
|
<div class={styles.BProgress}>
|
|
|
{props.item.trainingType === 'EVALUATION' ? (
|
|
|
<h4>
|
|
@@ -164,9 +149,8 @@ export default defineComponent({
|
|
|
</h4>
|
|
|
) : (
|
|
|
<h4>
|
|
|
-
|
|
|
{props.item.trainingTimes
|
|
|
- ? parseInt((props.item.trainingTimes / 60) + '')
|
|
|
+ ? parseInt(props.item.trainingTimes / 60 + '')
|
|
|
: 0}
|
|
|
<span>分钟</span>
|
|
|
</h4>
|
|
@@ -227,7 +211,8 @@ export default defineComponent({
|
|
|
class={styles.operation}
|
|
|
onClick={(e: MouseEvent) => {
|
|
|
e.stopPropagation();
|
|
|
- onDelete();
|
|
|
+ // onDelete();
|
|
|
+ removeVisiable.value = true;
|
|
|
}}>
|
|
|
<img
|
|
|
src={
|
|
@@ -254,6 +239,30 @@ export default defineComponent({
|
|
|
</NButton>
|
|
|
</div>
|
|
|
)}
|
|
|
+
|
|
|
+ <NModal
|
|
|
+ v-model:show={removeVisiable.value}
|
|
|
+ preset="card"
|
|
|
+ class={['modalTitle', styles.removeVisiable]}
|
|
|
+ title={'提示'}>
|
|
|
+ <div class={styles.studentRemove}>
|
|
|
+ <p>您确定是否删除?</p>
|
|
|
+
|
|
|
+ <NSpace class={styles.btnGroupModal} justify="center">
|
|
|
+ <NButton
|
|
|
+ round
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ emit('delete', props.item);
|
|
|
+ }}>
|
|
|
+ 确定
|
|
|
+ </NButton>
|
|
|
+ <NButton round onClick={() => (removeVisiable.value = false)}>
|
|
|
+ 取消
|
|
|
+ </NButton>
|
|
|
+ </NSpace>
|
|
|
+ </div>
|
|
|
+ </NModal>
|
|
|
</div>
|
|
|
);
|
|
|
}
|