tfp
Version:
A Web UI framework for TaskBuilder
39 lines • 102 kB
HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>选择部门</title>
<script type="text/javascript" src="/node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript">
function onOK() {
var deps;
var valueType = tfp.getUrlArg("valueType");
if(valueType=="obj") {
deps = tree1.getCheckedNodes(true);
if(deps.length==0) {
alert("请选择部门!");
return;
}
deps = {
id: deps[0].data.id,
code: deps[0].data.code,
name: deps[0].data.name
};
} else {
deps = tree1.getCheckedNodesValue();
if(deps=="") {
alert("请选择部门!");
return;
}
}
console.log(deps);
var dialog = tfp.getCurDialog();
if(tfp.getUrlArg("callback")) {
eval("dialog.opener."+tfp.getUrlArg("callback")+"(deps)");
} else if(tfp.getUrlArg("cptId")) {
dialog.opener[tfp.getUrlArg("cptId")].onSelected(deps);
}
tfp.closeCurDialog();
}
</script>
<script type="text/javascript">
!function i(o,r,a){function s(t,e){if(!r[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(l)return l(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=r[t]={exports:{}},o[t][0].call(n.exports,function(e){return s(o[t][1][e]||e)},n,n.exports,i,o,r,a)}return r[t].exports}for(var l="function"==typeof require&&require,e=0;e<a.length;e++)s(a[e]);return s}({1:[function(e,t,n){t.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},t.exports.__esModule=!0,t.exports.default=t.exports},{}],2:[function(e,t,n){function l(e,t,n,i,o,r,a){try{var s=e[r](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,o)}t.exports=function(s){return function(){var e=this,a=arguments;return new Promise(function(t,n){var i=s.apply(e,a);function o(e){l(i,t,n,o,r,"next",e)}function r(e){l(i,t,n,o,r,"throw",e)}o(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports},{}],3:[function(e,t,n){t.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},{}],4:[function(e,t,n){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}t.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},t.exports.__esModule=!0,t.exports.default=t.exports},{}],5:[function(e,t,n){var o=e("./superPropBase.js");function i(){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(e,t,n){var i=o(e,t);if(i){i=Object.getOwnPropertyDescriptor(i,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},t.exports.__esModule=!0,t.exports.default=t.exports,i.apply(this,arguments)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},{"./superPropBase.js":11}],6:[function(e,t,n){function i(e){return t.exports=i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},{}],7:[function(e,t,n){var i=e("./setPrototypeOf.js");t.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports},{"./setPrototypeOf.js":10}],8:[function(e,t,n){t.exports=function(e){return e&&e.__esModule?e:{default:e}},t.exports.__esModule=!0,t.exports.default=t.exports},{}],9:[function(e,t,n){var i=e("./typeof.js").default,o=e("./assertThisInitialized.js");t.exports=function(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},t.exports.__esModule=!0,t.exports.default=t.exports},{"./assertThisInitialized.js":1,"./typeof.js":12}],10:[function(e,n,t){function i(e,t){return n.exports=i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n.exports.__esModule=!0,n.exports.default=n.exports,i(e,t)}n.exports=i,n.exports.__esModule=!0,n.exports.default=n.exports},{}],11:[function(e,t,n){var i=e("./getPrototypeOf.js");t.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=i(e)););return e},t.exports.__esModule=!0,t.exports.default=t.exports},{"./getPrototypeOf.js":6}],12:[function(e,t,n){function i(e){return t.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,i(e)}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},{}],13:[function(e,t,n){t.exports=e("regenerator-runtime")},{"regenerator-runtime":14}],14:[function(e,t,n){t=function(a){"use strict";var l,e=Object.prototype,d=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},i=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function r(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{r({},"")}catch(e){r=function(e,t,n){return e[t]=n}}function s(e,t,n,i){var o,r,a,s,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype),i=new w(i||[]);return t._invoke=(o=e,r=n,a=i,s=h,function(e,t){if(s===f)throw new Error("Generator is already running");if(s===p){if("throw"===e)throw t;return N()}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){var i=function e(t,n){var i=t.iterator[n.method];if(i===l){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=l,e(t,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=u(i,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;i=i.arg;if(!i)return n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g;{if(!i.done)return i;n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=l)}n.delegate=null;return g}(n,a);if(i){if(i===g)continue;return i}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===h)throw s=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=f;i=u(o,r,a);if("normal"===i.type){if(s=a.done?p:c,i.arg!==g)return{value:i.arg,done:a.done}}else"throw"===i.type&&(s=p,a.method="throw",a.arg=i.arg)}}),t}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=s;var h="suspendedStart",c="suspendedYield",f="executing",p="completed",g={};function m(){}function v(){}function b(){}var y={};r(y,i,function(){return this});t=Object.getPrototypeOf,t=t&&t(t(x([])));t&&t!==e&&d.call(t,i)&&(y=t);var _=b.prototype=m.prototype=Object.create(y);function M(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}function C(a,s){var t;this._invoke=function(n,i){function e(){return new s(function(e,t){!function t(e,n,i,o){e=u(a[e],a,n);if("throw"!==e.type){var r=e.arg;return(n=r.value)&&"object"==typeof n&&d.call(n,"__await")?s.resolve(n.__await).then(function(e){t("next",e,i,o)},function(e){t("throw",e,i,o)}):s.resolve(n).then(function(e){r.value=e,i(r)},function(e){return t("throw",e,i,o)})}o(e.arg)}(n,i,e,t)})}return t=t?t.then(e,e):e()}}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function x(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,e=function e(){for(;++n<t.length;)if(d.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=l,e.done=!0,e};return e.next=e}}return{next:N}}function N(){return{value:l,done:!0}}return r(_,"constructor",v.prototype=b),r(b,"constructor",v),v.displayName=r(b,o,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,r(e,o,"GeneratorFunction")),e.prototype=Object.create(_),e},a.awrap=function(e){return{__await:e}},M(C.prototype),r(C.prototype,n,function(){return this}),a.AsyncIterator=C,a.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var r=new C(s(e,t,n,i),o);return a.isGeneratorFunction(t)?r:r.next().then(function(e){return e.done?e.value:r.next()})},M(_),r(_,o,"Generator"),r(_,i,function(){return this}),r(_,"toString",function(){return"[object Generator]"}),a.keys=function(n){var e,i=[];for(e in n)i.push(e);return i.reverse(),function e(){for(;i.length;){var t=i.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=x,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=l,this.done=!1,this.delegate=null,this.method="next",this.arg=l,this.tryEntries.forEach(j),!e)for(var t in this)"t"===t.charAt(0)&&d.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=l)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var i=this;function e(e,t){return r.type="throw",r.arg=n,i.next=e,t&&(i.method="next",i.arg=l),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],r=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=d.call(o,"catchLoc"),s=d.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&d.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}var r=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return r.type=e,r.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i,o=n.completion;return"throw"===o.type&&(i=o.arg,j(n)),i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=l),g}},a}("object"==typeof t?t.exports:{});try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},{}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=[{id:"Container",name:"容器组件",components:[{name:"Panel",comment:"面板",matchAllClient:!0},{name:"FlexBox",comment:"弹性栅格",matchAllClient:!0,dependencies:["Panel"]},{name:"Form",comment:"表单",matchAllClient:!0},{name:"TabPage",comment:"选项页",matchAllClient:!0,dependent:!0},{name:"Tab",comment:"选项卡",matchAllClient:!0,dependencies:["TabPage"]},{name:"Grid",comment:"数据表格"},{name:"DataSet",comment:"可编辑表格"},{name:"Tree",comment:"树形组件"},{name:"Iframe",comment:"嵌入式框架",matchAllClient:!0}]},{id:"Input",name:"表单输入项",components:[{name:"Button",comment:"按钮",matchAllClient:!0},{name:"Link",comment:"链接",matchAllClient:!0},{name:"Label",comment:"文本标签",matchAllClient:!0},{name:"Pre",comment:"文本段落",matchAllClient:!0},{name:"Text",comment:"单行输入框",matchAllClient:!0},{name:"TextArea",comment:"多行输入框",matchAllClient:!0},{name:"Radio",comment:"单选框",matchAllClient:!0},{name:"CheckBox",comment:"复选框",matchAllClient:!0},{name:"Select",comment:"下拉列表"},{name:"PopupList",comment:"弹出列表"},{name:"List",comment:"只读列表",matchAllClient:!0},{name:"Switch",comment:"开关",matchAllClient:!0},{name:"Password",comment:"密码",matchAllClient:!0},{name:"Hidden",comment:"隐藏域",matchAllClient:!0},{name:"Date",comment:"日期"},{name:"Time",comment:"时间"},{name:"DateTime",comment:"日期时间"},{name:"RichText",comment:"富文本"},{name:"Image",comment:"图片",matchAllClient:!0},{name:"FileUpload",comment:"文件上传",matchAllClient:!0},{name:"PhotoUpload",comment:"图片上传",matchAllClient:!0},{name:"Dep",comment:"部门"},{name:"User",comment:"用户"},{name:"Role",comment:"角色"}]},{id:"Invisible",name:"不可视组件",components:[{name:"Service",comment:"后台服务",matchAllClient:!0,isInvisible:!0}]},{id:"ImportExport",name:"导入导出",components:[{name:"ExcelImport",comment:"Excel导入"},{name:"ExcelExport",comment:"Excel导出"}]},{id:"Chart",name:"统计图表",components:[{name:"ChartLine",comment:"折线图",matchAllClient:!0},{name:"ChartBar",comment:"柱状图",matchAllClient:!0},{name:"ChartBarY",comment:"条形图",matchAllClient:!0},{name:"ChartLineBar",comment:"线柱结合图",matchAllClient:!0},{name:"ChartPie",comment:"饼状图",matchAllClient:!0},{name:"ChartAnnular",comment:"环形图",matchAllClient:!0}]}]},{}],16:[function(e,t,n){"use strict";var i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=i(e("@babel/runtime/helpers/get")),l=i(e("@babel/runtime/helpers/inherits")),o=i(e("@babel/runtime/helpers/possibleConstructorReturn")),d=i(e("@babel/runtime/helpers/getPrototypeOf"));function u(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=(0,d.default)(n);return t=i?(e=(0,d.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,o.default)(this,t)}}e=function(e){(0,l.default)(o,e);var i=u(o);function o(e,t,n){return(0,r.default)(this,o),i.call(this,e,"Button",t,n)}return(0,a.default)(o,[{key:"value",get:function(){return this.dataModel.value},set:function(e){this.dataModel.value=e,this._jqObj&&(this._jqObj.find("label").text(e),this.exeEventHandler("onChange"))}},{key:"buttonType",get:function(){return this.dataModel.buttonType},set:function(e){e=e||"default";this.checkAttrOption("buttonType",e)?(this.dataModel.buttonType=e,this._jqObj&&(this._jqObj.removeClass("tfp-button-default tfp-button-primary tfp-button-info tfp-button-warning tfp-button-success tfp-button-danger"),this._jqObj.removeClass("tfp-button-default-plain tfp-button-primary-plain tfp-button-info-plain tfp-button-warning-plain tfp-button-success-plain tfp-button-danger-plain"),this.plain?this._jqObj.addClass("tfp-button-"+e+"-plain"):this._jqObj.addClass("tfp-button-"+e))):this._tfp.showMsg("按钮组件不支持类型:"+e+"!")}},{key:"theme",get:function(){return this.dataModel.theme},set:function(e){e=e||"rect";this.checkAttrOption("theme",e)?(this.dataModel.theme=e,this._jqObj&&(this._jqObj.removeClass("tfp-button-round tfp-button-rect tfp-button-circle"),this._jqObj.addClass("tfp-button-"+e))):this._tfp.showMsg("按钮组件不支持风格:"+e+"!")}},{key:"plain",get:function(){return this.dataModel.plain},set:function(e){this.dataModel.plain=!!e,this._jqObj&&(this._jqObj.removeClass("tfp-button-default tfp-button-primary tfp-button-info tfp-button-warning tfp-button-success tfp-button-danger"),this._jqObj.removeClass("tfp-button-default-plain tfp-button-primary-plain tfp-button-info-plain tfp-button-warning-plain tfp-button-success-plain tfp-button-danger-plain"),e=this.buttonType||"default",this.dataModel.plain?this._jqObj.addClass("tfp-button-"+e+"-plain"):this._jqObj.addClass("tfp-button-"+e))}},{key:"showImage",get:function(){return this.dataModel.showImage},set:function(e){var t,n;this.dataModel.showImage=!!e,this._jqObj&&(e?0<this._jqObj.find("img").length?this._jqObj.find("img").parent().show():(this._tfp.isDesigning&&(uiDesigner.showAttrSettingRow("imageUrl"),uiDesigner.showAttrSettingRow("imageWidth"),uiDesigner.showAttrSettingRow("imageHeight"),uiDesigner.showAttrSettingRow("portrait"),uiDesigner.showAttrSettingRow("hiddenText")),(t=this.dataModel.imageUrl)?this._tfp.isDesigning&&(t=this._tfp.getUrlRealPath(t)):t=this._tfp.rootPath+"/src/components/button/images/default-photo.png",n=24,((n=this.dataModel.imageWidth?this.dataModel.imageWidth:n)+"").indexOf("px")<0&&(n+="px"),e=24,((e=this.dataModel.imageHeight?this.dataModel.imageHeight:e)+"").indexOf("px")<0&&(e+="px"),$('<div style="float:left;display:block;">'+('<img src="'+t+'" style="width:'+n+";height:"+e+';margin-top:3px;margin-bottom:3px;" />')+"</div>").insertBefore(this._jqObj.find("label")),this._jqObj.find("label").css("margin-left","7px"),this._jqObj.find("label").css("line-height",this._jqObj.height()+"px")):(this._jqObj.find("img").parent().remove(),this.dataModel.portrait=!1,this.dataModel.hiddenText=!1,this.dataModel.imageUrl="",this.dataModel.imageWidth=24,this.dataModel.imageHeight=24,this._jqObj.find("label").css("margin-left","0"),this._jqObj.find("label").css("line-height","30px"),this._jqObj.find("label").show(),this._tfp.isDesigning&&(uiDesigner.hideAttrSettingRow("imageUrl"),uiDesigner.hideAttrSettingRow("imageWidth"),uiDesigner.hideAttrSettingRow("imageHeight"),uiDesigner.setCurCptAttrSettingVal("imageWidth","24"),uiDesigner.setCurCptAttrSettingVal("imageHeight","24"),uiDesigner.setCurCptAttrSettingVal("portrait",!1),uiDesigner.hideAttrSettingRow("portrait"),uiDesigner.setCurCptAttrSettingVal("hiddenText",!1),uiDesigner.hideAttrSettingRow("hiddenText"))))}},{key:"imageUrl",get:function(){return this.dataModel.imageUrl},set:function(e){this.dataModel.imageUrl=e,this._jqObj&&(this._tfp.isDesigning&&e?this._jqObj.find("img").attr("src",this._tfp.getUrlRealPath(e)):this._jqObj.find("img").attr("src",e))}},{key:"imageWidth",get:function(){return this.dataModel.imageWidth},set:function(e){this.dataModel.imageWidth=e,this._jqObj&&this._jqObj.find("img").attr("width",e)}},{key:"imageHeight",get:function(){return this.dataModel.imageHeight},set:function(e){this.dataModel.imageHeight=e,this._jqObj&&(this._jqObj.find("img").attr("height",e),this.portrait||this._jqObj.find("label").css("line-height",this._jqObj.find("img").height()+6+"px"))}},{key:"hiddenText",get:function(){return this.dataModel.hiddenText},set:function(e){this.dataModel.hiddenText=!!e,this._jqObj&&0!=this._jqObj.find("label").length&&(e?(this.portrait=!1,uiDesigner.setCurCptAttrSettingVal("portrait",!1),uiDesigner.hideAttrSettingRow("portrait"),this._jqObj.find("img").css("margin-top","3px"),this._jqObj.find("label").hide()):(this._jqObj.find("label").show(),this._jqObj.find("div").css("float","left"),this._jqObj.find("div").css("width",""),this._jqObj.find("img").css("margin-top","3px"),this._jqObj.find("label").css("margin-left","7px"),this._jqObj.find("label").css("line-height",this._jqObj.find("img").height()+6+"px"),uiDesigner.showAttrSettingRow("portrait")))}},{key:"portrait",get:function(){return this.dataModel.portrait},set:function(e){this.dataModel.portrait=!!e,this._jqObj&&0!=this._jqObj.find("div").length&&(e?(this._jqObj.find("div").css("float","none"),this._jqObj.find("div").css("width","100%"),this._jqObj.find("img").css("margin-top","10px"),this._jqObj.find("label").css("margin-left","0"),this._jqObj.find("label").css("line-height","30px")):(this._jqObj.find("div").css("float","left"),this._jqObj.find("div").css("width",""),this._jqObj.find("img").css("margin-top","3px"),this._jqObj.find("label").css("margin-left","7px"),this._jqObj.find("label").css("line-height",this._jqObj.find("img").height()+6+"px")))}},{key:"title",get:function(){return this.dataModel.title},set:function(e){this.dataModel.title=e,this._jqObj&&this._jqObj.attr("title",e)}},{key:"labelHeight",get:function(){return this.dataModel.labelHeight?this._tfp.getPixel(this.dataModel.labelHeight):30},set:function(e){this.dataModel.labelHeight=e,this._jqObj&&(((e=e)+"").indexOf("px")<0&&(e+="px"),this._jqObj.find("label").css("line-height",e))}},{key:"css",value:function(e,t){(0,s.default)((0,d.default)(o.prototype),"css",this).call(this,e,t),"height"==e&&this._jqObj&&!this.showImage&&this._jqObj.find("label").css("line-height",t)}}]),o}(e("../controller.js").VisibleComponent);n.default=e},{"../controller.js":17,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/get":5,"@babel/runtime/helpers/getPrototypeOf":6,"@babel/runtime/helpers/inherits":7,"@babel/runtime/helpers/interopRequireDefault":8,"@babel/runtime/helpers/possibleConstructorReturn":9}],17:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.VisibleComponent=exports.InvisibleComponent=exports.FormInput=exports.ContainerComponent=exports.Component=void 0;var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));function _createSuper(n){var i=_isNativeReflectConstruct();return function(){var e,t=(0,_getPrototypeOf2.default)(n);return t=i?(e=(0,_getPrototypeOf2.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,_possibleConstructorReturn2.default)(this,t)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var _parent=Symbol("parent"),Component=function(){function Component(e,t,n,i){if((0,_classCallCheck2.default)(this,Component),!e)throw new Error("请提供tfp对象!");if(!t)throw console.log(n),new Error("请提供组件类型!");if(this._tfp=e,this.level=0,this.index=0,n)this.dataModel=n,this.dataModel.type||(this.dataModel.type=t);else{var o=this._tfp.type(t);if(!o)throw new Error("请提供正确的组件类型!");this.dataModel={type:t},this.dataModel.id=this.dataModel.type.substr(0,1).toLowerCase()+this.dataModel.type.substr(1)+this._tfp.getNewCptIndex(this.dataModel.type);for(var r=this.attrTypes,a=0;a<r.length;a++){var s=r[a];!s.default&&0!=s.default&&0!=s.default||("string"==s.type.toLowerCase()?this.dataModel[s.name]=s.default.replace("{id}",this.id):this.dataModel[s.name]=s.default)}if(o.defaultStyles)for(var l in this.dataModel.styles={},o.defaultStyles)this.dataModel.styles[l]=o.defaultStyles[l]}if(this.dataModel.id||(this.dataModel.id=this.dataModel.type.substr(0,1).toLowerCase()+this.dataModel.type.substr(1)+this._tfp.getNewCptIndex(this.dataModel.type)),(this._tfp.components[this.dataModel.id]=this)._tfp.isRuntime&&(window[this.dataModel.id]=this),i&&(this[_parent]=i,this.level=i.level+1,!this._tfp.isLoadingPage)){i.dataModel.components||(i.dataModel.components=[]);for(var d=!1,u=0;u<i.dataModel.components.length;u++){var h=i.dataModel.components[u];h.id!=this.dataModel.id?h.index>=this.index&&(this.index=h.index+1):d=!0}d||i.dataModel.components.push(this.dataModel)}}return(0,_createClass2.default)(Component,[{key:"id",get:function(){return this.dataModel.id},set:function(e){if(e){var t=this.dataModel.id;if(t!=e){for(var n in this._tfp.components)if(n==e)throw new Error("ID为的"+e+"组件已存在!");this.dataModel.id=e,delete this._tfp.components[t],(this._tfp.components[this.dataModel.id]=this)._tfp.isRuntime&&(delete window[t],window[this.dataModel.id]=this),0<$("#"+t).length&&$("#"+t).attr("id",this.dataModel.id)}}}},{key:"type",get:function(){return this.dataModel.type},set:function(e){}},{key:"metadata",get:function(){return this._tfp.type(this.dataModel.type)},set:function(e){}},{key:"parent",get:function(){return this[_parent]},set:function(e){if(this[_parent]){if(this[_parent].id==e.id)return;this[_parent].dataModel.components.remove(this.dataModel),this[_parent]=e,this[_parent].dataModel.components||(this[_parent].dataModel.components=[]),this[_parent].dataModel.components.push(this.dataModel)}else this[_parent]=e,this[_parent].dataModel.components||(this[_parent].dataModel.components=[]),this[_parent].dataModel.components.push(this.dataModel);this.level=this[_parent].level+1;for(var t=0;t<this[_parent].dataModel.components.length;t++){var n=this[_parent].dataModel.components[t];n.index>=this.index&&(this.index=n.index+1)}}},{key:"attrTypes",get:function(){var e=[],t=this._tfp.type(this.type);if(t.attrs)for(var n=0;n<t.attrs.length;n++){var i=t.attrs[n];if("group"==i.type||i.items)for(var o=0;o<i.items.length;o++)e.push(i.items[o]);else e.push(i)}return e},set:function(e){}},{key:"attr",value:function(e,t){if(0!=arguments.length)return 1==arguments.length?this[e]:void(this[e]=t)}},{key:"getAttrTypeInfo",value:function(e){if(!this.metadata)throw new Error("没有找到组件类型定义信息,请先引用类型信息!");if(!this.metadata.attrs)return null;for(var t=0;t<this.metadata.attrs.length;t++){var n=this.metadata.attrs[t];if("group"==n.type||n.items){for(var i=0;i<n.items.length;i++)if(n.items[i].name==e)return n.items[i]}else if(this.metadata.attrs[t].name==e)return this.metadata.attrs[t]}return null}},{key:"checkAttrOption",value:function(e,t){e=this.getAttrTypeInfo(e);if(!e)return!1;var n=e.options;if(!n)return!1;for(var i=0;i<n.length;i++)if(n[i].value==t)return!0;return!1}},{key:"exeEventHandler",value:function exeEventHandler(eventName){var ret;if(!this._tfp.isDesigning)return this[eventName]&&"function"==typeof this[eventName]?ret=this[eventName](arguments):this.dataModel[eventName]&&(ret=eval(this.dataModel[eventName])),ret||void 0}}]),Component}();exports.Component=Component;var InvisibleComponent=function(){(0,_inherits2.default)(r,Component);var o=_createSuper(r);function r(e,t,n,i){return(0,_classCallCheck2.default)(this,r),o.call(this,e,t,n,i)}return(0,_createClass2.default)(r,[{key:"isInvisible",get:function(){return!0},set:function(e){}},{key:"render",value:function(){this._tfp.isDesigning&&(window.parent.uiDesigner.addInvisibleComponent(this),this._tfp.initCptDesignSetting(this))}}]),r}();exports.InvisibleComponent=InvisibleComponent;var VisibleComponent=function(){(0,_inherits2.default)(r,Component);var o=_createSuper(r);function r(e,t,n,i){return(0,_classCallCheck2.default)(this,r),(i=o.call(this,e,t,n,i))._jqObj=null,i.el=null,i.isRendered=!1,i}return(0,_createClass2.default)(r,[{key:"isInvisible",get:function(){return!1},set:function(e){}},{key:"isContainer",get:function(){return!1},set:function(e){}},{key:"styles",get:function(){return this.dataModel.styles},set:function(e){}},{key:"style",get:function(){return this.dataModel.style},set:function(e){if(this.dataModel.style=e=e||"",this._jqObj){var t=e.trim();if(""==t||t.endsWith(";")||(t+=";"),this.dataModel.styles)for(var n in this.dataModel.styles)t+=n+": "+this.dataModel.styles[n]+";";e=this._jqObj.css("outline");this._jqObj.attr("style",t),this._jqObj.css("outline",e)}}},{key:"class",get:function(){return this.dataModel.class},set:function(e){this.dataModel.class=e=e||"",this._jqObj&&this._jqObj.attr("class",e)}},{key:"indent",get:function(){for(var e="",t=0;t<this.level;t++)e+="\t";return e},set:function(e){}},{key:"css",value:function(e,t){if(0!=arguments.length){if(1==arguments.length)return this.dataModel.styles?this.dataModel.styles[e]:null;this._jqObj&&this._jqObj.css(e,t),this.dataModel.styles||(this.dataModel.styles={}),""==t||null==t?delete this.dataModel.styles[e]:this.dataModel.styles[e]=t}}},{key:"val",value:function(e){if(0==arguments.length)return this.value;this.value=e}},{key:"show",value:function(){this._jqObj&&this._jqObj.show()}},{key:"hide",value:function(){this._jqObj&&this._jqObj.hide()}},{key:"toggle",value:function(){this._jqObj&&this._jqObj.toggle()}},{key:"focus",value:function(){this._jqObj&&this._jqObj.focus()}},{key:"getHtmlIndent",value:function(){if(this.indent)return this.indent;for(var e="",t=0;t<this.level;t++)e+="\t";return e}},{key:"render",value:function(){if(this.parent&&this.parent.containerEl||"Page"==this.type){var e=new this._tfp.renders[this.type](this._tfp,this.dataModel,this.level);if("Page"==this.type?(this.dataModel.pageElId&&this._tfp.isRuntime?this._jqObj=$("#"+this.dataModel.pageElId):this._jqObj=$("body"),this._jqObj.append(e.getHtml()),this._tfp.curPage=this):($(this.parent.containerEl).append(e.getHtml()),this._jqObj=$("#"+this.id)),0<this._jqObj.length&&(this.el=this._jqObj.get(0)),!this.isRendered&&this._tfp.isDesigning&&this._tfp.initCptDesignSetting(this),"undefined"==typeof window||this._tfp.isDesigning||(window[this.id]=this),this.dataModel.components)for(var t=0;t<this.dataModel.components.length;t++){var n=this.dataModel.components[t];this._tfp.render(n,this)}this.onRender&&this.onRender(),this.isRendered=!0}}},{key:"clear",value:function(){if(this.dataModel.components)for(var e=0;e<this.dataModel.components.length;e++){var t=this.dataModel.components[e],t=this._tfp.get(t.id);t.clear(),t._jqObj&&t._jqObj.remove(),delete this._tfp.components[t.id]}}}]),r}();exports.VisibleComponent=VisibleComponent;var ContainerComponent=function(){(0,_inherits2.default)(r,VisibleComponent);var o=_createSuper(r);function r(e,t,n,i){return(0,_classCallCheck2.default)(this,r),(i=o.call(this,e,t,n,i)).dataModel.components||(i.dataModel.components=[]),i}return(0,_createClass2.default)(r,[{key:"isContainer",get:function(){return!0},set:function(e){}},{key:"containerEl",get:function(){return this.el},set:function(e){this.el=e}},{key:"components",get:function(){return this.dataModel.components},set:function(e){}},{key:"addChild",value:function(e){e.parent=this}},{key:"removeChild",value:function(e){for(var t=0;t<this.dataModel.components.length;t++){var n=this.dataModel.components[t];if(n.id==e){n=this._tfp.components[n.id];return n.clear(),n._jqObj&&n._jqObj.remove(),this._tfp.isRuntime&&(delete this._tfp.components[n.id],delete window[n.id]),void(n=null)}}}},{key:"clearChildren",value:function(){for(var e=0;e<this.dataModel.components.length;e++){var t=this.dataModel.components[e],t=this._tfp.components[t.id];t.clear(),t._jqObj&&t._jqObj.remove(),delete this._tfp.components[t.id],this._tfp.isRuntime&&delete window[t.id],t=null}this.dataModel.components=[]}}]),r}();exports.ContainerComponent=ContainerComponent;var FormInput=function(_VisibleComponent2){(0,_inherits2.default)(FormInput,_VisibleComponent2);var _super4=_createSuper(FormInput);function FormInput(e,t,n,i){return(0,_classCallCheck2.default)(this,FormInput),_super4.call(this,e,t,n,i)}return(0,_createClass2.default)(FormInput,[{key:"isFormInput",get:function(){return!0}},{key:"comment",get:function(){return this.dataModel.comment},set:function(e){this.dataModel.comment=e}},{key:"dataBindingFormat",get:function(){return this.dataModel.dataBindingFormat},set:function(e){this.dataModel.dataBindingFormat=e}},{key:"required",get:function(){return this.dataModel.required},set:function(e){this.dataModel.required=!!e}},{key:"readonly",get:function(){return this.dataModel.readonly},set:function(e){this.dataModel.readonly=!!e,this.dataModel.readonly||delete this.dataModel.readonly,this._jqObj&&0<this._jqObj.length&&!this._tfp.isDesigning&&("INPUT"==(e=this._jqObj.get(0)).tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName?e.readOnly=this.dataModel.readonly:"DIV"==e.tagName&&this._jqObj.find("input").each(function(){$(this).get(0).readOnly=this.dataModel.readonly}))}},{key:"disabled",get:function(){return this.dataModel.disabled},set:function(e){this.dataModel.disabled=!!e,this.dataModel.disabled||delete this.dataModel.disabled,this._jqObj&&0<this._jqObj.length&&!this._tfp.isDesigning&&("INPUT"==(e=this._jqObj.get(0)).tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName?e.disabled=this.dataModel.disabled:"DIV"==e.tagName&&this._jqObj.find("input").each(function(){$(this).get(0).disabled=this.dataModel.disabled}))}},{key:"formula",get:function(){return this.dataModel.formula},set:function(e){isNull(e)?delete this.dataModel.formula:this.dataModel.formula=e}},{key:"valueOnChange",value:function(){this._tfp.iptValueOnChange(this)}},{key:"exeFormula",value:function exeFormula(){if(this.dataModel.formula){for(var val=this.dataModel.formula,ipts=this.dataModel.formula.match(/\$\{[\w]+\}/g),i=0;i<ipts.length;i++){var iptId=ipts[i].substr(2,ipts[i].length-3),ipt=this._tfp.components[iptId],iptVal;ipt&&(iptVal=ipt.value,"Text"==ipt.type&&isNull(iptVal)?iptVal="0":"DataSet"==ipt.type&&(iptVal=ipt.id),val=val.replaceAll("${"+iptId+"}",iptVal))}try{this.value=eval(val)}catch(err){console.error("执行计算表达式出错:"+err.message)}}}},{key:"setOptions",value:function(e){if(e){var t=[];if("string"==typeof e)for(var n=e.split(","),i=0;i<n.length;i++){var o=n[i];""!=o.trim()&&t.push({value:o,text:o})}else if(Array.isArray(e))for(i=0;i<e.length;i++){var r=e[i];"[object Object]"===Object.prototype.toString.call(r)?t.push(r):t.push({value:r,text:r})}this.dataModel.options=t}}}]),FormInput}(VisibleComponent);exports.FormInput=FormInput},{"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/getPrototypeOf":6,"@babel/runtime/helpers/inherits":7,"@babel/runtime/helpers/interopRequireDefault":8,"@babel/runtime/helpers/possibleConstructorReturn":9}],18:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_get2=_interopRequireDefault(require("@babel/runtime/helpers/get")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_controller=require("../controller.js");function _createSuper(n){var i=_isNativeReflectConstruct();return function(){var e,t=(0,_getPrototypeOf2.default)(n);return t=i?(e=(0,_getPrototypeOf2.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,_possibleConstructorReturn2.default)(this,t)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var Page=function(_ContainerComponent){(0,_inherits2.default)(Page,_ContainerComponent);var _super=_createSuper(Page);function Page(e,t){var n;if((0,_classCallCheck2.default)(this,Page),n=_super.call(this,e,"Page",t),e.isRuntime&&(t.pageElId?n._jqObj=$("#"+t.pageElId):n._jqObj=$("body"),n.el=n._jqObj.get(0),n.dataModel.title&&$("title").text(n.dataModel.title),n.dataModel.styles))for(var i in n.dataModel.styles)n._jqObj.css(i,n.dataModel.styles[i]);return n}return(0,_createClass2.default)(Page,[{key:"client",get:function(){return this.dataModel.client}},{key:"positionType",get:function(){return this.dataModel.positionType}},{key:"framework",get:function(){return this.dataModel.framework}},{key:"pageType",get:function(){return this.dataModel.pageType}},{key:"cssFiles",get:function(){return this.dataModel.cssFiles},set:function(e){this.dataModel.cssFiles=e}},{key:"jsFiles",get:function(){return this.dataModel.jsFiles},set:function(e){this.dataModel.jsFiles=e}},{key:"styleSheets",get:function(){return this.dataModel.styleSheets},set:function(e){this.dataModel.styleSheets=e}},{key:"title",get:function(){return this.dataModel.title},set:function(e){this.dataModel.title=e,$("title").text(e),this._tfp.isDesigning&&("phone"==this.client?window.parent.$("#divPhonePageTitle").html(e):"dialog"==this.pageType&&window.parent.$("#uiDesignerPageTitle").html(" "+e))}},{key:"bgColorMode",get:function(){return this.dataModel.bgColorMode},set:function(e){this.dataModel.bgColorMode=e}},{key:"contentColorMode",get:function(){return"dark"==this.dataModel.bgColorMode?"light":"dark"},set:function(e){}},{key:"width",get:function(){return"dialog"==this.dataModel.pageType?this.dataModel.width:null},set:function(e){e&&"dialog"==this.dataModel.pageType&&((e=(this.dataModel.width=e)+"").indexOf("px")<0&&e.indexOf("%")<0&&(e+="px"),this._tfp.isDesigning&&"dialog"==this.pageType?(window.parent.$("#uiDesignerFrame").css("width",e),window.parent.$("#uiDesignerFrame").find("iframe").css("width",e)):this._tfp.isRuntime)}},{key:"height",get:function(){return"dialog"==this.dataModel.pageType?this.dataModel.height:null},set:function(e){e&&"dialog"==this.dataModel.pageType&&((e=(this.dataModel.height=e)+"").indexOf("px")<0&&e.indexOf("%")<0&&(e+="px"),this._tfp.isDesigning&&"dialog"==this.pageType?(window.parent.$("#uiDesignerFrame").css("height",e),window.parent.$("#uiDesignerFrame").find("iframe").css("height",parseInt(e.replace("px",""))-31+"px")):this._tfp.isRuntime)}},{key:"render",value:function(){if((0,_get2.default)((0,_getPrototypeOf2.default)(Page.prototype),"render",this).call(this),this._tfp.isDesigning){if(this.dataModel.style&&$("body").attr("style",this.dataModel.style),this.dataModel.styles)for(var e in this.dataModel.styles)$("body").css(e,this.dataModel.styles[e]);if(this.dataModel.class&&$("body").attr("class",this.dataModel.class),this.dataModel.styleSheets){for(var t="",n=0;n<this.dataModel.styleSheets.length;n++){var i=this.dataModel.styleSheets[n];t+="\t"+i.id+" {";for(var o=0;o<i.styles.length;o++){var r=i.styles[o];t+=r.name+": "+r.value+";"}t+="}\r\n"}$("head").append('<style id="_tfpPageStyleSetting">\r\n'+t+"</style>")}if(this.dataModel.cssFiles)for(n=0;n<this.dataModel.cssFiles.length;n++){var a=this.dataModel.cssFiles[n];$("head").append('<link rel="stylesheet" type="text/css" href="'+a+'">')}}}},{key:"initRuntime",value:function initRuntime(){this.dataModel.onLoad&&eval(this.dataModel.onLoad)}}]),Page}(_controller.ContainerComponent);exports.default=Page},{"../controller.js":17,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/get":5,"@babel/runtime/helpers/getPrototypeOf":6,"@babel/runtime/helpers/inherits":7,"@babel/runtime/helpers/interopRequireDefault":8,"@babel/runtime/helpers/possibleConstructorReturn":9}],19:[function(e,t,n){"use strict";var i=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("@babel/runtime/helpers/classCallCheck")),a=i(e("@babel/runtime/helpers/createClass")),s=i(e("@babel/runtime/helpers/inherits")),o=i(e("@babel/runtime/helpers/possibleConstructorReturn")),l=i(e("@babel/runtime/helpers/getPrototypeOf"));function d(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=(0,l.default)(n);return t=i?(e=(0,l.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,o.default)(this,t)}}e=function(e){(0,s.default)(o,e);var i=d(o);function o(e,t,n){return(0,r.default)(this,o),i.call(this,e,"Panel",t,n)}return(0,a.default)(o,[{key:"title",get:function(){return this.dataModel.title},set:function(e){this.dataModel.title=e,this._jqObj&&this._jqObj.attr("title",e)}}]),o}(e("../controller.js").ContainerComponent);n.default=e},{"../controller.js":17,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/getPrototypeOf":6,"@babel/runtime/helpers/inherits":7,"@babel/runtime/helpers/interopRequireDefault":8,"@babel/runtime/helpers/possibleConstructorReturn":9}],20:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_controller=require("../controller.js");function _createSuper(n){var i=_isNativeReflectConstruct();return function(){var e,t=(0,_getPrototypeOf2.default)(n);return t=i?(e=(0,_getPrototypeOf2.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,_possibleConstructorReturn2.default)(this,t)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var _status=Symbol("status"),Service=function(_InvisibleComponent){(0,_inherits2.default)(Service,_InvisibleComponent);var _super=_createSuper(Service);function Service(e,t,n){return(0,_classCallCheck2.default)(this,Service),(n=_super.call(this,e,"Service",t,n))[_status]=0,n.cbFuncs=[],n}return(0,_createClass2.default)(Service,[{key:"status",get:function(){return this[_status]},set:function(e){}},{key:"path",get:function(){return this.dataModel.path},set:function(e){this.dataModel.path=e}},{key:"args",get:function(){return this.dataModel.args},set:function(e){this.dataModel.args=e}},{key:"argSettings",get:function(){return this.dataModel.argSettings},set:function(e){this.dataModel.argSettings=e}},{key:"autoReload",get:function(){return!!this.dataModel.autoReload},set:function(e){this.dataModel.autoReload=!!e}},{key:"autoShowError",get:function(){return!!this.dataModel.autoShowError},set:function(e){this.dataModel.autoShowError=!!e}},{key:"setArg",value:function(e,t,n){if(e){this.dataModel.argSettings||(this.dataModel.argSettings=[]);var i={name:e,type:"Default"};n&&(i.type=n),t&&(i.value=t);for(var o=!1,r=0;r<this.dataModel.argSettings.length;r++)if(this.dataModel.argSettings[r].name==i.name){o=!0,n&&(this.dataModel.argSettings[r].type=n),t&&(this.dataModel.argSettings[r].value=t);break}o||this.dataModel.argSettings.push(i)}else this._tfp.showMsg("请提供参数名称!")}},{key:"removeArg",value:function(e){if(e&&this.dataModel.argSettings)for(var t=0;t<this.dataModel.argSettings.length;t++)if(this.dataModel.argSettings[t].name==e)return void this.dataModel.argSettings.splice(t,1)}},{key:"showError",value:function showError(msg){console.error(msg),this.dataModel.autoShowError&&"undefined"!=typeof window&&this._tfp.showMsg(msg),this.onError?this.onError(msg):this.dataModel.onError&&eval(this.dataModel.onError)}},{key:"getHttpRequest",value:function(){var e;return window.XMLHttpRequest?e=new XMLHttpRequest:window.ActiveXObject&&(e=(e=new ActiveXObject("Msxml2.XMLHTTP"))||new ActiveXObject("Microsoft.XMLHTTP")),e||(this.showError("您的浏览器不支持Ajax,无法执行该操作!"),null)}},{key:"request",value:function(t,e){if(this.path){if(e&&this.cbFuncs.push(e),1!=this[_status]){if(this[_status]=1,(t=t||{}).service=this.path,this.dataModel.args)for(var n in this.dataModel.args)t[n]=this.dataModel.args[n];if(this.dataModel.argSettings)for(var i=0;i<this.dataModel.argSettings.length;i++){var o,r=this.dataModel.argSettings[i];if("QueryString"==r.type)r.value?t[r.name]=this._tfp.getUrlArg(r.value):t[r.name]=this._tfp.getUrlArg(r.name);else if("ComponentVal"==r.type){var a=null;(a=r.value?this._tfp.get(r.value):this._tfp.get(r.name))&&(t[r.name]=a.value)}else if("ComponentAttr"==r.type)r.value&&0<r.value.indexOf(".")&&(o=r.value.split("."),(a=this._tfp.get(o[0]))&&""!=o[1]&&(t[r.name]=a[o[1]]));else if("DialogArg"==r.type)if(r.value){var s;try{s=JSON.parse(this._tfp.getDialogArgs()),t[r.name]=s[r.value]}catch(e){this._tfp.showMsg(e.message)}}else t[r.name]=this._tfp.getDialogArgs();else"Expression"==r.type||(t[r.name]=r.value)}this.exeEventHandler("onRequest");try{if("undefined"!=typeof top&&top.taskMsgAuthObj){var l,d={args:{}};for(l in top.taskMsgAuthObj.setAuthData(d),d.args)t[l]=d.args[l]}}catch(e){try{if(void 0!==window.parent&&window.parent.taskMsgAuthObj){var u,h={args:{}};for(u in window.parent.taskMsgAuthObj.setAuthData(h),h.args)t[u]=h.args[u]}}catch(e){"undefined"!=typeof tmClient&&("iOS"==tmClient.clientOSType&&"undefined"!=typeof TMiOSClient||"Android"==tmClient.clientOSType&&"undefined"!=typeof TMAndroidClient)?(f=JSON.parse(tmClient.getAuthData()),t._auth_org=f._auth_org,t._auth_ts=f._auth_ts,t._auth_data=f._auth_data):(this._tfp.getUrlArg("_auth_org")&&(t._auth_org=this._tfp.getUrlArg("_auth_org")),this._tfp.getUrlArg("_auth_ts")&&(t._auth_ts=this._tfp.getUrlArg("_auth_ts")),this._tfp.getUrlArg("_auth_data")&&(t._auth_data=this._tfp.getUrlArg("_auth_data")))}}var c,f=!1;try{f="undefined"!=typeof top&&top.taskBuilder}catch(e){}f?(c=this,top.taskBuilder.requestByIPC(this.path,t,function(e,t){c.onResponse(e,t)})):this.sendRequest(t)}}else this.showError("请提供服务路径!")}},{key:"exeResponseFunc",value:function exeResponseFunc(req,res,responseFuncStr){responseFuncStr.indexOf(".")<0&&responseFuncStr.indexOf(" ")<0&&responseFuncStr.indexOf("=")<0&&responseFuncStr.indexOf("(")<0&&responseFuncStr.indexOf(")")<0?eval(responseFuncStr+"(req, res)"):eval(responseFuncStr)}},{key:"onResponse",value:function(e,t){if(0==t.code){if(this.srcElement&&(e.srcElement=this.srcElement),0<this.cbFuncs.length){for(var n=0;n<this.cbFuncs.length;n++)this.cbFuncs[n](e,t);this.cbFuncs=[]}this.dataModel.onResponse&&"string"==typeof this.dataModel.onResponse&&this.exeResponseFunc(e,t,this.dataModel.onResponse)}else if(this.cbFuncs=[],501!=t.code)this.showError(t.message);else try{this._tfp.isMobile()?top.location="/mobile/login.html":top.location="/"}catch(e){}}},{key:"sendRequest",value:function(t){var n=this,i=this.getHttpRequest();try{i.onreadystatechange=function(){var e;4==i.readyState&&(n[_status]=2,200==i.status?(e=JSON.parse(i.responseText),n.onResponse(t,e)):404==i.status?n.showError("请求的服务不存在!"):0!==i.status&&n.showError("向服务器发送请求时发生意外错误!\r\n错误代码:"+i.status))};var e=(e=location.toString()).substr(0,e.indexOf("/",8)+1);i.open("POST",e+"Service",!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),i.send(JSON.stringify(t))}catch(e){this.showError("向服务器发送请求时发生意外错误!\r\n错误描述:"+e.message)}}},{key:"initRuntime",value:function(){if(this.dataModel.argSettings&&this.dataModel.autoReload)for(var e=0;e<this.dataModel.argSettings.length;e++){var t,n=this.dataModel.argSettings[e];"ComponentVal"==n.type&&(t=null,(t=n.value?this._tfp.get(n.value):this._tfp.get(n.name))&&(t.formulaIpts||(t.formulaIpts=[]),t.formulaIpts.contains(this.id)||t.formulaIpts.push(this.id)))}}}]),Service}(_controller.InvisibleComponent);exports.default=Service},{"../controller.js":17,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/getPrototypeOf":6,"@babel/runtime/helpers/inherits":7,"@babel/runtime/helpers/interopRequireDefault":8,"@babel/runtime/helpers/possibleConstructorReturn":9}],21:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_controller=require("../controller.js");function _createSuper(n){var i=_isNativeReflectConstruct();return function(){var e,t=(0,_getPrototypeOf2.default)(n);return t=i?(e=(0,_getPrototypeOf2.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,_possibleConstructorReturn2.default)(this,t)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var Tree=function(_VisibleComponent){(0,_inherits2.default)(Tree,_VisibleComponent);var _super=_createSuper(Tree);function Tree(e,t,n){retur