人生啊人生 3 meses atrás
pai
commit
9e04f2243a
1 arquivos alterados com 100 adições e 0 exclusões
  1. 100 0
      user_web/src/view/admin/ManageCourse.vue

+ 100 - 0
user_web/src/view/admin/ManageCourse.vue

@@ -79,11 +79,98 @@ let state = ref({
 // 用于表单验证规则必须要的对象
 let ruleFormRef = ref();
 
+const props = { multiple: true }
+// 父子级的学校到班级的数据参数
+const options = [
+    {
+        value: 1,
+        label: 'Asia',
+        children: [
+            {
+                value: 2,
+                label: 'China',
+                children: [
+                { value: 3, label: 'Beijing' },
+                { value: 4, label: 'Shanghai' },
+                { value: 5, label: 'Hangzhou' },
+                ],
+            },
+            {
+                value: 6,
+                label: 'Japan',
+                children: [
+                { value: 7, label: 'Tokyo' },
+                { value: 8, label: 'Osaka' },
+                { value: 9, label: 'Kyoto' },
+                ],
+            },
+            {
+                value: 10,
+                label: 'Korea',
+                children: [
+                { value: 11, label: 'Seoul' },
+                { value: 12, label: 'Busan' },
+                { value: 13, label: 'Taegu' },
+                ],
+            },
+        ],
+    },
+    {
+        value: 14,
+        label: 'Europe',
+        children: [
+            {
+                value: 15,
+                label: 'France',
+                children: [
+                { value: 16, label: 'Paris' },
+                { value: 17, label: 'Marseille' },
+                { value: 18, label: 'Lyon' },
+                ],
+            },
+            {
+                value: 19,
+                label: 'UK',
+                children: [
+                { value: 20, label: 'London' },
+                { value: 21, label: 'Birmingham' },
+                { value: 22, label: 'Manchester' },
+                ],
+            },
+        ],
+    },
+    {
+        value: 23,
+        label: 'North America',
+        children: [
+            {
+                value: 24,
+                label: 'US',
+                children: [
+                { value: 25, label: 'New York' },
+                { value: 26, label: 'Los Angeles' },
+                { value: 27, label: 'Washington' },
+                ],
+            },
+            {
+                value: 28,
+                label: 'Canada',
+                children: [
+                { value: 29, label: 'Toronto' },
+                { value: 30, label: 'Montreal' },
+                { value: 31, label: 'Ottawa' },
+                ],
+            },
+        ],
+    },
+]
+
 /**
  * 添加,最后提交的数据
  */
 let addParams = ref({
     name: '',
+    classIds: [],
 });
 
 /**
@@ -92,6 +179,7 @@ let addParams = ref({
 const addParamsInit = () => {
     addParams.value = {
         name: '',
+        classIds: [],
     }
 }
 
@@ -100,6 +188,13 @@ const addParamsInit = () => {
  */
 let addRules = ref({
     name: [{ required: true, message: '请填写课程', trigger: 'blur' }],
+    classIds: [
+        {
+            required: true,
+            message: '请选择班级',
+            trigger: 'change',
+        },
+    ],
 });
 
 
@@ -506,6 +601,11 @@ onMounted(function() {
                         <el-input v-model="addParams.name" clearable placeholder="请填写课程"></el-input>
                     </el-form-item>
                 </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-form-item>
+                </el-form>
                 <div class="dialogFoot">
                     <el-button color="#EAEAEA" @click="state.showDialog = false" style="margin-right: 0.6rem">取消</el-button>
                     <el-button color="#2C68FF" @click="submitForm(ruleFormRef)">确认</el-button>