From ffc9e3d09ad44d763327b939c63b445b4f3d2728 Mon Sep 17 00:00:00 2001 From: toboos Date: Mon, 21 Sep 2020 19:45:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20window.alert=20=E6=8F=90?= =?UTF-8?q?=E7=A4=BA.=20=E4=BF=AE=E5=A4=8D=20tinymce=20=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=86=85=E8=8F=9C=E5=8D=95=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + scss/components/form/_tinymce.scss | 6 ++++++ scss/themes/cxd.scss | 1 + scss/themes/dark.scss | 1 + scss/themes/default.scss | 1 + src/Scoped.tsx | 6 +++--- src/renderers/Form/Image.tsx | 2 +- src/renderers/Tasks.tsx | 8 ++++---- src/types.ts | 4 ++-- 9 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 scss/components/form/_tinymce.scss diff --git a/.gitignore b/.gitignore index 004ce8cfc..5cae84fdc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .ruby-version test.sass npm-debug.log +yarn.lock # Folders .idea/ diff --git a/scss/components/form/_tinymce.scss b/scss/components/form/_tinymce.scss new file mode 100644 index 000000000..a5181b9b5 --- /dev/null +++ b/scss/components/form/_tinymce.scss @@ -0,0 +1,6 @@ +.tox-tinymce-aux { + z-index: $zindex-modal; +} +.tox-fullscreen .tox.tox-tinymce-aux { + z-index: $zindex-modal; +} diff --git a/scss/themes/cxd.scss b/scss/themes/cxd.scss index 31fd67c9d..4b1e2aafb 100644 --- a/scss/themes/cxd.scss +++ b/scss/themes/cxd.scss @@ -551,6 +551,7 @@ $Satus-icon-width: px2rem(14px); @import '../components/form/file'; @import '../components/form/editor'; @import '../components/form/rich-text'; +@import '../components/form/tinymce'; @import '../components/form/range'; @import '../components/form/repeat'; @import '../components/form/tree'; diff --git a/scss/themes/dark.scss b/scss/themes/dark.scss index bae59c115..60b0e7165 100644 --- a/scss/themes/dark.scss +++ b/scss/themes/dark.scss @@ -234,6 +234,7 @@ pre { @import '../components/form/file'; @import '../components/form/editor'; @import '../components/form/rich-text'; +@import '../components/form/tinymce'; @import '../components/form/range'; @import '../components/form/repeat'; @import '../components/form/tree'; diff --git a/scss/themes/default.scss b/scss/themes/default.scss index ca66bd614..3d1f366cf 100644 --- a/scss/themes/default.scss +++ b/scss/themes/default.scss @@ -97,6 +97,7 @@ $Form-input-borderColor: #cfdadd; @import '../components/form/file'; @import '../components/form/editor'; @import '../components/form/rich-text'; +@import '../components/form/tinymce'; @import '../components/form/range'; @import '../components/form/repeat'; @import '../components/form/tree'; diff --git a/src/Scoped.tsx b/src/Scoped.tsx index a2015fe52..8c3d28662 100644 --- a/src/Scoped.tsx +++ b/src/Scoped.tsx @@ -30,7 +30,7 @@ export interface ScopedComponentType extends React.Component { } export interface IScopedContext { - parent?: AlisIScopedContext; + parent?: AliasIScopedContext; registerComponent: (component: ScopedComponentType) => void; unRegisterComponent: (component: ScopedComponentType) => void; getComponentByName: (name: string) => ScopedComponentType; @@ -39,12 +39,12 @@ export interface IScopedContext { send: (target: string, ctx: RendererData) => void; close: (target: string) => void; } -type AlisIScopedContext = IScopedContext; +type AliasIScopedContext = IScopedContext; export const ScopedContext = React.createContext(createScopedTools('')); function createScopedTools( path?: string, - parent?: AlisIScopedContext, + parent?: AliasIScopedContext, env?: RendererEnv ): IScopedContext { const components: Array = []; diff --git a/src/renderers/Form/Image.tsx b/src/renderers/Form/Image.tsx index c3a8055d4..96bb0d8fd 100644 --- a/src/renderers/Form/Image.tsx +++ b/src/renderers/Form/Image.tsx @@ -846,7 +846,7 @@ export default class ImageControl extends React.Component< [].slice.call(files, 0, allowed).forEach((file: FileX) => { if (maxSize && file.size > maxSize) { - alert( + this.props.env.alert( __( '您选择的文件 {{filename}} 大小为 {{actualSize}} 超出了最大为 {{maxSize}} 的限制,请重新选择。', { diff --git a/src/renderers/Tasks.tsx b/src/renderers/Tasks.tsx index b95a1d89f..960b43cfc 100644 --- a/src/renderers/Tasks.tsx +++ b/src/renderers/Tasks.tsx @@ -241,7 +241,7 @@ export default class Task extends React.Component { } if (interval && !isEffectiveApi(checkApi)) { - return alert('checkApi 没有设置, 不能及时获取任务状态'); + return env.alert('checkApi 没有设置, 不能及时获取任务状态'); } isEffectiveApi(checkApi, data) && @@ -254,7 +254,7 @@ export default class Task extends React.Component { handleLoaded(ret: Payload) { if (!Array.isArray(ret.data)) { - return alert( + return this.props.env.alert( '返回格式不正确, 期望 response.data 为数组, 包含每个 task 的状态信息' ); } @@ -279,9 +279,9 @@ export default class Task extends React.Component { } = this.props; if (!retry && !isEffectiveApi(submitApi)) { - return alert('submitApi 没有配置'); + return env.alert('submitApi 没有配置'); } else if (retry && !isEffectiveApi(reSubmitApi)) { - return alert('reSubmitApi 没有配置'); + return env.alert('reSubmitApi 没有配置'); } this.setState( diff --git a/src/types.ts b/src/types.ts index af996bef2..0dd918d2b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -127,10 +127,10 @@ export interface PlainObject { export interface RendererData { [propsName: string]: any; - __prev?: RendererDataAlis; + __prev?: RendererDataAlias; __super?: RendererData; } -type RendererDataAlis = RendererData; +type RendererDataAlias = RendererData; export type FunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? K : never;