mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-07 21:46:12 +08:00
新增EVAL代码
This commit is contained in:
parent
1fe478f373
commit
d9bc4b4f34
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="code-editor" :style="{ height: height }">
|
||||
<div class="code-editor" :style="{ height: height + 'px' }">
|
||||
<div
|
||||
class="editor-container"
|
||||
:style="{
|
||||
@ -90,8 +90,8 @@ export default defineComponent({
|
||||
},
|
||||
// 编辑器高度
|
||||
height: {
|
||||
type: String,
|
||||
default: "300px",
|
||||
type: Number,
|
||||
default: 300,
|
||||
},
|
||||
// 编辑器主题
|
||||
theme: {
|
||||
|
@ -4,21 +4,42 @@ export const scriptCommands = {
|
||||
commands: [
|
||||
{
|
||||
value: "injectJs",
|
||||
label: "注入JS代码",
|
||||
label: "注入代码",
|
||||
icon: "script",
|
||||
description: "注入的代码(js)将在流程对应的位置直接运行。",
|
||||
neverHasOutput: true,
|
||||
isExpression: true,
|
||||
config: [
|
||||
{
|
||||
label: "JS脚本",
|
||||
component: "CodeEditor",
|
||||
language: "quickcommand",
|
||||
placeholder:
|
||||
"共享当前上下文,支持utools,quickcommand,quickcomposer等接口",
|
||||
"和当前流程共享上下文(变量、函数等),支持utools、quickcommand、quickcomposer、nodejs的接口",
|
||||
width: 12,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: `((code) => {return new Function("return " + code)()})`,
|
||||
label: "eval代码",
|
||||
description: "eval代码(js),并返回结果",
|
||||
config: [
|
||||
{
|
||||
component: "CodeEditor",
|
||||
language: "quickcommand",
|
||||
height: 40,
|
||||
hasAIAssistant: false,
|
||||
placeholder:
|
||||
"和当前流程共享上下文(变量、函数等),支持utools、quickcommand、quickcomposer、nodejs的接口。",
|
||||
width: 12,
|
||||
},
|
||||
],
|
||||
outputs: {
|
||||
label: "结果",
|
||||
suggestName: "evalResult",
|
||||
typeName: "字符串",
|
||||
},
|
||||
},
|
||||
{
|
||||
value: "quickcommand.runCode",
|
||||
label: "运行脚本",
|
||||
|
Loading…
x
Reference in New Issue
Block a user