From 1acbdfa7d387dc7660afac10528f7f86f7576612 Mon Sep 17 00:00:00 2001 From: qsc <3153284618@qq.com> Date: Mon, 23 Oct 2023 18:49:29 +0800 Subject: [PATCH] =?UTF-8?q?upload=20=E8=BE=B9=E7=95=8C=E6=83=85=E5=86=B5?= =?UTF-8?q?=EF=BC=9A=E7=94=A8=E5=8A=A8=E4=BD=9C=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/components/extraFile/commit/index.d.ts | 1 + es/components/extraFile/commit/index.js | 1 + es/components/extraFile/commit/web.d.ts | 1 + es/components/extraFile/commit/web.js | 4 ++-- es/components/extraFile/commit/web.pc.d.ts | 1 + es/components/extraFile/commit/web.pc.js | 4 ++-- lib/components/extraFile/commit/index.d.ts | 1 + lib/components/extraFile/commit/index.js | 1 + lib/components/extraFile/commit/web.d.ts | 1 + lib/components/extraFile/commit/web.js | 4 ++-- lib/components/extraFile/commit/web.pc.d.ts | 1 + lib/components/extraFile/commit/web.pc.js | 4 ++-- src/components/extraFile/commit/index.ts | 1 + src/components/extraFile/commit/web.pc.tsx | 4 +++- src/components/extraFile/commit/web.tsx | 4 +++- 15 files changed, 23 insertions(+), 10 deletions(-) diff --git a/es/components/extraFile/commit/index.d.ts b/es/components/extraFile/commit/index.d.ts index ab52a6310..6b034c848 100644 --- a/es/components/extraFile/commit/index.d.ts +++ b/es/components/extraFile/commit/index.d.ts @@ -1,6 +1,7 @@ /// import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps Promise | boolean | undefined; afterCommit?: () => void; diff --git a/es/components/extraFile/commit/web.js b/es/components/extraFile/commit/web.js index bbe6b7fbf..31c49d3b0 100644 --- a/es/components/extraFile/commit/web.js +++ b/es/components/extraFile/commit/web.js @@ -1,7 +1,7 @@ import { jsx as _jsx } from "react/jsx-runtime"; import { Button } from 'antd-mobile'; export default function render(props) { - const { state, oakExecutable, oakExecuting, oakDirty, size, block, type, executeText, buttonProps, beforeCommit, afterCommit, } = props.data; + const { state, oakExecutable, oakExecuting, oakDirty, size, block, type, executeText, buttonProps, action, beforeCommit, afterCommit, } = props.data; const { t, upload, execute } = props.methods; const disabled = oakExecuting || ['uploading'].includes(state) || @@ -26,7 +26,7 @@ export default function render(props) { return; } } - await execute(); + await execute(action || undefined); await upload(); if (afterCommit) { afterCommit(); diff --git a/es/components/extraFile/commit/web.pc.d.ts b/es/components/extraFile/commit/web.pc.d.ts index 1fb811f55..8ffc49745 100644 --- a/es/components/extraFile/commit/web.pc.d.ts +++ b/es/components/extraFile/commit/web.pc.d.ts @@ -8,6 +8,7 @@ export default function render(props: WebComponentProps void; beforeCommit?: () => Promise | boolean; diff --git a/es/components/extraFile/commit/web.pc.js b/es/components/extraFile/commit/web.pc.js index 1bc0c9171..d8232b615 100644 --- a/es/components/extraFile/commit/web.pc.js +++ b/es/components/extraFile/commit/web.pc.js @@ -1,7 +1,7 @@ import { jsx as _jsx } from "react/jsx-runtime"; import { Button } from 'antd'; export default function render(props) { - const { state, oakExecutable, oakExecuting, size, block, type, executeText, buttonProps = {}, afterCommit, beforeCommit, } = props.data; + const { state, oakExecutable, oakExecuting, size, block, type, executeText, buttonProps = {}, action, afterCommit, beforeCommit, } = props.data; const { t, upload, execute } = props.methods; const disabled = oakExecuting || ['uploading'].includes(state) || @@ -26,7 +26,7 @@ export default function render(props) { return; } } - await execute(); + await execute(action || undefined); await upload(); if (afterCommit) { afterCommit(); diff --git a/lib/components/extraFile/commit/index.d.ts b/lib/components/extraFile/commit/index.d.ts index ab52a6310..6b034c848 100644 --- a/lib/components/extraFile/commit/index.d.ts +++ b/lib/components/extraFile/commit/index.d.ts @@ -1,6 +1,7 @@ /// import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps Promise | boolean | undefined; afterCommit?: () => void; diff --git a/lib/components/extraFile/commit/web.js b/lib/components/extraFile/commit/web.js index fc1e89c1e..086f096b6 100644 --- a/lib/components/extraFile/commit/web.js +++ b/lib/components/extraFile/commit/web.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const antd_mobile_1 = require("antd-mobile"); function render(props) { - const { state, oakExecutable, oakExecuting, oakDirty, size, block, type, executeText, buttonProps, beforeCommit, afterCommit, } = props.data; + const { state, oakExecutable, oakExecuting, oakDirty, size, block, type, executeText, buttonProps, action, beforeCommit, afterCommit, } = props.data; const { t, upload, execute } = props.methods; const disabled = oakExecuting || ['uploading'].includes(state) || @@ -28,7 +28,7 @@ function render(props) { return; } } - await execute(); + await execute(action || undefined); await upload(); if (afterCommit) { afterCommit(); diff --git a/lib/components/extraFile/commit/web.pc.d.ts b/lib/components/extraFile/commit/web.pc.d.ts index 1fb811f55..8ffc49745 100644 --- a/lib/components/extraFile/commit/web.pc.d.ts +++ b/lib/components/extraFile/commit/web.pc.d.ts @@ -8,6 +8,7 @@ export default function render(props: WebComponentProps void; beforeCommit?: () => Promise | boolean; diff --git a/lib/components/extraFile/commit/web.pc.js b/lib/components/extraFile/commit/web.pc.js index e9b743cab..c12779171 100644 --- a/lib/components/extraFile/commit/web.pc.js +++ b/lib/components/extraFile/commit/web.pc.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const antd_1 = require("antd"); function render(props) { - const { state, oakExecutable, oakExecuting, size, block, type, executeText, buttonProps = {}, afterCommit, beforeCommit, } = props.data; + const { state, oakExecutable, oakExecuting, size, block, type, executeText, buttonProps = {}, action, afterCommit, beforeCommit, } = props.data; const { t, upload, execute } = props.methods; const disabled = oakExecuting || ['uploading'].includes(state) || @@ -28,7 +28,7 @@ function render(props) { return; } } - await execute(); + await execute(action || undefined); await upload(); if (afterCommit) { afterCommit(); diff --git a/src/components/extraFile/commit/index.ts b/src/components/extraFile/commit/index.ts index 9d610ae6d..1664ed717 100644 --- a/src/components/extraFile/commit/index.ts +++ b/src/components/extraFile/commit/index.ts @@ -22,6 +22,7 @@ export default OakComponent({ }; }, properties: { + action: '' as (string | undefined), efPaths: [] as string[], size: 'middle', block: false, diff --git a/src/components/extraFile/commit/web.pc.tsx b/src/components/extraFile/commit/web.pc.tsx index f77d1d4ee..9d672e778 100644 --- a/src/components/extraFile/commit/web.pc.tsx +++ b/src/components/extraFile/commit/web.pc.tsx @@ -15,6 +15,7 @@ export default function render( block?: ButtonProps['block']; type?: ButtonProps['type']; executeText?: string; + action?: string; buttonProps?: ButtonProps; afterCommit?: () => void; beforeCommit?: () => Promise | boolean; @@ -33,6 +34,7 @@ export default function render( type, executeText, buttonProps = {}, + action, afterCommit, beforeCommit, } = props.data; @@ -67,7 +69,7 @@ export default function render( return; } } - await execute(); + await execute(action || undefined); await upload(); if (afterCommit) { afterCommit(); diff --git a/src/components/extraFile/commit/web.tsx b/src/components/extraFile/commit/web.tsx index 8db226e9b..039dda5e7 100644 --- a/src/components/extraFile/commit/web.tsx +++ b/src/components/extraFile/commit/web.tsx @@ -15,6 +15,7 @@ export default function render( block?: ButtonProps['block']; type?: ButtonProps['type']; executeText?: string; + action?: string; buttonProps?: ButtonProps; beforeCommit?: () => | Promise @@ -37,6 +38,7 @@ export default function render( type, executeText, buttonProps, + action, beforeCommit, afterCommit, } = props.data; @@ -71,7 +73,7 @@ export default function render( return; } } - await execute(); + await execute(action || undefined); await upload(); if (afterCommit) { afterCommit();