mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-17 00:44:35 +08:00
编排新增按钮组弹窗
This commit is contained in:
@@ -6,6 +6,7 @@ import { dataCommands } from "./dataCommands";
|
||||
import { otherCommands } from "./otherCommands";
|
||||
import { simulateCommands } from "./simulateCommands";
|
||||
import { controlCommands } from "./controlCommands";
|
||||
import { uiCommands } from "./uiCommand";
|
||||
|
||||
export const commandCategories = [
|
||||
fileCommands,
|
||||
@@ -16,4 +17,5 @@ export const commandCategories = [
|
||||
controlCommands,
|
||||
otherCommands,
|
||||
simulateCommands,
|
||||
uiCommands,
|
||||
];
|
||||
|
||||
30
src/js/composer/commands/uiCommand.js
Normal file
30
src/js/composer/commands/uiCommand.js
Normal file
@@ -0,0 +1,30 @@
|
||||
export const uiCommands = {
|
||||
label: "UI操作",
|
||||
icon: "auto_graph",
|
||||
defaultOpened: false,
|
||||
commands: [
|
||||
{
|
||||
value: "quickcommand.showButtonBox",
|
||||
label: "按钮组弹窗",
|
||||
isAsync: true,
|
||||
config: [
|
||||
{
|
||||
label: "按钮组",
|
||||
type: "arrayEditor",
|
||||
defaultValue: [
|
||||
{
|
||||
value: "按钮1",
|
||||
isString: true,
|
||||
__varInputVal__: true,
|
||||
},
|
||||
{
|
||||
value: "按钮2",
|
||||
isString: true,
|
||||
__varInputVal__: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -95,6 +95,9 @@ const processObject = (obj, parentPath = "") => {
|
||||
* @returns {string} 格式化后的JSON字符串
|
||||
*/
|
||||
export const stringifyObject = (jsonObj) => {
|
||||
if (jsonObj instanceof Array) {
|
||||
return `[${jsonObj.map((item) => stringifyObject(item)).join(",")}]`;
|
||||
}
|
||||
if (jsonObj?.hasOwnProperty("__varInputVal__")) {
|
||||
return stringifyWithType(jsonObj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user