Browse Source

关联的公司

三七 5 days ago
parent
commit
b5855251ee

+ 7 - 7
src/components/ImageUpload/index.vue

@@ -165,8 +165,8 @@ export default {
           // 文件大于1MB时进行压缩
           this.compressImage(file).then((compressedFile) => {
             loadingInstance.close();
-            if (compressedFile.size / 1024 > 500) {
-              this.$message.error('图片压缩后仍大于500KB');
+            if (compressedFile.size / 1024 > 1000) {
+              this.$message.error('图片压缩后仍大于1000KB');
               reject();
             } else {
               // this.$message.success(`图片压缩成功,最终质量为: ${this.finalQuality.toFixed(2)}`);
@@ -195,7 +195,7 @@ export default {
       //     return false;
       //   }
       // }
-      
+
     },
     compressImage(file) {
       return new Promise((resolve, reject) => {
@@ -215,16 +215,16 @@ export default {
 
             let quality = 1; // 初始压缩质量
             let dataURL = canvas.toDataURL('image/jpeg', quality);
-            
+
             // 逐步压缩,直到图片大小小于500KB并且压缩质量不再降低
             while (dataURL.length / 1024 > 500 && quality > 0.1) {
               quality -= 0.01;
               dataURL = canvas.toDataURL('image/jpeg', quality);
             }
             this.finalQuality = quality; // 存储最终的压缩质量
-            
-            if (dataURL.length / 1024 > 500) {
-              reject(new Error('压缩后图片仍然大于500KB'));
+
+            if (dataURL.length / 1024 > 1000) {
+              reject(new Error('压缩后图片仍然大于1000KB'));
               return;
             }
 

+ 4 - 4
src/components/Material/index.vue

@@ -367,8 +367,8 @@ export default {
           // 文件大于1MB时进行压缩
           this.compressImage(file).then((compressedFile) => {
             loadingInstance.close();
-            if (compressedFile.size / 1024 > 500) {
-              this.$message.error('图片压缩后仍大于500KB');
+            if (compressedFile.size / 1024 > 1000) {
+              this.$message.error('图片压缩后仍大于1M');
               reject();
             } else {
               // this.$message.success(`图片压缩成功,最终质量为: ${this.finalQuality.toFixed(2)}`);
@@ -417,8 +417,8 @@ export default {
             }
             this.finalQuality = quality; // 存储最终的压缩质量
 
-            if (dataURL.length / 1024 > 500) {
-              reject(new Error('压缩后图片仍然大于500KB'));
+            if (dataURL.length / 1024 > 1000) {
+              reject(new Error('压缩后图片仍然大于1000KB'));
               return;
             }
 

+ 12 - 1
src/views/course/userCourse/index.vue

@@ -31,6 +31,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="关联的公司" prop="companyIds">
+        <el-select v-model="queryParams.companyIdsList" multiple placeholder="请选择公司" filterable clearable style="width: 90%;">
+          <el-option
+            v-for="dict in companyOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="课堂类型" prop="isPrivate" style="display: none">
         <el-select v-model="queryParams.isPrivate" placeholder="请选择" clearable size="small">
           <el-option
@@ -350,7 +360,8 @@ export default {
         hotRanking: null,
         integral: null,
         price: null,
-        isPrivate: 1
+        isPrivate: 1,
+        companyIdsList:[],
       },
       // 表单参数
       form: {},