|
@@ -79,89 +79,85 @@ let state = ref({
|
|
|
// 用于表单验证规则必须要的对象
|
|
|
let ruleFormRef = ref();
|
|
|
|
|
|
-const props = {
|
|
|
- multiple: true,
|
|
|
- // checkStrictly: true,
|
|
|
-}
|
|
|
// 父子级的学校到班级的数据参数
|
|
|
const options = [
|
|
|
{
|
|
|
- value: 1,
|
|
|
- label: 'Asia',
|
|
|
+ id: 1,
|
|
|
+ name: 'Asia',
|
|
|
children: [
|
|
|
{
|
|
|
- value: 2,
|
|
|
- label: 'China',
|
|
|
+ id: 2,
|
|
|
+ name: 'China',
|
|
|
children: [
|
|
|
- { value: 3, label: 'Beijing' },
|
|
|
- { value: 4, label: 'Shanghai' },
|
|
|
- { value: 5, label: 'Hangzhou' },
|
|
|
+ { id: 3, name: 'Beijing' },
|
|
|
+ { id: 4, name: 'Shanghai' },
|
|
|
+ { id: 5, name: 'Hangzhou' },
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
- value: 6,
|
|
|
- label: 'Japan',
|
|
|
+ id: 6,
|
|
|
+ name: 'Japan',
|
|
|
children: [
|
|
|
- { value: 7, label: 'Tokyo' },
|
|
|
- { value: 8, label: 'Osaka' },
|
|
|
- { value: 9, label: 'Kyoto' },
|
|
|
+ { id: 7, name: 'Tokyo' },
|
|
|
+ { id: 8, name: 'Osaka' },
|
|
|
+ { id: 9, name: 'Kyoto' },
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
- value: 10,
|
|
|
- label: 'Korea',
|
|
|
+ id: 10,
|
|
|
+ name: 'Korea',
|
|
|
children: [
|
|
|
- { value: 11, label: 'Seoul' },
|
|
|
- { value: 12, label: 'Busan' },
|
|
|
- { value: 13, label: 'Taegu' },
|
|
|
+ { id: 11, name: 'Seoul' },
|
|
|
+ { id: 12, name: 'Busan' },
|
|
|
+ { id: 13, name: 'Taegu' },
|
|
|
],
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
- value: 14,
|
|
|
- label: 'Europe',
|
|
|
+ id: 14,
|
|
|
+ name: 'Europe',
|
|
|
children: [
|
|
|
{
|
|
|
- value: 15,
|
|
|
- label: 'France',
|
|
|
+ id: 15,
|
|
|
+ name: 'France',
|
|
|
children: [
|
|
|
- { value: 16, label: 'Paris' },
|
|
|
- { value: 17, label: 'Marseille' },
|
|
|
- { value: 18, label: 'Lyon' },
|
|
|
+ { id: 16, name: 'Paris' },
|
|
|
+ { id: 17, name: 'Marseille' },
|
|
|
+ { id: 18, name: 'Lyon' },
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
- value: 19,
|
|
|
- label: 'UK',
|
|
|
+ id: 19,
|
|
|
+ name: 'UK',
|
|
|
children: [
|
|
|
- { value: 20, label: 'London' },
|
|
|
- { value: 21, label: 'Birmingham' },
|
|
|
- { value: 22, label: 'Manchester' },
|
|
|
+ { id: 20, name: 'London' },
|
|
|
+ { id: 21, name: 'Birmingham' },
|
|
|
+ { id: 22, name: 'Manchester' },
|
|
|
],
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
- value: 23,
|
|
|
- label: 'North America',
|
|
|
+ id: 23,
|
|
|
+ name: 'North America',
|
|
|
children: [
|
|
|
{
|
|
|
- value: 24,
|
|
|
- label: 'US',
|
|
|
+ id: 24,
|
|
|
+ name: 'US',
|
|
|
children: [
|
|
|
- { value: 25, label: 'New York' },
|
|
|
- { value: 26, label: 'Los Angeles' },
|
|
|
- { value: 27, label: 'Washington' },
|
|
|
+ { id: 25, name: 'New York' },
|
|
|
+ { id: 26, name: 'Los Angeles' },
|
|
|
+ { id: 27, name: 'Washington' },
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
- value: 28,
|
|
|
- label: 'Canada',
|
|
|
+ id: 28,
|
|
|
+ name: 'Canada',
|
|
|
children: [
|
|
|
- { value: 29, label: 'Toronto' },
|
|
|
- { value: 30, label: 'Montreal' },
|
|
|
- { value: 31, label: 'Ottawa' },
|
|
|
+ { id: 29, name: 'Toronto' },
|
|
|
+ { id: 30, name: 'Montreal' },
|
|
|
+ { id: 31, name: 'Ottawa' },
|
|
|
],
|
|
|
},
|
|
|
],
|
|
@@ -182,22 +178,11 @@ let addParams = ref({
|
|
|
const addParamsInit = () => {
|
|
|
addParams.value = {
|
|
|
name: '',
|
|
|
- classIds: [
|
|
|
- // [
|
|
|
- // 1,
|
|
|
- // 10,
|
|
|
- // 13
|
|
|
- // ],
|
|
|
- // [
|
|
|
- // 1,
|
|
|
- // 10,
|
|
|
- // 12
|
|
|
- // ],
|
|
|
- // [
|
|
|
- // 1,
|
|
|
- // 10,
|
|
|
- // 11
|
|
|
- // ]
|
|
|
+ classIds:
|
|
|
+ [
|
|
|
+ 29,
|
|
|
+ 30,
|
|
|
+ 31
|
|
|
],
|
|
|
}
|
|
|
}
|
|
@@ -624,7 +609,18 @@ onMounted(function() {
|
|
|
</el-form>
|
|
|
<el-form ref="ruleFormRef" :model="addParams" :rules="addRules">
|
|
|
<el-form-item label="班级" prop="classIds">
|
|
|
- <el-cascader v-model="addParams.classIds" :options="options" :props="props" clearable placeholder="请选择班级" />
|
|
|
+ <el-cascader v-model="addParams.classIds"
|
|
|
+ :options="options"
|
|
|
+ :props="{
|
|
|
+ children: 'children',
|
|
|
+ label: 'name',
|
|
|
+ value: 'id',
|
|
|
+ checkStrictly: false,
|
|
|
+ expandTrigger: 'hover',
|
|
|
+ emitPath: false,
|
|
|
+ multiple: true,
|
|
|
+ }"
|
|
|
+ clearable placeholder="请选择班级" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="dialogFoot">
|