mooho-base-admin-plus 2.4.24 → 2.4.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "2.4.24",
4
+ "version": "2.4.25",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -20,6 +20,7 @@
20
20
  :format="!!(accept || '').trim() ? accept.split(',').map(item => item.replaceAll('.', '')) : []"
21
21
  :multiple="true"
22
22
  :type="draggable ? 'drag' : 'select'"
23
+ :max-size="maxSize == null ? null : maxSize * 1024"
23
24
  >
24
25
  <Button v-if="!draggable && !readonly" :size="size" icon="ios-cloud-upload-outline">{{ $t('Front_Btn_Upload') }}</Button>
25
26
  <div v-if="draggable && !readonly" style="padding: 20px 0">
@@ -61,6 +62,10 @@
61
62
  maxCount: {
62
63
  type: Number
63
64
  },
65
+ // 最大上传文件大小(M)
66
+ maxSize: {
67
+ type: Number
68
+ },
64
69
  /**
65
70
  * 大小
66
71
  * @values small, default, large
@@ -32,6 +32,7 @@
32
32
  :show-upload-list="false"
33
33
  :before-upload="beforeUpload"
34
34
  :on-success="onUploadSuccess"
35
+ :max-size="maxSize == null ? null : maxSize * 1024"
35
36
  >
36
37
  <div
37
38
  class="form-image"
@@ -80,6 +81,10 @@
80
81
  maxCount: {
81
82
  type: Number
82
83
  },
84
+ // 最大上传文件大小(M)
85
+ maxSize: {
86
+ type: Number
87
+ },
83
88
  // 图片宽度
84
89
  width: {
85
90
  type: Number
@@ -392,6 +392,11 @@
392
392
  <Input type="number" style="width: 100px" number v-model="data.maxLength" />
393
393
  </FormItem>
394
394
  </Col>
395
+ <Col v-bind="grid8" v-if="data.controlType == 'Attachment' || data.controlType == 'Image'">
396
+ <FormItem label="文件大小限制(M)" key="maxValue" prop="maxValue">
397
+ <Input type="number" style="width: 100px" number v-model="data.maxValue" />
398
+ </FormItem>
399
+ </Col>
395
400
  <Col v-bind="grid8" v-if="data.controlType == 'NumberInput' || data.controlType == 'Slider'">
396
401
  <FormItem label="输入范围">
397
402
  <Input type="number" style="width: 60px" number v-model="data.minValue" />
@@ -417,7 +417,8 @@
417
417
  :ref="'attachment_' + column.code"
418
418
  :model-value="parseData(data, column.code)"
419
419
  @update:model-value="$event => setData(data, column.code, $event)"
420
- :maxCount="column.maxLength"
420
+ :max-count="column.maxLength"
421
+ :max-size="column.maxValue"
421
422
  :accept="column.pattern"
422
423
  :draggable="column.mergeSame"
423
424
  />
@@ -440,7 +441,8 @@
440
441
  :model-value="parseData(data, column.code)"
441
442
  @update:model-value="$event => setData(data, column.code, $event)"
442
443
  :readonly="readonly || column.isReadonly"
443
- :maxCount="column.maxLength"
444
+ :max-count="column.maxLength"
445
+ :max-size="column.maxValue"
444
446
  :height="column.controlHeight"
445
447
  :width="column.controlWidth"
446
448
  :accept="column.pattern"
@@ -923,7 +925,7 @@
923
925
  });
924
926
  }
925
927
 
926
- if (column.maxValue != null) {
928
+ if (column.maxValue != null && (column.controlType == 'NumberInput' || column.controlType == 'Slider')) {
927
929
  rules.push({
928
930
  type: this.getDataType(column),
929
931
  max: column.maxValue,
@@ -932,7 +934,7 @@
932
934
  });
933
935
  }
934
936
 
935
- if (column.minValue != null) {
937
+ if (column.minValue != null && (column.controlType == 'NumberInput' || column.controlType == 'Slider')) {
936
938
  rules.push({
937
939
  type: this.getDataType(column),
938
940
  min: column.minValue,
@@ -941,7 +943,7 @@
941
943
  });
942
944
  }
943
945
 
944
- if (column.maxLength != null) {
946
+ if (column.maxLength != null && (column.controlType == 'TextInput' || column.controlType == 'TextArea')) {
945
947
  rules.push({
946
948
  type: this.getDataType(column),
947
949
  length: column.maxLength,