|
@@ -39,6 +39,7 @@ import { eventGlobal } from '/src/utils';
|
|
import iconTips from '../../../images/icon-tips.png';
|
|
import iconTips from '../../../images/icon-tips.png';
|
|
import { typeFormat } from '../../resource-main/components/select-music';
|
|
import { typeFormat } from '../../resource-main/components/select-music';
|
|
import TheMessageDialog from '/src/components/TheMessageDialog';
|
|
import TheMessageDialog from '/src/components/TheMessageDialog';
|
|
|
|
+import { useResizeObserver } from '@vueuse/core';
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'courseware-modal',
|
|
name: 'courseware-modal',
|
|
props: {
|
|
props: {
|
|
@@ -210,7 +211,19 @@ export default defineComponent({
|
|
forms.preBtnLoading = false;
|
|
forms.preBtnLoading = false;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const getModalHeight = () => {
|
|
|
|
+ const dom: any = document.querySelector('#model-homework-height');
|
|
|
|
+ if (dom) {
|
|
|
|
+ useResizeObserver(dom as HTMLElement, (entries: any) => {
|
|
|
|
+ const entry = entries[0];
|
|
|
|
+ const { height } = entry.contentRect;
|
|
|
|
+ dom.style.setProperty('--window-page-lesson-height', height + 'px');
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
|
+ getModalHeight();
|
|
await getList();
|
|
await getList();
|
|
// 动态添加数据
|
|
// 动态添加数据
|
|
eventGlobal.on('onTrainAddItem', (item: any) => {
|
|
eventGlobal.on('onTrainAddItem', (item: any) => {
|
|
@@ -240,7 +253,7 @@ export default defineComponent({
|
|
</div>
|
|
</div>
|
|
</NSpace>
|
|
</NSpace>
|
|
|
|
|
|
- <NSpace>
|
|
|
|
|
|
+ <div class={styles.spaceBtnGroup}>
|
|
<NButton
|
|
<NButton
|
|
bordered={false}
|
|
bordered={false}
|
|
type="error"
|
|
type="error"
|
|
@@ -264,9 +277,11 @@ export default defineComponent({
|
|
取消
|
|
取消
|
|
</NButton>
|
|
</NButton>
|
|
|
|
|
|
- {props.cardType === 'homeworkRecord' ? (
|
|
|
|
|
|
+ {(props.cardType !== 'homeworkRecord' ||
|
|
|
|
+ props.courseScheduleId) && (
|
|
<NButton
|
|
<NButton
|
|
- type="primary"
|
|
|
|
|
|
+ bordered={false}
|
|
|
|
+ type="default"
|
|
disabled={forms.trainList.length <= 0}
|
|
disabled={forms.trainList.length <= 0}
|
|
onClick={() => {
|
|
onClick={() => {
|
|
if (!forms.title) {
|
|
if (!forms.title) {
|
|
@@ -283,11 +298,16 @@ export default defineComponent({
|
|
message.error('作业内容不能为空');
|
|
message.error('作业内容不能为空');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- forms.assignHomeworkStatus = true;
|
|
|
|
- }}>
|
|
|
|
- 立即布置
|
|
|
|
|
|
+
|
|
|
|
+ forms.preSaveVisiable = true;
|
|
|
|
+ }}
|
|
|
|
+ // loading={forms.preBtnLoading}
|
|
|
|
+ >
|
|
|
|
+ 保存
|
|
</NButton>
|
|
</NButton>
|
|
- ) : (
|
|
|
|
|
|
+ )}
|
|
|
|
+ {(props.cardType === 'homeworkRecord' ||
|
|
|
|
+ props.courseScheduleId) && (
|
|
<NButton
|
|
<NButton
|
|
type="primary"
|
|
type="primary"
|
|
disabled={forms.trainList.length <= 0}
|
|
disabled={forms.trainList.length <= 0}
|
|
@@ -306,15 +326,12 @@ export default defineComponent({
|
|
message.error('作业内容不能为空');
|
|
message.error('作业内容不能为空');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
- forms.preSaveVisiable = true;
|
|
|
|
- }}
|
|
|
|
- // loading={forms.preBtnLoading}
|
|
|
|
- >
|
|
|
|
- 保存
|
|
|
|
|
|
+ forms.assignHomeworkStatus = true;
|
|
|
|
+ }}>
|
|
|
|
+ 立即布置
|
|
</NButton>
|
|
</NButton>
|
|
)}
|
|
)}
|
|
- </NSpace>
|
|
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<NScrollbar
|
|
<NScrollbar
|
|
@@ -430,36 +447,6 @@ export default defineComponent({
|
|
</NSpin>
|
|
</NSpin>
|
|
</NScrollbar>
|
|
</NScrollbar>
|
|
|
|
|
|
- {props.cardType !== 'homeworkRecord' &&
|
|
|
|
- props.cardType !== 'prepare' && (
|
|
|
|
- <div
|
|
|
|
- class={[styles.btnGroup, styles.btnGroupClass]}
|
|
|
|
- style={{ justifyContent: 'flex-end' }}>
|
|
|
|
- <NSpace justify="end">
|
|
|
|
- <NButton
|
|
|
|
- type="primary"
|
|
|
|
- // {...{ id: 'train-0' }}
|
|
|
|
- // disabled={forms.drag}
|
|
|
|
- disabled={forms.trainList.length <= 0}
|
|
|
|
- onClick={() => {
|
|
|
|
- let count = 0;
|
|
|
|
- forms.trainList.forEach((item: any) => {
|
|
|
|
- if (!item.removeFlag) {
|
|
|
|
- count++;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- if (count <= 0) {
|
|
|
|
- message.error('作业内容不能为空');
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- forms.assignHomeworkStatus = true;
|
|
|
|
- }}>
|
|
|
|
- 立即布置
|
|
|
|
- </NButton>
|
|
|
|
- </NSpace>
|
|
|
|
- </div>
|
|
|
|
- )}
|
|
|
|
-
|
|
|
|
{/* 编辑 */}
|
|
{/* 编辑 */}
|
|
<NModal
|
|
<NModal
|
|
v-model:show={forms.editStatus}
|
|
v-model:show={forms.editStatus}
|