Sfoglia il codice sorgente

需求及样式调整

lideyin 5 anni fa
parent
commit
d504fe2462
3 ha cambiato i file con 35 aggiunte e 28 eliminazioni
  1. 1 1
      .env.development
  2. 0 5
      postcss.config.js
  3. 34 22
      src/modules/basic/view/clientConfig.vue

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 #### 如果需要改变以下环境变量的值,请在根目录下新增 .env.local 文件,里面设置的变量会覆盖本文件
-VUE_APP_CORE_HOST_URL=http://192.168.10.39:8000
+VUE_APP_CORE_HOST_URL=http://localhost:8000
 VUE_APP_EXAM_WORK_HOST_URL=http://192.168.10.39:8001
 VUE_APP_QUESTIONS_HOST_URL=http://192.168.10.39:8008
 VUE_APP_OE_HOST_URL=http://192.168.10.39:8013

+ 0 - 5
postcss.config.js

@@ -1,5 +0,0 @@
-module.exports = {
-  plugins: {
-    autoprefixer: {}
-  }
-};

+ 34 - 22
src/modules/basic/view/clientConfig.vue

@@ -20,7 +20,7 @@
           <el-upload
             class="upload-width"
             ref="upload"
-            accept="image/*"
+            accept=".png"
             :action="uploadAction"
             :headers="uploadHeaders"
             :data="uploadData"
@@ -32,6 +32,8 @@
             :file-list="fileList"
             :auto-upload="false"
             :multiple="false"
+            :limit="1"
+            :on-exceed="handleExceed"
             list-type="picture"
           >
             <el-button size="small" slot="trigger" type="primary"
@@ -44,7 +46,7 @@
               >清空文件</el-button
             >
             <div slot="tip" class="el-upload__tip">
-              图片大小为400*100的png文件
+              图片大小(长*宽)为400*100的png文件
             </div>
           </el-upload>
           <el-input v-show="false" v-model="ruleForm.LOGO_FILE_URL"></el-input>
@@ -74,7 +76,11 @@
             >
           </el-checkbox-group>
         </el-form-item>
-        <el-form-item label="窗口默认大小" prop="STUDENT_CLIENT_DEFAULT_SIZE">
+        <el-form-item
+          v-show="false"
+          label="窗口默认大小"
+          prop="STUDENT_CLIENT_DEFAULT_SIZE"
+        >
           <el-input
             v-model="ruleForm.STUDENT_CLIENT_DEFAULT_SIZE"
             placeholder="窗口大小格式为:宽度*高度"
@@ -89,15 +95,10 @@
           ></el-input>
         </el-form-item>
         <el-form-item>
-          <el-button
-            class="btn-margin-left"
-            type="primary"
-            @click="submitForm('ruleForm')"
+          <el-button type="primary" @click="submitForm('ruleForm')"
             >保 存</el-button
           >
-          <el-button class="btn-margin-left" @click="resetForm('ruleForm')"
-            >取 消</el-button
-          >
+          <!-- <el-button class="btn-margin-left" @click="resetForm('ruleForm')">取 消</el-button> -->
         </el-form-item>
       </el-form>
     </el-main>
@@ -148,7 +149,7 @@ export default {
           { min: 1, max: 50, message: "长度在 1 到 50 个字符", trigger: "blur" }
         ],
         LOGO_FILE_URL: [
-          { required: true, message: "请选择学校logo", trigger: "change" }
+          { required: true, message: "请上传学校logo", trigger: "change" }
         ],
         loginType: [
           {
@@ -276,12 +277,17 @@ export default {
           } else {
             this.fileList = [];
           }
+        } else {
+          this.$notify({
+            message: "学生客户端信息暂未初始化,请立即初始化",
+            type: "warning"
+          });
         }
       });
     },
-    resetForm(formName) {
-      this.$refs[formName].resetFields();
-    },
+    // resetForm(formName) {
+    //   this.$refs[formName].resetFields();
+    // },
     initUpload() {
       this.fileList = [];
     },
@@ -349,12 +355,12 @@ export default {
       for (let file of fileList) {
         var fileName = file.name;
         if (
-          !fileName.endsWith(".jpg") &&
-          !fileName.endsWith(".gif") &&
+          // !fileName.endsWith(".jpg") &&
+          // !fileName.endsWith(".gif") &&
           !fileName.endsWith(".png")
         ) {
           this.$notify({
-            message: "上传文件必须为[jpg,gif,png]",
+            message: "上传文件格式必须为[png]",
             type: "error"
           });
           this.initUpload();
@@ -374,6 +380,12 @@ export default {
     handleRemove(file, fileList) {
       console.log(file, fileList);
       this.removeFile();
+    },
+    handleExceed() {
+      this.$notify({
+        message: "当前限制选择 1 个文件,请先清空文件再试",
+        type: "error"
+      });
     }
   },
   created() {
@@ -394,12 +406,12 @@ export default {
 </script>
 <style scoped>
 .input-width {
-  width: 600px;
+  width: 638px;
 }
 .upload-width {
-  width: 600px;
-}
-.btn-margin-left {
-  margin-left: 200px;
+  width: 638px;
 }
+/* .btn-margin-left {
+  margin-left: 20px;
+} */
 </style>