antd-form-document 5.0.10 → 5.0.12

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.
Files changed (40) hide show
  1. package/README.md +64 -61
  2. package/dist/index.tsx +1 -1
  3. package/dist/index.tsx.map +1 -1
  4. package/dist/src/applets/index.d.ts.map +1 -1
  5. package/dist/src/components/Audio/index.d.ts.map +1 -1
  6. package/dist/src/components/Checkbox/index.d.ts.map +1 -1
  7. package/dist/src/components/Editor/index.d.ts +1 -0
  8. package/dist/src/components/Editor/index.d.ts.map +1 -1
  9. package/dist/src/components/FormList/index.d.ts.map +1 -1
  10. package/dist/src/components/Photo/index.d.ts.map +1 -1
  11. package/dist/src/components/Radio/index.d.ts.map +1 -1
  12. package/dist/src/components/Rate/index.d.ts.map +1 -1
  13. package/dist/src/components/Select/index.d.ts.map +1 -1
  14. package/dist/src/components/SuperUpload/index.d.ts.map +1 -1
  15. package/dist/src/components/Upload/index.d.ts.map +1 -1
  16. package/dist/src/components/Video/index.d.ts.map +1 -1
  17. package/dist/src/config.d.ts +1 -2
  18. package/dist/src/config.d.ts.map +1 -1
  19. package/dist/src/containers/Col/index.d.ts.map +1 -1
  20. package/dist/src/containers/Divider/index.d.ts.map +1 -1
  21. package/dist/src/containers/Row/index.d.ts.map +1 -1
  22. package/dist/src/containers/Steps/index.d.ts.map +1 -1
  23. package/dist/src/form/index.d.ts.map +1 -1
  24. package/dist/src/preview/index.d.ts.map +1 -1
  25. package/dist/src/service/ProComponent.d.ts.map +1 -1
  26. package/dist/src/service/UIComponent.d.ts +2 -8
  27. package/dist/src/service/UIComponent.d.ts.map +1 -1
  28. package/dist/src/service/UIListComponent.d.ts +8 -1
  29. package/dist/src/service/UIListComponent.d.ts.map +1 -1
  30. package/dist/src/service/UploadComponent.d.ts +25 -0
  31. package/dist/src/service/UploadComponent.d.ts.map +1 -0
  32. package/dist/src/service/WidgetComponent.d.ts +10 -1
  33. package/dist/src/service/WidgetComponent.d.ts.map +1 -1
  34. package/dist/src/service/index.d.ts +1 -0
  35. package/dist/src/service/index.d.ts.map +1 -1
  36. package/dist/src/utils/loading.d.ts.map +1 -1
  37. package/dist/src/utils/request.d.ts.map +1 -1
  38. package/dist/src/utils/style.d.ts +1 -1
  39. package/dist/src/utils/style.d.ts.map +1 -1
  40. package/package.json +4 -3
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/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/inherits";import l from"@babel/runtime/helpers/defineProperty";import{jsx as a,Fragment as s,jsxs as u}from"react/jsx-runtime";import c,{PureComponent as p,useEffect as f,useRef as d,useMemo as h,memo as v,useState as y}from"react";import{Form as m,Space as g,Image as b,Input as O,InputNumber as w,Select as j,Checkbox as P,Radio as S,Switch as k,DatePicker as C,TimePicker as x,Upload as D,Button as L,Modal as I,Progress as V,message as R,Rate as E,Card as B,Table as T,Row as F,Col as N,Steps as A,Layout as M,Divider as U,Skeleton as q}from"antd";import{parseInt as z,uniqueId as _,cloneDeep as W,camelCase as H,find as G,every as $,some as Y,concat as K,mapValues as J,isBoolean as Q,isArray as X,isObject as Z,isUndefined as ee}from"lodash";import te from"@babel/runtime/helpers/objectWithoutProperties";import re from"@babel/runtime/helpers/asyncToGenerator";import ne from"@babel/runtime/regenerator";import ie from"moment";import{extend as oe}from"umi-request";import{parse as le,compile as ae}from"path-to-regexp";import se from"wangeditor-for-react";import ue from"number-format.js";import ce from"dayjs";import pe from"dayjs/plugin/weekday";import fe from"dayjs/plugin/localeData";import de from"dayjs/plugin/customParseFormat";import he from"@babel/runtime/helpers/toConsumableArray";import{UploadOutlined as ve,PlusOutlined as ye,StarFilled as me,QuestionCircleOutlined as ge,UpOutlined as be,DownOutlined as Oe}from"@ant-design/icons";import we from"bytes";import je from"antd-img-crop";import Pe from"file-block-upload";import Se from"@babel/runtime/helpers/objectDestructuringEmpty";import ke from"@babel/runtime/helpers/extends";function Ce(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return xe(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xe(e,t):void 0}}(e))||t){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 xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var De=function(){return r((function e(r){t(this,e),l(this,"attributes",{}),this.id=_();var n,i=Ce(r.attributes);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.value.trim();this.isBoolean(a)&&(a=this.toBoolean(a)),this.attributes[o.name]=a}}catch(e){i.e(e)}finally{i.f()}this.children=new Array;var s,u=Ce(r.childNodes);try{for(u.s();!(s=u.n()).done;){var c,p,f=s.value;if(f instanceof Element)null===(c=this.children)||void 0===c||c.push(new e(f));if(3===f.nodeType&&f.textContent&&(this.text=f.textContent),4===f.nodeType)this.cdata=null===(p=f.nodeValue)||void 0===p?void 0:p.replace(/\ +/g," ").replace(/[\t\r\n]/g,"")}}catch(e){u.e(e)}finally{u.f()}this.tag=r.nodeName}),[{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)}}])}(),Le=function(){function e(){t(this,e)}return r(e,null,[{key:"parser",value:function(e){var t=e.childNodes[0];return new De(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)}}])}();function Ie(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 Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Re=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,s=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:"number",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 s?{type:"string",pattern:new RegExp(s),message:u}:{type:r,message:u}},Ee=c.createContext({});function Be(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 Te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fe=function(){function e(r){if(t(this,e),l(this,"request",{prefix:"api",headers:{},params:{},route:"/design"}),l(this,"file",{listUrl:"/file/list",downloadUrl:"/file/download",uploadUrl:"/file/upload",previewUrl:"/file/preview",extraData:function(e,t){}}),l(this,"style",{labelStyle:{color:"#055ab5"}}),l(this,"form",{documentUrl:"/form/:formId"}),l(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"}),l(this,"mimeType",{}),r){var n=r.request,i=r.file,o=r.form,a=r.chunk,s=r.mimeType,u=r.components,c=r.previewComponents;this.request=Te(Te({},this.request),n),this.file=Te(Te({},this.file),i),this.form=Te(Te({},this.form),o),this.chunk=Te(Te({},this.chunk),a),this.mimeType=s,this.components=u,this.previewComponents=c}}return r(e,null,[{key:"init",value:function(t){return new e(t)}}])}(),Ne=Fe.init(),Ae=function(e){Ne=Fe.init(e)},Me=0,Ue=[],qe=function(e){return new Promise((function(t){setTimeout((function(){t(e)}),e)}))},ze=function(){var e=re(ne.mark((function e(t){var r,n;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===Me)for(r=0,n=Ue;r<n.length;r++)(0,n[r])(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_e=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==Me++&&ze(!0);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),We=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==--Me&&ze(!1);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),He=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qe(1e3);case 2:0===Me?ze(!1):He();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ge=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Me=0,ze(!1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$e=["status"];function Ye(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 Ke=oe({prefix:Ne.request.prefix,headers:Ne.request.headers,timeout:1e4});Ke.use(function(){var e=re(ne.mark((function e(t,r){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,_e(),e.next=4,r();case 4:We(),e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(0),Ge(),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 Je=function(t,r){var n=W(r.data),i=t;try{var o,a="",s=i.match(/[a-zA-z]+:\/\/[^/]*/);if(s)a=e(s,1)[0],i=i.slice(a.length);var u=null===(o=le(i))||void 0===o?void 0:o.tokens;i=ae(i)(r.data),u.forEach((function(e){e instanceof Object&&e.name in n&&delete n[e.name]})),i=a+i}catch(e){console.error(e.message)}return"GET"===r.method.toLocaleUpperCase()?r.params=n:r.type&&(r.requestType=r.type),r.prefix=Ne.request.prefix,Ke(i,r).then((function(e){var t=e.status,r=te(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?Ye(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ye(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})}))},Qe=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 Je(i,{method:r,type:n,data:e})}},Xe=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],a=i[1];Object.assign(r,l({},H(o),a))}}));return r};function Ze(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?Ze(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tt=function(){return!!e})()}var rt=function(s){function u(){var r,o,a,s;t(this,u);for(var c=arguments.length,p=new Array(c),f=0;f<c;f++)p[f]=arguments[f];return o=this,a=u,s=[].concat(p),a=i(a),r=n(o,tt()?Reflect.construct(a,s||[],i(o).constructor):a.apply(o,s)),l(r,"styleWrapper",{style:{borderBottom:"1px solid #d9d9d9"}}),l(r,"request",function(){var t=re(ne.mark((function t(n,i){var o;return ne.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=null!=i?i:r.context.params,t.abrupt("return",Qe(n)(et({},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 o(u,s),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=Xe(r);return a("span",{style:et(et({},Ne.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:Xe(t),itemStyles:Xe(r)}}},{key:"display",value:function(){var e=this.getFieldsValue(),t=this.props,r=t.defaultHide,n=void 0!==r&&r,i=t.children,o=t.preview,l=!n,a=G(i,{tag:"Conditions"});if(a){var s,u=a.type,c=a.action,p=null===(s=a.children)||void 0===s?void 0:s.map(function(e,t){return function(r){var n=r.test;try{if(e){e=Ve(Ve({},e),{},{preview:t});var i=Object.keys(e).join(",");return new Function("{".concat(i,"}"),"return ".concat(n))(e)}}catch(e){}}}(e,o));if((null==p?void 0:p.length)>0&&void 0!==(null==p?void 0:p[0])){var f=!1;if((f="and"===u?$(p):Y(p))&&"hide"===c||!f&&"show"===c)return!1;if(!f&&"hide"===c||f&&"show"===c)return!0}}return l}},{key:"rules",value:function(){var e=this.props,t=e.preview,r=e.children;if(!t){var n,i,o=G(r,{tag:"Validates"});return null!==(n=null==o||null===(i=o.children)||void 0===i?void 0:i.map(Re))&&void 0!==n?n:[]}return[]}},{key:"collectionList",value:function(){var e=G(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=G(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,ie)}return new Function("moment","".concat(r))(ie)}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)}}])}(c.PureComponent);rt.contextType=Ee;var nt=["Component","defaultValue","style"];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){l(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(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lt=function(){return!!e})()}var at=function(){function e(){var r,o,a,s;t(this,e);for(var u=arguments.length,c=new Array(u),p=0;p<u;p++)c[p]=arguments[p];return o=this,a=e,s=[].concat(c),a=i(a),r=n(o,lt()?Reflect.construct(a,s||[],i(o).constructor):a.apply(o,s)),l(r,"initValue",(function(){var e=r.props.defaultValue;e&&r.forceUpdate((function(){r.setDefaultValue(e)}))})),l(r,"onChange",(function(e){r.setFieldValue(e)})),r}return o(e,rt),r(e,[{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,u=this.props,c=u.Component;u.defaultValue,u.style;var p=te(u,nt),f=this.getStyles(),d=f.styles,h=f.itemStyles;return a(m.Item,ot(ot(ot({name:o,label:this.getLabel(),style:h,hidden:l,rules:e},r),n),{},{children:a(c,ot(ot({},p),{},{style:d,onChange:this.onChange}))}))}return a(s,{})}}])}();function st(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 ut(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?st(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ct=function(){return!!e})()}var pt=function(){function e(){var r,o,a,s;t(this,e);for(var u=arguments.length,c=new Array(u),p=0;p<u;p++)c[p]=arguments[p];return o=this,a=e,s=[].concat(c),a=i(a),r=n(o,ct()?Reflect.construct(a,s||[],i(o).constructor):a.apply(o,s)),l(r,"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})),r}return o(e,rt),r(e,[{key:"optionList",value:function(){var e=G(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 ut(ut({},e),{},{validator:function(e,t){return(null==t?void 0:t.length)>0?Promise.resolve():Promise.reject()}})}if(e.min&&e.max){return ut(ut({},e),{},{validator:function(t,r){return r.length>=e.min&&r.length<=e.max?Promise.resolve():Promise.reject()}})}return ut({},e)}))}}])}();function ft(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ft=function(){return!!e})()}var dt=function(){function e(){return t(this,e),r=this,l=arguments,o=i(o=e),n(r,ft()?Reflect.construct(o,l||[],i(r).constructor):o.apply(r,l));var r,o,l}return o(e,p),r(e)}();function ht(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ht=function(){return!!e})()}var vt=function(){function e(){return t(this,e),r=this,l=arguments,o=i(o=e),n(r,ht()?Reflect.construct(o,l||[],i(r).constructor):o.apply(r,l));var r,o,l}return o(e,rt),r(e,[{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 a(m.Item,{style:l,hidden:n,rules:n?[]:e,wrapperCol:{span:24},children:a("div",{style:o,children:r})})}return a(s,{})}}])}();function yt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yt=function(){return!!e})()}var mt=function(){function e(){return t(this,e),r=this,l=arguments,o=i(o=e),n(r,yt()?Reflect.construct(o,l||[],i(r).constructor):o.apply(r,l));var r,o,l}return o(e,rt),r(e,[{key:"render",value:function(){var e,t=this.display(),r=null===(e=this.context.tooltip)||void 0===e||e;if(t&&r){var n=this.props,i=n.title,o=n.hidden,l=n.children,u=this.getStyles(),c=u.styles,p=u.itemStyles;return a(m.Item,{style:p,hidden:o,wrapperCol:{span:24},children:a("div",{style:c,children:null!=i?i:l})})}return a(s,{})}}])}(),gt=function(e){var t=e.value,r=e.type,n=e.style,i=e.onChange;return f((function(){null==i||i(t)}),[]),t&&"url"===r?t.split(/[,;\s]/).map((function(e){return a("div",{style:n,children:a("a",{href:e,target:"_blank",rel:"noreferrer",children:e})})})):a("div",{style:n,children:t})},bt=function(e){var t,r;return(null!==(t=null===(r=Ne.previewComponents)||void 0===r?void 0:r.PreviewText)&&void 0!==t?t:gt)(e)},Ot=function(e){var t=e.value;e.type,e.style;var r=e.onChange;return f((function(){null==r||r(t)}),[]),a("div",{dangerouslySetInnerHTML:{__html:t}})},wt=function(e){var t,r;return(null!==(t=null===(r=Ne.previewComponents)||void 0===r?void 0:r.PreviewEditor)&&void 0!==t?t:Ot)(e)},jt=function(e){var t=e.value,r=e.format,n=e.style,i=e.onChange;f((function(){i(t)}),[]);var o=r.trim().split(/\[.*?\]|[HMS]/),l=r.trim().split(new RegExp("[".concat(o.join(""),"]"))).filter((function(e){return e})),s=-1,u=null==t?void 0:t.split(":"),c=[];return o.forEach((function(e,t){e&&c.push(e),t<=l.length-1&&c.push(l[t])})),a("div",{style:n,children:c.map((function(e){return e.includes("H")?(s++,t?u[s]:"000"):e.includes("M")||e.includes("S")?(s++,t?u[s]:"00"):e})).join("")})},Pt=function(e){var t,r;return(null!==(t=null===(r=Ne.previewComponents)||void 0===r?void 0:r.PreviewDuration)&&void 0!==t?t:jt)(e)},St=function(e){var t=e.checked,r=e.style,n=e.onChange;return f((function(){n(t)}),[]),a("div",{style:r,children:t?"开启":"关闭"})},kt=function(e){var t,r;return(null!==(t=null===(r=Ne.previewComponents)||void 0===r?void 0:r.PreviewSwitch)&&void 0!==t?t:St)(e)},Ct=function(e){var t=e.value,r=e.list,n=e.style,i=e.onChange;if(f((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 a("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 a("div",{style:n,children:null==l?void 0:l.label})},xt=function(e){var t,r;return(null!==(t=null===(r=Ne.previewComponents)||void 0===r?void 0:r.PreviewList)&&void 0!==t?t:Ct)(e)},Dt=function(e){var t=e.fileList,r=Ne.request.prefix+Ne.file.downloadUrl,n=Ne.request.prefix+Ne.file.previewUrl;return a(s,{children:null==t?void 0:t.map((function(e){var t=e.id,i=e.name,o=e.url,l=e.contentType,s=r+"/"+t;return null!=l&&l.endsWith("pdf")?a("div",{children:u(g,{style:{paddingBottom:10},children:[a("a",{href:o,target:"_blank",rel:"noreferrer",children:i}),a("a",{href:s,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=l&&l.startsWith("image")?a("div",{children:u(g,{style:{paddingBottom:10},children:[u("div",{children:[a(b,{width:200,src:o,alt:i}),a("div",{children:i})]}),a("a",{href:s,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=l&&l.startsWith("video")?a("div",{children:u(g,{style:{paddingBottom:10},children:[u("div",{children:[a("video",{src:o,controls:!0,style:{width:260},children:"当前浏览器不支持视频播放,请使用最新版谷歌浏览器!"}),a("div",{children:i})]}),a("a",{href:s,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=l&&l.startsWith("audio")?a("div",{children:u("div",{style:{paddingBottom:10,display:"flex",alignItems:"center"},children:[u("div",{children:[a("audio",{src:o,controls:!0,style:{width:"calc(100% - 40px)",height:30},children:"当前浏览器不支持音频播放,请使用最新版谷歌浏览器!"}),a("div",{children:i})]}),a("a",{style:{paddingLeft:10},href:s,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=i&&i.endsWith(".doc")||null!=i&&i.endsWith(".docx")||null!=i&&i.endsWith(".xls")||null!=i&&i.endsWith(".xlsx")||null!=i&&i.endsWith(".ppt")||null!=i&&i.endsWith(".pptx")?a("div",{children:u(g,{style:{paddingBottom:10},children:[a("a",{href:n+"/"+t,target:"_blank",rel:"noreferrer",children:i}),a("a",{href:s,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):a("div",{children:u(g,{style:{paddingBottom:10},children:[a("a",{href:o,target:"_blank",rel:"noreferrer",children:i}),a("a",{href:s,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},Lt=function(e){var t,r;return(null!==(t=null===(r=Ne.previewComponents)||void 0===r?void 0:r.PreviewFile)&&void 0!==t?t:Dt)(e)},It=function(e){var t=e.fileList,r=e.autoplay,n=e.muted,i=e.loop,o=e.preload,l=Ne.request.prefix+Ne.file.downloadUrl;return a(s,{children:null==t?void 0:t.map((function(e){var t=e.id,s=e.name,c=e.url,p=l+"/"+t;return a("div",{children:u(g,{style:{paddingBottom:10},children:[u("div",{children:[a("audio",{src:c,controls:!0,autoPlay:r,muted:n,loop:i,preload:o,style:{width:"calc(100% - 40px)",height:30},children:"当前浏览器不支持音频播放,请使用最新版谷歌浏览器!"}),a("div",{children:s})]}),a("a",{href:p,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},Vt=function(e){var t,r;return(null!==(t=null===(r=Ne.previewComponents)||void 0===r?void 0:r.PreviewAudio)&&void 0!==t?t:It)(e)},Rt=function(e){var t=e.fileList,r=e.controls,n=e.autoplay,i=e.muted;e.pip;var o=e.loop,l=e.preload,c=Ne.request.prefix+Ne.file.downloadUrl;return a(s,{children:null==t?void 0:t.map((function(e){var t=e.id,s=e.name,p=e.url,f=c+"/"+t;return a("div",{children:u(g,{style:{paddingBottom:10},children:[u("div",{children:[a("video",{src:p,controls:r,autoPlay:n,muted:i,loop:o,preload:l,style:{width:260},children:"当前浏览器不支持视频播放,请使用最新版谷歌浏览器!"}),a("div",{children:s})]}),a("a",{href:f,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},Et=function(e){var t,r;return(null!==(t=null===(r=Ne.previewComponents)||void 0===r?void 0:r.PreviewVideo)&&void 0!==t?t:Rt)(e)},Bt=function(e){var t=e.fileList,r=e.width,n=e.height,i=e.style;return a(s,{children:null==t?void 0:t.map((function(e){var t=e.id,o=e.name,l=e.url;return a("div",{style:i,children:u(g,{style:{paddingBottom:10},children:[a(b,{width:r,height:n,src:l,alt:o}),a("a",{href:Ne.request.prefix+Ne.file.downloadUrl+"/"+t,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},Tt=function(e){var t,r;return(null!==(t=null===(r=Ne.previewComponents)||void 0===r?void 0:r.PreviewImage)&&void 0!==t?t:Bt)(e)};function Ft(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?Ft(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function At(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(At=function(){return!!e})()}var Mt=function(){function e(){return t(this,e),r=this,l=arguments,o=i(o=e),n(r,At()?Reflect.construct(o,l||[],i(r).constructor):o.apply(r,l));var r,o,l}return o(e,rt),r(e,[{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,u=i.preview,c=i.placeholder,p=i.maxLength,f=i.allowClear,d=i.showCount,h=i.readonly,v=i.hidden,y=this.getStyles(),g=y.styles,b=y.itemStyles;return a(m.Item,Nt(Nt(Nt({name:o,label:this.getLabel(),style:b,hidden:v,rules:e},r),n),{},{children:u?a(bt,{type:l,style:g}):a(O,{maxLength:p,placeholder:c,allowClear:f,showCount:d,disabled:h,style:g})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}();function Ut(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 qt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ut(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zt=function(){return!!e})()}var _t=function(){function e(){return t(this,e),r=this,l=arguments,o=i(o=e),n(r,zt()?Reflect.construct(o,l||[],i(r).constructor):o.apply(r,l));var r,o,l}return o(e,rt),r(e,[{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,u=t.showCount,c=t.minRow,p=void 0===c?"0":c,f=t.maxRow,d=void 0===f?"0":f,h=t.readonly,v=t.hidden,y=this.getItem(),g=y.itemProps,b=y.itemLayouts,w=this.getStyles(),j=w.styles,P=w.itemStyles,S=Number(p),k=Number(d);return a(m.Item,qt(qt(qt({name:r,label:this.getLabel(),style:P,hidden:v,rules:v?[]:e},g),b),{},{children:n?a(bt,{style:j}):a(O.TextArea,{maxLength:o,placeholder:i,allowClear:l,showCount:u,autoSize:!(S+k<1)&&{minRows:S,maxRows:k},disabled:h,style:j})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}();function Wt(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 Ht(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Gt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gt=function(){return!!e})()}var $t=function(){function e(){return t(this,e),r=this,l=arguments,o=i(o=e),n(r,Gt()?Reflect.construct(o,l||[],i(r).constructor):o.apply(r,l));var r,o,l}return o(e,rt),r(e,[{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?Ht(Ht({},e),{},{type:"number"}):e})),l=this.getItem(),u=l.itemProps,c=l.itemLayouts,p=this.props,f=p.code,d=p.preview,h=p.min,v=p.max,y=p.readonly,g=p.hidden,b=this.getStyles(),O=b.styles,j=b.itemStyles;return a(m.Item,Ht(Ht(Ht({name:f,label:this.getLabel(),style:j,hidden:g,rules:g?[]:o},u),c),{},{children:d?a(bt,{style:O}):a(w,Ht(Ht({min:h,max:v,disabled:y},i),{},{style:O}))}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}();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){l(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,t,r){return t=i(t),n(e,Qt()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Qt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qt=function(){return!!e})()}var Xt=function(){function e(){return t(this,e),Jt(this,e,arguments)}return o(e,rt),r(e,[{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,u=i.preview,c=i.placeholder,p=i.hidden,f=i.readonly,d=this.getStyles(),h=d.styles,v=d.itemStyles;return a(m.Item,Kt(Kt(Kt({name:o,label:this.getLabel(),style:v,hidden:p,colon:!!l,rules:p?[]:e},r),n),{},{children:u||f?a(wt,{style:h}):a(Zt,{placeholder:c,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),Zt=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return e=Jt(this,n,[].concat(i)),l(e,"isReactWEditor",!1),l(e,"editorRef",c.createRef()),e}return o(n,e),r(n,[{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 a(se,{placeholder:n,value:r,style:i,onBlur:function(){e.isReactWEditor=!1},onFocus:function(){e.isReactWEditor=!0},onChange:function(e){null==o||o(e)}})}}])}(c.Component);function er(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 tr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?er(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):er(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rr(e,t,r){return t=i(t),n(e,nr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function nr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nr=function(){return!!e})()}var ir=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=rr(this,e,[].concat(i)),l(r,"state",{list:[]}),r}return o(e,pt),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();if(r)this.setState({list:r},this.initValue);else if(t&&t.trim().length>0){var n=Ne.request.route+t;this.request(n).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,u=void 0===l||l,c=t.readonly,p=t.hidden,f=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()}})),v=this.getItem(),y=v.itemProps,g=v.itemLayouts,b=this.getStyles(),O=b.styles,w=b.itemStyles;return a(m.Item,tr(tr(tr({name:r,label:this.getLabel(),style:w,hidden:p,rules:p?[]:f},y),g),{},{children:n?a(xt,{list:this.state.list,style:O}):a(lr,{list:h,multiple:i,placeholder:o,allowClear:u,readonly:c,style:O})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),or=j.Option,lr=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=rr(this,e,[].concat(i)),l(r,"handleItemValue",(function(e){var t,n;null===(t=(n=r.props).onChange)||void 0===t||t.call(n,e)})),r}return o(e,dt),r(e,[{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,s=e.style;return a(j,{showSearch:!0,placeholder:i,mode:n?"multiple":void 0,disabled:l,value:r,allowClear:o,style:s,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 a(or,{value:t,children:r},t)}))})}}])}();function ar(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?ar(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ar(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ur(e,t,r){return t=i(t),n(e,cr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function cr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cr=function(){return!!e})()}var pr=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=ur(this,e,[].concat(i)),l(r,"state",{list:[]}),r}return o(e,pt),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();if(r)this.setState({list:r},this.initValue);else if(t&&t.trim().length>0){var n=Ne.request.route+t;this.request(n).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,s=i.readonly,u=i.hidden,c=this.getItem(),p=c.itemProps,f=c.itemLayouts,d=this.getStyles(),h=d.styles,v=d.itemStyles;return a(m.Item,sr(sr(sr({name:o,label:this.getLabel(),style:v,hidden:u,rules:u?[]:t},p),f),{},{children:l?a(xt,{list:this.state.list,style:h}):a(fr,{list:n,readonly:s,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),null}}])}(),fr=function(){function e(){return t(this,e),ur(this,e,arguments)}return o(e,dt),r(e,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.list,n=e.readonly,i=e.style,o=e.onChange;return a(P.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 a(P,{value:t,disabled:n,children:r},t)}))})}}])}();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){l(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 vr(e,t,r){return t=i(t),n(e,yr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function yr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yr=function(){return!!e})()}var mr=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=vr(this,e,[].concat(i)),l(r,"state",{list:[]}),r}return o(e,pt),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();if(r)this.setState({list:r},this.initValue);else if(t&&t.trim().length>0){var n=Ne.request.route+t;this.request(n).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,u=i.optionType,c=i.readonly,p=i.hidden,f=this.getItem(),d=f.itemProps,h=f.itemLayouts,v=this.getStyles(),y=v.styles,g=v.itemStyles;return a(m.Item,hr(hr(hr({name:o,label:this.getLabel(),style:g,hidden:p,rules:p?[]:t},d),h),{},{children:l?a(xt,{list:n,style:y}):a(gr,{list:this.state.list,optionType:u,readonly:c,style:y})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),gr=function(){function e(){return t(this,e),vr(this,e,arguments)}return o(e,dt),r(e,[{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 a(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 a(S,{value:t,disabled:i,children:r},t)}))})}}])}();function br(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 Or(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?br(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):br(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wr=function(){return!!e})()}var jr=function(){function e(){return t(this,e),r=this,l=arguments,o=i(o=e),n(r,wr()?Reflect.construct(o,l||[],i(r).constructor):o.apply(r,l));var r,o,l}return o(e,rt),r(e,[{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(),u=l.itemProps,c=l.itemLayouts,p=this.getStyles(),f=p.styles,d=p.itemStyles;return a(m.Item,Or(Or(Or({label:this.getLabel(),name:r,style:d,hidden:o,rules:o?[]:e,valuePropName:"checked"},u),c),{},{children:n?a(kt,{style:f}):a(k,{disabled:i,style:f})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}();function Pr(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?Pr(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kr(e,t,r){return t=i(t),n(e,Cr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Cr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cr=function(){return!!e})()}!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("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 xr=function(){function e(){return t(this,e),kr(this,e,arguments)}return o(e,rt),r(e,[{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,u=i.format,c=void 0===u?"H小时M分S秒":u,p=i.readonly,f=i.hidden,d=this.getStyles(),h=d.styles,v=d.itemStyles;return a(m.Item,Sr(Sr(Sr({name:o,label:this.getLabel(),style:v,hidden:f,rules:f?[]:e},r),n),{},{children:l?a(Pt,{format:c,style:h}):a(Dr,{format:c,readonly:p,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),Dr=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=kr(this,e,[].concat(i)),l(r,"duration",[0,0,0]),l(r,"pattern",["H","M","S"]),l(r,"changeValue",(function(e){return function(t){if("number"==typeof t){var n,i;r.duration[e]=t;var o=r.duration.map((function(e,t){return r.pattern[t].includes("H")?ue("000",e):ue("00",e)}));null===(n=(i=r.props).onChange)||void 0===n||n.call(i,o.join(":"))}}})),r}return o(e,dt),r(e,[{key:"render",value:function(){var e=this,t=this.props,r=t.value,n=t.format,i=t.readonly,o=t.style,l=n.trim().split(/\[.*?\]|[HMS]/);this.pattern=n.trim().split(new RegExp("[".concat(l.join(""),"]"))).filter((function(e){return e})),this.duration=this.pattern.map((function(){return 0})),"string"==typeof r&&(this.duration=r.split(":").map(Number));var s=-1,u=[];return l.forEach((function(t,r){t&&u.push(t),r<=e.pattern.length-1&&u.push(e.pattern[r])})),a("div",{className:"duration",children:u.map((function(t,r){return t.includes("H")?(s++,a(m.Item,{children:a(w,{style:Sr({width:"100%"},o),min:0,max:999,precision:0,value:e.duration[s],formatter:function(e){return e<100?e<10?"00"+e:"0"+e:e.toString()},onChange:e.changeValue(s),controls:!1,disabled:!!/\[|\]/.test(t)||i})},r)):t.includes("M")||t.includes("S")?(s++,a(m.Item,{children:a(w,{style:Sr({width:"100%"},o),min:0,max:59,precision:0,value:e.duration[s],formatter:function(e){return e<10?"0"+e:e.toString()},onChange:e.changeValue(s),controls:!1,disabled:!!/\[|\]/.test(t)||i})},r)):a("span",{children:t},r)}))})}}])}();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 Ir(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){l(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 Vr(e,t,r){return t=i(t),n(e,Rr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Rr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rr=function(){return!!e})()}ce.extend(pe),ce.extend(fe);var Er=function(){function e(){return t(this,e),Vr(this,e,arguments)}return o(e,rt),r(e,[{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,u=void 0===l?"date":l,c=i.format,p=void 0===c?"YYYY-MM-DD":c,f=i.showTime,d=void 0!==f&&f,h=i.preview,v=i.placeholder,y=i.allowClear,g=void 0===y||y,b=i.readonly,O=i.hidden,w=this.getStyles(),j=w.styles,P=w.itemStyles;return a(m.Item,Ir(Ir(Ir({name:o,label:this.getLabel(),style:P,hidden:O,rules:O?[]:e},r),n),{},{children:h?a(bt,{style:j}):a(Br,{type:u,format:p,showTime:d,placeholder:v,allowClear:g,readonly:b,style:j})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),Br=function(){function e(){return t(this,e),Vr(this,e,arguments)}return o(e,dt),r(e,[{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,s=e.readonly,u=e.style,c=e.onChange;return a(C,{value:t?ce(t,n):void 0,picker:r,format:n,showTime:i?{format:"HH:mm"}:void 0,placeholder:o,allowClear:l,disabled:s,style:u,onChange:function(e){null==c||c(null==e?void 0:e.format(n))}})}}])}();function Tr(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 Fr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tr(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Nr(e,t,r){return t=i(t),n(e,Ar()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ar=function(){return!!e})()}ce.extend(de);var Mr=function(){function e(){return t(this,e),Nr(this,e,arguments)}return o(e,rt),r(e,[{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,u=void 0===l?"HH:mm:ss":l,c=i.preview,p=i.placeholder,f=i.allowClear,d=void 0===f||f,h=i.readonly,v=i.hidden,y=this.getStyles(),g=y.styles,b=y.itemStyles;return a(m.Item,Fr(Fr(Fr({name:o,label:this.getLabel(),style:b,hidden:v,rules:v?[]:e},r),n),{},{children:c?a(bt,{style:g}):a(Ur,{format:u,placeholder:p,allowClear:d,readonly:h,style:g})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),Ur=function(){function e(){return t(this,e),Nr(this,e,arguments)}return o(e,dt),r(e,[{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,s=e.onChange;return a(x,{value:t?ce(t,r):void 0,format:r,placeholder:n,allowClear:i,disabled:o,style:l,onChange:function(e){null==s||s(null==e?void 0:e.format(r))}})}}])}();function qr(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 zr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qr(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _r(e,t,r){return t=i(t),n(e,Wr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Wr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wr=function(){return!!e})()}var Hr=function(e){return Array.isArray(e)?e:e&&e.list},Gr=function(){function e(){return t(this,e),_r(this,e,arguments)}return o(e,pt),r(e,[{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,u=t.fileSize,c=t.readonly,p=t.hidden,f=this.getItem(),d=f.itemProps,h=f.itemLayouts,v=this.getStyles(),y=v.styles,g=v.itemStyles;return a(m.Item,zr(zr(zr({name:r,label:this.getLabel(),style:g,hidden:p,rules:p?[]:e,valuePropName:"list",getValueFromEvent:Hr},d),h),{},{children:a($r,{maxCount:i,fileType:o,fileTypeMessage:l,fileSize:u,readonly:c,preview:n,style:y})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),$r=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=_r(this,e,[].concat(i)),l(r,"uploading",!1),l(r,"state",{fileList:[],modal:{open:!1,progress:0}}),l(r,"onBeforeUpload",(function(e){var t=r.props,n=t.fileSize,i=t.fileType,o=t.fileTypeMessage,l=null==i?void 0:i.replace(/\ +/g,"").split(","),a=null==l?void 0:l.map((function(e){return e.startsWith(".")?Ne.mimeType[e]:e}));if(!(a&&a.length>0))return R.error("文件类型不匹配!"),D.LIST_IGNORE;if(!a.includes(e.type))return R.error(o),D.LIST_IGNORE;if(n&&we.parse(n)<e.size)return R.error("上传的文件大小,不能超过 ".concat(n,"!")),D.LIST_IGNORE;return!0})),l(r,"onStart",(function(){clearInterval(r.timer),r.setState({modal:{open:!0,progress:0}}),r.uploading=!0})),l(r,"onProgress",(function(e){if(r.uploading){clearInterval(r.timer);var t=Math.round(e.percent/2);if(r.setState({modal:{open:!0,progress:t}}),50===t){var n=t;r.timer=setInterval((function(){r.uploading?r.setState({modal:{open:!0,progress:++n}}):(clearInterval(r.timer),r.setState({modal:{open:!1,progress:0}})),99===n&&clearInterval(r.timer)}),1e3)}}})),l(r,"onSuccess",(function(e,t){clearInterval(r.timer);var n=e.data,i=n.id,o=n.url;t.status="done",t.response=e,t.id=i,t.url=o;var l=[].concat(he(r.state.fileList),[t]);r.setState({fileList:l,modal:{open:!0,progress:100}},(function(){r.onChange(l),setTimeout((function(){r.setState({modal:{open:!1,progress:0}})}),500)})),r.uploading=!1})),l(r,"onError",(function(e,t,n){var i;clearInterval(r.timer);var o=[].concat(he(r.state.fileList),[n]);n.status="error",n.response=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"上传失败",r.setState({fileList:o,modal:{open:!1,progress:100}},(function(){r.onChange(o)})),r.uploading=!1})),l(r,"onRemove",(function(e){var t=r.state.fileList.filter((function(t){return t.id!==e.id}));r.setState({fileList:t},(function(){r.onChange(t)}))})),r}return o(e,dt),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Ne.file.listUrl;t&&(null==t?void 0:t.length)>0&&t[0]&&Qe(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return zr(zr({},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,c=n.style,p=o?Number(o):0;if(i)return a(Lt,{fileList:t});var f={onStart:this.onStart,onSuccess:this.onSuccess,onProgress:this.onProgress,onError:this.onError};return u(s,{children:[a(D,zr(zr({action:Ne.request.prefix+Ne.file.uploadUrl,fileList:t,maxCount:p,disabled:l,beforeUpload:this.onBeforeUpload,onRemove:this.onRemove},f),{},{children:a(L,{disabled:l||p<=t.length,icon:a(ve,{}),style:c,children:"上传"})})),u(I,{open:r.open,closable:!1,footer:null,children:[a("div",{children:"上传文件进度"}),a(V,{percent:r.progress})]})]})}}])}();function Yr(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 Kr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yr(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Jr(e,t,r){return t=i(t),n(e,Qr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Qr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qr=function(){return!!e})()}var Xr=function(e){return Array.isArray(e)?e:e&&e.list},Zr=["image/jpeg","image/png"],en=function(){function e(){return t(this,e),Jr(this,e,arguments)}return o(e,pt),r(e,[{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,u=void 0===l?"100":l,c=t.fileHeight,p=void 0===c?"100":c,f=t.readonly,d=t.hidden,h=this.getItem(),v=h.itemProps,y=h.itemLayouts,g=this.getStyles(),b=g.styles,O=g.itemStyles;return a(m.Item,Kr(Kr(Kr({name:r,label:this.getLabel(),style:O,hidden:d,rules:d?[]:e,valuePropName:"list",getValueFromEvent:Xr},v),y),{},{children:a(tn,{maxCount:i,fileSize:o,fileWidth:Number(u),fileHeight:Number(p),readonly:f,preview:n,style:b})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),tn=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=Jr(this,e,[].concat(i)),l(r,"uploading",!1),l(r,"state",{fileList:[],fileView:void 0}),l(r,"onChangeValue",(function(e){var t=e.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}));r.setState({fileList:t},(function(){r.onChange(t)}))})),l(r,"onBeforeUpload",(function(e){if(!Zr.includes(e.type))return R.error("上传文件类型,仅支持图片类型!"),D.LIST_IGNORE;var t=r.props.fileSize;if(t&&we.parse(t)<e.size)return R.error("上传的文件大小,不能超过 ".concat(t,"!")),D.LIST_IGNORE;return!0})),l(r,"onRemove",(function(e){var t=r.state.fileList.filter((function(t){return t.id!==e.id}));r.setState({fileList:t},(function(){r.onChange(t)}))})),r}return o(e,dt),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Ne.file.listUrl;t&&(null==t?void 0:t.length)>0&&t[0]&&Qe(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return Kr(Kr({},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,c=i.readonly,p=i.fileWidth,f=void 0===p?100:p,d=i.fileHeight,h=void 0===d?100:d,v=i.style,y=l?Number(l):0;return o?a(Tt,{fileList:r,width:f,height:h,style:v}):u(s,{children:[a(je,{rotationSlider:!0,modalTitle:"图片编辑",modalOk:"确认",modalCancel:"取消",aspect:f/h,children:a(D,{listType:"picture-card",accept:Zr.join(","),action:Ne.request.prefix+Ne.file.uploadUrl,fileList:r,maxCount:y,disabled:c,beforeUpload:this.onBeforeUpload,onChange:this.onChangeValue,onRemove:this.onRemove,onPreview:function(t){return e.setState({fileView:t})},children:!c&&Number(y)>r.length&&a(L,{type:"link",icon:a(ye,{}),style:v})})}),(null==n?void 0:n.id)&&a(I,{title:n.name,open:!0,footer:null,onCancel:function(){return e.setState({fileView:void 0})},children:a("img",{alt:n.name,style:{width:"100%"},src:n.url})})]})}}])}();function rn(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 nn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function on(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(on=function(){return!!e})()}var ln=function(){function e(){return t(this,e),r=this,l=arguments,o=i(o=e),n(r,on()?Reflect.construct(o,l||[],i(r).constructor):o.apply(r,l));var r,o,l}return o(e,pt),r(e,[{key:"plusRules",value:function(){var e=this.rules();return null==e?void 0:e.map((function(e){if(e.required){return nn(nn({},e),{},{validator:function(e,t){return 0===t?Promise.reject():Promise.resolve()}})}return nn({},e)}))}},{key:"render",value:function(){if(this.display()){var e;this.onComputeValue();var t=this.plusRules(),r=this.props,n=r.code,i=r.preview,o=r.allowHalf,l=void 0!==o&&o,u=r.count,c=void 0===u?5:u,p=r.items,f=r.readonly,d=r.hidden,h=this.getItem(),v=h.itemProps,y=h.itemLayouts,g=this.getStyles(),b=g.styles,O=g.itemStyles,w=null!==(e=null==p?void 0:p.split(","))&&void 0!==e?e:[];return a(m.Item,nn(nn(nn({name:n,label:this.getLabel(),style:O,hidden:d,rules:d?[]:t},v),y),{},{children:a(E,{allowHalf:l,count:c,character:function(e){var t=e.index,r=void 0===t?0:t;return w.length>0?w[r]:a(me,{})},disabled:i||f,style:b})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}();function an(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 sn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?an(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):an(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function un(e,t,r){return t=i(t),n(e,cn()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function cn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cn=function(){return!!e})()}var pn=function(e){return Array.isArray(e)?e:e&&e.list},fn=["audio/mpeg","audio/wav"],dn=function(){function e(){return t(this,e),un(this,e,arguments)}return o(e,pt),r(e,[{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.readonly,u=t.hidden,c=this.props,p=c.autoplay,f=void 0!==p&&p,d=c.muted,h=void 0!==d&&d,v=c.loop,y=void 0!==v&&v,g=c.preload,b=void 0===g?"auto":g,O=this.getItem(),w=O.itemProps,j=O.itemLayouts,P=this.getStyles(),S=P.styles,k=P.itemStyles;return a(m.Item,sn(sn(sn({name:r,label:this.getLabel(),style:k,hidden:u,rules:u?[]:e,valuePropName:"list",getValueFromEvent:pn},w),j),{},{children:a(hn,{code:r,maxCount:i,fileSize:o,readonly:l,preview:n,autoplay:f,muted:h,loop:y,preload:b,style:S})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),hn=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=un(this,e,[].concat(i)),l(r,"uploading",!1),l(r,"state",{fileList:[],modal:{open:!1,progress:0}}),l(r,"onBeforeUpload",(function(e){if(!fn.includes(e.type))return R.error("上传文件类型,仅支持音频类型!"),D.LIST_IGNORE;var t=r.props.fileSize;if(t&&we.parse(t)<e.size)return R.error("上传的文件大小,不能超过 ".concat(t,"!")),D.LIST_IGNORE;return!0})),l(r,"onStart",(function(){clearInterval(r.timer),r.setState({modal:{open:!0,progress:0}}),r.uploading=!0})),l(r,"onProgress",(function(e){if(r.uploading){clearInterval(r.timer);var t=Math.round(e.percent/2);if(r.setState({modal:{open:!0,progress:t}}),50===t){var n=t;r.timer=setInterval((function(){r.uploading?r.setState({modal:{open:!0,progress:++n}}):(clearInterval(r.timer),r.setState({modal:{open:!1,progress:0}})),99===n&&clearInterval(r.timer)}),1e3)}}})),l(r,"onSuccess",(function(e,t){clearInterval(r.timer);var n=e.data,i=n.id,o=n.url;t.status="done",t.response=e,t.id=i,t.url=o;var l=[].concat(he(r.state.fileList),[t]);r.setState({fileList:l,modal:{open:!0,progress:100}},(function(){r.onChange(l),setTimeout((function(){r.setState({modal:{open:!1,progress:0}})}),500)})),r.uploading=!1})),l(r,"onError",(function(e,t,n){var i;clearInterval(r.timer);var o=[].concat(he(r.state.fileList),[n]);n.status="error",n.response=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"上传失败",r.setState({fileList:o,modal:{open:!1,progress:100}},(function(){r.onChange(o)})),r.uploading=!1})),l(r,"onRemove",(function(e){var t=r.state.fileList.filter((function(t){return t.id!==e.id}));r.setState({fileList:t},(function(){r.onChange(t)}))})),r}return o(e,dt),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Ne.file.listUrl;t&&(null==t?void 0:t.length)>0&&t[0]&&Qe(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return sn(sn({},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.code,o=n.preview,l=n.maxCount,c=n.readonly,p=n.style,f=n.autoplay,d=n.muted,h=n.loop,v=n.preload,y=l?Number(l):0;if(o)return a(Vt,{code:i,fileList:t,autoplay:f,muted:d,loop:h,preload:v});var m={onStart:this.onStart,onSuccess:this.onSuccess,onProgress:this.onProgress,onError:this.onError};return u(s,{children:[a(D,sn(sn({listType:"picture-card",accept:fn.join(","),action:Ne.request.prefix+Ne.file.uploadUrl,fileList:t,maxCount:y,disabled:c,beforeUpload:this.onBeforeUpload,onRemove:this.onRemove},m),{},{children:!c&&Number(y)>t.length&&a(L,{type:"link",icon:a(ye,{}),style:p})})),u(I,{open:r.open,closable:!1,footer:null,children:[a("div",{children:"上传文件进度"}),a(V,{percent:r.progress})]})]})}}])}();function vn(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 yn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function mn(e,t,r){return t=i(t),n(e,gn()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function gn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gn=function(){return!!e})()}var bn=function(e){return Array.isArray(e)?e:e&&e.list},On=["video/mp4"],wn=function(){function e(){return t(this,e),mn(this,e,arguments)}return o(e,pt),r(e,[{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.readonly,u=t.hidden,c=this.props,p=c.controls,f=void 0===p||p,d=c.autoplay,h=void 0!==d&&d,v=c.muted,y=void 0!==v&&v,g=c.pip,b=void 0!==g&&g,O=c.loop,w=void 0!==O&&O,j=c.preload,P=void 0===j?"auto":j,S=this.getItem(),k=S.itemProps,C=S.itemLayouts,x=this.getStyles(),D=x.styles,L=x.itemStyles;return a(m.Item,yn(yn(yn({name:r,label:this.getLabel(),style:L,hidden:u,rules:u?[]:e,valuePropName:"list",getValueFromEvent:bn},k),C),{},{children:a(jn,{code:r,maxCount:i,fileSize:o,readonly:l,preview:n,controls:f,autoplay:h,muted:y,pip:b,loop:w,preload:P,style:D})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),jn=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=mn(this,e,[].concat(i)),l(r,"uploading",!1),l(r,"state",{fileList:[],modal:{open:!1,progress:0}}),l(r,"onBeforeUpload",(function(e){if(!On.includes(e.type))return R.error("上传文件类型,仅支持视频类型!"),D.LIST_IGNORE;var t=r.props.fileSize;if(t&&we.parse(t)<e.size)return R.error("上传的文件大小,不能超过 ".concat(t,"!")),D.LIST_IGNORE;return!0})),l(r,"onStart",(function(){clearInterval(r.timer),r.setState({modal:{open:!0,progress:0}}),r.uploading=!0})),l(r,"onProgress",(function(e){if(r.uploading){clearInterval(r.timer);var t=Math.round(e.percent/2);if(r.setState({modal:{open:!0,progress:t}}),50===t){var n=t;r.timer=setInterval((function(){r.uploading?r.setState({modal:{open:!0,progress:++n}}):(clearInterval(r.timer),r.setState({modal:{open:!1,progress:0}})),99===n&&clearInterval(r.timer)}),1e3)}}})),l(r,"onSuccess",(function(e,t){clearInterval(r.timer);var n=e.data,i=n.id,o=n.url;t.status="done",t.response=e,t.id=i,t.url=o;var l=[].concat(he(r.state.fileList),[t]);r.setState({fileList:l,modal:{open:!0,progress:100}},(function(){r.onChange(l),setTimeout((function(){r.setState({modal:{open:!1,progress:0}})}),500)})),r.uploading=!1})),l(r,"onError",(function(e,t,n){var i;clearInterval(r.timer);var o=[].concat(he(r.state.fileList),[n]);n.status="error",n.response=null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"上传失败",r.setState({fileList:o,modal:{open:!1,progress:100}},(function(){r.onChange(o)})),r.uploading=!1})),l(r,"onRemove",(function(e){var t=r.state.fileList.filter((function(t){return t.id!==e.id}));r.setState({fileList:t},(function(){r.onChange(t)}))})),r}return o(e,dt),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Ne.file.listUrl;t&&(null==t?void 0:t.length)>0&&t[0]&&Qe(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return yn(yn({},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.code,o=n.preview,l=n.maxCount,c=n.readonly,p=n.style,f=n.controls,d=n.autoplay,h=n.muted,v=n.pip,y=n.loop,m=n.preload,g=l?Number(l):0;if(o)return a(Et,{code:i,fileList:t,controls:f,autoplay:d,muted:h,pip:v,loop:y,preload:m});var b={onStart:this.onStart,onSuccess:this.onSuccess,onProgress:this.onProgress,onError:this.onError};return u(s,{children:[a(D,yn(yn({listType:"picture-card",accept:On.join(","),action:Ne.request.prefix+Ne.file.uploadUrl,fileList:t,maxCount:g,disabled:c,beforeUpload:this.onBeforeUpload,onRemove:this.onRemove},b),{},{children:!c&&Number(g)>t.length&&a(L,{type:"link",icon:a(ye,{}),style:p})})),u(I,{open:r.open,closable:!1,footer:null,children:[a("div",{children:"上传文件进度"}),a(V,{percent:r.progress})]})]})}}])}();function Pn(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 Sn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kn(e,t,r){return t=i(t),n(e,Cn()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Cn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cn=function(){return!!e})()}var xn=function(e){return Array.isArray(e)?e:e&&e.list},Dn=function(){function e(){return t(this,e),kn(this,e,arguments)}return o(e,pt),r(e,[{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,u=t.fileSize,c=t.readonly,p=t.hidden,f=this.getItem(),d=f.itemProps,h=f.itemLayouts,v=this.getStyles(),y=v.styles,g=v.itemStyles;return a(m.Item,Sn(Sn(Sn({name:r,label:this.getLabel(),style:g,hidden:p,rules:p?[]:e,valuePropName:"list",getValueFromEvent:xn},d),h),{},{children:a(Ln,{maxCount:i,fileType:o,fileTypeMessage:l,fileSize:u,readonly:c,preview:n,style:y})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),Ln=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=kn(this,e,[].concat(i)),l(r,"uploading",!1),l(r,"state",{fileList:[],modal:{open:!1,progress:0}}),l(r,"onBeforeUpload",(function(e){var t=r.props,n=t.fileSize,i=t.fileType,o=t.fileTypeMessage,l=null==i?void 0:i.replace(/\ +/g,"").split(",");if(!(l&&l.length>0))return R.error("文件类型不匹配!"),D.LIST_IGNORE;if(!l.includes(e.type))return R.error(o),D.LIST_IGNORE;if(n&&we.parse(n)<e.size)return R.error("上传的文件大小,不能超过 ".concat(n,"!")),D.LIST_IGNORE;return!0})),l(r,"customRequest",(function(e){var t,n,i,o,l,a,s,u={blockSize:Ne.chunk.chunkSize,checkFile:(s=re(ne.mark((function e(t){var r,n,i;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,Qe("post form "+Ne.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 s.apply(this,arguments)}),checkBlock:(a=re(ne.mark((function e(t){var r,n,i,o;return ne.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,Qe("post form "+Ne.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=re(ne.mark((function e(t){var r,n,i,o,l,a;return ne.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,Qe("post form "+Ne.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=re(ne.mark((function e(t){var r,n,i;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,Qe("post form "+Ne.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=re(ne.mark((function e(){var t;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qe(Ne.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=re(ne.mark((function e(t){var r,n,i;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,Qe("post form "+Ne.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:(t=re(ne.mark((function e(){var t;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qe(Ne.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 t.apply(this,arguments)})},c=Pe.create(u);c.progress((function(e,t){e.status="uploading",r.setState({modal:{open:!0,progress:t}})})),c.complete((function(e){var t=e.response,n=t.id,i=t.url;e.id=n,e.url=i,e.status="done";var o=[].concat(he(r.state.fileList),[e]);r.setState({fileList:o,modal:{open:!1,progress:0}},(function(){r.onChange(o)}))})),c.error((function(e,t){e.status="error",e.response=t;var n=r.state.fileList,i=n.findIndex((function(t){return t.uid===e.uid}));-1===i?n.push(e):n[i]=e,r.setState({fileList:n,modal:{open:!1,progress:0}})})),c.start(e.file)})),l(r,"onRemove",(function(e){var t=r.state.fileList.filter((function(t){return t.id!==e.id}));r.setState({fileList:t},(function(){r.onChange(t)}))})),r}return o(e,dt),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Ne.file.listUrl;t&&t.length>0&&Qe(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return Sn(Sn({},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,c=n.style,p=o?Number(o):0;return i?a(Lt,{fileList:t}):u(s,{children:[a(D,{action:Ne.request.prefix+Ne.file.uploadUrl,fileList:t,maxCount:p,disabled:l,beforeUpload:this.onBeforeUpload,customRequest:this.customRequest,onRemove:this.onRemove,children:a(L,{disabled:l||p<=t.length,icon:a(ve,{}),style:c,children:"上传"})}),u(I,{open:r.open,closable:!1,footer:null,children:[a("div",{children:"上传文件进度"}),a(V,{percent:r.progress})]})]})}}])}(),In=["worksId","worksExtraId"];function Vn(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 Rn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function En(e,t,r){return t=i(t),n(e,Bn()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Bn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bn=function(){return!!e})()}var Tn=function(){function e(){return t(this,e),En(this,e,arguments)}return o(e,pt),r(e,[{key:"getColumns",value:function(){var e,t=G(this.props.children,{tag:"Columns"});return t?null===(e=t.children)||void 0===e?void 0:e.map((function(e){var t;return Rn(Rn({},e),{},{rules:null===(t=e.rules)||void 0===t?void 0:t.map(Re)})})):[]}},{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,u=i.preview,c=i.readonly,p=i.hidden,f=this.getStyles(),d=f.styles,h=f.itemStyles;return a(m.Item,Rn(Rn(Rn({name:o,style:h,hidden:p,rules:p?[]:e,valuePropName:"list"},r),n),{},{children:a(Fn,{preview:u||c,title:l,columns:this.getColumns(),style:d})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),Fn=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=En(this,e,[].concat(i)),l(r,"state",{dataSource:[],modal:{title:"",entity:void 0,show:!1}}),l(r,"onFinish",(function(e){var t=r.state.dataSource,n=[];e.id||e.uid?n=t.map((function(t){return e.id&&t.id===e.id||e.uid&&t.uid===e.uid?Rn(Rn({},t),e):t})):(e.index=t.length+1,e.uid=_(),n=[].concat(he(t),[e])),r.setState({dataSource:n,modal:{title:"",entity:void 0,show:!1}},(function(){var e,t;null===(e=(t=r.props).onChange)||void 0===e||e.call(t,n)}))})),l(r,"onCancel",(function(){r.setState({modal:{title:"",entity:void 0,show:!1}})})),r}return o(e,dt),r(e,[{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,Rn({id:e.worksExtraId,index:t+1},te(e,In))}));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[u(g,{children:[a("a",{onClick:function(){e.setState({modal:{title:"修改".concat(r),entity:n,show:!0}})},children:"修改"},"modifly"),a("a",{onClick:function(){I.confirm({title:"警告",icon:a(ge,{}),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,s=o.modal,c=this.getColumns();return u(B,{title:r,bodyStyle:{padding:"0px 12px"},extra:n?null:a("a",{onClick:function(){e.setState({modal:{title:"新建".concat(r),entity:void 0,show:!0}})},children:"添加"},"new"),children:[a(T,{rowKey:"index",size:"small",style:i,columns:c,dataSource:l}),s.show&&a(Nn,{title:s.title,entity:s.entity,columns:c,onFinish:this.onFinish,onCancel:this.onCancel})]})}}])}(),Nn=function(t){var r,n=t.title,i=t.entity,o=t.columns,l=t.onFinish,s=t.onCancel,u=m.useForm(),c=e(u,1)[0];return a(I,{title:n,width:740,open:!0,destroyOnClose:!0,onCancel:s,onOk:(r=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c.validateFields().then((function(e){l(Rn(Rn({},i),e))})).catch((function(e){console.warn(e)}));case 2:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)}),children:a(m,{form:c,name:"modalTable",initialValues:i,wrapperCol:{span:22},autoComplete:"off",layout:"vertical",children:a(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 a(N,{span:12,children:a(m.Item,{label:t,name:r,rules:i,children:a(O,{placeholder:n})})},r)}))})})})},An=["id","index"];function Mn(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 Un(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return zn(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zn(e,t):void 0}}(e))||t){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 zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _n(e,t,r){return t=i(t),n(e,Wn()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Wn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wn=function(){return!!e})()}var Hn=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=_n(this,e,[].concat(i)),l(r,"itemList",[]),l(r,"columnList",[]),l(r,"state",{doc:void 0,loading:!0}),l(r,"initItems",function(){var e=re(ne.mark((function e(t){var n,i,o,l,a,s,u,c,p,f,d,h,v,y,m,g,b,O,w,j;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.columnList=G(r.props.children,{tag:"Columns"}).children,n=r.columnList.map((function(e){return e.dataIndex})),i=Le.selectors(t,"[code]"),o=qn(i),e.prev=4,o.s();case 6:if((l=o.n()).done){e.next=29;break}if(a=l.value,s=a.getAttribute("code"),u=a.getAttribute("title"),c=a.tagName.toLowerCase(),!s||!n.includes(s)){e.next=27;break}if(p={},f=a.getAttribute("remote"),!((d=Le.selectors(a,"Option")).length>0)){e.next=20;break}h=qn(d);try{for(h.s();!(v=h.n()).done;)y=v.value,m=y.getAttribute("value"),g=y.textContent,m&&g&&(p[m]=g)}catch(e){h.e(e)}finally{h.f()}e.next=26;break;case 20:if(!f){e.next=26;break}return e.next=23,r.request(Ne.request.route+f);case 23:b=e.sent,O=qn(b);try{for(O.s();!(w=O.n()).done;)j=w.value,p[j.key]=j.label}catch(e){O.e(e)}finally{O.f()}case 26:r.itemList.push({code:s,title:u,type:c,data:p});case 27:e.next=6;break;case 29:e.next=34;break;case 31:e.prev=31,e.t0=e.catch(4),o.e(e.t0);case 34:return e.prev=34,o.f(),e.finish(34);case 37:r.setState({loading:!1});case 38:case"end":return e.stop()}}),e,null,[[4,31,34,37]])})));return function(t){return e.apply(this,arguments)}}()),r}return o(e,pt),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.formId;this.setState({loading:!0}),this.request(Ne.form.documentUrl,{formId:t}).then((function(t){var r=Le.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,u=i.witdh,c=i.preview,p=i.readonly,f=i.hidden,d=this.getStyles(),h=d.styles,v=d.itemStyles,y=this.state.doc;return a(m.Item,Un(Un(Un({name:o,style:v,hidden:f,rules:f?[]:e,valuePropName:"list"},r),n),{},{children:a(Gn,{preview:c||p,title:l,witdh:u,columns:this.columnList,items:this.itemList,document:y,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),a(s,{})}}])}(),Gn=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return r=_n(this,e,[].concat(i)),l(r,"state",{dataSource:[],modal:{title:"",entity:void 0,show:!1}}),l(r,"onFinish",(function(e){var t=r.state.dataSource,n=[];e.id?n=t.map((function(t){return t.id===e.id?Un(Un({},t),e):t})):(e.id=_(),e.index=t.length+1,n=[].concat(he(t),[e])),r.onChange(n)})),l(r,"onCancel",(function(){r.setState({modal:{title:"",entity:void 0,show:!1}})})),r}return o(e,dt),r(e,[{key:"componentDidMount",value:function(){var e=this.props.list;if(Array.isArray(e)){var t=e.map((function(e,t){var r=ke({},(Se(e),e));return Un({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,te(e,An)})))}))}},{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,s=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(t){var n=t;return e.text?n=e.text:0!==Object.keys(r.data).length&&(n=r.data[t]),"url"===e.type?a("a",{href:t,target:"_blank",rel:"noreferrer",children:n}):n}),e}));return r?s:K(s,{title:"操作",dataIndex:"option",valueType:"option",render:function(t,r){return[u(g,{children:[a("a",{onClick:function(){e.setState({modal:{title:"修改".concat(n),entity:r,show:!0}})},children:"修改"},"modifly"),a("a",{onClick:function(){I.confirm({title:"警告",icon:a(ge,{}),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,s=this.state,c=s.dataSource,p=s.modal,f=this.getColumns();return u(B,{title:n,style:{padding:"0px 12px"},extra:r?null:a("a",{onClick:function(){e.setState({modal:{title:"新建".concat(n),entity:void 0,show:!0}})},children:"添加"},"new"),children:[a(T,{rowKey:"id",size:"small",style:l,columns:f,dataSource:c}),p.show&&a($n,{title:p.title,witdh:i,entity:p.entity,document:o,onFinish:this.onFinish,onCancel:this.onCancel})]})}}])}(),$n=function(e){var t,r=e.title,n=e.witdh,i=void 0===n?"740":n,o=e.entity,l=e.document,s=e.onFinish,u=e.onCancel,c=d();return a(I,{title:r,width:Number(i),open:!0,destroyOnClose:!0,onCancel:u,onOk:(t=re(ne.mark((function e(){var t,r,n;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,null===(t=c.current)||void 0===t?void 0:t.validateFields();case 3:n=null===(r=c.current)||void 0===r?void 0:r.getFieldsValue(),s(Un(Un({},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&&a(ci,{form:c,document:l,initialValues:o})})},Yn=Object.freeze({__proto__:null,Audio:dn,Checkbox:pr,DatePicker:Er,Duration:xr,Editor:Xt,FormList:Hn,Label:vt,Number:$t,Photo:en,Radio:mr,Rate:ln,Select:ir,SuperUpload:Dn,Switch:jr,Table:Tn,Text:Mt,TextArea:_t,TimePicker:Mr,Tooltip:mt,Upload:Gr,Video:wn}),Kn=function(e){var t=e.children,r=e.gutter;return a(F,{gutter:Number(r),style:{margin:0},children:t})},Jn=function(e){var t=e.span,r=e.children;return a(N,{span:t,children:r})},Qn=function(e){var t=e.direction,r=e.stepIndex,n=e.onChangeSetp,i=e.children,o=h((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 a(A,{current:r,direction:t,onChange:n,items:o,style:{padding:16,backgroundColor:"white"}})},Xn=M.Content,Zn=v((function(e){var t=e.currentStepIndex,r=e.stepIndex,n=e.style,i=e.children,o=h((function(){var e=n?Xe(n):{padding:16,backgroundColor:"white"};return t!==Number(r)&&Object.assign(e,{display:"none"}),e}),[t]);return a(Xn,{style:o,children:i})})),ei=function(e){var t=e.dashed,r=void 0!==t&&t,n=e.orientation,i=void 0===n?"center":n,o=e.children;return a(U,{dashed:r,orientation:i,style:{color:"#055ab5",fontWeight:"bold"},children:o})},ti={display:"none"},ri={display:"block"},ni=v((function(t){var r=t.defaultExpanded,n=void 0===r||r,i=t.on,o=t.off,l=t.style,c=t.collapse,p=t.children,f=y(n),d=e(f,2),h=d[0],v=d[1],m=Xe(l);return c?u(s,{children:[a("div",{style:m,children:u(L,{type:"link",onClick:function(){v(!h)},children:[h?o:i,a(h?be:Oe,{})," "]})}),a("div",{style:h?ri:ti,children:p})]}):a(s,{children:p})}));function ii(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 oi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ii(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ii(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function li(e,t,r){return t=i(t),n(e,ai()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function ai(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ai=function(){return!!e})()}var si=Yn,ui={Row:Kn,Col:Jn,Collapse:ni,Content:Zn,Divider:ei,Steps:Qn},ci=function(){function n(e){var r,i,o;return t(this,n),o=li(this,n,[e]),l(o,"state",{stepIndex:0,root:void 0,loading:!0}),l(o,"hideClear",!1),l(o,"onValuesChange",(function(e){o.setState({values:e})})),l(o,"onStepIndex",(function(e){o.setState({stepIndex:e})})),l(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:si[e.tag];return n?o.component(e,n):ui[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:c.createRef(),o}return o(n,p),r(n,[{key:"componentDidMount",value:function(){var t,r,n=this,i=this.props.document,o=(t="string"==typeof i?Le.getRoot(i):Le.parser(i)).attributes,s=o.style,u=o.labelCol,c=o.wrapperCol,p=o.showTitle,f=o.hideClear;if(this.showTitle=!!p,this.hideClear=!!f,"string"==typeof s){var d=null==s?void 0:s.replace(/\ +/g,"").split(";");null==d||d.forEach((function(t){if(t){var r=t.split(":"),i=e(r,2),o=i[0],a=i[1];Object.assign(n.styles,l({},H(o),a))}}))}u&&c&&(this.layouts={labelCol:{span:u},wrapperCol:{span:c}}),Ne.components&&(this.customComponents=J(Ne.components,(function(e){return function(t){return a(at,oi({Component:e},t))}}))),this.setState({root:t,loading:!0}),"function"==typeof(r=function(e){n.setState({loading:e})})&&Ue.push(r),He()}},{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.preview,n=t.hidden,i=t.readonly;if(e.preview=null!=r&&r,Q(n))e.hidden=n;else if(X(n))e.hidden=n.includes(e.code);else if(Z(n))e.hidden=!!n[e.code];else{var o;e.hidden=null!==(o=e.hidden)&&void 0!==o&&o}if(Q(i))e.readonly=i;else if(X(i))e.readonly=i.includes(e.code);else if(Z(i))e.readonly=!!i[e.code];else{var l;e.readonly=null!==(l=e.readonly)&&void 0!==l&&l}ee(e.hideClear)&&(e.hideClear=this.hideClear)}},{key:"component",value:function(e,t){var r=e.id,n=e.attributes,i=e.children;return this.setComponentStatus(n),a(t,oi(oi({},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?a(Kn,oi(oi({},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Col"===r?a(Jn,{span:Number(n.span),children:null==o?void 0:o.map(this.children)},t):"Collapse"===r?a(ni,oi(oi({collapse:this.props.collapse},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Content"===r?a(Zn,oi(oi({currentStepIndex:this.state.stepIndex},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Steps"===r?a(Qn,oi(oi({stepIndex:this.state.stepIndex,onChangeSetp:this.onStepIndex},n),{},{children:o}),t):"Divider"===r?a(ei,oi(oi({},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=G(n.map(t.children),{tag:"Validates"});return oi(oi({},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 u(s,{children:[r&&a(Ee.Provider,{value:oi(oi({},this.props),{},{form:this.form,showTitle:this.showTitle}),children:a(pi,oi(oi({form:this.form,style:n?oi(oi({},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&&a(q,{active:!0})]})}}])}(),pi=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return e=li(this,n,[].concat(i)),l(e,"onFinish",(function(e){console.log("Success:",e)})),e}return o(n,e),r(n,[{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,s=e.onValuesChange;return a(m,{ref:t,style:r,labelCol:n,wrapperCol:i,initialValues:o,onFinish:this.onFinish,autoComplete:"off",onValuesChange:function(e){s(e)},children:l})}}])}(c.PureComponent);export{Ee as DesignContext,rt as UIComponent,pt as UIListComponent,ci as default,Ae 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/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import i from"@babel/runtime/helpers/inherits";import l from"@babel/runtime/helpers/defineProperty";import{jsx as a,Fragment as u,jsxs as c}from"react/jsx-runtime";import s,{PureComponent as p,useEffect as f,useRef as d,useMemo as h,memo as y,useState as v}from"react";import{Form as m,message as b,Upload as g,Space as O,Image as w,Input as j,InputNumber as P,Select as k,Checkbox as S,Radio as C,Switch as x,DatePicker as D,TimePicker as V,Button as L,Modal as I,Progress as R,Rate as E,Card as B,Table as F,Row as T,Col as A,Steps as N,Layout as M,Divider as U,Skeleton as q}from"antd";import{parseInt as z,uniqueId as _,isObject as W,isString as H,camelCase as G,cloneDeep as Y,find as $,every as K,some as J,debounce as Q,concat as X,mapValues as Z,isBoolean as ee,isArray as te,isUndefined as re}from"lodash";import ne from"@babel/runtime/helpers/objectWithoutProperties";import oe from"moment";import ie from"@babel/runtime/helpers/asyncToGenerator";import le from"@babel/runtime/regenerator";import{extend as ae}from"umi-request";import{parse as ue,compile as ce}from"path-to-regexp";import se from"@babel/runtime/helpers/get";import pe from"@babel/runtime/helpers/toConsumableArray";import fe from"bytes";import{Toolbar as de,Editor as he}from"@wangeditor/editor-for-react";import"@wangeditor/editor/dist/css/style.css";import ye from"number-format.js";import ve from"dayjs";import me from"dayjs/plugin/weekday";import be from"dayjs/plugin/localeData";import ge from"dayjs/plugin/customParseFormat";import{UploadOutlined as Oe,PlusOutlined as we,StarFilled as je,QuestionCircleOutlined as Pe,UpOutlined as ke,DownOutlined as Se}from"@ant-design/icons";import Ce from"antd-img-crop";import xe from"file-block-upload";import De from"@babel/runtime/helpers/objectDestructuringEmpty";import Ve from"@babel/runtime/helpers/extends";function Le(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Ie(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ie(e,t):void 0}}(e))||t){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 i,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,i=e},f:function(){try{l||null==r.return||r.return()}finally{if(a)throw i}}}}function Ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Re=function(){return r((function e(r){t(this,e),l(this,"attributes",{}),this.id=_();var n,o=Le(r.attributes);try{for(o.s();!(n=o.n()).done;){var i=n.value,a=i.value.trim();this.isBoolean(a)&&(a=this.toBoolean(a)),this.attributes[i.name]=a}}catch(e){o.e(e)}finally{o.f()}this.children=new Array;var u,c=Le(r.childNodes);try{for(c.s();!(u=c.n()).done;){var s,p,f=u.value;if(f instanceof Element)null===(s=this.children)||void 0===s||s.push(new e(f));if(3===f.nodeType&&f.textContent&&(this.text=f.textContent),4===f.nodeType)this.cdata=null===(p=f.nodeValue)||void 0===p?void 0:p.replace(/\ +/g," ").replace(/[\t\r\n]/g,"")}}catch(e){c.e(e)}finally{c.f()}this.tag=r.nodeName}),[{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)}}])}(),Ee=function(){function e(){t(this,e)}return r(e,null,[{key:"parser",value:function(e){var t=e.childNodes[0];return new Re(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)}}])}();function Be(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 Fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Te=function(e){var t=e.type,r=void 0===t?"string":t,n=e.required,o=e.minlength,i=e.maxlength,l=e.min,a=e.max,u=e.pattern,c=e.message;return n?{type:r,required:n,message:c}:o&&i?{type:r,min:Number(o),max:Number(i),message:c}:l&&a?{type:"number",min:Number(l),max:Number(a),message:c}:"phone"===r?{type:"string",pattern:new RegExp("^[1][3,5,6,7,8][0-9]\\d{8}$"),message:c}:"regexp"===r&&"string"==typeof u?{type:"string",pattern:new RegExp(u),message:c}:{type:r,message:c}},Ae=s.createContext({});function Ne(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 Me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ue=function(){function e(r){if(t(this,e),l(this,"request",{prefix:"api",headers:{},root:"/design"}),l(this,"file",{listUrl:"/file/list",downloadUrl:"/file/download",uploadUrl:"/file/upload",previewUrl:"/file/preview",extraData:function(e,t){}}),l(this,"style",{labelStyle:{color:"#055ab5"}}),l(this,"form",{documentUrl:"/form/:formId"}),l(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"}),l(this,"mimeType",{}),r){var n=r.request,o=r.file,i=r.form,a=r.chunk,u=r.mimeType,c=r.components,s=r.previewComponents;this.request=Me(Me({},this.request),n),this.file=Me(Me({},this.file),o),this.form=Me(Me({},this.form),i),this.chunk=Me(Me({},this.chunk),a),this.mimeType=u,this.components=c,this.previewComponents=s}}return r(e,null,[{key:"init",value:function(t){return new e(t)}}])}(),qe=Ue.init(),ze=function(e){qe=Ue.init(e)},_e=function(t){var r={};return W(t)?t:(H(t)&&t.replace(/\ +/g,"").split(";").forEach((function(t){if(t){var n=t.split(":"),o=e(n,2),i=o[0],a=o[1];Object.assign(r,l({},G(i),a))}})),r)},We=0,He=[],Ge=function(e){return new Promise((function(t){setTimeout((function(){t(e)}),e)}))},Ye=function(){var e=ie(le.mark((function e(t){var r,n;return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===We)for(r=0,n=He;r<n.length;r++)(0,n[r])(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$e=function(){var e=ie(le.mark((function e(){return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==We++&&Ye(!0);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ke=function(){var e=ie(le.mark((function e(){return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==--We&&Ye(!1);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Je=function(){var e=ie(le.mark((function e(){return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ge(1e3);case 2:0===We?Ye(!1):Je();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Qe=function(){var e=ie(le.mark((function e(){return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:We=0,Ye(!1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Xe=["status"];function Ze(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 et=ae({prefix:qe.request.prefix,headers:qe.request.headers,timeout:1e4});et.use(function(){var e=ie(le.mark((function e(t,r){return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,$e(),e.next=4,r();case 4:Ke(),e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(0),Qe(),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 tt=function(t,r){var n=Y(r.data),o=t;try{var i,a="",u=o.match(/[a-zA-z]+:\/\/[^/]*/);if(u)a=e(u,1)[0],o=o.slice(a.length);var c=null===(i=ue(o))||void 0===i?void 0:i.tokens;o=ce(o)(r.data),c.forEach((function(e){e instanceof Object&&e.name in n&&delete n[e.name]})),o=a+o}catch(e){console.error(e.message)}return"GET"===r.method.toLocaleUpperCase()?r.params=n:r.type&&(r.requestType=r.type),r.prefix=qe.request.prefix,et(o,r).then((function(e){var t=e.status,r=ne(e,Xe),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?Ze(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(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,i=null!==(t=null==n?void 0:n.message)&&void 0!==t?t:"访问超时";return console.error(o,r,n),Promise.resolve({success:!1,message:i})}))},rt=function(t){var r="GET",n="json",o=t,i=t.split(" ");if(2===i.length){var l=e(i,2);r=l[0],o=l[1]}else if(3===i.length){var a=e(i,3);r=a[0],n=a[1],o=a[2]}return function(e){return tt(o,{method:r,type:n,data:e})}};function nt(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?nt(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function it(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(it=function(){return!!e})()}var lt=function(){function e(){return t(this,e),r=this,l=arguments,i=o(i=e),n(r,it()?Reflect.construct(i,l||[],o(r).constructor):i.apply(r,l));var r,i,l}return i(e,p),r(e,[{key:"request",value:(l=ie(le.mark((function e(t,r){var n;return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null!=r?r:this.context.params,e.abrupt("return",rt(t)(ot({},n)).then((function(e){var t=e.success,r=e.data;return t?Promise.resolve(r):Promise.reject(void 0)})).catch((function(e){return console.error("remote",t,e),Promise.reject(e)})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})}]);var l}();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 ut(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){l(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 ct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ct=function(){return!!e})()}lt.contextType=Ae;var st=function(){function e(){var r,i,a,u;t(this,e);for(var c=arguments.length,s=new Array(c),p=0;p<c;p++)s[p]=arguments[p];return i=this,a=e,u=[].concat(s),a=o(a),r=n(i,ct()?Reflect.construct(a,u||[],o(i).constructor):a.apply(i,u)),l(r,"styleWrapper",{style:{borderBottom:"1px solid #d9d9d9"}}),r}return i(e,lt),r(e,[{key:"setDefaultValue",value:function(e){var t=this.context.form;if(t){var r,n,o=this.props.code;if(!(null===(r=t.current)||void 0===r?void 0:r.getFieldValue(o)))null===(n=t.current)||void 0===n||n.setFieldValue(o,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=_e(r);return a("span",{style:ut(ut({},qe.style.labelStyle),n),children:t})}}},{key:"getItem",value:function(){var e,t,r=this.props,n=r.preview,o=r.labelCol,i=r.wrapperCol,l=r.tips,a=o&&i?{labelCol:{span:o},wrapperCol:{span:i}}:{};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:_e(t),itemStyles:_e(r)}}},{key:"display",value:function(){var e=this.getFieldsValue(),t=this.props,r=t.defaultHide,n=void 0!==r&&r,o=t.children,i=t.preview,l=!n,a=$(o,{tag:"Conditions"});if(a){var u,c=a.type,s=a.action,p=null===(u=a.children)||void 0===u?void 0:u.map(function(e,t){return function(r){var n=r.test;try{if(e){e=Fe(Fe({},e),{},{preview:t});var o=Object.keys(e).join(",");return new Function("{".concat(o,"}"),"return ".concat(n))(e)}}catch(e){}}}(e,i));if((null==p?void 0:p.length)>0&&void 0!==(null==p?void 0:p[0])){var f=!1;if((f="and"===c?K(p):J(p))&&"hide"===s||!f&&"show"===s)return!1;if(!f&&"hide"===s||f&&"show"===s)return!0}}return l}},{key:"rules",value:function(){var e=this.props,t=e.preview,r=e.children;if(!t){var n,o,i=$(r,{tag:"Validates"});return null!==(n=null==i||null===(o=i.children)||void 0===o?void 0:o.map(Te))&&void 0!==n?n:[]}return[]}},{key:"collectionList",value:function(){var e=$(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=$(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,oe)}return new Function("moment","".concat(r))(oe)}catch(e){}}(this.getFieldsValue(),t);r&&setTimeout((function(){e.setFieldValue(r)}),1)}}},{key:"initValue",value:function(e){var t=this,r=this.props.defaultValue,n=void 0===r?e:r;n&&this.forceUpdate((function(){t.setDefaultValue(n)}))}}])}();st.contextType=Ae;var pt=["Component","defaultValue","style"];function ft(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?ft(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ht(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ht=function(){return!!e})()}var yt=function(){function e(){var r,i,a,u;t(this,e);for(var c=arguments.length,s=new Array(c),p=0;p<c;p++)s[p]=arguments[p];return i=this,a=e,u=[].concat(s),a=o(a),r=n(i,ht()?Reflect.construct(a,u||[],o(i).constructor):a.apply(i,u)),l(r,"initValue",(function(){var e=r.props.defaultValue;e&&r.forceUpdate((function(){r.setDefaultValue(e)}))})),l(r,"onChange",(function(e){r.setFieldValue(e)})),r}return i(e,st),r(e,[{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,o=this.props,i=o.code,l=o.hidden,c=this.props,s=c.Component;c.defaultValue,c.style;var p=ne(c,pt),f=this.getStyles(),d=f.styles,h=f.itemStyles;return a(m.Item,dt(dt(dt({name:i,label:this.getLabel(),style:h,hidden:l,rules:e},r),n),{},{children:a(s,dt(dt({},p),{},{style:d,onChange:this.onChange}))}))}return a(u,{})}}])}();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 mt(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){l(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(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bt=function(){return!!e})()}function gt(e,t,r,n){var i=se(o(e.prototype),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}var Ot=function(){function l(){return t(this,l),e=this,i=arguments,r=o(r=l),n(e,bt()?Reflect.construct(r,i||[],o(e).constructor):r.apply(e,i));var e,r,i}return i(l,st),r(l,[{key:"optionList",value:function(){var e=$(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 mt(mt({},e),{},{validator:function(e,t){return(null==t?void 0:t.length)>0?Promise.resolve():Promise.reject()}})}if(e.min&&e.max){return mt(mt({},e),{},{validator:function(t,r){return r.length>=e.min&&r.length<=e.max?Promise.resolve():Promise.reject()}})}return mt({},e)}))}},{key:"getList",value: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}},{key:"request",value:function(){var t=ie(le.mark((function t(r,n){var o;return le.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=qe.request.root+r,t.abrupt("return",gt(l,"request",this,3)([o,n]).then((function(t){if(Array.isArray(t)){var r=t.map((function(t){var r,n=null===(r=Object.entries(t))||void 0===r?void 0:r[0],o=e(n,2);return{key:o[0],label:o[1]}}));return Promise.resolve(r)}return Promise.resolve(t)})));case 2:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}()}])}();function wt(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 jt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pt=function(){return!!e})()}var kt=function(){function e(){var r,i,a,u;t(this,e);for(var c=arguments.length,s=new Array(c),p=0;p<c;p++)s[p]=arguments[p];return i=this,a=e,u=[].concat(s),a=o(a),r=n(i,Pt()?Reflect.construct(a,u||[],o(i).constructor):a.apply(i,u)),l(r,"uploading",!1),l(r,"state",{fileList:[],fileView:void 0,modal:{open:!1,progress:0}}),l(r,"getFileTypeList",(function(){var e,t=null===(e=r.props.fileType)||void 0===e?void 0:e.replace(/\ +/g,"").split(",");return null==t?void 0:t.map((function(e){return e.startsWith(".")?qe.mimeType[e]:e}))})),l(r,"onStart",(function(){clearInterval(r.timer),r.setState({modal:{open:!0,progress:0}}),r.uploading=!0})),l(r,"onProgress",(function(e){if(r.uploading){clearInterval(r.timer);var t=Math.round(e.percent/2);if(r.setState({modal:{open:!0,progress:t}}),50===t){var n=t;r.timer=setInterval((function(){r.uploading?r.setState({modal:{open:!0,progress:++n}}):(clearInterval(r.timer),r.setState({modal:{open:!1,progress:0}})),99===n&&clearInterval(r.timer)}),1e3)}}})),l(r,"onSuccess",(function(e,t){clearInterval(r.timer);var n=e.data,o=n.id,i=n.url;t.status="done",t.response=e,t.id=o,t.url=i;var l=[].concat(pe(r.state.fileList),[t]);r.setState({fileList:l,modal:{open:!0,progress:100}},(function(){r.onChange(l),setTimeout((function(){r.setState({modal:{open:!1,progress:0}})}),500)})),r.uploading=!1})),l(r,"onError",(function(e,t,n){var o;clearInterval(r.timer);var i=[].concat(pe(r.state.fileList),[n]);n.status="error",n.response=null!==(o=null==t?void 0:t.message)&&void 0!==o?o:"上传失败",r.setState({fileList:i,modal:{open:!1,progress:100}},(function(){r.onChange(i)})),r.uploading=!1})),l(r,"onRemove",(function(e){var t=r.state.fileList.filter((function(t){return t.id!==e.id}));r.setState({fileList:t},(function(){r.onChange(t)}))})),r}return i(e,lt),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=qe.request.root+qe.file.listUrl;t&&t.length>0&&this.request(r,{ids:t}).then((function(t){var r=t.map((function(e){return jt(jt({},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:"onBeforeUpload",value:function(e){var t=this.props.fileSize;if(t&&fe.parse(t)<e.size)return b.error("上传的文件大小,不能超过 ".concat(t,"!")),g.LIST_IGNORE;return!0}}])}();function St(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(St=function(){return!!e})()}var Ct=function(){function e(){return t(this,e),r=this,l=arguments,i=o(i=e),n(r,St()?Reflect.construct(i,l||[],o(r).constructor):i.apply(r,l));var r,i,l}return i(e,st),r(e,[{key:"render",value:function(){if(this.display()){var e=this.rules(),t=this.props,r=t.title,n=t.hidden,o=this.getStyles(),i=o.styles,l=o.itemStyles;return a(m.Item,{style:l,hidden:n,rules:n?[]:e,wrapperCol:{span:24},children:a("div",{style:i,children:r})})}return a(u,{})}}])}();function xt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xt=function(){return!!e})()}var Dt=function(){function e(){return t(this,e),r=this,l=arguments,i=o(i=e),n(r,xt()?Reflect.construct(i,l||[],o(r).constructor):i.apply(r,l));var r,i,l}return i(e,st),r(e,[{key:"render",value:function(){var e,t=this.display(),r=null===(e=this.context.tooltip)||void 0===e||e;if(t&&r){var n=this.props,o=n.title,i=n.hidden,l=n.children,c=this.getStyles(),s=c.styles,p=c.itemStyles;return a(m.Item,{style:p,hidden:i,wrapperCol:{span:24},children:a("div",{style:s,children:null!=o?o:l})})}return a(u,{})}}])}(),Vt=function(e){var t=e.value,r=e.type,n=e.style,o=e.onChange;return f((function(){null==o||o(t)}),[]),t&&"url"===r?t.split(/[,;\s]/).map((function(e){return a("div",{style:n,children:a("a",{href:e,target:"_blank",rel:"noreferrer",children:e})})})):a("div",{style:n,children:t})},Lt=function(e){var t,r;return(null!==(t=null===(r=qe.previewComponents)||void 0===r?void 0:r.PreviewText)&&void 0!==t?t:Vt)(e)},It=function(e){var t=e.value;e.type,e.style;var r=e.onChange;return f((function(){null==r||r(t)}),[]),a("div",{dangerouslySetInnerHTML:{__html:t}})},Rt=function(e){var t,r;return(null!==(t=null===(r=qe.previewComponents)||void 0===r?void 0:r.PreviewEditor)&&void 0!==t?t:It)(e)},Et=function(e){var t=e.value,r=e.format,n=e.style,o=e.onChange;f((function(){o(t)}),[]);for(var i=r,l=["H","M","S"],u=t?t.split(":"):["000","00","00"],c=0;c<l.length;c++)i=i.replace(new RegExp("\\[".concat(l[c],"\\]|").concat(l[c]),"g"),u[c]);return a("div",{style:n,children:i})},Bt=function(e){var t,r;return(null!==(t=null===(r=qe.previewComponents)||void 0===r?void 0:r.PreviewDuration)&&void 0!==t?t:Et)(e)},Ft=function(e){var t=e.checked,r=e.style,n=e.onChange;return f((function(){n(t)}),[]),a("div",{style:r,children:t?"开启":"关闭"})},Tt=function(e){var t,r;return(null!==(t=null===(r=qe.previewComponents)||void 0===r?void 0:r.PreviewSwitch)&&void 0!==t?t:Ft)(e)},At=function(e){var t=e.value,r=e.list,n=e.style,o=e.onChange;if(f((function(){o(t)}),[]),Array.isArray(t)){var i=r.filter((function(e){var r=e.key;return t.includes(r)})).map((function(e){return e.label}));return a("div",{style:n,children:null==i?void 0:i.join()})}var l=null==r?void 0:r.find((function(e){return e.key===t}));return a("div",{style:n,children:null==l?void 0:l.label})},Nt=function(e){var t,r;return(null!==(t=null===(r=qe.previewComponents)||void 0===r?void 0:r.PreviewList)&&void 0!==t?t:At)(e)},Mt=function(e){var t=e.fileList,r=qe.request.prefix+qe.file.downloadUrl,n=qe.request.prefix+qe.file.previewUrl;return a(u,{children:null==t?void 0:t.map((function(e){var t=e.id,o=e.name,i=e.url,l=e.contentType,u=r+"/"+t;return null!=l&&l.endsWith("pdf")?a("div",{children:c(O,{style:{paddingBottom:10},children:[a("a",{href:i,target:"_blank",rel:"noreferrer",children:o}),a("a",{href:u,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=l&&l.startsWith("image")?a("div",{children:c(O,{style:{paddingBottom:10},children:[c("div",{children:[a(w,{width:200,src:i,alt:o}),a("div",{children:o})]}),a("a",{href:u,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=l&&l.startsWith("video")?a("div",{children:c(O,{style:{paddingBottom:10},children:[c("div",{children:[a("video",{src:i,controls:!0,style:{width:260},children:"当前浏览器不支持视频播放,请使用最新版谷歌浏览器!"}),a("div",{children:o})]}),a("a",{href:u,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=l&&l.startsWith("audio")?a("div",{children:c("div",{style:{paddingBottom:10,display:"flex",alignItems:"center"},children:[c("div",{children:[a("audio",{src:i,controls:!0,style:{width:"calc(100% - 40px)",height:30},children:"当前浏览器不支持音频播放,请使用最新版谷歌浏览器!"}),a("div",{children:o})]}),a("a",{style:{paddingLeft:10},href:u,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=o&&o.endsWith(".doc")||null!=o&&o.endsWith(".docx")||null!=o&&o.endsWith(".xls")||null!=o&&o.endsWith(".xlsx")||null!=o&&o.endsWith(".ppt")||null!=o&&o.endsWith(".pptx")?a("div",{children:c(O,{style:{paddingBottom:10},children:[a("a",{href:n+"/"+t,target:"_blank",rel:"noreferrer",children:o}),a("a",{href:u,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):a("div",{children:c(O,{style:{paddingBottom:10},children:[a("a",{href:i,target:"_blank",rel:"noreferrer",children:o}),a("a",{href:u,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},Ut=function(e){var t,r;return(null!==(t=null===(r=qe.previewComponents)||void 0===r?void 0:r.PreviewFile)&&void 0!==t?t:Mt)(e)},qt=function(e){var t=e.fileList,r=e.autoplay,n=e.muted,o=e.loop,i=e.preload,l=qe.request.prefix+qe.file.downloadUrl;return a(u,{children:null==t?void 0:t.map((function(e){var t=e.id,u=e.name,s=e.url,p=l+"/"+t;return a("div",{children:c(O,{style:{paddingBottom:10},children:[c("div",{children:[a("audio",{src:s,controls:!0,autoPlay:r,muted:n,loop:o,preload:i,style:{width:"calc(100% - 40px)",height:30},children:"当前浏览器不支持音频播放,请使用最新版谷歌浏览器!"}),a("div",{children:u})]}),a("a",{href:p,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},zt=function(e){var t,r;return(null!==(t=null===(r=qe.previewComponents)||void 0===r?void 0:r.PreviewAudio)&&void 0!==t?t:qt)(e)},_t=function(e){var t=e.fileList,r=e.controls,n=e.autoplay,o=e.muted;e.pip;var i=e.loop,l=e.preload,s=qe.request.prefix+qe.file.downloadUrl;return a(u,{children:null==t?void 0:t.map((function(e){var t=e.id,u=e.name,p=e.url,f=s+"/"+t;return a("div",{children:c(O,{style:{paddingBottom:10},children:[c("div",{children:[a("video",{src:p,controls:r,autoPlay:n,muted:o,loop:i,preload:l,style:{width:260},children:"当前浏览器不支持视频播放,请使用最新版谷歌浏览器!"}),a("div",{children:u})]}),a("a",{href:f,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},Wt=function(e){var t,r;return(null!==(t=null===(r=qe.previewComponents)||void 0===r?void 0:r.PreviewVideo)&&void 0!==t?t:_t)(e)},Ht=function(e){var t=e.fileList,r=e.width,n=e.height,o=e.style;return a(u,{children:null==t?void 0:t.map((function(e){var t=e.id,i=e.name,l=e.url;return a("div",{style:o,children:c(O,{style:{paddingBottom:10},children:[a(w,{width:r,height:n,src:l,alt:i}),a("a",{href:qe.request.prefix+qe.file.downloadUrl+"/"+t,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},Gt=function(e){var t,r;return(null!==(t=null===(r=qe.previewComponents)||void 0===r?void 0:r.PreviewImage)&&void 0!==t?t:Ht)(e)};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 $t(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){l(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 Kt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kt=function(){return!!e})()}var Jt=function(){function e(){return t(this,e),r=this,l=arguments,i=o(i=e),n(r,Kt()?Reflect.construct(i,l||[],o(r).constructor):i.apply(r,l));var r,i,l}return i(e,st),r(e,[{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,o=this.props,i=o.code,l=o.type,c=o.preview,s=o.placeholder,p=o.maxLength,f=o.allowClear,d=o.showCount,h=o.readonly,y=o.hidden,v=this.getStyles(),b=v.styles,g=v.itemStyles;return a(m.Item,$t($t($t({name:i,label:this.getLabel(),style:g,hidden:y,rules:e},r),n),{},{children:c?a(Lt,{type:l,style:b}):a(j,{maxLength:p,placeholder:s,allowClear:f,showCount:d,disabled:h,style:b})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}();function Qt(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 Xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zt=function(){return!!e})()}var er=function(){function e(){return t(this,e),r=this,l=arguments,i=o(i=e),n(r,Zt()?Reflect.construct(i,l||[],o(r).constructor):i.apply(r,l));var r,i,l}return i(e,st),r(e,[{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,o=t.placeholder,i=t.maxLength,l=t.allowClear,c=t.showCount,s=t.minRow,p=void 0===s?"0":s,f=t.maxRow,d=void 0===f?"0":f,h=t.readonly,y=t.hidden,v=this.getItem(),b=v.itemProps,g=v.itemLayouts,O=this.getStyles(),w=O.styles,P=O.itemStyles,k=Number(p),S=Number(d);return a(m.Item,Xt(Xt(Xt({name:r,label:this.getLabel(),style:P,hidden:y,rules:y?[]:e},b),g),{},{children:n?a(Lt,{style:w}):a(j.TextArea,{maxLength:i,placeholder:o,allowClear:l,showCount:c,autoSize:!(k+S<1)&&{minRows:k,maxRows:S},disabled:h,style:w})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}();function tr(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 rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tr(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function nr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nr=function(){return!!e})()}var or=function(){function e(){return t(this,e),r=this,l=arguments,i=o(i=e),n(r,nr()?Reflect.construct(i,l||[],o(r).constructor):i.apply(r,l));var r,i,l}return i(e,st),r(e,[{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,o={};"digits"===r?o=n?{precision:Number(n)}:{precision:2}:"money"===r?o={formatter:function(e){return"¥ ".concat(e).replace(/\B(?=(\d{3})+(?!\d))/g,",")},parser:function(e){return e.replace(/\$\s?|(,*)/g,"")}}:"percentage"===r&&(o={formatter:function(e){return"".concat(e,"%")},parser:function(e){return e.replace("%","")}}),this.onComputeValue();var i=this.rules().map((function(e){return e.required?rr(rr({},e),{},{type:"number"}):e})),l=this.getItem(),c=l.itemProps,s=l.itemLayouts,p=this.props,f=p.code,d=p.preview,h=p.min,y=p.max,v=p.readonly,b=p.hidden,g=this.getStyles(),O=g.styles,w=g.itemStyles;return a(m.Item,rr(rr(rr({name:f,label:this.getLabel(),style:w,hidden:b,rules:b?[]:i},c),s),{},{children:d?a(Lt,{style:O}):a(P,rr(rr({min:h,max:y,disabled:v},o),{},{style:O}))}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}();function ir(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 lr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ir(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ir(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ar(e,t,r){return t=o(t),n(e,ur()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ur=function(){return!!e})()}var cr=function(){function e(){return t(this,e),ar(this,e,arguments)}return i(e,st),r(e,[{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,o=this.props,i=o.code,l=o.title,c=o.preview,s=o.placeholder,p=o.hidden,f=o.readonly,d=this.getStyles(),h=d.styles,y=d.itemStyles;return a(m.Item,lr(lr(lr({name:i,label:this.getLabel(),style:y,hidden:p,colon:!!l,rules:p?[]:e},r),n),{},{children:c||f?a(Rt,{style:h}):a(sr,{placeholder:s,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),sr=function(e){function n(){var e;t(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=ar(this,n,[].concat(o)),l(e,"state",{editor:null,html:""}),l(e,"handleChange",Q((function(t){var r,n;null===(r=(n=e.props).onChange)||void 0===r||r.call(n,t)}),500)),e}return i(n,e),r(n,[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.setState({html:e.props.value})}),1)}},{key:"render",value:function(){var e=this,t=this.props,r=t.placeholder,n=t.style,o=this.state,i=o.editor,l=o.html,u=lr({height:"200px",overflowY:"hidden"},n);return c("div",{style:{border:"1px solid #ccc",zIndex:100},children:[a(de,{editor:i,mode:"default",defaultConfig:{excludeKeys:["group-image","group-video"]},style:{borderBottom:"1px solid #ccc"}}),a(he,{defaultConfig:{placeholder:r},value:l,onCreated:function(t){e.setState({editor:t})},onChange:function(t){var r=t.getHtml();e.setState({html:r},(function(){e.handleChange(r)}))},mode:"default",style:u})]})}}])}(s.Component);function pr(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 fr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pr(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function dr(e,t,r){return t=o(t),n(e,hr()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function hr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hr=function(){return!!e})()}var yr=function(){function e(){var r;t(this,e);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return r=dr(this,e,[].concat(o)),l(r,"state",{list:[]}),r}return i(e,Ot),r(e,[{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,o=t.multiple,i=t.placeholder,l=t.allowClear,c=void 0===l||l,s=t.readonly,p=t.hidden,f=o?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&&(!o&&!t.some((function(e){return e.key===r}))||o&&!t.some((function(e){return r.includes(e.key)})))&&e.cleanFieldValue()}})),y=this.getItem(),v=y.itemProps,b=y.itemLayouts,g=this.getStyles(),O=g.styles,w=g.itemStyles;return a(m.Item,fr(fr(fr({name:r,label:this.getLabel(),style:w,hidden:p,rules:p?[]:f},v),b),{},{children:n?a(Nt,{list:this.state.list,style:O}):a(mr,{list:h,multiple:o,placeholder:i,allowClear:c,readonly:s,style:O})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),vr=k.Option,mr=function(){function e(){var r;t(this,e);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return r=dr(this,e,[].concat(o)),l(r,"handleItemValue",(function(e){var t,n;null===(t=(n=r.props).onChange)||void 0===t||t.call(n,e)})),r}return i(e,lt),r(e,[{key:"render",value:function(){var e=this.props,t=e.list,r=e.value,n=e.multiple,o=e.placeholder,i=e.allowClear,l=e.readonly,u=e.style;return a(k,{showSearch:!0,placeholder:o,mode:n?"multiple":void 0,disabled:l,value:r,allowClear:i,style:u,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 a(vr,{value:t,children:r},t)}))})}}])}();function br(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 gr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?br(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):br(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Or(e,t,r){return t=o(t),n(e,wr()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function wr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wr=function(){return!!e})()}var jr=function(){function e(){var r;t(this,e);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return r=Or(this,e,[].concat(o)),l(r,"state",{list:[]}),r}return i(e,Ot),r(e,[{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()}})),o=this.props,i=o.code,l=o.preview,u=o.readonly,c=o.hidden,s=this.getItem(),p=s.itemProps,f=s.itemLayouts,d=this.getStyles(),h=d.styles,y=d.itemStyles;return a(m.Item,gr(gr(gr({name:i,label:this.getLabel(),style:y,hidden:c,rules:c?[]:t},p),f),{},{children:l?a(Nt,{list:this.state.list,style:h}):a(Pr,{list:n,readonly:u,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),null}}])}(),Pr=function(){function e(){return t(this,e),Or(this,e,arguments)}return i(e,lt),r(e,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.list,n=e.readonly,o=e.style,i=e.onChange;return a(S.Group,{style:o,value:t,onChange:function(e){null==i||i(e)},children:r&&r.map((function(e){var t=e.key,r=e.label;return a(S,{value:t,disabled:n,children:r},t)}))})}}])}();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){l(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,t,r){return t=o(t),n(e,xr()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function xr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xr=function(){return!!e})()}var Dr=function(){function e(){var r;t(this,e);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return r=Cr(this,e,[].concat(o)),l(r,"state",{list:[]}),r}return i(e,Ot),r(e,[{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()}})),o=this.props,i=o.code,l=o.preview,c=o.optionType,s=o.readonly,p=o.hidden,f=this.getItem(),d=f.itemProps,h=f.itemLayouts,y=this.getStyles(),v=y.styles,b=y.itemStyles;return a(m.Item,Sr(Sr(Sr({name:i,label:this.getLabel(),style:b,hidden:p,rules:p?[]:t},d),h),{},{children:l?a(Nt,{list:n,style:v}):a(Vr,{list:this.state.list,optionType:c,readonly:s,style:v})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),Vr=function(){function e(){return t(this,e),Cr(this,e,arguments)}return i(e,lt),r(e,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.list,n=e.optionType,o=e.readonly,i=e.style,l=e.onChange;return a(C.Group,{value:t,optionType:n,style:i,onChange:function(e){null==l||l(e.target.value)},children:r&&r.map((function(e){var t=e.key,r=e.label;return a(C,{value:t,disabled:o,children:r},t)}))})}}])}();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 Ir(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){l(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 Rr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rr=function(){return!!e})()}var Er=function(){function e(){return t(this,e),r=this,l=arguments,i=o(i=e),n(r,Rr()?Reflect.construct(i,l||[],o(r).constructor):i.apply(r,l));var r,i,l}return i(e,st),r(e,[{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,o=t.readonly,i=t.hidden,l=this.getItem(),c=l.itemProps,s=l.itemLayouts,p=this.getStyles(),f=p.styles,d=p.itemStyles;return a(m.Item,Ir(Ir(Ir({label:this.getLabel(),name:r,style:d,hidden:i,rules:i?[]:e,valuePropName:"checked"},c),s),{},{children:n?a(Tt,{style:f}):a(x,{disabled:o,style:f})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}();function Br(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 Fr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Br(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Br(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tr(e,t,r){return t=o(t),n(e,Ar()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function Ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ar=function(){return!!e})()}!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.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 Nr=function(){function e(){return t(this,e),Tr(this,e,arguments)}return i(e,st),r(e,[{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,o=this.props,i=o.code,l=o.preview,c=o.format,s=void 0===c?"H小时M分S秒":c,p=o.readonly,f=o.hidden,d=this.getStyles(),h=d.styles,y=d.itemStyles;return a(m.Item,Fr(Fr(Fr({name:i,label:this.getLabel(),style:y,hidden:f,rules:f?[]:e},r),n),{},{children:l?a(Bt,{format:s,style:h}):a(Mr,{format:s,readonly:p,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),Mr=function(){function e(){var r;t(this,e);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return r=Tr(this,e,[].concat(o)),l(r,"duration",[0,0,0]),l(r,"pattern",["H","M","S"]),l(r,"changeValue",(function(e){return function(t){if("number"==typeof t){var n,o;r.duration[e]=t;var i=r.duration.map((function(e,t){return ye(0===t?"000":"00",e)}));null===(n=(o=r.props).onChange)||void 0===n||n.call(o,i.join(":"))}}})),r}return i(e,lt),r(e,[{key:"render",value:function(){var e=this,t=this.props,r=t.value,n=t.format,o=t.readonly,i=t.style,l=n.trim().split(/\[.*?\]|[HMS]/);this.pattern=n.trim().split(new RegExp("[".concat(l.join(""),"]"))).filter((function(e){return e})),"string"==typeof r&&(this.duration=r.split(":").map(Number));var u=[];return l.forEach((function(t,r){t&&u.push(t),r<=e.pattern.length-1&&u.push(e.pattern[r])})),a("div",{className:"duration",children:u.map((function(t,r){return t.includes("H")?a(m.Item,{children:a(P,{style:Fr({width:"100%"},i),min:0,max:999,precision:0,value:e.duration[0],formatter:function(e){return e<100?e<10?"00"+e:"0"+e:e.toString()},onChange:e.changeValue(0),controls:!1,disabled:!!/\[|\]/.test(t)||o})},"H"):t.includes("M")?a(m.Item,{children:a(P,{style:Fr({width:"100%"},i),min:0,max:59,precision:0,value:e.duration[1],formatter:function(e){return e<10?"0"+e:e.toString()},onChange:e.changeValue(1),controls:!1,disabled:!!/\[|\]/.test(t)||o})},"M"):t.includes("S")?a(m.Item,{children:a(P,{style:Fr({width:"100%"},i),min:0,max:59,precision:0,value:e.duration[2],formatter:function(e){return e<10?"0"+e:e.toString()},onChange:e.changeValue(2),controls:!1,disabled:!!/\[|\]/.test(t)||o})},"S"):a("span",{children:t},r)}))})}}])}();function Ur(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 qr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ur(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ur(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zr(e,t,r){return t=o(t),n(e,_r()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function _r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_r=function(){return!!e})()}ve.extend(me),ve.extend(be);var Wr=function(){function e(){return t(this,e),zr(this,e,arguments)}return i(e,st),r(e,[{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,o=this.props,i=o.code,l=o.type,c=void 0===l?"date":l,s=o.format,p=void 0===s?"YYYY-MM-DD":s,f=o.showTime,d=void 0!==f&&f,h=o.preview,y=o.placeholder,v=o.allowClear,b=void 0===v||v,g=o.readonly,O=o.hidden,w=this.getStyles(),j=w.styles,P=w.itemStyles;return a(m.Item,qr(qr(qr({name:i,label:this.getLabel(),style:P,hidden:O,rules:O?[]:e},r),n),{},{children:h?a(Lt,{style:j}):a(Hr,{type:c,format:p,showTime:d,placeholder:y,allowClear:b,readonly:g,style:j})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),Hr=function(){function e(){return t(this,e),zr(this,e,arguments)}return i(e,lt),r(e,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.type,n=e.format,o=e.showTime,i=e.placeholder,l=e.allowClear,u=e.readonly,c=e.style,s=e.onChange;return a(D,{value:t?ve(t,n):void 0,picker:r,format:n,showTime:o?{format:"HH:mm"}:void 0,placeholder:i,allowClear:l,disabled:u,style:c,onChange:function(e){null==s||s(null==e?void 0:e.format(n))}})}}])}();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 Yr(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){l(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,r){return t=o(t),n(e,Kr()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function Kr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kr=function(){return!!e})()}ve.extend(ge);var Jr=function(){function e(){return t(this,e),$r(this,e,arguments)}return i(e,st),r(e,[{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,o=this.props,i=o.code,l=o.format,c=void 0===l?"HH:mm:ss":l,s=o.preview,p=o.placeholder,f=o.allowClear,d=void 0===f||f,h=o.readonly,y=o.hidden,v=this.getStyles(),b=v.styles,g=v.itemStyles;return a(m.Item,Yr(Yr(Yr({name:i,label:this.getLabel(),style:g,hidden:y,rules:y?[]:e},r),n),{},{children:s?a(Lt,{style:b}):a(Qr,{format:c,placeholder:p,allowClear:d,readonly:h,style:b})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),Qr=function(){function e(){return t(this,e),$r(this,e,arguments)}return i(e,lt),r(e,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.format,n=e.placeholder,o=e.allowClear,i=e.readonly,l=e.style,u=e.onChange;return a(V,{value:t?ve(t,r):void 0,format:r,placeholder:n,allowClear:o,disabled:i,style:l,onChange:function(e){null==u||u(null==e?void 0:e.format(r))}})}}])}();function Xr(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 Zr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xr(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function en(e,t,r){return t=o(t),n(e,tn()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function tn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tn=function(){return!!e})()}var rn=function(e){return Array.isArray(e)?e:e&&e.list},nn=function(){function e(){return t(this,e),en(this,e,arguments)}return i(e,Ot),r(e,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,o=t.maxCount,i=t.fileType,l=t.fileTypeMessage,c=t.fileSize,s=t.readonly,p=t.hidden,f=this.getItem(),d=f.itemProps,h=f.itemLayouts,y=this.getStyles(),v=y.styles,b=y.itemStyles;return a(m.Item,Zr(Zr(Zr({name:r,label:this.getLabel(),style:b,hidden:p,rules:p?[]:e,valuePropName:"list",getValueFromEvent:rn},d),h),{},{children:a(on,{maxCount:o,fileType:i,fileTypeMessage:l,fileSize:c,readonly:s,preview:n,style:v})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),on=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=en(this,e,[].concat(i)),l(r,"onBeforeUpload",(function(t){var n,i,l,a,u=r.getFileTypeList();return u&&u.length>0?u.includes(t.type)?(n="onBeforeUpload",i=r,l=3,a=se(o(e.prototype),n,i),2&l&&"function"==typeof a?function(e){return a.apply(i,e)}:a)([t]):(b.error(r.props.fileTypeMessage),g.LIST_IGNORE):(b.error("文件类型不匹配!"),g.LIST_IGNORE)})),r}return i(e,kt),r(e,[{key:"render",value:function(){var e=this.state,t=e.fileList,r=e.modal,n=this.props,o=n.preview,i=n.maxCount,l=n.readonly,s=n.style,p=i?Number(i):0;if(o)return a(Ut,{fileList:t});var f={onStart:this.onStart,onSuccess:this.onSuccess,onProgress:this.onProgress,onError:this.onError};return c(u,{children:[a(g,Zr(Zr({action:qe.request.prefix+qe.file.uploadUrl,fileList:t,maxCount:p,disabled:l,beforeUpload:this.onBeforeUpload,onRemove:this.onRemove},f),{},{children:a(L,{disabled:l||p<=t.length,icon:a(Oe,{}),style:s,children:"上传"})})),c(I,{open:r.open,closable:!1,footer:null,children:[a("div",{children:"上传文件进度"}),a(R,{percent:r.progress})]})]})}}])}();function ln(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 an(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ln(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function un(e,t,r){return t=o(t),n(e,cn()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function cn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cn=function(){return!!e})()}var sn=function(e){return Array.isArray(e)?e:e&&e.list},pn=["image/jpeg","image/png"],fn=function(){function e(){return t(this,e),un(this,e,arguments)}return i(e,Ot),r(e,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,o=t.maxCount,i=t.editor,l=void 0===i||i,c=t.fileSize,s=t.fileWidth,p=void 0===s?"100":s,f=t.fileHeight,d=void 0===f?"100":f,h=t.readonly,y=t.hidden,v=this.getItem(),b=v.itemProps,g=v.itemLayouts,O=this.getStyles(),w=O.styles,j=O.itemStyles;return a(m.Item,an(an(an({name:r,label:this.getLabel(),style:j,hidden:y,rules:y?[]:e,valuePropName:"list",getValueFromEvent:sn},b),g),{},{children:a(dn,{maxCount:o,editor:l,fileSize:c,fileWidth:Number(p),fileHeight:Number(d),readonly:h,preview:n,style:w})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),dn=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=un(this,e,[].concat(i)),l(r,"onChangeValue",(function(e){var t=e.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,o=n.id;n.name;var i=n.url;e.id=o,e.url=i,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}));r.setState({fileList:t},(function(){r.onChange(t)}))})),l(r,"onBeforeUpload",(function(t){var n,i,l,a;return pn.includes(t.type)?(n="onBeforeUpload",i=r,l=3,a=se(o(e.prototype),n,i),2&l&&"function"==typeof a?function(e){return a.apply(i,e)}:a)([t]):(b.error("上传文件类型,仅支持图片类型!"),g.LIST_IGNORE)})),r}return i(e,kt),r(e,[{key:"render",value:function(){var e=this,t=this.state,r=t.fileList,n=t.fileView,o=this.props,i=o.preview,l=o.maxCount,s=o.readonly,p=o.editor,f=o.fileWidth,d=void 0===f?100:f,h=o.fileHeight,y=void 0===h?100:h,v=o.style,m=l?Number(l):0;return i?a(Gt,{fileList:r,width:d,height:y,style:v}):c(u,{children:[p?a(Ce,{rotationSlider:!0,modalTitle:"图片编辑",modalOk:"确认",modalCancel:"取消",aspect:d/y,children:a(g,{listType:"picture-card",accept:pn.join(","),action:qe.request.prefix+qe.file.uploadUrl,fileList:r,maxCount:m,disabled:s,beforeUpload:this.onBeforeUpload,onChange:this.onChangeValue,onRemove:this.onRemove,onPreview:function(t){return e.setState({fileView:t})},children:!s&&Number(m)>r.length&&a(L,{type:"link",icon:a(we,{}),style:v})})}):a(g,{listType:"picture-card",accept:pn.join(","),action:qe.request.prefix+qe.file.uploadUrl,fileList:r,maxCount:m,disabled:s,beforeUpload:this.onBeforeUpload,onChange:this.onChangeValue,onRemove:this.onRemove,onPreview:function(t){return e.setState({fileView:t})},children:!s&&Number(m)>r.length&&a(L,{type:"link",icon:a(we,{}),style:v})}),(null==n?void 0:n.id)&&a(I,{title:n.name,open:!0,footer:null,onCancel:function(){return e.setState({fileView:void 0})},children:a("img",{alt:n.name,style:{width:"100%"},src:n.url})})]})}}])}();function hn(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 yn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vn=function(){return!!e})()}var mn=function(){function e(){return t(this,e),r=this,l=arguments,i=o(i=e),n(r,vn()?Reflect.construct(i,l||[],o(r).constructor):i.apply(r,l));var r,i,l}return i(e,Ot),r(e,[{key:"plusRules",value:function(){var e=this.rules();return null==e?void 0:e.map((function(e){if(e.required){return yn(yn({},e),{},{validator:function(e,t){return 0===t?Promise.reject():Promise.resolve()}})}return yn({},e)}))}},{key:"render",value:function(){if(this.display()){var e;this.onComputeValue();var t=this.plusRules(),r=this.props,n=r.code,o=r.preview,i=r.allowHalf,l=void 0!==i&&i,c=r.count,s=void 0===c?5:c,p=r.items,f=r.readonly,d=r.hidden,h=this.getItem(),y=h.itemProps,v=h.itemLayouts,b=this.getStyles(),g=b.styles,O=b.itemStyles,w=null!==(e=null==p?void 0:p.split(","))&&void 0!==e?e:[];return a(m.Item,yn(yn(yn({name:n,label:this.getLabel(),style:O,hidden:d,rules:d?[]:t},y),v),{},{children:a(E,{allowHalf:l,count:s,character:function(e){var t=e.index,r=void 0===t?0:t;return w.length>0?w[r]:a(je,{})},disabled:o||f,style:g})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}();function bn(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 gn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function On(e,t,r){return t=o(t),n(e,wn()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function wn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wn=function(){return!!e})()}var jn=function(e){return Array.isArray(e)?e:e&&e.list},Pn=["audio/mpeg","audio/wav"],kn=function(){function e(){return t(this,e),On(this,e,arguments)}return i(e,Ot),r(e,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,o=t.maxCount,i=t.fileSize,l=t.readonly,c=t.hidden,s=this.props,p=s.autoplay,f=void 0!==p&&p,d=s.muted,h=void 0!==d&&d,y=s.loop,v=void 0!==y&&y,b=s.preload,g=void 0===b?"auto":b,O=this.getItem(),w=O.itemProps,j=O.itemLayouts,P=this.getStyles(),k=P.styles,S=P.itemStyles;return a(m.Item,gn(gn(gn({name:r,label:this.getLabel(),style:S,hidden:c,rules:c?[]:e,valuePropName:"list",getValueFromEvent:jn},w),j),{},{children:a(Sn,{code:r,maxCount:o,fileSize:i,readonly:l,preview:n,autoplay:f,muted:h,loop:v,preload:g,style:k})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),Sn=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=On(this,e,[].concat(i)),l(r,"onBeforeUpload",(function(t){var n,i,l,a;return Pn.includes(t.type)?(n="onBeforeUpload",i=r,l=3,a=se(o(e.prototype),n,i),2&l&&"function"==typeof a?function(e){return a.apply(i,e)}:a)([t]):(b.error("上传文件类型,仅支持音频类型!"),g.LIST_IGNORE)})),r}return i(e,kt),r(e,[{key:"render",value:function(){var e=this.state,t=e.fileList,r=e.modal,n=this.props,o=n.code,i=n.preview,l=n.maxCount,s=n.readonly,p=n.style,f=n.autoplay,d=n.muted,h=n.loop,y=n.preload,v=l?Number(l):0;if(i)return a(zt,{code:o,fileList:t,autoplay:f,muted:d,loop:h,preload:y});var m={onStart:this.onStart,onSuccess:this.onSuccess,onProgress:this.onProgress,onError:this.onError};return c(u,{children:[a(g,gn(gn({listType:"picture-card",accept:Pn.join(","),action:qe.request.prefix+qe.file.uploadUrl,fileList:t,maxCount:v,disabled:s,beforeUpload:this.onBeforeUpload,onRemove:this.onRemove},m),{},{children:!s&&Number(v)>t.length&&a(L,{type:"link",icon:a(we,{}),style:p})})),c(I,{open:r.open,closable:!1,footer:null,children:[a("div",{children:"上传文件进度"}),a(R,{percent:r.progress})]})]})}}])}();function Cn(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 xn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Dn(e,t,r){return t=o(t),n(e,Vn()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function Vn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vn=function(){return!!e})()}var Ln=function(e){return Array.isArray(e)?e:e&&e.list},In=["video/mp4"],Rn=function(){function e(){return t(this,e),Dn(this,e,arguments)}return i(e,Ot),r(e,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,o=t.maxCount,i=t.fileSize,l=t.readonly,c=t.hidden,s=this.props,p=s.controls,f=void 0===p||p,d=s.autoplay,h=void 0!==d&&d,y=s.muted,v=void 0!==y&&y,b=s.pip,g=void 0!==b&&b,O=s.loop,w=void 0!==O&&O,j=s.preload,P=void 0===j?"auto":j,k=this.getItem(),S=k.itemProps,C=k.itemLayouts,x=this.getStyles(),D=x.styles,V=x.itemStyles;return a(m.Item,xn(xn(xn({name:r,label:this.getLabel(),style:V,hidden:c,rules:c?[]:e,valuePropName:"list",getValueFromEvent:Ln},S),C),{},{children:a(En,{code:r,maxCount:o,fileSize:i,readonly:l,preview:n,controls:f,autoplay:h,muted:v,pip:g,loop:w,preload:P,style:D})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),En=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=Dn(this,e,[].concat(i)),l(r,"onBeforeUpload",(function(t){var n,i,l,a;return In.includes(t.type)?(n="onBeforeUpload",i=r,l=3,a=se(o(e.prototype),n,i),2&l&&"function"==typeof a?function(e){return a.apply(i,e)}:a)([t]):(b.error("上传文件类型,仅支持视频类型!"),g.LIST_IGNORE)})),r}return i(e,kt),r(e,[{key:"render",value:function(){var e=this.state,t=e.fileList,r=e.modal,n=this.props,o=n.code,i=n.preview,l=n.maxCount,s=n.readonly,p=n.style,f=n.controls,d=n.autoplay,h=n.muted,y=n.pip,v=n.loop,m=n.preload,b=l?Number(l):0;if(i)return a(Wt,{code:o,fileList:t,controls:f,autoplay:d,muted:h,pip:y,loop:v,preload:m});var O={onStart:this.onStart,onSuccess:this.onSuccess,onProgress:this.onProgress,onError:this.onError};return c(u,{children:[a(g,xn(xn({listType:"picture-card",accept:In.join(","),action:qe.request.prefix+qe.file.uploadUrl,fileList:t,maxCount:b,disabled:s,beforeUpload:this.onBeforeUpload,onRemove:this.onRemove},O),{},{children:!s&&Number(b)>t.length&&a(L,{type:"link",icon:a(we,{}),style:p})})),c(I,{open:r.open,closable:!1,footer:null,children:[a("div",{children:"上传文件进度"}),a(R,{percent:r.progress})]})]})}}])}();function Bn(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?Bn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tn(e,t,r){return t=o(t),n(e,An()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function An(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(An=function(){return!!e})()}var Nn=function(e){return Array.isArray(e)?e:e&&e.list},Mn=function(){function e(){return t(this,e),Tn(this,e,arguments)}return i(e,Ot),r(e,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,o=t.maxCount,i=t.fileType,l=t.fileTypeMessage,c=t.fileSize,s=t.readonly,p=t.hidden,f=this.getItem(),d=f.itemProps,h=f.itemLayouts,y=this.getStyles(),v=y.styles,b=y.itemStyles;return a(m.Item,Fn(Fn(Fn({name:r,label:this.getLabel(),style:b,hidden:p,rules:p?[]:e,valuePropName:"list",getValueFromEvent:Nn},d),h),{},{children:a(Un,{maxCount:o,fileType:i,fileTypeMessage:l,fileSize:c,readonly:s,preview:n,style:v})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),Un=function(){function e(){var r;t(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=Tn(this,e,[].concat(i)),l(r,"onBeforeUpload",(function(t){var n,i,l,a,u=r.getFileTypeList();return u&&u.length>0?u.includes(t.type)?(n="onBeforeUpload",i=r,l=3,a=se(o(e.prototype),n,i),2&l&&"function"==typeof a?function(e){return a.apply(i,e)}:a)([t]):(b.error(r.props.fileTypeMessage),g.LIST_IGNORE):(b.error("文件类型不匹配!"),g.LIST_IGNORE)})),l(r,"customRequest",(function(e){var t,n,o,i,l,a,u,c={blockSize:qe.chunk.chunkSize,checkFile:(u=ie(le.mark((function e(t){var n,o,i;return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fileName,o=t.fileMd5,i=t.fileSize,e.next=3,r.request("post form "+qe.chunk.checkFile,{fileName:n,fileMd5:o,fileSize:i});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return u.apply(this,arguments)}),checkBlock:(a=ie(le.mark((function e(t){var n,o,i,l;return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fileName,o=t.fileMd5,i=t.blockMd5,l=t.blockIndex,e.next=3,r.request("post form "+qe.chunk.checkChunk,{fileName:n,fileMd5:o,blockMd5:i,blockIndex:l});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=ie(le.mark((function e(t){var n,o,i,l,a,u;return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fileName,o=t.fileMd5,i=t.blockMd5,l=t.blockIndex,a=t.file,(u=new FormData).append("blockIndex",String(l)),u.append("blockMd5",i),u.append("fileName",n),u.append("fileMd5",o),u.append("file",a),e.next=9,r.request("post form "+qe.chunk.chunkUpload,u);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)}),mergeBlock:(i=ie(le.mark((function e(t){var n,o,i;return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fileName,o=t.fileMd5,i=t.fileSize,e.next=3,r.request("post form "+qe.chunk.doMerge,{fileName:n,fileMd5:o,fileSize:i});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)}),mergeProgress:(o=ie(le.mark((function e(){var t;return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.request(qe.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 o.apply(this,arguments)}),verifyFile:(n=ie(le.mark((function e(t){var n,o,i;return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fileName,o=t.fileMd5,i=t.fileSize,e.next=3,r.request("post form "+qe.chunk.onComplete,{fileName:n,fileMd5:o,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:(t=ie(le.mark((function e(){var t;return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.request(qe.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 t.apply(this,arguments)})},s=xe.create(c);s.progress((function(e,t){e.status="uploading",r.setState({modal:{open:!0,progress:t}})})),s.complete((function(e){var t=e.response,n=t.id,o=t.url;e.id=n,e.url=o,e.status="done";var i=[].concat(pe(r.state.fileList),[e]);r.setState({fileList:i,modal:{open:!1,progress:0}},(function(){r.onChange(i)}))})),s.error((function(e,t){e.status="error",e.response=t;var n=r.state.fileList,o=n.findIndex((function(t){return t.uid===e.uid}));-1===o?n.push(e):n[o]=e,r.setState({fileList:n,modal:{open:!1,progress:0}})})),s.start(e.file)})),r}return i(e,kt),r(e,[{key:"render",value:function(){var e=this.state,t=e.fileList,r=e.modal,n=this.props,o=n.preview,i=n.maxCount,l=n.readonly,s=n.style,p=i?Number(i):0;return o?a(Ut,{fileList:t}):c(u,{children:[a(g,{action:qe.request.prefix+qe.file.uploadUrl,fileList:t,maxCount:p,disabled:l,beforeUpload:this.onBeforeUpload,customRequest:this.customRequest,onRemove:this.onRemove,children:a(L,{disabled:l||p<=t.length,icon:a(Oe,{}),style:s,children:"上传"})}),c(I,{open:r.open,closable:!1,footer:null,children:[a("div",{children:"上传文件进度"}),a(R,{percent:r.progress})]})]})}}])}(),qn=["worksId","worksExtraId"];function zn(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 _n(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Wn(e,t,r){return t=o(t),n(e,Hn()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function Hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hn=function(){return!!e})()}var Gn=function(){function e(){return t(this,e),Wn(this,e,arguments)}return i(e,Ot),r(e,[{key:"getColumns",value:function(){var e,t=$(this.props.children,{tag:"Columns"});return t?null===(e=t.children)||void 0===e?void 0:e.map((function(e){var t;return _n(_n({},e),{},{rules:null===(t=e.rules)||void 0===t?void 0:t.map(Te)})})):[]}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.plusRules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,o=this.props,i=o.code,l=o.title,c=o.preview,s=o.readonly,p=o.hidden,f=this.getStyles(),d=f.styles,h=f.itemStyles;return a(m.Item,_n(_n(_n({name:i,style:h,hidden:p,rules:p?[]:e,valuePropName:"list"},r),n),{},{children:a(Yn,{preview:c||s,title:l,columns:this.getColumns(),style:d})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),Yn=function(){function e(){var r;t(this,e);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return r=Wn(this,e,[].concat(o)),l(r,"state",{dataSource:[],modal:{title:"",entity:void 0,show:!1}}),l(r,"onFinish",(function(e){var t=r.state.dataSource,n=[];e.id||e.uid?n=t.map((function(t){return e.id&&t.id===e.id||e.uid&&t.uid===e.uid?_n(_n({},t),e):t})):(e.index=t.length+1,e.uid=_(),n=[].concat(pe(t),[e])),r.setState({dataSource:n,modal:{title:"",entity:void 0,show:!1}},(function(){var e,t;null===(e=(t=r.props).onChange)||void 0===e||e.call(t,n)}))})),l(r,"onCancel",(function(){r.setState({modal:{title:"",entity:void 0,show:!1}})})),r}return i(e,lt),r(e,[{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,_n({id:e.worksExtraId,index:t+1},ne(e,qn))}));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,o=t.columns,i=t.onChange,l=this.state.dataSource;return n?o:X(o,{title:"操作",dataIndex:"option",valueType:"option",render:function(t,n){return[c(O,{children:[a("a",{onClick:function(){e.setState({modal:{title:"修改".concat(r),entity:n,show:!0}})},children:"修改"},"modifly"),a("a",{onClick:function(){I.confirm({title:"警告",icon:a(Pe,{}),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==i||i(t)}))}})},children:"删除"},"delete")]},"option")]}})}},{key:"render",value:function(){var e=this,t=this.props,r=t.title,n=t.preview,o=t.style,i=this.state,l=i.dataSource,u=i.modal,s=this.getColumns();return c(B,{title:r,bodyStyle:{padding:"0px 12px"},extra:n?null:a("a",{onClick:function(){e.setState({modal:{title:"新建".concat(r),entity:void 0,show:!0}})},children:"添加"},"new"),children:[a(F,{rowKey:"index",size:"small",style:o,columns:s,dataSource:l}),u.show&&a($n,{title:u.title,entity:u.entity,columns:s,onFinish:this.onFinish,onCancel:this.onCancel})]})}}])}(),$n=function(t){var r,n=t.title,o=t.entity,i=t.columns,l=t.onFinish,u=t.onCancel,c=m.useForm(),s=e(c,1)[0];return a(I,{title:n,width:740,open:!0,destroyOnClose:!0,onCancel:u,onOk:(r=ie(le.mark((function e(){return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.validateFields().then((function(e){l(_n(_n({},o),e))})).catch((function(e){console.warn(e)}));case 2:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)}),children:a(m,{form:s,name:"modalTable",initialValues:o,wrapperCol:{span:22},autoComplete:"off",layout:"vertical",children:a(T,{children:i.length>0&&i.map((function(e){var t=e.title,r=e.dataIndex,n=e.placeholder,o=e.rules;if("index"!==r&&"option"!==r)return a(A,{span:12,children:a(m.Item,{label:t,name:r,rules:o,children:a(j,{placeholder:n})})},r)}))})})})},Kn=["id","index"];function Jn(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 Qn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jn(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Zn(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zn(e,t):void 0}}(e))||t){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 i,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,i=e},f:function(){try{l||null==r.return||r.return()}finally{if(a)throw i}}}}function Zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eo(e,t,r){return t=o(t),n(e,to()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function to(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(to=function(){return!!e})()}var ro=function(){function e(){var r;t(this,e);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return r=eo(this,e,[].concat(o)),l(r,"itemList",[]),l(r,"columnList",[]),l(r,"state",{doc:void 0,loading:!0}),l(r,"initItems",function(){var e=ie(le.mark((function e(t){var n,o,i,l,a,u,c,s,p,f,d,h,y,v,m,b,g,O,w,j;return le.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.columnList=$(r.props.children,{tag:"Columns"}).children,n=r.columnList.map((function(e){return e.dataIndex})),o=Ee.selectors(t,"[code]"),i=Xn(o),e.prev=4,i.s();case 6:if((l=i.n()).done){e.next=29;break}if(a=l.value,u=a.getAttribute("code"),c=a.getAttribute("title"),s=a.tagName.toLowerCase(),!u||!n.includes(u)){e.next=27;break}if(p={},f=a.getAttribute("remote"),!((d=Ee.selectors(a,"Option")).length>0)){e.next=20;break}h=Xn(d);try{for(h.s();!(y=h.n()).done;)v=y.value,m=v.getAttribute("value"),b=v.textContent,m&&b&&(p[m]=b)}catch(e){h.e(e)}finally{h.f()}e.next=26;break;case 20:if(!f){e.next=26;break}return e.next=23,r.request(qe.request.root+f);case 23:g=e.sent,O=Xn(g);try{for(O.s();!(w=O.n()).done;)j=w.value,p[j.key]=j.label}catch(e){O.e(e)}finally{O.f()}case 26:r.itemList.push({code:u,title:c,type:s,data:p});case 27:e.next=6;break;case 29:e.next=34;break;case 31:e.prev=31,e.t0=e.catch(4),i.e(e.t0);case 34:return e.prev=34,i.f(),e.finish(34);case 37:r.setState({loading:!1});case 38:case"end":return e.stop()}}),e,null,[[4,31,34,37]])})));return function(t){return e.apply(this,arguments)}}()),r}return i(e,Ot),r(e,[{key:"componentDidMount",value:function(){var e=this,t=this.props.formId;this.setState({loading:!0}),this.request(qe.form.documentUrl,{formId:t}).then((function(t){var r=Ee.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,o=this.props,i=o.code,l=o.title,c=o.witdh,s=o.preview,p=o.readonly,f=o.hidden,d=this.getStyles(),h=d.styles,y=d.itemStyles,v=this.state.doc;return a(m.Item,Qn(Qn(Qn({name:i,style:y,hidden:f,rules:f?[]:e,valuePropName:"list"},r),n),{},{children:a(no,{preview:s||p,title:l,witdh:c,columns:this.columnList,items:this.itemList,document:v,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),a(u,{})}}])}(),no=function(){function e(){var r;t(this,e);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return r=eo(this,e,[].concat(o)),l(r,"state",{dataSource:[],modal:{title:"",entity:void 0,show:!1}}),l(r,"onFinish",(function(e){var t=r.state.dataSource,n=[];e.id?n=t.map((function(t){return t.id===e.id?Qn(Qn({},t),e):t})):(e.id=_(),e.index=t.length+1,n=[].concat(pe(t),[e])),r.onChange(n)})),l(r,"onCancel",(function(){r.setState({modal:{title:"",entity:void 0,show:!1}})})),r}return i(e,lt),r(e,[{key:"componentDidMount",value:function(){var e=this.props.list;if(Array.isArray(e)){var t=e.map((function(e,t){var r=Ve({},(De(e),e));return Qn({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,ne(e,Kn)})))}))}},{key:"getColumns",value:function(){var e=this,t=this.props,r=t.preview,n=t.title,o=t.columns,i=t.items,l=this.state.dataSource,u=o.map((function(e){var t=e.dataIndex,r=i.find((function(e){return e.code===t}));return r&&(e.title||(e.title=r.title),e.render=function(t){var n=t;return e.text?n=e.text:0!==Object.keys(r.data).length&&(n=r.data[t]),"url"===e.type?a("a",{href:t,target:"_blank",rel:"noreferrer",children:n}):n}),e}));return r?u:X(u,{title:"操作",dataIndex:"option",valueType:"option",render:function(t,r){return[c(O,{children:[a("a",{onClick:function(){e.setState({modal:{title:"修改".concat(n),entity:r,show:!0}})},children:"修改"},"modifly"),a("a",{onClick:function(){I.confirm({title:"警告",icon:a(Pe,{}),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,o=t.witdh,i=t.document,l=t.style,u=this.state,s=u.dataSource,p=u.modal,f=this.getColumns();return c(B,{title:n,style:{padding:"0px 12px"},extra:r?null:a("a",{onClick:function(){e.setState({modal:{title:"新建".concat(n),entity:void 0,show:!0}})},children:"添加"},"new"),children:[a(F,{rowKey:"id",size:"small",style:l,columns:f,dataSource:s}),p.show&&a(oo,{title:p.title,witdh:o,entity:p.entity,document:i,onFinish:this.onFinish,onCancel:this.onCancel})]})}}])}(),oo=function(e){var t,r=e.title,n=e.witdh,o=void 0===n?"740":n,i=e.entity,l=e.document,u=e.onFinish,c=e.onCancel,s=d();return a(I,{title:r,width:Number(o),open:!0,destroyOnClose:!0,onCancel:c,onOk:(t=ie(le.mark((function e(){var t,r,n;return le.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(),u(Qn(Qn({},i),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&&a(jo,{form:s,document:l,initialValues:i})})},io=Object.freeze({__proto__:null,Audio:kn,Checkbox:jr,DatePicker:Wr,Duration:Nr,Editor:cr,FormList:ro,Label:Ct,Number:or,Photo:fn,Radio:Dr,Rate:mn,Select:yr,SuperUpload:Mn,Switch:Er,Table:Gn,Text:Jt,TextArea:er,TimePicker:Jr,Tooltip:Dt,Upload:nn,Video:Rn}),lo=function(e){var t=e.children,r=e.gutter;return a(T,{gutter:Number(r),style:{margin:0},children:t})},ao=function(e){var t=e.span,r=e.children;return a(A,{span:t,children:r})},uo=function(e){var t=e.direction,r=e.stepIndex,n=e.onChangeSetp,o=e.children,i=h((function(){return null==o?void 0:o.map((function(e){var t=e.id,r=e.attributes;return{key:t,title:r.title,description:r.description}}))}),[o]);return a(N,{current:r,direction:t,onChange:n,items:i,style:{padding:16,backgroundColor:"white"}})},co=M.Content,so=y((function(e){var t=e.currentStepIndex,r=e.stepIndex,n=e.style,o=e.children,i=h((function(){var e=n?_e(n):{padding:16,backgroundColor:"white"};return t!==Number(r)&&Object.assign(e,{display:"none"}),e}),[t]);return a(co,{style:i,children:o})})),po=function(e){var t=e.dashed,r=void 0!==t&&t,n=e.orientation,o=void 0===n?"center":n,i=e.children;return a(U,{dashed:r,orientation:o,style:{color:"#055ab5",fontWeight:"bold"},children:i})},fo={display:"none"},ho={display:"block"},yo=y((function(t){var r=t.defaultExpanded,n=void 0===r||r,o=t.on,i=t.off,l=t.style,s=t.collapse,p=t.children,f=v(n),d=e(f,2),h=d[0],y=d[1],m=_e(l);return s?c(u,{children:[a("div",{style:m,children:c(L,{type:"link",onClick:function(){y(!h)},children:[h?i:o,a(h?ke:Se,{})," "]})}),a("div",{style:h?ho:fo,children:p})]}):a(u,{children:p})}));function vo(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 mo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vo(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bo(e,t,r){return t=o(t),n(e,go()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function go(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(go=function(){return!!e})()}var Oo=io,wo={Row:lo,Col:ao,Collapse:yo,Content:so,Divider:po,Steps:uo},jo=function(){function n(e){var r,o,i;return t(this,n),i=bo(this,n,[e]),l(i,"state",{stepIndex:0,root:void 0,loading:!0}),l(i,"hideClear",!1),l(i,"onValuesChange",(function(e){i.setState({values:e})})),l(i,"onStepIndex",(function(e){i.setState({stepIndex:e})})),l(i,"children",(function(e){var t,r,n=null!==(t=null===(r=i.customComponents)||void 0===r?void 0:r[e.tag])&&void 0!==t?t:Oo[e.tag];return n?i.component(e,n):wo[e.tag]?i.container(e):i.applet(e)})),i.styles=null!==(r=e.style)&&void 0!==r?r:{},i.form=null!==(o=e.form)&&void 0!==o?o:s.createRef(),i}return i(n,p),r(n,[{key:"componentDidMount",value:function(){var t,r,n=this,o=this.props.document,i=(t="string"==typeof o?Ee.getRoot(o):Ee.parser(o)).attributes,u=i.style,c=i.labelCol,s=i.wrapperCol,p=i.showTitle,f=i.hideClear;if(this.showTitle=!!p,this.hideClear=!!f,"string"==typeof u){var d=null==u?void 0:u.replace(/\ +/g,"").split(";");null==d||d.forEach((function(t){if(t){var r=t.split(":"),o=e(r,2),i=o[0],a=o[1];Object.assign(n.styles,l({},G(i),a))}}))}c&&s&&(this.layouts={labelCol:{span:c},wrapperCol:{span:s}}),qe.components&&(this.customComponents=Z(qe.components,(function(e){return function(t){return a(yt,mo({Component:e},t))}}))),this.setState({root:t,loading:!0}),"function"==typeof(r=function(e){n.setState({loading:e})})&&He.push(r),Je()}},{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.preview,n=t.hidden,o=t.readonly;if(e.preview=null!=r&&r,ee(n))e.hidden=n;else if(te(n))e.hidden=n.includes(e.code);else if(W(n))e.hidden=!!n[e.code];else{var i;e.hidden=null!==(i=e.hidden)&&void 0!==i&&i}if(ee(o))e.readonly=o;else if(te(o))e.readonly=o.includes(e.code);else if(W(o))e.readonly=!!o[e.code];else{var l;e.readonly=null!==(l=e.readonly)&&void 0!==l&&l}re(e.hideClear)&&(e.hideClear=this.hideClear)}},{key:"component",value:function(e,t){var r=e.id,n=e.attributes,o=e.children;return this.setComponentStatus(n),a(t,mo(mo({},n),{},{children:null==o?void 0:o.map(this.children)}),r)}},{key:"container",value:function(e){var t=e.id,r=e.tag,n=e.attributes,o=e.text,i=e.children;return"Row"===r?a(lo,mo(mo({},n),{},{children:null==i?void 0:i.map(this.children)}),t):"Col"===r?a(ao,{span:Number(n.span),children:null==i?void 0:i.map(this.children)},t):"Collapse"===r?a(yo,mo(mo({collapse:this.props.collapse},n),{},{children:null==i?void 0:i.map(this.children)}),t):"Content"===r?a(so,mo(mo({currentStepIndex:this.state.stepIndex},n),{},{children:null==i?void 0:i.map(this.children)}),t):"Steps"===r?a(uo,mo(mo({stepIndex:this.state.stepIndex,onChangeSetp:this.onStepIndex},n),{},{children:i}),t):"Divider"===r?a(po,mo(mo({},n),{},{children:o}),t):void 0}},{key:"applet",value:function(e){var t=this,r=e.tag,n=e.attributes,o=e.cdata,i=e.children;if("Columns"===r){var l=null==i?void 0:i.map((function(e){var r=e.attributes,n=e.children;if(n){var o,i=$(n.map(t.children),{tag:"Validates"});return mo(mo({},r),{},{rules:null!==(o=null==i?void 0:i.children)&&void 0!==o?o:[]})}return r}));return{tag:r,children:l}}return"Options"===r?{tag:r,children:null==i?void 0:i.map((function(e){return{key:e.attributes.value,label:e.text}}))}:"Validates"===r?{tag:r,children:null==i?void 0:i.map((function(e){return e.attributes}))}:"Conditions"===r?{tag:r,type:n.type,action:n.action,children:null==i?void 0:i.map((function(e){return e.attributes}))}:"Collection"===r||"Compute"===r?{tag:r,cdata:o}:void 0}},{key:"render",value:function(){var e,t=this.state,r=t.root,n=t.loading,o=this.props.initialValues;return c(u,{children:[r&&a(Ae.Provider,{value:mo(mo({},this.props),{},{form:this.form,showTitle:this.showTitle}),children:a(Po,mo(mo({form:this.form,style:n?mo(mo({},this.styles),{},{display:"none"}):this.styles,initialValues:o,onValuesChange:this.onValuesChange},this.layouts),{},{children:null===(e=r.children)||void 0===e?void 0:e.map(this.children)}))}),n&&a(q,{active:!0})]})}}])}(),Po=function(e){function n(){var e;t(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=bo(this,n,[].concat(o)),l(e,"onFinish",(function(e){console.log("Success:",e)})),e}return i(n,e),r(n,[{key:"render",value:function(){var e=this.props,t=e.form,r=e.style,n=e.labelCol,o=e.wrapperCol,i=e.initialValues,l=e.children,u=e.onValuesChange;return a(m,{ref:t,style:r,labelCol:n,wrapperCol:o,initialValues:i,onFinish:this.onFinish,autoComplete:"off",onValuesChange:function(e){u(e)},children:l})}}])}(s.PureComponent);export{Ae as DesignContext,st as UIComponent,Ot as UIListComponent,jo as default,ze as defineConfig};
2
2
  //# sourceMappingURL=index.tsx.map