antd-form-document 5.0.11 → 5.0.12

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