Jelajahi Sumber

科目添加考试时长

罗永浩 5 bulan lalu
induk
melakukan
ec54df5649

+ 2 - 1
addons/admin/src/config/setting.js

@@ -5,7 +5,8 @@ export default {
   version: "1.0",
   name: "后台管理系统", // 项目名称
   loginName: "后台登录", // 项目名称
-  baseURL: "https://api.gxlmcs.com/", // 本地接口地址
+  baseURL: "http://123.57.137.186:8090", // 本地接口地址
+  // baseURL: "https://api.gxlmcs.com/", // 本地接口地址
   // chatURL: 'ws://127.0.4.82:8660',  // 聊天地址
   signKey: "stapp&688", // 签名密钥
   whiteList: ["/login", "/forget"], // 路由白名单(不需要登录的)

+ 8 - 1
addons/admin/src/views/exam/component/SubjectManager.vue

@@ -23,6 +23,7 @@
                         </template>
                     </el-table-column>
                     <el-table-column prop="sort" label="排序" width="100" />
+                    <el-table-column prop="answer_times" label="答题时长(分钟)" width="100" />
                     <el-table-column prop="status" label="状态" width="100">
                         <template slot-scope="{ row }">
                             <el-tag type="success" v-if="row.status === 1">有效</el-tag>
@@ -65,6 +66,9 @@
                             :value="Number(key)" />
                     </el-select>
                 </el-form-item>
+                <el-form-item label="答题时长(分钟)" prop="answer_times">
+                    <el-input-number v-model="formData.answer_times" :min="0" :max="12000" placeholder="请输入答题时长(分钟)" />
+                </el-form-item>
                 <el-form-item label="排序" prop="sort">
                     <el-input-number v-model="formData.sort" :min="0" />
                 </el-form-item>
@@ -111,6 +115,7 @@ export default {
                 attr_type: this.defaultType === 1 ? 3 : null,
                 description: '',
                 icon: '',
+                answer_times: 45,
                 sort: 0,
                 status: 1
             },
@@ -152,7 +157,8 @@ export default {
                     ...row,
                     attr_type: row.attr_type ? Number(row.attr_type) : null,
                     description: row.description || '',
-                    icon: row.icon || ''
+                    icon: row.icon || '',
+                    answer_times: row.answer_times || 45
                 })
             } else {
                 this.resetForm()
@@ -215,6 +221,7 @@ export default {
                 attr_type: this.defaultType === 1 ? 3 : null, // 单招默认为3(职业适应性测试视频课),对口和专升本为null
                 description: '',
                 icon: '',
+                answer_times: 45,
                 sort: 0,
                 status: 1
             })

+ 8 - 4
addons/admin/src/views/subject/subject.vue

@@ -77,7 +77,7 @@
                     <el-table-column prop="attr_type" label="类别属性" width="120" v-if="showAttrTypeColumn">
                         <template slot-scope="{ row }">
                             <el-tag type="success" v-if="row.attr_type">{{ attrTypeOptions[row.attr_type] || '未知'
-                                }}</el-tag>
+                            }}</el-tag>
                             <span v-else>-</span>
                         </template>
                     </el-table-column>
@@ -124,6 +124,9 @@
                             :value="Number(key)" />
                     </el-select>
                 </el-form-item>
+                <el-form-item label="答题时长(分钟)" prop="answer_times">
+                    <el-input-number v-model="formData.answer_times" :min="0" :max="12000" placeholder="请输入答题时长(分钟)" />
+                </el-form-item>
                 <el-form-item label="排序" prop="sort">
                     <el-input-number v-model="formData.sort" :min="0" />
                 </el-form-item>
@@ -155,7 +158,7 @@ export default {
                 where: { keyword: "", type: null, attr_type: null, status: null }
             },
             choose: [],
-            formData: { id: null, subject_name: "", type: 1, attr_type: 3, description: "", icon: "", sort: 0, status: 1 },
+            formData: { id: null, subject_name: "", type: 1, attr_type: 3, description: "", icon: "", answer_times: 45, sort: 0, status: 1 },
             isEdit: false,
             formVisible: false,
             formRules: {
@@ -233,11 +236,12 @@ export default {
                     type: Number(row.type),
                     attr_type: row.attr_type ? Number(row.attr_type) : (Number(row.type) === 1 ? 3 : null),
                     description: row.description || "",
-                    icon: row.icon || ""
+                    icon: row.icon || "",
+                    answer_times: row.answer_times || 45
                 }; // 转成数字
             } else {
                 this.isEdit = false;
-                this.formData = { id: null, subject_name: "", type: 1, attr_type: 3, description: "", icon: "", sort: 0, status: 1 };
+                this.formData = { id: null, subject_name: "", type: 1, attr_type: 3, description: "", icon: "", answer_times: 45, sort: 0, status: 1 };
             }
             this.formVisible = true;
         },

+ 1 - 0
app/Models/ExamSubjectsModel.php

@@ -16,6 +16,7 @@ class ExamSubjectsModel extends BaseModel
         'attr_type',
         'description',
         'icon',
+        'answer_times',
         'sort',
         'create_time',
         'update_time',