From 4545f7c587b30dbe0f7880df2d8cc12e6fd2e56e Mon Sep 17 00:00:00 2001 From: wangshaoping Date: Wed, 11 Sep 2024 14:41:39 +0800 Subject: [PATCH] update --- .zed/settings.json | 0 Untitled | 1027 +++++++++++++++++ io.sc.engine.rule.frontend/package.json | 2 +- .../src/views/authorization/Authorization.vue | 6 +- .../src/views/function/Function.vue | 12 +- .../src/views/lib/IndicatorGrid.vue | 24 +- .../src/views/lib/LibGrid.vue | 10 +- .../src/views/lib/ProcessorGrid.vue | 58 +- .../src/views/lib/TestCase.vue | 12 +- .../src/views/lib/TestCaseParameter.vue | 20 +- .../src/views/lib/ValidatorGrid.vue | 22 +- .../src/views/resources/Resources.vue | 15 +- .../resources/StartDeployWorkflowDialog.vue | 2 +- .../src/views/resources/designer/Designer.vue | 6 +- .../resources/designer/DesignerDialog.vue | 21 +- .../src/views/resources/designer/Model.vue | 12 +- .../src/views/resources/designer/Option.vue | 14 +- .../views/resources/designer/Parameter.vue | 36 +- .../views/resources/designer/Processor.vue | 92 +- .../resources/designer/TestCaseParameter.vue | 20 +- .../views/resources/designer/Validator.vue | 22 +- .../views/shared/SelectIndicatorDialog.vue | 4 +- .../src/views/testcase/Testcase.vue | 28 +- .../src/views/workflow/CompleteTaskDialog.vue | 2 +- .../src/views/workflow/Workflow.vue | 8 +- .../webpack.config.common.cjs | 80 +- io.sc.platform.core.frontend/.bin/util.js | 85 +- io.sc.platform.core.frontend/package.json | 2 +- .../template-project/package.json | 4 +- .../webpack.config.common.cjs | 80 +- .../webpack.config.common.cjs | 80 +- 31 files changed, 1430 insertions(+), 376 deletions(-) create mode 100644 .zed/settings.json create mode 100644 Untitled diff --git a/.zed/settings.json b/.zed/settings.json new file mode 100644 index 00000000..e69de29b diff --git a/Untitled b/Untitled new file mode 100644 index 00000000..771a30d5 --- /dev/null +++ b/Untitled @@ -0,0 +1,1027 @@ +{ + // The name of the Zed theme to use for the UI. + // + // `mode` is one of: + // - "system": Use the theme that corresponds to the system's appearance + // - "light": Use the theme indicated by the "light" field + // - "dark": Use the theme indicated by the "dark" field + "theme": { + "mode": "system", + "light": "One Light", + "dark": "One Dark" + }, + // The name of a base set of key bindings to use. + // This setting can take four values, each named after another + // text editor: + // + // 1. "VSCode" + // 2. "JetBrains" + // 3. "SublimeText" + // 4. "Atom" + "base_keymap": "VSCode", + // Features that can be globally enabled or disabled + "features": { + // Which inline completion provider to use. + "inline_completion_provider": "copilot" + }, + // The name of a font to use for rendering text in the editor + "buffer_font_family": "Zed Plex Mono", + // Set the buffer text's font fallbacks, this will be merged with + // the platform's default fallbacks. + "buffer_font_fallbacks": [], + // The OpenType features to enable for text in the editor. + "buffer_font_features": { + // Disable ligatures: + // "calt": false + }, + // The default font size for text in the editor + "buffer_font_size": 15, + // The weight of the editor font in standard CSS units from 100 to 900. + "buffer_font_weight": 400, + // Set the buffer's line height. + // May take 3 values: + // 1. Use a line height that's comfortable for reading (1.618) + // "buffer_line_height": "comfortable" + // 2. Use a standard line height, (1.3) + // "buffer_line_height": "standard", + // 3. Use a custom line height + // "buffer_line_height": { + // "custom": 2 + // }, + "buffer_line_height": "comfortable", + // The name of a font to use for rendering text in the UI + // You can set this to ".SystemUIFont" to use the system font + "ui_font_family": "Zed Plex Sans", + // Set the UI's font fallbacks, this will be merged with the platform's + // default font fallbacks. + "ui_font_fallbacks": [], + // The OpenType features to enable for text in the UI + "ui_font_features": { + // Disable ligatures: + "calt": false + }, + // The weight of the UI font in standard CSS units from 100 to 900. + "ui_font_weight": 400, + // The default font size for text in the UI + "ui_font_size": 16, + // The factor to grow the active pane by. Defaults to 1.0 + // which gives the same size as all other panes. + "active_pane_magnification": 1.0, + // Centered layout related settings. + "centered_layout": { + // The relative width of the left padding of the central pane from the + // workspace when the centered layout is used. + "left_padding": 0.2, + // The relative width of the right padding of the central pane from the + // workspace when the centered layout is used. + "right_padding": 0.2 + }, + // The key to use for adding multiple cursors + // Currently "alt" or "cmd_or_ctrl" (also aliased as + // "cmd" and "ctrl") are supported. + "multi_cursor_modifier": "alt", + // Whether to enable vim modes and key bindings. + "vim_mode": false, + // Whether to show the informational hover box when moving the mouse + // over symbols in the editor. + "hover_popover_enabled": true, + // Whether to confirm before quitting Zed. + "confirm_quit": false, + // Whether to restore last closed project when fresh Zed instance is opened. + "restore_on_startup": "last_session", + // Size of the drop target in the editor. + "drop_target_size": 0.2, + // Whether the window should be closed when using 'close active item' on a window with no tabs. + // May take 3 values: + // 1. Use the current platform's convention + // "when_closing_with_no_tabs": "platform_default" + // 2. Always close the window: + // "when_closing_with_no_tabs": "close_window", + // 3. Never close the window + // "when_closing_with_no_tabs": "keep_window_open", + "when_closing_with_no_tabs": "platform_default", + // Whether to use the system provided dialogs for Open and Save As. + // When set to false, Zed will use the built-in keyboard-first pickers. + "use_system_path_prompts": true, + // Whether the cursor blinks in the editor. + "cursor_blink": true, + // How to highlight the current line in the editor. + // + // 1. Don't highlight the current line: + // "none" + // 2. Highlight the gutter area: + // "gutter" + // 3. Highlight the editor area: + // "line" + // 4. Highlight the full line (default): + // "all" + "current_line_highlight": "all", + // Whether to pop the completions menu while typing in an editor without + // explicitly requesting it. + "show_completions_on_input": true, + // Whether to display inline and alongside documentation for items in the + // completions menu + "show_completion_documentation": true, + // The debounce delay before re-querying the language server for completion + // documentation when not included in original completion list. + "completion_documentation_secondary_query_debounce": 300, + // Show method signatures in the editor, when inside parentheses. + "auto_signature_help": false, + /// Whether to show the signature help after completion or a bracket pair inserted. + /// If `auto_signature_help` is enabled, this setting will be treated as enabled also. + "show_signature_help_after_edits": true, + // Whether to show wrap guides (vertical rulers) in the editor. + // Setting this to true will show a guide at the 'preferred_line_length' value + // if softwrap is set to 'preferred_line_length', and will show any + // additional guides as specified by the 'wrap_guides' setting. + "show_wrap_guides": true, + // Character counts at which to show wrap guides in the editor. + "wrap_guides": [], + // Hide the values of in variables from visual display in private files + "redact_private_values": false, + // The default number of lines to expand excerpts in the multibuffer by. + "expand_excerpt_lines": 3, + // Globs to match against file paths to determine if a file is private. + "private_files": ["**/.env*", "**/*.pem", "**/*.key", "**/*.cert", "**/*.crt", "**/secrets.yml"], + // Whether to use additional LSP queries to format (and amend) the code after + // every "trigger" symbol input, defined by LSP server capabilities. + "use_on_type_format": true, + // Whether to automatically add matching closing characters when typing + // opening parenthesis, bracket, brace, single or double quote characters. + // For example, when you type (, Zed will add a closing ) at the correct position. + "use_autoclose": true, + // Whether to automatically surround selected text when typing opening parenthesis, + // bracket, brace, single or double quote characters. + // For example, when you select text and type (, Zed will surround the text with (). + "use_auto_surround": true, + // Controls how the editor handles the autoclosed characters. + // When set to `false`(default), skipping over and auto-removing of the closing characters + // happen only for auto-inserted characters. + // Otherwise(when `true`), the closing characters are always skipped over and auto-removed + // no matter how they were inserted. + "always_treat_brackets_as_autoclosed": false, + // Controls whether inline completions are shown immediately (true) + // or manually by triggering `editor::ShowInlineCompletion` (false). + "show_inline_completions": true, + // Whether to show tabs and spaces in the editor. + // This setting can take three values: + // + // 1. Draw tabs and spaces only for the selected text (default): + // "selection" + // 2. Do not draw any tabs or spaces: + // "none" + // 3. Draw all invisible symbols: + // "all" + // 4. Draw whitespaces at boundaries only: + // "boundary" + // For a whitespace to be on a boundary, any of the following conditions need to be met: + // - It is a tab + // - It is adjacent to an edge (start or end) + // - It is adjacent to a whitespace (left or right) + "show_whitespaces": "selection", + // Settings related to calls in Zed + "calls": { + // Join calls with the microphone live by default + "mute_on_join": false, + // Share your project when you are the first to join a channel + "share_on_join": false + }, + // Toolbar related settings + "toolbar": { + // Whether to show breadcrumbs. + "breadcrumbs": true, + // Whether to show quick action buttons. + "quick_actions": true, + // Whether to show the Selections menu in the editor toolbar + "selections_menu": true + }, + // Scrollbar related settings + "scrollbar": { + // When to show the scrollbar in the editor. + // This setting can take four values: + // + // 1. Show the scrollbar if there's important information or + // follow the system's configured behavior (default): + // "auto" + // 2. Match the system's configured behavior: + // "system" + // 3. Always show the scrollbar: + // "always" + // 4. Never show the scrollbar: + // "never" + "show": "auto", + // Whether to show cursor positions in the scrollbar. + "cursors": true, + // Whether to show git diff indicators in the scrollbar. + "git_diff": true, + // Whether to show buffer search results in the scrollbar. + "search_results": true, + // Whether to show selected symbol occurrences in the scrollbar. + "selected_symbol": true, + // Whether to show diagnostic indicators in the scrollbar. + "diagnostics": true + }, + // What to do when multibuffer is double clicked in some of its excerpts + // (parts of singleton buffers). + // May take 2 values: + // 1. Behave as a regular buffer and select the whole word (default). + // "double_click_in_multibuffer": "select" + // 2. Open the excerpt clicked as a new buffer in the new tab. + // "double_click_in_multibuffer": "open", + // For the case of "open", regular selection behavior can be achieved by holding `alt` when double clicking. + "double_click_in_multibuffer": "select", + "gutter": { + // Whether to show line numbers in the gutter. + "line_numbers": true, + // Whether to show code action buttons in the gutter. + "code_actions": true, + // Whether to show runnables buttons in the gutter. + "runnables": true, + // Whether to show fold buttons in the gutter. + "folds": true + }, + "indent_guides": { + /// Whether to show indent guides in the editor. + "enabled": true, + /// The width of the indent guides in pixels, between 1 and 10. + "line_width": 1, + /// The width of the active indent guide in pixels, between 1 and 10. + "active_line_width": 1, + /// Determines how indent guides are colored. + /// This setting can take the following three values: + /// + /// 1. "disabled" + /// 2. "fixed" + /// 3. "indent_aware" + "coloring": "fixed", + /// Determines how indent guide backgrounds are colored. + /// This setting can take the following two values: + /// + /// 1. "disabled" + /// 2. "indent_aware" + "background_coloring": "disabled" + }, + // Whether the editor will scroll beyond the last line. + "scroll_beyond_last_line": "one_page", + // The number of lines to keep above/below the cursor when scrolling. + "vertical_scroll_margin": 3, + // Scroll sensitivity multiplier. This multiplier is applied + // to both the horizontal and vertical delta values while scrolling. + "scroll_sensitivity": 1.0, + "relative_line_numbers": false, + // If 'search_wrap' is disabled, search result do not wrap around the end of the file. + "search_wrap": true, + // When to populate a new search's query based on the text under the cursor. + // This setting can take the following three values: + // + // 1. Always populate the search query with the word under the cursor (default). + // "always" + // 2. Only populate the search query when there is text selected + // "selection" + // 3. Never populate the search query + // "never" + "seed_search_query_from_cursor": "always", + // Inlay hint related settings + "inlay_hints": { + // Global switch to toggle hints on and off, switched off by default. + "enabled": false, + // Toggle certain types of hints on and off, all switched on by default. + "show_type_hints": true, + "show_parameter_hints": true, + // Corresponds to null/None LSP hint type value. + "show_other_hints": true, + // Time to wait after editing the buffer, before requesting the hints, + // set to 0 to disable debouncing. + "edit_debounce_ms": 700, + // Time to wait after scrolling the buffer, before requesting the hints, + // set to 0 to disable debouncing. + "scroll_debounce_ms": 50 + }, + "project_panel": { + // Whether to show the project panel button in the status bar + "button": true, + // Default width of the project panel. + "default_width": 240, + // Where to dock the project panel. Can be 'left' or 'right'. + "dock": "left", + // Whether to show file icons in the project panel. + "file_icons": true, + // Whether to show folder icons or chevrons for directories in the project panel. + "folder_icons": true, + // Whether to show the git status in the project panel. + "git_status": true, + // Amount of indentation for nested items. + "indent_size": 20, + // Whether to reveal it in the project panel automatically, + // when a corresponding project entry becomes active. + // Gitignored entries are never auto revealed. + "auto_reveal_entries": true, + // Whether to fold directories automatically and show compact folders + // (e.g. "a/b/c" ) when a directory has only one subdirectory inside. + "auto_fold_dirs": true, + /// Scrollbar-related settings + "scrollbar": { + /// When to show the scrollbar in the project panel. + /// + /// Default: always + "show": "always" + } + }, + "outline_panel": { + // Whether to show the outline panel button in the status bar + "button": true, + // Default width of the outline panel. + "default_width": 300, + // Where to dock the outline panel. Can be 'left' or 'right'. + "dock": "left", + // Whether to show file icons in the outline panel. + "file_icons": true, + // Whether to show folder icons or chevrons for directories in the outline panel. + "folder_icons": true, + // Whether to show the git status in the outline panel. + "git_status": true, + // Amount of indentation for nested items. + "indent_size": 20, + // Whether to reveal it in the outline panel automatically, + // when a corresponding outline entry becomes active. + // Gitignored entries are never auto revealed. + "auto_reveal_entries": true, + /// Whether to fold directories automatically + /// when a directory has only one directory inside. + "auto_fold_dirs": true + }, + "collaboration_panel": { + // Whether to show the collaboration panel button in the status bar. + "button": true, + // Where to dock the collaboration panel. Can be 'left' or 'right'. + "dock": "left", + // Default width of the collaboration panel. + "default_width": 240 + }, + "chat_panel": { + // Whether to show the chat panel button in the status bar. + "button": true, + // Where to the chat panel. Can be 'left' or 'right'. + "dock": "right", + // Default width of the chat panel. + "default_width": 240 + }, + "message_editor": { + // Whether to automatically replace emoji shortcodes with emoji characters. + // For example: typing `:wave:` gets replaced with `👋`. + "auto_replace_emoji_shortcode": true + }, + "notification_panel": { + // Whether to show the notification panel button in the status bar. + "button": true, + // Where to dock the notification panel. Can be 'left' or 'right'. + "dock": "right", + // Default width of the notification panel. + "default_width": 380 + }, + "assistant": { + // Version of this setting. + "version": "2", + // Whether the assistant is enabled. + "enabled": true, + // Whether to show the assistant panel button in the status bar. + "button": true, + // Where to dock the assistant panel. Can be 'left', 'right' or 'bottom'. + "dock": "right", + // Default width when the assistant is docked to the left or right. + "default_width": 640, + // Default height when the assistant is docked to the bottom. + "default_height": 320, + // The default model to use when creating new contexts. + "default_model": { + // The provider to use. + "provider": "zed.dev", + // The model to use. + "model": "claude-3-5-sonnet" + } + }, + // The settings for slash commands. + "slash_commands": { + // Settings for the `/docs` slash command. + "docs": { + // Whether `/docs` is enabled. + "enabled": false + }, + // Settings for the `/project` slash command. + "project": { + // Whether `/project` is enabled. + "enabled": false + } + }, + // Whether the screen sharing icon is shown in the os status bar. + "show_call_status_icon": true, + // Whether to use language servers to provide code intelligence. + "enable_language_server": true, + // Whether to perform linked edits of associated ranges, if the language server supports it. + // For example, when editing opening tag, the contents of the closing tag will be edited as well. + "linked_edits": true, + // The list of language servers to use (or disable) for all languages. + // + // This is typically customized on a per-language basis. + "language_servers": ["..."], + // When to automatically save edited buffers. This setting can + // take four values. + // + // 1. Never automatically save: + // "autosave": "off", + // 2. Save when changing focus away from the Zed window: + // "autosave": "on_window_change", + // 3. Save when changing focus away from a specific buffer: + // "autosave": "on_focus_change", + // 4. Save when idle for a certain amount of time: + // "autosave": { "after_delay": {"milliseconds": 500} }, + "autosave": "off", + // Settings related to the editor's tab bar. + "tab_bar": { + // Whether or not to show the tab bar in the editor + "show": true, + // Whether or not to show the navigation history buttons. + "show_nav_history_buttons": true + }, + // Settings related to the editor's tabs + "tabs": { + // Show git status colors in the editor tabs. + "git_status": false, + // Position of the close button on the editor tabs. + "close_position": "right", + // Whether to show the file icon for a tab. + "file_icons": false + }, + // Settings related to preview tabs. + "preview_tabs": { + // Whether preview tabs should be enabled. + // Preview tabs allow you to open files in preview mode, where they close automatically + // when you switch to another file unless you explicitly pin them. + // This is useful for quickly viewing files without cluttering your workspace. + "enabled": true, + // Whether to open tabs in preview mode when selected from the file finder. + "enable_preview_from_file_finder": false, + // Whether a preview tab gets replaced when code navigation is used to navigate away from the tab. + "enable_preview_from_code_navigation": false + }, + // Whether or not to remove any trailing whitespace from lines of a buffer + // before saving it. + "remove_trailing_whitespace_on_save": true, + // Whether to start a new line with a comment when a previous line is a comment as well. + "extend_comment_on_newline": true, + // Whether or not to ensure there's a single newline at the end of a buffer + // when saving it. + "ensure_final_newline_on_save": true, + // Whether or not to perform a buffer format before saving + // + // Keep in mind, if the autosave with delay is enabled, format_on_save will be ignored + "format_on_save": "on", + // How to perform a buffer format. This setting can take 4 values: + // + // 1. Format code using the current language server: + // "formatter": "language_server" + // 2. Format code using an external command: + // "formatter": { + // "external": { + // "command": "prettier", + // "arguments": ["--stdin-filepath", "{buffer_path}"] + // } + // } + // 3. Format code using Zed's Prettier integration: + // "formatter": "prettier" + // 4. Default. Format files using Zed's Prettier integration (if applicable), + // or falling back to formatting via language server: + // "formatter": "auto" + "formatter": "auto", + // How to soft-wrap long lines of text. + // Possible values: + // + // 1. Do not soft wrap. + // "soft_wrap": "none", + // 2. Prefer a single line generally, unless an overly long line is encountered. + // "soft_wrap": "prefer_line", + // 3. Soft wrap lines that overflow the editor. + // "soft_wrap": "editor_width", + // 4. Soft wrap lines at the preferred line length. + // "soft_wrap": "preferred_line_length", + "soft_wrap": "prefer_line", + // The column at which to soft-wrap lines, for buffers where soft-wrap + // is enabled. + "preferred_line_length": 80, + // Whether to indent lines using tab characters, as opposed to multiple + // spaces. + "hard_tabs": false, + // How many columns a tab should occupy. + "tab_size": 4, + // Control what info is collected by Zed. + "telemetry": { + // Send debug info like crash reports. + "diagnostics": true, + // Send anonymized usage data like what languages you're using Zed with. + "metrics": true + }, + // Automatically update Zed. This setting may be ignored on Linux if + // installed through a package manager. + "auto_update": true, + // Diagnostics configuration. + "diagnostics": { + // Whether to show warnings or not by default. + "include_warnings": true + }, + // Add files or globs of files that will be excluded by Zed entirely: + // they will be skipped during FS scan(s), file tree and file search + // will lack the corresponding file entries. + "file_scan_exclusions": [ + "**/.git", + "**/.svn", + "**/.hg", + "**/CVS", + "**/.DS_Store", + "**/Thumbs.db", + "**/.classpath", + "**/.settings" + ], + // Git gutter behavior configuration. + "git": { + // Control whether the git gutter is shown. May take 2 values: + // 1. Show the gutter + // "git_gutter": "tracked_files" + // 2. Hide the gutter + // "git_gutter": "hide" + "git_gutter": "tracked_files", + // Control whether the git blame information is shown inline, + // in the currently focused line. + "inline_blame": { + "enabled": true + // Sets a delay after which the inline blame information is shown. + // Delay is restarted with every cursor movement. + // "delay_ms": 600 + } + }, + // Configuration for how direnv configuration should be loaded. May take 2 values: + // 1. Load direnv configuration through the shell hook, works for POSIX shells and fish. + // "load_direnv": "shell_hook" + // 2. Load direnv configuration using `direnv export json` directly. + // This can help with some shells that otherwise would not detect + // the direnv environment, such as nushell or elvish. + // "load_direnv": "direct" + "load_direnv": "shell_hook", + "inline_completions": { + // A list of globs representing files that inline completions should be disabled for. + "disabled_globs": [".env"] + }, + // Settings specific to journaling + "journal": { + // The path of the directory where journal entries are stored + "path": "~", + // What format to display the hours in + // May take 2 values: + // 1. hour12 + // 2. hour24 + "hour_format": "hour12" + }, + // Settings specific to the terminal + "terminal": { + // What shell to use when opening a terminal. May take 3 values: + // 1. Use the system's default terminal configuration in /etc/passwd + // "shell": "system" + // 2. A program: + // "shell": { + // "program": "sh" + // } + // 3. A program with arguments: + // "shell": { + // "with_arguments": { + // "program": "/bin/bash", + // "arguments": ["--login"] + // } + // } + "shell": "system", + // Where to dock terminals panel. Can be `left`, `right`, `bottom`. + "dock": "bottom", + // Default width when the terminal is docked to the left or right. + "default_width": 640, + // Default height when the terminal is docked to the bottom. + "default_height": 320, + // What working directory to use when launching the terminal. + // May take 4 values: + // 1. Use the current file's project directory. Will Fallback to the + // first project directory strategy if unsuccessful + // "working_directory": "current_project_directory" + // 2. Use the first project in this workspace's directory + // "working_directory": "first_project_directory" + // 3. Always use this platform's home directory (if we can find it) + // "working_directory": "always_home" + // 4. Always use a specific directory. This value will be shell expanded. + // If this path is not a valid directory the terminal will default to + // this platform's home directory (if we can find it) + // "working_directory": { + // "always": { + // "directory": "~/zed/projects/" + // } + // } + "working_directory": "current_project_directory", + // Set the cursor blinking behavior in the terminal. + // May take 3 values: + // 1. Never blink the cursor, ignoring the terminal mode + // "blinking": "off", + // 2. Default the cursor blink to off, but allow the terminal to + // set blinking + // "blinking": "terminal_controlled", + // 3. Always blink the cursor, ignoring the terminal mode + // "blinking": "on", + "blinking": "terminal_controlled", + // Set whether Alternate Scroll mode (code: ?1007) is active by default. + // Alternate Scroll mode converts mouse scroll events into up / down key + // presses when in the alternate screen (e.g. when running applications + // like vim or less). The terminal can still set and unset this mode. + // May take 2 values: + // 1. Default alternate scroll mode to on + // "alternate_scroll": "on", + // 2. Default alternate scroll mode to off + // "alternate_scroll": "off", + "alternate_scroll": "off", + // Set whether the option key behaves as the meta key. + // May take 2 values: + // 1. Rely on default platform handling of option key, on macOS + // this means generating certain unicode characters + // "option_to_meta": false, + // 2. Make the option keys behave as a 'meta' key, e.g. for emacs + // "option_to_meta": true, + "option_as_meta": true, + // Whether or not selecting text in the terminal will automatically + // copy to the system clipboard. + "copy_on_select": false, + // Whether to show the terminal button in the status bar + "button": true, + // Any key-value pairs added to this list will be added to the terminal's + // environment. Use `:` to separate multiple values. + "env": { + // "KEY": "value1:value2" + }, + // Set the terminal's line height. + // May take 3 values: + // 1. Use a line height that's comfortable for reading, 1.618 + // "line_height": "comfortable" + // 2. Use a standard line height, 1.3. This option is useful for TUIs, + // particularly if they use box characters + // "line_height": "standard", + // 3. Use a custom line height. + // "line_height": { + // "custom": 2 + // }, + "line_height": "comfortable", + // Activate the python virtual environment, if one is found, in the + // terminal's working directory (as resolved by the working_directory + // setting). Set this to "off" to disable this behavior. + "detect_venv": { + "on": { + // Default directories to search for virtual environments, relative + // to the current working directory. We recommend overriding this + // in your project's settings, rather than globally. + "directories": [".env", "env", ".venv", "venv"], + // Can also be `csh`, `fish`, and `nushell` + "activate_script": "default" + } + }, + "toolbar": { + // Whether to display the terminal title in its toolbar. + "title": true + } + // Set the terminal's font size. If this option is not included, + // the terminal will default to matching the buffer's font size. + // "font_size": 15, + // Set the terminal's font family. If this option is not included, + // the terminal will default to matching the buffer's font family. + // "font_family": "Zed Plex Mono", + // Set the terminal's font fallbacks. If this option is not included, + // the terminal will default to matching the buffer's font fallbacks. + // This will be merged with the platform's default font fallbacks + // "font_fallbacks": ["FiraCode Nerd Fonts"], + // Sets the maximum number of lines in the terminal's scrollback buffer. + // Default: 10_000, maximum: 100_000 (all bigger values set will be treated as 100_000), 0 disables the scrolling. + // Existing terminals will not pick up this change until they are recreated. + // "max_scroll_history_lines": 10000, + }, + "code_actions_on_format": {}, + /// Settings related to running tasks. + "tasks": { + "variables": {} + }, + // An object whose keys are language names, and whose values + // are arrays of filenames or extensions of files that should + // use those languages. + // + // For example, to treat files like `foo.notjs` as JavaScript, + // and `Embargo.lock` as TOML: + // + // { + // "JavaScript": ["notjs"], + // "TOML": ["Embargo.lock"] + // } + // + "file_types": { + "JSON": ["flake.lock"], + "JSONC": ["**/.zed/**/*.json", "**/zed/**/*.json", "**/Zed/**/*.json", "tsconfig.json"] + }, + // The extensions that Zed should automatically install on startup. + // + // If you don't want any of these extensions, add this field to your settings + // and change the value to `false`. + "auto_install_extensions": { + "html": true + }, + // Different settings for specific languages. + "languages": { + "Astro": { + "prettier": { + "allowed": true, + "plugins": ["prettier-plugin-astro"] + } + }, + "Blade": { + "prettier": { + "allowed": true + } + }, + "C": { + "format_on_save": "off", + "use_on_type_format": false + }, + "C++": { + "format_on_save": "off", + "use_on_type_format": false + }, + "CSS": { + "prettier": { + "allowed": true + } + }, + "Elixir": { + "language_servers": ["elixir-ls", "!next-ls", "!lexical", "..."] + }, + "Erlang": { + "language_servers": ["erlang-ls", "!elp", "..."] + }, + "Go": { + "code_actions_on_format": { + "source.organizeImports": true + } + }, + "GraphQL": { + "prettier": { + "allowed": true + } + }, + "HEEX": { + "language_servers": ["elixir-ls", "!next-ls", "!lexical", "..."] + }, + "HTML": { + "prettier": { + "allowed": true + } + }, + "Java": { + "prettier": { + "allowed": true, + "plugins": ["prettier-plugin-java"] + } + }, + "JavaScript": { + "language_servers": ["!typescript-language-server", "vtsls", "..."], + "prettier": { + "allowed": true + } + }, + "JSON": { + "prettier": { + "allowed": true + } + }, + "JSONC": { + "prettier": { + "allowed": true + } + }, + "Markdown": { + "format_on_save": "off", + "use_on_type_format": false, + "prettier": { + "allowed": true + } + }, + "PHP": { + "language_servers": ["phpactor", "!intelephense", "..."], + "prettier": { + "allowed": true, + "plugins": ["@prettier/plugin-php"], + "parser": "php" + } + }, + "Ruby": { + "language_servers": ["solargraph", "!ruby-lsp", "!rubocop", "..."] + }, + "SCSS": { + "prettier": { + "allowed": true + } + }, + "SQL": { + "prettier": { + "allowed": true, + "plugins": ["prettier-plugin-sql"] + } + }, + "Starlark": { + "language_servers": ["starpls", "!buck2-lsp", "..."] + }, + "Svelte": { + "language_servers": ["svelte-language-server", "..."], + "prettier": { + "allowed": true, + "plugins": ["prettier-plugin-svelte"] + } + }, + "TSX": { + "language_servers": ["!typescript-language-server", "vtsls", "..."], + "prettier": { + "allowed": true + } + }, + "Twig": { + "prettier": { + "allowed": true + } + }, + "TypeScript": { + "language_servers": ["!typescript-language-server", "vtsls", "..."], + "prettier": { + "allowed": true + } + }, + "Vue.js": { + "language_servers": ["vue-language-server", "..."], + "prettier": { + "allowed": true + } + }, + "XML": { + "prettier": { + "allowed": true, + "plugins": ["@prettier/plugin-xml"] + } + }, + "YAML": { + "prettier": { + "allowed": true + } + } + }, + // Different settings for specific language models. + "language_models": { + "anthropic": { + "version": "1", + "api_url": "https://api.anthropic.com" + }, + "google": { + "api_url": "https://generativelanguage.googleapis.com" + }, + "ollama": { + "api_url": "http://localhost:11434" + }, + "openai": { + "version": "1", + "api_url": "https://api.openai.com/v1" + } + }, + // Zed's Prettier integration settings. + // Allows to enable/disable formatting with Prettier + // and configure default Prettier, used when no project-level Prettier installation is found. + "prettier": { + // // Whether to consider prettier formatter or not when attempting to format a file. + // "allowed": false, + // + // // Use regular Prettier json configuration. + // // If Prettier is allowed, Zed will use this for its Prettier instance for any applicable file, if + // // the project has no other Prettier installed. + // "plugins": [], + // + // // Use regular Prettier json configuration. + // // If Prettier is allowed, Zed will use this for its Prettier instance for any applicable file, if + // // the project has no other Prettier installed. + // "trailingComma": "es5", + // "tabWidth": 4, + // "semi": false, + // "singleQuote": true + }, + // LSP Specific settings. + "lsp": { + // Specify the LSP name as a key here. + // "rust-analyzer": { + // // These initialization options are merged into Zed's defaults + // "initialization_options": { + // "check": { + // "command": "clippy" // rust-analyzer.check.command (default: "check") + // } + // } + // } + }, + // Jupyter settings + "jupyter": { + "enabled": true + // Specify the language name as the key and the kernel name as the value. + // "kernel_selections": { + // "python": "conda-base" + // "typescript": "deno" + // } + }, + // Vim settings + "vim": { + "use_system_clipboard": "always", + "use_multiline_find": false, + "use_smartcase_find": false, + "custom_digraphs": {} + }, + // The server to connect to. If the environment variable + // ZED_SERVER_URL is set, it will override this setting. + "server_url": "https://zed.dev", + // Settings overrides to use when using Zed Preview. + // Mostly useful for developers who are managing multiple instances of Zed. + "preview": { + // "theme": "Andromeda" + }, + // Settings overrides to use when using Zed Nightly. + // Mostly useful for developers who are managing multiple instances of Zed. + "nightly": { + // "theme": "Andromeda" + }, + // Settings overrides to use when using Zed Stable. + // Mostly useful for developers who are managing multiple instances of Zed. + "stable": { + // "theme": "Andromeda" + }, + // Settings overrides to use when using Zed Dev. + // Mostly useful for developers who are managing multiple instances of Zed. + "dev": { + // "theme": "Andromeda" + }, + // Task-related settings. + "task": { + // Whether to show task status indicator in the status bar. Default: true + "show_status_indicator": true + }, + // Whether to show full labels in line indicator or short ones + // + // Values: + // - `short`: "2 s, 15 l, 32 c" + // - `long`: "2 selections, 15 lines, 32 characters" + // Default: long + "line_indicator_format": "long", + // Set a proxy to use. The proxy protocol is specified by the URI scheme. + // + // Supported URI scheme: `http`, `https`, `socks4`, `socks4a`, `socks5`, + // `socks5h`. `http` will be used when no scheme is specified. + // + // By default no proxy will be used, or Zed will try get proxy settings from + // environment variables. + // + // Examples: + // - "proxy": "socks5://localhost:10808" + // - "proxy": "http://127.0.0.1:10809" + "proxy": null, + // Set to configure aliases for the command palette. + // When typing a query which is a key of this object, the value will be used instead. + // + // Examples: + // { + // "W": "workspace::Save" + // } + "command_aliases": {}, + // ssh_connections is an array of ssh connections. + // By default this setting is null, which disables the direct ssh connection support. + // You can configure these from `project: Open Remote` in the command palette. + // Zed's ssh support will pull configuration from your ~/.ssh too. + // Examples: + // [ + // { + // "host": "example-box", + // "projects": [ + // { + // "paths": ["/home/user/code/zed"] + // } + // ] + // } + // ] + "ssh_connections": null, + // Configures the Context Server Protocol binaries + // + // Examples: + // { + // "id": "server-1", + // "executable": "/path", + // "args": ['arg1", "args2"] + // } + "experimental.context_servers": { + "servers": [] + } +} diff --git a/io.sc.engine.rule.frontend/package.json b/io.sc.engine.rule.frontend/package.json index 2a29c389..a69308dc 100644 --- a/io.sc.engine.rule.frontend/package.json +++ b/io.sc.engine.rule.frontend/package.json @@ -92,7 +92,7 @@ "luckyexcel": "1.0.1", "mockjs": "1.1.0", "pinia": "2.2.2", - "platform-core": "8.1.322", + "platform-core": "8.1.323", "quasar": "2.16.11", "tailwindcss": "3.4.10", "vue": "3.4.38", diff --git a/io.sc.engine.rule.frontend/src/views/authorization/Authorization.vue b/io.sc.engine.rule.frontend/src/views/authorization/Authorization.vue index 826b6e33..fc036b24 100644 --- a/io.sc.engine.rule.frontend/src/views/authorization/Authorization.vue +++ b/io.sc.engine.rule.frontend/src/views/authorization/Authorization.vue @@ -15,9 +15,9 @@ }" :query-form-cols-num="3" :query-form-fields="[ - { name: 'code', label: $t('code'), type: 'text' }, - { name: 'name', label: $t('name'), type: 'text' }, - { name: 'enable', label: $t('isEnable'), type: 'select', options: Options.yesNo() }, + { name: 'code', label: $t('code'), type: 'w-text' }, + { name: 'name', label: $t('name'), type: 'w-text' }, + { name: 'enable', label: $t('isEnable'), type: 'w-select', options: Options.yesNo() }, ]" :toolbar-configure="{ noIcon: false }" :toolbar-actions="['query', 'separator', 'refresh', 'separator', 'view', 'separator', 'export']" diff --git a/io.sc.engine.rule.frontend/src/views/function/Function.vue b/io.sc.engine.rule.frontend/src/views/function/Function.vue index 1d5c8b0b..72b89651 100644 --- a/io.sc.engine.rule.frontend/src/views/function/Function.vue +++ b/io.sc.engine.rule.frontend/src/views/function/Function.vue @@ -80,13 +80,13 @@ form: { colsNum: 1, fields: [ - { name: 'name', label: $t('name'), type: 'text', required: true }, - { name: 'signature', label: $t('re.function.grid.entity.signature'), type: 'text', required: true }, - { name: 'description', label: $t('description'), type: 'text' }, + { name: 'name', label: $t('name'), type: 'w-text', required: true }, + { name: 'signature', label: $t('re.function.grid.entity.signature'), type: 'w-text', required: true }, + { name: 'description', label: $t('description'), type: 'w-text' }, { name: 'mathXml', label: $t('re.function.grid.entity.mathXml'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 5, lang: 'xml', toolbar: false, @@ -103,8 +103,8 @@ ) `, }, - { name: 'body', label: $t('re.function.grid.entity.body'), type: 'code-mirror', rows: 10, lang: 'java', toolbar: false }, - { name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true }, + { name: 'body', label: $t('re.function.grid.entity.body'), type: 'w-code-mirror', rows: 10, lang: 'java', toolbar: false }, + { name: 'enable', label: $t('enable'), type: 'w-checkbox', defaultValue: true }, ], }, }" diff --git a/io.sc.engine.rule.frontend/src/views/lib/IndicatorGrid.vue b/io.sc.engine.rule.frontend/src/views/lib/IndicatorGrid.vue index ac6e360a..d8cd19cb 100644 --- a/io.sc.engine.rule.frontend/src/views/lib/IndicatorGrid.vue +++ b/io.sc.engine.rule.frontend/src/views/lib/IndicatorGrid.vue @@ -94,8 +94,8 @@ ]" :query-form-cols-num="6" :query-form-fields="[ - { colSpan: 2, name: 'code', label: $t('code'), type: 'text', clearable: true }, - { colSpan: 3, name: 'name', label: $t('name'), type: 'text', clearable: true }, + { colSpan: 2, name: 'code', label: $t('code'), type: 'w-text', clearable: true }, + { colSpan: 3, name: 'name', label: $t('name'), type: 'w-text', clearable: true }, ]" :columns="[ { width: 60, name: 'order', label: $t('order'), align: 'right' }, @@ -135,13 +135,13 @@ form: { colsNum: 1, fields: [ - { name: 'lib', label: $t('lib'), type: 'text', defaultValue: lib.id, hidden: true }, - { name: 'name', label: $t('name'), type: 'text' }, - { name: 'type', label: $t('type'), type: 'select', options: Options.enum(Enums.IndicatorType) }, + { name: 'lib', label: $t('lib'), type: 'w-text', defaultValue: lib.id, hidden: true }, + { name: 'name', label: $t('name'), type: 'w-text' }, + { name: 'type', label: $t('type'), type: 'w-select', options: Options.enum(Enums.IndicatorType) }, { name: 'valueType', label: $t('re.resources.designer.parameter.grid.entity.valueType'), - type: 'select', + type: 'w-select', options: ValueTypeList, 'onUpdate:modelValue': (value) => { axios.get(Environment.apiContextPath('/api/re/dictionary/getVersionsByCode?code=' + value)).then((response) => { @@ -157,7 +157,7 @@ { name: 'valueTypeVersion', label: $t('re.resources.designer.parameter.grid.entity.valueTypeVersion'), - type: 'select', + type: 'w-select', options: valueTypeVersionRef, showIf: (arg) => { const valueType = arg.form.getFieldValue('valueType'); @@ -189,7 +189,7 @@ { name: 'valueScale', label: $t('re.resources.designer.parameter.grid.entity.valueScale'), - type: 'number', + type: 'w-number', defaultValue: 6, showIf: (arg) => { const valueType = arg.form.getFieldValue('valueType'); @@ -203,7 +203,7 @@ { name: 'valueRoundingMode', label: $t('re.resources.designer.parameter.grid.entity.valueRoundingMode'), - type: 'select', + type: 'w-select', options: Options.enum(Enums.RoundingMode), defaultValue: 'HALF_UP', showIf: (arg) => { @@ -218,16 +218,16 @@ { name: 'valueTypeIsList', label: $t('re.resources.designer.parameter.grid.entity.valueTypeIsList'), - type: 'checkbox', + type: 'w-checkbox', defaultValue: false, }, { name: 'defaultValue', label: $t('defaultValue'), - type: 'text', + type: 'w-text', }, - { name: 'order', label: $t('order'), type: 'number' }, + { name: 'order', label: $t('order'), type: 'w-number' }, ], }, }" diff --git a/io.sc.engine.rule.frontend/src/views/lib/LibGrid.vue b/io.sc.engine.rule.frontend/src/views/lib/LibGrid.vue index 9f51ae55..e807e5f5 100644 --- a/io.sc.engine.rule.frontend/src/views/lib/LibGrid.vue +++ b/io.sc.engine.rule.frontend/src/views/lib/LibGrid.vue @@ -224,19 +224,19 @@ form: { colsNum: 1, fields: [ - { name: 'parent', label: $t('parent'), type: 'text', hidden: true }, - { name: 'type', label: $t('type'), type: 'text', hidden: true }, + { name: 'parent', label: $t('parent'), type: 'w-text', hidden: true }, + { name: 'type', label: $t('type'), type: 'w-text', hidden: true }, { name: 'code', label: $t('code'), - type: 'text', + type: 'w-text', showIf: (arg) => { const type = arg.form.getFieldValue('type'); return type !== 'FOLDER'; }, }, - { name: 'name', label: $t('name'), type: 'text', required: true }, - { name: 'description', label: $t('description'), type: 'text' }, + { name: 'name', label: $t('name'), type: 'w-text', required: true }, + { name: 'description', label: $t('description'), type: 'w-text' }, ], }, }" diff --git a/io.sc.engine.rule.frontend/src/views/lib/ProcessorGrid.vue b/io.sc.engine.rule.frontend/src/views/lib/ProcessorGrid.vue index 4f4977a5..20049827 100644 --- a/io.sc.engine.rule.frontend/src/views/lib/ProcessorGrid.vue +++ b/io.sc.engine.rule.frontend/src/views/lib/ProcessorGrid.vue @@ -303,15 +303,15 @@ form: { colsNum: 5, fields: [ - { colSpan: 5, name: 'indicator', label: 'indicator', type: 'text', defaultValue: indicator.id, hidden: true }, - { colSpan: 5, name: 'id', label: $t('id'), type: 'text', hidden: true }, - { colSpan: 5, name: 'order', label: $t('order'), type: 'number', hidden: true }, - { colSpan: 5, name: 'type', label: $t('type'), type: 'text', hidden: true }, + { colSpan: 5, name: 'indicator', label: 'indicator', type: 'w-text', defaultValue: indicator.id, hidden: true }, + { colSpan: 5, name: 'id', label: $t('id'), type: 'w-text', hidden: true }, + { colSpan: 5, name: 'order', label: $t('order'), type: 'w-number', hidden: true }, + { colSpan: 5, name: 'type', label: $t('type'), type: 'w-text', hidden: true }, { colSpan: 5, name: 'objectCondition', label: $t('re.resources.designer.processor.grid.entity.objectCondition'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -432,7 +432,7 @@ { name: 'expression', label: $t('expression'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -457,7 +457,7 @@ colSpan: 5, name: 'mathFormula', label: $t('re.resources.designer.processor.grid.entity.mathFormula'), - type: 'math', + type: 'w-math', autoCompletion: autoCompletion, showIf: (arg) => { return 'MATH_FORMULA' === arg.form.getFieldValue('type'); @@ -467,7 +467,7 @@ colSpan: 5, name: 'arithmetic', label: $t('re.resources.designer.processor.grid.entity.arithmetic'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 5, lineWrap: true, @@ -483,7 +483,7 @@ colSpan: 5, name: 'ternaryCondition', label: $t('re.resources.designer.processor.grid.entity.ternaryCondition'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -499,7 +499,7 @@ colSpan: 5, name: 'ternaryTrue', label: $t('re.resources.designer.processor.grid.entity.ternaryTrue'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -515,7 +515,7 @@ colSpan: 5, name: 'ternaryFalse', label: $t('re.resources.designer.processor.grid.entity.ternaryFalse'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -531,7 +531,7 @@ colSpan: 5, name: 'when', label: $t('re.resources.designer.processor.grid.entity.when'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -547,7 +547,7 @@ colSpan: 5, name: 'then', label: $t('re.resources.designer.processor.grid.entity.then'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -563,7 +563,7 @@ colSpan: 5, name: 'isWhenThenShorted', label: $t('re.resources.designer.processor.grid.entity.isWhenThenShorted'), - type: 'checkbox', + type: 'w-checkbox', showIf: (arg) => { return 'WHEN_THEN' === arg.form.getFieldValue('type'); }, @@ -575,7 +575,7 @@ showIf: (arg) => { return 'NUMBER_RANGE' === arg.form.getFieldValue('type'); }, - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 2, lineWrap: true, @@ -672,11 +672,11 @@ colsNum: 4, fields: [ { name: 'uuid', label: 'uuid', hidden: true, colSpan: 4 }, - { name: 'min', label: $t('minValue'), type: 'text', colSpan: 3 }, - { name: 'minIncluded', label: $t('include'), type: 'checkbox' }, - { name: 'max', label: $t('maxValue'), type: 'text', colSpan: 3 }, - { name: 'maxIncluded', label: $t('include'), type: 'checkbox' }, - { name: 'value', label: $t('value'), type: 'number', colSpan: 3 }, + { name: 'min', label: $t('minValue'), type: 'w-text', colSpan: 3 }, + { name: 'minIncluded', label: $t('include'), type: 'w-checkbox' }, + { name: 'max', label: $t('maxValue'), type: 'w-text', colSpan: 3 }, + { name: 'maxIncluded', label: $t('include'), type: 'w-checkbox' }, + { name: 'value', label: $t('value'), type: 'w-number', colSpan: 3 }, ], }, }, @@ -768,7 +768,7 @@ { name: 'condition', label: $t('condition'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -780,7 +780,7 @@ { name: 'value', label: $t('value'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -809,7 +809,7 @@ colSpan: 5, name: 'groovyScript', label: $t('re.resources.designer.processor.grid.entity.groovyScript'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 20, lang: 'java', lineWrap: false, @@ -825,7 +825,7 @@ colSpan: 5, name: 'sqlDatasourceName', label: $t('re.resources.designer.processor.grid.entity.sqlDatasourceName'), - type: 'select', + type: 'w-select', clearable: true, options: dsOptionsRef, rows: 1, @@ -837,7 +837,7 @@ colSpan: 3, name: 'sql', label: $t('re.resources.designer.processor.grid.entity.sql'), - type: 'code-mirror', + type: 'w-code-mirror', height: 180, lang: 'sql', toolbar: false, @@ -934,7 +934,7 @@ { name: 'name', label: $t('name'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 1, placeholder: true, @@ -944,7 +944,7 @@ { name: 'value', label: $t('value'), - type: 'text', + type: 'w-text', }, ], }, @@ -1081,13 +1081,13 @@ { name: 'field', label: $t('fieldName'), - type: 'select', + type: 'w-select', options: sqlQueryResultFieldsRef, }, { name: 'parameter', label: $t('parameterName'), - type: 'select', + type: 'w-select', options: indicatorOptionsRef, }, ], diff --git a/io.sc.engine.rule.frontend/src/views/lib/TestCase.vue b/io.sc.engine.rule.frontend/src/views/lib/TestCase.vue index 1ffa39ee..149610b4 100644 --- a/io.sc.engine.rule.frontend/src/views/lib/TestCase.vue +++ b/io.sc.engine.rule.frontend/src/views/lib/TestCase.vue @@ -80,12 +80,12 @@ form: { colsNum: 1, fields: [ - { name: 'order', label: $t('order'), type: 'text', hidden: true }, - { name: 'id', label: $t('id'), type: 'text', hidden: true }, - { name: 'ownerType', label: $t('ownerType'), type: 'text', defaultValue: 'LIB', hidden: true }, - { name: 'owner', label: $t('owner'), type: 'text', defaultValue: lib.id, hidden: true }, - { name: 'name', label: $t('name'), type: 'text', required: true }, - { name: 'description', label: $t('description'), type: 'text' }, + { name: 'order', label: $t('order'), type: 'w-text', hidden: true }, + { name: 'id', label: $t('id'), type: 'w-text', hidden: true }, + { name: 'ownerType', label: $t('ownerType'), type: 'w-text', defaultValue: 'LIB', hidden: true }, + { name: 'owner', label: $t('owner'), type: 'w-text', defaultValue: lib.id, hidden: true }, + { name: 'name', label: $t('name'), type: 'w-text', required: true }, + { name: 'description', label: $t('description'), type: 'w-text' }, ], }, }" diff --git a/io.sc.engine.rule.frontend/src/views/lib/TestCaseParameter.vue b/io.sc.engine.rule.frontend/src/views/lib/TestCaseParameter.vue index 0a9ca308..bb815e3b 100644 --- a/io.sc.engine.rule.frontend/src/views/lib/TestCaseParameter.vue +++ b/io.sc.engine.rule.frontend/src/views/lib/TestCaseParameter.vue @@ -87,16 +87,16 @@ form: { colsNum: 1, fields: [ - { name: 'testCase', label: $t('testCase'), type: 'text', defaultValue: testCase.id, hidden: true }, - { name: 'id', label: $t('id'), type: 'text', hidden: true }, - { name: 'source', label: $t('source'), type: 'text', hidden: true }, - { name: 'parameterType', label: $t('parameterType'), type: 'text', hidden: true }, - { name: 'scoreCardVarType', label: $t('scoreCardVarType'), type: 'text', hidden: true }, - { name: 'indicatorType', label: $t('indicatorType'), type: 'text', hidden: true }, + { name: 'testCase', label: $t('testCase'), type: 'w-text', defaultValue: testCase.id, hidden: true }, + { name: 'id', label: $t('id'), type: 'w-text', hidden: true }, + { name: 'source', label: $t('source'), type: 'w-text', hidden: true }, + { name: 'parameterType', label: $t('parameterType'), type: 'w-text', hidden: true }, + { name: 'scoreCardVarType', label: $t('scoreCardVarType'), type: 'w-text', hidden: true }, + { name: 'indicatorType', label: $t('indicatorType'), type: 'w-text', hidden: true }, { name: 'inputValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.inputValue'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 4, showIf: (arg) => { const parameterType = arg.form.getFieldValue('parameterType'); @@ -115,7 +115,7 @@ { name: 'expectValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.expectValue'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 4, showIf: (arg) => { const parameterType = arg.form.getFieldValue('parameterType'); @@ -135,11 +135,11 @@ { name: 'resultValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.resultValue'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 4, lang: 'json', }, - { name: 'skipCheck', label: $t('re.resources.designer.testCaseParameter.grid.entity.skipCheck'), type: 'checkbox' }, + { name: 'skipCheck', label: $t('re.resources.designer.testCaseParameter.grid.entity.skipCheck'), type: 'w-checkbox' }, ], }, }" diff --git a/io.sc.engine.rule.frontend/src/views/lib/ValidatorGrid.vue b/io.sc.engine.rule.frontend/src/views/lib/ValidatorGrid.vue index 2cadcd05..74684afa 100644 --- a/io.sc.engine.rule.frontend/src/views/lib/ValidatorGrid.vue +++ b/io.sc.engine.rule.frontend/src/views/lib/ValidatorGrid.vue @@ -43,17 +43,17 @@ form: { colsNum: 1, fields: [ - { name: 'indicator', label: 'indicator', type: 'text', defaultValue: indicator.id, hidden: true }, - { name: 'id', label: $t('id'), type: 'text', hidden: true }, + { name: 'indicator', label: 'indicator', type: 'w-text', defaultValue: indicator.id, hidden: true }, + { name: 'id', label: $t('id'), type: 'w-text', hidden: true }, { name: 'description', label: $t('description'), - type: 'text', + type: 'w-text', }, { name: 'type', label: $t('type'), - type: 'select', + type: 'w-select', required: true, options: ValueTypeAndValidatorTypeMapping[ValueTypeAndValidatorTypeMapping[indicator.valueType] == null ? 'java.lang.Object' : indicator.valueType], @@ -61,7 +61,7 @@ { name: 'minValue', label: $t('minValue'), - type: 'text', + type: 'w-text', showIf: (arg) => { const type = arg.form.getFieldValue('type'); if (type == 'INTEGER_RANGE' || type == 'DECIMAL_RANGE' || type == 'LENGTH_RANGE' || type == 'DATE_RANGE') { @@ -73,7 +73,7 @@ { name: 'minInclude', label: $t('isMinValueInclude'), - type: 'checkbox', + type: 'w-checkbox', showIf: (arg) => { const type = arg.form.getFieldValue('type'); if (type == 'INTEGER_RANGE' || type == 'DECIMAL_RANGE' || type == 'LENGTH_RANGE' || type == 'DATE_RANGE') { @@ -85,7 +85,7 @@ { name: 'maxValue', label: $t('maxValue'), - type: 'text', + type: 'w-text', showIf: (arg) => { const type = arg.form.getFieldValue('type'); if (type == 'INTEGER_RANGE' || type == 'DECIMAL_RANGE' || type == 'LENGTH_RANGE' || type == 'DATE_RANGE') { @@ -97,7 +97,7 @@ { name: 'maxInclude', label: $t('isMaxValueInclude'), - type: 'checkbox', + type: 'w-checkbox', showIf: (arg) => { const type = arg.form.getFieldValue('type'); if (type == 'INTEGER_RANGE' || type == 'DECIMAL_RANGE' || type == 'LENGTH_RANGE' || type == 'DATE_RANGE') { @@ -109,7 +109,7 @@ { name: 'pattern', label: $t('RegExp'), - type: 'text', + type: 'w-text', showIf: (arg) => { const type = arg.form.getFieldValue('type'); if (type == 'PATTERN') { @@ -121,9 +121,9 @@ { name: 'tip', label: $t('re.resources.designer.validator.grid.entity.tip'), - type: 'text', + type: 'w-text', }, - { name: 'order', label: $t('order'), type: 'number', hidden: false }, + { name: 'order', label: $t('order'), type: 'w-number', hidden: false }, ], }, }" diff --git a/io.sc.engine.rule.frontend/src/views/resources/Resources.vue b/io.sc.engine.rule.frontend/src/views/resources/Resources.vue index 4508c599..f16062a4 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/Resources.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/Resources.vue @@ -290,22 +290,22 @@ form: { colsNum: 1, fields: [ - { name: 'type', label: $t('type'), type: 'text', hidden: true }, + { name: 'type', label: $t('type'), type: 'w-text', hidden: true }, { name: 'code', label: $t('code'), - type: 'text', + type: 'w-text', showIf: (arg) => { const type = arg.form.getFieldValue('type'); return type === 'MODEL' || type === 'SCORE_CARD'; }, }, - { name: 'name', label: $t('name'), type: 'text', required: true }, - { name: 'description', label: $t('description'), type: 'text' }, + { name: 'name', label: $t('name'), type: 'w-text', required: true }, + { name: 'description', label: $t('description'), type: 'w-text' }, { name: 'imports', label: $t('re.resources.grid.entity.imports'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', lineWrap: true, lineBreak: false, @@ -346,9 +346,8 @@ }" @row-db-click=" (args) => { - console.log(args); - if (row.type !== 'FOLDER') { - designerDialogRef.open(row); + if (args.row.type !== 'FOLDER') { + designerDialogRef.open(args.row); } } " diff --git a/io.sc.engine.rule.frontend/src/views/resources/StartDeployWorkflowDialog.vue b/io.sc.engine.rule.frontend/src/views/resources/StartDeployWorkflowDialog.vue index eebcb88e..871435df 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/StartDeployWorkflowDialog.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/StartDeployWorkflowDialog.vue @@ -18,7 +18,7 @@ diff --git a/io.sc.engine.rule.frontend/src/views/resources/designer/Designer.vue b/io.sc.engine.rule.frontend/src/views/resources/designer/Designer.vue index 20333859..df53e7f6 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/designer/Designer.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/designer/Designer.vue @@ -5,9 +5,9 @@ {} }, - { name: 'model', label: $t('modelId'), type: 'text', defaultValue: model.id, hidden: true }, - { name: 'code', label: $t('code'), type: 'text' }, - { name: 'name', label: $t('name'), type: 'text', required: true }, - { name: 'description', label: $t('description'), type: 'text' }, + { name: 'type', label: $t('type'), type: 'w-select', options: Options.enum(Enums.ParameterType), 'onUpdate:modelValue': (value) => {} }, + { name: 'model', label: $t('modelId'), type: 'w-text', defaultValue: model.id, hidden: true }, + { name: 'code', label: $t('code'), type: 'w-text' }, + { name: 'name', label: $t('name'), type: 'w-text', required: true }, + { name: 'description', label: $t('description'), type: 'w-text' }, { name: 'libCode', label: $t('re.resources.designer.parameter.grid.entity.libCode'), - type: 'select', + type: 'w-select', options: libCodeOptionsRef, showIf: (arg) => { const type = arg.form.getFieldValue('type'); @@ -228,7 +228,7 @@ { name: 'libVersion', label: $t('re.resources.designer.parameter.grid.entity.libVersion'), - type: 'select', + type: 'w-select', options: libVersionOptionsRef, showIf: (arg) => { const type = arg.form.getFieldValue('type'); @@ -242,7 +242,7 @@ { name: 'indicatorCode', label: $t('re.resources.designer.parameter.grid.entity.indicatorCode'), - type: 'select', + type: 'w-select', options: indicatorCodeOptionsRef, showIf: (arg) => { const type = arg.form.getFieldValue('type'); @@ -252,7 +252,7 @@ { name: 'valueType', label: $t('re.resources.designer.parameter.grid.entity.valueType'), - type: 'select', + type: 'w-select', options: ValueTypeList, defaultValue: 'java.math.BigDecimal', showIf: (arg) => { @@ -277,7 +277,7 @@ { name: 'valueTypeVersion', label: $t('re.resources.designer.parameter.grid.entity.valueTypeVersion'), - type: 'select', + type: 'w-select', clearable: true, options: valueTypeVersionOptionsRef, showIf: (arg) => { @@ -314,7 +314,7 @@ { name: 'valueScale', label: $t('re.resources.designer.parameter.grid.entity.valueScale'), - type: 'number', + type: 'w-number', defaultValue: 6, showIf: (arg) => { const valueType = arg.form.getFieldValue('valueType'); @@ -334,7 +334,7 @@ { name: 'valueRoundingMode', label: $t('re.resources.designer.parameter.grid.entity.valueRoundingMode'), - type: 'select', + type: 'w-select', options: Options.enum(Enums.RoundingMode), defaultValue: 'HALF_UP', showIf: (arg) => { @@ -355,7 +355,7 @@ { name: 'valueTypeIsList', label: $t('re.resources.designer.parameter.grid.entity.valueTypeIsList'), - type: 'checkbox', + type: 'w-checkbox', defaultValue: false, showIf: (arg) => { const type = arg.form.getFieldValue('type'); @@ -368,7 +368,7 @@ { name: 'defaultValue', label: $t('defaultValue'), - type: 'text', + type: 'w-text', showIf: (arg) => { const type = arg.form.getFieldValue('type'); const valueTypeIsList = arg.form.getFieldValue('valueTypeIsList'); @@ -379,7 +379,7 @@ }, }, - { name: 'order', label: $t('order'), type: 'number' }, + { name: 'order', label: $t('order'), type: 'w-number' }, ], }, }" @@ -413,8 +413,8 @@ }, }" @row-click=" - (evt, row, index) => { - emit('rowClick', evt, row, index); + (args) => { + emit('rowClick', args); } " @before-request-data=" @@ -482,7 +482,7 @@ const props = defineProps({ }); const emit = defineEmits<{ - (e: 'rowClick', evt: Event, row: any, index: number): void; + (e: 'rowClick', args): void; (e: 'beforeRequestData', requestParams: URLSearchParams | any, callback: any): void; }>(); diff --git a/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue b/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue index 0d954098..47938e88 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/designer/Processor.vue @@ -434,17 +434,17 @@ form: { colsNum: 5, fields: [ - { colSpan: 5, name: 'parameter', label: 'parameter', type: 'text', defaultValue: parameter.id, hidden: true }, - { colSpan: 5, name: 'id', label: $t('id'), type: 'text', hidden: true }, - { colSpan: 5, name: 'order', label: $t('order'), type: 'number', hidden: true }, - { colSpan: 5, name: 'type', label: $t('type'), type: 'text', hidden: true }, - { colSpan: 5, name: 'description', label: $t('description'), type: 'text', hidden: true }, - { colSpan: 5, name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true, hidden: true }, + { colSpan: 5, name: 'parameter', label: 'parameter', type: 'w-text', defaultValue: parameter.id, hidden: true }, + { colSpan: 5, name: 'id', label: $t('id'), type: 'w-text', hidden: true }, + { colSpan: 5, name: 'order', label: $t('order'), type: 'w-number', hidden: true }, + { colSpan: 5, name: 'type', label: $t('type'), type: 'w-text', hidden: true }, + { colSpan: 5, name: 'description', label: $t('description'), type: 'w-text', hidden: true }, + { colSpan: 5, name: 'enable', label: $t('enable'), type: 'w-checkbox', defaultValue: true, hidden: true }, { colSpan: 5, name: 'objectCondition', label: $t('re.resources.designer.processor.grid.entity.objectCondition'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -563,7 +563,7 @@ { name: 'expression', label: $t('expression'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -587,7 +587,7 @@ colSpan: 5, name: 'optionCode', label: $t('re.resources.designer.processor.grid.entity.optionCode'), - type: 'select', + type: 'w-select', options: optionOptionsRef, showIf: (arg) => { return 'OPTION_VALUE' === arg.form.getFieldValue('type'); @@ -597,7 +597,7 @@ colSpan: 5, name: 'mathFormula', label: $t('re.resources.designer.processor.grid.entity.mathFormula'), - type: 'math', + type: 'w-math', autoCompletion: autoCompletion, userDefinedFunctions: userDefinedFunctionsRef, showIf: (arg) => { @@ -608,7 +608,7 @@ colSpan: 5, name: 'arithmetic', label: $t('re.resources.designer.processor.grid.entity.arithmetic'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 5, placeholder: true, @@ -624,7 +624,7 @@ colSpan: 5, name: 'ternaryCondition', label: $t('re.resources.designer.processor.grid.entity.ternaryCondition'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 4, placeholder: true, @@ -640,7 +640,7 @@ colSpan: 5, name: 'ternaryTrue', label: $t('re.resources.designer.processor.grid.entity.ternaryTrue'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 4, placeholder: true, @@ -656,7 +656,7 @@ colSpan: 5, name: 'ternaryFalse', label: $t('re.resources.designer.processor.grid.entity.ternaryFalse'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 4, placeholder: true, @@ -672,7 +672,7 @@ colSpan: 5, name: 'when', label: $t('re.resources.designer.processor.grid.entity.when'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 4, lineWrap: true, @@ -688,7 +688,7 @@ colSpan: 5, name: 'then', label: $t('re.resources.designer.processor.grid.entity.then'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 4, lineWrap: true, @@ -704,7 +704,7 @@ colSpan: 5, name: 'isWhenThenShorted', label: $t('re.resources.designer.processor.grid.entity.isWhenThenShorted'), - type: 'checkbox', + type: 'w-checkbox', showIf: (arg) => { return 'WHEN_THEN' === arg.form.getFieldValue('type'); }, @@ -716,7 +716,7 @@ showIf: (arg) => { return 'NUMBER_RANGE' === arg.form.getFieldValue('type'); }, - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 3, lineWrap: true, @@ -814,11 +814,11 @@ colsNum: 4, fields: [ { name: 'uuid', label: 'uuid', hidden: true, colSpan: 4 }, - { name: 'min', label: $t('minValue'), type: 'text', colSpan: 3 }, - { name: 'minIncluded', label: $t('include'), type: 'checkbox' }, - { name: 'max', label: $t('maxValue'), type: 'text', colSpan: 3 }, - { name: 'maxIncluded', label: $t('include'), type: 'checkbox' }, - { name: 'value', label: $t('value'), type: 'number', colSpan: 3 }, + { name: 'min', label: $t('minValue'), type: 'w-text', colSpan: 3 }, + { name: 'minIncluded', label: $t('include'), type: 'w-checkbox' }, + { name: 'max', label: $t('maxValue'), type: 'w-text', colSpan: 3 }, + { name: 'maxIncluded', label: $t('include'), type: 'w-checkbox' }, + { name: 'value', label: $t('value'), type: 'w-number', colSpan: 3 }, ], }, }, @@ -912,7 +912,7 @@ { name: 'condition', label: $t('condition'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 4, placeholder: true, @@ -924,7 +924,7 @@ { name: 'value', label: $t('value'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 4, lineWrap: true, @@ -953,7 +953,7 @@ colSpan: 5, name: 'decisionTable2C', label: $t('re.resources.designer.processor.grid.entity.decisionTable2C'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 1, showIf: (arg) => { return 'DECISION_TABLE_2C' === arg.form.getFieldValue('type'); @@ -963,7 +963,7 @@ colSpan: 5, name: 'decisionTable', label: $t('re.resources.designer.processor.grid.entity.decisionTable'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 1, showIf: (arg) => { return 'DECISION_TABLE' === arg.form.getFieldValue('type'); @@ -973,7 +973,7 @@ colSpan: 5, name: 'decisionTree', label: $t('re.resources.designer.processor.grid.entity.decisionTree'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 20, lineNumber: true, toolbar: false, @@ -985,7 +985,7 @@ colSpan: 5, name: 'executionFlow', label: $t('re.resources.designer.processor.grid.entity.executionFlow'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 20, lineNumber: true, toolbar: false, @@ -997,7 +997,7 @@ colSpan: 5, name: 'pmml', label: $t('re.resources.designer.processor.grid.entity.pmml'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 20, lineNumber: true, toolbar: false, @@ -1010,7 +1010,7 @@ colSpan: 5, name: 'groovyScript', label: $t('re.resources.designer.processor.grid.entity.groovyScript'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 20, lineNumber: true, lang: 'java', @@ -1027,7 +1027,7 @@ colSpan: 5, name: 'sqlDatasourceName', label: $t('re.resources.designer.processor.grid.entity.sqlDatasourceName'), - type: 'select', + type: 'w-select', clearable: true, options: dsOptionsRef, rows: 1, @@ -1039,7 +1039,7 @@ colSpan: 3, name: 'sql', label: $t('re.resources.designer.processor.grid.entity.sql'), - type: 'code-mirror', + type: 'w-code-mirror', height: 180, lang: 'sql', toolbar: false, @@ -1136,7 +1136,7 @@ { name: 'name', label: $t('name'), - type: 'code-mirror', + type: 'w-code-mirror', lang: 'java', rows: 1, placeholder: true, @@ -1145,7 +1145,7 @@ { name: 'value', label: $t('value'), - type: 'text', + type: 'w-text', }, ], }, @@ -1282,13 +1282,13 @@ { name: 'field', label: $t('fieldName'), - type: 'select', + type: 'w-select', options: sqlQueryResultFieldsRef, }, { name: 'parameter', label: $t('parameterName'), - type: 'select', + type: 'w-select', options: parameterOptionsRef, }, ], @@ -1419,7 +1419,8 @@ } " @after-editor-open=" - (row) => { + (args) => { + const row = args.data; // 获取代码提示列表 axios.get(Environment.apiContextPath('/api/re/common/listParameterAndValueTypeByParameterId/' + parameter.id)).then((response) => { autoCompletionManager.setParameters(response.data.parameters); @@ -1498,14 +1499,14 @@ } " @row-db-click=" - (e, row) => { - const type = row.type; + (args) => { + const type = args.row.type; if ('DECISION_TREE' === type) { - decisionTreeDialogRef.open(row.id); + decisionTreeDialogRef.open(args.row.id); } else if ('EXECUTION_FLOW' === type) { - executionFlowDialogRef.open(row.id); + executionFlowDialogRef.open(args.row.id); } else { - gridRef.edit(row); + gridRef.edit(args.row); } } " @@ -1540,11 +1541,6 @@ const props = defineProps({ readOnly: { type: Boolean, default: false }, }); -const emit = defineEmits<{ - (e: 'rowClick', evt: Event, row: any, index: number): void; - (e: 'beforeRequestData', requestParams: URLSearchParams | any, callback: any): void; -}>(); - const gridRef = ref(); const optionOptionsRef = ref([]); const dsOptionsRef = ref([]); diff --git a/io.sc.engine.rule.frontend/src/views/resources/designer/TestCaseParameter.vue b/io.sc.engine.rule.frontend/src/views/resources/designer/TestCaseParameter.vue index e866094a..d6f842a3 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/designer/TestCaseParameter.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/designer/TestCaseParameter.vue @@ -83,16 +83,16 @@ form: { colsNum: 1, fields: [ - { name: 'testCase', label: $t('testCase'), type: 'text', defaultValue: testCase.id, hidden: true }, - { name: 'id', label: $t('id'), type: 'text', hidden: true }, - { name: 'source', label: $t('source'), type: 'text', hidden: true }, - { name: 'parameterType', label: $t('parameterType'), type: 'text', hidden: true }, - { name: 'scoreCardVarType', label: $t('scoreCardVarType'), type: 'text', hidden: true }, - { name: 'indicatorType', label: $t('indicatorType'), type: 'text', hidden: true }, + { name: 'testCase', label: $t('testCase'), type: 'w-text', defaultValue: testCase.id, hidden: true }, + { name: 'id', label: $t('id'), type: 'w-text', hidden: true }, + { name: 'source', label: $t('source'), type: 'w-text', hidden: true }, + { name: 'parameterType', label: $t('parameterType'), type: 'w-text', hidden: true }, + { name: 'scoreCardVarType', label: $t('scoreCardVarType'), type: 'w-text', hidden: true }, + { name: 'indicatorType', label: $t('indicatorType'), type: 'w-text', hidden: true }, { name: 'inputValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.inputValue'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 4, showIf: (arg) => { const parameterType = arg.form.getFieldValue('parameterType'); @@ -111,7 +111,7 @@ { name: 'expectValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.expectValue'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 4, showIf: (arg) => { const parameterType = arg.form.getFieldValue('parameterType'); @@ -131,11 +131,11 @@ { name: 'resultValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.resultValue'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 4, lang: 'json', }, - { name: 'skipCheck', label: $t('re.resources.designer.testCaseParameter.grid.entity.skipCheck'), type: 'checkbox' }, + { name: 'skipCheck', label: $t('re.resources.designer.testCaseParameter.grid.entity.skipCheck'), type: 'w-checkbox' }, ], }, }" diff --git a/io.sc.engine.rule.frontend/src/views/resources/designer/Validator.vue b/io.sc.engine.rule.frontend/src/views/resources/designer/Validator.vue index eb2dd7c9..ecc33863 100644 --- a/io.sc.engine.rule.frontend/src/views/resources/designer/Validator.vue +++ b/io.sc.engine.rule.frontend/src/views/resources/designer/Validator.vue @@ -70,18 +70,18 @@ form: { colsNum: 1, fields: [ - { name: 'parameter', label: 'parameter', type: 'text', defaultValue: parameter.id, hidden: true }, - { name: 'id', label: $t('id'), type: 'text', hidden: true }, + { name: 'parameter', label: 'parameter', type: 'w-text', defaultValue: parameter.id, hidden: true }, + { name: 'id', label: $t('id'), type: 'w-text', hidden: true }, { name: 'description', label: $t('description'), - type: 'text', + type: 'w-text', }, - { name: 'type', label: $t('type'), type: 'select', options: ValueTypeAndValidatorTypeMapping[parameter.valueType] }, + { name: 'type', label: $t('type'), type: 'w-select', options: ValueTypeAndValidatorTypeMapping[parameter.valueType] }, { name: 'minValue', label: $t('minValue'), - type: 'text', + type: 'w-text', showIf: (arg) => { const type = arg.form.getFieldValue('type'); if (type == 'INTEGER_RANGE' || type == 'DECIMAL_RANGE' || type == 'LENGTH_RANGE' || type == 'DATE_RANGE') { @@ -93,7 +93,7 @@ { name: 'minInclude', label: $t('isMinValueInclude'), - type: 'checkbox', + type: 'w-checkbox', showIf: (arg) => { const type = arg.form.getFieldValue('type'); if (type == 'INTEGER_RANGE' || type == 'DECIMAL_RANGE' || type == 'LENGTH_RANGE' || type == 'DATE_RANGE') { @@ -105,7 +105,7 @@ { name: 'maxValue', label: $t('maxValue'), - type: 'text', + type: 'w-text', showIf: (arg) => { const type = arg.form.getFieldValue('type'); if (type == 'INTEGER_RANGE' || type == 'DECIMAL_RANGE' || type == 'LENGTH_RANGE' || type == 'DATE_RANGE') { @@ -117,7 +117,7 @@ { name: 'maxInclude', label: $t('isMaxValueInclude'), - type: 'checkbox', + type: 'w-checkbox', showIf: (arg) => { const type = arg.form.getFieldValue('type'); if (type == 'INTEGER_RANGE' || type == 'DECIMAL_RANGE' || type == 'LENGTH_RANGE' || type == 'DATE_RANGE') { @@ -129,7 +129,7 @@ { name: 'pattern', label: $t('RegExp'), - type: 'text', + type: 'w-text', showIf: (arg) => { const type = arg.form.getFieldValue('type'); if (type == 'PATTERN') { @@ -141,9 +141,9 @@ { name: 'tip', label: $t('re.resources.designer.validator.grid.entity.tip'), - type: 'text', + type: 'w-text', }, - { name: 'order', label: $t('order'), type: 'number', hidden: false }, + { name: 'order', label: $t('order'), type: 'w-number', hidden: false }, ], }, }" diff --git a/io.sc.engine.rule.frontend/src/views/shared/SelectIndicatorDialog.vue b/io.sc.engine.rule.frontend/src/views/shared/SelectIndicatorDialog.vue index 4b8d18c4..9c60dd90 100644 --- a/io.sc.engine.rule.frontend/src/views/shared/SelectIndicatorDialog.vue +++ b/io.sc.engine.rule.frontend/src/views/shared/SelectIndicatorDialog.vue @@ -117,8 +117,8 @@ :toolbar-actions="['query', 'refresh', 'separator', 'view']" :query-form-cols-num="2" :query-form-fields="[ - { name: 'code', label: $t('code'), type: 'text', clearable: true }, - { name: 'name', label: $t('name'), type: 'text', clearable: true }, + { name: 'code', label: $t('code'), type: 'w-text', clearable: true }, + { name: 'name', label: $t('name'), type: 'w-text', clearable: true }, ]" :columns="[ { width: 60, name: 'order', label: $t('order'), align: 'right' }, diff --git a/io.sc.engine.rule.frontend/src/views/testcase/Testcase.vue b/io.sc.engine.rule.frontend/src/views/testcase/Testcase.vue index fbd749be..1b266d21 100644 --- a/io.sc.engine.rule.frontend/src/views/testcase/Testcase.vue +++ b/io.sc.engine.rule.frontend/src/views/testcase/Testcase.vue @@ -100,10 +100,10 @@ form: { colsNum: 1, fields: [ - { name: 'order', label: $t('order'), type: 'text', hidden: true }, - { name: 'id', label: $t('id'), type: 'text', hidden: true }, - { name: 'name', label: $t('name'), type: 'text', required: true }, - { name: 'description', label: $t('description'), type: 'text' }, + { name: 'order', label: $t('order'), type: 'w-text', hidden: true }, + { name: 'id', label: $t('id'), type: 'w-text', hidden: true }, + { name: 'name', label: $t('name'), type: 'w-text', required: true }, + { name: 'description', label: $t('description'), type: 'w-text' }, ], }, }" @@ -228,16 +228,16 @@ form: { colsNum: 1, fields: [ - { name: 'testCase', label: $t('testCase'), type: 'text', defaultValue: currentSelectedTestCaseRef.id, hidden: true }, - { name: 'id', label: $t('id'), type: 'text', hidden: true }, - { name: 'source', label: $t('source'), type: 'text', hidden: true }, - { name: 'parameterType', label: $t('parameterType'), type: 'text', hidden: true }, - { name: 'scoreCardVarType', label: $t('scoreCardVarType'), type: 'text', hidden: true }, - { name: 'indicatorType', label: $t('indicatorType'), type: 'text', hidden: true }, + { name: 'testCase', label: $t('testCase'), type: 'w-text', defaultValue: currentSelectedTestCaseRef.id, hidden: true }, + { name: 'id', label: $t('id'), type: 'w-text', hidden: true }, + { name: 'source', label: $t('source'), type: 'w-text', hidden: true }, + { name: 'parameterType', label: $t('parameterType'), type: 'w-text', hidden: true }, + { name: 'scoreCardVarType', label: $t('scoreCardVarType'), type: 'w-text', hidden: true }, + { name: 'indicatorType', label: $t('indicatorType'), type: 'w-text', hidden: true }, { name: 'inputValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.inputValue'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 4, showIf: (arg) => { const parameterType = arg.form.getFieldValue('parameterType'); @@ -257,7 +257,7 @@ { name: 'expectValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.expectValue'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 4, showIf: (arg) => { const parameterType = arg.form.getFieldValue('parameterType'); @@ -280,11 +280,11 @@ { name: 'resultValue', label: $t('re.resources.designer.testCaseParameter.grid.entity.resultValue'), - type: 'code-mirror', + type: 'w-code-mirror', rows: 4, lang: 'json', }, - { name: 'skipCheck', label: $t('re.resources.designer.testCaseParameter.grid.entity.skipCheck'), type: 'checkbox' }, + { name: 'skipCheck', label: $t('re.resources.designer.testCaseParameter.grid.entity.skipCheck'), type: 'w-checkbox' }, ], }, }" diff --git a/io.sc.engine.rule.frontend/src/views/workflow/CompleteTaskDialog.vue b/io.sc.engine.rule.frontend/src/views/workflow/CompleteTaskDialog.vue index 03491fa2..3bcc1cea 100644 --- a/io.sc.engine.rule.frontend/src/views/workflow/CompleteTaskDialog.vue +++ b/io.sc.engine.rule.frontend/src/views/workflow/CompleteTaskDialog.vue @@ -14,7 +14,7 @@ diff --git a/io.sc.engine.rule.frontend/src/views/workflow/Workflow.vue b/io.sc.engine.rule.frontend/src/views/workflow/Workflow.vue index 63f32642..523820ee 100644 --- a/io.sc.engine.rule.frontend/src/views/workflow/Workflow.vue +++ b/io.sc.engine.rule.frontend/src/views/workflow/Workflow.vue @@ -156,10 +156,10 @@ form: { colsNum: 1, fields: [ - { name: 'order', label: $t('order'), type: 'text', hidden: true }, - { name: 'id', label: $t('id'), type: 'text', hidden: true }, - { name: 'name', label: $t('name'), type: 'text', required: true }, - { name: 'description', label: $t('description'), type: 'text' }, + { name: 'order', label: $t('order'), type: 'w-text', hidden: true }, + { name: 'id', label: $t('id'), type: 'w-text', hidden: true }, + { name: 'name', label: $t('name'), type: 'w-text', required: true }, + { name: 'description', label: $t('description'), type: 'w-text' }, ], }, }" diff --git a/io.sc.engine.rule.frontend/webpack.config.common.cjs b/io.sc.engine.rule.frontend/webpack.config.common.cjs index 29d61265..bb04dd8a 100644 --- a/io.sc.engine.rule.frontend/webpack.config.common.cjs +++ b/io.sc.engine.rule.frontend/webpack.config.common.cjs @@ -1,16 +1,16 @@ /** * webpack 通用配置 */ -const path = require('path'); // path -const webpack = require('webpack'); // webpack -const json5 = require('json5'); // json5 -const HtmlWebpackPlugin = require('html-webpack-plugin'); // webpack html 生成插件 -const CopyWebpackPlugin = require('copy-webpack-plugin'); // webpack copy 插件 -const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // 抽取 css 插件 -const { VueLoaderPlugin } = require('vue-loader'); // vue loader 插件 -const ESLintPlugin = require('eslint-webpack-plugin'); // eslint 插件 -const packageJson = require('./package.json'); // package.json -const projectName =packageJson.name; // 项目名称 +const path = require('path'); // path +const webpack = require('webpack'); // webpack +const json5 = require('json5'); // json5 +const HtmlWebpackPlugin = require('html-webpack-plugin'); // webpack html 生成插件 +const CopyWebpackPlugin = require('copy-webpack-plugin'); // webpack copy 插件 +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // 抽取 css 插件 +const { VueLoaderPlugin } = require('vue-loader'); // vue loader 插件 +const ESLintPlugin = require('eslint-webpack-plugin'); // eslint 插件 +const packageJson = require('./package.json'); // package.json +const projectName = packageJson.name; // 项目名称 module.exports = { // 入口文件 @@ -37,26 +37,28 @@ module.exports = { exclude: /node_modules/, use: [ { - loader: "babel-loader", + loader: 'babel-loader', options: { cacheDirectory: true, - } - } - ] + }, + }, + ], }, // css { test: /\.(sa|sc|c)ss$/, - use: [{ - loader: MiniCssExtractPlugin.loader, - }, - { - loader: 'css-loader', - }, - { - loader: 'postcss-loader', - }] + use: [ + { + loader: MiniCssExtractPlugin.loader, + }, + { + loader: 'css-loader', + }, + { + loader: 'postcss-loader', + }, + ], }, // 字体文件 @@ -65,7 +67,7 @@ module.exports = { type: 'asset/resource', generator: { filename: `fonts/[name].[contenthash:5].[ext]`, - } + }, }, // json5 @@ -84,8 +86,8 @@ module.exports = { use: [ { loader: 'vue-loader', - } - ] + }, + ], }, // 解决 @maxgraph/core 的问题, 避免出现以下错误 @@ -97,10 +99,10 @@ module.exports = { // The extension in the request is mandatory for it to be fully specified. { test: /\.js$/, - include: /node_modules\/@maxgraph\/core/, - resolve:{ + include: /node_modules[\/\\]@maxgraph[\/\\]core/, + resolve: { fullySpecified: false, - } + }, }, ], }, @@ -109,7 +111,7 @@ module.exports = { plugins: [ new webpack.DefinePlugin({ __VUE_OPTIONS_API__: JSON.stringify(true), - __VUE_PROD_DEVTOOLS__: JSON.stringify(false) + __VUE_PROD_DEVTOOLS__: JSON.stringify(false), }), // 进度显示插件 @@ -118,7 +120,7 @@ module.exports = { // css 抽取插件 new MiniCssExtractPlugin({ filename: `css/[name].[contenthash:5].css`, - chunkFilename: `css/[name].[contenthash:5].css` + chunkFilename: `css/[name].[contenthash:5].css`, }), // 自动生成静态 index.html 文件 @@ -144,8 +146,8 @@ module.exports = { return true; }, info: { minimized: true }, - } - ] + }, + ], }), // vue loader 插件 @@ -156,9 +158,7 @@ module.exports = { fix: true, formatter: 'stylish', extensions: ['js', 'ts', 'vue', 'cjs'], - exclude: [ - 'node_modules', - ], + exclude: ['node_modules'], }), ], @@ -171,9 +171,9 @@ module.exports = { // 设置支持的模块扩展名,即这些扩展名的文件可以作为模块被使用 extensions: ['.js', '.cjs', '.ts', '.vue'], fallback: { - "fs": false, - "os": false, - "path": false, - } + fs: false, + os: false, + path: false, + }, }, }; diff --git a/io.sc.platform.core.frontend/.bin/util.js b/io.sc.platform.core.frontend/.bin/util.js index 1c929eb6..1b947ec4 100644 --- a/io.sc.platform.core.frontend/.bin/util.js +++ b/io.sc.platform.core.frontend/.bin/util.js @@ -1,23 +1,23 @@ -const fs =require('fs'); +const fs = require('fs'); /** * 新建目录 * @param {*} dir 目录路径 */ -function mkdir(dir){ - fs.mkdirSync(dir,{recursive: true}); +function mkdir(dir) { + fs.mkdirSync(dir, { recursive: true }); } /** * 删除目录 * @param {*} dir 目录 */ -function rm(dir){ - fs.rmSync(dir,{recursive: true}); +function rm(dir) { + fs.rmSync(dir, { recursive: true }); } -function cp(src,target){ - fs.cpSync(src,target,{recursive: true}); +function cp(src, target) { + fs.cpSync(src, target, { recursive: true }); } /** @@ -25,7 +25,7 @@ function cp(src,target){ * @param {*} src 文件路径 * @returns javascript 对象 */ -function parseJson(src){ +function parseJson(src) { return JSON.parse(fs.readFileSync(src).toString()); } @@ -34,14 +34,14 @@ function parseJson(src){ * @param {*} filePath 文件路径 * @param {*} repalcer 替换字符 Map(key:需要替换的字符串,value:替换后的字符串) */ -function replaceAll(filePath,repalcer){ - let content =fs.readFileSync(filePath,{encoding:'utf-8'}); - if(repalcer){ - for(const key in repalcer){ - content =content.replaceAll(key,repalcer[key]); +function replaceAll(filePath, repalcer) { + let content = fs.readFileSync(filePath, { encoding: 'utf-8' }); + if (repalcer) { + for (const key in repalcer) { + content = content.replaceAll(key, repalcer[key]); } } - fs.writeFileSync(filePath,content); + fs.writeFileSync(filePath, content); } /** @@ -66,7 +66,33 @@ function mergeObject(target, source) { } } } - return target; + return sortObject(target); +} + +/** + * 排序对象的属性 + * @param {*} obj 对象 + * @returns 排序后的对象 + */ +function sortObject(obj) { + if (!obj) { + return null; + } + const propertyNames = []; + for (const property in obj) { + propertyNames.push(property); + } + propertyNames.sort(); + const result = {}; + for (const propertyName of propertyNames) { + const value = obj[propertyName]; + if (typeof value === 'object' && !Array.isArray(value)) { + result[propertyName] = sortObject(obj[propertyName]); + } else { + result[propertyName] = obj[propertyName]; + } + } + return result; } /** @@ -75,19 +101,19 @@ function mergeObject(target, source) { * @param {*} srcPath 源文件 * @param {*} includeProperties 包含的需要合并的属性列表 */ -function mergeJsonFile(targetPath,srcPath,includeProperties){ - const target =parseJson(targetPath); - const source =parseJson(srcPath); - if(includeProperties && includeProperties.length>0){ - for(const property of includeProperties){ - if(target[property]){ - mergeObject(target[property],source[property]); - }else{ - target[property] =source[property]; +function mergeJsonFile(targetPath, srcPath, includeProperties) { + const target = parseJson(targetPath); + const source = parseJson(srcPath); + if (includeProperties && includeProperties.length > 0) { + for (const property of includeProperties) { + if (target[property]) { + mergeObject(target[property], source[property]); + } else { + target[property] = source[property]; } } - }else{ - mergeObject(target,source); + } else { + mergeObject(target, source); } fs.writeFileSync(targetPath, JSON.stringify(target, null, ' ')); } @@ -106,8 +132,8 @@ function isFileExisted(file) { resolve(true); } }); - }) -}; + }); +} module.exports = { mkdir, @@ -115,7 +141,8 @@ module.exports = { cp, parseJson, replaceAll, + sortObject, mergeObject, mergeJsonFile, - isFileExisted + isFileExisted, }; diff --git a/io.sc.platform.core.frontend/package.json b/io.sc.platform.core.frontend/package.json index b8fa500d..ddb9c782 100644 --- a/io.sc.platform.core.frontend/package.json +++ b/io.sc.platform.core.frontend/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.1.322", + "version": "8.1.323", "description": "前端核心包,用于快速构建前端的脚手架", "//main": "库的主文件", "main": "dist/platform-core.js", diff --git a/io.sc.platform.core.frontend/template-project/package.json b/io.sc.platform.core.frontend/template-project/package.json index 6b3b1060..83230455 100644 --- a/io.sc.platform.core.frontend/template-project/package.json +++ b/io.sc.platform.core.frontend/template-project/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.1.322", + "version": "8.1.323", "description": "前端核心包,用于快速构建前端的脚手架", "private": false, "keywords": [], @@ -105,7 +105,7 @@ "luckyexcel": "1.0.1", "mockjs": "1.1.0", "pinia": "2.2.2", - "platform-core": "8.1.322", + "platform-core": "8.1.323", "quasar": "2.16.11", "svg-path-commander": "2.0.10", "tailwindcss": "3.4.10", diff --git a/io.sc.platform.core.frontend/template-project/webpack.config.common.cjs b/io.sc.platform.core.frontend/template-project/webpack.config.common.cjs index 29d61265..bb04dd8a 100644 --- a/io.sc.platform.core.frontend/template-project/webpack.config.common.cjs +++ b/io.sc.platform.core.frontend/template-project/webpack.config.common.cjs @@ -1,16 +1,16 @@ /** * webpack 通用配置 */ -const path = require('path'); // path -const webpack = require('webpack'); // webpack -const json5 = require('json5'); // json5 -const HtmlWebpackPlugin = require('html-webpack-plugin'); // webpack html 生成插件 -const CopyWebpackPlugin = require('copy-webpack-plugin'); // webpack copy 插件 -const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // 抽取 css 插件 -const { VueLoaderPlugin } = require('vue-loader'); // vue loader 插件 -const ESLintPlugin = require('eslint-webpack-plugin'); // eslint 插件 -const packageJson = require('./package.json'); // package.json -const projectName =packageJson.name; // 项目名称 +const path = require('path'); // path +const webpack = require('webpack'); // webpack +const json5 = require('json5'); // json5 +const HtmlWebpackPlugin = require('html-webpack-plugin'); // webpack html 生成插件 +const CopyWebpackPlugin = require('copy-webpack-plugin'); // webpack copy 插件 +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // 抽取 css 插件 +const { VueLoaderPlugin } = require('vue-loader'); // vue loader 插件 +const ESLintPlugin = require('eslint-webpack-plugin'); // eslint 插件 +const packageJson = require('./package.json'); // package.json +const projectName = packageJson.name; // 项目名称 module.exports = { // 入口文件 @@ -37,26 +37,28 @@ module.exports = { exclude: /node_modules/, use: [ { - loader: "babel-loader", + loader: 'babel-loader', options: { cacheDirectory: true, - } - } - ] + }, + }, + ], }, // css { test: /\.(sa|sc|c)ss$/, - use: [{ - loader: MiniCssExtractPlugin.loader, - }, - { - loader: 'css-loader', - }, - { - loader: 'postcss-loader', - }] + use: [ + { + loader: MiniCssExtractPlugin.loader, + }, + { + loader: 'css-loader', + }, + { + loader: 'postcss-loader', + }, + ], }, // 字体文件 @@ -65,7 +67,7 @@ module.exports = { type: 'asset/resource', generator: { filename: `fonts/[name].[contenthash:5].[ext]`, - } + }, }, // json5 @@ -84,8 +86,8 @@ module.exports = { use: [ { loader: 'vue-loader', - } - ] + }, + ], }, // 解决 @maxgraph/core 的问题, 避免出现以下错误 @@ -97,10 +99,10 @@ module.exports = { // The extension in the request is mandatory for it to be fully specified. { test: /\.js$/, - include: /node_modules\/@maxgraph\/core/, - resolve:{ + include: /node_modules[\/\\]@maxgraph[\/\\]core/, + resolve: { fullySpecified: false, - } + }, }, ], }, @@ -109,7 +111,7 @@ module.exports = { plugins: [ new webpack.DefinePlugin({ __VUE_OPTIONS_API__: JSON.stringify(true), - __VUE_PROD_DEVTOOLS__: JSON.stringify(false) + __VUE_PROD_DEVTOOLS__: JSON.stringify(false), }), // 进度显示插件 @@ -118,7 +120,7 @@ module.exports = { // css 抽取插件 new MiniCssExtractPlugin({ filename: `css/[name].[contenthash:5].css`, - chunkFilename: `css/[name].[contenthash:5].css` + chunkFilename: `css/[name].[contenthash:5].css`, }), // 自动生成静态 index.html 文件 @@ -144,8 +146,8 @@ module.exports = { return true; }, info: { minimized: true }, - } - ] + }, + ], }), // vue loader 插件 @@ -156,9 +158,7 @@ module.exports = { fix: true, formatter: 'stylish', extensions: ['js', 'ts', 'vue', 'cjs'], - exclude: [ - 'node_modules', - ], + exclude: ['node_modules'], }), ], @@ -171,9 +171,9 @@ module.exports = { // 设置支持的模块扩展名,即这些扩展名的文件可以作为模块被使用 extensions: ['.js', '.cjs', '.ts', '.vue'], fallback: { - "fs": false, - "os": false, - "path": false, - } + fs: false, + os: false, + path: false, + }, }, }; diff --git a/io.sc.platform.core.frontend/webpack.config.common.cjs b/io.sc.platform.core.frontend/webpack.config.common.cjs index 29d61265..bb04dd8a 100644 --- a/io.sc.platform.core.frontend/webpack.config.common.cjs +++ b/io.sc.platform.core.frontend/webpack.config.common.cjs @@ -1,16 +1,16 @@ /** * webpack 通用配置 */ -const path = require('path'); // path -const webpack = require('webpack'); // webpack -const json5 = require('json5'); // json5 -const HtmlWebpackPlugin = require('html-webpack-plugin'); // webpack html 生成插件 -const CopyWebpackPlugin = require('copy-webpack-plugin'); // webpack copy 插件 -const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // 抽取 css 插件 -const { VueLoaderPlugin } = require('vue-loader'); // vue loader 插件 -const ESLintPlugin = require('eslint-webpack-plugin'); // eslint 插件 -const packageJson = require('./package.json'); // package.json -const projectName =packageJson.name; // 项目名称 +const path = require('path'); // path +const webpack = require('webpack'); // webpack +const json5 = require('json5'); // json5 +const HtmlWebpackPlugin = require('html-webpack-plugin'); // webpack html 生成插件 +const CopyWebpackPlugin = require('copy-webpack-plugin'); // webpack copy 插件 +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // 抽取 css 插件 +const { VueLoaderPlugin } = require('vue-loader'); // vue loader 插件 +const ESLintPlugin = require('eslint-webpack-plugin'); // eslint 插件 +const packageJson = require('./package.json'); // package.json +const projectName = packageJson.name; // 项目名称 module.exports = { // 入口文件 @@ -37,26 +37,28 @@ module.exports = { exclude: /node_modules/, use: [ { - loader: "babel-loader", + loader: 'babel-loader', options: { cacheDirectory: true, - } - } - ] + }, + }, + ], }, // css { test: /\.(sa|sc|c)ss$/, - use: [{ - loader: MiniCssExtractPlugin.loader, - }, - { - loader: 'css-loader', - }, - { - loader: 'postcss-loader', - }] + use: [ + { + loader: MiniCssExtractPlugin.loader, + }, + { + loader: 'css-loader', + }, + { + loader: 'postcss-loader', + }, + ], }, // 字体文件 @@ -65,7 +67,7 @@ module.exports = { type: 'asset/resource', generator: { filename: `fonts/[name].[contenthash:5].[ext]`, - } + }, }, // json5 @@ -84,8 +86,8 @@ module.exports = { use: [ { loader: 'vue-loader', - } - ] + }, + ], }, // 解决 @maxgraph/core 的问题, 避免出现以下错误 @@ -97,10 +99,10 @@ module.exports = { // The extension in the request is mandatory for it to be fully specified. { test: /\.js$/, - include: /node_modules\/@maxgraph\/core/, - resolve:{ + include: /node_modules[\/\\]@maxgraph[\/\\]core/, + resolve: { fullySpecified: false, - } + }, }, ], }, @@ -109,7 +111,7 @@ module.exports = { plugins: [ new webpack.DefinePlugin({ __VUE_OPTIONS_API__: JSON.stringify(true), - __VUE_PROD_DEVTOOLS__: JSON.stringify(false) + __VUE_PROD_DEVTOOLS__: JSON.stringify(false), }), // 进度显示插件 @@ -118,7 +120,7 @@ module.exports = { // css 抽取插件 new MiniCssExtractPlugin({ filename: `css/[name].[contenthash:5].css`, - chunkFilename: `css/[name].[contenthash:5].css` + chunkFilename: `css/[name].[contenthash:5].css`, }), // 自动生成静态 index.html 文件 @@ -144,8 +146,8 @@ module.exports = { return true; }, info: { minimized: true }, - } - ] + }, + ], }), // vue loader 插件 @@ -156,9 +158,7 @@ module.exports = { fix: true, formatter: 'stylish', extensions: ['js', 'ts', 'vue', 'cjs'], - exclude: [ - 'node_modules', - ], + exclude: ['node_modules'], }), ], @@ -171,9 +171,9 @@ module.exports = { // 设置支持的模块扩展名,即这些扩展名的文件可以作为模块被使用 extensions: ['.js', '.cjs', '.ts', '.vue'], fallback: { - "fs": false, - "os": false, - "path": false, - } + fs: false, + os: false, + path: false, + }, }, };