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