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