优化upload

This commit is contained in:
icssoa 2022-10-14 16:28:34 +08:00
parent 314e9644aa
commit 664585b21c
3 changed files with 22 additions and 1 deletions

View File

@ -10,7 +10,7 @@
},
"dependencies": {
"@cool-vue/admin": "^5.0.3",
"@cool-vue/crud": "^5.7.0",
"@cool-vue/crud": "^5.7.1",
"@element-plus/icons-vue": "^2.0.6",
"@vueuse/core": "^9.1.0",
"axios": "^0.27.2",

View File

@ -143,6 +143,7 @@ import { useCool, module } from "/@/cool";
import { extname, uuid } from "/@/cool/utils";
import { useBase } from "/$/base";
import { fileSize, fileName, fileType } from "../utils";
import { useForm } from "@cool-vue/crud";
interface Item {
url: string;
@ -190,6 +191,9 @@ const { service } = useCool();
//
const { user } = useBase();
//
const Form = useForm();
//
const { options } = module.get("upload");
@ -202,6 +206,11 @@ const size = computed(() => {
return (isArray(d) ? d : [d, d]).map((e: string | number) => (isNumber(e) ? e + "px" : e));
});
//
const disabled = computed(() => {
return Form.value?.disabled || props.disabled;
});
//
const limit = props.limit || options.limit.upload;

View File

@ -1091,6 +1091,18 @@
mitt "^3.0.0"
vue "^3.2.39"
"@cool-vue/crud@^5.7.1":
version "5.7.1"
resolved "https://registry.npmjs.org/@cool-vue/crud/-/crud-5.7.1.tgz#b8f935c6aeb5bcc2830fdb38f79f2b14d1acc4e6"
integrity sha512-rSb9lobCG9NlFlb+8WRiZfEwjTFrIo5/93Qx+cRHQgzVE8tXxsnNCwlMZNC0Tr3kkmuROQGP9ClkuJV8YwhyYA==
dependencies:
array.prototype.flat "^1.2.4"
core-js "^3.21.1"
element-plus "^2.2.17"
merge "^2.1.1"
mitt "^3.0.0"
vue "^3.2.39"
"@ctrl/tinycolor@^3.4.1":
version "3.4.1"
resolved "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.4.1.tgz#75b4c27948c81e88ccd3a8902047bcd797f38d32"