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