antd-form-document 5.0.6 → 5.0.7
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 +42 -2
- package/dist/index.tsx +1 -1
- package/dist/index.tsx.map +1 -1
- package/dist/src/config.d.ts +5 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/preview/index.d.ts +6 -18
- package/dist/src/preview/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -888,7 +888,7 @@ const App = () => {
|
|
|
888
888
|
| multiple | 暂缺 | boolean | false | - |
|
|
889
889
|
| maxCount | 最大上传文件个数 | number | - | ✓ |
|
|
890
890
|
| fileSize | 单个文件最大字节;`1B`、`1KB`、`1MB`、`1GB`、`1TB`、`1PB` | string | - | |
|
|
891
|
-
| fileType | 上传文件类型;[mime-type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string | - | |
|
|
891
|
+
| fileType | 上传文件类型;[mime-type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) 或文件扩展名 `需预先配置` | string | - | |
|
|
892
892
|
| fileTypeMessage | 上传文件类型提示说明 | string | - | |
|
|
893
893
|
| defaultHide | 默认是否隐藏 | boolean | false | - |
|
|
894
894
|
| tips | 字段提示 | string | - | |
|
|
@@ -955,7 +955,7 @@ const App = () => {
|
|
|
955
955
|
| multiple | 暂缺 | boolean | false | - |
|
|
956
956
|
| maxCount | 最大上传文件个数 | number | - | ✓ |
|
|
957
957
|
| fileSize | 单个文件最大字节;`1B`、`1KB`、`1MB`、`1GB`、`1TB`、`1PB` | string | - | |
|
|
958
|
-
| fileType | 上传文件类型;[mime-type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string | - | |
|
|
958
|
+
| fileType | 上传文件类型;[mime-type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) 或文件扩展名 `需预先配置` | string | - | |
|
|
959
959
|
| fileTypeMessage | 上传文件类型提示说明 | string | - | |
|
|
960
960
|
| defaultHide | 默认是否隐藏 | boolean | false | - |
|
|
961
961
|
| tips | 字段提示 | string | - | |
|
|
@@ -1271,8 +1271,10 @@ const App = () => {
|
|
|
1271
1271
|
| 参数 | 说明 | 类型 | 默认值 | 必填项 |
|
|
1272
1272
|
| ---------- | ---------- | ------ | ------ | ------ |
|
|
1273
1273
|
| components | 自定义组件 | object | - | |
|
|
1274
|
+
| previewCompoents | 预览组件 | { PreviewText`文本预览`、PreviewDuration`时长预览`、PreviewSwitch`切换预览`、PreviewList`列表预览`、PreviewImage`图片预览`、PreviewFile`文件预览` } | - | |
|
|
1274
1275
|
| request | 请求参数 | object | - | |
|
|
1275
1276
|
| file | 文件参数 | object | - | |
|
|
1277
|
+
| chunk | 大文件上传参数 | object | - | |
|
|
1276
1278
|
| form | 表单参数 | object | - | |
|
|
1277
1279
|
|
|
1278
1280
|
**例:**
|
|
@@ -1284,6 +1286,35 @@ export default defineConfig({
|
|
|
1284
1286
|
Department,
|
|
1285
1287
|
UploadList
|
|
1286
1288
|
},
|
|
1289
|
+
previewCompoents: {
|
|
1290
|
+
PreviewFile
|
|
1291
|
+
},
|
|
1292
|
+
mimeType: {
|
|
1293
|
+
".doc": "application/msword",
|
|
1294
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1295
|
+
".xls": "application/vnd.ms-excel",
|
|
1296
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1297
|
+
".ppt": "application/vnd.ms-powerpoint",
|
|
1298
|
+
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
1299
|
+
".pdf": "application/pdf",
|
|
1300
|
+
".txt": "text/plain",
|
|
1301
|
+
".mp3": "audio/mpeg",
|
|
1302
|
+
".wma": "audio/x-ms-wma",
|
|
1303
|
+
".wav": "audio/wav",
|
|
1304
|
+
".mp4": "video/mp4",
|
|
1305
|
+
".m4v": "video/x-m4v",
|
|
1306
|
+
".wmv": "video/x-ms-wmv",
|
|
1307
|
+
".avi": "video/x-msvideo",
|
|
1308
|
+
".mov": "video/quicktime",
|
|
1309
|
+
".mkv": "video/x-matroska",
|
|
1310
|
+
".png": "image/png",
|
|
1311
|
+
".jpeg": "image/jpeg",
|
|
1312
|
+
".jpg": "image/jpeg",
|
|
1313
|
+
".zip": "application/x-zip-compressed",
|
|
1314
|
+
".rar": "application/octet-stream",
|
|
1315
|
+
".tar": "application/x-tar",
|
|
1316
|
+
".gz": "application/x-gzip",
|
|
1317
|
+
},
|
|
1287
1318
|
request: {
|
|
1288
1319
|
prefix: "api",
|
|
1289
1320
|
},
|
|
@@ -1292,6 +1323,15 @@ export default defineConfig({
|
|
|
1292
1323
|
downloadUrl: "/api/fileDownload",
|
|
1293
1324
|
uploadUrl: "/api/file/upload"
|
|
1294
1325
|
},
|
|
1326
|
+
chunk: {
|
|
1327
|
+
checkFile: "/api/checkFile",
|
|
1328
|
+
checkChunk: "/api/checkChunk",
|
|
1329
|
+
chunkUpload: "/api/chunkUpload",
|
|
1330
|
+
doMerge: "/api/doMerge",
|
|
1331
|
+
mergeProgress: "/api/mergeProgress",
|
|
1332
|
+
onComplete: "/api/onComplete",
|
|
1333
|
+
completeProgress: "/api/completeProgress"
|
|
1334
|
+
}
|
|
1295
1335
|
form: {
|
|
1296
1336
|
documentUrl: "/form/:formId"
|
|
1297
1337
|
}
|
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 h,useRef as d,useMemo as y,memo as v,useState as m}from"react";import{Form as b,Space as g,Image as O,Input as w,InputNumber as j,Select as P,Checkbox as k,Radio as C,Switch as S,DatePicker as x,TimePicker as R,message as D,Upload as V,Button as I,Modal as L,Progress as E,Card as F,Table as B,Row as T,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,isUndefined as ee}from"lodash";import te from"@babel/runtime/helpers/objectWithoutProperties";import re from"@babel/runtime/helpers/asyncToGenerator";import ne from"@babel/runtime/regenerator";import ie from"moment";import{extend as oe}from"umi-request";import{parse as le,compile as ae}from"path-to-regexp";import ue from"wangeditor-for-react";import ce from"number-format.js";import se from"dayjs";import fe from"dayjs/plugin/weekday";import pe from"dayjs/plugin/localeData";import he from"dayjs/plugin/customParseFormat";import de from"@babel/runtime/helpers/toConsumableArray";import{UploadOutlined as ye,PlusOutlined as ve,QuestionCircleOutlined as me,UpOutlined as be,DownOutlined as ge}from"@ant-design/icons";import Oe from"bytes";import we from"antd-img-crop";import je from"file-block-upload";import Pe from"@babel/runtime/helpers/objectDestructuringEmpty";import ke from"@babel/runtime/helpers/extends";function Ce(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)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 xe=function(){function e(r){t(this,e),a(this,"attributes",{}),this.id=_();var n,i=Ce(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=Ce(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}(),Re=function(){function e(){t(this,e)}return r(e,null,[{key:"parser",value:function(e){var t=e.childNodes[0];return new xe(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 De(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?De(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):De(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 Ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ee(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=Fe(Fe({},this.request),n),this.file=Fe(Fe({},this.file),i),this.form=Fe(Fe({},this.form),o),this.chunk=Fe(Fe({},this.chunk),l),this.components=u}}return r(e,null,[{key:"init",value:function(t){return new e(t)}}]),e}(),Te=Be.init(),Ae=function(e){Te=Be.init(e)},Ne=0,Me=[],qe=function(e){return new Promise((function(t){setTimeout((function(){t(e)}),e)}))},Ue=function(){var e=re(ne.mark((function e(t){var r,n;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===Ne)for(r=0,n=Me;r<n.length;r++)(0,n[r])(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ze=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==Ne++&&Ue(!0);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_e=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==--Ne&&Ue(!1);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),We=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qe(1e3);case 2:0===Ne?Ue(!1):We();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ge=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ne=0,Ue(!1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),He=["status"];function $e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 Ye=oe({prefix:Te.request.prefix,headers:Te.request.headers,timeout:1e4});Ye.use(function(){var e=re(ne.mark((function e(t,r){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,ze(),e.next=4,r();case 4:_e(),e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(0),Ge(),e.t0;case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,r){return e.apply(this,arguments)}}(),{global:!0});var Ke=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=le(i);i=ae(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,Ye(i,r).then((function(e){var t=e.status,r=te(e,He),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?$e(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(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})}))},Je=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 Ke(i,{method:r,type:n,data:e})}},Qe=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 Xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 Ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function et(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 tt=function(o){i(c,o);var l=et(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=re(ne.mark((function t(n,i){var o;return ne.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=null!=i?i:r.context.params,t.abrupt("return",Je(n)(Ze({},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=Qe(r);return u("span",{style:Ze(Ze({},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:Qe(t),itemStyles:Qe(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=Ve(Ve({},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 h=!1;if((h="and"===s?$(p):Y(p))&&"hide"===f||!h&&"show"===f)return!1;if(!h&&"hide"===f||h&&"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,ie)}return new Function("moment","".concat(r))(ie)}catch(e){}}(this.getFieldsValue(),t);r&&setTimeout((function(){e.setFieldValue(r)}),1)}}},{key:"initValue",value:function(e){var t=this.props.defaultValue,r=void 0===t?e:t;r&&this.setDefaultValue(r)}}]),c}(f.PureComponent);tt.contextType=Le;var rt=["Component","defaultValue","style"];function nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function it(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ot(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 lt=function(e){i(l,tt);var o=ot(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=te(a,rt),p=this.getStyles(),h=p.styles,d=p.itemStyles;return u(b.Item,it(it(it({name:o,label:this.getLabel(),style:d,hidden:l,rules:e},r),n),{},{children:u(s,it(it({},f),{},{style:h,onChange:this.onChange}))}))}return u(c,{})}}]),l}();function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ut(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ct(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(l,tt);var o=ct(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 ut(ut({},e),{},{validator:function(e,t){return(null==t?void 0:t.length)>0?Promise.resolve():Promise.reject()}})}if(e.min&&e.max){return ut(ut({},e),{},{validator:function(t,r){return r.length>=e.min&&r.length<=e.max?Promise.resolve():Promise.reject()}})}return ut({},e)}))}}]),l}();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 pt=function(e){i(o,p);var n=ft(o);function o(){return t(this,o),n.apply(this,arguments)}return r(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 dt=function(e){i(o,tt);var n=ht(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 yt(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 vt=function(e){i(o,tt);var n=yt(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}(),mt=function(e){var t=e.value,r=e.type,n=e.style,i=e.onChange;return h((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})},bt=function(t){var r=t.value,n=t.style,i=t.onChange;if(h((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秒"})},gt=function(e){var t=e.checked,r=e.style,n=e.onChange;return h((function(){n(t)}),[]),u("div",{style:r,children:t?"开启":"关闭"})},Ot=function(e){var t=e.value,r=e.list,n=e.style,i=e.onChange;if(h((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})},wt=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)}))})},jt=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 Pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ct(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,tt);var n=Ct(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,h=i.showCount,d=i.readonly,y=i.hidden,v=this.getStyles(),m=v.styles,g=v.itemStyles;return u(b.Item,kt(kt(kt({name:o,label:this.getLabel(),style:g,hidden:y,rules:e},r),n),{},{children:a?u(mt,{type:l,style:m}):u(w,{maxLength:f,placeholder:s,allowClear:p,showCount:h,disabled:d,style:m})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),o}();function xt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 Rt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Dt(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 Vt=function(e){i(o,tt);var n=Dt(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,h=void 0===p?"0":p,d=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),C=Number(h);return u(b.Item,Rt(Rt(Rt({name:r,label:this.getLabel(),style:P,hidden:y,rules:y?[]:e},m),g),{},{children:n?u(mt,{style:j}):u(w.TextArea,{maxLength:o,placeholder:i,allowClear:l,showCount:a,autoSize:!(k+C<1)&&{minRows:k,maxRows:C},disabled:d,style:j})}))}return this.props.hideClear&&this.cleanFieldValue(),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 Et(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,tt);var n=Et(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,h=f.preview,d=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:h?u(mt,{style:O}):u(j,Lt(Lt({min:d,max:y,disabled:v},i),{},{style:O}))}))}return this.props.hideClear&&this.cleanFieldValue(),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 At(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 Nt=function(e){i(o,tt);var n=At(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,h=this.getStyles(),d=h.styles,y=h.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(mt,{style:d}):u(Mt,{placeholder:s,style:d})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),o}(),Mt=function(e){i(l,e);var o=At(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(ue,{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 qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ut(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zt(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 _t=function(e){i(l,st);var o=zt(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(),h=this.collectionList(),d=this.getList(this.state.list,h,(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,Ut(Ut(Ut({name:r,label:this.getLabel(),style:w,hidden:f,rules:f?[]:p},v),m),{},{children:n?u(Ot,{list:this.state.list,style:O}):u(Gt,{list:d,multiple:i,placeholder:o,allowClear:a,readonly:s,style:O})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),l}(),Wt=P.Option,Gt=function(e){i(l,pt);var o=zt(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(Wt,{value:t,children:r},t)}))})}}]),l}();function Ht(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $t(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ht(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yt(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 Kt=function(e){i(l,st);var o=Yt(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,h=this.getStyles(),d=h.styles,y=h.itemStyles;return u(b.Item,$t($t($t({name:o,label:this.getLabel(),style:y,hidden:c,rules:c?[]:t},f),p),{},{children:l?u(Ot,{list:this.state.list,style:d}):u(Jt,{list:n,readonly:a,style:d})}))}return this.props.hideClear&&this.cleanFieldValue(),null}}]),l}(),Jt=function(e){i(o,pt);var n=Yt(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 Qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Zt(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 er=function(e){i(l,st);var o=Zt(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(),h=p.itemProps,d=p.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return u(b.Item,Xt(Xt(Xt({name:o,label:this.getLabel(),style:m,hidden:f,rules:f?[]:t},h),d),{},{children:l?u(Ot,{list:n,style:v}):u(tr,{list:this.state.list,optionType:a,readonly:s,style:v})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),l}(),tr=function(e){i(o,pt);var n=Zt(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(C.Group,{value:t,optionType:n,style:o,onChange:function(e){null==l||l(e.target.value)},children:r&&r.map((function(e){var t=e.key,r=e.label;return u(C,{value:t,disabled:i,children:r},t)}))})}}]),o}();function rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ir(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 or=function(e){i(o,tt);var n=ir(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,h=f.itemStyles;return u(b.Item,nr(nr(nr({label:this.getLabel(),name:r,style:h,hidden:o,rules:o?[]:e,valuePropName:"checked"},a),s),{},{children:n?u(gt,{style:p}):u(S,{disabled:i,style:p})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),o}();function lr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ar(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ur(e){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 cr=function(e){i(o,tt);var n=ur(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,h=f.itemStyles;return u(b.Item,ar(ar(ar({name:o,label:this.getLabel(),style:h,hidden:s,rules:s?[]:e},r),n),{},{children:l?u(bt,{style:p}):u(sr,{readonly:a,style:p})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),o}(),sr=function(e){i(l,pt);var o=ur(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 ce(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:ar({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:ar({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:ar({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 fr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hr(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)}}se.extend(fe),se.extend(pe);var dr=function(e){i(o,tt);var n=hr(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,h=void 0!==p&&p,d=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,pr(pr(pr({name:o,label:this.getLabel(),style:P,hidden:O,rules:O?[]:e},r),n),{},{children:d?u(mt,{style:j}):u(yr,{type:a,format:f,showTime:h,placeholder:y,allowClear:m,readonly:g,style:j})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),o}(),yr=function(e){i(o,pt);var n=hr(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?se(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 vr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function br(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)}}se.extend(he);var gr=function(e){i(o,tt);var n=br(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,h=void 0===p||p,d=i.readonly,y=i.hidden,v=this.getStyles(),m=v.styles,g=v.itemStyles;return u(b.Item,mr(mr(mr({name:o,label:this.getLabel(),style:g,hidden:y,rules:y?[]:e},r),n),{},{children:s?u(mt,{style:m}):u(Or,{format:a,placeholder:f,allowClear:h,readonly:d,style:m})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),o}(),Or=function(e){i(o,pt);var n=br(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?se(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 wr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 jr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wr(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)}}var kr=function(e){return Array.isArray(e)?e:e&&e.list},Cr=function(e){i(o,st);var n=Pr(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(),h=p.itemProps,d=p.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return u(b.Item,jr(jr(jr({name:r,label:this.getLabel(),style:m,hidden:f,rules:f?[]:e,valuePropName:"list",getValueFromEvent:kr},h),d),{},{children:u(Sr,{maxCount:i,fileType:o,fileTypeMessage:l,fileSize:a,readonly:s,preview:n,style:v})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),o}(),Sr=function(e){i(l,pt);var o=Pr(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("文件类型不匹配!"),V.LIST_IGNORE;if(!l.includes(t.type))return D.error(o),V.LIST_IGNORE;if(n&&Oe.parse(n)<t.size)return D.error("上传的文件大小,不能超过 ".concat(n,"!")),V.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]&&Je(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return jr(jr({},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(wt,{fileList:t});var p={onStart:this.onStart,onSuccess:this.onSuccess,onProgress:this.onProgress,onError:this.onError};return s(c,{children:[u(V,jr(jr({action:Te.request.prefix+Te.file.uploadUrl,fileList:t,maxCount:f,disabled:l,beforeUpload:this.onBeforeUpload,onRemove:this.onRemove},p),{},{children:u(I,{disabled:l||f<=t.length,icon:u(ye,{}),style:a,children:"上传"})})),s(L,{open:r.open,closable:!1,footer:null,children:[u("div",{children:"上传文件进度"}),u(E,{percent:r.progress})]})]})}}]),l}();function xr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Dr(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 Vr=function(e){return Array.isArray(e)?e:e&&e.list},Ir=["image/jpeg","image/png"],Lr=function(e){i(o,st);var n=Dr(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,h=t.hidden,d=this.getItem(),y=d.itemProps,v=d.itemLayouts,m=this.getStyles(),g=m.styles,O=m.itemStyles;return u(b.Item,Rr(Rr(Rr({name:r,label:this.getLabel(),style:O,hidden:h,rules:h?[]:e,valuePropName:"list",getValueFromEvent:Vr},y),v),{},{children:u(Er,{maxCount:i,fileSize:o,fileWidth:Number(a),fileHeight:Number(f),readonly:p,preview:n,style:g})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),o}(),Er=function(e){i(l,pt);var o=Dr(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("上传文件类型,仅支持图片类型!"),V.LIST_IGNORE;var r=e.props.fileSize;if(r&&Oe.parse(r)<t.size)return D.error("上传的文件大小,不能超过 ".concat(r,"!")),V.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]&&Je(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return Rr(Rr({},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,h=i.fileHeight,d=void 0===h?100:h,y=i.style,v=l?Number(l):0;return o?u(jt,{fileList:r,width:p,height:d,style:y}):s(c,{children:[u(we,{rotationSlider:!0,modalTitle:"图片编辑",modalOk:"确认",modalCancel:"取消",aspect:p/d,children:u(V,{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(I,{type:"link",icon:u(ve,{}),style:y})})}),(null==n?void 0:n.id)&&u(L,{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 Fr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function 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 Ar=function(e){return Array.isArray(e)?e:e&&e.list},Nr=function(e){i(o,st);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(),h=p.itemProps,d=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:Ar},h),d),{},{children:u(Mr,{maxCount:i,fileType:o,fileTypeMessage:l,fileSize:a,readonly:s,preview:n,style:v})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),o}(),Mr=function(e){i(l,pt);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("文件类型不匹配!"),V.LIST_IGNORE;if(!l.includes(t.type))return D.error(o),V.LIST_IGNORE;if(n&&Oe.parse(n)<t.size)return D.error("上传的文件大小,不能超过 ".concat(n,"!")),V.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=re(ne.mark((function e(t){var r,n,i;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,Je("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=re(ne.mark((function e(t){var r,n,i,o;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.blockMd5,o=t.blockIndex,e.next=3,Je("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=re(ne.mark((function e(t){var r,n,i,o,l,a;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.blockMd5,o=t.blockIndex,l=t.file,(a=new FormData).append("blockIndex",String(o)),a.append("blockMd5",i),a.append("fileName",r),a.append("fileMd5",n),a.append("file",l),e.next=9,Je("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=re(ne.mark((function e(t){var r,n,i;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,Je("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=re(ne.mark((function e(){var t;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Je(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=re(ne.mark((function e(t){var r,n,i;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,Je("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=re(ne.mark((function e(){var t;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Je(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=je.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&&Je(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(wt,{fileList:t}):s(c,{children:[u(V,{action:Te.request.prefix+Te.file.uploadUrl,fileList:t,maxCount:f,disabled:l,beforeUpload:this.onBeforeUpload,customRequest:this.customRequest,onRemove:this.onRemove,children:u(I,{disabled:l||f<=t.length,icon:u(ye,{}),style:a,children:"上传"})}),s(L,{open:r.open,closable:!1,footer:null,children:[u("div",{children:"上传文件进度"}),u(E,{percent:r.progress})]})]})}}]),l}(),qr=["worksId","worksExtraId"];function Ur(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ur(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ur(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _r(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 Wr=function(e){i(o,st);var n=_r(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 zr(zr({},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(),h=p.styles,d=p.itemStyles;return u(b.Item,zr(zr(zr({name:o,style:d,hidden:f,rules:f?[]:e,valuePropName:"list"},r),n),{},{children:u(Gr,{preview:a||s,title:l,columns:this.getColumns(),style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),o}(),Gr=function(e){i(l,pt);var o=_r(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?zr(zr({},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,zr({id:e.worksExtraId,index:t+1},te(e,qr))}));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(){L.confirm({title:"警告",icon:u(me,{}),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(F,{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(B,{rowKey:"index",size:"small",style:i,columns:c,dataSource:l}),a.show&&u(Hr,{title:a.title,entity:a.entity,columns:c,onFinish:this.onFinish,onCancel:this.onCancel})]})}}]),l}(),Hr=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(L,{title:n,width:740,open:!0,destroyOnClose:!0,onCancel:a,onOk:(r=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.validateFields().then((function(e){l(zr(zr({},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(T,{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)}))})})})},$r=["id","index"];function Yr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Jr(e,t){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 Qr(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 Qr(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 Qr(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 Xr(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 Zr=function(e){i(l,st);var o=Xr(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=re(ne.mark((function t(r){var n,i,o,l,a,u,c,s,f,p,h,d,y,v,m,b,g,O,w,j;return ne.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=Re.selectors(r,"[code]"),o=Jr(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"),!((h=Re.selectors(a,"Option")).length>0)){t.next=20;break}d=Jr(h);try{for(d.s();!(y=d.n()).done;)v=y.value,m=v.getAttribute("value"),b=v.textContent,m&&b&&(f[m]=b)}catch(e){d.e(e)}finally{d.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=Jr(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=Re.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,h=this.getStyles(),d=h.styles,y=h.itemStyles,v=this.state.doc;return u(b.Item,Kr(Kr(Kr({name:o,style:y,hidden:p,rules:p?[]:e,valuePropName:"list"},r),n),{},{children:u(en,{preview:s||f,title:l,witdh:a,columns:this.columnList,items:this.itemList,document:v,style:d})}))}return this.props.hideClear&&this.cleanFieldValue(),u(c,{})}}]),l}(),en=function(e){i(l,pt);var o=Xr(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?Kr(Kr({},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=ke({},(Pe(e),e));return Kr({id:_(),index:t+1},r)}));this.onChange(t)}}},{key:"onChange",value:function(e){var t=this;this.setState({dataSource:e,modal:{title:"",entity:void 0,show:!1}},(function(){var r,n;null===(r=(n=t.props).onChange)||void 0===r||r.call(n,e.map((function(e){return e.id,e.index,te(e,$r)})))}))}},{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(){L.confirm({title:"警告",icon:u(me,{}),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(F,{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(B,{rowKey:"id",size:"small",style:l,columns:p,dataSource:c}),f.show&&u(tn,{title:f.title,witdh:i,entity:f.entity,document:o,onFinish:this.onFinish,onCancel:this.onCancel})]})}}]),l}(),tn=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=d();return u(L,{title:r,width:Number(i),open:!0,destroyOnClose:!0,onCancel:c,onOk:(t=re(ne.mark((function e(){var t,r,n;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,null===(t=s.current)||void 0===t?void 0:t.validateFields();case 3:n=null===(r=s.current)||void 0===r?void 0:r.getFieldsValue(),a(Kr(Kr({},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(bn,{form:s,document:l,initialValues:o})})},rn=Object.freeze({__proto__:null,Checkbox:Kt,DatePicker:dr,Duration:cr,Editor:Nt,FormList:Zr,Label:dt,Number:Ft,Photo:Lr,Radio:er,Select:_t,SuperUpload:Nr,Switch:or,Table:Wr,Text:St,TextArea:Vt,TimePicker:gr,Tooltip:vt,Upload:Cr}),nn=function(e){var t=e.children,r=e.gutter;return u(T,{gutter:Number(r),style:{margin:0},children:t})},on=function(e){var t=e.span,r=e.children;return u(A,{span:t,children:r})},ln=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"}})},an=M.Content,un=v((function(e){var t=e.currentStepIndex,r=e.stepIndex,n=e.style,i=e.children,o=y((function(){var e=n?Qe(n):{padding:16,backgroundColor:"white"};return t!==Number(r)&&Object.assign(e,{display:"none"}),e}),[t]);return u(an,{style:o,children:i})})),cn=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})},sn={display:"none"},fn={display:"block"},pn=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),h=e(p,2),d=h[0],y=h[1],v=Qe(l);return a?s(c,{children:[u("div",{style:v,children:s(I,{type:"link",onClick:function(){y(!d)},children:[d?o:i,u(d?be:ge,{})," "]})}),u("div",{style:d?fn:sn,children:f})]}):u(c,{children:f})}));function hn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function yn(e){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 vn=rn,mn={Row:nn,Col:on,Collapse:pn,Content:un,Divider:cn,Steps:ln},bn=function(o){i(h,p);var l=yn(h);function h(e){var r,i,o;return t(this,h),o=l.call(this,e),a(n(o),"state",{stepIndex:0,root:void 0,loading:!0}),a(n(o),"hideClear",!1),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:vn[e.tag];return n?o.component(e,n):mn[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(h,[{key:"componentDidMount",value:function(){var t,r,n=this,i=this.props,o=i.document,l=i.preview,c=(t="string"==typeof o?Re.getRoot(o):Re.parser(o)).attributes,s=c.style,f=c.labelCol,p=c.wrapperCol,h=c.showTitle,d=c.hideClear;if(this.showTitle=!!h,this.hideClear=!!d,"string"==typeof s){var y=null==s?void 0:s.replace(/\ +/g,"").split(";");null==y||y.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(lt,dn({Component:e},t))}}))),this.setState({root:t,loading:!0}),"function"==typeof(r=function(e){n.setState({loading:e})})&&Me.push(r),We()}},{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}ee(e.hideClear)&&(e.hideClear=this.hideClear)}},{key:"component",value:function(e,t){var r=e.id,n=e.attributes,i=e.children;return this.setComponentStatus(n),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(nn,dn(dn({},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Col"===r?u(on,{span:Number(n.span),children:null==o?void 0:o.map(this.children)},t):"Collapse"===r?u(pn,dn(dn({collapse:this.props.collapse},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Content"===r?u(un,dn(dn({currentStepIndex:this.state.stepIndex},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Steps"===r?u(ln,dn(dn({stepIndex:this.state.stepIndex,onChangeSetp:this.onStepIndex},n),{},{children:o}),t):"Divider"===r?u(cn,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(gn,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})]})}}]),h}(),gn=function(e){i(l,e);var o=yn(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,tt as UIComponent,st as UIListComponent,bn as default,Ae as defineConfig};
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/classCallCheck";import r from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/assertThisInitialized";import l from"@babel/runtime/helpers/inherits";import a from"@babel/runtime/helpers/defineProperty";import{jsx as u,Fragment as s,jsxs as c}from"react/jsx-runtime";import p,{PureComponent as f,useEffect as d,useRef as h,useMemo as y,memo as v,useState as m}from"react";import{Form as g,Space as b,Image as O,Input as w,InputNumber as j,Select as k,Checkbox as P,Radio as C,Switch as S,DatePicker as x,TimePicker as D,message as V,Upload as I,Button as L,Modal as R,Progress as E,Card as F,Table as T,Row as B,Col as A,Steps as N,Layout as M,Divider as q,Skeleton as U}from"antd";import{parseInt as z,uniqueId as W,cloneDeep as _,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,isUndefined as ee}from"lodash";import te from"@babel/runtime/helpers/objectWithoutProperties";import re from"@babel/runtime/helpers/asyncToGenerator";import ne from"@babel/runtime/regenerator";import ie from"moment";import{extend as oe}from"umi-request";import{parse as le,compile as ae}from"path-to-regexp";import ue from"wangeditor-for-react";import se from"number-format.js";import ce from"dayjs";import pe from"dayjs/plugin/weekday";import fe from"dayjs/plugin/localeData";import de from"dayjs/plugin/customParseFormat";import he from"@babel/runtime/helpers/toConsumableArray";import{UploadOutlined as ye,PlusOutlined as ve,QuestionCircleOutlined as me,UpOutlined as ge,DownOutlined as be}from"@ant-design/icons";import Oe from"bytes";import we from"antd-img-crop";import je from"file-block-upload";import ke from"@babel/runtime/helpers/objectDestructuringEmpty";import Pe from"@babel/runtime/helpers/extends";function Ce(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)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 xe=function(){function e(r){t(this,e),a(this,"attributes",{}),this.id=W();var n,i=Ce(r.attributes);try{for(i.s();!(n=i.n()).done;){var o=n.value,l=o.value.trim();this.isBoolean(l)&&(l=this.toBoolean(l)),this.attributes[o.name]=l}}catch(e){i.e(e)}finally{i.f()}this.children=new Array;var u,s=Ce(r.childNodes);try{for(s.s();!(u=s.n()).done;){var c,p,f=u.value;if(f instanceof Element)null===(c=this.children)||void 0===c||c.push(new e(f));if(3===f.nodeType&&f.textContent&&(this.text=f.textContent),4===f.nodeType)this.cdata=null===(p=f.nodeValue)||void 0===p?void 0:p.replace(/\ +/g," ").replace(/[\t\r\n]/g,"")}}catch(e){s.e(e)}finally{s.f()}this.tag=r.nodeName}return r(e,[{key:"isBoolean",value:function(e){return"true"===e||"false"===e}},{key:"toBoolean",value:function(e){return"true"===e}},{key:"isNumber",value:function(e){return/^\d+$/.test(e)}},{key:"toNumber",value:function(e){return z(e,10)}}]),e}(),De=function(){function e(){t(this,e)}return r(e,null,[{key:"parser",value:function(e){var t=e.childNodes[0];return new xe(t)}},{key:"toDocument",value:function(e){return(new DOMParser).parseFromString(e,"text/xml")}},{key:"getRoot",value:function(t){var r=e.toDocument(t);return e.parser(r)}},{key:"selector",value:function(e,t){return e.querySelector(t)}},{key:"selectors",value:function(e,t){return e.querySelectorAll(t)}}]),e}();function Ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ie(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 Le=function(e){var t=e.type,r=void 0===t?"string":t,n=e.required,i=e.minlength,o=e.maxlength,l=e.min,a=e.max,u=e.pattern,s=e.message;return n?{type:r,required:n,message:s}:i&&o?{type:r,min:Number(i),max:Number(o),message:s}:l&&a?{type:"number",min:Number(l),max:Number(a),message:s}:"phone"===r?{type:"string",pattern:new RegExp("^[1][3,5,6,7,8][0-9]\\d{8}$"),message:s}:"regexp"===r&&"string"==typeof u?{type:"string",pattern:new RegExp(u),message:s}:{type:r,message:s}},Re=p.createContext({});function Ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Te=function(){function e(r){if(t(this,e),a(this,"request",{prefix:"api",headers:{},params:{},route:"/design"}),a(this,"file",{listUrl:"/file/list",downloadUrl:"/file/download",uploadUrl:"/file/upload",previewUrl:"/file/preview",extraData:function(e,t){}}),a(this,"style",{labelStyle:{color:"#055ab5"}}),a(this,"form",{documentUrl:"/form/:formId"}),a(this,"chunk",{chunkSize:10*Math.pow(1024,2),checkFile:"/chunk/checkFile",checkChunk:"/chunk/checkChunk",chunkUpload:"/chunk/chunkUpload",doMerge:"/chunk/doMerge",mergeProgress:"/chunk/mergeProgress",onComplete:"/chunk/onComplete",completeProgress:"/chunk/completeProgress"}),a(this,"mimeType",{}),r){var n=r.request,i=r.file,o=r.form,l=r.chunk,u=r.mimeType,s=r.components,c=r.previewCompoents;this.request=Fe(Fe({},this.request),n),this.file=Fe(Fe({},this.file),i),this.form=Fe(Fe({},this.form),o),this.chunk=Fe(Fe({},this.chunk),l),this.mimeType=u,this.components=s,this.previewCompoents=c}}return r(e,null,[{key:"init",value:function(t){return new e(t)}}]),e}(),Be=Te.init(),Ae=function(e){Be=Te.init(e)},Ne=0,Me=[],qe=function(e){return new Promise((function(t){setTimeout((function(){t(e)}),e)}))},Ue=function(){var e=re(ne.mark((function e(t){var r,n;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===Ne)for(r=0,n=Me;r<n.length;r++)(0,n[r])(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ze=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==Ne++&&Ue(!0);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),We=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==--Ne&&Ue(!1);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_e=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qe(1e3);case 2:0===Ne?Ue(!1):_e();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ge=function(){var e=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ne=0,Ue(!1);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),He=["status"];function $e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 Ye=oe({prefix:Be.request.prefix,headers:Be.request.headers,timeout:1e4});Ye.use(function(){var e=re(ne.mark((function e(t,r){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,ze(),e.next=4,r();case 4:We(),e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(0),Ge(),e.t0;case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,r){return e.apply(this,arguments)}}(),{global:!0});var Ke=function(t,r){var n=_(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=le(i);i=ae(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=Be.request.prefix,Ye(i,r).then((function(e){var t=e.status,r=te(e,He),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?$e(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(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})}))},Je=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 Ke(i,{method:r,type:n,data:e})}},Qe=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 Xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 Ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function et(e,t,r){return t=i(t),n(e,tt()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function tt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tt=function(){return!!e})()}var rt=function(n){function i(){var r;t(this,i);for(var n=arguments.length,l=new Array(n),u=0;u<n;u++)l[u]=arguments[u];return r=et(this,i,[].concat(l)),a(o(r),"styleWrapper",{style:{borderBottom:"1px solid #d9d9d9"}}),a(o(r),"request",function(){var t=re(ne.mark((function t(n,i){var o;return ne.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=null!=i?i:r.context.params,t.abrupt("return",Je(n)(Ze({},o)).then((function(t){var r=t.success,n=t.data;if(r){if(Array.isArray(n)){var i=n.map((function(t){var r,n=null===(r=Object.entries(t))||void 0===r?void 0:r[0],i=e(n,2);return{key:i[0],label:i[1]}}));return Promise.resolve(i)}return Promise.resolve(n)}return Promise.reject(void 0)})).catch((function(e){return console.error("remote",n,e),Promise.reject(e)})));case 2:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()),r}return l(i,n),r(i,[{key:"setDefaultValue",value:function(e){var t=this.context.form;if(t){var r,n,i=this.props.code;if(!(null===(r=t.current)||void 0===r?void 0:r.getFieldValue(i)))null===(n=t.current)||void 0===n||n.setFieldValue(i,e)}}},{key:"setFieldValue",value:function(e){var t=this.context.form;if(t){var r,n=this.props.code;null===(r=t.current)||void 0===r||r.setFieldValue(n,e)}}},{key:"cleanFieldValue",value:function(){var e=this;setTimeout((function(){e.setFieldValue(void 0)}),1)}},{key:"getFieldValue",value:function(){var e=this.context.form;if(e){var t,r=this.props.code;return null===(t=e.current)||void 0===t?void 0:t.getFieldValue(r)}}},{key:"getFieldsValue",value:function(){var e,t=this.context.form;if(t)return null===(e=t.current)||void 0===e?void 0:e.getFieldsValue()}},{key:"getLabel",value:function(){if(this.context.showTitle){var e=this.props,t=e.title,r=e.labelStyle,n=Qe(r);return u("span",{style:Ze(Ze({},Be.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:Qe(t),itemStyles:Qe(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 s,c=u.type,p=u.action,f=null===(s=u.children)||void 0===s?void 0:s.map(function(e,t){return function(r){var n=r.test;try{if(e){e=Ie(Ie({},e),{},{preview:t});var i=Object.keys(e).join(",");return new Function("{".concat(i,"}"),"return ".concat(n))(e)}}catch(e){}}}(r,t));if((null==f?void 0:f.length)>0&&void 0!==(null==f?void 0:f[0])){var d=!1;if((d="and"===c?$(f):Y(f))&&"hide"===p||!d&&"show"===p)return!1;if(!d&&"hide"===p||d&&"show"===p)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(Le))&&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,ie)}return new Function("moment","".concat(r))(ie)}catch(e){}}(this.getFieldsValue(),t);r&&setTimeout((function(){e.setFieldValue(r)}),1)}}},{key:"initValue",value:function(e){var t=this.props.defaultValue,r=void 0===t?e:t;r&&this.setDefaultValue(r)}}]),i}(p.PureComponent);rt.contextType=Re;var nt=["Component","defaultValue","style"];function it(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach((function(t){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 lt(e,t,r){return t=i(t),n(e,at()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function at(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(at=function(){return!!e})()}var ut=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=lt(this,n,[].concat(i)),a(o(e),"initValue",(function(){var t=e.props.defaultValue;t&&e.forceUpdate((function(){e.setDefaultValue(t)}))})),a(o(e),"onChange",(function(t){e.setFieldValue(t)})),e}return l(n,rt),r(n,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.hidden,a=this.props,c=a.Component;a.defaultValue,a.style;var p=te(a,nt),f=this.getStyles(),d=f.styles,h=f.itemStyles;return u(g.Item,ot(ot(ot({name:o,label:this.getLabel(),style:h,hidden:l,rules:e},r),n),{},{children:u(c,ot(ot({},p),{},{style:d,onChange:this.onChange}))}))}return u(s,{})}}]),n}();function st(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ct(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?st(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pt(e,t,r){return t=i(t),n(e,ft()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function ft(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ft=function(){return!!e})()}var dt=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=pt(this,n,[].concat(i)),a(o(e),"getList",(function(e,t,r){if(t){var n=e.filter((function(e){var r=e.key;return t.includes(r)}));return r(n),n}return e})),e}return l(n,rt),r(n,[{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 ct(ct({},e),{},{validator:function(e,t){return(null==t?void 0:t.length)>0?Promise.resolve():Promise.reject()}})}if(e.min&&e.max){return ct(ct({},e),{},{validator:function(t,r){return r.length>=e.min&&r.length<=e.max?Promise.resolve():Promise.reject()}})}return ct({},e)}))}}]),n}();function ht(e,t,r){return t=i(t),n(e,yt()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function yt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yt=function(){return!!e})()}var vt=function(e){function n(){return t(this,n),ht(this,n,arguments)}return l(n,f),r(n)}();function mt(e,t,r){return t=i(t),n(e,gt()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function gt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gt=function(){return!!e})()}var bt=function(e){function n(){return t(this,n),mt(this,n,arguments)}return l(n,rt),r(n,[{key:"render",value:function(){if(this.display()){var e=this.rules(),t=this.props,r=t.title,n=t.hidden,i=this.getStyles(),o=i.styles,l=i.itemStyles;return u(g.Item,{style:l,hidden:n,rules:n?[]:e,wrapperCol:{span:24},children:u("div",{style:o,children:r})})}return u(s,{})}}]),n}();function Ot(e,t,r){return t=i(t),n(e,wt()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wt=function(){return!!e})()}var jt=function(e){function n(){return t(this,n),Ot(this,n,arguments)}return l(n,rt),r(n,[{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,c=l.itemStyles;return u(g.Item,{style:c,hidden:i,wrapperCol:{span:24},children:u("div",{style:a,children:null!=n?n:o})})}return u(s,{})}}]),n}(),kt=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})},Pt=function(e){var t,r;return(null!==(t=null===(r=Be.previewCompoents)||void 0===r?void 0:r.PreviewText)&&void 0!==t?t:kt)(e)},Ct=function(t){var r=t.value,n=t.style,i=t.onChange;if(d((function(){i(r)}),[]),r){var o=null==r?void 0:r.split(":"),l=e(o,3),a=l[0],s=l[1],c=l[2];return u("div",{style:n,children:"".concat(a,"小时").concat(s,"分").concat(c,"秒")})}return u("div",{style:n,children:"000时00分00秒"})},St=function(e){var t,r;return(null!==(t=null===(r=Be.previewCompoents)||void 0===r?void 0:r.PreviewDuration)&&void 0!==t?t:Ct)(e)},xt=function(e){var t=e.checked,r=e.style,n=e.onChange;return d((function(){n(t)}),[]),u("div",{style:r,children:t?"开启":"关闭"})},Dt=function(e){var t,r;return(null!==(t=null===(r=Be.previewCompoents)||void 0===r?void 0:r.PreviewSwitch)&&void 0!==t?t:xt)(e)},Vt=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})},It=function(e){var t,r;return(null!==(t=null===(r=Be.previewCompoents)||void 0===r?void 0:r.PreviewList)&&void 0!==t?t:Vt)(e)},Lt=function(e){var t=e.fileList,r=Be.request.prefix+Be.file.downloadUrl,n=Be.request.prefix+Be.file.previewUrl;return u(s,{children:null==t?void 0:t.map((function(e){var t=e.id,i=e.name,o=e.url,l=e.contentType,a=r+"/"+t;return null!=l&&l.endsWith("pdf")?u("div",{children:c(b,{style:{paddingBottom:10},children:[u("a",{href:o,target:"_blank",rel:"noreferrer",children:i}),u("a",{href:a,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=l&&l.startsWith("image")?u("div",{children:c(b,{style:{paddingBottom:10},children:[u(O,{width:200,src:o,alt:i}),u("a",{href:a,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=l&&l.startsWith("video")?u("div",{children:c(b,{style:{paddingBottom:10},children:[u("video",{src:o,controls:!0,style:{width:260},children:"当前浏览器不支持视频播放,请使用最新版谷歌浏览器!"}),u("a",{href:a,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=l&&l.startsWith("audio")?u("div",{children:c("div",{style:{paddingBottom:10,display:"flex",alignItems:"center"},children:[u("audio",{src:o,controls:!0,style:{width:"calc(100% - 40px)",height:30},children:"当前浏览器不支持音频播放,请使用最新版谷歌浏览器!"}),u("a",{style:{paddingLeft:10},href:a,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):null!=i&&i.endsWith(".doc")||null!=i&&i.endsWith(".docx")||null!=i&&i.endsWith(".xls")||null!=i&&i.endsWith(".xlsx")||null!=i&&i.endsWith(".ppt")||null!=i&&i.endsWith(".pptx")?u("div",{children:c(b,{style:{paddingBottom:10},children:[u("a",{href:n+"/"+t,target:"_blank",rel:"noreferrer",children:i}),u("a",{href:a,target:"_blank",rel:"noreferrer",children:"下载"})]})},t):u("div",{children:c(b,{style:{paddingBottom:10},children:[u("a",{href:o,target:"_blank",rel:"noreferrer",children:i}),u("a",{href:a,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},Rt=function(e){var t,r;return(null!==(t=null===(r=Be.previewCompoents)||void 0===r?void 0:r.PreviewFile)&&void 0!==t?t:Lt)(e)},Et=function(e){var t=e.fileList,r=e.width,n=e.height,i=e.style;return u(s,{children:null==t?void 0:t.map((function(e){var t=e.id,o=e.name,l=e.url;return u("div",{style:i,children:c(b,{style:{paddingBottom:10},children:[u(O,{width:r,height:n,src:l,alt:o}),u("a",{href:Be.request.prefix+Be.file.downloadUrl+"/"+t,target:"_blank",rel:"noreferrer",children:"下载"})]})},t)}))})},Ft=function(e){var t,r;return(null!==(t=null===(r=Be.previewCompoents)||void 0===r?void 0:r.PreviewImage)&&void 0!==t?t:Et)(e)};function Tt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 Bt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function At(e,t,r){return t=i(t),n(e,Nt()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Nt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nt=function(){return!!e})()}var Mt=function(e){function n(){return t(this,n),At(this,n,arguments)}return l(n,rt),r(n,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.type,a=i.preview,c=i.placeholder,p=i.maxLength,f=i.allowClear,d=i.showCount,h=i.readonly,y=i.hidden,v=this.getStyles(),m=v.styles,b=v.itemStyles;return u(g.Item,Bt(Bt(Bt({name:o,label:this.getLabel(),style:b,hidden:y,rules:e},r),n),{},{children:a?u(Pt,{type:l,style:m}):u(w,{maxLength:p,placeholder:c,allowClear:f,showCount:d,disabled:h,style:m})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}();function qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ut(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zt(e,t,r){return t=i(t),n(e,Wt()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wt=function(){return!!e})()}var _t=function(e){function n(){return t(this,n),zt(this,n,arguments)}return l(n,rt),r(n,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.props,r=t.code,n=t.preview,i=t.placeholder,o=t.maxLength,l=t.allowClear,a=t.showCount,c=t.minRow,p=void 0===c?"0":c,f=t.maxRow,d=void 0===f?"0":f,h=t.readonly,y=t.hidden,v=this.getItem(),m=v.itemProps,b=v.itemLayouts,O=this.getStyles(),j=O.styles,k=O.itemStyles,P=Number(p),C=Number(d);return u(g.Item,Ut(Ut(Ut({name:r,label:this.getLabel(),style:k,hidden:y,rules:y?[]:e},m),b),{},{children:n?u(Pt,{style:j}):u(w.TextArea,{maxLength:o,placeholder:i,allowClear:l,showCount:a,autoSize:!(P+C<1)&&{minRows:P,maxRows:C},disabled:h,style:j})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}();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,t,r){return t=i(t),n(e,Yt()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Yt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yt=function(){return!!e})()}var Kt=function(e){function n(){return t(this,n),$t(this,n,arguments)}return l(n,rt),r(n,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){var e=this.props,t=e.type,r=void 0===t?"number":t,n=e.precision,i={};"digits"===r?i=n?{precision:Number(n)}:{precision:2}:"money"===r?i={formatter:function(e){return"¥ ".concat(e).replace(/\B(?=(\d{3})+(?!\d))/g,",")},parser:function(e){return e.replace(/\$\s?|(,*)/g,"")}}:"percentage"===r&&(i={formatter:function(e){return"".concat(e,"%")},parser:function(e){return e.replace("%","")}}),this.onComputeValue();var o=this.rules().map((function(e){return e.required?Ht(Ht({},e),{},{type:"number"}):e})),l=this.getItem(),a=l.itemProps,c=l.itemLayouts,p=this.props,f=p.code,d=p.preview,h=p.min,y=p.max,v=p.readonly,m=p.hidden,b=this.getStyles(),O=b.styles,w=b.itemStyles;return u(g.Item,Ht(Ht(Ht({name:f,label:this.getLabel(),style:w,hidden:m,rules:m?[]:o},a),c),{},{children:d?u(Pt,{style:O}):u(j,Ht(Ht({min:h,max:y,disabled:v},i),{},{style:O}))}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}();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,t,r){return t=i(t),n(e,Zt()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zt=function(){return!!e})()}var er=function(e){function n(){return t(this,n),Xt(this,n,arguments)}return l(n,rt),r(n,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.title,a=i.preview,c=i.placeholder,p=i.hidden,f=i.readonly,d=this.getStyles(),h=d.styles,y=d.itemStyles;return u(g.Item,Qt(Qt(Qt({name:o,label:this.getLabel(),style:y,hidden:p,colon:!!l,rules:p?[]:e},r),n),{},{children:a||f?u(Pt,{style:h}):u(tr,{placeholder:c,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),tr=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=Xt(this,n,[].concat(i)),a(o(e),"isReactWEditor",!1),a(o(e),"editorRef",p.createRef()),e}return l(n,e),r(n,[{key:"shouldComponentUpdate",value:function(){return!this.isReactWEditor}},{key:"render",value:function(){var e=this,t=this.props,r=t.value,n=t.placeholder,i=t.style,o=t.onChange;return u(ue,{placeholder:n,value:r,style:i,onBlur:function(){e.isReactWEditor=!1},onFocus:function(){e.isReactWEditor=!0},onChange:function(e){null==o||o(e)}})}}]),n}(p.Component);function rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ir(e,t,r){return t=i(t),n(e,or()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function or(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(or=function(){return!!e})()}var lr=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=ir(this,n,[].concat(i)),a(o(e),"state",{list:[]}),e}return l(n,dt),r(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();if(r)this.setState({list:r},this.initValue);else if(t&&t.trim().length>0){var n=Be.request.route+t;this.request(n).then((function(t){e.setState({list:t},e.initValue)}))}}},{key:"initValue",value:function(){var e=this.props,t=e.defaultValue,r=e.multiple;t&&(r?this.setDefaultValue([t]):this.setDefaultValue(t))}},{key:"render",value:function(){var e=this;if(this.display()){this.onComputeValue();var t=this.props,r=t.code,n=t.preview,i=t.multiple,o=t.placeholder,l=t.allowClear,a=void 0===l||l,c=t.readonly,p=t.hidden,f=i?this.plusRules():this.rules(),d=this.collectionList(),h=this.getList(this.state.list,d,(function(t){if(t.length>0){var r=e.getFieldValue();r&&(!i&&!t.some((function(e){return e.key===r}))||i&&!t.some((function(e){return r.includes(e.key)})))&&e.cleanFieldValue()}})),y=this.getItem(),v=y.itemProps,m=y.itemLayouts,b=this.getStyles(),O=b.styles,w=b.itemStyles;return u(g.Item,nr(nr(nr({name:r,label:this.getLabel(),style:w,hidden:p,rules:p?[]:f},v),m),{},{children:n?u(It,{list:this.state.list,style:O}):u(ur,{list:h,multiple:i,placeholder:o,allowClear:a,readonly:c,style:O})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),ar=k.Option,ur=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=ir(this,n,[].concat(i)),a(o(e),"handleItemValue",(function(t){var r,n;null===(r=(n=e.props).onChange)||void 0===r||r.call(n,t)})),e}return l(n,vt),r(n,[{key:"render",value:function(){var e=this.props,t=e.list,r=e.value,n=e.multiple,i=e.placeholder,o=e.allowClear,l=e.readonly,a=e.style;return u(k,{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(ar,{value:t,children:r},t)}))})}}]),n}();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 cr(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,t,r){return t=i(t),n(e,fr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function fr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fr=function(){return!!e})()}var dr=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=pr(this,n,[].concat(i)),a(o(e),"state",{list:[]}),e}return l(n,dt),r(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();if(r)this.setState({list:r},this.initValue);else if(t&&t.trim().length>0){var n=Be.request.route+t;this.request(n).then((function(t){e.setState({list:t},e.initValue)}))}}},{key:"render",value:function(){var e=this;if(this.display()){this.onComputeValue();var t=this.plusRules(),r=this.collectionList(),n=this.getList(this.state.list,r,(function(t){if(t.length>0){var r=e.getFieldValue();r&&!t.some((function(e){return r.includes(e.key)}))&&e.cleanFieldValue()}})),i=this.props,o=i.code,l=i.preview,a=i.readonly,s=i.hidden,c=this.getItem(),p=c.itemProps,f=c.itemLayouts,d=this.getStyles(),h=d.styles,y=d.itemStyles;return u(g.Item,cr(cr(cr({name:o,label:this.getLabel(),style:y,hidden:s,rules:s?[]:t},p),f),{},{children:l?u(It,{list:this.state.list,style:h}):u(hr,{list:n,readonly:a,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),null}}]),n}(),hr=function(e){function n(){return t(this,n),pr(this,n,arguments)}return l(n,vt),r(n,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.list,n=e.readonly,i=e.style,o=e.onChange;return u(P.Group,{style:i,value:t,onChange:function(e){null==o||o(e)},children:r&&r.map((function(e){var t=e.key,r=e.label;return u(P,{value:t,disabled:n,children:r},t)}))})}}]),n}();function yr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function 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,t,r){return t=i(t),n(e,gr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function gr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gr=function(){return!!e})()}var br=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=mr(this,n,[].concat(i)),a(o(e),"state",{list:[]}),e}return l(n,dt),r(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.remote,r=this.optionList();if(r)this.setState({list:r},this.initValue);else if(t&&t.trim().length>0){var n=Be.request.route+t;this.request(n).then((function(t){e.setState({list:t},e.initValue)}))}}},{key:"render",value:function(){var e=this;if(this.display()){this.onComputeValue();var t=this.rules(),r=this.collectionList(),n=this.getList(this.state.list,r,(function(t){if(t.length>0){var r=e.getFieldValue();r&&!t.some((function(e){return r.includes(e.key)}))&&e.cleanFieldValue()}})),i=this.props,o=i.code,l=i.preview,a=i.optionType,c=i.readonly,p=i.hidden,f=this.getItem(),d=f.itemProps,h=f.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return u(g.Item,vr(vr(vr({name:o,label:this.getLabel(),style:m,hidden:p,rules:p?[]:t},d),h),{},{children:l?u(It,{list:n,style:v}):u(Or,{list:this.state.list,optionType:a,readonly:c,style:v})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),Or=function(e){function n(){return t(this,n),mr(this,n,arguments)}return l(n,vt),r(n,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.list,n=e.optionType,i=e.readonly,o=e.style,l=e.onChange;return u(C.Group,{value:t,optionType:n,style:o,onChange:function(e){null==l||l(e.target.value)},children:r&&r.map((function(e){var t=e.key,r=e.label;return u(C,{value:t,disabled:i,children:r},t)}))})}}]),n}();function wr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 jr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kr(e,t,r){return t=i(t),n(e,Pr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Pr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pr=function(){return!!e})()}var Cr=function(e){function n(){return t(this,n),kr(this,n,arguments)}return l(n,rt),r(n,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.props,r=t.code,n=t.preview,i=t.readonly,o=t.hidden,l=this.getItem(),a=l.itemProps,c=l.itemLayouts,p=this.getStyles(),f=p.styles,d=p.itemStyles;return u(g.Item,jr(jr(jr({label:this.getLabel(),name:r,style:d,hidden:o,rules:o?[]:e,valuePropName:"checked"},a),c),{},{children:n?u(Dt,{style:f}):u(S,{disabled:i,style:f})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}();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 xr(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 Dr(e,t,r){return t=i(t),n(e,Vr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Vr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vr=function(){return!!e})()}!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 Ir=function(e){function n(){return t(this,n),Dr(this,n,arguments)}return l(n,rt),r(n,[{key:"componentDidMount",value:function(){this.initValue("000:00:00")}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.preview,a=i.readonly,c=i.hidden,p=this.getStyles(),f=p.styles,d=p.itemStyles;return u(g.Item,xr(xr(xr({name:o,label:this.getLabel(),style:d,hidden:c,rules:c?[]:e},r),n),{},{children:l?u(St,{style:f}):u(Lr,{readonly:a,style:f})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),Lr=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=Dr(this,n,[].concat(i)),a(o(e),"duration",[0,0,0]),a(o(e),"changeValue",(function(t){return function(r){if("number"==typeof r){var n,i;e.duration[t]=r;var o=e.duration.map((function(e,t){return se(0===t?"000":"00",e)}));null===(n=(i=e.props).onChange)||void 0===n||n.call(i,o.join(":"))}}})),e}return l(n,vt),r(n,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.readonly,n=e.style;return"string"==typeof t&&(this.duration=t.split(":").map(Number)),c("div",{className:"duration",children:[u(g.Item,{children:u(j,{style:xr({width:"100%"},n),min:0,max:999,precision:0,value:this.duration[0],formatter:function(e){return e<100?e<10?"00"+e:"0"+e:e.toString()},onChange:this.changeValue(0),controls:!1,disabled:r})}),u("span",{children:"小时"}),u(g.Item,{children:u(j,{style:xr({width:"100%"},n),min:0,max:59,precision:0,value:this.duration[1],formatter:function(e){return e<10?"0"+e:e.toString()},onChange:this.changeValue(1),controls:!1,disabled:r})}),u("span",{children:"分"}),u(g.Item,{children:u(j,{style:xr({width:"100%"},n),min:0,max:59,precision:0,value:this.duration[2],formatter:function(e){return e<10?"0"+e:e.toString()},onChange:this.changeValue(2),controls:!1,disabled:r})}),u("span",{children:"秒"})]})}}]),n}();function Rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Fr(e,t,r){return t=i(t),n(e,Tr()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Tr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tr=function(){return!!e})()}ce.extend(pe),ce.extend(fe);var Br=function(e){function n(){return t(this,n),Fr(this,n,arguments)}return l(n,rt),r(n,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.type,a=void 0===l?"date":l,c=i.format,p=void 0===c?"YYYY-MM-DD":c,f=i.showTime,d=void 0!==f&&f,h=i.preview,y=i.placeholder,v=i.allowClear,m=void 0===v||v,b=i.readonly,O=i.hidden,w=this.getStyles(),j=w.styles,k=w.itemStyles;return u(g.Item,Er(Er(Er({name:o,label:this.getLabel(),style:k,hidden:O,rules:O?[]:e},r),n),{},{children:h?u(Pt,{style:j}):u(Ar,{type:a,format:p,showTime:d,placeholder:y,allowClear:m,readonly:b,style:j})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),Ar=function(e){function n(){return t(this,n),Fr(this,n,arguments)}return l(n,vt),r(n,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.type,n=e.format,i=e.showTime,o=e.placeholder,l=e.allowClear,a=e.readonly,s=e.style,c=e.onChange;return u(x,{value:t?ce(t,n):void 0,picker:r,format:n,showTime:i?{format:"HH:mm"}:void 0,placeholder:o,allowClear:l,disabled:a,style:s,onChange:function(e){null==c||c(null==e?void 0:e.format(n))}})}}]),n}();function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 Mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qr(e,t,r){return t=i(t),n(e,Ur()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function Ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ur=function(){return!!e})()}ce.extend(de);var zr=function(e){function n(){return t(this,n),qr(this,n,arguments)}return l(n,rt),r(n,[{key:"componentDidMount",value:function(){this.initValue()}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.rules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.format,a=void 0===l?"HH:mm:ss":l,c=i.preview,p=i.placeholder,f=i.allowClear,d=void 0===f||f,h=i.readonly,y=i.hidden,v=this.getStyles(),m=v.styles,b=v.itemStyles;return u(g.Item,Mr(Mr(Mr({name:o,label:this.getLabel(),style:b,hidden:y,rules:y?[]:e},r),n),{},{children:c?u(Pt,{style:m}):u(Wr,{format:a,placeholder:p,allowClear:d,readonly:h,style:m})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),Wr=function(e){function n(){return t(this,n),qr(this,n,arguments)}return l(n,vt),r(n,[{key:"render",value:function(){var e=this.props,t=e.value,r=e.format,n=e.placeholder,i=e.allowClear,o=e.readonly,l=e.style,a=e.onChange;return u(D,{value:t?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))}})}}]),n}();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 Gr(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 Hr(e,t,r){return t=i(t),n(e,$r()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function $r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($r=function(){return!!e})()}var Yr=function(e){return Array.isArray(e)?e:e&&e.list},Kr=function(e){function n(){return t(this,n),Hr(this,n,arguments)}return l(n,dt),r(n,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,i=t.maxCount,o=t.fileType,l=t.fileTypeMessage,a=t.fileSize,c=t.readonly,p=t.hidden,f=this.getItem(),d=f.itemProps,h=f.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return u(g.Item,Gr(Gr(Gr({name:r,label:this.getLabel(),style:m,hidden:p,rules:p?[]:e,valuePropName:"list",getValueFromEvent:Yr},d),h),{},{children:u(Jr,{maxCount:i,fileType:o,fileTypeMessage:l,fileSize:a,readonly:c,preview:n,style:v})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),Jr=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=Hr(this,n,[].concat(i)),a(o(e),"uploading",!1),a(o(e),"state",{fileList:[],modal:{open:!1,progress:0}}),a(o(e),"onBeforeUpload",(function(t){var r=e.props,n=r.fileSize,i=r.fileType,o=r.fileTypeMessage,l=null==i?void 0:i.replace(/\ +/g,"").split(","),a=null==l?void 0:l.map((function(e){return e.startsWith(".")?Be.mimeType[e]:e}));if(!(a&&a.length>0))return V.error("文件类型不匹配!"),I.LIST_IGNORE;if(!a.includes(t.type))return V.error(o),I.LIST_IGNORE;if(n&&Oe.parse(n)<t.size)return V.error("上传的文件大小,不能超过 ".concat(n,"!")),I.LIST_IGNORE;return!0})),a(o(e),"onStart",(function(){clearInterval(e.timer),e.setState({modal:{open:!0,progress:0}}),e.uploading=!0})),a(o(e),"onProgress",(function(t){if(e.uploading){clearInterval(e.timer);var r=Math.round(t.percent/2);if(e.setState({modal:{open:!0,progress:r}}),50===r){var n=r;e.timer=setInterval((function(){e.uploading?e.setState({modal:{open:!0,progress:++n}}):(clearInterval(e.timer),e.setState({modal:{open:!1,progress:0}})),99===n&&clearInterval(e.timer)}),1e3)}}})),a(o(e),"onSuccess",(function(t,r){clearInterval(e.timer);var n=t.data,i=n.id,o=n.url;r.status="done",r.response=t,r.id=i,r.url=o;var l=[].concat(he(e.state.fileList),[r]);e.setState({fileList:l,modal:{open:!0,progress:100}},(function(){e.onChange(l),setTimeout((function(){e.setState({modal:{open:!1,progress:0}})}),500)})),e.uploading=!1})),a(o(e),"onError",(function(t,r,n){var i;clearInterval(e.timer);var o=[].concat(he(e.state.fileList),[n]);n.status="error",n.response=null!==(i=null==r?void 0:r.message)&&void 0!==i?i:"上传失败",e.setState({fileList:o,modal:{open:!1,progress:100}},(function(){e.onChange(o)})),e.uploading=!1})),a(o(e),"onRemove",(function(t){var r=e.state.fileList.filter((function(e){return e.id!==t.id}));e.setState({fileList:r},(function(){e.onChange(r)}))})),e}return l(n,vt),r(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Be.file.listUrl;t&&(null==t?void 0:t.length)>0&&t[0]&&Je(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return Gr(Gr({},e),{},{status:"done"})}));e.setState({fileList:r},(function(){e.onChange(r)}))})).catch((function(e){console.warn("url",r,e)}))}},{key:"onChange",value:function(e){var t,r;null===(t=(r=this.props).onChange)||void 0===t||t.call(r,e.filter((function(e){var t=e.id,r=e.status;return t&&"done"===r})).map((function(e){return e.id})))}},{key:"render",value:function(){var e=this.state,t=e.fileList,r=e.modal,n=this.props,i=n.preview,o=n.maxCount,l=n.readonly,a=n.style,p=o?Number(o):0;if(i)return u(Rt,{fileList:t});var f={onStart:this.onStart,onSuccess:this.onSuccess,onProgress:this.onProgress,onError:this.onError};return c(s,{children:[u(I,Gr(Gr({action:Be.request.prefix+Be.file.uploadUrl,fileList:t,maxCount:p,disabled:l,beforeUpload:this.onBeforeUpload,onRemove:this.onRemove},f),{},{children:u(L,{disabled:l||p<=t.length,icon:u(ye,{}),style:a,children:"上传"})})),c(R,{open:r.open,closable:!1,footer:null,children:[u("div",{children:"上传文件进度"}),u(E,{percent:r.progress})]})]})}}]),n}();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 Xr(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,t,r){return t=i(t),n(e,en()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function en(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(en=function(){return!!e})()}var tn=function(e){return Array.isArray(e)?e:e&&e.list},rn=["image/jpeg","image/png"],nn=function(e){function n(){return t(this,n),Zr(this,n,arguments)}return l(n,dt),r(n,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,i=t.maxCount,o=t.fileSize,l=t.fileWidth,a=void 0===l?"100":l,c=t.fileHeight,p=void 0===c?"100":c,f=t.readonly,d=t.hidden,h=this.getItem(),y=h.itemProps,v=h.itemLayouts,m=this.getStyles(),b=m.styles,O=m.itemStyles;return u(g.Item,Xr(Xr(Xr({name:r,label:this.getLabel(),style:O,hidden:d,rules:d?[]:e,valuePropName:"list",getValueFromEvent:tn},y),v),{},{children:u(on,{maxCount:i,fileSize:o,fileWidth:Number(a),fileHeight:Number(p),readonly:f,preview:n,style:b})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),on=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=Zr(this,n,[].concat(i)),a(o(e),"uploading",!1),a(o(e),"state",{fileList:[],fileView:void 0}),a(o(e),"onChangeValue",(function(t){var r=t.fileList.map((function(e){var t,r;if(200===(null===(t=e.response)||void 0===t?void 0:t.status)){var n=e.response.data,i=n.id;n.name;var o=n.url;e.id=i,e.url=o,e.status="done"}else 500===(null===(r=e.response)||void 0===r?void 0:r.status)&&(e.status="error",e.response=e.response.message);return e}));e.setState({fileList:r},(function(){e.onChange(r)}))})),a(o(e),"onBeforeUpload",(function(t){if(!rn.includes(t.type))return V.error("上传文件类型,仅支持图片类型!"),I.LIST_IGNORE;var r=e.props.fileSize;if(r&&Oe.parse(r)<t.size)return V.error("上传的文件大小,不能超过 ".concat(r,"!")),I.LIST_IGNORE;return!0})),a(o(e),"onRemove",(function(t){var r=e.state.fileList.filter((function(e){return e.id!==t.id}));e.setState({fileList:r},(function(){e.onChange(r)}))})),e}return l(n,vt),r(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Be.file.listUrl;t&&(null==t?void 0:t.length)>0&&t[0]&&Je(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,p=i.fileWidth,f=void 0===p?100:p,d=i.fileHeight,h=void 0===d?100:d,y=i.style,v=l?Number(l):0;return o?u(Ft,{fileList:r,width:f,height:h,style:y}):c(s,{children:[u(we,{rotationSlider:!0,modalTitle:"图片编辑",modalOk:"确认",modalCancel:"取消",aspect:f/h,children:u(I,{listType:"picture-card",accept:rn.join(","),action:Be.request.prefix+Be.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(ve,{}),style:y})})}),(null==n?void 0:n.id)&&u(R,{title:n.name,open:!0,footer:null,onCancel:function(){return e.setState({fileView:void 0})},children:u("img",{alt:n.name,style:{width:"100%"},src:n.url})})]})}}]),n}();function ln(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function an(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ln(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function un(e,t,r){return t=i(t),n(e,sn()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function sn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sn=function(){return!!e})()}var cn=function(e){return Array.isArray(e)?e:e&&e.list},pn=function(e){function n(){return t(this,n),un(this,n,arguments)}return l(n,dt),r(n,[{key:"render",value:function(){if(this.display()){var e=this.plusRules(),t=this.props,r=t.code,n=t.preview,i=t.maxCount,o=t.fileType,l=t.fileTypeMessage,a=t.fileSize,c=t.readonly,p=t.hidden,f=this.getItem(),d=f.itemProps,h=f.itemLayouts,y=this.getStyles(),v=y.styles,m=y.itemStyles;return u(g.Item,an(an(an({name:r,label:this.getLabel(),style:m,hidden:p,rules:p?[]:e,valuePropName:"list",getValueFromEvent:cn},d),h),{},{children:u(fn,{maxCount:i,fileType:o,fileTypeMessage:l,fileSize:a,readonly:c,preview:n,style:v})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),fn=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=un(this,n,[].concat(i)),a(o(e),"uploading",!1),a(o(e),"state",{fileList:[],modal:{open:!1,progress:0}}),a(o(e),"onBeforeUpload",(function(t){var r=e.props,n=r.fileSize,i=r.fileType,o=r.fileTypeMessage,l=null==i?void 0:i.replace(/\ +/g,"").split(",");if(!(l&&l.length>0))return V.error("文件类型不匹配!"),I.LIST_IGNORE;if(!l.includes(t.type))return V.error(o),I.LIST_IGNORE;if(n&&Oe.parse(n)<t.size)return V.error("上传的文件大小,不能超过 ".concat(n,"!")),I.LIST_IGNORE;return!0})),a(o(e),"customRequest",(function(t){var r,n,i,o,l,a,u,s={blockSize:Be.chunk.chunkSize,checkFile:(u=re(ne.mark((function e(t){var r,n,i;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,Je("post form "+Be.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=re(ne.mark((function e(t){var r,n,i,o;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.blockMd5,o=t.blockIndex,e.next=3,Je("post form "+Be.chunk.checkChunk)({fileName:r,fileMd5:n,blockMd5:i,blockIndex:o});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)}),uploadBlock:(l=re(ne.mark((function e(t){var r,n,i,o,l,a;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.blockMd5,o=t.blockIndex,l=t.file,(a=new FormData).append("blockIndex",String(o)),a.append("blockMd5",i),a.append("fileName",r),a.append("fileMd5",n),a.append("file",l),e.next=9,Je("post form "+Be.chunk.chunkUpload)(a);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)}),mergeBlock:(o=re(ne.mark((function e(t){var r,n,i;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,Je("post form "+Be.chunk.doMerge)({fileName:r,fileMd5:n,fileSize:i});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)}),mergeProgress:(i=re(ne.mark((function e(){var t;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Je(Be.chunk.mergeProgress)();case 2:return t=e.sent,e.abrupt("return",null==t?void 0:t.data);case 4:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)}),verifyFile:(n=re(ne.mark((function e(t){var r,n,i;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.fileName,n=t.fileMd5,i=t.fileSize,e.next=3,Je("post form "+Be.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=re(ne.mark((function e(){var t;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Je(Be.chunk.completeProgress)();case 2:return t=e.sent,e.abrupt("return",null==t?void 0:t.data);case 4:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},c=je.create(s);c.progress((function(t,r){t.status="uploading",e.setState({modal:{open:!0,progress:r}})})),c.complete((function(t){var r=t.response,n=r.id,i=r.url;t.id=n,t.url=i,t.status="done";var o=[].concat(he(e.state.fileList),[t]);e.setState({fileList:o,modal:{open:!1,progress:0}},(function(){e.onChange(o)}))})),c.error((function(t,r){t.status="error",t.response=r;var n=e.state.fileList,i=n.findIndex((function(e){return e.uid===t.uid}));-1===i?n.push(t):n[i]=t,e.setState({fileList:n,modal:{open:!1,progress:0}})})),c.start(t.file)})),a(o(e),"onRemove",(function(t){var r=e.state.fileList.filter((function(e){return e.id!==t.id}));e.setState({fileList:r},(function(){e.onChange(r)}))})),e}return l(n,vt),r(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.list,r=Be.file.listUrl;t&&t.length>0&&Je(r)({ids:t}).then((function(t){var r=t.data.map((function(e){return an(an({},e),{},{status:"done"})}));e.setState({fileList:r},(function(){e.onChange(r)}))})).catch((function(e){console.warn("url",r,e)}))}},{key:"onChange",value:function(e){var t,r;null===(t=(r=this.props).onChange)||void 0===t||t.call(r,e.filter((function(e){return"done"===e.status})).map((function(e){return e.id})))}},{key:"render",value:function(){var e=this.state,t=e.fileList,r=e.modal,n=this.props,i=n.preview,o=n.maxCount,l=n.readonly,a=n.style,p=o?Number(o):0;return i?u(Rt,{fileList:t}):c(s,{children:[u(I,{action:Be.request.prefix+Be.file.uploadUrl,fileList:t,maxCount:p,disabled:l,beforeUpload:this.onBeforeUpload,customRequest:this.customRequest,onRemove:this.onRemove,children:u(L,{disabled:l||p<=t.length,icon:u(ye,{}),style:a,children:"上传"})}),c(R,{open:r.open,closable:!1,footer:null,children:[u("div",{children:"上传文件进度"}),u(E,{percent:r.progress})]})]})}}]),n}(),dn=["worksId","worksExtraId"];function hn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vn(e,t,r){return t=i(t),n(e,mn()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function mn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mn=function(){return!!e})()}var gn=function(e){function n(){return t(this,n),vn(this,n,arguments)}return l(n,dt),r(n,[{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 yn(yn({},e),{},{rules:null===(t=e.rules)||void 0===t?void 0:t.map(Le)})})):[]}},{key:"render",value:function(){if(this.display()){this.onComputeValue();var e=this.plusRules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.title,a=i.preview,c=i.readonly,p=i.hidden,f=this.getStyles(),d=f.styles,h=f.itemStyles;return u(g.Item,yn(yn(yn({name:o,style:h,hidden:p,rules:p?[]:e,valuePropName:"list"},r),n),{},{children:u(bn,{preview:a||c,title:l,columns:this.getColumns(),style:d})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),bn=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=vn(this,n,[].concat(i)),a(o(e),"state",{dataSource:[],modal:{title:"",entity:void 0,show:!1}}),a(o(e),"onFinish",(function(t){var r=e.state.dataSource,n=[];t.id||t.uid?n=r.map((function(e){return t.id&&e.id===t.id||t.uid&&e.uid===t.uid?yn(yn({},e),t):e})):(t.index=r.length+1,t.uid=W(),n=[].concat(he(r),[t])),e.setState({dataSource:n,modal:{title:"",entity:void 0,show:!1}},(function(){var t,r;null===(t=(r=e.props).onChange)||void 0===t||t.call(r,n)}))})),a(o(e),"onCancel",(function(){e.setState({modal:{title:"",entity:void 0,show:!1}})})),e}return l(n,vt),r(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.list,r=e.onChange;if(Array.isArray(t)){var n=t.map((function(e,t){return e.worksId,yn({id:e.worksExtraId,index:t+1},te(e,dn))}));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[c(b,{children:[u("a",{onClick:function(){e.setState({modal:{title:"修改".concat(r),entity:n,show:!0}})},children:"修改"},"modifly"),u("a",{onClick:function(){R.confirm({title:"警告",icon:u(me,{}),content:"请确认是否删除该项数据?",okText:"确认",cancelText:"取消",onOk:function(){var t=l.filter((function(e){var t=e.id,r=e.uid;return!(t&&n.id===t||r&&n.uid===r)}));e.setState({dataSource:t},(function(){null==o||o(t)}))}})},children:"删除"},"delete")]},"option")]}})}},{key:"render",value:function(){var e=this,t=this.props,r=t.title,n=t.preview,i=t.style,o=this.state,l=o.dataSource,a=o.modal,s=this.getColumns();return c(F,{title:r,bodyStyle:{padding:"0px 12px"},extra:n?null:u("a",{onClick:function(){e.setState({modal:{title:"新建".concat(r),entity:void 0,show:!0}})},children:"添加"},"new"),children:[u(T,{rowKey:"index",size:"small",style:i,columns:s,dataSource:l}),a.show&&u(On,{title:a.title,entity:a.entity,columns:s,onFinish:this.onFinish,onCancel:this.onCancel})]})}}]),n}(),On=function(t){var r,n=t.title,i=t.entity,o=t.columns,l=t.onFinish,a=t.onCancel,s=g.useForm(),c=e(s,1)[0];return u(R,{title:n,width:740,open:!0,destroyOnClose:!0,onCancel:a,onOk:(r=re(ne.mark((function e(){return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c.validateFields().then((function(e){l(yn(yn({},i),e))})).catch((function(e){console.warn(e)}));case 2:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)}),children:u(g,{form:c,name:"modalTable",initialValues:i,wrapperCol:{span:22},autoComplete:"off",layout:"vertical",children:u(B,{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(g.Item,{label:t,name:r,rules:i,children:u(w,{placeholder:n})})},r)}))})})})},wn=["id","index"];function jn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jn(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pn(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 Cn(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 Cn(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 Cn(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 Sn(e,t,r){return t=i(t),n(e,xn()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function xn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xn=function(){return!!e})()}var Dn=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=Sn(this,n,[].concat(i)),a(o(e),"itemList",[]),a(o(e),"columnList",[]),a(o(e),"state",{doc:void 0,loading:!0}),a(o(e),"initItems",function(){var t=re(ne.mark((function t(r){var n,i,o,l,a,u,s,c,p,f,d,h,y,v,m,g,b,O,w,j;return ne.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=De.selectors(r,"[code]"),o=Pn(i),t.prev=4,o.s();case 6:if((l=o.n()).done){t.next=29;break}if(a=l.value,u=a.getAttribute("code"),s=a.getAttribute("title"),c=a.tagName.toLowerCase(),!u||!n.includes(u)){t.next=27;break}if(p={},f=a.getAttribute("remote"),!((d=De.selectors(a,"Option")).length>0)){t.next=20;break}h=Pn(d);try{for(h.s();!(y=h.n()).done;)v=y.value,m=v.getAttribute("value"),g=v.textContent,m&&g&&(p[m]=g)}catch(e){h.e(e)}finally{h.f()}t.next=26;break;case 20:if(!f){t.next=26;break}return t.next=23,e.request(Be.request.route+f);case 23:b=t.sent,O=Pn(b);try{for(O.s();!(w=O.n()).done;)j=w.value,p[j.key]=j.label}catch(e){O.e(e)}finally{O.f()}case 26:e.itemList.push({code:u,title:s,type:c,data:p});case 27:t.next=6;break;case 29:t.next=34;break;case 31:t.prev=31,t.t0=t.catch(4),o.e(t.t0);case 34:return t.prev=34,o.f(),t.finish(34);case 37:e.setState({loading:!1});case 38:case"end":return t.stop()}}),t,null,[[4,31,34,37]])})));return function(e){return t.apply(this,arguments)}}()),e}return l(n,dt),r(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.formId;this.setState({loading:!0}),this.request(Be.form.documentUrl,{formId:t}).then((function(t){var r=De.toDocument(t);e.setState({doc:r}),e.initItems(r)}))}},{key:"render",value:function(){if(this.display()&&!this.state.loading){this.onComputeValue();var e=this.plusRules(),t=this.getItem(),r=t.itemProps,n=t.itemLayouts,i=this.props,o=i.code,l=i.title,a=i.witdh,c=i.preview,p=i.readonly,f=i.hidden,d=this.getStyles(),h=d.styles,y=d.itemStyles,v=this.state.doc;return u(g.Item,kn(kn(kn({name:o,style:y,hidden:f,rules:f?[]:e,valuePropName:"list"},r),n),{},{children:u(Vn,{preview:c||p,title:l,witdh:a,columns:this.columnList,items:this.itemList,document:v,style:h})}))}return this.props.hideClear&&this.cleanFieldValue(),u(s,{})}}]),n}(),Vn=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=Sn(this,n,[].concat(i)),a(o(e),"state",{dataSource:[],modal:{title:"",entity:void 0,show:!1}}),a(o(e),"onFinish",(function(t){var r=e.state.dataSource,n=[];t.id?n=r.map((function(e){return e.id===t.id?kn(kn({},e),t):e})):(t.id=W(),t.index=r.length+1,n=[].concat(he(r),[t])),e.onChange(n)})),a(o(e),"onCancel",(function(){e.setState({modal:{title:"",entity:void 0,show:!1}})})),e}return l(n,vt),r(n,[{key:"componentDidMount",value:function(){var e=this.props.list;if(Array.isArray(e)){var t=e.map((function(e,t){var r=Pe({},(ke(e),e));return kn({id:W(),index:t+1},r)}));this.onChange(t)}}},{key:"onChange",value:function(e){var t=this;this.setState({dataSource:e,modal:{title:"",entity:void 0,show:!1}},(function(){var r,n;null===(r=(n=t.props).onChange)||void 0===r||r.call(n,e.map((function(e){return e.id,e.index,te(e,wn)})))}))}},{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[c(b,{children:[u("a",{onClick:function(){e.setState({modal:{title:"修改".concat(n),entity:r,show:!0}})},children:"修改"},"modifly"),u("a",{onClick:function(){R.confirm({title:"警告",icon:u(me,{}),content:"请确认是否删除该项数据?",okText:"确认",cancelText:"取消",onOk:function(){var t=l.filter((function(e){var t=e.id;return!(t&&r.id===t)}));e.onChange(t)}})},children:"删除"},"delete")]},"option")]}})}},{key:"render",value:function(){var e=this,t=this.props,r=t.preview,n=t.title,i=t.witdh,o=t.document,l=t.style,a=this.state,s=a.dataSource,p=a.modal,f=this.getColumns();return c(F,{title:n,bodyStyle:{padding:"0px 12px"},extra:r?null:u("a",{onClick:function(){e.setState({modal:{title:"新建".concat(n),entity:void 0,show:!0}})},children:"添加"},"new"),children:[u(T,{rowKey:"id",size:"small",style:l,columns:f,dataSource:s}),p.show&&u(In,{title:p.title,witdh:i,entity:p.entity,document:o,onFinish:this.onFinish,onCancel:this.onCancel})]})}}]),n}(),In=function(e){var t,r=e.title,n=e.witdh,i=void 0===n?"740":n,o=e.entity,l=e.document,a=e.onFinish,s=e.onCancel,c=h();return u(R,{title:r,width:Number(i),open:!0,destroyOnClose:!0,onCancel:s,onOk:(t=re(ne.mark((function e(){var t,r,n;return ne.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,null===(t=c.current)||void 0===t?void 0:t.validateFields();case 3:n=null===(r=c.current)||void 0===r?void 0:r.getFieldsValue(),a(kn(kn({},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($n,{form:c,document:l,initialValues:o})})},Ln=Object.freeze({__proto__:null,Checkbox:dr,DatePicker:Br,Duration:Ir,Editor:er,FormList:Dn,Label:bt,Number:Kt,Photo:nn,Radio:br,Select:lr,SuperUpload:pn,Switch:Cr,Table:gn,Text:Mt,TextArea:_t,TimePicker:zr,Tooltip:jt,Upload:Kr}),Rn=function(e){var t=e.children,r=e.gutter;return u(B,{gutter:Number(r),style:{margin:0},children:t})},En=function(e){var t=e.span,r=e.children;return u(A,{span:t,children:r})},Fn=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"}})},Tn=M.Content,Bn=v((function(e){var t=e.currentStepIndex,r=e.stepIndex,n=e.style,i=e.children,o=y((function(){var e=n?Qe(n):{padding:16,backgroundColor:"white"};return t!==Number(r)&&Object.assign(e,{display:"none"}),e}),[t]);return u(Tn,{style:o,children:i})})),An=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})},Nn={display:"none"},Mn={display:"block"},qn=v((function(t){var r=t.defaultExpanded,n=void 0===r||r,i=t.on,o=t.off,l=t.style,a=t.collapse,p=t.children,f=m(n),d=e(f,2),h=d[0],y=d[1],v=Qe(l);return a?c(s,{children:[u("div",{style:v,children:c(L,{type:"link",onClick:function(){y(!h)},children:[h?o:i,u(h?ge:be,{})," "]})}),u("div",{style:h?Mn:Nn,children:p})]}):u(s,{children:p})}));function Un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){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 zn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Un(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Un(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Wn(e,t,r){return t=i(t),n(e,_n()?Reflect.construct(t,r||[],i(e).constructor):t.apply(e,r))}function _n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_n=function(){return!!e})()}var Gn=Ln,Hn={Row:Rn,Col:En,Collapse:qn,Content:Bn,Divider:An,Steps:Fn},$n=function(n){function i(e){var r,n,l;return t(this,i),l=Wn(this,i,[e]),a(o(l),"state",{stepIndex:0,root:void 0,loading:!0}),a(o(l),"hideClear",!1),a(o(l),"onValuesChange",(function(e){l.setState({values:e})})),a(o(l),"onStepIndex",(function(e){l.setState({stepIndex:e})})),a(o(l),"children",(function(e){var t,r,n=null!==(t=null===(r=l.customComponents)||void 0===r?void 0:r[e.tag])&&void 0!==t?t:Gn[e.tag];return n?l.component(e,n):Hn[e.tag]?l.container(e):l.applet(e)})),l.styles=null!==(r=e.style)&&void 0!==r?r:{},l.form=null!==(n=e.form)&&void 0!==n?n:p.createRef(),l}return l(i,f),r(i,[{key:"componentDidMount",value:function(){var t,r,n=this,i=this.props,o=i.document,l=i.preview,s=(t="string"==typeof o?De.getRoot(o):De.parser(o)).attributes,c=s.style,p=s.labelCol,f=s.wrapperCol,d=s.showTitle,h=s.hideClear;if(this.showTitle=!!d,this.hideClear=!!h,"string"==typeof c){var y=null==c?void 0:c.replace(/\ +/g,"").split(";");null==y||y.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))}}))}p&&f&&(this.layouts={labelCol:{span:p},wrapperCol:{span:f}}),this.preview=null!=l&&l,Be.components&&(this.customComponents=J(Be.components,(function(e){return function(t){return u(ut,zn({Component:e},t))}}))),this.setState({root:t,loading:!0}),"function"==typeof(r=function(e){n.setState({loading:e})})&&Me.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}ee(e.hideClear)&&(e.hideClear=this.hideClear)}},{key:"component",value:function(e,t){var r=e.id,n=e.attributes,i=e.children;return this.setComponentStatus(n),u(t,zn(zn({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,zn(zn({},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Col"===r?u(En,{span:Number(n.span),children:null==o?void 0:o.map(this.children)},t):"Collapse"===r?u(qn,zn(zn({collapse:this.props.collapse},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Content"===r?u(Bn,zn(zn({currentStepIndex:this.state.stepIndex},n),{},{children:null==o?void 0:o.map(this.children)}),t):"Steps"===r?u(Fn,zn(zn({stepIndex:this.state.stepIndex,onChangeSetp:this.onStepIndex},n),{},{children:o}),t):"Divider"===r?u(An,zn(zn({},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 zn(zn({},r),{},{rules:null!==(i=null==o?void 0:o.children)&&void 0!==i?i:[]})}return r}));return{tag:r,children:l}}return"Options"===r?{tag:r,children:null==o?void 0:o.map((function(e){return{key:e.attributes.value,label:e.text}}))}:"Validates"===r?{tag:r,children:null==o?void 0:o.map((function(e){return e.attributes}))}:"Conditions"===r?{tag:r,type:n.type,action:n.action,children:null==o?void 0:o.map((function(e){return e.attributes}))}:"Collection"===r||"Compute"===r?{tag:r,cdata:i}:void 0}},{key:"render",value:function(){var e,t=this.state,r=t.root,n=t.loading,i=this.props.initialValues;return c(s,{children:[r&&u(Re.Provider,{value:zn(zn({},this.props),{},{form:this.form,showTitle:this.showTitle}),children:u(Yn,zn(zn({form:this.form,style:n?zn(zn({},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})]})}}]),i}(),Yn=function(e){function n(){var e;t(this,n);for(var r=arguments.length,i=new Array(r),l=0;l<r;l++)i[l]=arguments[l];return e=Wn(this,n,[].concat(i)),a(o(e),"onFinish",(function(e){console.log("Success:",e)})),e}return l(n,e),r(n,[{key:"render",value:function(){var e=this.props,t=e.form,r=e.style,n=e.labelCol,i=e.wrapperCol,o=e.initialValues,l=e.children,a=e.onValuesChange;return u(g,{ref:t,style:r,labelCol:n,wrapperCol:i,initialValues:o,onFinish:this.onFinish,autoComplete:"off",onValuesChange:function(e){a(e)},children:l})}}]),n}(p.PureComponent);export{Re as DesignContext,rt as UIComponent,dt as UIListComponent,$n as default,Ae as defineConfig};
|
|
2
2
|
//# sourceMappingURL=index.tsx.map
|