antd-form-document 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.tsx CHANGED
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/classCallCheck";import r from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/assertThisInitialized";import i from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"@babel/runtime/helpers/defineProperty";import{jsx as c,Fragment as u,jsxs as s}from"react/jsx-runtime";import f,{PureComponent as p,useEffect as d,useRef as h,useMemo as y,memo as v,useState as m}from"react";import{Form as g,Space as b,Image as O,Input as w,InputNumber as j,Select as P,Checkbox as k,Radio as S,Switch as C,DatePicker as x,TimePicker as R,message as D,Upload as I,Button as L,Modal as V,Progress as E,Card as B,Table as T,Row as F,Col as A,Steps as N,Layout as M,Divider as U,Skeleton as q}from"antd";import{parseInt as z,uniqueId as _,cloneDeep as W,camelCase as G,find as H,every as $,some as Y,concat as K,mapValues as J,isBoolean as Q,isArray as X,isObject as Z}from"lodash";import ee from"@babel/runtime/helpers/objectWithoutProperties";import te from"@babel/runtime/helpers/asyncToGenerator";import re from"@babel/runtime/regenerator";import ne from"moment";import{extend as ie}from"umi-request";import{parse as oe,compile as le}from"path-to-regexp";import ae from"wangeditor-for-react";import ce from"number-format.js";import ue from"dayjs";import se from"dayjs/plugin/weekday";import fe from"dayjs/plugin/localeData";import pe from"dayjs/plugin/customParseFormat";import de from"@babel/runtime/helpers/toConsumableArray";import{UploadOutlined as he,PlusOutlined as ye,QuestionCircleOutlined as ve,UpOutlined as me,DownOutlined as ge}from"@ant-design/icons";import be from"bytes";import Oe from"antd-img-crop";import we from"file-block-upload";import je from"@babel/runtime/helpers/objectDestructuringEmpty";import Pe from"@babel/runtime/helpers/extends";function ke(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Se(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Se(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==r.return||r.return()}finally{if(a)throw o}}}}function Se(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ce=function(){function e(r){t(this,e),a(this,"attributes",{}),this.id=_();var n,i=ke(r.attributes);try{for(i.s();!(n=i.n()).done;){var o=n.value,l=o.value.trim();this.isBoolean(l)&&(l=this.toBoolean(l)),this.attributes[o.name]=l}}catch(e){i.e(e)}finally{i.f()}this.children=new Array;var c,u=ke(r.childNodes);try{for(u.s();!(c=u.n()).done;){var s,f,p=c.value;if(p instanceof Element)null===(s=this.children)||void 0===s||s.push(new e(p));if(3===p.nodeType&&p.textContent&&(this.text=p.textContent),4===p.nodeType)this.cdata=null===(f=p.nodeValue)||void 0===f?void 0:f.replace(/\ +/g," ").replace(/[\t\r\n]/g,"")}}catch(e){u.e(e)}finally{u.f()}this.tag=r.nodeName}return r(e,[{key:"isBoolean",value:function(e){return"true"===e||"false"===e}},{key:"toBoolean",value:function(e){return"true"===e}},{key:"isNumber",value:function(e){return/^\d+$/.test(e)}},{key:"toNumber",value:function(e){return z(e,10)}}]),e}(),xe=function(){function e(){t(this,e)}return r(e,null,[{key:"parser",value:function(e){var t=e.childNodes[0];return new Ce(t)}},{key:"toDocument",value:function(e){return(new DOMParser).parseFromString(e,"text/xml")}},{key:"getRoot",value:function(t){var r=e.toDocument(t);return e.parser(r)}},{key:"selector",value:function(e,t){return e.querySelector(t)}},{key:"selectors",value:function(e,t){return e.querySelectorAll(t)}}]),e}();function Re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function De(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ie=function(e){var t=e.type,r=void 0===t?"string":t,n=e.required,i=e.minlength,o=e.maxlength,l=e.min,a=e.max,c=e.pattern,u=e.message;return n?{type:r,required:n,message:u}:i&&o?{type:r,min:Number(i),max:Number(o),message:u}:l&&a?{type:r,min:Number(l),max:Number(a),message:u}:"phone"===r?{type:"regexp",pattern:new RegExp("^[1][3,5,7,8][0-9]\\d{8}$"),message:u}:"regexp"===r&&"string"==typeof c?{type:r,pattern:new RegExp(c),message:u}:{type:r,message:u}},Le=f.createContext({});function Ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Be=function(){function e(r){if(t(this,e),a(this,"request",{prefix:"api",headers:{},params:{}}),a(this,"file",{listUrl:"/file/list",downloadUrl:"/file/download",uploadUrl:"/file/upload",extraData:function(e,t){}}),a(this,"style",{labelStyle:{color:"#055ab5"}}),a(this,"form",{documentUrl:"/form/:formId"}),a(this,"chunk",{chunkSize:10*Math.pow(1024,2),checkFile:"/chunk/checkFile",checkChunk:"/chunk/checkChunk",chunkUpload:"/chunk/chunkUpload",doMerge:"/chunk/doMerge",mergeProgress:"/chunk/mergeProgress",onComplete:"/chunk/onComplete",completeProgress:"/chunk/completeProgress"}),r){var n=r.request,i=r.file,o=r.form,l=r.chunk,c=r.components;this.request=Ee(Ee({},this.request),n),this.file=Ee(Ee({},this.file),i),this.form=Ee(Ee({},this.form),o),this.chunk=Ee(Ee({},this.chunk),l),this.components=c}}return r(e,null,[{key:"init",value:function(t){return new e(t)}}]),e}(),Te=Be.init(),Fe=function(e){Te=Be.init(e)},Ae=0,Ne=[],Me=function(){var e=te(re.mark((function e(t){var r,n;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===Ae)for(r=0,n=Ne;r<n.length;r++)(0,n[r])(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ue=function(){var e=te(re.mark((function e(){return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==Ae++&&Me(!0);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=te(re.mark((function e(){return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==--Ae&&Me(!1);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ze=function(){var e=te(re.mark((function e(){return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ae=0,Me(!1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_e=["status"];function We(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Ge=ie({prefix:Te.request.prefix,timeout:1e4});Ge.use(function(){var e=te(re.mark((function e(t,r){return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Ue(),e.next=4,r();case 4:qe(),e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(0),ze(),e.t0;case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,r){return e.apply(this,arguments)}}(),{global:!0});var He=function(t,r){var n=W(r.data),i=t;try{var o="",l=i.match(/[a-zA-z]+:\/\/[^/]*/);if(l)o=e(l,1)[0],i=i.slice(o.length);var c=oe(i);i=le(i)(r.data),c.forEach((function(e){e instanceof Object&&e.name in n&&delete n[e.name]})),i=o+i}catch(e){console.error(e.message)}return"GET"===r.method.toLocaleUpperCase()?r.params=n:r.type&&(r.requestType=r.type),r.prefix=Te.request.prefix,Ge(i,r).then((function(e){var t=e.status,r=ee(e,_e),n=200===t;return Promise.resolve(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?We(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):We(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({success:n},r))})).catch((function(e){var t,r=e.response,n=e.data,o=null!==(t=null==n?void 0:n.message)&&void 0!==t?t:"访问超时";return console.error(i,r,n),Promise.resolve({success:!1,message:o})}))},$e=function(t){var r="GET",n="json",i=t,o=t.split(" ");if(2===o.length){var l=e(o,2);r=l[0],i=l[1]}else if(3===o.length){var a=e(o,3);r=a[0],n=a[1],i=a[2]}return function(e){return He(i,{method:r,type:n,data:e})}},Ye=function(t){var r={};t&&t.replace(/\ +/g,"").split(";").forEach((function(t){if(t){var n=t.split(":"),i=e(n,2),o=i[0],l=i[1];Object.assign(r,a({},G(o),l))}}));return r};function Ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Qe(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Xe=function(o){i(u,o);var l=Qe(u);function u(){var r;t(this,u);for(var i=arguments.length,o=new Array(i),c=0;c<i;c++)o[c]=arguments[c];return r=l.call.apply(l,[this].concat(o)),a(n(r),"styleWrapper",{style:{borderBottom:"1px solid #d9d9d9"}}),a(n(r),"request",function(){var t=te(re.mark((function t(n,i){var o;return re.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=null!=i?i:r.context.params,t.abrupt("return",$e(n)(Je({},o)).then((function(t){var r=t.success,n=t.data;if(r){if(Array.isArray(n)){var i=n.map((function(t){var r,n=null===(r=Object.entries(t))||void 0===r?void 0:r[0],i=e(n,2);return{key:i[0],label:i[1]}}));return Promise.resolve(i)}return Promise.resolve(n)}return Promise.reject(void 0)})).catch((function(e){return console.error("remote",n,e),Promise.reject(e)})));case 2:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()),r}return r(u,[{key:"setDefaultValue",value:function(e){var t=this.context.form;if(t){var r,n,i=this.props.code;if(!(null===(r=t.current)||void 0===r?void 0:r.getFieldValue(i)))null===(n=t.current)||void 0===n||n.setFieldValue(i,e)}}},{key:"setFieldValue",value:function(e){var t=this.context.form;if(t){var r,n=this.props.code;null===(r=t.current)||void 0===r||r.setFieldValue(n,e)}}},{key:"cleanFieldValue",value:function(){var e=this;setTimeout((function(){e.setFieldValue(void 0)}),1)}},{key:"getFieldValue",value:function(){var e=this.context.form;if(e){var t,r=this.props.code;return null===(t=e.current)||void 0===t?void 0:t.getFieldValue(r)}}},{key:"getFieldsValue",value:function(){var e,t=this.context.form;if(t)return null===(e=t.current)||void 0===e?void 0:e.getFieldsValue()}},{key:"getLabel",value:function(){if(this.context.showTitle){var e=this.props,t=e.title,r=e.labelStyle,n=Ye(r);return c("span",{style:Je(Je({},Te.style.labelStyle),n),children:t})}}},{key:"getItem",value:function(){var e,t,r=this.props,n=r.preview,i=r.labelCol,o=r.wrapperCol,l=r.tips,a=i&&o?{labelCol:{span:i},wrapperCol:{span:o}}:{};n?(e={required:!1},Object.assign(null!==(t=a.wrapperCol)&&void 0!==t?t:{},this.styleWrapper)):e={tooltip:l};return{itemProps:e,itemLayouts:a}}},{key:"getStyles",value:function(){var e=this.props,t=e.style,r=e.itemStyle;return{styles:Ye(t),itemStyles:Ye(r)}}},{key:"display",value:function(){var e,t=null!==(e=this.context.preview)&&void 0!==e&&e,r=this.getFieldsValue(),n=this.props,i=n.defaultHide,o=void 0!==i&&i,l=n.children,a=!o,c=H(l,{tag:"Conditions"});if(c){var u,s=c.type,f=c.action,p=null===(u=c.children)||void 0===u?void 0:u.map(function(e,t){return function(r){var n=r.test;try{if(e){e=De(De({},e),{},{preview:t});var i=Object.keys(e).join(",");return new Function("{".concat(i,"}"),"return ".concat(n))(e)}}catch(e){}}}(r,t));if((null==p?void 0:p.length)>0&&void 0!==(null==p?void 0:p[0])){var d=!1;if((d="and"===s?$(p):Y(p))&&"hide"===f||!d&&"show"===f)return!1;if(!d&&"hide"===f||d&&"show"===f)return!0}}return a}},{key:"rules",value:function(){var e=this.props,t=e.preview,r=e.children;if(!t){var n,i,o=H(r,{tag:"Validates"});return null!==(n=null==o||null===(i=o.children)||void 0===i?void 0:i.map(Ie))&&void 0!==n?n:[]}return[]}},{key:"collectionList",value:function(){var e=H(this.props.children,{tag:"Collection"});if(e)return function(e,t){var r=t.cdata;try{if(e){var n=Object.keys(e).join(",");return new Function("{".concat(n,"}"),"".concat(r))(e)}return new Function("".concat(r))()}catch(e){}return[]}(this.getFieldsValue(),e)}},{key:"onComputeValue",value:function(){var e=this,t=H(this.props.children,{tag:"Compute"});if(t){var r=function(e,t){var r=t.cdata;try{if(e){var n=Object.keys(e).join(",");return new Function("{".concat(n,"}"),"moment","".concat(r))(e,ne)}return new Function("moment","".concat(r))(ne)}catch(e){}}(this.getFieldsValue(),t);r&&setTimeout((function(){e.setFieldValue(r)}),1)}}},{key:"initValue",value:function(e){var t=this.props.defaultValue,r=void 0===t?e:t;r&&this.setDefaultValue(r)}}]),u}(f.PureComponent);Xe.contextType=Le;var Ze=["Component","defaultValue","style"];function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?et(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var nt=function(e){i(l,Xe);var o=rt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"initValue",(function(){var t=e.props.defaultValue;t&&e.forceUpdate((function(){e.setDefaultValue(t)}))})),a(n(e),"onChange",(function(t){e.setFieldValue(t)})),e}return r(l,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.hidden,a=this.props,s=a.Component;a.defaultValue,a.style;var f=ee(a,Ze),p=this.getStyles(),d=p.styles,h=p.itemStyles;return c(g.Item,tt(tt(tt({name:o,label:this.getLabel(),style:h,hidden:l,rules:e},r),n),{},{children:c(s,tt(tt({},f),{},{style:d,onChange:this.onChange}))}))}return c(u,{})}}]),l}();function it(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function lt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var at=function(e){i(l,Xe);var o=lt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"getList",(function(e,t,r){if(t){var n=e.filter((function(e){var r=e.key;return t.includes(r)}));return r(n),n}return e})),e}return r(l,[{key:"optionList",value:function(){var e=H(this.props.children,{tag:"Options"});return null==e?void 0:e.children}},{key:"plusRules",value:function(){var e=this.rules();return null==e?void 0:e.map((function(e){if(e.required){return ot(ot({},e),{},{validator:function(e,t){return(null==t?void 0:t.length)>0?Promise.resolve():Promise.reject()}})}if(e.min&&e.max){return ot(ot({},e),{},{validator:function(t,r){return r.length>=e.min&&r.length<=e.max?Promise.resolve():Promise.reject()}})}return ot({},e)}))}}]),l}();function ct(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var ut=function(e){i(o,p);var n=ct(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o)}();function st(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var ft=function(e){i(o,Xe);var n=st(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){if(this.display()){var e=this.rules(),t=this.props,r=t.title,n=t.hidden,i=this.getStyles(),o=i.styles,l=i.itemStyles;return c(g.Item,{style:l,hidden:n,rules:n?[]:e,wrapperCol:{span:24},children:c("div",{style:o,children:r})})}return c(u,{})}}]),o}();function pt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var dt=function(e){i(o,Xe);var n=pt(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){var e=this.display(),t=this.props.preview;if(e&&!t){var r=this.props,n=r.title,i=r.hidden,o=r.children,l=this.getStyles(),a=l.styles,s=l.itemStyles;return c(g.Item,{style:s,hidden:i,wrapperCol:{span:24},children:c("div",{style:a,children:null!=n?n:o})})}return c(u,{})}}]),o}(),ht=function(e){var t=e.value,r=e.type,n=e.style,i=e.onChange;return d((function(){null==i||i(t)}),[]),c("div",t&&"url"===r?{style:n,children:c("a",{href:t,target:"_blank",rel:"noreferrer",children:t})}:{style:n,children:t})},yt=function(t){var r=t.value,n=t.style,i=t.onChange;if(d((function(){i(r)}),[]),r){var o=null==r?void 0:r.split(":"),l=e(o,3),a=l[0],u=l[1],s=l[2];return c("div",{style:n,children:"".concat(a,"小时").concat(u,"分").concat(s,"秒")})}return c("div",{style:n,children:"000时00分00秒"})},vt=function(e){var t=e.checked,r=e.style,n=e.onChange;return d((function(){n(t)}),[]),c("div",{style:r,children:t?"开启":"关闭"})},mt=function(e){var t=e.value,r=e.list,n=e.style,i=e.onChange;if(d((function(){i(t)}),[]),Array.isArray(t)){var o=r.filter((function(e){var r=e.key;return t.includes(r)})).map((function(e){return e.label}));return c("div",{style:n,children:null==o?void 0:o.join()})}var l=null==r?void 0:r.find((function(e){return e.key===t}));return c("div",{style:n,children:null==l?void 0:l.label})},gt=function(e){var t=e.fileList,r=Te.request.prefix+Te.file.downloadUrl;return c(u,{children:null==t?void 0:t.map((function(e){var t=e.id,n=e.name,i=e.url,o=e.contentType,l=r+"/"+t;return null!=o&&o.endsWith("pdf")?c("div",{children:s(b,{style:{paddingBottom:10},children:[c("a",{href:i,target:"_blank",rel:"noreferrer",children:n}),c("a",{href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=o&&o.startsWith("image")?c("div",{children:s(b,{style:{paddingBottom:10},children:[c(O,{width:200,src:i,alt:n}),c("a",{href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=o&&o.startsWith("video")?c("div",{children:s(b,{style:{paddingBottom:10},children:[c("video",{src:i,controls:!0,style:{width:260},children:"当前浏览器不支持视频播放,请使用最新版谷歌浏览器!"}),c("a",{href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=o&&o.startsWith("audio")?c("div",{children:s("div",{style:{paddingBottom:10,display:"flex",alignItems:"center"},children:[c("audio",{src:i,controls:!0,style:{width:"calc(100% - 40px)",height:30},children:"当前浏览器不支持音频播放,请使用最新版谷歌浏览器!"}),c("a",{style:{paddingLeft:10},href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=n&&n.endsWith(".doc")||null!=n&&n.endsWith(".docx")||null!=n&&n.endsWith(".xls")||null!=n&&n.endsWith(".xlsx")||null!=n&&n.endsWith(".ppt")||null!=n&&n.endsWith(".pptx")?c("div",{children:s(b,{style:{paddingBottom:10},children:[c("a",{href:"http://view.officeapps.live.com/op/view.aspx?src="+i,target:"_blank",rel:"noreferrer",children:n}),c("a",{href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):c("div",{children:s(b,{style:{paddingBottom:10},children:[c("a",{href:i,target:"_blank",rel:"noreferrer",children:n}),c("a",{href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},bt=function(e){var t=e.fileList,r=e.width,n=e.height,i=e.style;return c(u,{children:null==t?void 0:t.map((function(e){var t=e.id,o=e.name,l=e.url;return c("div",{style:i,children:s(b,{style:{paddingBottom:10},children:[c(O,{width:r,height:n,src:l,alt:o}),c("a",{href:Te.request.prefix+Te.file.downloadUrl+"/"+t,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})};function Ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Pt=function(e){i(o,Xe);var n=jt(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.type,a=i.preview,s=i.placeholder,f=i.maxLength,p=i.allowClear,d=i.showCount,h=i.readonly,y=i.hidden,v=this.getStyles(),m=v.styles,b=v.itemStyles;return c(g.Item,wt(wt(wt({name:o,label:this.getLabel(),style:b,hidden:y,rules:e},r),n),{},{children:a?c(ht,{type:l,style:m}):c(w,{maxLength:f,placeholder:s,allowClear:p,showCount:d,disabled:h,style:m})}))}return c(u,{})}}]),o}();function kt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function St(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ct(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var xt=function(e){i(o,Xe);var n=Ct(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.props,r=t.code,n=t.preview,i=t.placeholder,o=t.maxLength,l=t.allowClear,a=t.showCount,s=t.readonly,f=t.hidden,p=this.getItem(),d=p.itemProps,h=p.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return c(g.Item,St(St(St({name:r,label:this.getLabel(),style:m,hidden:f,rules:f?[]:e},d),h),{},{children:n?c(ht,{style:v}):c(w.TextArea,{maxLength:o,placeholder:i,allowClear:l,showCount:a,disabled:s,style:v})}))}return c(u,{})}}]),o}();function Rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function It(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Lt=function(e){i(o,Xe);var n=It(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){var e=this.props,t=e.type,r=void 0===t?"number":t,n=e.precision,i={};"digits"===r?i=n?{precision:Number(n)}:{precision:2}:"money"===r?i={formatter:function(e){return"¥ ".concat(e).replace(/\B(?=(\d{3})+(?!\d))/g,",")},parser:function(e){return e.replace(/\$\s?|(,*)/g,"")}}:"percentage"===r&&(i={formatter:function(e){return"".concat(e,"%")},parser:function(e){return e.replace("%","")}}),this.onComputeValue();var o=this.rules().map((function(e){return e.required?Dt(Dt({},e),{},{type:"integer"}):e})),l=this.getItem(),a=l.itemProps,s=l.itemLayouts,f=this.props,p=f.code,d=f.preview,h=f.min,y=f.max,v=f.readonly,m=f.hidden,b=this.getStyles(),O=b.styles,w=b.itemStyles;return c(g.Item,Dt(Dt(Dt({name:p,label:this.getLabel(),style:w,hidden:m,rules:m?[]:o},a),s),{},{children:d?c(ht,{style:O}):c(j,Dt(Dt({min:h,max:y,disabled:v},i),{},{style:O}))}))}return c(u,{})}}]),o}();function Vt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Bt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Tt=function(e){i(o,Xe);var n=Bt(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.title,a=i.preview,s=i.placeholder,f=i.hidden,p=i.readonly,d=this.getStyles(),h=d.styles,y=d.itemStyles;return c(g.Item,Et(Et(Et({name:o,label:this.getLabel(),style:y,hidden:f,colon:!!l,rules:f?[]:e},r),n),{},{children:a||p?c(ht,{style:h}):c(Ft,{placeholder:s,style:h})}))}return c(u,{})}}]),o}(),Ft=function(e){i(l,e);var o=Bt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"isReactWEditor",!1),a(n(e),"editorRef",f.createRef()),e}return r(l,[{key:"shouldComponentUpdate",value:function(){return!this.isReactWEditor}},{key:"render",value:function(){var e=this,t=this.props,r=t.value,n=t.placeholder,i=t.style,o=t.onChange;return c(ae,{placeholder:n,value:r,style:i,onBlur:function(){e.isReactWEditor=!1},onFocus:function(){e.isReactWEditor=!0},onChange:function(e){null==o||o(e)}})}}]),l}(f.Component);function At(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?At(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Mt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Ut=function(e){i(l,at);var o=Mt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"state",{list:[]}),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();r?this.setState({list:r},this.initValue):t&&t.trim().length>0&&this.request(t).then((function(t){e.setState({list:t},e.initValue)}))}},{key:"initValue",value:function(){var e=this.props,t=e.defaultValue,r=e.multiple;t&&(r?this.setDefaultValue([t]):this.setDefaultValue(t))}},{key:"render",value:function(){var e=this;if(this.display()){this.onComputeValue();var t=this.props,r=t.code,n=t.preview,i=t.multiple,o=t.placeholder,l=t.allowClear,a=void 0===l||l,s=t.readonly,f=t.hidden,p=i?this.plusRules():this.rules(),d=this.collectionList(),h=this.getList(this.state.list,d,(function(t){if(t.length>0){var r=e.getFieldValue();r&&(!i&&!t.some((function(e){return e.key===r}))||i&&!t.some((function(e){return r.includes(e.key)})))&&e.cleanFieldValue()}})),y=this.getItem(),v=y.itemProps,m=y.itemLayouts,b=this.getStyles(),O=b.styles,w=b.itemStyles;return c(g.Item,Nt(Nt(Nt({name:r,label:this.getLabel(),style:w,hidden:f,rules:f?[]:p},v),m),{},{children:n?c(mt,{list:this.state.list,style:O}):c(zt,{list:h,multiple:i,placeholder:o,allowClear:a,readonly:s,style:O})}))}return c(u,{})}}]),l}(),qt=P.Option,zt=function(e){i(l,ut);var o=Mt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"handleItemValue",(function(t){var r,n;null===(r=(n=e.props).onChange)||void 0===r||r.call(n,t)})),e}return r(l,[{key:"render",value:function(){var e=this.props,t=e.list,r=e.value,n=e.multiple,i=e.placeholder,o=e.allowClear,l=e.readonly,a=e.style;return c(P,{showSearch:!0,placeholder:i,mode:n?"multiple":void 0,disabled:l,value:r,allowClear:o,style:a,onChange:this.handleItemValue,filterOption:function(e,t){return t.children.toLowerCase().includes(e.toLowerCase())},children:t&&t.map((function(e){var t=e.key,r=e.label;return c(qt,{value:t,children:r},t)}))})}}]),l}();function _t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_t(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Ht=function(e){i(l,at);var o=Gt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"state",{list:[]}),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();r?this.setState({list:r},this.initValue):t&&t.trim().length>0&&this.request(t).then((function(t){e.setState({list:t},e.initValue)}))}},{key:"render",value:function(){var e=this;if(this.display()){this.onComputeValue();var t=this.plusRules(),r=this.collectionList(),n=this.getList(this.state.list,r,(function(t){if(t.length>0){var r=e.getFieldValue();r&&!t.some((function(e){return r.includes(e.key)}))&&e.cleanFieldValue()}})),i=this.props,o=i.code,l=i.preview,a=i.readonly,u=i.hidden,s=this.getItem(),f=s.itemProps,p=s.itemLayouts,d=this.getStyles(),h=d.styles,y=d.itemStyles;return c(g.Item,Wt(Wt(Wt({name:o,label:this.getLabel(),style:y,hidden:u,rules:u?[]:t},f),p),{},{children:l?c(mt,{list:this.state.list,style:h}):c($t,{list:n,readonly:a,style:h})}))}return null}}]),l}(),$t=function(e){i(o,ut);var n=Gt(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.list,n=e.readonly,i=e.style,o=e.onChange;return c(k.Group,{style:i,value:t,onChange:function(e){null==o||o(e)},children:r&&r.map((function(e){var t=e.key,r=e.label;return c(k,{value:t,disabled:n,children:r},t)}))})}}]),o}();function Yt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Jt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Qt=function(e){i(l,at);var o=Jt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"state",{list:[]}),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();r?this.setState({list:r},this.initValue):t&&t.trim().length>0&&this.request(t).then((function(t){e.setState({list:t},e.initValue)}))}},{key:"render",value:function(){var e=this;if(this.display()){this.onComputeValue();var t=this.rules(),r=this.collectionList(),n=this.getList(this.state.list,r,(function(t){if(t.length>0){var r=e.getFieldValue();r&&!t.some((function(e){return r.includes(e.key)}))&&e.cleanFieldValue()}})),i=this.props,o=i.code,l=i.preview,a=i.optionType,s=i.readonly,f=i.hidden,p=this.getItem(),d=p.itemProps,h=p.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return c(g.Item,Kt(Kt(Kt({name:o,label:this.getLabel(),style:m,hidden:f,rules:f?[]:t},d),h),{},{children:l?c(mt,{list:n,style:v}):c(Xt,{list:this.state.list,optionType:a,readonly:s,style:v})}))}return c(u,{})}}]),l}(),Xt=function(e){i(o,ut);var n=Jt(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.list,n=e.optionType,i=e.readonly,o=e.style,l=e.onChange;return c(S.Group,{value:t,optionType:n,style:o,onChange:function(e){null==l||l(e.target.value)},children:r&&r.map((function(e){var t=e.key,r=e.label;return c(S,{value:t,disabled:i,children:r},t)}))})}}]),o}();function Zt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tr(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var rr=function(e){i(o,Xe);var n=tr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.props,r=t.code,n=t.preview,i=t.readonly,o=t.hidden,l=this.getItem(),a=l.itemProps,s=l.itemLayouts,f=this.getStyles(),p=f.styles,d=f.itemStyles;return c(g.Item,er(er(er({label:this.getLabel(),name:r,style:d,hidden:o,rules:o?[]:e,valuePropName:"checked"},a),s),{},{children:n?c(vt,{style:p}):c(C,{disabled:i,style:p})}))}return c(u,{})}}]),o}();function nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ir(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function or(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".duration > .ant-form-item {\r\n display: inline-block;\r\n vertical-align: middle;\r\n margin-bottom: 0;\r\n width: 20%;\r\n}\r\n\r\n.duration > .ant-form-item:first-child {\r\n width: 30%;\r\n}\r\n\r\n.duration > span {\r\n padding: 5px; \r\n vertical-align: middle;\r\n}");var lr=function(e){i(o,Xe);var n=or(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue("000:00:00")}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.preview,a=i.readonly,s=i.hidden,f=this.getStyles(),p=f.styles,d=f.itemStyles;return c(g.Item,ir(ir(ir({name:o,label:this.getLabel(),style:d,hidden:s,rules:s?[]:e},r),n),{},{children:l?c(yt,{style:p}):c(ar,{readonly:a,style:p})}))}return c(u,{})}}]),o}(),ar=function(e){i(l,ut);var o=or(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"duration",[0,0,0]),a(n(e),"changeValue",(function(t){return function(r){if("number"==typeof r){var n,i;e.duration[t]=r;var o=e.duration.map((function(e,t){return ce(0===t?"000":"00",e)}));null===(n=(i=e.props).onChange)||void 0===n||n.call(i,o.join(":"))}}})),e}return r(l,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.readonly,n=e.style;return"string"==typeof t&&(this.duration=t.split(":").map(Number)),s("div",{className:"duration",children:[c(g.Item,{children:c(j,{style:ir({width:"100%"},n),min:0,max:999,precision:0,value:this.duration[0],formatter:function(e){return e<100?e<10?"00"+e:"0"+e:e.toString()},onChange:this.changeValue(0),controls:!1,disabled:r})}),c("span",{children:"小时"}),c(g.Item,{children:c(j,{style:ir({width:"100%"},n),min:0,max:59,precision:0,value:this.duration[1],formatter:function(e){return e<10?"0"+e:e.toString()},onChange:this.changeValue(1),controls:!1,disabled:r})}),c("span",{children:"分"}),c(g.Item,{children:c(j,{style:ir({width:"100%"},n),min:0,max:59,precision:0,value:this.duration[2],formatter:function(e){return e<10?"0"+e:e.toString()},onChange:this.changeValue(2),controls:!1,disabled:r})}),c("span",{children:"秒"})]})}}]),l}();function cr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ur(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function sr(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}ue.extend(se),ue.extend(fe);var fr=function(e){i(o,Xe);var n=sr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.type,a=void 0===l?"date":l,s=i.format,f=void 0===s?"YYYY-MM-DD":s,p=i.showTime,d=void 0!==p&&p,h=i.preview,y=i.placeholder,v=i.allowClear,m=void 0===v||v,b=i.readonly,O=i.hidden,w=this.getStyles(),j=w.styles,P=w.itemStyles;return c(g.Item,ur(ur(ur({name:o,label:this.getLabel(),style:P,hidden:O,rules:O?[]:e},r),n),{},{children:h?c(ht,{style:j}):c(pr,{type:a,format:f,showTime:d,placeholder:y,allowClear:m,readonly:b,style:j})}))}return c(u,{})}}]),o}(),pr=function(e){i(o,ut);var n=sr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.type,n=e.format,i=e.showTime,o=e.placeholder,l=e.allowClear,a=e.readonly,u=e.style,s=e.onChange;return c(x,{value:t?ue(t,n):void 0,picker:r,format:n,showTime:i?{format:"HH:mm"}:void 0,placeholder:o,allowClear:l,disabled:a,style:u,onChange:function(e){null==s||s(null==e?void 0:e.format(n))}})}}]),o}();function dr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function yr(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}ue.extend(pe);var vr=function(e){i(o,Xe);var n=yr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.format,a=void 0===l?"HH:mm:ss":l,s=i.preview,f=i.placeholder,p=i.allowClear,d=void 0===p||p,h=i.readonly,y=i.hidden,v=this.getStyles(),m=v.styles,b=v.itemStyles;return c(g.Item,hr(hr(hr({name:o,label:this.getLabel(),style:b,hidden:y,rules:y?[]:e},r),n),{},{children:s?c(ht,{style:m}):c(mr,{format:a,placeholder:f,allowClear:d,readonly:h,style:m})}))}return c(u,{})}}]),o}(),mr=function(e){i(o,ut);var n=yr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.format,n=e.placeholder,i=e.allowClear,o=e.readonly,l=e.style,a=e.onChange;return c(R,{value:t?ue(t,r):void 0,format:r,placeholder:n,allowClear:i,disabled:o,style:l,onChange:function(e){null==a||a(null==e?void 0:e.format(r))}})}}]),o}();function gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Or(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var wr=function(e){return Array.isArray(e)?e:e&&e.list},jr=function(e){i(o,at);var n=Or(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,i=t.maxCount,o=t.fileType,l=t.fileTypeMessage,a=t.fileSize,s=t.readonly,f=t.hidden,p=this.getItem(),d=p.itemProps,h=p.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return c(g.Item,br(br(br({name:r,label:this.getLabel(),style:m,hidden:f,rules:f?[]:e,valuePropName:"list",getValueFromEvent:wr},d),h),{},{children:c(Pr,{maxCount:i,fileType:o,fileTypeMessage:l,fileSize:a,readonly:s,preview:n,style:v})}))}return c(u,{})}}]),o}(),Pr=function(e){i(l,ut);var o=Or(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"uploading",!1),a(n(e),"state",{fileList:[],modal:{open:!1,progress:0}}),a(n(e),"onBeforeUpload",(function(t){var r=e.props,n=r.fileSize,i=r.fileType,o=r.fileTypeMessage,l=null==i?void 0:i.replace(/\ +/g,"").split(",");if(!(l&&l.length>0))return D.error("文件类型不匹配!"),I.LIST_IGNORE;if(!l.includes(t.type))return D.error(o),I.LIST_IGNORE;if(n&&be.parse(n)<t.size)return D.error("上传的文件大小,不能超过 ".concat(n,"!")),I.LIST_IGNORE;return!0})),a(n(e),"onStart",(function(){clearInterval(e.timer),e.setState({modal:{open:!0,progress:0}}),e.uploading=!0})),a(n(e),"onProgress",(function(t){if(e.uploading){var r=Math.round(t.percent/2);if(e.setState({modal:{open:!0,progress:r}}),50===r){var n=r;clearInterval(e.timer),e.timer=setInterval((function(){e.uploading?e.setState({modal:{open:!0,progress:++n}}):(clearInterval(e.timer),e.setState({modal:{open:!1,progress:0}})),99===n&&clearInterval(e.timer)}),1e3)}}})),a(n(e),"onSuccess",(function(t,r){clearInterval(e.timer);var n=t.data,i=n.id,o=n.url;r.status="done",r.response=t,r.id=i,r.url=o;var l=[].concat(de(e.state.fileList),[r]);e.setState({fileList:l,modal:{open:!0,progress:100}},(function(){e.onChange(l),setTimeout((function(){e.setState({modal:{open:!1,progress:0}})}),500)})),e.uploading=!1})),a(n(e),"onError",(function(t,r,n){var i;clearInterval(e.timer);var o=[].concat(de(e.state.fileList),[n]);n.status="error",n.response=null!==(i=null==r?void 0:r.message)&&void 0!==i?i:"上传失败",e.setState({fileList:o,modal:{open:!1,progress:100}},(function(){e.onChange(o)})),e.uploading=!1})),a(n(e),"onRemove",(function(t){var r=e.state.fileList.filter((function(e){return e.id!==t.id}));e.setState({fileList:r},(function(){e.onChange(r)}))})),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Te.file.listUrl;t&&(null==t?void 0:t.length)>0&&t[0]&&$e(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return br(br({},e),{},{status:"done"})}));e.setState({fileList:r},(function(){e.onChange(r)}))})).catch((function(e){console.warn("url",r,e)}))}},{key:"onChange",value:function(e){var t,r;null===(t=(r=this.props).onChange)||void 0===t||t.call(r,e.filter((function(e){var t=e.id,r=e.status;return t&&"done"===r})).map((function(e){return e.id})))}},{key:"render",value:function(){var e=this.state,t=e.fileList,r=e.modal,n=this.props,i=n.preview,o=n.maxCount,l=n.readonly,a=n.style,f=o?Number(o):0;if(i)return c(gt,{fileList:t});var p={onStart:this.onStart,onSuccess:this.onSuccess,onProgress:this.onProgress,onError:this.onError};return s(u,{children:[c(I,br(br({action:Te.request.prefix+Te.file.uploadUrl,fileList:t,maxCount:f,disabled:l,beforeUpload:this.onBeforeUpload,onRemove:this.onRemove},p),{},{children:c(L,{disabled:l||f<=t.length,icon:c(he,{}),style:a,children:"上传"})})),s(V,{open:r.open,closable:!1,footer:null,children:[c("div",{children:"上传文件进度"}),c(E,{percent:r.progress})]})]})}}]),l}();function kr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Cr(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var xr=function(e){return Array.isArray(e)?e:e&&e.list},Rr=["image/jpeg","image/png"],Dr=function(e){i(o,at);var n=Cr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,i=t.maxCount,o=t.fileSize,l=t.fileWidth,a=void 0===l?"100":l,s=t.fileHeight,f=void 0===s?"100":s,p=t.readonly,d=t.hidden,h=this.getItem(),y=h.itemProps,v=h.itemLayouts,m=this.getStyles(),b=m.styles,O=m.itemStyles;return c(g.Item,Sr(Sr(Sr({name:r,label:this.getLabel(),style:O,hidden:d,rules:d?[]:e,valuePropName:"list",getValueFromEvent:xr},y),v),{},{children:c(Ir,{maxCount:i,fileSize:o,fileWidth:Number(a),fileHeight:Number(f),readonly:p,preview:n,style:b})}))}return c(u,{})}}]),o}(),Ir=function(e){i(l,ut);var o=Cr(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"uploading",!1),a(n(e),"state",{fileList:[],fileView:void 0}),a(n(e),"onChangeValue",(function(t){var r=t.fileList.map((function(e){var t,r;if(200===(null===(t=e.response)||void 0===t?void 0:t.status)){var n=e.response.data,i=n.id;n.name;var o=n.url;e.id=i,e.url=o,e.status="done"}else 500===(null===(r=e.response)||void 0===r?void 0:r.status)&&(e.status="error",e.response=e.response.message);return e}));e.setState({fileList:r},(function(){e.onChange(r)}))})),a(n(e),"onBeforeUpload",(function(t){if(!Rr.includes(t.type))return D.error("上传文件类型,仅支持图片类型!"),I.LIST_IGNORE;var r=e.props.fileSize;if(r&&be.parse(r)<t.size)return D.error("上传的文件大小,不能超过 ".concat(r,"!")),I.LIST_IGNORE;return!0})),a(n(e),"onRemove",(function(t){var r=e.state.fileList.filter((function(e){return e.id!==t.id}));e.setState({fileList:r},(function(){e.onChange(r)}))})),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Te.file.listUrl;t&&(null==t?void 0:t.length)>0&&t[0]&&$e(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return Sr(Sr({},e),{},{status:"done"})}));e.setState({fileList:r},(function(){e.onChange(r)}))})).catch((function(e){console.warn("url",r,e)}))}},{key:"onChange",value:function(e){var t,r;null===(t=(r=this.props).onChange)||void 0===t||t.call(r,e.filter((function(e){var t=e.id,r=e.status;return t&&"done"===r})).map((function(e){return e.id})))}},{key:"render",value:function(){var e=this,t=this.state,r=t.fileList,n=t.fileView,i=this.props,o=i.preview,l=i.maxCount,a=i.readonly,f=i.fileWidth,p=void 0===f?100:f,d=i.fileHeight,h=void 0===d?100:d,y=i.style,v=l?Number(l):0;return o?c(bt,{fileList:r,width:p,height:h,style:y}):s(u,{children:[c(Oe,{rotationSlider:!0,modalTitle:"图片编辑",modalOk:"确认",modalCancel:"取消",aspect:p/h,children:c(I,{listType:"picture-card",accept:Rr.join(","),action:Te.request.prefix+Te.file.uploadUrl,fileList:r,maxCount:v,disabled:a,beforeUpload:this.onBeforeUpload,onChange:this.onChangeValue,onRemove:this.onRemove,onPreview:function(t){return e.setState({fileView:t})},children:!a&&Number(v)>r.length&&c(L,{type:"link",icon:c(ye,{}),style:y})})}),(null==n?void 0:n.id)&&c(V,{title:n.name,open:!0,footer:null,onCancel:function(){return e.setState({fileView:void 0})},children:c("img",{alt:n.name,style:{width:"100%"},src:n.url})})]})}}]),l}();function Lr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Er(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Br=function(e){return Array.isArray(e)?e:e&&e.list},Tr=function(e){i(o,at);var n=Er(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,i=t.maxCount,o=t.fileType,l=t.fileTypeMessage,a=t.fileSize,s=t.readonly,f=t.hidden,p=this.getItem(),d=p.itemProps,h=p.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return c(g.Item,Vr(Vr(Vr({name:r,label:this.getLabel(),style:m,hidden:f,rules:f?[]:e,valuePropName:"list",getValueFromEvent:Br},d),h),{},{children:c(Fr,{maxCount:i,fileType:o,fileTypeMessage:l,fileSize:a,readonly:s,preview:n,style:v})}))}return c(u,{})}}]),o}(),Fr=function(e){i(l,ut);var o=Er(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"uploading",!1),a(n(e),"state",{fileList:[],modal:{open:!1,progress:0}}),a(n(e),"onBeforeUpload",(function(t){var r=e.props,n=r.fileSize,i=r.fileType,o=r.fileTypeMessage,l=null==i?void 0:i.replace(/\ +/g,"").split(",");if(!(l&&l.length>0))return D.error("文件类型不匹配!"),I.LIST_IGNORE;if(!l.includes(t.type))return D.error(o),I.LIST_IGNORE;if(n&&be.parse(n)<t.size)return D.error("上传的文件大小,不能超过 ".concat(n,"!")),I.LIST_IGNORE;return!0})),a(n(e),"customRequest",(function(t){var r,n,i,o,l,a,c,u={blockSize:Te.chunk.chunkSize,checkFile:(c=te(re.mark((function e(t){var r,n,i;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,$e("post form "+Te.chunk.checkFile)({fileName:r,fileMd5:n,fileSize:i});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),checkBlock:(a=te(re.mark((function e(t){var r,n,i,o;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.blockMd5,o=t.blockIndex,e.next=3,$e("post form "+Te.chunk.checkChunk)({fileName:r,fileMd5:n,blockMd5:i,blockIndex:o});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)}),uploadBlock:(l=te(re.mark((function e(t){var r,n,i,o,l,a;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.blockMd5,o=t.blockIndex,l=t.file,(a=new FormData).append("blockIndex",String(o)),a.append("blockMd5",i),a.append("fileName",r),a.append("fileMd5",n),a.append("file",l),e.next=9,$e("post form "+Te.chunk.chunkUpload)(a);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)}),mergeBlock:(o=te(re.mark((function e(t){var r,n,i;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,$e("post form "+Te.chunk.doMerge)({fileName:r,fileMd5:n,fileSize:i});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)}),mergeProgress:(i=te(re.mark((function e(){var t;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$e(Te.chunk.mergeProgress)();case 2:return t=e.sent,e.abrupt("return",null==t?void 0:t.data);case 4:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)}),verifyFile:(n=te(re.mark((function e(t){var r,n,i;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,$e("post form "+Te.chunk.onComplete)({fileName:r,fileMd5:n,fileSize:i});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)}),verifyProgress:(r=te(re.mark((function e(){var t;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$e(Te.chunk.completeProgress)();case 2:return t=e.sent,e.abrupt("return",null==t?void 0:t.data);case 4:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},s=we.create(u);s.progress((function(t,r){t.status="uploading",e.setState({modal:{open:!0,progress:r}})})),s.complete((function(t){var r=t.response,n=r.id,i=r.url;t.id=n,t.url=i,t.status="done";var o=[].concat(de(e.state.fileList),[t]);e.setState({fileList:o,modal:{open:!1,progress:0}},(function(){e.onChange(o)}))})),s.error((function(t,r){t.status="error",t.response=r;var n=e.state.fileList,i=n.findIndex((function(e){return e.uid===t.uid}));-1===i?n.push(t):n[i]=t,e.setState({fileList:n,modal:{open:!1,progress:0}})})),s.start(t.file)})),a(n(e),"onRemove",(function(t){var r=e.state.fileList.filter((function(e){return e.id!==t.id}));e.setState({fileList:r},(function(){e.onChange(r)}))})),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Te.file.listUrl;t&&t.length>0&&$e(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return Vr(Vr({},e),{},{status:"done"})}));e.setState({fileList:r},(function(){e.onChange(r)}))})).catch((function(e){console.warn("url",r,e)}))}},{key:"onChange",value:function(e){var t,r;null===(t=(r=this.props).onChange)||void 0===t||t.call(r,e.filter((function(e){return"done"===e.status})).map((function(e){return e.id})))}},{key:"render",value:function(){var e=this.state,t=e.fileList,r=e.modal,n=this.props,i=n.preview,o=n.maxCount,l=n.readonly,a=n.style,f=o?Number(o):0;return i?c(gt,{fileList:t}):s(u,{children:[c(I,{action:Te.request.prefix+Te.file.uploadUrl,fileList:t,maxCount:f,disabled:l,beforeUpload:this.onBeforeUpload,customRequest:this.customRequest,onRemove:this.onRemove,children:c(L,{disabled:l||f<=t.length,icon:c(he,{}),style:a,children:"上传"})}),s(V,{open:r.open,closable:!1,footer:null,children:[c("div",{children:"上传文件进度"}),c(E,{percent:r.progress})]})]})}}]),l}(),Ar=["worksId","worksExtraId"];function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ur(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var qr=function(e){i(o,at);var n=Ur(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"getColumns",value:function(){var e,t=H(this.props.children,{tag:"Columns"});return t?null===(e=t.children)||void 0===e?void 0:e.map((function(e){var t;return Mr(Mr({},e),{},{rules:null===(t=e.rules)||void 0===t?void 0:t.map(Ie)})})):[]}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.plusRules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.title,a=i.preview,s=i.readonly,f=i.hidden,p=this.getStyles(),d=p.styles,h=p.itemStyles;return c(g.Item,Mr(Mr(Mr({name:o,style:h,hidden:f,rules:f?[]:e,valuePropName:"list"},r),n),{},{children:c(zr,{preview:a||s,title:l,columns:this.getColumns(),style:d})}))}return c(u,{})}}]),o}(),zr=function(e){i(l,ut);var o=Ur(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"state",{dataSource:[],modal:{title:"",entity:void 0,show:!1}}),a(n(e),"onFinish",(function(t){var r=e.state.dataSource,n=[];t.id||t.uid?n=r.map((function(e){return t.id&&e.id===t.id||t.uid&&e.uid===t.uid?Mr(Mr({},e),t):e})):(t.index=r.length+1,t.uid=_(),n=[].concat(de(r),[t])),e.setState({dataSource:n,modal:{title:"",entity:void 0,show:!1}},(function(){var t,r;null===(t=(r=e.props).onChange)||void 0===t||t.call(r,n)}))})),a(n(e),"onCancel",(function(){e.setState({modal:{title:"",entity:void 0,show:!1}})})),e}return r(l,[{key:"componentDidMount",value:function(){var e=this.props,t=e.list,r=e.onChange;if(Array.isArray(t)){var n=t.map((function(e,t){return e.worksId,Mr({id:e.worksExtraId,index:t+1},ee(e,Ar))}));this.setState({dataSource:n},(function(){null==r||r(n)}))}}},{key:"getColumns",value:function(){var e=this,t=this.props,r=t.title,n=t.preview,i=t.columns,o=t.onChange,l=this.state.dataSource;return n?i:K(i,{title:"操作",dataIndex:"option",valueType:"option",render:function(t,n){return[s(b,{children:[c("a",{onClick:function(){e.setState({modal:{title:"修改".concat(r),entity:n,show:!0}})},children:"修改"},"modifly"),c("a",{onClick:function(){V.confirm({title:"警告",icon:c(ve,{}),content:"请确认是否删除该项数据?",okText:"确认",cancelText:"取消",onOk:function(){var t=l.filter((function(e){var t=e.id,r=e.uid;return!(t&&n.id===t||r&&n.uid===r)}));e.setState({dataSource:t},(function(){null==o||o(t)}))}})},children:"删除"},"delete")]},"option")]}})}},{key:"render",value:function(){var e=this,t=this.props,r=t.title,n=t.preview,i=t.style,o=this.state,l=o.dataSource,a=o.modal,u=this.getColumns();return s(B,{title:r,bodyStyle:{padding:"0px 12px"},extra:n?null:c("a",{onClick:function(){e.setState({modal:{title:"新建".concat(r),entity:void 0,show:!0}})},children:"添加"},"new"),children:[c(T,{rowKey:"index",size:"small",style:i,columns:u,dataSource:l}),a.show&&c(_r,{title:a.title,entity:a.entity,columns:u,onFinish:this.onFinish,onCancel:this.onCancel})]})}}]),l}(),_r=function(t){var r,n=t.title,i=t.entity,o=t.columns,l=t.onFinish,a=t.onCancel,u=g.useForm(),s=e(u,1)[0];return c(V,{title:n,width:740,open:!0,destroyOnClose:!0,onCancel:a,onOk:(r=te(re.mark((function e(){return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.validateFields().then((function(e){l(Mr(Mr({},i),e))})).catch((function(e){console.warn(e)}));case 2:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)}),children:c(g,{form:s,name:"modalTable",initialValues:i,wrapperCol:{span:22},autoComplete:"off",layout:"vertical",children:c(F,{children:o.length>0&&o.map((function(e){var t=e.title,r=e.dataIndex,n=e.placeholder,i=e.rules;if("index"!==r&&"option"!==r)return c(A,{span:12,children:c(g.Item,{label:t,name:r,rules:i,children:c(w,{placeholder:n})})},r)}))})})})},Wr=["id","index"];function Gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $r(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Yr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yr(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==r.return||r.return()}finally{if(a)throw o}}}}function Yr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Kr(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Jr=function(e){i(l,at);var o=Kr(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"itemList",[]),a(n(e),"columnList",[]),a(n(e),"state",{doc:void 0,loading:!0}),a(n(e),"initItems",function(){var t=te(re.mark((function t(r){var n,i,o,l,a,c,u,s,f,p,d,h,y,v,m,g,b,O,w,j;return re.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.columnList=H(e.props.children,{tag:"Columns"}).children,n=e.columnList.map((function(e){return e.dataIndex})),i=xe.selectors(r,"[code]"),o=$r(i),t.prev=4,o.s();case 6:if((l=o.n()).done){t.next=29;break}if(a=l.value,c=a.getAttribute("code"),u=a.getAttribute("title"),s=a.tagName.toLowerCase(),!c||!n.includes(c)){t.next=27;break}if(f={},p=a.getAttribute("remote"),!((d=xe.selectors(a,"Option")).length>0)){t.next=20;break}h=$r(d);try{for(h.s();!(y=h.n()).done;)v=y.value,m=v.getAttribute("value"),g=v.textContent,m&&g&&(f[m]=g)}catch(e){h.e(e)}finally{h.f()}t.next=26;break;case 20:if(!p){t.next=26;break}return t.next=23,e.request(p);case 23:b=t.sent,O=$r(b);try{for(O.s();!(w=O.n()).done;)j=w.value,f[j.key]=j.label}catch(e){O.e(e)}finally{O.f()}case 26:e.itemList.push({code:c,title:u,type:s,data:f});case 27:t.next=6;break;case 29:t.next=34;break;case 31:t.prev=31,t.t0=t.catch(4),o.e(t.t0);case 34:return t.prev=34,o.f(),t.finish(34);case 37:e.setState({loading:!1});case 38:case"end":return t.stop()}}),t,null,[[4,31,34,37]])})));return function(e){return t.apply(this,arguments)}}()),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.formId;this.setState({loading:!0}),this.request(Te.form.documentUrl,{formId:t}).then((function(t){var r=xe.toDocument(t);e.setState({doc:r}),e.initItems(r)}))}},{key:"render",value:function(){if(this.display()&&!this.state.loading){this.onComputeValue();var e=this.plusRules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.title,a=i.witdh,s=i.preview,f=i.readonly,p=i.hidden,d=this.getStyles(),h=d.styles,y=d.itemStyles,v=this.state.doc;return c(g.Item,Hr(Hr(Hr({name:o,style:y,hidden:p,rules:p?[]:e,valuePropName:"list"},r),n),{},{children:c(Qr,{preview:s||f,title:l,witdh:a,columns:this.columnList,items:this.itemList,document:v,style:h})}))}return c(u,{})}}]),l}(),Qr=function(e){i(l,ut);var o=Kr(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"state",{dataSource:[],modal:{title:"",entity:void 0,show:!1}}),a(n(e),"onFinish",(function(t){var r=e.state.dataSource,n=[];t.id?n=r.map((function(e){return e.id===t.id?Hr(Hr({},e),t):e})):(t.id=_(),t.index=r.length+1,n=[].concat(de(r),[t])),e.onChange(n)})),a(n(e),"onCancel",(function(){e.setState({modal:{title:"",entity:void 0,show:!1}})})),e}return r(l,[{key:"componentDidMount",value:function(){var e=this.props.list;if(Array.isArray(e)){var t=e.map((function(e,t){var r=Pe({},(je(e),e));return Hr({id:_(),index:t+1},r)}));this.onChange(t)}}},{key:"onChange",value:function(e){var t=this;this.setState({dataSource:e,modal:{title:"",entity:void 0,show:!1}},(function(){var r,n;null===(r=(n=t.props).onChange)||void 0===r||r.call(n,e.map((function(e){return e.id,e.index,ee(e,Wr)})))}))}},{key:"getColumns",value:function(){var e=this,t=this.props,r=t.preview,n=t.title,i=t.columns,o=t.items,l=this.state.dataSource,a=i.map((function(e){var t=e.dataIndex,r=o.find((function(e){return e.code===t}));return r&&(e.title||(e.title=r.title),e.render=function(e){return 0===Object.keys(r.data).length?e:r.data[e]}),e}));return r?a:K(a,{title:"操作",dataIndex:"option",valueType:"option",render:function(t,r){return[s(b,{children:[c("a",{onClick:function(){e.setState({modal:{title:"修改".concat(n),entity:r,show:!0}})},children:"修改"},"modifly"),c("a",{onClick:function(){V.confirm({title:"警告",icon:c(ve,{}),content:"请确认是否删除该项数据?",okText:"确认",cancelText:"取消",onOk:function(){var t=l.filter((function(e){var t=e.id;return!(t&&r.id===t)}));e.onChange(t)}})},children:"删除"},"delete")]},"option")]}})}},{key:"render",value:function(){var e=this,t=this.props,r=t.preview,n=t.title,i=t.witdh,o=t.document,l=t.style,a=this.state,u=a.dataSource,f=a.modal,p=this.getColumns();return s(B,{title:n,bodyStyle:{padding:"0px 12px"},extra:r?null:c("a",{onClick:function(){e.setState({modal:{title:"新建".concat(n),entity:void 0,show:!0}})},children:"添加"},"new"),children:[c(T,{rowKey:"id",size:"small",style:l,columns:p,dataSource:u}),f.show&&c(Xr,{title:f.title,witdh:i,entity:f.entity,document:o,onFinish:this.onFinish,onCancel:this.onCancel})]})}}]),l}(),Xr=function(e){var t,r=e.title,n=e.witdh,i=void 0===n?"740":n,o=e.entity,l=e.document,a=e.onFinish,u=e.onCancel,s=h();return c(V,{title:r,width:Number(i),open:!0,destroyOnClose:!0,onCancel:u,onOk:(t=te(re.mark((function e(){var t,r,n;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,null===(t=s.current)||void 0===t?void 0:t.validateFields();case 3:n=null===(r=s.current)||void 0===r?void 0:r.getFieldsValue(),a(Hr(Hr({},o),n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),function(){return t.apply(this,arguments)}),children:l&&c(yn,{form:s,document:l,initialValues:o})})},Zr=Object.freeze({__proto__:null,Checkbox:Ht,DatePicker:fr,Duration:lr,Editor:Tt,FormList:Jr,Label:ft,Number:Lt,Photo:Dr,Radio:Qt,Select:Ut,SuperUpload:Tr,Switch:rr,Table:qr,Text:Pt,TextArea:xt,TimePicker:vr,Tooltip:dt,Upload:jr}),en=function(e){var t=e.children,r=e.gutter;return c(F,{gutter:Number(r),style:{margin:0},children:t})},tn=function(e){var t=e.span,r=e.children;return c(A,{span:t,children:r})},rn=function(e){var t=e.direction,r=e.stepIndex,n=e.onChangeSetp,i=e.children,o=y((function(){return null==i?void 0:i.map((function(e){var t=e.id,r=e.attributes;return{key:t,title:r.title,description:r.description}}))}),[i]);return c(N,{current:r,direction:t,onChange:n,items:o,style:{padding:16,backgroundColor:"white"}})},nn=M.Content,on=v((function(e){var t=e.currentStepIndex,r=e.stepIndex,n=e.style,i=e.children,o=y((function(){var e=n?Ye(n):{padding:16,backgroundColor:"white"};return t!==Number(r)&&Object.assign(e,{display:"none"}),e}),[t]);return c(nn,{style:o,children:i})})),ln=function(e){var t=e.dashed,r=void 0!==t&&t,n=e.orientation,i=void 0===n?"center":n,o=e.children;return c(U,{dashed:r,orientation:i,style:{color:"#055ab5",fontWeight:"bold"},children:o})},an={display:"none"},cn={display:"block"},un=v((function(t){var r=t.defaultExpanded,n=void 0===r||r,i=t.on,o=t.off,l=t.style,a=t.collapse,f=t.children,p=m(n),d=e(p,2),h=d[0],y=d[1],v=Ye(l);return a?s(u,{children:[c("div",{style:v,children:s(L,{type:"link",onClick:function(){y(!h)},children:[h?o:i,c(h?me:ge,{})," "]})}),c("div",{style:h?cn:an,children:f})]}):c(u,{children:f})}));function sn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sn(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pn(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var dn=Zr,hn={Col:tn,Collapse:un,Content:on,Divider:ln,Row:en,Steps:rn},yn=function(o){i(d,p);var l=pn(d);function d(e){var r,i,o;return t(this,d),o=l.call(this,e),a(n(o),"state",{stepIndex:0,root:void 0,loading:!0}),a(n(o),"onValuesChange",(function(e){o.setState({values:e})})),a(n(o),"onStepIndex",(function(e){o.setState({stepIndex:e})})),a(n(o),"children",(function(e){var t,r,n=null!==(t=null===(r=o.customComponents)||void 0===r?void 0:r[e.tag])&&void 0!==t?t:dn[e.tag];return n?o.component(e,n):hn[e.tag]?o.container(e):o.applet(e)})),o.styles=null!==(r=e.style)&&void 0!==r?r:{},o.form=null!==(i=e.form)&&void 0!==i?i:f.createRef(),o}return r(d,[{key:"componentDidMount",value:function(){var t,r,n=this,i=this.props,o=i.document,l=i.preview,u=(t="string"==typeof o?xe.getRoot(o):xe.parser(o)).attributes,s=u.style,f=u.labelCol,p=u.wrapperCol,d=u.showTitle;if(this.showTitle=!!d,"string"==typeof s){var h=null==s?void 0:s.replace(/\ +/g,"").split(";");null==h||h.forEach((function(t){if(t){var r=t.split(":"),i=e(r,2),o=i[0],l=i[1];Object.assign(n.styles,a({},G(o),l))}}))}f&&p&&(this.layouts={labelCol:{span:f},wrapperCol:{span:p}}),this.preview=null!=l&&l,Te.components&&(this.customComponents=J(Te.components,(function(e){return function(t){return c(nt,fn({Component:e},t))}}))),this.setState({root:t,loading:!0}),"function"==typeof(r=function(e){n.setState({loading:e})})&&Ne.push(r)}},{key:"componentWillUnmount",value:function(){var e;null===(e=this.form.current)||void 0===e||e.resetFields(),this.setState({root:void 0,loading:!0})}},{key:"setComponentStatus",value:function(e){var t=this.props,r=t.hidden,n=t.readonly;if(Q(r))e.hidden=r;else if(X(r))e.hidden=r.includes(e.code);else if(Z(r))e.hidden=!!r[e.code];else{var i;e.hidden=null!==(i=e.hidden)&&void 0!==i&&i}if(Q(n))e.readonly=n;else if(X(n))e.readonly=n.includes(e.code);else if(Z(n))e.readonly=!!n[e.code];else{var o;e.readonly=null!==(o=e.readonly)&&void 0!==o&&o}}},{key:"component",value:function(e,t){var r=e.id,n=e.attributes,i=e.children;return this.setComponentStatus(n),c(t,fn(fn({preview:this.preview},n),{},{children:null==i?void 0:i.map(this.children)}),r)}},{key:"container",value:function(e){var t=e.id,r=e.tag,n=e.attributes,i=e.text,o=e.children;return"Row"===r?c(en,fn(fn({},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Col"===r?c(tn,{span:Number(n.span),children:null==o?void 0:o.map(this.children)},t):"Collapse"===r?c(un,fn(fn({collapse:this.props.collapse},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Content"===r?c(on,fn(fn({currentStepIndex:this.state.stepIndex},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Steps"===r?c(rn,fn(fn({stepIndex:this.state.stepIndex,onChangeSetp:this.onStepIndex},n),{},{children:o}),t):"Divider"===r?c(ln,fn(fn({},n),{},{children:i}),t):void 0}},{key:"applet",value:function(e){var t=this,r=e.tag,n=e.attributes,i=e.cdata,o=e.children;if("Columns"===r){var l=null==o?void 0:o.map((function(e){var r=e.attributes,n=e.children;if(n){var i,o=H(n.map(t.children),{tag:"Validates"});return fn(fn({},r),{},{rules:null!==(i=null==o?void 0:o.children)&&void 0!==i?i:[]})}return r}));return{tag:r,children:l}}return"Options"===r?{tag:r,children:null==o?void 0:o.map((function(e){return{key:e.attributes.value,label:e.text}}))}:"Validates"===r?{tag:r,children:null==o?void 0:o.map((function(e){return e.attributes}))}:"Conditions"===r?{tag:r,type:n.type,action:n.action,children:null==o?void 0:o.map((function(e){return e.attributes}))}:"Collection"===r||"Compute"===r?{tag:r,cdata:i}:void 0}},{key:"render",value:function(){var e,t=this.state,r=t.root,n=t.loading,i=this.props.initialValues;return s(u,{children:[r&&c(Le.Provider,{value:fn(fn({},this.props),{},{form:this.form,showTitle:this.showTitle}),children:c(vn,fn(fn({form:this.form,style:n?fn(fn({},this.styles),{},{display:"none"}):this.styles,initialValues:i,onValuesChange:this.onValuesChange},this.layouts),{},{children:null===(e=r.children)||void 0===e?void 0:e.map(this.children)}))}),n&&c(q,{active:!0})]})}}]),d}(),vn=function(e){i(l,e);var o=pn(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"onFinish",(function(e){console.log("Success:",e)})),e}return r(l,[{key:"render",value:function(){var e=this.props,t=e.form,r=e.style,n=e.labelCol,i=e.wrapperCol,o=e.initialValues,l=e.children,a=e.onValuesChange;return c(g,{ref:t,style:r,labelCol:n,wrapperCol:i,initialValues:o,onFinish:this.onFinish,autoComplete:"off",onValuesChange:function(e){a(e)},children:l})}}]),l}(f.PureComponent);export{Le as DesignContext,Xe as UIComponent,at as UIListComponent,yn as default,Fe as defineConfig};
1
+ import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/classCallCheck";import r from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/assertThisInitialized";import i from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import a from"@babel/runtime/helpers/defineProperty";import{jsx as c,Fragment as u,jsxs as s}from"react/jsx-runtime";import f,{PureComponent as p,useEffect as d,useRef as h,useMemo as y,memo as v,useState as m}from"react";import{Form as g,Space as b,Image as O,Input as w,InputNumber as j,Select as P,Checkbox as k,Radio as S,Switch as C,DatePicker as x,TimePicker as R,message as D,Upload as I,Button as L,Modal as V,Progress as E,Card as B,Table as T,Row as F,Col as A,Steps as N,Layout as M,Divider as U,Skeleton as q}from"antd";import{parseInt as z,uniqueId as _,cloneDeep as W,camelCase as G,find as H,every as $,some as Y,concat as K,mapValues as J,isBoolean as Q,isArray as X,isObject as Z}from"lodash";import ee from"@babel/runtime/helpers/objectWithoutProperties";import te from"@babel/runtime/helpers/asyncToGenerator";import re from"@babel/runtime/regenerator";import ne from"moment";import{extend as ie}from"umi-request";import{parse as oe,compile as le}from"path-to-regexp";import ae from"wangeditor-for-react";import ce from"number-format.js";import ue from"dayjs";import se from"dayjs/plugin/weekday";import fe from"dayjs/plugin/localeData";import pe from"dayjs/plugin/customParseFormat";import de from"@babel/runtime/helpers/toConsumableArray";import{UploadOutlined as he,PlusOutlined as ye,QuestionCircleOutlined as ve,UpOutlined as me,DownOutlined as ge}from"@ant-design/icons";import be from"bytes";import Oe from"antd-img-crop";import we from"file-block-upload";import je from"@babel/runtime/helpers/objectDestructuringEmpty";import Pe from"@babel/runtime/helpers/extends";function ke(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Se(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Se(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==r.return||r.return()}finally{if(a)throw o}}}}function Se(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ce=function(){function e(r){t(this,e),a(this,"attributes",{}),this.id=_();var n,i=ke(r.attributes);try{for(i.s();!(n=i.n()).done;){var o=n.value,l=o.value.trim();this.isBoolean(l)&&(l=this.toBoolean(l)),this.attributes[o.name]=l}}catch(e){i.e(e)}finally{i.f()}this.children=new Array;var c,u=ke(r.childNodes);try{for(u.s();!(c=u.n()).done;){var s,f,p=c.value;if(p instanceof Element)null===(s=this.children)||void 0===s||s.push(new e(p));if(3===p.nodeType&&p.textContent&&(this.text=p.textContent),4===p.nodeType)this.cdata=null===(f=p.nodeValue)||void 0===f?void 0:f.replace(/\ +/g," ").replace(/[\t\r\n]/g,"")}}catch(e){u.e(e)}finally{u.f()}this.tag=r.nodeName}return r(e,[{key:"isBoolean",value:function(e){return"true"===e||"false"===e}},{key:"toBoolean",value:function(e){return"true"===e}},{key:"isNumber",value:function(e){return/^\d+$/.test(e)}},{key:"toNumber",value:function(e){return z(e,10)}}]),e}(),xe=function(){function e(){t(this,e)}return r(e,null,[{key:"parser",value:function(e){var t=e.childNodes[0];return new Ce(t)}},{key:"toDocument",value:function(e){return(new DOMParser).parseFromString(e,"text/xml")}},{key:"getRoot",value:function(t){var r=e.toDocument(t);return e.parser(r)}},{key:"selector",value:function(e,t){return e.querySelector(t)}},{key:"selectors",value:function(e,t){return e.querySelectorAll(t)}}]),e}();function Re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function De(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ie=function(e){var t=e.type,r=void 0===t?"string":t,n=e.required,i=e.minlength,o=e.maxlength,l=e.min,a=e.max,c=e.pattern,u=e.message;return n?{type:r,required:n,message:u}:i&&o?{type:r,min:Number(i),max:Number(o),message:u}:l&&a?{type:r,min:Number(l),max:Number(a),message:u}:"phone"===r?{type:"string",pattern:new RegExp("^[1][3,5,6,7,8][0-9]\\d{8}$"),message:u}:"regexp"===r&&"string"==typeof c?{type:"string",pattern:new RegExp(c),message:u}:{type:r,message:u}},Le=f.createContext({});function Ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Be=function(){function e(r){if(t(this,e),a(this,"request",{prefix:"api",headers:{},params:{}}),a(this,"file",{listUrl:"/file/list",downloadUrl:"/file/download",uploadUrl:"/file/upload",extraData:function(e,t){}}),a(this,"style",{labelStyle:{color:"#055ab5"}}),a(this,"form",{documentUrl:"/form/:formId"}),a(this,"chunk",{chunkSize:10*Math.pow(1024,2),checkFile:"/chunk/checkFile",checkChunk:"/chunk/checkChunk",chunkUpload:"/chunk/chunkUpload",doMerge:"/chunk/doMerge",mergeProgress:"/chunk/mergeProgress",onComplete:"/chunk/onComplete",completeProgress:"/chunk/completeProgress"}),r){var n=r.request,i=r.file,o=r.form,l=r.chunk,c=r.components;this.request=Ee(Ee({},this.request),n),this.file=Ee(Ee({},this.file),i),this.form=Ee(Ee({},this.form),o),this.chunk=Ee(Ee({},this.chunk),l),this.components=c}}return r(e,null,[{key:"init",value:function(t){return new e(t)}}]),e}(),Te=Be.init(),Fe=function(e){Te=Be.init(e)},Ae=0,Ne=[],Me=function(){var e=te(re.mark((function e(t){var r,n;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===Ae)for(r=0,n=Ne;r<n.length;r++)(0,n[r])(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ue=function(){var e=te(re.mark((function e(){return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==Ae++&&Me(!0);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=te(re.mark((function e(){return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==--Ae&&Me(!1);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ze=function(){var e=te(re.mark((function e(){return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ae=0,Me(!1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_e=["status"];function We(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Ge=ie({prefix:Te.request.prefix,timeout:1e4});Ge.use(function(){var e=te(re.mark((function e(t,r){return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Ue(),e.next=4,r();case 4:qe(),e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(0),ze(),e.t0;case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,r){return e.apply(this,arguments)}}(),{global:!0});var He=function(t,r){var n=W(r.data),i=t;try{var o="",l=i.match(/[a-zA-z]+:\/\/[^/]*/);if(l)o=e(l,1)[0],i=i.slice(o.length);var c=oe(i);i=le(i)(r.data),c.forEach((function(e){e instanceof Object&&e.name in n&&delete n[e.name]})),i=o+i}catch(e){console.error(e.message)}return"GET"===r.method.toLocaleUpperCase()?r.params=n:r.type&&(r.requestType=r.type),r.prefix=Te.request.prefix,Ge(i,r).then((function(e){var t=e.status,r=ee(e,_e),n=200===t;return Promise.resolve(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?We(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):We(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({success:n},r))})).catch((function(e){var t,r=e.response,n=e.data,o=null!==(t=null==n?void 0:n.message)&&void 0!==t?t:"访问超时";return console.error(i,r,n),Promise.resolve({success:!1,message:o})}))},$e=function(t){var r="GET",n="json",i=t,o=t.split(" ");if(2===o.length){var l=e(o,2);r=l[0],i=l[1]}else if(3===o.length){var a=e(o,3);r=a[0],n=a[1],i=a[2]}return function(e){return He(i,{method:r,type:n,data:e})}},Ye=function(t){var r={};t&&t.replace(/\ +/g,"").split(";").forEach((function(t){if(t){var n=t.split(":"),i=e(n,2),o=i[0],l=i[1];Object.assign(r,a({},G(o),l))}}));return r};function Ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Qe(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Xe=function(o){i(u,o);var l=Qe(u);function u(){var r;t(this,u);for(var i=arguments.length,o=new Array(i),c=0;c<i;c++)o[c]=arguments[c];return r=l.call.apply(l,[this].concat(o)),a(n(r),"styleWrapper",{style:{borderBottom:"1px solid #d9d9d9"}}),a(n(r),"request",function(){var t=te(re.mark((function t(n,i){var o;return re.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=null!=i?i:r.context.params,t.abrupt("return",$e(n)(Je({},o)).then((function(t){var r=t.success,n=t.data;if(r){if(Array.isArray(n)){var i=n.map((function(t){var r,n=null===(r=Object.entries(t))||void 0===r?void 0:r[0],i=e(n,2);return{key:i[0],label:i[1]}}));return Promise.resolve(i)}return Promise.resolve(n)}return Promise.reject(void 0)})).catch((function(e){return console.error("remote",n,e),Promise.reject(e)})));case 2:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()),r}return r(u,[{key:"setDefaultValue",value:function(e){var t=this.context.form;if(t){var r,n,i=this.props.code;if(!(null===(r=t.current)||void 0===r?void 0:r.getFieldValue(i)))null===(n=t.current)||void 0===n||n.setFieldValue(i,e)}}},{key:"setFieldValue",value:function(e){var t=this.context.form;if(t){var r,n=this.props.code;null===(r=t.current)||void 0===r||r.setFieldValue(n,e)}}},{key:"cleanFieldValue",value:function(){var e=this;setTimeout((function(){e.setFieldValue(void 0)}),1)}},{key:"getFieldValue",value:function(){var e=this.context.form;if(e){var t,r=this.props.code;return null===(t=e.current)||void 0===t?void 0:t.getFieldValue(r)}}},{key:"getFieldsValue",value:function(){var e,t=this.context.form;if(t)return null===(e=t.current)||void 0===e?void 0:e.getFieldsValue()}},{key:"getLabel",value:function(){if(this.context.showTitle){var e=this.props,t=e.title,r=e.labelStyle,n=Ye(r);return c("span",{style:Je(Je({},Te.style.labelStyle),n),children:t})}}},{key:"getItem",value:function(){var e,t,r=this.props,n=r.preview,i=r.labelCol,o=r.wrapperCol,l=r.tips,a=i&&o?{labelCol:{span:i},wrapperCol:{span:o}}:{};n?(e={required:!1},Object.assign(null!==(t=a.wrapperCol)&&void 0!==t?t:{},this.styleWrapper)):e={tooltip:l};return{itemProps:e,itemLayouts:a}}},{key:"getStyles",value:function(){var e=this.props,t=e.style,r=e.itemStyle;return{styles:Ye(t),itemStyles:Ye(r)}}},{key:"display",value:function(){var e,t=null!==(e=this.context.preview)&&void 0!==e&&e,r=this.getFieldsValue(),n=this.props,i=n.defaultHide,o=void 0!==i&&i,l=n.children,a=!o,c=H(l,{tag:"Conditions"});if(c){var u,s=c.type,f=c.action,p=null===(u=c.children)||void 0===u?void 0:u.map(function(e,t){return function(r){var n=r.test;try{if(e){e=De(De({},e),{},{preview:t});var i=Object.keys(e).join(",");return new Function("{".concat(i,"}"),"return ".concat(n))(e)}}catch(e){}}}(r,t));if((null==p?void 0:p.length)>0&&void 0!==(null==p?void 0:p[0])){var d=!1;if((d="and"===s?$(p):Y(p))&&"hide"===f||!d&&"show"===f)return!1;if(!d&&"hide"===f||d&&"show"===f)return!0}}return a}},{key:"rules",value:function(){var e=this.props,t=e.preview,r=e.children;if(!t){var n,i,o=H(r,{tag:"Validates"});return null!==(n=null==o||null===(i=o.children)||void 0===i?void 0:i.map(Ie))&&void 0!==n?n:[]}return[]}},{key:"collectionList",value:function(){var e=H(this.props.children,{tag:"Collection"});if(e)return function(e,t){var r=t.cdata;try{if(e){var n=Object.keys(e).join(",");return new Function("{".concat(n,"}"),"".concat(r))(e)}return new Function("".concat(r))()}catch(e){}return[]}(this.getFieldsValue(),e)}},{key:"onComputeValue",value:function(){var e=this,t=H(this.props.children,{tag:"Compute"});if(t){var r=function(e,t){var r=t.cdata;try{if(e){var n=Object.keys(e).join(",");return new Function("{".concat(n,"}"),"moment","".concat(r))(e,ne)}return new Function("moment","".concat(r))(ne)}catch(e){}}(this.getFieldsValue(),t);r&&setTimeout((function(){e.setFieldValue(r)}),1)}}},{key:"initValue",value:function(e){var t=this.props.defaultValue,r=void 0===t?e:t;r&&this.setDefaultValue(r)}}]),u}(f.PureComponent);Xe.contextType=Le;var Ze=["Component","defaultValue","style"];function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?et(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var nt=function(e){i(l,Xe);var o=rt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"initValue",(function(){var t=e.props.defaultValue;t&&e.forceUpdate((function(){e.setDefaultValue(t)}))})),a(n(e),"onChange",(function(t){e.setFieldValue(t)})),e}return r(l,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.hidden,a=this.props,s=a.Component;a.defaultValue,a.style;var f=ee(a,Ze),p=this.getStyles(),d=p.styles,h=p.itemStyles;return c(g.Item,tt(tt(tt({name:o,label:this.getLabel(),style:h,hidden:l,rules:e},r),n),{},{children:c(s,tt(tt({},f),{},{style:d,onChange:this.onChange}))}))}return c(u,{})}}]),l}();function it(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function lt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var at=function(e){i(l,Xe);var o=lt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"getList",(function(e,t,r){if(t){var n=e.filter((function(e){var r=e.key;return t.includes(r)}));return r(n),n}return e})),e}return r(l,[{key:"optionList",value:function(){var e=H(this.props.children,{tag:"Options"});return null==e?void 0:e.children}},{key:"plusRules",value:function(){var e=this.rules();return null==e?void 0:e.map((function(e){if(e.required){return ot(ot({},e),{},{validator:function(e,t){return(null==t?void 0:t.length)>0?Promise.resolve():Promise.reject()}})}if(e.min&&e.max){return ot(ot({},e),{},{validator:function(t,r){return r.length>=e.min&&r.length<=e.max?Promise.resolve():Promise.reject()}})}return ot({},e)}))}}]),l}();function ct(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var ut=function(e){i(o,p);var n=ct(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o)}();function st(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var ft=function(e){i(o,Xe);var n=st(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){if(this.display()){var e=this.rules(),t=this.props,r=t.title,n=t.hidden,i=this.getStyles(),o=i.styles,l=i.itemStyles;return c(g.Item,{style:l,hidden:n,rules:n?[]:e,wrapperCol:{span:24},children:c("div",{style:o,children:r})})}return c(u,{})}}]),o}();function pt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var dt=function(e){i(o,Xe);var n=pt(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){var e=this.display(),t=this.props.preview;if(e&&!t){var r=this.props,n=r.title,i=r.hidden,o=r.children,l=this.getStyles(),a=l.styles,s=l.itemStyles;return c(g.Item,{style:s,hidden:i,wrapperCol:{span:24},children:c("div",{style:a,children:null!=n?n:o})})}return c(u,{})}}]),o}(),ht=function(e){var t=e.value,r=e.type,n=e.style,i=e.onChange;return d((function(){null==i||i(t)}),[]),c("div",t&&"url"===r?{style:n,children:c("a",{href:t,target:"_blank",rel:"noreferrer",children:t})}:{style:n,children:t})},yt=function(t){var r=t.value,n=t.style,i=t.onChange;if(d((function(){i(r)}),[]),r){var o=null==r?void 0:r.split(":"),l=e(o,3),a=l[0],u=l[1],s=l[2];return c("div",{style:n,children:"".concat(a,"小时").concat(u,"分").concat(s,"秒")})}return c("div",{style:n,children:"000时00分00秒"})},vt=function(e){var t=e.checked,r=e.style,n=e.onChange;return d((function(){n(t)}),[]),c("div",{style:r,children:t?"开启":"关闭"})},mt=function(e){var t=e.value,r=e.list,n=e.style,i=e.onChange;if(d((function(){i(t)}),[]),Array.isArray(t)){var o=r.filter((function(e){var r=e.key;return t.includes(r)})).map((function(e){return e.label}));return c("div",{style:n,children:null==o?void 0:o.join()})}var l=null==r?void 0:r.find((function(e){return e.key===t}));return c("div",{style:n,children:null==l?void 0:l.label})},gt=function(e){var t=e.fileList,r=Te.request.prefix+Te.file.downloadUrl;return c(u,{children:null==t?void 0:t.map((function(e){var t=e.id,n=e.name,i=e.url,o=e.contentType,l=r+"/"+t;return null!=o&&o.endsWith("pdf")?c("div",{children:s(b,{style:{paddingBottom:10},children:[c("a",{href:i,target:"_blank",rel:"noreferrer",children:n}),c("a",{href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=o&&o.startsWith("image")?c("div",{children:s(b,{style:{paddingBottom:10},children:[c(O,{width:200,src:i,alt:n}),c("a",{href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=o&&o.startsWith("video")?c("div",{children:s(b,{style:{paddingBottom:10},children:[c("video",{src:i,controls:!0,style:{width:260},children:"当前浏览器不支持视频播放,请使用最新版谷歌浏览器!"}),c("a",{href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=o&&o.startsWith("audio")?c("div",{children:s("div",{style:{paddingBottom:10,display:"flex",alignItems:"center"},children:[c("audio",{src:i,controls:!0,style:{width:"calc(100% - 40px)",height:30},children:"当前浏览器不支持音频播放,请使用最新版谷歌浏览器!"}),c("a",{style:{paddingLeft:10},href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=n&&n.endsWith(".doc")||null!=n&&n.endsWith(".docx")||null!=n&&n.endsWith(".xls")||null!=n&&n.endsWith(".xlsx")||null!=n&&n.endsWith(".ppt")||null!=n&&n.endsWith(".pptx")?c("div",{children:s(b,{style:{paddingBottom:10},children:[c("a",{href:"http://view.officeapps.live.com/op/view.aspx?src="+i,target:"_blank",rel:"noreferrer",children:n}),c("a",{href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):c("div",{children:s(b,{style:{paddingBottom:10},children:[c("a",{href:i,target:"_blank",rel:"noreferrer",children:n}),c("a",{href:l,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},bt=function(e){var t=e.fileList,r=e.width,n=e.height,i=e.style;return c(u,{children:null==t?void 0:t.map((function(e){var t=e.id,o=e.name,l=e.url;return c("div",{style:i,children:s(b,{style:{paddingBottom:10},children:[c(O,{width:r,height:n,src:l,alt:o}),c("a",{href:Te.request.prefix+Te.file.downloadUrl+"/"+t,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})};function Ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Pt=function(e){i(o,Xe);var n=jt(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules();console.log(e);var t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.type,a=i.preview,s=i.placeholder,f=i.maxLength,p=i.allowClear,d=i.showCount,h=i.readonly,y=i.hidden,v=this.getStyles(),m=v.styles,b=v.itemStyles;return c(g.Item,wt(wt(wt({name:o,label:this.getLabel(),style:b,hidden:y,rules:e},r),n),{},{children:a?c(ht,{type:l,style:m}):c(w,{maxLength:f,placeholder:s,allowClear:p,showCount:d,disabled:h,style:m})}))}return c(u,{})}}]),o}();function kt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function St(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ct(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var xt=function(e){i(o,Xe);var n=Ct(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.props,r=t.code,n=t.preview,i=t.placeholder,o=t.maxLength,l=t.allowClear,a=t.showCount,s=t.readonly,f=t.hidden,p=this.getItem(),d=p.itemProps,h=p.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return c(g.Item,St(St(St({name:r,label:this.getLabel(),style:m,hidden:f,rules:f?[]:e},d),h),{},{children:n?c(ht,{style:v}):c(w.TextArea,{maxLength:o,placeholder:i,allowClear:l,showCount:a,disabled:s,style:v})}))}return c(u,{})}}]),o}();function Rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function It(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Lt=function(e){i(o,Xe);var n=It(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){var e=this.props,t=e.type,r=void 0===t?"number":t,n=e.precision,i={};"digits"===r?i=n?{precision:Number(n)}:{precision:2}:"money"===r?i={formatter:function(e){return"¥ ".concat(e).replace(/\B(?=(\d{3})+(?!\d))/g,",")},parser:function(e){return e.replace(/\$\s?|(,*)/g,"")}}:"percentage"===r&&(i={formatter:function(e){return"".concat(e,"%")},parser:function(e){return e.replace("%","")}}),this.onComputeValue();var o=this.rules().map((function(e){return e.required?Dt(Dt({},e),{},{type:"integer"}):e})),l=this.getItem(),a=l.itemProps,s=l.itemLayouts,f=this.props,p=f.code,d=f.preview,h=f.min,y=f.max,v=f.readonly,m=f.hidden,b=this.getStyles(),O=b.styles,w=b.itemStyles;return c(g.Item,Dt(Dt(Dt({name:p,label:this.getLabel(),style:w,hidden:m,rules:m?[]:o},a),s),{},{children:d?c(ht,{style:O}):c(j,Dt(Dt({min:h,max:y,disabled:v},i),{},{style:O}))}))}return c(u,{})}}]),o}();function Vt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Bt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Tt=function(e){i(o,Xe);var n=Bt(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.title,a=i.preview,s=i.placeholder,f=i.hidden,p=i.readonly,d=this.getStyles(),h=d.styles,y=d.itemStyles;return c(g.Item,Et(Et(Et({name:o,label:this.getLabel(),style:y,hidden:f,colon:!!l,rules:f?[]:e},r),n),{},{children:a||p?c(ht,{style:h}):c(Ft,{placeholder:s,style:h})}))}return c(u,{})}}]),o}(),Ft=function(e){i(l,e);var o=Bt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"isReactWEditor",!1),a(n(e),"editorRef",f.createRef()),e}return r(l,[{key:"shouldComponentUpdate",value:function(){return!this.isReactWEditor}},{key:"render",value:function(){var e=this,t=this.props,r=t.value,n=t.placeholder,i=t.style,o=t.onChange;return c(ae,{placeholder:n,value:r,style:i,onBlur:function(){e.isReactWEditor=!1},onFocus:function(){e.isReactWEditor=!0},onChange:function(e){null==o||o(e)}})}}]),l}(f.Component);function At(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?At(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Mt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Ut=function(e){i(l,at);var o=Mt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"state",{list:[]}),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();r?this.setState({list:r},this.initValue):t&&t.trim().length>0&&this.request(t).then((function(t){e.setState({list:t},e.initValue)}))}},{key:"initValue",value:function(){var e=this.props,t=e.defaultValue,r=e.multiple;t&&(r?this.setDefaultValue([t]):this.setDefaultValue(t))}},{key:"render",value:function(){var e=this;if(this.display()){this.onComputeValue();var t=this.props,r=t.code,n=t.preview,i=t.multiple,o=t.placeholder,l=t.allowClear,a=void 0===l||l,s=t.readonly,f=t.hidden,p=i?this.plusRules():this.rules(),d=this.collectionList(),h=this.getList(this.state.list,d,(function(t){if(t.length>0){var r=e.getFieldValue();r&&(!i&&!t.some((function(e){return e.key===r}))||i&&!t.some((function(e){return r.includes(e.key)})))&&e.cleanFieldValue()}})),y=this.getItem(),v=y.itemProps,m=y.itemLayouts,b=this.getStyles(),O=b.styles,w=b.itemStyles;return c(g.Item,Nt(Nt(Nt({name:r,label:this.getLabel(),style:w,hidden:f,rules:f?[]:p},v),m),{},{children:n?c(mt,{list:this.state.list,style:O}):c(zt,{list:h,multiple:i,placeholder:o,allowClear:a,readonly:s,style:O})}))}return c(u,{})}}]),l}(),qt=P.Option,zt=function(e){i(l,ut);var o=Mt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"handleItemValue",(function(t){var r,n;null===(r=(n=e.props).onChange)||void 0===r||r.call(n,t)})),e}return r(l,[{key:"render",value:function(){var e=this.props,t=e.list,r=e.value,n=e.multiple,i=e.placeholder,o=e.allowClear,l=e.readonly,a=e.style;return c(P,{showSearch:!0,placeholder:i,mode:n?"multiple":void 0,disabled:l,value:r,allowClear:o,style:a,onChange:this.handleItemValue,filterOption:function(e,t){return t.children.toLowerCase().includes(e.toLowerCase())},children:t&&t.map((function(e){var t=e.key,r=e.label;return c(qt,{value:t,children:r},t)}))})}}]),l}();function _t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_t(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Ht=function(e){i(l,at);var o=Gt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"state",{list:[]}),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();r?this.setState({list:r},this.initValue):t&&t.trim().length>0&&this.request(t).then((function(t){e.setState({list:t},e.initValue)}))}},{key:"render",value:function(){var e=this;if(this.display()){this.onComputeValue();var t=this.plusRules(),r=this.collectionList(),n=this.getList(this.state.list,r,(function(t){if(t.length>0){var r=e.getFieldValue();r&&!t.some((function(e){return r.includes(e.key)}))&&e.cleanFieldValue()}})),i=this.props,o=i.code,l=i.preview,a=i.readonly,u=i.hidden,s=this.getItem(),f=s.itemProps,p=s.itemLayouts,d=this.getStyles(),h=d.styles,y=d.itemStyles;return c(g.Item,Wt(Wt(Wt({name:o,label:this.getLabel(),style:y,hidden:u,rules:u?[]:t},f),p),{},{children:l?c(mt,{list:this.state.list,style:h}):c($t,{list:n,readonly:a,style:h})}))}return null}}]),l}(),$t=function(e){i(o,ut);var n=Gt(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.list,n=e.readonly,i=e.style,o=e.onChange;return c(k.Group,{style:i,value:t,onChange:function(e){null==o||o(e)},children:r&&r.map((function(e){var t=e.key,r=e.label;return c(k,{value:t,disabled:n,children:r},t)}))})}}]),o}();function Yt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Jt(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Qt=function(e){i(l,at);var o=Jt(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"state",{list:[]}),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();r?this.setState({list:r},this.initValue):t&&t.trim().length>0&&this.request(t).then((function(t){e.setState({list:t},e.initValue)}))}},{key:"render",value:function(){var e=this;if(this.display()){this.onComputeValue();var t=this.rules(),r=this.collectionList(),n=this.getList(this.state.list,r,(function(t){if(t.length>0){var r=e.getFieldValue();r&&!t.some((function(e){return r.includes(e.key)}))&&e.cleanFieldValue()}})),i=this.props,o=i.code,l=i.preview,a=i.optionType,s=i.readonly,f=i.hidden,p=this.getItem(),d=p.itemProps,h=p.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return c(g.Item,Kt(Kt(Kt({name:o,label:this.getLabel(),style:m,hidden:f,rules:f?[]:t},d),h),{},{children:l?c(mt,{list:n,style:v}):c(Xt,{list:this.state.list,optionType:a,readonly:s,style:v})}))}return c(u,{})}}]),l}(),Xt=function(e){i(o,ut);var n=Jt(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.list,n=e.optionType,i=e.readonly,o=e.style,l=e.onChange;return c(S.Group,{value:t,optionType:n,style:o,onChange:function(e){null==l||l(e.target.value)},children:r&&r.map((function(e){var t=e.key,r=e.label;return c(S,{value:t,disabled:i,children:r},t)}))})}}]),o}();function Zt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tr(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var rr=function(e){i(o,Xe);var n=tr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.props,r=t.code,n=t.preview,i=t.readonly,o=t.hidden,l=this.getItem(),a=l.itemProps,s=l.itemLayouts,f=this.getStyles(),p=f.styles,d=f.itemStyles;return c(g.Item,er(er(er({label:this.getLabel(),name:r,style:d,hidden:o,rules:o?[]:e,valuePropName:"checked"},a),s),{},{children:n?c(vt,{style:p}):c(C,{disabled:i,style:p})}))}return c(u,{})}}]),o}();function nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ir(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function or(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".duration > .ant-form-item {\r\n display: inline-block;\r\n vertical-align: middle;\r\n margin-bottom: 0;\r\n width: 20%;\r\n}\r\n\r\n.duration > .ant-form-item:first-child {\r\n width: 30%;\r\n}\r\n\r\n.duration > span {\r\n padding: 5px; \r\n vertical-align: middle;\r\n}");var lr=function(e){i(o,Xe);var n=or(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue("000:00:00")}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.preview,a=i.readonly,s=i.hidden,f=this.getStyles(),p=f.styles,d=f.itemStyles;return c(g.Item,ir(ir(ir({name:o,label:this.getLabel(),style:d,hidden:s,rules:s?[]:e},r),n),{},{children:l?c(yt,{style:p}):c(ar,{readonly:a,style:p})}))}return c(u,{})}}]),o}(),ar=function(e){i(l,ut);var o=or(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"duration",[0,0,0]),a(n(e),"changeValue",(function(t){return function(r){if("number"==typeof r){var n,i;e.duration[t]=r;var o=e.duration.map((function(e,t){return ce(0===t?"000":"00",e)}));null===(n=(i=e.props).onChange)||void 0===n||n.call(i,o.join(":"))}}})),e}return r(l,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.readonly,n=e.style;return"string"==typeof t&&(this.duration=t.split(":").map(Number)),s("div",{className:"duration",children:[c(g.Item,{children:c(j,{style:ir({width:"100%"},n),min:0,max:999,precision:0,value:this.duration[0],formatter:function(e){return e<100?e<10?"00"+e:"0"+e:e.toString()},onChange:this.changeValue(0),controls:!1,disabled:r})}),c("span",{children:"小时"}),c(g.Item,{children:c(j,{style:ir({width:"100%"},n),min:0,max:59,precision:0,value:this.duration[1],formatter:function(e){return e<10?"0"+e:e.toString()},onChange:this.changeValue(1),controls:!1,disabled:r})}),c("span",{children:"分"}),c(g.Item,{children:c(j,{style:ir({width:"100%"},n),min:0,max:59,precision:0,value:this.duration[2],formatter:function(e){return e<10?"0"+e:e.toString()},onChange:this.changeValue(2),controls:!1,disabled:r})}),c("span",{children:"秒"})]})}}]),l}();function cr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ur(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function sr(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}ue.extend(se),ue.extend(fe);var fr=function(e){i(o,Xe);var n=sr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.type,a=void 0===l?"date":l,s=i.format,f=void 0===s?"YYYY-MM-DD":s,p=i.showTime,d=void 0!==p&&p,h=i.preview,y=i.placeholder,v=i.allowClear,m=void 0===v||v,b=i.readonly,O=i.hidden,w=this.getStyles(),j=w.styles,P=w.itemStyles;return c(g.Item,ur(ur(ur({name:o,label:this.getLabel(),style:P,hidden:O,rules:O?[]:e},r),n),{},{children:h?c(ht,{style:j}):c(pr,{type:a,format:f,showTime:d,placeholder:y,allowClear:m,readonly:b,style:j})}))}return c(u,{})}}]),o}(),pr=function(e){i(o,ut);var n=sr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.type,n=e.format,i=e.showTime,o=e.placeholder,l=e.allowClear,a=e.readonly,u=e.style,s=e.onChange;return c(x,{value:t?ue(t,n):void 0,picker:r,format:n,showTime:i?{format:"HH:mm"}:void 0,placeholder:o,allowClear:l,disabled:a,style:u,onChange:function(e){null==s||s(null==e?void 0:e.format(n))}})}}]),o}();function dr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function yr(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}ue.extend(pe);var vr=function(e){i(o,Xe);var n=yr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.format,a=void 0===l?"HH:mm:ss":l,s=i.preview,f=i.placeholder,p=i.allowClear,d=void 0===p||p,h=i.readonly,y=i.hidden,v=this.getStyles(),m=v.styles,b=v.itemStyles;return c(g.Item,hr(hr(hr({name:o,label:this.getLabel(),style:b,hidden:y,rules:y?[]:e},r),n),{},{children:s?c(ht,{style:m}):c(mr,{format:a,placeholder:f,allowClear:d,readonly:h,style:m})}))}return c(u,{})}}]),o}(),mr=function(e){i(o,ut);var n=yr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.format,n=e.placeholder,i=e.allowClear,o=e.readonly,l=e.style,a=e.onChange;return c(R,{value:t?ue(t,r):void 0,format:r,placeholder:n,allowClear:i,disabled:o,style:l,onChange:function(e){null==a||a(null==e?void 0:e.format(r))}})}}]),o}();function gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Or(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var wr=function(e){return Array.isArray(e)?e:e&&e.list},jr=function(e){i(o,at);var n=Or(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,i=t.maxCount,o=t.fileType,l=t.fileTypeMessage,a=t.fileSize,s=t.readonly,f=t.hidden,p=this.getItem(),d=p.itemProps,h=p.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return c(g.Item,br(br(br({name:r,label:this.getLabel(),style:m,hidden:f,rules:f?[]:e,valuePropName:"list",getValueFromEvent:wr},d),h),{},{children:c(Pr,{maxCount:i,fileType:o,fileTypeMessage:l,fileSize:a,readonly:s,preview:n,style:v})}))}return c(u,{})}}]),o}(),Pr=function(e){i(l,ut);var o=Or(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"uploading",!1),a(n(e),"state",{fileList:[],modal:{open:!1,progress:0}}),a(n(e),"onBeforeUpload",(function(t){var r=e.props,n=r.fileSize,i=r.fileType,o=r.fileTypeMessage,l=null==i?void 0:i.replace(/\ +/g,"").split(",");if(!(l&&l.length>0))return D.error("文件类型不匹配!"),I.LIST_IGNORE;if(!l.includes(t.type))return D.error(o),I.LIST_IGNORE;if(n&&be.parse(n)<t.size)return D.error("上传的文件大小,不能超过 ".concat(n,"!")),I.LIST_IGNORE;return!0})),a(n(e),"onStart",(function(){clearInterval(e.timer),e.setState({modal:{open:!0,progress:0}}),e.uploading=!0})),a(n(e),"onProgress",(function(t){if(e.uploading){clearInterval(e.timer);var r=Math.round(t.percent/2);if(e.setState({modal:{open:!0,progress:r}}),50===r){var n=r;e.timer=setInterval((function(){e.uploading?e.setState({modal:{open:!0,progress:++n}}):(clearInterval(e.timer),e.setState({modal:{open:!1,progress:0}})),99===n&&clearInterval(e.timer)}),1e3)}}})),a(n(e),"onSuccess",(function(t,r){clearInterval(e.timer);var n=t.data,i=n.id,o=n.url;r.status="done",r.response=t,r.id=i,r.url=o;var l=[].concat(de(e.state.fileList),[r]);e.setState({fileList:l,modal:{open:!0,progress:100}},(function(){e.onChange(l),setTimeout((function(){e.setState({modal:{open:!1,progress:0}})}),500)})),e.uploading=!1})),a(n(e),"onError",(function(t,r,n){var i;clearInterval(e.timer);var o=[].concat(de(e.state.fileList),[n]);n.status="error",n.response=null!==(i=null==r?void 0:r.message)&&void 0!==i?i:"上传失败",e.setState({fileList:o,modal:{open:!1,progress:100}},(function(){e.onChange(o)})),e.uploading=!1})),a(n(e),"onRemove",(function(t){var r=e.state.fileList.filter((function(e){return e.id!==t.id}));e.setState({fileList:r},(function(){e.onChange(r)}))})),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Te.file.listUrl;t&&(null==t?void 0:t.length)>0&&t[0]&&$e(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return br(br({},e),{},{status:"done"})}));e.setState({fileList:r},(function(){e.onChange(r)}))})).catch((function(e){console.warn("url",r,e)}))}},{key:"onChange",value:function(e){var t,r;null===(t=(r=this.props).onChange)||void 0===t||t.call(r,e.filter((function(e){var t=e.id,r=e.status;return t&&"done"===r})).map((function(e){return e.id})))}},{key:"render",value:function(){var e=this.state,t=e.fileList,r=e.modal,n=this.props,i=n.preview,o=n.maxCount,l=n.readonly,a=n.style,f=o?Number(o):0;if(i)return c(gt,{fileList:t});var p={onStart:this.onStart,onSuccess:this.onSuccess,onProgress:this.onProgress,onError:this.onError};return s(u,{children:[c(I,br(br({action:Te.request.prefix+Te.file.uploadUrl,fileList:t,maxCount:f,disabled:l,beforeUpload:this.onBeforeUpload,onRemove:this.onRemove},p),{},{children:c(L,{disabled:l||f<=t.length,icon:c(he,{}),style:a,children:"上传"})})),s(V,{open:r.open,closable:!1,footer:null,children:[c("div",{children:"上传文件进度"}),c(E,{percent:r.progress})]})]})}}]),l}();function kr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Cr(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var xr=function(e){return Array.isArray(e)?e:e&&e.list},Rr=["image/jpeg","image/png"],Dr=function(e){i(o,at);var n=Cr(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,i=t.maxCount,o=t.fileSize,l=t.fileWidth,a=void 0===l?"100":l,s=t.fileHeight,f=void 0===s?"100":s,p=t.readonly,d=t.hidden,h=this.getItem(),y=h.itemProps,v=h.itemLayouts,m=this.getStyles(),b=m.styles,O=m.itemStyles;return c(g.Item,Sr(Sr(Sr({name:r,label:this.getLabel(),style:O,hidden:d,rules:d?[]:e,valuePropName:"list",getValueFromEvent:xr},y),v),{},{children:c(Ir,{maxCount:i,fileSize:o,fileWidth:Number(a),fileHeight:Number(f),readonly:p,preview:n,style:b})}))}return c(u,{})}}]),o}(),Ir=function(e){i(l,ut);var o=Cr(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"uploading",!1),a(n(e),"state",{fileList:[],fileView:void 0}),a(n(e),"onChangeValue",(function(t){var r=t.fileList.map((function(e){var t,r;if(200===(null===(t=e.response)||void 0===t?void 0:t.status)){var n=e.response.data,i=n.id;n.name;var o=n.url;e.id=i,e.url=o,e.status="done"}else 500===(null===(r=e.response)||void 0===r?void 0:r.status)&&(e.status="error",e.response=e.response.message);return e}));e.setState({fileList:r},(function(){e.onChange(r)}))})),a(n(e),"onBeforeUpload",(function(t){if(!Rr.includes(t.type))return D.error("上传文件类型,仅支持图片类型!"),I.LIST_IGNORE;var r=e.props.fileSize;if(r&&be.parse(r)<t.size)return D.error("上传的文件大小,不能超过 ".concat(r,"!")),I.LIST_IGNORE;return!0})),a(n(e),"onRemove",(function(t){var r=e.state.fileList.filter((function(e){return e.id!==t.id}));e.setState({fileList:r},(function(){e.onChange(r)}))})),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Te.file.listUrl;t&&(null==t?void 0:t.length)>0&&t[0]&&$e(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return Sr(Sr({},e),{},{status:"done"})}));e.setState({fileList:r},(function(){e.onChange(r)}))})).catch((function(e){console.warn("url",r,e)}))}},{key:"onChange",value:function(e){var t,r;null===(t=(r=this.props).onChange)||void 0===t||t.call(r,e.filter((function(e){var t=e.id,r=e.status;return t&&"done"===r})).map((function(e){return e.id})))}},{key:"render",value:function(){var e=this,t=this.state,r=t.fileList,n=t.fileView,i=this.props,o=i.preview,l=i.maxCount,a=i.readonly,f=i.fileWidth,p=void 0===f?100:f,d=i.fileHeight,h=void 0===d?100:d,y=i.style,v=l?Number(l):0;return o?c(bt,{fileList:r,width:p,height:h,style:y}):s(u,{children:[c(Oe,{rotationSlider:!0,modalTitle:"图片编辑",modalOk:"确认",modalCancel:"取消",aspect:p/h,children:c(I,{listType:"picture-card",accept:Rr.join(","),action:Te.request.prefix+Te.file.uploadUrl,fileList:r,maxCount:v,disabled:a,beforeUpload:this.onBeforeUpload,onChange:this.onChangeValue,onRemove:this.onRemove,onPreview:function(t){return e.setState({fileView:t})},children:!a&&Number(v)>r.length&&c(L,{type:"link",icon:c(ye,{}),style:y})})}),(null==n?void 0:n.id)&&c(V,{title:n.name,open:!0,footer:null,onCancel:function(){return e.setState({fileView:void 0})},children:c("img",{alt:n.name,style:{width:"100%"},src:n.url})})]})}}]),l}();function Lr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Er(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Br=function(e){return Array.isArray(e)?e:e&&e.list},Tr=function(e){i(o,at);var n=Er(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,i=t.maxCount,o=t.fileType,l=t.fileTypeMessage,a=t.fileSize,s=t.readonly,f=t.hidden,p=this.getItem(),d=p.itemProps,h=p.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return c(g.Item,Vr(Vr(Vr({name:r,label:this.getLabel(),style:m,hidden:f,rules:f?[]:e,valuePropName:"list",getValueFromEvent:Br},d),h),{},{children:c(Fr,{maxCount:i,fileType:o,fileTypeMessage:l,fileSize:a,readonly:s,preview:n,style:v})}))}return c(u,{})}}]),o}(),Fr=function(e){i(l,ut);var o=Er(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"uploading",!1),a(n(e),"state",{fileList:[],modal:{open:!1,progress:0}}),a(n(e),"onBeforeUpload",(function(t){var r=e.props,n=r.fileSize,i=r.fileType,o=r.fileTypeMessage,l=null==i?void 0:i.replace(/\ +/g,"").split(",");if(!(l&&l.length>0))return D.error("文件类型不匹配!"),I.LIST_IGNORE;if(!l.includes(t.type))return D.error(o),I.LIST_IGNORE;if(n&&be.parse(n)<t.size)return D.error("上传的文件大小,不能超过 ".concat(n,"!")),I.LIST_IGNORE;return!0})),a(n(e),"customRequest",(function(t){var r,n,i,o,l,a,c,u={blockSize:Te.chunk.chunkSize,checkFile:(c=te(re.mark((function e(t){var r,n,i;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,$e("post form "+Te.chunk.checkFile)({fileName:r,fileMd5:n,fileSize:i});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)}),checkBlock:(a=te(re.mark((function e(t){var r,n,i,o;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.blockMd5,o=t.blockIndex,e.next=3,$e("post form "+Te.chunk.checkChunk)({fileName:r,fileMd5:n,blockMd5:i,blockIndex:o});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)}),uploadBlock:(l=te(re.mark((function e(t){var r,n,i,o,l,a;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.blockMd5,o=t.blockIndex,l=t.file,(a=new FormData).append("blockIndex",String(o)),a.append("blockMd5",i),a.append("fileName",r),a.append("fileMd5",n),a.append("file",l),e.next=9,$e("post form "+Te.chunk.chunkUpload)(a);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)}),mergeBlock:(o=te(re.mark((function e(t){var r,n,i;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,$e("post form "+Te.chunk.doMerge)({fileName:r,fileMd5:n,fileSize:i});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)}),mergeProgress:(i=te(re.mark((function e(){var t;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$e(Te.chunk.mergeProgress)();case 2:return t=e.sent,e.abrupt("return",null==t?void 0:t.data);case 4:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)}),verifyFile:(n=te(re.mark((function e(t){var r,n,i;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,$e("post form "+Te.chunk.onComplete)({fileName:r,fileMd5:n,fileSize:i});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)}),verifyProgress:(r=te(re.mark((function e(){var t;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$e(Te.chunk.completeProgress)();case 2:return t=e.sent,e.abrupt("return",null==t?void 0:t.data);case 4:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},s=we.create(u);s.progress((function(t,r){t.status="uploading",e.setState({modal:{open:!0,progress:r}})})),s.complete((function(t){var r=t.response,n=r.id,i=r.url;t.id=n,t.url=i,t.status="done";var o=[].concat(de(e.state.fileList),[t]);e.setState({fileList:o,modal:{open:!1,progress:0}},(function(){e.onChange(o)}))})),s.error((function(t,r){t.status="error",t.response=r;var n=e.state.fileList,i=n.findIndex((function(e){return e.uid===t.uid}));-1===i?n.push(t):n[i]=t,e.setState({fileList:n,modal:{open:!1,progress:0}})})),s.start(t.file)})),a(n(e),"onRemove",(function(t){var r=e.state.fileList.filter((function(e){return e.id!==t.id}));e.setState({fileList:r},(function(){e.onChange(r)}))})),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Te.file.listUrl;t&&t.length>0&&$e(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return Vr(Vr({},e),{},{status:"done"})}));e.setState({fileList:r},(function(){e.onChange(r)}))})).catch((function(e){console.warn("url",r,e)}))}},{key:"onChange",value:function(e){var t,r;null===(t=(r=this.props).onChange)||void 0===t||t.call(r,e.filter((function(e){return"done"===e.status})).map((function(e){return e.id})))}},{key:"render",value:function(){var e=this.state,t=e.fileList,r=e.modal,n=this.props,i=n.preview,o=n.maxCount,l=n.readonly,a=n.style,f=o?Number(o):0;return i?c(gt,{fileList:t}):s(u,{children:[c(I,{action:Te.request.prefix+Te.file.uploadUrl,fileList:t,maxCount:f,disabled:l,beforeUpload:this.onBeforeUpload,customRequest:this.customRequest,onRemove:this.onRemove,children:c(L,{disabled:l||f<=t.length,icon:c(he,{}),style:a,children:"上传"})}),s(V,{open:r.open,closable:!1,footer:null,children:[c("div",{children:"上传文件进度"}),c(E,{percent:r.progress})]})]})}}]),l}(),Ar=["worksId","worksExtraId"];function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ur(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var qr=function(e){i(o,at);var n=Ur(o);function o(){return t(this,o),n.apply(this,arguments)}return r(o,[{key:"getColumns",value:function(){var e,t=H(this.props.children,{tag:"Columns"});return t?null===(e=t.children)||void 0===e?void 0:e.map((function(e){var t;return Mr(Mr({},e),{},{rules:null===(t=e.rules)||void 0===t?void 0:t.map(Ie)})})):[]}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.plusRules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.title,a=i.preview,s=i.readonly,f=i.hidden,p=this.getStyles(),d=p.styles,h=p.itemStyles;return c(g.Item,Mr(Mr(Mr({name:o,style:h,hidden:f,rules:f?[]:e,valuePropName:"list"},r),n),{},{children:c(zr,{preview:a||s,title:l,columns:this.getColumns(),style:d})}))}return c(u,{})}}]),o}(),zr=function(e){i(l,ut);var o=Ur(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"state",{dataSource:[],modal:{title:"",entity:void 0,show:!1}}),a(n(e),"onFinish",(function(t){var r=e.state.dataSource,n=[];t.id||t.uid?n=r.map((function(e){return t.id&&e.id===t.id||t.uid&&e.uid===t.uid?Mr(Mr({},e),t):e})):(t.index=r.length+1,t.uid=_(),n=[].concat(de(r),[t])),e.setState({dataSource:n,modal:{title:"",entity:void 0,show:!1}},(function(){var t,r;null===(t=(r=e.props).onChange)||void 0===t||t.call(r,n)}))})),a(n(e),"onCancel",(function(){e.setState({modal:{title:"",entity:void 0,show:!1}})})),e}return r(l,[{key:"componentDidMount",value:function(){var e=this.props,t=e.list,r=e.onChange;if(Array.isArray(t)){var n=t.map((function(e,t){return e.worksId,Mr({id:e.worksExtraId,index:t+1},ee(e,Ar))}));this.setState({dataSource:n},(function(){null==r||r(n)}))}}},{key:"getColumns",value:function(){var e=this,t=this.props,r=t.title,n=t.preview,i=t.columns,o=t.onChange,l=this.state.dataSource;return n?i:K(i,{title:"操作",dataIndex:"option",valueType:"option",render:function(t,n){return[s(b,{children:[c("a",{onClick:function(){e.setState({modal:{title:"修改".concat(r),entity:n,show:!0}})},children:"修改"},"modifly"),c("a",{onClick:function(){V.confirm({title:"警告",icon:c(ve,{}),content:"请确认是否删除该项数据?",okText:"确认",cancelText:"取消",onOk:function(){var t=l.filter((function(e){var t=e.id,r=e.uid;return!(t&&n.id===t||r&&n.uid===r)}));e.setState({dataSource:t},(function(){null==o||o(t)}))}})},children:"删除"},"delete")]},"option")]}})}},{key:"render",value:function(){var e=this,t=this.props,r=t.title,n=t.preview,i=t.style,o=this.state,l=o.dataSource,a=o.modal,u=this.getColumns();return s(B,{title:r,bodyStyle:{padding:"0px 12px"},extra:n?null:c("a",{onClick:function(){e.setState({modal:{title:"新建".concat(r),entity:void 0,show:!0}})},children:"添加"},"new"),children:[c(T,{rowKey:"index",size:"small",style:i,columns:u,dataSource:l}),a.show&&c(_r,{title:a.title,entity:a.entity,columns:u,onFinish:this.onFinish,onCancel:this.onCancel})]})}}]),l}(),_r=function(t){var r,n=t.title,i=t.entity,o=t.columns,l=t.onFinish,a=t.onCancel,u=g.useForm(),s=e(u,1)[0];return c(V,{title:n,width:740,open:!0,destroyOnClose:!0,onCancel:a,onOk:(r=te(re.mark((function e(){return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.validateFields().then((function(e){l(Mr(Mr({},i),e))})).catch((function(e){console.warn(e)}));case 2:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)}),children:c(g,{form:s,name:"modalTable",initialValues:i,wrapperCol:{span:22},autoComplete:"off",layout:"vertical",children:c(F,{children:o.length>0&&o.map((function(e){var t=e.title,r=e.dataIndex,n=e.placeholder,i=e.rules;if("index"!==r&&"option"!==r)return c(A,{span:12,children:c(g.Item,{label:t,name:r,rules:i,children:c(w,{placeholder:n})})},r)}))})})})},Wr=["id","index"];function Gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $r(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Yr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yr(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return l=e.done,e},e:function(e){a=!0,o=e},f:function(){try{l||null==r.return||r.return()}finally{if(a)throw o}}}}function Yr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Kr(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var Jr=function(e){i(l,at);var o=Kr(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"itemList",[]),a(n(e),"columnList",[]),a(n(e),"state",{doc:void 0,loading:!0}),a(n(e),"initItems",function(){var t=te(re.mark((function t(r){var n,i,o,l,a,c,u,s,f,p,d,h,y,v,m,g,b,O,w,j;return re.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.columnList=H(e.props.children,{tag:"Columns"}).children,n=e.columnList.map((function(e){return e.dataIndex})),i=xe.selectors(r,"[code]"),o=$r(i),t.prev=4,o.s();case 6:if((l=o.n()).done){t.next=29;break}if(a=l.value,c=a.getAttribute("code"),u=a.getAttribute("title"),s=a.tagName.toLowerCase(),!c||!n.includes(c)){t.next=27;break}if(f={},p=a.getAttribute("remote"),!((d=xe.selectors(a,"Option")).length>0)){t.next=20;break}h=$r(d);try{for(h.s();!(y=h.n()).done;)v=y.value,m=v.getAttribute("value"),g=v.textContent,m&&g&&(f[m]=g)}catch(e){h.e(e)}finally{h.f()}t.next=26;break;case 20:if(!p){t.next=26;break}return t.next=23,e.request(p);case 23:b=t.sent,O=$r(b);try{for(O.s();!(w=O.n()).done;)j=w.value,f[j.key]=j.label}catch(e){O.e(e)}finally{O.f()}case 26:e.itemList.push({code:c,title:u,type:s,data:f});case 27:t.next=6;break;case 29:t.next=34;break;case 31:t.prev=31,t.t0=t.catch(4),o.e(t.t0);case 34:return t.prev=34,o.f(),t.finish(34);case 37:e.setState({loading:!1});case 38:case"end":return t.stop()}}),t,null,[[4,31,34,37]])})));return function(e){return t.apply(this,arguments)}}()),e}return r(l,[{key:"componentDidMount",value:function(){var e=this,t=this.props.formId;this.setState({loading:!0}),this.request(Te.form.documentUrl,{formId:t}).then((function(t){var r=xe.toDocument(t);e.setState({doc:r}),e.initItems(r)}))}},{key:"render",value:function(){if(this.display()&&!this.state.loading){this.onComputeValue();var e=this.plusRules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.title,a=i.witdh,s=i.preview,f=i.readonly,p=i.hidden,d=this.getStyles(),h=d.styles,y=d.itemStyles,v=this.state.doc;return c(g.Item,Hr(Hr(Hr({name:o,style:y,hidden:p,rules:p?[]:e,valuePropName:"list"},r),n),{},{children:c(Qr,{preview:s||f,title:l,witdh:a,columns:this.columnList,items:this.itemList,document:v,style:h})}))}return c(u,{})}}]),l}(),Qr=function(e){i(l,ut);var o=Kr(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"state",{dataSource:[],modal:{title:"",entity:void 0,show:!1}}),a(n(e),"onFinish",(function(t){var r=e.state.dataSource,n=[];t.id?n=r.map((function(e){return e.id===t.id?Hr(Hr({},e),t):e})):(t.id=_(),t.index=r.length+1,n=[].concat(de(r),[t])),e.onChange(n)})),a(n(e),"onCancel",(function(){e.setState({modal:{title:"",entity:void 0,show:!1}})})),e}return r(l,[{key:"componentDidMount",value:function(){var e=this.props.list;if(Array.isArray(e)){var t=e.map((function(e,t){var r=Pe({},(je(e),e));return Hr({id:_(),index:t+1},r)}));this.onChange(t)}}},{key:"onChange",value:function(e){var t=this;this.setState({dataSource:e,modal:{title:"",entity:void 0,show:!1}},(function(){var r,n;null===(r=(n=t.props).onChange)||void 0===r||r.call(n,e.map((function(e){return e.id,e.index,ee(e,Wr)})))}))}},{key:"getColumns",value:function(){var e=this,t=this.props,r=t.preview,n=t.title,i=t.columns,o=t.items,l=this.state.dataSource,a=i.map((function(e){var t=e.dataIndex,r=o.find((function(e){return e.code===t}));return r&&(e.title||(e.title=r.title),e.render=function(e){return 0===Object.keys(r.data).length?e:r.data[e]}),e}));return r?a:K(a,{title:"操作",dataIndex:"option",valueType:"option",render:function(t,r){return[s(b,{children:[c("a",{onClick:function(){e.setState({modal:{title:"修改".concat(n),entity:r,show:!0}})},children:"修改"},"modifly"),c("a",{onClick:function(){V.confirm({title:"警告",icon:c(ve,{}),content:"请确认是否删除该项数据?",okText:"确认",cancelText:"取消",onOk:function(){var t=l.filter((function(e){var t=e.id;return!(t&&r.id===t)}));e.onChange(t)}})},children:"删除"},"delete")]},"option")]}})}},{key:"render",value:function(){var e=this,t=this.props,r=t.preview,n=t.title,i=t.witdh,o=t.document,l=t.style,a=this.state,u=a.dataSource,f=a.modal,p=this.getColumns();return s(B,{title:n,bodyStyle:{padding:"0px 12px"},extra:r?null:c("a",{onClick:function(){e.setState({modal:{title:"新建".concat(n),entity:void 0,show:!0}})},children:"添加"},"new"),children:[c(T,{rowKey:"id",size:"small",style:l,columns:p,dataSource:u}),f.show&&c(Xr,{title:f.title,witdh:i,entity:f.entity,document:o,onFinish:this.onFinish,onCancel:this.onCancel})]})}}]),l}(),Xr=function(e){var t,r=e.title,n=e.witdh,i=void 0===n?"740":n,o=e.entity,l=e.document,a=e.onFinish,u=e.onCancel,s=h();return c(V,{title:r,width:Number(i),open:!0,destroyOnClose:!0,onCancel:u,onOk:(t=te(re.mark((function e(){var t,r,n;return re.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,null===(t=s.current)||void 0===t?void 0:t.validateFields();case 3:n=null===(r=s.current)||void 0===r?void 0:r.getFieldsValue(),a(Hr(Hr({},o),n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),function(){return t.apply(this,arguments)}),children:l&&c(yn,{form:s,document:l,initialValues:o})})},Zr=Object.freeze({__proto__:null,Checkbox:Ht,DatePicker:fr,Duration:lr,Editor:Tt,FormList:Jr,Label:ft,Number:Lt,Photo:Dr,Radio:Qt,Select:Ut,SuperUpload:Tr,Switch:rr,Table:qr,Text:Pt,TextArea:xt,TimePicker:vr,Tooltip:dt,Upload:jr}),en=function(e){var t=e.children,r=e.gutter;return c(F,{gutter:Number(r),style:{margin:0},children:t})},tn=function(e){var t=e.span,r=e.children;return c(A,{span:t,children:r})},rn=function(e){var t=e.direction,r=e.stepIndex,n=e.onChangeSetp,i=e.children,o=y((function(){return null==i?void 0:i.map((function(e){var t=e.id,r=e.attributes;return{key:t,title:r.title,description:r.description}}))}),[i]);return c(N,{current:r,direction:t,onChange:n,items:o,style:{padding:16,backgroundColor:"white"}})},nn=M.Content,on=v((function(e){var t=e.currentStepIndex,r=e.stepIndex,n=e.style,i=e.children,o=y((function(){var e=n?Ye(n):{padding:16,backgroundColor:"white"};return t!==Number(r)&&Object.assign(e,{display:"none"}),e}),[t]);return c(nn,{style:o,children:i})})),ln=function(e){var t=e.dashed,r=void 0!==t&&t,n=e.orientation,i=void 0===n?"center":n,o=e.children;return c(U,{dashed:r,orientation:i,style:{color:"#055ab5",fontWeight:"bold"},children:o})},an={display:"none"},cn={display:"block"},un=v((function(t){var r=t.defaultExpanded,n=void 0===r||r,i=t.on,o=t.off,l=t.style,a=t.collapse,f=t.children,p=m(n),d=e(p,2),h=d[0],y=d[1],v=Ye(l);return a?s(u,{children:[c("div",{style:v,children:s(L,{type:"link",onClick:function(){y(!h)},children:[h?o:i,c(h?me:ge,{})," "]})}),c("div",{style:h?cn:an,children:f})]}):c(u,{children:f})}));function sn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sn(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pn(e){var t=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 r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var dn=Zr,hn={Col:tn,Collapse:un,Content:on,Divider:ln,Row:en,Steps:rn},yn=function(o){i(d,p);var l=pn(d);function d(e){var r,i,o;return t(this,d),o=l.call(this,e),a(n(o),"state",{stepIndex:0,root:void 0,loading:!0}),a(n(o),"onValuesChange",(function(e){o.setState({values:e})})),a(n(o),"onStepIndex",(function(e){o.setState({stepIndex:e})})),a(n(o),"children",(function(e){var t,r,n=null!==(t=null===(r=o.customComponents)||void 0===r?void 0:r[e.tag])&&void 0!==t?t:dn[e.tag];return n?o.component(e,n):hn[e.tag]?o.container(e):o.applet(e)})),o.styles=null!==(r=e.style)&&void 0!==r?r:{},o.form=null!==(i=e.form)&&void 0!==i?i:f.createRef(),o}return r(d,[{key:"componentDidMount",value:function(){var t,r,n=this,i=this.props,o=i.document,l=i.preview,u=(t="string"==typeof o?xe.getRoot(o):xe.parser(o)).attributes,s=u.style,f=u.labelCol,p=u.wrapperCol,d=u.showTitle;if(this.showTitle=!!d,"string"==typeof s){var h=null==s?void 0:s.replace(/\ +/g,"").split(";");null==h||h.forEach((function(t){if(t){var r=t.split(":"),i=e(r,2),o=i[0],l=i[1];Object.assign(n.styles,a({},G(o),l))}}))}f&&p&&(this.layouts={labelCol:{span:f},wrapperCol:{span:p}}),this.preview=null!=l&&l,Te.components&&(this.customComponents=J(Te.components,(function(e){return function(t){return c(nt,fn({Component:e},t))}}))),this.setState({root:t,loading:!0}),"function"==typeof(r=function(e){n.setState({loading:e})})&&Ne.push(r)}},{key:"componentWillUnmount",value:function(){var e;null===(e=this.form.current)||void 0===e||e.resetFields(),this.setState({root:void 0,loading:!0})}},{key:"setComponentStatus",value:function(e){var t=this.props,r=t.hidden,n=t.readonly;if(Q(r))e.hidden=r;else if(X(r))e.hidden=r.includes(e.code);else if(Z(r))e.hidden=!!r[e.code];else{var i;e.hidden=null!==(i=e.hidden)&&void 0!==i&&i}if(Q(n))e.readonly=n;else if(X(n))e.readonly=n.includes(e.code);else if(Z(n))e.readonly=!!n[e.code];else{var o;e.readonly=null!==(o=e.readonly)&&void 0!==o&&o}}},{key:"component",value:function(e,t){var r=e.id,n=e.attributes,i=e.children;return this.setComponentStatus(n),c(t,fn(fn({preview:this.preview},n),{},{children:null==i?void 0:i.map(this.children)}),r)}},{key:"container",value:function(e){var t=e.id,r=e.tag,n=e.attributes,i=e.text,o=e.children;return"Row"===r?c(en,fn(fn({},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Col"===r?c(tn,{span:Number(n.span),children:null==o?void 0:o.map(this.children)},t):"Collapse"===r?c(un,fn(fn({collapse:this.props.collapse},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Content"===r?c(on,fn(fn({currentStepIndex:this.state.stepIndex},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Steps"===r?c(rn,fn(fn({stepIndex:this.state.stepIndex,onChangeSetp:this.onStepIndex},n),{},{children:o}),t):"Divider"===r?c(ln,fn(fn({},n),{},{children:i}),t):void 0}},{key:"applet",value:function(e){var t=this,r=e.tag,n=e.attributes,i=e.cdata,o=e.children;if("Columns"===r){var l=null==o?void 0:o.map((function(e){var r=e.attributes,n=e.children;if(n){var i,o=H(n.map(t.children),{tag:"Validates"});return fn(fn({},r),{},{rules:null!==(i=null==o?void 0:o.children)&&void 0!==i?i:[]})}return r}));return{tag:r,children:l}}return"Options"===r?{tag:r,children:null==o?void 0:o.map((function(e){return{key:e.attributes.value,label:e.text}}))}:"Validates"===r?{tag:r,children:null==o?void 0:o.map((function(e){return e.attributes}))}:"Conditions"===r?{tag:r,type:n.type,action:n.action,children:null==o?void 0:o.map((function(e){return e.attributes}))}:"Collection"===r||"Compute"===r?{tag:r,cdata:i}:void 0}},{key:"render",value:function(){var e,t=this.state,r=t.root,n=t.loading,i=this.props.initialValues;return s(u,{children:[r&&c(Le.Provider,{value:fn(fn({},this.props),{},{form:this.form,showTitle:this.showTitle}),children:c(vn,fn(fn({form:this.form,style:n?fn(fn({},this.styles),{},{display:"none"}):this.styles,initialValues:i,onValuesChange:this.onValuesChange},this.layouts),{},{children:null===(e=r.children)||void 0===e?void 0:e.map(this.children)}))}),n&&c(q,{active:!0})]})}}]),d}(),vn=function(e){i(l,e);var o=pn(l);function l(){var e;t(this,l);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return e=o.call.apply(o,[this].concat(i)),a(n(e),"onFinish",(function(e){console.log("Success:",e)})),e}return r(l,[{key:"render",value:function(){var e=this.props,t=e.form,r=e.style,n=e.labelCol,i=e.wrapperCol,o=e.initialValues,l=e.children,a=e.onValuesChange;return c(g,{ref:t,style:r,labelCol:n,wrapperCol:i,initialValues:o,onFinish:this.onFinish,autoComplete:"off",onValuesChange:function(e){a(e)},children:l})}}]),l}(f.PureComponent);export{Le as DesignContext,Xe as UIComponent,at as UIListComponent,yn as default,Fe as defineConfig};
2
2
  //# sourceMappingURL=index.tsx.map