UNPKG

tfp

Version:

A Web UI framework for TaskBuilder

2,342 lines (2,341 loc) 50.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _default = [{ "name": "logic", "comment": "基本语句", "color": "#00CCFF", "fontcolor": "#333333", "statements": [{ "name": "declare", "comment": "变量声明", "format": "var {varName};\r\n", "inputs": [{ "name": "varName", "comment": "名称", "type": "text", "width": "100px", "required": true }, { "name": "varType", "comment": "类型", "type": "select", "options": [{ "value": "null", "text": "空值" }, { "value": "string", "text": "字符串" }, { "value": "int", "text": "整数" }, { "value": "float", "text": "浮点数" }, { "value": "array", "text": "数组" }, { "value": "date", "text": "日期" }, { "value": "object", "text": "对象" }] }, { "name": "defaultVal", "comment": "默认值", "type": "text", "width": "150px", "dragin": true }] }, { "name": "assign", "comment": "变量赋值", "format": "{varName} {operator} {value};\r\n", "inputs": [{ "name": "varName", "comment": "名称", "type": "varList", "required": true }, { "name": "operator", "comment": "运算符", "type": "select", "options": [{ "value": "=", "text": "=" }, { "value": "+=", "text": "+=" }, { "value": "-=", "text": "-=" }], "default": "=" }, { "name": "value", "comment": "值", "type": "text", "required": true, "width": "150px", "dragin": true }] }, { "name": "reference", "comment": "变量引用", "format": "{varName}", "inputs": [{ "name": "varName", "comment": "", "type": "varList", "required": true }], "return": { "must": true, "type": "var" } }, { "name": "if", "comment": "判断", "format": "if({condition}) {\r\n{statements}\r\n}\r\n", "haveStatements": true, "inputs": [{ "name": "condition", "comment": "", "type": "text", "width": "400px", "required": true, "dragin": true }] }, { "name": "iteratearray", "comment": "遍历数组元素", "format": "for(var {indexVar}={startIndex};{indexVar}<{arrVar}.length;{indexVar}++){\r\n{statements}\r\n}\r\n", "haveStatements": true, "inputs": [{ "name": "arrVar", "comment": "数组变量名", "type": "text", "width": "100px", "dragin": true }, { "name": "indexVar", "comment": "索引变量名", "type": "text", "width": "40px", "default": "i" }, { "name": "startIndex", "comment": "起始索引", "type": "text", "width": "40px", "default": "0" }] }, { "name": "iterateobject", "comment": "遍历对象属性", "haveStatements": true, "format": "for(var {propVar} in {objVar}) {\r\n{statements}\r\n}\r\n", "inputs": [{ "name": "objVar", "comment": "对象变量名", "type": "text", "width": "150px", "dragin": true }, { "name": "propVar", "comment": "属性变量名", "type": "text", "width": "80px", "default": "prop" }] }, { "name": "continue", "comment": "继续循环", "format": "continue" }, { "name": "break", "comment": "跳出循环", "format": "break" }, { "name": "return", "comment": "返回", "format": "return {retVal}", "inputs": [{ "name": "retVal", "comment": "返回值", "type": "text", "dragin": true }] }, { "name": "callFunc", "comment": "当前页面函数调用", "format": "{funcname}();\r\n", "inputs": [{ "name": "funcName", "comment": "函数名称", "type": "funcList", "width": "200px", "required": true }, { "name": "setting", "comment": "参数设置", "type": "dialog", "url": "taskbuilder-tfp-designer/CptFuncSetting.html", "width": "640px", "height": "540px", "saveRetToAttr": "args" }], "return": { "must": false, "type": "var" } }, { "name": "tfp.showMsg", "comment": "显示提示信息", "format": "tfp.showMsg({message})", "inputs": [{ "name": "message", "comment": "提示信息", "type": "text", "required": true, "width": "200px", "dragin": true }] }, { "name": "log", "comment": "输出控制台信息", "format": "console.log({message})", "inputs": [{ "name": "message", "comment": "信息内容", "type": "text", "required": true, "width": "300px", "dragin": true }] }, { "name": "comment", "comment": "添加注释", "format": "//{message}", "inputs": [{ "name": "message", "comment": "注释内容", "type": "text", "required": true, "width": "300px" }] }, { "name": "custom", "comment": "自定义语句", "format": "{content}", "inputs": [{ "name": "content", "comment": "语句内容", "type": "text", "required": true, "width": "385px" }], "return": { "must": false, "type": "var" } }] }, { "name": "basic", "comment": "通用", "color": "#FFCC33", "fontcolor": "#333333", "statements": [{ "name": "tfp.gotoPage", "comment": "跳转到指定页面", "format": "tfp.gotoPage({url});\r\n", "inputs": [{ "name": "url", "comment": "页面地址", "type": "text", "required": true, "width": "300px", "dragin": true }] }, { "name": "location.reload", "comment": "刷新当前页面", "format": "location.reload();\r\n" }, { "name": "history.back", "comment": "返回上一页", "format": "history.back();\r\n" }, { "name": "tfp.getUrlArg", "comment": "获得URL参数", "format": "tfp.getUrlArg({argName})", "icon": "", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "argName", "comment": "", "type": "text", "required": true, "width": "100px", "dragin": true }] }, { "name": "tfp.openPage", "comment": "打开新页面", "format": "tfp.openPage({title}, {url});\r\n", "inputs": [{ "name": "title", "comment": "标题", "type": "text", "required": true, "width": "100px", "dragin": true }, { "name": "url", "comment": "页面地址", "type": "text", "required": true, "width": "200px", "dragin": true }] }, { "name": "tfp.showPage", "comment": "显示指定页面", "format": "tfp.showPage({id});\r\n", "icon": "", "inputs": [{ "name": "id", "comment": "页面ID", "type": "text", "required": true, "width": "100px", "dragin": true }] }, { "name": "tfp.hidePage", "comment": "隐藏指定页面", "format": "tfp.hidePage({id});\r\n", "icon": "", "inputs": [{ "name": "id", "comment": "页面ID", "type": "text", "required": true, "width": "100px", "dragin": true }] }, { "name": "tfp.closePage", "comment": "关闭指定页面", "format": "tfp.closePage({id});\r\n", "icon": "", "inputs": [{ "name": "id", "comment": "页面ID", "type": "text", "required": true, "width": "100px", "dragin": true }] }, { "name": "tfp.getCurPage", "comment": "获得当前页面", "format": "tfp.getCurPage()", "return": { "must": true, "type": "object" } }, { "name": "tfp.closeCurPage", "comment": "关闭当前页面", "format": "tfp.closeCurPage();\r\n" }, { "name": "tfp.openDialog", "comment": "打开对话框", "format": "tfp.openDialog({title}, {url}, {width}, {height});\r\n", "inputs": [{ "name": "title", "comment": "标题", "type": "text", "required": true, "width": "100px", "dragin": true }, { "name": "url", "comment": "页面URL路径", "type": "text", "required": true, "width": "100px", "dragin": true }, { "name": "width", "comment": "宽度", "type": "px", "required": true, "width": "50px" }, { "name": "height", "comment": "高度", "type": "px", "required": true, "width": "50px" }] }, { "name": "tfp.closeCurDialog", "comment": "关闭当前对话框", "format": "tfp.closeCurDialog();\r\n", "icon": "", "inputs": [{ "name": "ret", "comment": "返回值", "type": "text", "required": true, "width": "100px", "dragin": true }] }, { "name": "tfp.getCurDialog", "comment": "获得当前对话框", "format": "tfp.getCurDialog()", "return": { "must": true, "type": "object" } }, { "name": "tfp.getCurDialogId", "comment": "获得当前对话框的ID", "format": "tfp.getCurDialogId()", "return": { "must": true, "type": "string" } }, { "name": "tfp.openReport", "comment": "打开报表页面", "format": "tfp.openReport({url})", "icon": "", "inputs": [{ "name": "url", "comment": "报表文件路径", "type": "text", "required": true, "width": "300px", "dragin": true }] }, { "name": "tfp.openPDF", "comment": "打开PDF文件", "format": "tfp.openPDF({url})", "icon": "", "inputs": [{ "name": "url", "comment": "PDF文件路径", "type": "text", "required": true, "width": "300px", "dragin": true }] }] }, { "name": "component", "comment": "组件", "color": "#66CC33", "fontcolor": "#333333", "statements": [{ "name": "getCptId", "comment": "获得组件编号", "icon": "", "format": "{cptId}.id", "return": { "must": true, "type": "object" }, "inputs": [{ "name": "cptId", "comment": "", "type": "component", "required": true }] }, { "name": "getCptType", "comment": "获得组件类型名称", "icon": "", "format": "{cptId}.dataModel.type", "return": { "must": true, "type": "object" }, "inputs": [{ "name": "cptId", "comment": "", "type": "component", "required": true }] }, { "name": "getCptDataModel", "comment": "获得组件数据模型", "icon": "", "format": "{cptId}.dataModel", "return": { "must": true, "type": "object" }, "inputs": [{ "name": "cptId", "comment": "", "type": "component", "required": true }] }, { "name": "setValue", "comment": "设置组件值", "icon": "", "format": "{cptId}.value = {val}", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "val", "comment": "组件值", "type": "string", "required": true, "dragin": true }] }, { "name": "getValue", "comment": "获得组件值", "icon": "", "format": "{cptId}.value", "return": { "must": true, "type": "var" }, "inputs": [{ "name": "cptId", "comment": "", "type": "component", "required": true }] }, { "name": "getAttr", "comment": "获得组件属性", "icon": "", "format": "{cptId}.attr('{attrName}')", "return": { "must": true, "type": "var" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "attrName", "comment": "属性名称", "type": "select", "required": true }] }, { "name": "setAttr", "comment": "设置组件属性", "icon": "", "format": "{cptId}.attr('{attrName}', '{attrVal}')", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "attrName", "comment": "属性名称", "type": "select", "required": true }, { "name": "attrVal", "comment": "属性值", "type": "string", "required": true, "dragin": true }] }, { "name": "setAttrGui", "comment": "设置组件属性(图形化)", "icon": "", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "setting", "type": "dialog", "url": "taskbuilder-tfp-designer/CptAttrSetting.html", "width": "720px", "height": "540px", "saveRetToAttr": "attrs" }] }, { "name": "getCss", "comment": "获得组件样式", "icon": "", "format": "{cptId}.css('{styleName}')", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "styleName", "comment": "样式名称", "type": "select", "required": true }] }, { "name": "setCss", "comment": "设置组件样式", "icon": "", "format": "{cptId}.css('{styleName}', '{styleVal}')", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "styleName", "comment": "样式名称", "type": "select", "required": true }, { "name": "styleVal", "comment": "样式值", "type": "string", "required": true, "dragin": true }] }, { "name": "setCssGui", "comment": "设置组件样式(图形化)", "icon": "", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "setting", "type": "dialog", "url": "taskbuilder-tfp-designer/CptStyleSetting.html", "width": "720px", "height": "540px", "saveRetToAttr": "styles" }] }, { "name": "addCssClass", "comment": "为组件添加样式类", "icon": "", "format": "{cptId}._jqObj.addClass('{className}')", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "className", "comment": "样式类名称", "type": "string", "required": true, "dragin": true }] }, { "name": "removeCssClass", "comment": "移除组件的样式类", "icon": "", "format": "{cptId}._jqObj.removeClass('{className}')", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "className", "comment": "样式类名称", "type": "string", "required": true, "dragin": true }] }, { "name": "hasCssClass", "comment": "组件是否包含样式类", "icon": "", "format": "{cptId}._jqObj.hasClass('{className}')", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "className", "comment": "样式类名称", "type": "string", "required": true, "dragin": true }] }, { "name": "callCptFunc", "comment": "调用组件方法", "icon": "", "return": { "must": false, "type": "var" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }, { "name": "funcName", "comment": "方法名称", "type": "cptFuncList", "required": true }, { "name": "setting", "comment": "参数设置", "type": "dialog", "url": "taskbuilder-tfp-designer/CptFuncSetting.html", "width": "640px", "height": "540px", "saveRetToAttr": "args" }] }, { "name": "show", "comment": "显示组件", "format": "{cptId}.show()", "icon": "", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "hide", "comment": "隐藏组件", "format": "{cptId}.hide()", "icon": "", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "focus", "comment": "让组件获得焦点", "format": "{cptId}.focus()", "icon": "", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "width", "comment": "获得组件宽度", "icon": "", "format": "{cptId}._jqObj.width()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "height", "comment": "获得组件高度", "icon": "", "format": "{cptId}._jqObj.height()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "innerWidth", "comment": "获得组件内部宽度", "icon": "", "format": "{cptId}._jqObj.innerWidth()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "innerHeight", "comment": "获得组件内部高度", "icon": "", "format": "{cptId}._jqObj.innerHeight()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "outerWidth", "comment": "获得组件外部宽度", "icon": "", "format": "{cptId}._jqObj.outerWidth()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "outerHeight", "comment": "获得组件外部高度", "icon": "", "format": "{cptId}._jqObj.outerHeight()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "offset", "comment": "获得组件相对页面的坐标", "icon": "", "format": "{cptId}._jqObj.offset()", "return": { "must": true, "type": "object" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "position", "comment": "获得组件相对父组件位置", "icon": "", "format": "{cptId}._jqObj.position()", "return": { "must": true, "type": "object" }, "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }, { "name": "remove", "comment": "移除组件", "format": "{cptId}.remove()", "icon": "", "inputs": [{ "name": "cptId", "comment": "组件", "type": "component", "required": true }] }] }, { "name": "string", "comment": "字符串", "color": "#CC0000", "statements": [{ "name": "length", "comment": "获得字符串长度", "format": "'{str}'.length", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "gblen", "comment": "获得字符串字节长度", "format": "'{str}'.gblen()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "charAt", "comment": "返回指定位置的字符", "format": "'{str}'.charAt( {index} )", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "index", "comment": "字符位置索引", "type": "string", "required": true }] }, { "name": "indexOf", "comment": "查找子字符串首次出现位置", "format": "'{str1}'.indexOf( '{str2}' , {fromindex} )", "return": { "must": true, "type": "int" }, "fontsize": "12px", "inputs": [{ "name": "str1", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "str2", "comment": "子字符串", "type": "string", "required": true, "dragin": true }, { "name": "fromindex", "comment": "查找起始位置索引", "type": "string" }] }, { "name": "lastIndexOf", "comment": "查找子字符串最后出现位置", "format": "'{str1}'.lastIndexOf( '{str2}' , {fromindex} )", "return": { "must": true, "type": "int" }, "fontsize": "12px", "inputs": [{ "name": "str1", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "str2", "comment": "子字符串", "type": "string", "required": true, "dragin": true }, { "name": "fromindex", "comment": "起始位置", "type": "string" }] }, { "name": "substring", "comment": "截取起止位置的字符串", "format": "'{str1}'.substring( {from} , {to} )", "return": { "must": true, "type": "string" }, "fontsize": "12px", "inputs": [{ "name": "str1", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "from", "comment": "起始位置", "type": "string", "required": true }, { "name": "to", "comment": "截止位置", "type": "string" }] }, { "name": "substr", "comment": "截取指定长度的字符串", "format": "'{str1}'.substr( {start} , {length} )", "return": { "must": true, "type": "string" }, "fontsize": "12px", "inputs": [{ "name": "str1", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "start", "comment": "起始位置", "type": "string", "required": true }, { "name": "length", "comment": "长度", "type": "string" }] }, { "name": "replace", "comment": "替换第一个匹配项", "format": "'{str1}'.replace( '{str2}' )", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str1", "comment": "被替换的字符串", "type": "string", "required": true, "dragin": true }, { "name": "str2", "comment": "要替换的字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "replaceAll", "comment": "全部替换", "format": "tfp.replaceAll( '{str1}' , '{str2}' )", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str1", "comment": "被替换的字符串", "type": "string", "required": true, "dragin": true }, { "name": "str2", "comment": "要替换的字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "trim", "comment": "去掉字符串两端空格", "format": "'{str}'.trim()", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "split", "comment": "分割成字符串数组", "format": "'{str}'.split( '{separator}' )", "return": { "must": true, "type": "array" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "separator", "comment": "分割字符", "type": "string", "required": true, "dragin": true }] }, { "name": "toLowerCase", "comment": "转换为小写", "format": "'{str}'.toLowerCase()", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "toUpperCase", "comment": "转换为大写", "format": "'{str}'.toUpperCase()", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "startsWith", "comment": "是否以指定字符串开头", "format": "'{str1}'.startsWith( '{str2}' )", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "str1", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "str2", "comment": "子字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "endsWith", "comment": "是否以指定字符串结尾", "format": "'{str1}'.endsWith( '{str2}' )", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "str1", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "str2", "comment": "子字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "JSONParse", "comment": "将字符串解析为JSON对象", "format": "JSON.parse('{str}')", "return": { "must": true, "type": "object" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "JSONStringify", "comment": "将JSON对象转换为字符串", "format": "JSON.stringify({obj})", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "obj", "comment": "JSON对象", "type": "string", "required": true, "dragin": true }] }] }, { "name": "number", "comment": "数值", "color": "#CC33FF", "statements": [{ "name": "parseInt", "comment": "转换为整数", "format": "parseInt( {num} )", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "num", "comment": "数值", "type": "string", "required": true, "dragin": true }] }, { "name": "parseFloat", "comment": "转换为小数", "format": "parseFloat( {num} )", "return": { "must": true, "type": "float" }, "inputs": [{ "name": "num", "comment": "数值", "type": "string", "required": true, "dragin": true }] }, { "name": "tfp.formatMoney", "comment": "格式化金额", "format": "tfp.formatMoney( {money} )", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "money", "comment": "金额值", "type": "string", "required": true, "dragin": true }] }, { "name": "tfp.prefixInteger", "comment": "数字前面补零", "format": "tfp.prefixInteger( {num} , {len} )", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "num", "comment": "数字", "type": "int", "required": true, "dragin": true }, { "name": "len", "comment": "长度", "type": "int", "required": true }] }, { "name": "toFixed", "comment": "四舍五入为指定小数位数", "format": "{num}.toFixed( {len} )", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "num", "comment": "数值", "type": "number", "required": true, "dragin": true }, { "name": "len", "comment": "小数点位数", "type": "int", "required": true }] }, { "name": "abs", "comment": "返回绝对值", "format": "Math.abs( {num} )", "return": { "must": true, "type": "number" }, "inputs": [{ "name": "num", "comment": "数值", "type": "number", "required": true, "dragin": true }] }, { "name": "ceil", "comment": "向上舍入为最接近的整数", "format": "Math.ceil( {num} )", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "num", "comment": "数值", "type": "number", "required": true, "dragin": true }] }, { "name": "floor", "comment": "向下舍入为最接近的整数", "format": "Math.floor( {num} )", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "num", "comment": "数值", "type": "number", "required": true, "dragin": true }] }, { "name": "round", "comment": "舍入为最接近的整数", "format": "Math.round( {num} )", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "num", "comment": "数值", "type": "number", "required": true, "dragin": true }] }, { "name": "trunc", "comment": "返回数字的整数部分", "format": "Math.trunc( {num} )", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "num", "comment": "数值", "type": "number", "required": true, "dragin": true }] }, { "name": "sign", "comment": "返回数的符号", "format": "Math.sign( {num} )", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "num", "comment": "数值", "type": "number", "required": true, "dragin": true }] }, { "name": "pow", "comment": "返回x的y次幂", "format": "Math.pow( {x}, {y} )", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "x", "comment": "数值", "type": "number", "required": true, "dragin": true }, { "name": "y", "comment": "数值", "type": "number", "required": true, "dragin": true }] }, { "name": "sqrt", "comment": "返回x的平方根", "format": "Math.pow( {x} )", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "x", "comment": "数值", "type": "number", "required": true, "dragin": true }] }, { "name": "random", "comment": "返回0到1之间的随机数", "format": "Math.random()", "return": { "must": true, "type": "float" } }] }, { "name": "date", "comment": "日期", "color": "#996600", "statements": [{ "name": "now", "comment": "获得当前时间", "format": "new Date()", "return": { "must": true, "type": "date" } }, { "name": "strToDate", "comment": "转换为日期", "format": "new Date('{str}')", "return": { "must": true, "type": "date" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }] }, { "name": "tfp.formatDate", "comment": "格式化日期", "format": "tfp.formatDate({date}, '{format}')", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "date", "comment": "日期对象", "type": "Date", "required": true, "dragin": true }, { "name": "format", "comment": "日期格式", "type": "select", "options": [{ "value": "yyyy-MM-dd HH:mm:ss", "text": "yyyy-MM-dd HH:mm:ss" }, { "value": "yyyy-MM-dd HH:mm", "text": "yyyy-MM-dd HH:mm" }, { "value": "yyyy-MM-dd", "text": "yyyy-MM-dd" }, { "value": "yyyy/MM/dd HH:mm:ss", "text": "yyyy/MM/dd HH:mm:ss" }, { "value": "yyyy/MM/dd HH:mm", "text": "yyyy/MM/dd HH:mm" }, { "value": "yyyy/MM/dd", "text": "yyyy/MM/dd" }, { "value": "yyyy年MM月dd日HH时mm分ss秒", "text": "yyyy年MM月dd日HH时mm分ss秒" }, { "value": "yyyy年MM月dd日HH时mm分", "text": "yyyy年MM月dd日HH时mm分" }, { "value": "yyyy年MM月dd日", "text": "yyyy年MM月dd日" }, { "value": "HH:mm:ss", "text": "HH:mm:ss" }, { "value": "HH:mm", "text": "HH:mm" }, { "value": "HH时mm分ss秒", "text": "HH时mm分ss秒" }, { "value": "HH时mm分", "text": "HH时mm分" }], "required": true }] }, { "name": "getFullYear", "comment": "返回年份", "format": "{date}.getFullYear()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "date", "comment": "日期对象", "type": "Date", "required": true, "dragin": true }] }, { "name": "getMonth", "comment": "返回月份", "format": "{date}.getMonth()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "date", "comment": "日期对象", "type": "Date", "required": true, "dragin": true }] }, { "name": "getDay", "comment": "返回星期几", "format": "{date}.getDay()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "date", "comment": "日期对象", "type": "Date", "required": true, "dragin": true }] }, { "name": "getDate", "comment": "返回月中的第几天", "format": "{date}.getDate()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "date", "comment": "日期对象", "type": "Date", "required": true, "dragin": true }] }, { "name": "getHours", "comment": "返回小时", "format": "{date}.getHours()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "date", "comment": "日期对象", "type": "Date", "required": true, "dragin": true }] }, { "name": "getMinutes", "comment": "返回分钟", "format": "{date}.getMinutes()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "date", "comment": "日期对象", "type": "Date", "required": true, "dragin": true }] }, { "name": "getSeconds", "comment": "返回秒数", "format": "{date}.getSeconds()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "date", "comment": "日期对象", "type": "Date", "required": true, "dragin": true }] }, { "name": "getMilliseconds", "comment": "返回毫秒", "format": "{date}.getMilliseconds()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "date", "comment": "日期对象", "type": "Date", "required": true, "dragin": true }] }, { "name": "getTime", "comment": "返回毫秒总数", "format": "{date}.getTime()", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "date", "comment": "日期对象", "type": "Date", "required": true, "dragin": true }] }] }, { "name": "array", "comment": "数组", "color": "#336600", "statements": [{ "name": "join", "comment": "将数组元素连接成字符串", "format": "{arr}.join('{separator}')", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }, { "name": "separator", "comment": "分割字符", "type": "string", "required": true, "default": ",", "dragin": true }] }, { "name": "pop", "comment": "删除最后一个元素", "format": "{arr}.pop()", "return": { "must": false, "type": "var" }, "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }] }, { "name": "push", "comment": "在数组结尾处添加元素", "format": "{arr}.push({item})", "return": { "must": false, "type": "int" }, "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }, { "name": "item", "comment": "元素", "type": "string", "required": true, "dragin": true }] }, { "name": "shift", "comment": "删除第一个元素", "format": "{arr}.shift()", "return": { "must": false, "type": "var" }, "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }] }, { "name": "unshift", "comment": "在数组开头处添加元素", "format": "{arr}.unshift( {item} )", "return": { "must": false, "type": "int" }, "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }, { "name": "item", "comment": "元素", "type": "string", "required": true, "dragin": true }] }, { "name": "setItem", "comment": "更改指定索引处元素值", "format": "{arr}.[{index}] = {var};\r\n", "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }, { "name": "index", "comment": "元素索引", "type": "string", "required": true }, { "name": "val", "comment": "元素值", "type": "string", "required": true, "dragin": true }] }, { "name": "getItem", "comment": "获得指定索引处元素值", "format": "{arr}.[{index}]", "return": { "must": true, "type": "var" }, "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }, { "name": "index", "comment": "元素索引", "type": "string", "required": true }] }, { "name": "removeItem", "comment": "删除指定元素", "format": "{arr}.remove({item})", "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }, { "name": "item", "comment": "元素", "type": "string", "required": true, "dragin": true }] }, { "name": "splice", "comment": "删除指定索引位置元素", "format": "{arr}.splice({index}, {len})", "return": { "must": false, "type": "array" }, "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }, { "name": "index", "comment": "元素索引", "type": "string", "required": true }, { "name": "len", "comment": "删除数量", "type": "string", "required": true }] }, { "name": "slice", "comment": "裁剪数组", "format": "{arr}.slice({index}, {len})", "return": { "must": true, "type": "array" }, "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }, { "name": "start", "comment": "开始索引", "type": "string", "required": true }, { "name": "end", "comment": "结束索引", "type": "string", "required": true }] }, { "name": "concat", "comment": "合并数组", "format": "{arr1}.concat({arr2})", "return": { "must": true, "type": "array" }, "inputs": [{ "name": "arr1", "comment": "数组1名称", "type": "string", "required": true, "dragin": true }, { "name": "arr2", "comment": "数组2名称", "type": "string", "required": true, "dragin": true }] }, { "name": "length", "comment": "获得数组长度", "format": "{arr}.length", "return": { "must": true, "type": "int" }, "inputs": [{ "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }] } /*, { "name": "max", "comment": "返回元素中最大的数值", "format": "{arr}.max()", "return": { "must": true, "type": "number" }, "inputs": [ { "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true } ] }, { "name": "min", "comment": "返回元素中最小的数值", "format": "{arr}.min()", "return": { "must": true, "type": "number" }, "inputs": [ { "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true } ] }, { "name": "avg", "comment": "返回所有元素的平均值", "format": "{arr}.avg()", "return": { "must": true, "type": "number" }, "inputs": [ { "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true } ] }, { "name": "orderAsc", "comment": "由小到大排序", "format": "{arr}.asc()", "return": { "must": true, "type": "array" }, "inputs": [ { "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true } ] }, { "name": "orderDesc", "comment": "由大到小排序", "format": "{arr}.desc()", "return": { "must": true, "type": "array" }, "inputs": [ { "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true } ] }, { "name": "sort", "comment": "按元素指定属性排序", "format": "{arr}.sort('{prop}', '{condition}')", "return": { "must": true, "type": "array" }, "inputs": [ { "name": "arr", "comment": "数组名称", "type": "string", "required": true, "dragin": true }, { "name": "prop", "comment": "属性名", "type": "string", "required": true, "dragin": true }, { "name": "condition", "comment": "排序规则", "type": "select", "options": [ { "value": "asc", "text": "正序" }, { "value": "desc", "text": "倒序" } ], "required": true } ] }*/ ] }, { "name": "check", "comment": "校验", "color": "#003399", "statements": [{ "name": "isNull", "comment": "是否为空", "format": "isNull({varName})", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "varName", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "isUndefined", "comment": "是否为undefined", "format": "typeof({varName})=='undefined'", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "varName", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "isNum", "comment": "是否是数值", "format": "!isNaN({num})", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "num", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "isInt", "comment": "是否是整数", "format": "tfp.isInt({num})", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "num", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "isString", "comment": "是否是字符串", "format": "typeof({str})=='string'", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "str", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "isArray", "comment": "是否是数组", "format": "Array.isArray({varName})", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "varName", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "isObj", "comment": "是否是JSON对象", "format": "tfp.isObj({varName})", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "varName", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "isMobile", "comment": "是否是有效的手机号", "format": "tfp.isMobile('{str}')", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "str", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "isTel", "comment": "是否是有效的座机号", "format": "tfp.isTel('{str}')", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "str", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "isIDCard", "comment": "是否是有效的身份证号", "format": "tfp.isIDCard('{str}')", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "str", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "isMail", "comment": "是否是有效的邮箱地址", "format": "tfp.isMail('{str}')", "return": { "must": true, "type": "bool" }, "inputs": [{ "name": "str", "comment": "", "type": "string", "required": true, "dragin": true }] }] }, { "name": "more", "comment": "其他", "color": "#663366", "statements": [{ "name": "md5", "comment": "MD5加密", "format": "tfp.md5('{str}')", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str", "comment": "", "type": "string", "required": true, "dragin": true }] }, { "name": "encDES", "comment": "DES加密", "format": "tfp.encDES('{str}', '{key}')", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "key", "comment": "密钥", "type": "string", "required": true, "dragin": true }] }, { "name": "decDES", "comment": "DES解密", "format": "tfp.decDES('{str}', '{key}')", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "key", "comment": "密钥", "type": "string", "required": true, "dragin": true }] }, { "name": "encAES", "comment": "AES加密", "format": "tfp.encAES('{str}', '{key}', '{iv}')", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "key", "comment": "密钥", "type": "string", "required": true, "dragin": true }, { "name": "iv", "comment": "向量", "type": "string", "required": true, "dragin": true }] }, { "name": "decAES", "comment": "AES解密", "format": "tfp.decAES('{str}', '{key}', '{iv}')", "return": { "must": true, "type": "string" }, "inputs": [{ "name": "str", "comment": "字符串", "type": "string", "required": true, "dragin": true }, { "name": "key", "comment": "密钥", "type": "string", "required": true, "dragin": true }, { "name": "iv", "comment": "向量", "type": "string", "required": true, "dragin": true }] }] }]; exports["default"] = _default;