|
@@ -2,16 +2,18 @@
|
|
<div class="dsion-step2">
|
|
<div class="dsion-step2">
|
|
<BasicTable @register="registerTable" :searchInfo="searchInfo">
|
|
<BasicTable @register="registerTable" :searchInfo="searchInfo">
|
|
<template #toolbar>
|
|
<template #toolbar>
|
|
- <a-button type="primary" @click="handelImport" :disabled="status === 1">导入</a-button>
|
|
|
|
- <a-button type="primary" @click="handelAdd" :disabled="status === 1">添加</a-button>
|
|
|
|
- <a-button type="primary" @click="handelSave" :disabled="status === 1">保存</a-button>
|
|
|
|
|
|
+ <a-button type="primary" @click="handelImport" :disabled="state.status === 1">
|
|
|
|
+ 导入
|
|
|
|
+ </a-button>
|
|
|
|
+ <a-button type="primary" @click="handelAdd" :disabled="state.status === 1">添加</a-button>
|
|
|
|
+ <a-button type="primary" @click="handelSave" :disabled="state.status === 1">保存</a-button>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template #majorSetId="{ record, column }">
|
|
<template #majorSetId="{ record, column }">
|
|
<Select
|
|
<Select
|
|
v-model:value="record[column.dataIndex]"
|
|
v-model:value="record[column.dataIndex]"
|
|
:options="majorSetOptions"
|
|
:options="majorSetOptions"
|
|
- :disabled="status === 1"
|
|
|
|
|
|
+ :disabled="state.status === 1"
|
|
:showSearch="true"
|
|
:showSearch="true"
|
|
:filterOption="filterOption"
|
|
:filterOption="filterOption"
|
|
style="margin: -5px 0; width: 100%"
|
|
style="margin: -5px 0; width: 100%"
|
|
@@ -21,7 +23,7 @@
|
|
<Select
|
|
<Select
|
|
v-model:value="record[column.dataIndex]"
|
|
v-model:value="record[column.dataIndex]"
|
|
:options="classTypeOptions"
|
|
:options="classTypeOptions"
|
|
- :disabled="status === 1"
|
|
|
|
|
|
+ :disabled="state.status === 1"
|
|
:showSearch="true"
|
|
:showSearch="true"
|
|
:filterOption="filterOption"
|
|
:filterOption="filterOption"
|
|
style="margin: -5px 0; width: 100%"
|
|
style="margin: -5px 0; width: 100%"
|
|
@@ -31,7 +33,7 @@
|
|
<a-input
|
|
<a-input
|
|
v-model:value="record[column.dataIndex]"
|
|
v-model:value="record[column.dataIndex]"
|
|
placeholder="班级名称"
|
|
placeholder="班级名称"
|
|
- :disabled="status === 1"
|
|
|
|
|
|
+ :disabled="state.status === 1"
|
|
style="margin: -5px 0; width: 100%"
|
|
style="margin: -5px 0; width: 100%"
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
@@ -39,7 +41,7 @@
|
|
<a-input-number
|
|
<a-input-number
|
|
v-model:value="record[column.dataIndex]"
|
|
v-model:value="record[column.dataIndex]"
|
|
placeholder="班级人数"
|
|
placeholder="班级人数"
|
|
- :disabled="status === 1"
|
|
|
|
|
|
+ :disabled="state.status === 1"
|
|
style="margin: -5px 0; width: 100%"
|
|
style="margin: -5px 0; width: 100%"
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
@@ -47,7 +49,7 @@
|
|
<Select
|
|
<Select
|
|
v-model:value="record[column.dataIndex]"
|
|
v-model:value="record[column.dataIndex]"
|
|
:options="teacherOptions"
|
|
:options="teacherOptions"
|
|
- :disabled="status === 1"
|
|
|
|
|
|
+ :disabled="state.status === 1"
|
|
:showSearch="true"
|
|
:showSearch="true"
|
|
:filterOption="filterOption"
|
|
:filterOption="filterOption"
|
|
style="margin: -5px 0; width: 100%"
|
|
style="margin: -5px 0; width: 100%"
|
|
@@ -57,20 +59,20 @@
|
|
<Select
|
|
<Select
|
|
v-model:value="record[column.dataIndex]"
|
|
v-model:value="record[column.dataIndex]"
|
|
:options="classroomOptions"
|
|
:options="classroomOptions"
|
|
- :disabled="status === 1"
|
|
|
|
|
|
+ :disabled="state.status === 1"
|
|
:showSearch="true"
|
|
:showSearch="true"
|
|
:filterOption="filterOption"
|
|
:filterOption="filterOption"
|
|
style="margin: -5px 0; width: 100%"
|
|
style="margin: -5px 0; width: 100%"
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
<template #isOrderClass="{ record, column }">
|
|
<template #isOrderClass="{ record, column }">
|
|
- <Checkbox :disabled="status === 1" v-model:checked="record[column.dataIndex]" />
|
|
|
|
|
|
+ <Checkbox :disabled="state.status === 1" v-model:checked="record[column.dataIndex]" />
|
|
</template>
|
|
</template>
|
|
<template #sortCode="{ record, column }">
|
|
<template #sortCode="{ record, column }">
|
|
<a-input-number
|
|
<a-input-number
|
|
v-model:value="record[column.dataIndex]"
|
|
v-model:value="record[column.dataIndex]"
|
|
placeholder="排序"
|
|
placeholder="排序"
|
|
- :disabled="status === 1"
|
|
|
|
|
|
+ :disabled="state.status === 1"
|
|
style="margin: -5px 0; width: 100%"
|
|
style="margin: -5px 0; width: 100%"
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
@@ -79,13 +81,13 @@
|
|
:actions="[
|
|
:actions="[
|
|
{
|
|
{
|
|
label: '保存',
|
|
label: '保存',
|
|
- disabled: status === 1,
|
|
|
|
|
|
+ disabled: state.status === 1,
|
|
onClick: handleSave.bind(null, record),
|
|
onClick: handleSave.bind(null, record),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '删除',
|
|
label: '删除',
|
|
color: 'error',
|
|
color: 'error',
|
|
- disabled: status === 1,
|
|
|
|
|
|
+ disabled: state.status === 1,
|
|
onClick: handleDelete.bind(null, record),
|
|
onClick: handleDelete.bind(null, record),
|
|
},
|
|
},
|
|
]"
|
|
]"
|
|
@@ -98,7 +100,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
- import { reactive, ref, watch, onMounted } from 'vue';
|
|
|
|
|
|
+ import { reactive, ref, onMounted } from 'vue';
|
|
import { BasicTable, useTable, TableAction, EditRecordRow } from '/@/components/Table';
|
|
import { BasicTable, useTable, TableAction, EditRecordRow } from '/@/components/Table';
|
|
import { table2Columns } from '../data.config';
|
|
import { table2Columns } from '../data.config';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
@@ -108,7 +110,6 @@
|
|
import {
|
|
import {
|
|
deleteBandingBandingTaskClass,
|
|
deleteBandingBandingTaskClass,
|
|
getBandingTaskClassList,
|
|
getBandingTaskClassList,
|
|
- postBandingBandingTaskClass,
|
|
|
|
putBandingBandingTaskClass,
|
|
putBandingBandingTaskClass,
|
|
} from '/@/services/apis/BandingTaskClassController';
|
|
} from '/@/services/apis/BandingTaskClassController';
|
|
import { getMajorSetOption } from '/@/api/userMagic';
|
|
import { getMajorSetOption } from '/@/api/userMagic';
|
|
@@ -148,20 +149,11 @@
|
|
|
|
|
|
const searchInfo = reactive<Recordable>({});
|
|
const searchInfo = reactive<Recordable>({});
|
|
|
|
|
|
- const props = defineProps({
|
|
|
|
- taskId: { type: String, default: '' },
|
|
|
|
- status: { type: Number, default: 0 },
|
|
|
|
|
|
+ const state = reactive({
|
|
|
|
+ taskId: '',
|
|
|
|
+ status: 0,
|
|
});
|
|
});
|
|
|
|
|
|
- watch(
|
|
|
|
- () => props.taskId,
|
|
|
|
- async (newVal) => {
|
|
|
|
- if (newVal) {
|
|
|
|
- searchInfo.bandingTaskId = newVal;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
const { createMessage } = useMessage();
|
|
const { createMessage } = useMessage();
|
|
|
|
|
|
const handelAdd = () => {
|
|
const handelAdd = () => {
|
|
@@ -189,7 +181,7 @@
|
|
await putBandingBandingTaskClass([
|
|
await putBandingBandingTaskClass([
|
|
{
|
|
{
|
|
...data,
|
|
...data,
|
|
- bandingTaskId: props.taskId,
|
|
|
|
|
|
+ bandingTaskId: state.taskId,
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
} else {
|
|
} else {
|
|
@@ -215,7 +207,7 @@
|
|
dataItem['isOrderClass'] = dataItem['isOrderClass'] || dataItem['isOrderClass'] === 1 ? 1 : 0;
|
|
dataItem['isOrderClass'] = dataItem['isOrderClass'] || dataItem['isOrderClass'] === 1 ? 1 : 0;
|
|
if (item._newRow) {
|
|
if (item._newRow) {
|
|
delete dataItem.id;
|
|
delete dataItem.id;
|
|
- Object.assign(dataItem, { bandingTaskId: props.taskId });
|
|
|
|
|
|
+ Object.assign(dataItem, { bandingTaskId: state.taskId });
|
|
}
|
|
}
|
|
postData.push(dataItem);
|
|
postData.push(dataItem);
|
|
});
|
|
});
|
|
@@ -231,7 +223,7 @@
|
|
};
|
|
};
|
|
|
|
|
|
const handelImport = () => {
|
|
const handelImport = () => {
|
|
- openImportModal(true, { baseData: { taskId: props.taskId } });
|
|
|
|
|
|
+ openImportModal(true, { baseData: { taskId: state.taskId } });
|
|
};
|
|
};
|
|
|
|
|
|
const handleSuccess = () => {
|
|
const handleSuccess = () => {
|
|
@@ -241,14 +233,17 @@
|
|
const validateStep = () => {
|
|
const validateStep = () => {
|
|
return true;
|
|
return true;
|
|
};
|
|
};
|
|
- const reloadStep = () => {
|
|
|
|
|
|
+ const reloadStep = (data) => {
|
|
|
|
+ state.taskId = data.taskId;
|
|
|
|
+ state.status = data.status;
|
|
|
|
+ searchInfo.bandingTaskId = data.taskId;
|
|
reload();
|
|
reload();
|
|
};
|
|
};
|
|
|
|
|
|
- const majorSetOptions = ref([]);
|
|
|
|
- const teacherOptions = ref([]);
|
|
|
|
- const classroomOptions = ref([]);
|
|
|
|
- const classTypeOptions = ref([]);
|
|
|
|
|
|
+ const majorSetOptions = ref<Recordable[]>([]);
|
|
|
|
+ const teacherOptions = ref<Recordable[]>([]);
|
|
|
|
+ const classroomOptions = ref<Recordable[]>([]);
|
|
|
|
+ const classTypeOptions = ref<Recordable[]>([]);
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
majorSetOptions.value = await getMajorSetOption();
|
|
majorSetOptions.value = await getMajorSetOption();
|