mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 11:12:20 +08:00
* refactor(plugin-workflow): refactor apis * fix(plugin-workflow-parallel): fix import in test cases * fix(plugin-workflow): fix some module import source * fix(plugin-workflow): move manual table acl to manual plugin * fix(plugin-workflow-manual): fix folder typo
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { css } from '@nocobase/client';
|
|
|
|
import { Instruction, WorkflowVariableRawTextArea, defaultFieldNames } from '@nocobase/plugin-workflow/client';
|
|
|
|
import { NAMESPACE } from '../locale';
|
|
|
|
export default class extends Instruction {
|
|
title = `{{t("SQL action", { ns: "${NAMESPACE}" })}}`;
|
|
type = 'sql';
|
|
group = 'collection';
|
|
description = `{{t("Execute a SQL statement in database.", { ns: "${NAMESPACE}" })}}`;
|
|
fieldset = {
|
|
sql: {
|
|
type: 'string',
|
|
required: true,
|
|
title: 'SQL',
|
|
description: `{{t("Usage of SQL query result is not supported yet.", { ns: "${NAMESPACE}" })}}`,
|
|
'x-decorator': 'FormItem',
|
|
'x-component': 'WorkflowVariableRawTextArea',
|
|
'x-component-props': {
|
|
rows: 20,
|
|
className: css`
|
|
font-size: 80%;
|
|
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
`,
|
|
},
|
|
},
|
|
};
|
|
components = {
|
|
WorkflowVariableRawTextArea,
|
|
};
|
|
useVariables({ key, title }, { types, fieldNames = defaultFieldNames }) {
|
|
return {
|
|
[fieldNames.value]: key,
|
|
[fieldNames.label]: title,
|
|
};
|
|
}
|
|
}
|