tfp
Version:
A Web UI framework for TaskBuilder
86 lines • 92.1 kB
HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>导入Excel数据</title>
<script type="text/javascript" src="/node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript">
var isImport = false;
var importService;
var importOK = false;
function importData() {
if(!importService || importService=="") {
tfp.showMsg("请提供导入服务路径!");
return;
}
if(isImport) {
tfp.showMsg("正在导入,请稍候!");
return;
}
var files = fileupload1.files;
if(!files || files.length==0) {
tfp.showMsg("请选择要导入的文件!");
return;
}
button_submit.hide();
isImport = true;
serviceImport.path = importService;
serviceImport.request({fileCode: files[0].code}, function(req, res) {
if(res.code!=0) {
tfp.showMsg(res.message);
return;
}
labelHint.show();
panelProgress.show();
label2.show();
labelTotal.show();
label3.show();
labelFinish.show();
getImportStatus(res.serviceId);
});
}
function getImportStatus(serviceId) {
setTimeout(function() {
serviceGetStatus.request({serviceId: serviceId}, function(req, res) {
if(res.code!=0) {
tfp.showMsg(res.message);
return;
}
if(!res.serviceInfo) {
labelHint.value = "查询导入服务信息失败!";
return;
}
labelTotal.value = res.serviceInfo.total;
labelFinish.value = res.serviceInfo.finish;
let progress = Math.ceil(res.serviceInfo.finish*100/res.serviceInfo.total);
panelProgressBar.css("width", progress*2+"px");
if(res.serviceInfo.status==0 && res.serviceInfo.finish!=res.serviceInfo.total) {
getImportStatus(serviceId);
} else if(res.serviceInfo.status==1 || res.serviceInfo.finish==res.serviceInfo.total) {
isImport = false;
importOK = true;
labelHint.value = "导入完毕。";
} else if(res.serviceInfo.status==-1) {
isImport = false;
labelHint.value = "导入时发生错误:"+res.serviceInfo.error.message;
}
});
}, 1000);
}
function initPage() {
importService = tfp.getUrlArg("servicePath");
if(!importService || importService=="") {
tfp.showMsg("请提供导入服务路径!");
return;
}
}
function onClose() {
var dialog = tfp.getCurDialog();
let cbFunc = tfp.getUrlArg("cb");
if(cbFunc) {
eval("dialog.opener."+cbFunc+"("+importOK+")");
}
tfp.closeCurDialog();
}
</script>
<script type="text/javascript">
!function i(r,a,o){function s(t,e){if(!a[t]){if(!r[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=a[t]={exports:{}},r[t][0].call(n.exports,function(e){return s(r[t][1][e]||e)},n,n.exports,i,r,a,o)}return a[t].exports}for(var l="function"==typeof require&&require,e=0;e<o.length;e++)s(o[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,r,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}t.exports=function(s){return function(){var e=this,o=arguments;return new Promise(function(t,n){var i=s.apply(e,o);function r(e){l(i,t,n,r,a,"next",e)}function a(e){l(i,t,n,r,a,"throw",e)}r(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 r=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=r(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,r=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 r(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(o){"use strict";var l,e=Object.prototype,u=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},i=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,n){return e[t]=n}}function s(e,t,n,i){var r,a,o,s,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype),i=new O(i||[]);return t._invoke=(r=e,a=n,o=i,s=d,function(e,t){if(s===h)throw new Error("Generator is already running");if(s===f){if("throw"===e)throw t;return k()}for(o.method=e,o.arg=t;;){var n=o.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=p(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,o);if(i){if(i===g)continue;return i}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(s===d)throw s=f,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s=h;i=p(r,a,o);if("normal"===i.type){if(s=o.done?f:c,i.arg!==g)return{value:i.arg,done:o.done}}else"throw"===i.type&&(s=f,o.method="throw",o.arg=i.arg)}}),t}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}o.wrap=s;var d="suspendedStart",c="suspendedYield",h="executing",f="completed",g={};function m(){}function b(){}function y(){}var v={};a(v,i,function(){return this});t=Object.getPrototypeOf,t=t&&t(t(x([])));t&&t!==e&&u.call(t,i)&&(v=t);var _=y.prototype=m.prototype=Object.create(v);function j(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function M(o,s){var t;this._invoke=function(n,i){function e(){return new s(function(e,t){!function t(e,n,i,r){e=p(o[e],o,n);if("throw"!==e.type){var a=e.arg;return(n=a.value)&&"object"==typeof n&&u.call(n,"__await")?s.resolve(n.__await).then(function(e){t("next",e,i,r)},function(e){t("throw",e,i,r)}):s.resolve(n).then(function(e){a.value=e,i(a)},function(e){return t("throw",e,i,r)})}r(e.arg)}(n,i,e,t)})}return t=t?t.then(e,e):e()}}function C(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 w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,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(u.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:k}}function k(){return{value:l,done:!0}}return a(_,"constructor",b.prototype=y),a(y,"constructor",b),b.displayName=a(y,r,"GeneratorFunction"),o.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,a(e,r,"GeneratorFunction")),e.prototype=Object.create(_),e},o.awrap=function(e){return{__await:e}},j(M.prototype),a(M.prototype,n,function(){return this}),o.AsyncIterator=M,o.async=function(e,t,n,i,r){void 0===r&&(r=Promise);var a=new M(s(e,t,n,i),r);return o.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},j(_),a(_,r,"Generator"),a(_,i,function(){return this}),a(_,"toString",function(){return"[object Generator]"}),o.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}},o.values=x,O.prototype={constructor:O,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(w),!e)for(var t in this)"t"===t.charAt(0)&&u.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 a.type="throw",a.arg=n,i.next=e,t&&(i.method="next",i.arg=l),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t],a=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var o=u.call(r,"catchLoc"),s=u.call(r,"finallyLoc");if(o&&s){if(this.prev<r.catchLoc)return e(r.catchLoc,!0);if(this.prev<r.finallyLoc)return e(r.finallyLoc)}else if(o){if(this.prev<r.catchLoc)return e(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return e(r.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&&u.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}var a=(r=r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc?null:r)?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,g):this.complete(a)},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),w(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,r=n.completion;return"throw"===r.type&&(i=r.arg,w(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}},o}("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:"可编辑表格",dependencies:["DateTime","Date"]},{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:"角色"},{name:"QrCode",comment:"二维码",matchAllClient:!0},{name:"BarCode",comment:"条形码",matchAllClient:!0},{name:"IconPicker",comment:"图标",matchAllClient:!0},{name:"PathPicker",comment:"路径",matchAllClient:!0},{name:"OrgPicker",comment:"组织结构",matchAllClient:!0}]},{id:"Invisible",name:"不可视组件",components:[{name:"Service",comment:"后台服务",matchAllClient:!0,isInvisible:!0},{name:"Timer",comment:"定时器",matchAllClient:!0,isInvisible:!0}]},{id:"ImportExport",name:"导入导出",components:[{name:"ExcelImport",comment:"Excel导入"},{name:"ExcelExport",comment:"Excel导出"}]},{id:"media",name:"媒体组件",components:[{name:"Audio",comment:"音频",matchAllClient:!0},{name:"Video",comment:"视频",matchAllClient:!0}]},{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 a=i(e("@babel/runtime/helpers/classCallCheck")),o=i(e("@babel/runtime/helpers/createClass")),s=i(e("@babel/runtime/helpers/get")),l=i(e("@babel/runtime/helpers/inherits")),r=i(e("@babel/runtime/helpers/possibleConstructorReturn")),u=i(e("@babel/runtime/helpers/getPrototypeOf"));function p(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,u.default)(n);return t=i?(e=(0,u.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,r.default)(this,t)}}e=function(e){(0,l.default)(r,e);var i=p(r);function r(e,t,n){return(0,a.default)(this,r),i.call(this,e,"Button",t,n)}return(0,o.default)(r,[{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,u.default)(r.prototype),"css",this).call(this,e,t),"height"==e&&this._jqObj&&!this.showImage&&this._jqObj.find("label").css("line-height",t)}}]),r}(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 r=this._tfp.type(t);if(!r)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 a=this.attrTypes,o=0;o<a.length;o++){var s=a[o];!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(r.defaultStyles)for(var l in this.dataModel.styles={},r.defaultStyles)this.dataModel.styles[l]=r.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 u=!1,p=0;p<i.dataModel.components.length;p++){var d=i.dataModel.components[p];d.id!=this.dataModel.id?d.index>=this.index&&(this.index=d.index+1):u=!0}u||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 r=0;r<i.items.length;r++)e.push(i.items[r]);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)(a,Component);var r=_createSuper(a);function a(e,t,n,i){return(0,_classCallCheck2.default)(this,a),r.call(this,e,t,n,i)}return(0,_createClass2.default)(a,[{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))}}]),a}();exports.InvisibleComponent=InvisibleComponent;var VisibleComponent=function(){(0,_inherits2.default)(a,Component);var r=_createSuper(a);function a(e,t,n,i){return(0,_classCallCheck2.default)(this,a),(i=r.call(this,e,t,n,i))._jqObj=null,i.el=null,i.isRendered=!1,i}return(0,_createClass2.default)(a,[{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.initDesigning&&this.initDesigning(),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]}}}]),a}();exports.VisibleComponent=VisibleComponent;var ContainerComponent=function(){(0,_inherits2.default)(a,VisibleComponent);var r=_createSuper(a);function a(e,t,n,i){return(0,_classCallCheck2.default)(this,a),(i=r.call(this,e,t,n,i)).dataModel.components||(i.dataModel.components=[]),i}return(0,_createClass2.default)(a,[{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=[]}}]),a}();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 r=n[i];""!=r.trim()&&t.push({value:r,text:r})}else if(Array.isArray(e))for(i=0;i<e.length;i++){var a=e[i];"[object Object]"===Object.prototype.toString.call(a)?t.push(a):t.push({value:a,text:a})}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")),_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 FileUpload=function(_FormInput){(0,_inherits2.default)(FileUpload,_FormInput);var _super=_createSuper(FileUpload);function FileUpload(e,t,n,i){return(0,_classCallCheck2.default)(this,FileUpload),n=i?_super.call(this,e,i,t,n):_super.call(this,e,"FileUpload",t,n),(0,_possibleConstructorReturn2.default)(n)}return(0,_createClass2.default)(FileUpload,[{key:"appCode",get:function(){return this.dataModel.appCode},set:function(e){this.dataModel.appCode=e}},{key:"appDataId",get:function(){return this.dataModel.appDataId},set:function(e){this.dataModel.appDataId=e}},{key:"fileType",get:function(){return this.dataModel.fileType},set:function(e){this.dataModel.fileType=e}},{key:"size",get:function(){return this.dataModel.size},set:function(e){this.dataModel.size=e}},{key:"allowUpload",get:function(){return this.dataModel.allowUpload},set:function(e){this.dataModel.allowUpload=e}},{key:"allowDelete",get:function(){return this.dataModel.allowDelete},set:function(e){this.dataModel.allowDelete=e}},{key:"value",get:function(){var e=[];this.files||(this.files=[]);for(var t=0;t<this.files.length;t++){var n=this.files[t];e.push({name:n.name,code:n.code,size:n.size})}return this.dataModel.value=e},set:function(e){if(e&&Array.isArray(e)&&(this.files=e,this.dataModel.value=e,this._jqObj)){this._jqObj.find(".tfp-fileupload-fileinfo").each(function(){$(this).parent().remove()});for(var t,n=0;n<this.dataModel.value.length;n++){var i=this.dataModel.value[n],r='<div class="tfp-fileupload-row"><p class="tfp-fileupload-fileinfo"><img src="/node_modules/tfp/src/components/fileupload/images/attach.png" align="absmiddle" /> <a href="/Download?fileCode='+i.code+'">'+i.name+"</a>";this.dataModel.allowDelete&&(r+=' <a href="javascript:void(0)" file-code="'+i.code+'">删除</a>'),r+="</p></div>",this._jqObj.append(r)}this.dataModel.allowDelete&&(t=this)._jqObj.find("a").click(function(){var e=$(this).attr("file-code");e&&t.deleteFile(this,e)}),this.exeEventHandler("onChange")}}},{key:"selectFile",value:function(){var e,t;this.dataModel.size||(this.dataModel.size=10),this.files&&this.files.length>=this.dataModel.size?this._tfp.showMsg("最多只能上传"+this.dataModel.size+"个文件!"):(this._jqObj.append('<div class="tfp-fileupload-row" style="display:none"><input type="file" style="display:none" /><p class="tfp-fileupload-fileinfo"><img src="/node_modules/tfp/src/components/fileupload/images/attach.png" align="absmiddle" /></p><p><progress value="0" max="100"></progress> <span class="uploaderPercent">0%</span></p></div>'),e=this._jqObj.find(".tfp-fileupload-row").last().find("input"),t=this,e.change(function(){t.uploadFile(this)}),e.click())}},{key:"uploadFile",value:function uploadFile(ipt){var iptFile=$(ipt),filePath=iptFile.val();if(this.files)for(var i=0;i<this.files.length;i++){var f=this.files[i];if(f.path==filePath)return this._tfp.showMsg("该文件已添加!"),void iptFile.parent().remove()}var fileName=filePath.substr(filePath.lastIndexOf("\\")+1);if("PhotoUpload"!=this.type||this.dataModel.fileType||(this.dataModel.fileType=".jpg,.jpeg,.gif,.png,.bmp"),this.dataModel.fileType){var isValidType=!0,end=fileName.lastIndexOf("."),filetype;if(0<=end?(filetype=fileName.substr(end),this.dataModel.fileType.toLowerCase().split(",").contains(filetype.toLowerCase())||(isValidType=!1)):isValidType=!1,!isValidType)return this._tfp.showMsg("文件格式必须为:"+this.dataModel.fileType+"。"),void iptFile.parent().remove()}var fileObj=ipt.files[0],reader;"PhotoUpload"==this.type?(reader=new FileReader,reader.onload=function(e){iptFile.parent().find("img").attr("src",e.target.result)},reader.readAsDataURL(fileObj)):iptFile.parent().find(".tfp-fileupload-fileinfo").append(" "+fileName),iptFile.parent().show();var uploaderUrl="/Upload";this.dataModel.appCode&&(uploaderUrl+="?appCode="+this.dataModel.appCode,this.dataModel.appDataId&&(uploaderUrl+="&appDataId="+this.dataModel.appDataId),this.dataModel.onlyOne&&(uploaderUrl+="&onlyOne=true"));var uploaderUrl=this._tfp.setUrlAuthData(uploaderUrl),that=this,form=new FormData;form.append("file",fileObj);var xhr=new XMLHttpRequest;xhr.open("post",uploaderUrl,!0),xhr.onload=function(){var response=null;try{response=JSON.parse(xhr.responseText)}catch(e){return that._tfp.showMsg("文件["+fileName+"]上传失败,错误描述:"+e.message),iptFile.parent().hide(),void iptFile.parent().remove()}if(0!=response.code)return that._tfp.showMsg("文件["+fileName+"]上传失败,错误描述:"+response.message),iptFile.parent().hide(),void iptFile.parent().remove();that.dataModel.allowDelete&&("PhotoUpload"==that.type?iptFile.parent().append('<p align="center"><a href="javascript:void(0)">删除</a></p>'):iptFile.parent().find(".tfp-fileupload-fileinfo").append(' <a href="javascript:void(0)">删除</a>'),iptFile.parent().find("a").click(function(){that.deleteFile(this,response.path)}));var file={};file.name=fileName,response.fileId&&(file.id=response.fileId),response.fileCode?file.code=response.fileCode:file.code=response.path,response.fileSize?file.size=response.fileSize:file.size=response.size,file.path=filePath,that.files||(that.files=[]),that.files.push(file),iptFile.parent().find("progress").parent().remove(),iptFile.remove(),that.onChange&&eval(that.onChange)},xhr.upload.fileInput=iptFile,xhr.upload.addEventListener("progress",this.onUploaderProgressChange,!1),xhr.send(form)}},{key:"deleteFile",value:function(e,t){if(this.files){for(var n=-1,i=0;i<this.files.length;i++)if(this.files[i].code==t){n=i;break}0<=n&&this.files.splice(n,1)}$(e).parent().parent().remove()}},{key:"onUploaderProgressChange",value:function(e){var t=e.srcElement.fileInput,n=t.parent().find("progress").get(0),t=t.parent().find(".uploaderPercent").get(0);e.lengthComputable&&(n.max=e.total,n.value=e.loaded,t.innerHTML=Math.round(e.loaded/e.total*100)+"%")}},{key:"initRuntime",value:function(){var e=this;this._jqObj.find(".tfp-fileupload-row").eq(0).find("input").click(function(){e.selectFile()})}}]),FileUpload}(_controller.FormInput);exports.default=FileUpload},{"../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}],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 a=i(e("@babel/runtime/helpers/classCallCheck")),o=i(e("@babel/runtime/helpers/createClass")),s=i(e("@babel/runtime/helpers/inherits")),r=i(e("@babel/runtime/helpers/possibleConstructorReturn")),l=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,l.default)(n);return t=i?(e=(0,l.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,r.default)(this,t)}}e=function(e){(0,s.default)(r,e);var i=u(r);function r(e,t,n){return(0,a.default)(this,r),i.call(this,e,"Label",t,n)}return(0,o.default)(r,[{key:"value",get:function(){return this.dataModel.value||""},set:function(e){this.dataModel.value=e,this._jqObj&&(this._jqObj.text(e),this.exeEventHandler("onChange"))}},{key:"dataBindingFormat",get:function(){return this.dataModel.dataBindingFormat},set:function(e){this.dataModel.dataBindingFormat=e}}]),r}(e("../controller.js").VisibleComponent);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")),_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 r=0;r