Ver Fonte

feat: 限制输入框输入长度,表格样式调整

chenhao há 2 anos atrás
pai
commit
8e7ad5d6b5

+ 30 - 11
src/pages/exam-manage/index.vue

@@ -19,7 +19,11 @@
           </a-select>
         </a-form-item>
         <a-form-item label="考试批次">
-          <a-input v-model:value="query.name"></a-input>
+          <a-input
+            v-model:value="query.name"
+            placeholder="考试批次"
+            maxlength="50"
+          ></a-input>
         </a-form-item>
         <a-form-item>
           <a-button class="search-button" type="primary" @click="queryExamList"
@@ -110,10 +114,17 @@
           </a-select>
         </a-form-item>
         <a-form-item label="考试批次" v-bind="validateInfos.name">
-          <a-input v-model:value="examInfo.name" placeholder="请输入考试批次"></a-input>
+          <a-input
+            v-model:value="examInfo.name"
+            maxlength="50"
+            placeholder="请输入考试批次"
+          ></a-input>
         </a-form-item>
         <a-form-item label="状态" v-bind="validateInfos.examStatus">
-          <a-select v-model:value="examInfo.examStatus" placeholder="选择考试状态">
+          <a-select
+            v-model:value="examInfo.examStatus"
+            placeholder="选择考试状态"
+          >
             <a-select-option value="EDIT">{{
               EXAM_STATUS.EDIT
             }}</a-select-option>
@@ -161,12 +172,18 @@ const query = reactive<FetchExamListQuery>({
 
 /** table配置 */
 const columns: TableColumnType[] = [
-  { title: "序号", dataIndex: "index", align: "center" },
-  { title: "考试ID", dataIndex: "id" },
-  { title: "考试批次", dataIndex: "name" },
-  { title: "状态", dataIndex: "examStatus", align: "center" },
-  { title: "科目数量", dataIndex: "paperCount" },
-  { title: "操作", dataIndex: "operation" },
+  { title: "序号", dataIndex: "index", align: "center", width: 60 },
+  { title: "考试ID", dataIndex: "id", width: 100, ellipsis: true },
+  { title: "考试批次", dataIndex: "name", ellipsis: true },
+  {
+    title: "状态",
+    dataIndex: "examStatus",
+    align: "center",
+    width: 160,
+    ellipsis: true,
+  },
+  { title: "科目数量", dataIndex: "paperCount", align: "center", width: 100, ellipsis: true },
+  { title: "操作", dataIndex: "operation", align: "center", width: 100 },
 ];
 
 /** 学校列表信息 */
@@ -227,8 +244,10 @@ const querySchoolList = throttle(
 const toggleAddExamModal = (show: boolean = true) => {
   showModal.value = show;
   if (show) {
-    if(!examInfo.id){
-      Object.assign(examInfo, { schoolId: query.schoolId || mainStore.systemUserInfo?.schoolId });
+    if (!examInfo.id) {
+      Object.assign(examInfo, {
+        schoolId: query.schoolId || mainStore.systemUserInfo?.schoolId,
+      });
     }
     querySchoolList("", "form");
   }

+ 1 - 0
src/pages/login/index.vue

@@ -12,6 +12,7 @@
         <a-form-item v-bind="validateInfos.loginName">
           <a-input
             class="login-input login-input-name"
+            maxlength="50"
             v-model:value="loginModel.loginName"
             placeholder="请输入用户名"
           >

+ 23 - 5
src/pages/school-manage/index.vue

@@ -3,7 +3,7 @@
     <Block class="header-block tw-flex tw-items-center tw-justify-between">
       <a-form layout="inline">
         <a-form-item label="学校名称">
-          <a-input v-model:value="query.name"></a-input>
+          <a-input v-model:value="query.name" placeholder="学校名称" maxlength="50"></a-input>
         </a-form-item>
         <a-form-item>
           <a-button
@@ -94,22 +94,40 @@
     >
       <a-form :labelCol="{ span: 6 }">
         <a-form-item label="学校编码" v-bind="validateInfos.code">
-          <a-input :disabled="schoolInfo.id" v-model:value="schoolInfo.code"></a-input>
+          <a-input
+            :disabled="schoolInfo.id"
+            placeholder="学校编码"
+            v-model:value="schoolInfo.code"
+            maxlength="50"
+          ></a-input>
         </a-form-item>
         <a-form-item label="学校名称" v-bind="validateInfos.name">
-          <a-input v-model:value="schoolInfo.name"></a-input>
+          <a-input
+            v-model:value="schoolInfo.name"
+            placeholder="学校名称"
+            maxlength="50"
+          ></a-input>
         </a-form-item>
         <a-form-item label="负责人" v-bind="validateInfos.contacts">
-          <a-input v-model:value="schoolInfo.contacts"></a-input>
+          <a-input
+            v-model:value="schoolInfo.contacts"
+            placeholder="学校负责人"
+            maxlength="50"
+          ></a-input>
         </a-form-item>
         <a-form-item label="联系方式" v-bind="validateInfos.telephone">
           <a-input
             v-model:value="schoolInfo.telephone"
+            placeholder="学校联系方式"
             maxlength="11"
           ></a-input>
         </a-form-item>
         <a-form-item label="地区" v-bind="validateInfos.region">
-          <a-input v-model:value="schoolInfo.region"></a-input>
+          <a-input
+            v-model:value="schoolInfo.region"
+            placeholder="学校所在地区"
+            maxlength="50"
+          ></a-input>
         </a-form-item>
         <a-form-item label="状态">
           <a-radio-group v-model:value="schoolInfo.enable">

+ 27 - 8
src/pages/subjects-manage/index.vue

@@ -43,10 +43,18 @@
           </a-select>
         </a-form-item>
         <a-form-item label="科目代码">
-          <a-input v-model:value="query.courseCode"></a-input>
+          <a-input
+            v-model:value="query.courseCode"
+            placeholder="科目代码"
+            maxlength="50"
+          ></a-input>
         </a-form-item>
         <a-form-item label="科目名称">
-          <a-input v-model:value="query.courseName"></a-input>
+          <a-input
+            v-model:value="query.courseName"
+            placeholder="科目名称"
+            maxlength="50"
+          ></a-input>
         </a-form-item>
         <a-form-item label="试卷总分" class="range-item">
           <a-input v-model:value="query.totalScoreMin"></a-input>
@@ -301,12 +309,23 @@ const query = reactive<
 
 /** table配置 */
 const columns: TableColumnType[] = [
-  { title: "序号", dataIndex: "index", align: "center" },
-  { title: "科目代码", dataIndex: "courseCode" },
-  { title: "科目名称", dataIndex: "courseName" },
-  { title: "主观总分", dataIndex: "subjectiveScore" },
-  { title: "试卷总分", dataIndex: "totalScore" },
-  { title: "分组数", dataIndex: "groupCount" },
+  { title: "序号", dataIndex: "index", align: "center", width: 60 },
+  {
+    title: "科目代码",
+    dataIndex: "courseCode",
+    align: "center",
+    width: 120,
+    ellipsis: true,
+  },
+  { title: "科目名称", dataIndex: "courseName", ellipsis: true },
+  {
+    title: "主观总分",
+    dataIndex: "subjectiveScore",
+    align: "center",
+    width: 100,
+  },
+  { title: "试卷总分", dataIndex: "totalScore", align: "center", width: 100 },
+  { title: "分组数", dataIndex: "groupCount", align: "center", width: 80 },
 ];
 
 /** 学校列表信息 */

+ 20 - 13
src/pages/user-manage/index.vue

@@ -21,6 +21,7 @@
         <a-form-item label="登录名">
           <a-input
             v-model:value="query.loginName"
+            maxlength="50"
             placeholder="登录名"
           ></a-input>
         </a-form-item>
@@ -142,6 +143,7 @@
         <a-form-item label="姓名" v-bind="validateInfos.name">
           <a-input
             v-model:value="userInfo.name"
+            maxlength="50"
             placeholder="请输入姓名"
           ></a-input>
         </a-form-item>
@@ -381,15 +383,20 @@ const query = reactive<FetchUserListQuery>({
 
 /** table配置 */
 const columns: TableColumnType[] = [
-  { title: "序号", dataIndex: "index", align: "center" },
-  { title: "ID", dataIndex: "id" },
-  { title: "姓名", dataIndex: "name" },
-  { title: "登录名", dataIndex: "loginName" },
-  { title: "学校", dataIndex: "schoolName", align: "center" },
-  { title: "角色", dataIndex: "roleName" },
-  { title: "更新时间", dataIndex: "updateTime" },
-  { title: "状态", dataIndex: "enable" },
-  { title: "操作", dataIndex: "operation" },
+  { title: "序号", dataIndex: "index", align: "center", width: 60 },
+  { title: "ID", dataIndex: "id", width: 100, ellipsis: true },
+  { title: "姓名", dataIndex: "name", ellipsis: true },
+  { title: "登录名", dataIndex: "loginName", ellipsis: true },
+  {
+    title: "学校",
+    dataIndex: "schoolName",
+    align: "center",
+    ellipsis: true,
+  },
+  { title: "角色", dataIndex: "roleName", align: "center", width: 120 },
+  { title: "更新时间", dataIndex: "updateTime", width: 200, ellipsis: true },
+  { title: "状态", dataIndex: "enable", align: "center", width: 80 },
+  { title: "操作", dataIndex: "operation", width: 240 },
 ];
 
 /** 用户列表信息 */
@@ -539,10 +546,10 @@ const handleRemove: UploadProps["onRemove"] = (file) => {
 };
 
 const beforeUpload: UploadProps["beforeUpload"] = async (file) => {
-  await fileTypeCheck(file,['xls','xlsx']).catch((error)=>{
-    message.error('文件类型错误, 请使用导入模板编辑')
-    return Promise.reject(error)
-  })
+  await fileTypeCheck(file, ["xls", "xlsx"]).catch((error) => {
+    message.error("文件类型错误, 请使用导入模板编辑");
+    return Promise.reject(error);
+  });
   importUserForm.fileList = [file];
   return false;
 };

+ 1 - 1
vite.config.ts

@@ -55,7 +55,7 @@ export default defineConfig({
   server: {
     proxy: {
       '^/api': {
-        target: 'http://192.168.10.83:7101'
+        target: 'http://192.168.10.39:7100'
       }
     }
   }