Skip to content

Commit 664585b

Browse files
committed
优化upload
1 parent 314e964 commit 664585b

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@cool-vue/admin": "^5.0.3",
13-
"@cool-vue/crud": "^5.7.0",
13+
"@cool-vue/crud": "^5.7.1",
1414
"@element-plus/icons-vue": "^2.0.6",
1515
"@vueuse/core": "^9.1.0",
1616
"axios": "^0.27.2",

src/modules/upload/components/index.vue

+9
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ import { useCool, module } from "/@/cool";
143143
import { extname, uuid } from "/@/cool/utils";
144144
import { useBase } from "/$/base";
145145
import { fileSize, fileName, fileType } from "../utils";
146+
import { useForm } from "@cool-vue/crud";
146147
147148
interface Item {
148149
url: string;
@@ -190,6 +191,9 @@ const { service } = useCool();
190191
// 缓存
191192
const { user } = useBase();
192193
194+
// 表单
195+
const Form = useForm();
196+
193197
// 模块配置
194198
const { options } = module.get("upload");
195199
@@ -202,6 +206,11 @@ const size = computed(() => {
202206
return (isArray(d) ? d : [d, d]).map((e: string | number) => (isNumber(e) ? e + "px" : e));
203207
});
204208
209+
// 是否禁用
210+
const disabled = computed(() => {
211+
return Form.value?.disabled || props.disabled;
212+
});
213+
205214
// 最大上传数量
206215
const limit = props.limit || options.limit.upload;
207216

yarn.lock

+12
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,18 @@
10911091
mitt "^3.0.0"
10921092
vue "^3.2.39"
10931093

1094+
"@cool-vue/crud@^5.7.1":
1095+
version "5.7.1"
1096+
resolved "https://registry.npmjs.org/@cool-vue/crud/-/crud-5.7.1.tgz#b8f935c6aeb5bcc2830fdb38f79f2b14d1acc4e6"
1097+
integrity sha512-rSb9lobCG9NlFlb+8WRiZfEwjTFrIo5/93Qx+cRHQgzVE8tXxsnNCwlMZNC0Tr3kkmuROQGP9ClkuJV8YwhyYA==
1098+
dependencies:
1099+
array.prototype.flat "^1.2.4"
1100+
core-js "^3.21.1"
1101+
element-plus "^2.2.17"
1102+
merge "^2.1.1"
1103+
mitt "^3.0.0"
1104+
vue "^3.2.39"
1105+
10941106
"@ctrl/tinycolor@^3.4.1":
10951107
version "3.4.1"
10961108
resolved "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.4.1.tgz#75b4c27948c81e88ccd3a8902047bcd797f38d32"

0 commit comments

Comments
 (0)