mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
优化upload
This commit is contained in:
parent
314e9644aa
commit
664585b21c
@ -10,7 +10,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cool-vue/admin": "^5.0.3",
|
"@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",
|
"@element-plus/icons-vue": "^2.0.6",
|
||||||
"@vueuse/core": "^9.1.0",
|
"@vueuse/core": "^9.1.0",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
|
@ -143,6 +143,7 @@ import { useCool, module } from "/@/cool";
|
|||||||
import { extname, uuid } from "/@/cool/utils";
|
import { extname, uuid } from "/@/cool/utils";
|
||||||
import { useBase } from "/$/base";
|
import { useBase } from "/$/base";
|
||||||
import { fileSize, fileName, fileType } from "../utils";
|
import { fileSize, fileName, fileType } from "../utils";
|
||||||
|
import { useForm } from "@cool-vue/crud";
|
||||||
|
|
||||||
interface Item {
|
interface Item {
|
||||||
url: string;
|
url: string;
|
||||||
@ -190,6 +191,9 @@ const { service } = useCool();
|
|||||||
// 缓存
|
// 缓存
|
||||||
const { user } = useBase();
|
const { user } = useBase();
|
||||||
|
|
||||||
|
// 表单
|
||||||
|
const Form = useForm();
|
||||||
|
|
||||||
// 模块配置
|
// 模块配置
|
||||||
const { options } = module.get("upload");
|
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));
|
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;
|
const limit = props.limit || options.limit.upload;
|
||||||
|
|
||||||
|
12
yarn.lock
12
yarn.lock
@ -1091,6 +1091,18 @@
|
|||||||
mitt "^3.0.0"
|
mitt "^3.0.0"
|
||||||
vue "^3.2.39"
|
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":
|
"@ctrl/tinycolor@^3.4.1":
|
||||||
version "3.4.1"
|
version "3.4.1"
|
||||||
resolved "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.4.1.tgz#75b4c27948c81e88ccd3a8902047bcd797f38d32"
|
resolved "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.4.1.tgz#75b4c27948c81e88ccd3a8902047bcd797f38d32"
|
||||||
|
Loading…
Reference in New Issue
Block a user