antd-form-document 5.0.9 → 5.0.11

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