From 664585b21c0b799dea2ceeb5adb0555634c0b7b0 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Fri, 14 Oct 2022 16:28:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96upload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/modules/upload/components/index.vue | 9 +++++++++ yarn.lock | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 98c8f22..485df1a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/modules/upload/components/index.vue b/src/modules/upload/components/index.vue index b0fea98..2369480 100644 --- a/src/modules/upload/components/index.vue +++ b/src/modules/upload/components/index.vue @@ -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; diff --git a/yarn.lock b/yarn.lock index b7f3eb0..6604694 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"