Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-libs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-libs
Commits
9da4b276
Commit
9da4b276
authored
Nov 26, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
data类型修改为dynamic
增加map类型
parent
177a5a79
Changes
40
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
406 additions
and
63 deletions
+406
-63
compare.json
dist/processes/base/compare.json
+1
-1
entry.json
dist/processes/base/entry.json
+1
-1
log.json
dist/processes/base/log.json
+1
-1
turntable-start.json
dist/processes/custom/turntable-start.json
+1
-1
turntable-stop.json
dist/processes/custom/turntable-stop.json
+1
-1
duiba-api.json
dist/processes/duiba/duiba-api.json
+5
-1
goto-record.json
dist/processes/duiba/goto-record.json
+1
-1
http-polling.json
dist/processes/net/http-polling.json
+4
-7
http-request.json
dist/processes/net/http-request.json
+5
-1
api-request.json
dist/processes/projextX/api-request.json
+161
-0
push-dialog.json
dist/processes/view/push-dialog.json
+1
-1
set-mouse-enabled.json
dist/processes/view/set-mouse-enabled.json
+1
-1
set-node-property.json
dist/processes/view/set-node-property.json
+1
-1
set-node-visibility.json
dist/processes/view/set-node-visibility.json
+1
-1
set-script-enabled.json
dist/processes/view/set-script-enabled.json
+1
-1
set-script-property.json
dist/processes/view/set-script-property.json
+1
-1
types.d.ts
libs/types.d.ts
+7
-1
compiler-custom.js
scripts/compiler-custom.js
+4
-2
compiler-process.js
scripts/compiler-process.js
+4
-2
compiler-script.js
scripts/compiler-script.js
+4
-2
tscompiler.js
scripts/tscompiler.js
+5
-2
index.ts
src/process/base/compare/index.ts
+1
-4
index.ts
src/process/base/entry/index.ts
+1
-1
index.ts
src/process/base/log/index.ts
+2
-1
index.ts
src/process/custom/turntable-start/index.ts
+1
-1
index.ts
src/process/custom/turntable-stop/index.ts
+2
-2
index.ts
src/process/duiba/duiba-api/index.ts
+1
-1
meta.json
src/process/duiba/duiba-api/meta.json
+4
-0
index.ts
src/process/duiba/goto-record/index.ts
+2
-1
index.ts
src/process/net/http-polling/index.ts
+0
-4
meta.json
src/process/net/http-polling/meta.json
+4
-6
index.ts
src/process/net/http-request/index.ts
+8
-5
meta.json
src/process/net/http-request/meta.json
+5
-1
meta.json
src/process/projextX/api-request/meta.json
+158
-0
index.ts
src/process/view/push-dialog/index.ts
+1
-1
index.ts
src/process/view/set-mouse-enabled/index.ts
+1
-1
index.ts
src/process/view/set-node-property/index.ts
+1
-1
index.ts
src/process/view/set-node-visibility/index.ts
+1
-1
index.ts
src/process/view/set-script-enabled/index.ts
+1
-1
index.ts
src/process/view/set-script-property/index.ts
+1
-1
No files found.
dist/processes/base/compare.json
View file @
9da4b276
...
...
@@ -33,7 +33,7 @@
"false"
],
"id"
:
"compare"
,
"script"
:
"var leftValue = typeof props.left === 'string' ? '
\"
' + props.left + '
\"
' : props.left;
\n
var rightValue = typeof props.right === 'string' ? '
\"
' + props.right + '
\"
' : props.right;
\n
var operator =
(args ? args.operator : props.operator) || '==';
\n
if (operator === '==' || operator === '!=') {
\n
operator += '=';
\n
}
\n
var func = new Function('return ' + leftValue + operator + rightValue);
\n
var result = func();
\n
next(result ? 'true' : 'false');
\n
"
,
"script"
:
"var leftValue = typeof props.left === 'string' ? '
\"
' + props.left + '
\"
' : props.left;
\n
var rightValue = typeof props.right === 'string' ? '
\"
' + props.right + '
\"
' : props.right;
\n
var operator =
props.operator;
\n
var func = new Function('return ' + leftValue + operator + rightValue);
\n
var result = func();
\n
next(result ? 'true' : 'false');
\n
"
,
"group"
:
"base"
,
"type"
:
"builtin"
}
dist/processes/base/entry.json
View file @
9da4b276
...
...
@@ -6,7 +6,7 @@
"success"
],
"id"
:
"entry"
,
"script"
:
"next('success');
\n
"
,
"script"
:
"next('success'
, args
);
\n
"
,
"group"
:
"base"
,
"type"
:
"builtin"
}
dist/processes/base/log.json
View file @
9da4b276
...
...
@@ -17,7 +17,7 @@
"success"
],
"id"
:
"log"
,
"script"
:
"console.log(props ? props.content : (args ? args.content : ''));
\n
next('success');
\n
"
,
"script"
:
"console.log(props ? props.content : (args ? args.content : ''));
\n
next('success'
, args
);
\n
"
,
"group"
:
"base"
,
"type"
:
"builtin"
}
dist/processes/custom/turntable-start.json
View file @
9da4b276
...
...
@@ -6,7 +6,7 @@
"success"
],
"id"
:
"turntable-start"
,
"script"
:
"var key = 'state-' + vm.id;
\n
global[key] = true;
\n
engine.Tween.get(props.target)
\n
.set({ rotation: 0 })
\n
.to({ rotation: 360 }, props.duration, engine.Ease.quintIn)
\n
.call(function () {
\n
next('success');
\n
playLoop();
\n
});
\n
function playLoop() {
\n
var goon = global[key];
\n
if (goon) {
\n
engine.Tween.get(props.target)
\n
.set({ rotation: 0 })
\n
.to({ rotation: 360 }, props.duration / 4)
\n
.call(function () {
\n
engine.globalEvent.dispatchEvent('loop-end');
\n
playLoop();
\n
});
\n
}
\n
}
\n
"
,
"script"
:
"var key = 'state-' + vm.id;
\n
global[key] = true;
\n
engine.Tween.get(props.target)
\n
.set({ rotation: 0 })
\n
.to({ rotation: 360 }, props.duration, engine.Ease.quintIn)
\n
.call(function () {
\n
next('success'
, args
);
\n
playLoop();
\n
});
\n
function playLoop() {
\n
var goon = global[key];
\n
if (goon) {
\n
engine.Tween.get(props.target)
\n
.set({ rotation: 0 })
\n
.to({ rotation: 360 }, props.duration / 4)
\n
.call(function () {
\n
engine.globalEvent.dispatchEvent('loop-end');
\n
playLoop();
\n
});
\n
}
\n
}
\n
"
,
"group"
:
"custom"
,
"type"
:
"builtin"
}
dist/processes/custom/turntable-stop.json
View file @
9da4b276
...
...
@@ -26,7 +26,7 @@
"success"
],
"id"
:
"turntable-stop"
,
"script"
:
"if (args && args.hasOwnProperty('index')) {
\n
var key = 'state-' + vm.id;
\n
var index = args.index;
\n
var per = 360 / props.divid;
\n
var ratio = per * props.ratio;
\n
var rotation_1 = 360 * 3 - index * per + Math.random() * ratio + (per - ratio) / 2;
\n
delete global[key];
\n
engine.globalEvent.once('loop-end', function () {
\n
engine.Tween.get(props.target || target)
\n
.to({ rotation: rotation_1 }, props.duration, engine.Ease.quintOut)
\n
.call(function () {
\n
next('success'
);
\n
});
\n
});
\n
}
\n
else {
\n
engine.Tween.removeTweens(props.target || target);
\n
next('success'
);
\n
}
\n
"
,
"script"
:
"if (args && args.hasOwnProperty('index')) {
\n
var key = 'state-' + vm.id;
\n
var index = args.index;
\n
var per = 360 / props.divid;
\n
var ratio = per * props.ratio;
\n
var rotation_1 = 360 * 3 - index * per + Math.random() * ratio + (per - ratio) / 2;
\n
delete global[key];
\n
engine.globalEvent.once('loop-end', function () {
\n
engine.Tween.get(props.target || target)
\n
.to({ rotation: rotation_1 }, props.duration, engine.Ease.quintOut)
\n
.call(function () {
\n
next('success'
, args);
\n
});
\n
});
\n
}
\n
else {
\n
engine.Tween.removeTweens(props.target || target);
\n
next('success', args
);
\n
}
\n
"
,
"group"
:
"custom"
,
"type"
:
"builtin"
}
dist/processes/duiba/duiba-api.json
View file @
9da4b276
...
...
@@ -18,6 +18,10 @@
"name"
:
{
"type"
:
"string"
,
"alias"
:
"数据名"
},
"params"
:
{
"type"
:
"map"
,
"alias"
:
"参数"
}
},
"output"
:
[
...
...
@@ -180,7 +184,7 @@
}
],
"id"
:
"duiba-api"
,
"script"
:
"next('success');
\n
"
,
"script"
:
"next('success'
, args
);
\n
"
,
"group"
:
"duiba"
,
"type"
:
"builtin"
}
dist/processes/duiba/goto-record.json
View file @
9da4b276
...
...
@@ -6,7 +6,7 @@
"success"
],
"id"
:
"goto-record"
,
"script"
:
"location.href = '/record';
\n
next('success');
\n
"
,
"script"
:
"location.href = '/record';
\n
next('success'
, args
);
\n
"
,
"group"
:
"duiba"
,
"type"
:
"builtin"
}
dist/processes/net/http-polling.json
View file @
9da4b276
...
...
@@ -3,7 +3,6 @@
"props"
:
{
"url"
:
{
"type"
:
"string"
,
"enum"
:
[],
"alias"
:
"链接"
},
"method"
:
{
...
...
@@ -17,30 +16,29 @@
},
"count"
:
{
"type"
:
"number"
,
"enum"
:
[],
"alias"
:
"次数"
,
"default"
:
10
},
"delay"
:
{
"type"
:
"number"
,
"enum"
:
[],
"default"
:
500
,
"alias"
:
"单次延时"
},
"name"
:
{
"type"
:
"string"
,
"enum"
:
[],
"alias"
:
"数据名"
},
"field"
:
{
"type"
:
"string"
,
"enum"
:
[],
"alias"
:
"字段名"
},
"successValues"
:
{
"type"
:
"string"
,
"enum"
:
[],
"alias"
:
"成功值"
},
"params"
:
{
"type"
:
"map"
,
"alias"
:
"参数"
}
},
"output"
:
[
...
...
@@ -238,7 +236,6 @@
}
],
"id"
:
"http-polling"
,
"script"
:
""
,
"group"
:
"net"
,
"type"
:
"builtin"
}
dist/processes/net/http-request.json
View file @
9da4b276
...
...
@@ -14,6 +14,10 @@
],
"alias"
:
"方法"
,
"default"
:
"get"
},
"params"
:
{
"type"
:
"map"
,
"alias"
:
"参数"
}
},
"output"
:
[
...
...
@@ -22,7 +26,7 @@
"exception"
],
"id"
:
"http-request"
,
"script"
:
"
if (!props.url) {
\n
console.log('url is empty');
\n
next('exception', '
\\
'url is empty
\\
'');
\n
}
\n
else {
\n
engine.httpRequest(function (s, payload) {
\n
if (s) {
\n
next('success', payload);
\n
}
\n
else {
\n
next('failed', payload);
\n
}
\n
}, props.url, props.method, {}
, 'json');
\n
}
\n
"
,
"script"
:
"
var url = engine.findVariable('url', args, props);
\n
var params = engine.findVariable('params', args, props);
\n
if (!url) {
\n
console.log('url is empty');
\n
next('exception', '
\\
'url is empty
\\
'');
\n
}
\n
else {
\n
engine.httpRequest(function (s, payload) {
\n
if (s) {
\n
next('success', payload);
\n
}
\n
else {
\n
next('failed', payload);
\n
}
\n
}, url, props.method, params
, 'json');
\n
}
\n
"
,
"group"
:
"net"
,
"type"
:
"builtin"
}
dist/processes/projextX/api-request.json
0 → 100644
View file @
9da4b276
{
"props"
:
{
"host"
:
{
"type"
:
"string"
,
"alias"
:
"接口根"
},
"uri"
:
{
"type"
:
"string"
,
"alias"
:
"URI"
},
"method"
:
{
"type"
:
"enum"
,
"enum"
:
[
"get"
,
"post"
],
"alias"
:
"方法"
},
"dataName"
:
{
"type"
:
"string"
,
"alias"
:
"数据名"
},
"params"
:
{
"type"
:
"map"
,
"alias"
:
"参数"
}
},
"name"
:
"api请求"
,
"output"
:
[
"success"
,
"failed"
,
"exception"
],
"sub"
:
{
"e6a9f1de-40c6-445b-b5e9-5c50a904a4de"
:
{
"uuid"
:
"e6a9f1de-40c6-445b-b5e9-5c50a904a4de"
,
"meta"
:
"entry"
,
"design"
:
{
"x"
:
10
,
"y"
:
10
,
"input"
:
{},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
31
}
]
}
},
"props"
:
{},
"output"
:
{
"success"
:
[
"567169ba-a2c1-4c10-9025-605a2e89ef0f"
]
}
},
"567169ba-a2c1-4c10-9025-605a2e89ef0f"
:
{
"uuid"
:
"567169ba-a2c1-4c10-9025-605a2e89ef0f"
,
"meta"
:
"a4b27753-4cbb-47e3-9b31-51ced475e41a"
,
"design"
:
{
"x"
:
151
,
"y"
:
115
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
47.5
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
47.5
}
]
}
},
"props"
:
{
"host"
:
{
"type"
:
"link"
},
"uri"
:
{
"type"
:
"link"
}
},
"output"
:
{
"success"
:
[
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db"
]
}
},
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db"
:
{
"uuid"
:
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db"
,
"meta"
:
"duiba-api"
,
"design"
:
{
"x"
:
350
,
"y"
:
188
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
56
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
49
}
],
"failed"
:
[
{
"x"
:
124.5
,
"y"
:
63
}
]
}
},
"props"
:
{
"method"
:
{
"type"
:
"link"
},
"name"
:
{
"type"
:
"link"
,
"alias"
:
"dataName"
}
},
"output"
:
{}
}
},
"subEntry"
:
"e6a9f1de-40c6-445b-b5e9-5c50a904a4de"
,
"metas"
:
[
{
"id"
:
"a4b27753-4cbb-47e3-9b31-51ced475e41a"
,
"script"
:
"var host = engine.findVariable('host', args, props);
\n
var uri = engine.findVariable('uri', args, props);
\n
next('success', {url: engine.joinPath(host, uri)});"
,
"props"
:
{
"host"
:
{
"type"
:
"string"
,
"alias"
:
"接口根"
},
"uri"
:
{
"type"
:
"string"
,
"alias"
:
"URI"
}
},
"isInline"
:
true
,
"name"
:
"url拼接"
,
"output"
:
[
"success"
]
}
],
"id"
:
"api-request"
,
"group"
:
"projextX"
,
"type"
:
"builtin"
}
dist/processes/view/push-dialog.json
View file @
9da4b276
...
...
@@ -16,7 +16,7 @@
"complete"
],
"id"
:
"push-dialog"
,
"script"
:
"if (!props.viewName) {
\n
console.log('没有设置视图名');
\n
next('exception', '没有设置视图名');
\n
}
\n
else {
\n
var gameStage = engine.gameStage;
\n
var view = gameStage.instantiateView(props.viewName);
\n
if (view) {
\n
gameStage.popupContainer.push(view);
\n
}
\n
next('complete');
\n
}
\n
"
,
"script"
:
"if (!props.viewName) {
\n
console.log('没有设置视图名');
\n
next('exception', '没有设置视图名');
\n
}
\n
else {
\n
var gameStage = engine.gameStage;
\n
var view = gameStage.instantiateView(props.viewName);
\n
if (view) {
\n
gameStage.popupContainer.push(view
, { center: props.center }
);
\n
}
\n
next('complete');
\n
}
\n
"
,
"group"
:
"view"
,
"type"
:
"builtin"
}
dist/processes/view/set-mouse-enabled.json
View file @
9da4b276
...
...
@@ -16,7 +16,7 @@
"success"
],
"id"
:
"set-mouse-enabled"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
targetNode.mouseEnabled = props.enabled;
\n
}
\n
next('success');
\n
"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
targetNode.mouseEnabled = props.enabled;
\n
}
\n
next('success'
, args
);
\n
"
,
"group"
:
"view"
,
"type"
:
"builtin"
}
dist/processes/view/set-node-property.json
View file @
9da4b276
...
...
@@ -29,7 +29,7 @@
"success"
],
"id"
:
"set-node-property"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
var field = props.field, valueType = props.valueType, value = props.value;
\n
if (field && value) {
\n
var tValue = void 0;
\n
switch (valueType) {
\n
case 'number':
\n
tValue = parseFloat(value);
\n
break;
\n
case 'string':
\n
tValue = value;
\n
break;
\n
case 'boolean':
\n
tValue = value === 'true' ? true : (value === 'false' ? false : value);
\n
break;
\n
}
\n
if (tValue !== undefined) {
\n
targetNode[field] = tValue;
\n
}
\n
}
\n
}
\n
next('success');
\n
"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
var field = props.field, valueType = props.valueType, value = props.value;
\n
if (field && value) {
\n
var tValue = void 0;
\n
switch (valueType) {
\n
case 'number':
\n
tValue = parseFloat(value);
\n
break;
\n
case 'string':
\n
tValue = value;
\n
break;
\n
case 'boolean':
\n
tValue = value === 'true' ? true : (value === 'false' ? false : value);
\n
break;
\n
}
\n
if (tValue !== undefined) {
\n
targetNode[field] = tValue;
\n
}
\n
}
\n
}
\n
next('success'
, args
);
\n
"
,
"group"
:
"view"
,
"type"
:
"builtin"
}
dist/processes/view/set-node-visibility.json
View file @
9da4b276
...
...
@@ -16,7 +16,7 @@
"success"
],
"id"
:
"set-node-visibility"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
targetNode.visible = props.visible;
\n
}
\n
next('success');
\n
"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
targetNode.visible = props.visible;
\n
}
\n
next('success'
, args
);
\n
"
,
"group"
:
"view"
,
"type"
:
"builtin"
}
dist/processes/view/set-script-enabled.json
View file @
9da4b276
...
...
@@ -24,7 +24,7 @@
"success"
],
"id"
:
"set-script-enabled"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
var scriptsProxy = targetNode.scriptsProxy;
\n
var scriptIndex = props.scriptIndex, scriptName = props.scriptName, enabled = props.enabled;
\n
var script = void 0;
\n
if (scriptIndex !== undefined) {
\n
script = scriptsProxy.all[scriptIndex];
\n
}
\n
else if (scriptName !== undefined) {
\n
script = scriptsProxy.get(scriptName);
\n
}
\n
if (script) {
\n
script.disabled = !enabled;
\n
}
\n
}
\n
next('success');
\n
"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
var scriptsProxy = targetNode.scriptsProxy;
\n
var scriptIndex = props.scriptIndex, scriptName = props.scriptName, enabled = props.enabled;
\n
var script = void 0;
\n
if (scriptIndex !== undefined) {
\n
script = scriptsProxy.all[scriptIndex];
\n
}
\n
else if (scriptName !== undefined) {
\n
script = scriptsProxy.get(scriptName);
\n
}
\n
if (script) {
\n
script.disabled = !enabled;
\n
}
\n
}
\n
next('success'
, args
);
\n
"
,
"group"
:
"view"
,
"type"
:
"builtin"
}
dist/processes/view/set-script-property.json
View file @
9da4b276
...
...
@@ -37,7 +37,7 @@
"success"
],
"id"
:
"set-script-property"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
var scriptsProxy = targetNode.scriptsProxy;
\n
var scriptIndex = props.scriptIndex, scriptName = props.scriptName, enabled = props.enabled;
\n
var script = void 0;
\n
if (scriptIndex !== undefined) {
\n
script = scriptsProxy.all[scriptIndex];
\n
}
\n
else if (scriptName !== undefined) {
\n
script = scriptsProxy.get(scriptName);
\n
}
\n
if (script) {
\n
var field = props.field, valueType = props.valueType, value = props.value;
\n
if (field && value) {
\n
var tValue = void 0;
\n
switch (valueType) {
\n
case 'number':
\n
tValue = parseFloat(value);
\n
break;
\n
case 'string':
\n
tValue = value;
\n
break;
\n
case 'boolean':
\n
tValue = value === 'true' ? true : (value === 'false' ? false : value);
\n
break;
\n
}
\n
if (tValue !== undefined) {
\n
script[field] = tValue;
\n
}
\n
}
\n
}
\n
}
\n
next('success');
\n
"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
var scriptsProxy = targetNode.scriptsProxy;
\n
var scriptIndex = props.scriptIndex, scriptName = props.scriptName, enabled = props.enabled;
\n
var script = void 0;
\n
if (scriptIndex !== undefined) {
\n
script = scriptsProxy.all[scriptIndex];
\n
}
\n
else if (scriptName !== undefined) {
\n
script = scriptsProxy.get(scriptName);
\n
}
\n
if (script) {
\n
var field = props.field, valueType = props.valueType, value = props.value;
\n
if (field && value) {
\n
var tValue = void 0;
\n
switch (valueType) {
\n
case 'number':
\n
tValue = parseFloat(value);
\n
break;
\n
case 'string':
\n
tValue = value;
\n
break;
\n
case 'boolean':
\n
tValue = value === 'true' ? true : (value === 'false' ? false : value);
\n
break;
\n
}
\n
if (tValue !== undefined) {
\n
script[field] = tValue;
\n
}
\n
}
\n
}
\n
}
\n
next('success'
, args
);
\n
"
,
"group"
:
"view"
,
"type"
:
"builtin"
}
libs/types.d.ts
View file @
9da4b276
...
...
@@ -11,6 +11,12 @@ declare module engine {
export
function
addCustomModule
(
id
,
container
:
Container
,
options
?):
Container
;
export
function
findVariable
(
name
,
...
contexts
);
export
function
joinPath
(...
segments
);
export
function
trimChar
(
str
,
char
);
export
const
devicePixelRatio
:
number
;
export
let
StageScaleMode
:
{
...
...
@@ -2793,7 +2799,7 @@ declare module engine {
getViewConfigByName
(
name
:
any
):
any
;
instantiateView
(
name
,
cache
=
true
):
any
;
instantiateView
(
name
,
cache
=
true
):
any
;
setBlackLayerVisible
(
visible
:
any
):
void
;
...
...
scripts/compiler-custom.js
View file @
9da4b276
...
...
@@ -29,9 +29,11 @@ const [_, __, sourcePath, outputPath = 'dist/customs'] = process.argv;
async
function
compileProcess
(
sourcePath
,
output
)
{
const
id
=
sourcePath
;
const
meta
=
fs
.
readJsonSync
(
path
.
join
(
'src/custom/'
+
sourcePath
,
'meta.json'
));
const
{
code
}
=
await
compile
(
'src/custom/'
+
sourcePath
+
'/index.ts'
);
const
result
=
await
compile
(
'src/custom/'
+
sourcePath
,
false
);
meta
.
id
=
id
;
meta
.
code
=
code
;
if
(
result
){
meta
.
code
=
result
.
code
;
}
const
outputPath
=
path
.
join
(
output
,
sourcePath
);
fs
.
ensureDirSync
(
path
.
dirname
(
outputPath
));
...
...
scripts/compiler-process.js
View file @
9da4b276
...
...
@@ -29,9 +29,11 @@ function compileProcess(sourcePath, output, isBuiltin) {
const
group
=
arr
[
0
];
const
id
=
arr
[
1
];
const
meta
=
fs
.
readJsonSync
(
path
.
join
(
'src/process/'
+
sourcePath
,
'meta.json'
));
const
{
code
}
=
compile
(
'src/process/'
+
sourcePath
);
const
result
=
compile
(
'src/process/'
+
sourcePath
,
false
);
meta
.
id
=
id
;
meta
.
script
=
code
;
if
(
result
){
meta
.
script
=
result
.
code
;
}
meta
.
group
=
group
;
if
(
isBuiltin
){
meta
.
type
=
'builtin'
...
...
scripts/compiler-script.js
View file @
9da4b276
...
...
@@ -26,9 +26,11 @@ console.log('complete!');
function
compileProcess
(
sourcePath
,
output
)
{
const
id
=
sourcePath
;
const
meta
=
fs
.
readJsonSync
(
path
.
join
(
'src/script/'
+
sourcePath
,
'meta.json'
));
const
{
code
}
=
compile
(
'src/script/'
+
sourcePath
);
const
result
=
compile
(
'src/script/'
+
sourcePath
,
false
);
meta
.
id
=
id
;
meta
.
code
=
code
;
if
(
result
){
meta
.
code
=
result
.
code
;
}
const
outputPath
=
path
.
join
(
output
,
sourcePath
);
fs
.
ensureDirSync
(
path
.
dirname
(
outputPath
));
...
...
scripts/tscompiler.js
View file @
9da4b276
...
...
@@ -14,7 +14,7 @@ exports.prepare = function (tsconfig, projectPath) {
_projectPath
=
projectPath
;
};
exports
.
compile
=
function
(
file
)
{
exports
.
compile
=
function
(
file
,
throwError
=
true
)
{
if
(
!
_options
)
{
throw
Error
(
'no options input'
)
}
...
...
@@ -25,8 +25,11 @@ exports.compile = function (file) {
filePath
=
path
.
resolve
(
_projectPath
,
file
+
'/index.ts'
);
if
(
!
fs
.
existsSync
(
filePath
))
{
if
(
throwError
){
throw
new
Error
(
'source code file not exists'
);
}
return
null
;
}
}
let
source
=
fs
.
readFileSync
(
filePath
,
'utf-8'
);
...
...
src/process/base/compare/index.ts
View file @
9da4b276
...
...
@@ -4,10 +4,7 @@
let
leftValue
=
typeof
props
.
left
===
'string'
?
'"'
+
props
.
left
+
'"'
:
props
.
left
;
let
rightValue
=
typeof
props
.
right
===
'string'
?
'"'
+
props
.
right
+
'"'
:
props
.
right
;
let
operator
=
(
args
?
args
.
operator
:
props
.
operator
)
||
'=='
;
if
(
operator
===
'=='
||
operator
===
'!='
){
operator
+=
'='
;
}
let
operator
=
props
.
operator
;
let
func
=
new
Function
(
'return '
+
leftValue
+
operator
+
rightValue
);
let
result
=
func
();
next
(
result
?
'true'
:
'false'
);
src/process/base/entry/index.ts
View file @
9da4b276
...
...
@@ -2,4 +2,4 @@
* Created by rockyl on 2019-11-16.
*/
next
(
'success'
);
next
(
'success'
,
args
);
src/process/base/log/index.ts
View file @
9da4b276
...
...
@@ -3,4 +3,5 @@
*/
console
.
log
(
props
?
props
.
content
:
(
args
?
args
.
content
:
''
));
next
(
'success'
);
\ No newline at end of file
next
(
'success'
,
args
);
\ No newline at end of file
src/process/custom/turntable-start/index.ts
View file @
9da4b276
...
...
@@ -9,7 +9,7 @@ engine.Tween.get(props.target)
.
set
({
rotation
:
0
})
.
to
({
rotation
:
360
},
props
.
duration
,
engine
.
Ease
.
quintIn
)
.
call
(
function
()
{
next
(
'success'
);
next
(
'success'
,
args
);
playLoop
();
});
...
...
src/process/custom/turntable-stop/index.ts
View file @
9da4b276
...
...
@@ -13,10 +13,10 @@ if (args && args.hasOwnProperty('index')) {
engine
.
Tween
.
get
(
props
.
target
||
target
)
.
to
({
rotation
},
props
.
duration
,
engine
.
Ease
.
quintOut
)
.
call
(
function
()
{
next
(
'success'
);
next
(
'success'
,
args
);
})
});
}
else
{
engine
.
Tween
.
removeTweens
(
props
.
target
||
target
);
next
(
'success'
);
next
(
'success'
,
args
);
}
src/process/duiba/duiba-api/index.ts
View file @
9da4b276
...
...
@@ -2,4 +2,4 @@
* Created by rockyl on 2019-11-16.
*/
next
(
'success'
);
next
(
'success'
,
args
);
src/process/duiba/duiba-api/meta.json
View file @
9da4b276
...
...
@@ -18,6 +18,10 @@
"name"
:
{
"type"
:
"string"
,
"alias"
:
"数据名"
},
"params"
:
{
"type"
:
"map"
,
"alias"
:
"参数"
}
},
"output"
:
[
...
...
src/process/duiba/goto-record/index.ts
View file @
9da4b276
...
...
@@ -3,4 +3,5 @@
*/
location
.
href
=
'/record'
;
next
(
'success'
);
next
(
'success'
,
args
);
src/process/net/http-polling/index.ts
deleted
100644 → 0
View file @
177a5a79
/**
* Created by rockyl on 2019-11-16.
*/
src/process/net/http-polling/meta.json
View file @
9da4b276
...
...
@@ -3,7 +3,6 @@
"props"
:
{
"url"
:
{
"type"
:
"string"
,
"enum"
:
[],
"alias"
:
"链接"
},
"method"
:
{
...
...
@@ -17,30 +16,29 @@
},
"count"
:
{
"type"
:
"number"
,
"enum"
:
[],
"alias"
:
"次数"
,
"default"
:
10
},
"delay"
:
{
"type"
:
"number"
,
"enum"
:
[],
"default"
:
500
,
"alias"
:
"单次延时"
},
"name"
:
{
"type"
:
"string"
,
"enum"
:
[],
"alias"
:
"数据名"
},
"field"
:
{
"type"
:
"string"
,
"enum"
:
[],
"alias"
:
"字段名"
},
"successValues"
:
{
"type"
:
"string"
,
"enum"
:
[],
"alias"
:
"成功值"
},
"params"
:
{
"type"
:
"map"
,
"alias"
:
"参数"
}
},
"output"
:
[
...
...
src/process/net/http-request/index.ts
View file @
9da4b276
...
...
@@ -2,15 +2,18 @@
* Created by rockyl on 2019-11-16.
*/
if
(
!
props
.
url
){
const
url
=
engine
.
findVariable
(
'url'
,
args
,
props
);
const
params
=
engine
.
findVariable
(
'params'
,
args
,
props
);
if
(
!
url
)
{
console
.
log
(
'url is empty'
);
next
(
'exception'
,
'
\'
url is empty
\'
'
);
}
else
{
}
else
{
engine
.
httpRequest
((
s
,
payload
)
=>
{
if
(
s
)
{
if
(
s
)
{
next
(
'success'
,
payload
);
}
else
{
}
else
{
next
(
'failed'
,
payload
);
}
},
props
.
url
,
props
.
method
,
{}
,
'json'
);
},
url
,
props
.
method
,
params
,
'json'
);
}
src/process/net/http-request/meta.json
View file @
9da4b276
...
...
@@ -3,7 +3,11 @@
"desc"
:
"Http请求"
,
"props"
:
{
"url"
:
{
"type"
:
"string"
,
"alias"
:
"地址"
},
"method"
:
{
"type"
:
"enum"
,
"enum"
:
[
"get"
,
"post"
],
"alias"
:
"方法"
,
"default"
:
"get"
}
"method"
:
{
"type"
:
"enum"
,
"enum"
:
[
"get"
,
"post"
],
"alias"
:
"方法"
,
"default"
:
"get"
},
"params"
:
{
"type"
:
"map"
,
"alias"
:
"参数"
}
},
"output"
:
[
"success"
,
"failed"
,
"exception"
]
}
\ No newline at end of file
src/process/projextX/api-request/meta.json
0 → 100644
View file @
9da4b276
{
"props"
:
{
"host"
:
{
"type"
:
"string"
,
"alias"
:
"接口根"
},
"uri"
:
{
"type"
:
"string"
,
"alias"
:
"URI"
},
"method"
:
{
"type"
:
"enum"
,
"enum"
:
[
"get"
,
"post"
],
"alias"
:
"方法"
},
"dataName"
:
{
"type"
:
"string"
,
"alias"
:
"数据名"
},
"params"
:
{
"type"
:
"map"
,
"alias"
:
"参数"
}
},
"name"
:
"api请求"
,
"output"
:
[
"success"
,
"failed"
,
"exception"
],
"sub"
:
{
"e6a9f1de-40c6-445b-b5e9-5c50a904a4de"
:
{
"uuid"
:
"e6a9f1de-40c6-445b-b5e9-5c50a904a4de"
,
"meta"
:
"entry"
,
"design"
:
{
"x"
:
10
,
"y"
:
10
,
"input"
:
{},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
31
}
]
}
},
"props"
:
{},
"output"
:
{
"success"
:
[
"567169ba-a2c1-4c10-9025-605a2e89ef0f"
]
}
},
"567169ba-a2c1-4c10-9025-605a2e89ef0f"
:
{
"uuid"
:
"567169ba-a2c1-4c10-9025-605a2e89ef0f"
,
"meta"
:
"a4b27753-4cbb-47e3-9b31-51ced475e41a"
,
"design"
:
{
"x"
:
151
,
"y"
:
115
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
47.5
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
47.5
}
]
}
},
"props"
:
{
"host"
:
{
"type"
:
"link"
},
"uri"
:
{
"type"
:
"link"
}
},
"output"
:
{
"success"
:
[
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db"
]
}
},
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db"
:
{
"uuid"
:
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db"
,
"meta"
:
"duiba-api"
,
"design"
:
{
"x"
:
350
,
"y"
:
188
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
56
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
49
}
],
"failed"
:
[
{
"x"
:
124.5
,
"y"
:
63
}
]
}
},
"props"
:
{
"method"
:
{
"type"
:
"link"
},
"name"
:
{
"type"
:
"link"
,
"alias"
:
"dataName"
}
},
"output"
:
{}
}
},
"subEntry"
:
"e6a9f1de-40c6-445b-b5e9-5c50a904a4de"
,
"metas"
:
[
{
"id"
:
"a4b27753-4cbb-47e3-9b31-51ced475e41a"
,
"script"
:
"var host = engine.findVariable('host', args, props);
\n
var uri = engine.findVariable('uri', args, props);
\n
next('success', {url: engine.joinPath(host, uri)});"
,
"props"
:
{
"host"
:
{
"type"
:
"string"
,
"alias"
:
"接口根"
},
"uri"
:
{
"type"
:
"string"
,
"alias"
:
"URI"
}
},
"isInline"
:
true
,
"name"
:
"url拼接"
,
"output"
:
[
"success"
]
}
]
}
\ No newline at end of file
src/process/view/push-dialog/index.ts
View file @
9da4b276
...
...
@@ -9,7 +9,7 @@ if (!props.viewName) {
let
gameStage
=
engine
.
gameStage
;
let
view
=
gameStage
.
instantiateView
(
props
.
viewName
);
if
(
view
)
{
gameStage
.
popupContainer
.
push
(
view
);
gameStage
.
popupContainer
.
push
(
view
,
{
center
:
props
.
center
}
);
}
next
(
'complete'
);
...
...
src/process/view/set-mouse-enabled/index.ts
View file @
9da4b276
...
...
@@ -7,4 +7,4 @@ if(targetNode){
targetNode
.
mouseEnabled
=
props
.
enabled
;
}
next
(
'success'
);
next
(
'success'
,
args
);
src/process/view/set-node-property/index.ts
View file @
9da4b276
...
...
@@ -24,4 +24,4 @@ if (targetNode) {
}
}
next
(
'success'
);
next
(
'success'
,
args
);
src/process/view/set-node-visibility/index.ts
View file @
9da4b276
...
...
@@ -7,4 +7,4 @@ if(targetNode){
targetNode
.
visible
=
props
.
visible
;
}
next
(
'success'
);
next
(
'success'
,
args
);
src/process/view/set-script-enabled/index.ts
View file @
9da4b276
...
...
@@ -17,4 +17,4 @@ if (targetNode) {
}
}
next
(
'success'
);
next
(
'success'
,
args
);
src/process/view/set-script-property/index.ts
View file @
9da4b276
...
...
@@ -34,4 +34,4 @@ if (targetNode) {
}
}
next
(
'success'
);
next
(
'success'
,
args
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment