diff --git a/packages/core/client/src/block-provider/GanttBlockProvider.tsx b/packages/core/client/src/block-provider/GanttBlockProvider.tsx index 7e886fe0dd..3ebbd9c9bd 100644 --- a/packages/core/client/src/block-provider/GanttBlockProvider.tsx +++ b/packages/core/client/src/block-provider/GanttBlockProvider.tsx @@ -13,6 +13,7 @@ const formatData = ( hideChildren: boolean = false, ) => { data.forEach((item: any) => { + const percent=item[fieldNames.progress] * 100; if (item.children && item.children.length) { tasks.push({ start: new Date(item[fieldNames.start]), @@ -20,7 +21,7 @@ const formatData = ( name: item[fieldNames.title], id: item.id + '', type: 'project', - progress: item[fieldNames.progress] * 100 || 0, + progress: percent>100?100:percent || 0, hideChildren: hideChildren, project: projectId, color: item.color, @@ -33,7 +34,7 @@ const formatData = ( name: item[fieldNames.title], id: item.id + '', type: fieldNames.end ? 'task' : 'milestone', - progress: item[fieldNames.progress] * 100 || 0, + progress: percent>100?100:percent || 0, project: projectId, color: item.color, }); diff --git a/packages/core/client/src/block-provider/hooks/index.ts b/packages/core/client/src/block-provider/hooks/index.ts index df3c74e4a9..98e67709c5 100644 --- a/packages/core/client/src/block-provider/hooks/index.ts +++ b/packages/core/client/src/block-provider/hooks/index.ts @@ -718,7 +718,17 @@ export const useDestroyActionProps = () => { await resource.destroy({ filterByTk, }); - service?.refresh?.(); + + const { count = 0, page = 0, pageSize = 0 } = service?.data?.meta || {}; + if (count % pageSize === 1) { + service.run({ + ...service?.params?.[0], + page: page - 1, + }); + } else { + service?.refresh?.(); + } + if (block !== 'TableField') { __parent?.service?.refresh?.(); setVisible?.(false); diff --git a/packages/core/client/src/schema-component/antd/gantt/components/gantt/task-gantt.tsx b/packages/core/client/src/schema-component/antd/gantt/components/gantt/task-gantt.tsx index 1128e5327a..0010bbd599 100644 --- a/packages/core/client/src/schema-component/antd/gantt/components/gantt/task-gantt.tsx +++ b/packages/core/client/src/schema-component/antd/gantt/components/gantt/task-gantt.tsx @@ -39,7 +39,7 @@ export const TaskGantt: React.FC = forwardRef( width={gridProps.svgWidth} height={calendarProps.headerHeight} fontFamily={barProps.fontFamily} - style={{ borderBottom: '1px solid #f0f0f0',fontWeight:700 }} + style={{ borderBottom: '1px solid #f0f0f0', fontWeight: 700 }} > diff --git a/packages/core/client/src/schema-component/antd/gantt/components/task-item/task-item.tsx b/packages/core/client/src/schema-component/antd/gantt/components/task-item/task-item.tsx index 4356c3929f..1017c3fd54 100644 --- a/packages/core/client/src/schema-component/antd/gantt/components/task-item/task-item.tsx +++ b/packages/core/client/src/schema-component/antd/gantt/components/task-item/task-item.tsx @@ -98,7 +98,7 @@ export const TaskItem: React.FC = (props) => { {taskItem} diff --git a/packages/core/client/src/schema-component/antd/input/ReadPretty.tsx b/packages/core/client/src/schema-component/antd/input/ReadPretty.tsx index ab32dfde18..c0a9a54c6f 100644 --- a/packages/core/client/src/schema-component/antd/input/ReadPretty.tsx +++ b/packages/core/client/src/schema-component/antd/input/ReadPretty.tsx @@ -58,7 +58,7 @@ ReadPretty.TextArea = (props) => { value ); return ( -
+
{props.addonBefore} {props.prefix} {content} @@ -94,7 +94,7 @@ ReadPretty.Html = (props) => { ); return ( -
+
{props.addonBefore} {props.prefix} {content} diff --git a/packages/core/client/src/schema-component/antd/markdown/style.less b/packages/core/client/src/schema-component/antd/markdown/style.less index 4ce93dee70..0e6489227d 100644 --- a/packages/core/client/src/schema-component/antd/markdown/style.less +++ b/packages/core/client/src/schema-component/antd/markdown/style.less @@ -1,8 +1,5 @@ .nb-markdown { line-height: 1.612; - a { - word-break: break-all; - } } .nb-markdown > *:last-child { diff --git a/packages/core/client/src/schema-component/antd/table-v2/Table.tsx b/packages/core/client/src/schema-component/antd/table-v2/Table.tsx index 0ccb7bab01..9bb8aae86e 100644 --- a/packages/core/client/src/schema-component/antd/table-v2/Table.tsx +++ b/packages/core/client/src/schema-component/antd/table-v2/Table.tsx @@ -131,7 +131,7 @@ const usePaginationProps = (pagination1, pagination2) => { ...pagination1, ...pagination2, }; - return result.total < result.pageSize ? false : result; + return result.total <= result.pageSize ? false : result; }; const useValidator = (validator: (value: any) => string) => { diff --git a/packages/core/client/src/schema-component/antd/variable/JSONInput.tsx b/packages/core/client/src/schema-component/antd/variable/JSONInput.tsx index be75056d5d..7d40fc679e 100644 --- a/packages/core/client/src/schema-component/antd/variable/JSONInput.tsx +++ b/packages/core/client/src/schema-component/antd/variable/JSONInput.tsx @@ -1,10 +1,10 @@ -import React, { useRef, useState } from 'react'; -import { Button, Cascader, Popover, Input as AntInput } from 'antd'; +import React, { useRef } from 'react'; +import { Button } from 'antd'; import { css } from "@emotion/css"; import { Input } from "../input"; import { useTranslation } from 'react-i18next'; -import { XButton } from './XButton'; +import { VariableSelect } from './VariableSelect'; @@ -21,7 +21,6 @@ export function JSONInput(props) { const inputRef = useRef(null); const { value, space = 2, scope } = props; const { t } = useTranslation(); - const [selectedVar, setSelectedVar] = useState([]); const options = typeof scope === 'function' ? scope() : (scope ?? []); function onFormat() { @@ -72,24 +71,7 @@ export function JSONInput(props) { `} > - - setSelectedVar(keyPaths as string[])} - changeOnSelect - /> - - - )} - trigger="click" - placement="topRight" - > - - +
); diff --git a/packages/core/client/src/schema-component/antd/variable/TextArea.tsx b/packages/core/client/src/schema-component/antd/variable/TextArea.tsx index 9996922306..308442355f 100644 --- a/packages/core/client/src/schema-component/antd/variable/TextArea.tsx +++ b/packages/core/client/src/schema-component/antd/variable/TextArea.tsx @@ -1,12 +1,12 @@ import React, { useState, useEffect, useRef, useMemo } from 'react'; -import { Input, Cascader, Button, Tag } from 'antd'; +import { Input } from 'antd'; import { useForm } from '@formily/react'; import { cx, css } from '@emotion/css'; import { useTranslation } from 'react-i18next'; import * as sanitizeHTML from 'sanitize-html'; import { EllipsisWithTooltip, useCompile } from '../..'; -import { useRecord } from '../../../record-provider'; +import { VariableSelect } from './VariableSelect'; type RangeIndexes = [number, number, number, number]; @@ -341,19 +341,6 @@ export function TextArea(props) { } } } - - .x-button{ - .ant-select.ant-cascader{ - position: absolute; - top: -1px; - left: -1px; - min-width: auto; - width: calc(100% + 2px); - height: calc(100% + 2px); - overflow: hidden; - opacity: 0; - } - } `} >
{!disabled - ? ( - - ) + ? : null } diff --git a/packages/core/client/src/schema-component/antd/variable/VariableSelect.tsx b/packages/core/client/src/schema-component/antd/variable/VariableSelect.tsx new file mode 100644 index 0000000000..46cc5edab4 --- /dev/null +++ b/packages/core/client/src/schema-component/antd/variable/VariableSelect.tsx @@ -0,0 +1,83 @@ +import { css, cx } from "@emotion/css"; +import { Button, Cascader } from "antd"; +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; + +export function VariableSelect(props) { + const { options, onInsert } = props; + const { t } = useTranslation(); + const [selectedVar, setSelectedVar] = useState([]); + + useEffect(() => { + setSelectedVar([]); + }, [options]); + + return ( + + ); +} diff --git a/packages/plugins/workflow/src/client/nodes/delay.tsx b/packages/plugins/workflow/src/client/nodes/delay.tsx index 20debc1af5..9d1aef993d 100644 --- a/packages/plugins/workflow/src/client/nodes/delay.tsx +++ b/packages/plugins/workflow/src/client/nodes/delay.tsx @@ -19,15 +19,13 @@ export default { type: 'number', title: `{{t("End Status", { ns: "${NAMESPACE}" })}}`, 'x-decorator': 'FormItem', - 'x-component': 'Select', - 'x-component-props': { - placeholder: `{{t("Select status", { ns: "${NAMESPACE}" })}}`, - }, + 'x-component': 'Radio.Group', enum: [ { label: `{{t("Succeed and continue", { ns: "${NAMESPACE}" })}}`, value: JOB_STATUS.RESOLVED }, { label: `{{t("Fail and exit", { ns: "${NAMESPACE}" })}}`, value: JOB_STATUS.FAILED }, ], - required: true + required: true, + default: JOB_STATUS.RESOLVED } }, view: { diff --git a/packages/plugins/workflow/src/client/nodes/index.tsx b/packages/plugins/workflow/src/client/nodes/index.tsx index dce0813655..7e5c9df02b 100644 --- a/packages/plugins/workflow/src/client/nodes/index.tsx +++ b/packages/plugins/workflow/src/client/nodes/index.tsx @@ -423,7 +423,6 @@ export function NodeDefaultView(props) { 'x-component': 'fieldset', 'x-component-props': { className: css` - .ant-input, .ant-select, .ant-cascader-picker, .ant-picker, @@ -434,6 +433,15 @@ export function NodeDefaultView(props) { min-width: 6em; } } + + .ant-input-affix-wrapper{ + &:not(.full-width){ + .ant-input{ + width: auto; + min-width: 6em; + } + } + } ` }, properties: instruction.fieldset