antd-form-document 5.0.4 → 5.0.5

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