@jiaozhiye/qm-design-react 1.5.13 → 1.5.14

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/lib/index.full.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("QmDesign",["react"],t):"object"==typeof exports?exports.QmDesign=t(require("react")):e.QmDesign=t(e.React)}("undefined"!=typeof self?self:this,(__WEBPACK_EXTERNAL_MODULE__787__=>(()=>{"use strict";var __webpack_modules__={386:(e,t,a)=>{a.d(t,{Z:()=>r});const r="undefined"==typeof window},542:(e,t,a)=>{a.d(t,{Ds:()=>n.debounce,HD:()=>n.isString,I8:()=>y,Kn:()=>n.isPlainObject,M2:()=>c,P2:()=>n.throttle,PM:()=>v,RI:()=>p,U2:()=>n.get,XT:()=>u,Y3:()=>m,ZT:()=>d,_A:()=>f,_v:()=>h,hj:()=>n.isNumber,l$:()=>s,mf:()=>n.isFunction,o8:()=>n.isUndefined,t8:()=>n.set,w1:()=>o,xb:()=>g});var r=a(787),l=a.n(r),n=a(517),i=a(386);const o=()=>!i.Z&&/MSIE|Trident/.test(navigator.userAgent),s=e=>l().isValidElement(e),c=e=>s(e)&&e.type===l().Fragment,d=()=>{},u=()=>!0,p=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),h=async e=>new Promise((t=>setTimeout(t,e))),m=e=>{Promise.resolve().then(e)},f=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),g=e=>!!(!e&&0!==e||(0,n.isArray)(e)&&!e.length||(0,n.isPlainObject)(e)&&!Object.keys(e).length);function b(e,t){let a=-1;const r=e.length;for(;++a<r;)t(e[a],a);return e}const y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if((0,n.isPlainObject)(e)||(0,n.isArray)(e)){const a=Array.isArray(e),r=a?[]:{};if(t.get(e))return e;t.set(e,r);const l=a?void 0:Object.keys(e);return b(l||e,((a,n)=>{l&&(n=a),r[n]=y(e[n],t)})),r}return e},v=e=>(0,n.isNumber)(e)?`${e}px`:e.toString()},762:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$P:()=>isBracketBalance,A_:()=>array_format,Pz:()=>stringify,ar:()=>where});var _lib_filter_string__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(874),_lib_variables_replacement__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(704),_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(353),_lib_operations__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(981);window.__query__=function(){return(0,_lib_operations__WEBPACK_IMPORTED_MODULE_3__.D)(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])};const stringify=_lib_filter_string__WEBPACK_IMPORTED_MODULE_0__.Z.stringify,array_format=_lib_filter_string__WEBPACK_IMPORTED_MODULE_0__.Z.array_format,isBracketBalance=_lib_variables_replacement__WEBPACK_IMPORTED_MODULE_1__.Z.isBracketBalance,where=(array,query,isTree)=>{let result=[];if(query=_lib_filter_string__WEBPACK_IMPORTED_MODULE_0__.Z.replace_symbols(query),isTree)query=_lib_variables_replacement__WEBPACK_IMPORTED_MODULE_1__.Z.replace_variables(query,"record"),result=(0,_utils__WEBPACK_IMPORTED_MODULE_2__.Nl)(array,(record=>eval(query)));else{query=_lib_variables_replacement__WEBPACK_IMPORTED_MODULE_1__.Z.replace_variables(query,"array[i]");for(let i=0,len=array.length;i<len;i++)eval(query)&&result.push(array[i])}return result}},874:(e,t,a)=>{a.d(t,{Z:()=>l});const r=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"],l={operations:function(e){const t=e.split(" "),a=[];let l=0;a[l]=[];for(let e=0;e<t.length;e++)r.includes(t[e])?(a[l]=a[l].join(" "),l++,a[l]=[]):a[l].push(t[e]);return a[l]=a[l].join(" "),a},number_operations:function(e){return this.operations(e).length},string_format:function(e){return"string"!=typeof e?e:e.split(/[\s'\s"]/).join("")},stringify:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return"string"==typeof e?"'"+e.trim().replace(/(')/g,"\\$1").replace(/\(/g,"├").replace(/\)/g,"┤").replace(/\s/g,t)+"'":e},array_format:function(e){let t="[";for(let a=0,r=(e=Array.isArray(e)?e:[e]).length;a<r;a++)t+="number"==typeof e[a]?e[a]:"'"+e[a]+"'",a<r-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,a){return e.split(t).join(a)},replace_symbols:function(e){return e=this.find_replace(e," AND "," && "),e=this.find_replace(e," and "," && "),e=this.find_replace(e," OR "," || "),e=this.find_replace(e," or "," || "),e=this.find_replace(e," <> "," != "),e=this.find_replace(e," LIKE "," like "),e=this.find_replace(e," LIKES "," likes "),e=this.find_replace(e," IN "," in "),this.find_replace(e," NIN "," nin ")}}},981:(e,t,a)=>{a.d(t,{D:()=>s});const r=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,l=["string","number","boolean","symbol"],n=e=>l.includes(typeof e),i=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),o=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(r,"\\$1"),"i"),s=(e,t,a)=>{e=e??"";let r=!0;switch(t){case"like":r=null!==e.toString().match(o(a));break;case"likes":r=a.split(/,|,/).some((t=>null!==e.toString().match(o(t))));break;case"in":n(a)&&(a=[a]),Array.isArray(a)&&(r=Array.isArray(e)?a.every((t=>e.includes(t))):a.includes(e));break;case"nin":n(a)&&(a=[a]),Array.isArray(a)&&(r=!(Array.isArray(e)?a.some((t=>e.includes(t))):a.includes(e)));break;case"!=":case"<>":r=(i(e)?e.slice(0,10):e)!=a;break;case"<":r=(i(e)?e.slice(0,10):e)<a;break;case"<=":r=(i(e)?e.slice(0,10):e)<=a;break;case">":r=(i(e)?e.slice(0,10):e)>a;break;case">=":r=(i(e)?e.slice(0,10):e)>=a;break;default:r=(i(e)?e.slice(0,10):e)==a}return r}},704:(e,t,a)=>{a.d(t,{Z:()=>l});const r=["==","<",">","<=",">=","!=","like","likes","in","nin"],l={isBracketBalance:function(e){let t=0;const a=e.length;for(let r=0;r<a;r++){const a=e.charAt(r);"("===a&&t++,")"===a&&t--}return 0===t},replace_variables:function(e,t){let a="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?a+=" "+e[t]+" ":a+=e[t];const l=a.split(" ").filter((e=>""!==e));for(let e=0;e<l.length;e++)r.includes(l[e])&&("this"!=l[e-1]?l[e-1]=t+"."+l[e-1]:l[e-1]=t),r.includes(l[e])&&(l.splice(e-1,3,`__query__(${l[e-1]}, '${l[e]}', ${l[e+1]})`),e-=2);return l.join(" ")}}},353:(e,t,a)=>{a.d(t,{CD:()=>g,C_:()=>S,EJ:()=>x,HG:()=>s,J1:()=>c,MY:()=>f,Nl:()=>q,Ps:()=>p,Qi:()=>F,RI:()=>i.RI,SX:()=>O,TQ:()=>k,W2:()=>A,ZJ:()=>L,_3:()=>I,bY:()=>C,dN:()=>w,e5:()=>E,gU:()=>m,gn:()=>P,jq:()=>T,p6:()=>_,t2:()=>h,tL:()=>b,tj:()=>v,uf:()=>N,v9:()=>H,vo:()=>y,wE:()=>R,y1:()=>u});var r=a(517),l=a(635),n=a.n(l),i=a(542),o=a(762);const s=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...s(e.children)):t.push(e)})),t},c=e=>e.filter((e=>(e.children&&(e.children=c(e.children)),!e.hidden&&!e.noAuth))),d=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...d(e.children))})),t},u=(e,t)=>e.map((e=>(e.children&&(e.children=u(e.children,t)),null==t||t(e),e))),p=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(e[r].children&&(a=p(e[r].children,t)),a)return a;if(e[r].dataIndex===t)return e[r]}return a},h=e=>{const t=e.children;return t?t[0].children?h(t[0]):t[0]:e},m=e=>{const t=e.children;return t?t[t.length-1].children?m(t[t.length-1]):t[t.length-1]:e},f=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),g=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(e[r].children&&(a=g(e[r].children,t)),a)return a;if(e[r].rowKey===t)return e[r]}return a},b=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...b(e.children))})),t},y=e=>{let t=1;const a=(e,r)=>{if(r&&(e.level=r.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((r=>{e.fixed?r.fixed=e.fixed:delete r.fixed,a(r,e),t+=r.colSpan})),e.colSpan=t}else e.colSpan=e.colSpan??1};e.forEach((e=>{e.level=1,a(e,null)}));const r=[];for(let e=0;e<t;e++)r.push([]);return d(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,r[e.level-1].push(e)})),r},v=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){const r=e.parentNode;if(a.top+=e.offsetTop,a.left+=e.offsetLeft,r&&r!==document.documentElement&&r!==document.body&&(a.top-=r.scrollTop,a.left-=r.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return v(e.offsetParent,t,a)}return a},x=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,E=(e,t)=>(0,r.transform)(e,((e,a,l)=>{(0,r.isEqual)(a,t[l])||(e[l]=(0,i.Kn)(a)&&(0,i.Kn)(t[l])?E(a,t[l]):a)})),C=(e,t)=>(0,r.intersection)(e,t).length===t.length,S=(e,t)=>(0,r.get)(e,t)??"",w=(e,t,a,l)=>{l>=0&&null!=a&&(a=Number(a).toFixed(l)),(0,r.set)(e,t,a??"")},T=(e,t)=>{if(!t.includes("|"))return S(e,t);const a=[];return t.split("|").forEach((t=>{t&&a.push(S(e,t))})),a.join(" | ")},N=e=>{const t=(e=e.toString()).split("."),a="-"===t[0].charAt(0)?"-":"";let r=a?t[0].slice(1):t[0],l="";for(;r.length>3;)l=`,${r.slice(-3)}${l}`,r=r.slice(0,r.length-3);return r&&(l=r+l),`${a}${l}${t[1]?`.${t[1]}`:""}`},I=(e,t)=>e?n()(e,t):null,_=(e,t)=>e?n()(e).format(t):"",R=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}));return e+t},P=e=>{const t=[];if((0,i.l$)(e)){const{children:a}=e.props;Array.isArray(a)?a.forEach((e=>t.push(...P(e)))):a&&t.push(...P(a))}else t.push(e);return t},O=e=>e.filter((e=>!e._group)),A=e=>{const t=[];return Object.keys(e).forEach((a=>{null!==e[a]&&t.push(`${a}|${e[a]}`)})),t.join(",")},k=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a="";if(Array.isArray(e)){let r=0;for(let l=0,n=e.length;l<n;l++){const n=e[l];if(!n.fieldName)continue;const i=Array.isArray(n.condition)?(0,o.A_)(n.condition):(0,o.Pz)(n.condition,"^");a+=`${n.bracketLeft} ${t?`${n.fieldName}|${n.fieldType}`:n.fieldName} ${n.expression} ${i} ${n.bracketRight} ${n.logic} `,r=n.logic.length}a=a.slice(0,-1*r-2)}else{const r=5;for(const r in e){const[l,n]=r.includes("|")?r.split("|"):[r,""],i=e[r];for(const e in i){const r=Array.isArray(i[e])?(0,o.A_)(i[e]):(0,o.Pz)(i[e],"^");"''"!==r&&"[]"!==r&&(a+=`${t?`${l}|${n}`:l} ${e} ${r} and `)}}a=a.slice(0,-1*r)}return a.replace(/\s+/g," ").trim()},H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const a=e=>{const a=[];return t.forEach((t=>a.push(S(e,t)))),a},r={};return e.forEach((e=>{const t=JSON.stringify(a(e));r[t]=r[t]||[],r[t].push(e)})),Object.keys(r).map((e=>r[e]))},F=(e,t)=>{for(let a=0;a<e.length;a++){if(e[a].rowKey===t)return[t];if(Array.isArray(e[a].children)){const r=F(e[a].children,t);if(r)return[e[a].rowKey,r].flat()}}},L=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(a=L(e[r].children,t)),a)return a;if(t(e[r]))return e[r]}return a},q=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&q(e.children,t),t(e)||e.children&&e.children.length)))},635:e=>{e.exports=require("dayjs")},517:e=>{e.exports=require("lodash-es")},787:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__787__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var a=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](a,a.exports,__webpack_require__),a.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Affix:()=>N.Affix,Alert:()=>N.Alert,Anchor:()=>N.Anchor,AutoComplete:()=>N.AutoComplete,Avatar:()=>N.Avatar,BackTop:()=>N.BackTop,Badge:()=>N.Badge,Breadcrumb:()=>N.Breadcrumb,Button:()=>N.Button,Calendar:()=>O,Card:()=>N.Card,Carousel:()=>N.Carousel,Cascader:()=>N.Cascader,Checkbox:()=>N.Checkbox,Col:()=>N.Col,Collapse:()=>N.Collapse,Comment:()=>N.Comment,ConfigProvider:()=>N.ConfigProvider,DatePicker:()=>H,Descriptions:()=>N.Descriptions,Divider:()=>N.Divider,Drawer:()=>N.Drawer,Dropdown:()=>N.Dropdown,Empty:()=>N.Empty,Form:()=>N.Form,Grid:()=>N.Grid,Image:()=>N.Image,Input:()=>N.Input,InputNumber:()=>N.InputNumber,Layout:()=>N.Layout,List:()=>N.List,Mentions:()=>N.Mentions,Menu:()=>N.Menu,Modal:()=>N.Modal,PageHeader:()=>N.PageHeader,Pagination:()=>N.Pagination,Popconfirm:()=>N.Popconfirm,Popover:()=>N.Popover,Progress:()=>N.Progress,QmAnchor:()=>gt,QmButton:()=>J,QmCollapse:()=>Ee,QmConfigProvider:()=>B,QmCopyToClipboard:()=>Ho,QmCountup:()=>Be,QmCropper:()=>wn,QmDivider:()=>pe,QmDownload:()=>nt,QmDrawer:()=>Nt,QmEmpty:()=>Ze,QmForm:()=>Zl,QmModal:()=>At,QmPrint:()=>ws,QmRangeTableHelper:()=>os,QmSearchHelper:()=>Go,QmSearchTree:()=>Bn,QmSpace:()=>ne,QmSpin:()=>Qe,QmSplit:()=>Me,QmTable:()=>zo,QmTabs:()=>Ct,QmTinymce:()=>vn,QmTreeHelper:()=>as,QmTreeTableHelper:()=>es,QmUploadFile:()=>_n,QmUploadImg:()=>Fn,Radio:()=>N.Radio,Rate:()=>N.Rate,Result:()=>N.Result,Row:()=>N.Row,Select:()=>N.Select,Skeleton:()=>N.Skeleton,Slider:()=>N.Slider,Space:()=>N.Space,Spin:()=>N.Spin,Statistic:()=>N.Statistic,Steps:()=>N.Steps,Switch:()=>N.Switch,Tabs:()=>N.Tabs,Tag:()=>N.Tag,TimePicker:()=>D,Timeline:()=>N.Timeline,Tooltip:()=>N.Tooltip,Transfer:()=>N.Transfer,Tree:()=>N.Tree,TreeSelect:()=>N.TreeSelect,Typography:()=>N.Typography,Upload:()=>N.Upload,message:()=>N.message,notification:()=>N.notification,pinyin:()=>Xr,version:()=>Ts});var e=__webpack_require__(787),t=__webpack_require__.n(e);const a=require("prop-types");var r=__webpack_require__.n(a);const l=(0,e.createContext)({locale:"zh-cn",size:"middle"});var n=__webpack_require__(635),i=__webpack_require__.n(n);const o={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?"},divider:{collect:"收起",spread:"展开"},dialog:{fullScreen:"全屏",cancelFullScreen:"取消全屏",close:"关 闭",confirm:"确 定",cancel:"取 消"},form:{search:"搜 索",reset:"重 置",save:"保 存",spread:"展开",collect:"收起",trueText:"是",falseText:"否",draggable:"拖动排序",requiredTips:"不能为空",searchHelperTips:"搜索帮助正在加载值",inputPlaceholder:"请输入...",selectPlaceholder:"请选择...",treePlaceholder:"树节点过滤",rangeInputNumberPlaceholder:["开始值","结束值"],rangeSearchHelper:["起始位置","结束位置"],datePlaceholder:"选择日期",timePlaceholder:"选择时间",weekPlaceholder:"选择周",monthPlaceholder:"选择月",quarterPlaceholder:"选择季度",yearPlaceholder:"选择年",daterangePlaceholder:["开始日期","结束日期"],timerangePlaceholder:["开始时间","结束时间"],monthrangePlaceholder:["开始月份","结束月份"],yearrangePlaceholder:["开始年份","结束年份"],datePickers:["今天","昨天","一周前","一个月前"],dateRangePickers:["最近一周","最近一个月","最近三个月","最近六个月"],citySelectType:["按省份","按城市"],regionSelectLabel:["省","市","区","街道"],validatePrompt:"表单校验提示"},clipboard:{success:"复制成功",error:"复制失败"},download:{text:"下载",success:"文件下载成功",error:"文件下载失败!"},upload:{tooltip:"只能上传 {type} 格式",notType:"不支持的文件类型 {type}",sizeLimit:"大小不能超过 {size}M",uploadError:"文件上传失败!",downError:"文件下载失败!",text:"点击上传"},uploadCropper:{dragableText:"拖放或点击",tooltip:"只能上传 {type} 格式的图片",preview:"图片预览",cropper:"图片裁剪",uploadError:"图片上传失败!",downError:"图片下载失败!",text:"上传图片",zoomIn:"放大",zoomOut:"缩小",rotatePlus:"顺时针",rotateSubtract:"逆时针"},print:{preview:"打印预览",pageSetting:"页面设置",printError:"打印失败!",exportError:"导出失败!",defaultPrinter:"默认打印机",laserPrinter:"激光打印机",stylusPrinter:"针式打印机",printer:"打印机",type:"类型",copies:"份数",printPage:["打印第","几页"],setting:"设置",export:"导出",print:"打印",scale:"缩放",paper:"纸张",pageNumber:"页码",pagination:"第{currentPage}页 / 共{totalPage}页",setPanel:{printParameter:"打印参数",pagerType:"纸张类型",carbonPaper:"三联复写纸(针式)",printDirection:"打印方向",vertical:"纵向",horizontal:"横向",doublePrint:"双面打印",autoDoublePrint:"自动双面打印",manualDoublePrint:"手动双面打印",fixedLogo:"固定Logo",printMargin:"打印边距",leftMargin:"左边距",rightMargin:"右边距",topMargin:"上边距",bottomMargin:"下边距",sizeUnit:"厘米",noEmpty:"不能为空"}},split:{resize:"拖动改变大小"},searchHelper:{text:"搜索帮助",orderIndex:"序号",rangeStartTip:"起始位置不能大于结束位置",rangeEndTip:"结束位置不能小于起始位置"},table:{config:{selectionText:"选择",summaryText:"合计",copyText:"复制",emptyText:"暂无数据..."},alert:{total:"共 {total} 条",selected:"已选择 {total} 项",clear:"清空"},selection:{all:"全选所有",invert:"反选所有",clear:"清空所有",currentPage:"当前页全选"},columnFilter:{text:"列定义",reset:"重置",draggable:"拖动排序",fixedLeft:"固定左侧",fixedRight:"固定右侧",cancelFixed:"取消固定"},editable:{inputPlaceholder:"请输入",selectPlaceholder:"请选择",datePlaceholder:"选择日期",datetimePlaceholder:"选择时间"},sorter:{text:"排序",asc:"升序",desc:"降序"},filter:{search:"搜 索",reset:"重 置",searchText:"搜索{text}",searchAreaText:"搜索{text},用逗号隔开",gtPlaceholder:"大于",ltPlaceholder:"小于",eqPlaceholder:"等于",neqPlaceholder:"不等于",text:"筛选"},screen:{full:"全屏",cancelFull:"取消全屏"},import:{text:"导 入",textNoSpace:"导入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",textNoSpace:"导出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式",warnText:"暂无表格数据或正在导出"},clipboard:{text:"粘 贴",textNoSpace:"粘贴",success:"成功粘贴 {total} 条记录",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},mergeCell:{cancel:"恢复",confirm:"合并"},print:{text:"打印"},refresh:{text:"刷新"},toolbox:{text:"工具箱"},selectCollection:{text:"行选集合",settingTitle:"行选列表",closeButton:"关 闭"},groupSummary:{text:"汇总",settingTitle:"汇总设置",savedSetting:"保存的汇总设置",saveButton:"保 存",closeButton:"关 闭",confirmButton:"显示汇总",removeText:"移除",configText:"配置名称",resultText:"汇总结果",sumText:"列值汇总",maxText:"列最大值",minText:"列最小值",avgText:"列平均值",countText:"条数汇总",operation:"操作",index:"序号",groupItem:"分组项",summaryColumn:"汇总列",calcFormula:"计算公式"},highSearch:{text:"高级检索",settingTitle:"高级检索设置",searchButton:"开始检索",closeButton:"关 闭",removeText:"移除",andText:"并且",orText:"或者",gtText:"大于",ltText:"小于",gteText:"大于等于",lteText:"小于等于",eqText:"等于",neqText:"不等于",inText:"包含",ninText:"不包含",likeText:"模糊匹配",configText:"配置名称",saveButton:"保 存",savedSetting:"保存的高级检索设置",operation:"操作",bracket:"括号",fieldName:"字段名",fieldType:"字段类型",expression:"运算",condition:"条件值",logic:"逻辑",noEmpty:"字段名不能为空"},fastSearch:{text:"数据定位查找",settingTitle:"数据定位查找设置",closeButton:"关 闭",savedSetting:"保存的数据查找设置",queryCondition:"请输入查询条件",notMatch:"没有符合条件的记录!",toTheEnd:"已查找到表格末尾,是否从头开始查找?",toStart:"已查找到表格开始,是否从末尾开始查找",tabPanes:["查找条件","更多条件"],matchCase:"大小写匹配",matchFullchar:"全字符匹配",clear:"清空条件",queryPrev:"查找上一个",queryNext:"查找下一个"}}}};require("dayjs/locale/zh-cn");let s=o;function c(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,a)=>t[a])):e}const d=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];const[r,l]=t;let n;const i=r.split(".");let o=s;for(let e=0,t=i.length;e<t;e++){if(n=o[i[e]],e===t-1)return c(n,l);if(!n)return"";o=n}return""},u=e=>{s=e||s,s.name&&i().locale(s.name)};class p extends Error{constructor(e){super(e),this.name="QmDesignError"}}function h(e,t){throw new p(`[${e}] ${t}`)}function m(e,t){console.warn(new p(`[${e}] ${t}`))}const f=e=>["","small","middle","large"].includes(e),g=require("dayjs/plugin/localeData");var b=__webpack_require__.n(g);const y=require("dayjs/plugin/advancedFormat");var v=__webpack_require__.n(y);const x=require("dayjs/plugin/customParseFormat");var E=__webpack_require__.n(x);const C=require("dayjs/plugin/quarterOfYear");var S=__webpack_require__.n(C);const w=require("dayjs/plugin/weekOfYear");var T=__webpack_require__.n(w);i().extend(b()),i().extend(v()),i().extend(E()),i().extend(S()),i().extend(T());const N=require("antd"),I=require("rc-picker/es/generate/dayjs");var _=__webpack_require__.n(I);const R=require("antd/es/calendar/generateCalendar");var P=__webpack_require__.n(R);require("antd/es/calendar/style");const O=P()(_()),A=require("antd/es/date-picker/generatePicker");var k=__webpack_require__.n(A);require("antd/es/date-picker/style/index");const H=k()(_());function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},F.apply(this,arguments)}const L=e.forwardRef(((t,a)=>e.createElement(H,F({},t,{picker:"time",mode:void 0,ref:a}))));L.displayName="TimePicker";const q=e.forwardRef(((t,a)=>e.createElement(H.RangePicker,F({},t,{picker:"time",mode:void 0,ref:a}))));q.displayName="RangePicker",L.RangePicker=q;const D=L,$={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?"},divider:{collect:"Collapse",spread:"Expand"},dialog:{fullScreen:"Full Screen",cancelFullScreen:"Cancel Full Screen",close:"Close",confirm:"Confirm",cancel:"Cancel"},form:{search:"Search",reset:"Reset",save:"Save",spread:"Expand",collect:"Collapse",trueText:"Yes",falseText:"No",draggable:"Drag and sort",requiredTips:" is required",searchHelperTips:"Search Helper is loading value",inputPlaceholder:"Please enter...",selectPlaceholder:"Please select...",treePlaceholder:"Tree node filter",rangeInputNumberPlaceholder:["Start value","End value"],rangeSearchHelper:["Start","End"],datePlaceholder:"Select date",timePlaceholder:"Select time",weekPlaceholder:"Select week",monthPlaceholder:"Select month",quarterPlaceholder:"Select quarter",yearPlaceholder:"Select year",daterangePlaceholder:["Start date","End date"],timerangePlaceholder:["Start time","End time"],monthrangePlaceholder:["Start month","End month"],yearrangePlaceholder:["Start year","End year"],datePickers:["Today","Yesterday","A Week Ago","A Month Ago"],dateRangePickers:["Nearly A Week","Nearly A Month","Nearly Three Months","Nearly Six Months"],citySelectType:["Province","City"],regionSelectLabel:["Province","City","Region","Street"],validatePrompt:"Form validation tips"},clipboard:{success:"Copy successful",error:"Copy failed"},download:{text:"Download",success:"File downloaded successfully",error:"File download failed!"},upload:{tooltip:"Can only upload {type} format",notType:"Unsupported file types {type}",sizeLimit:"Size cannot exceed {size}M",uploadError:"Failed to upload files!",downError:"File download failed!",text:"click and upload"},uploadCropper:{dragableText:"Drop or click",tooltip:"Can only upload {type} format",preview:"Preview image",cropper:"Cropper image",uploadError:"Failed to upload images!",downError:"Image download failed!",text:"Upload image",zoomIn:"Zoom in",zoomOut:"Zoom out",rotatePlus:"Rotate plus",rotateSubtract:"Rotate subtract"},print:{preview:"Print preview",pageSetting:"Page setting",printError:"Print failed!",exportError:"Export failed!",defaultPrinter:"Default printer",laserPrinter:"Laser printer",stylusPrinter:"Stylus printer",printer:"Printer",type:"Type",copies:"Copies",printPage:["Print","page"],setting:"Setting",export:"Export",print:"Print",scale:"Scale",paper:"Paper",pageNumber:"Number",pagination:"{currentPage} / {totalPage} page",setPanel:{printParameter:"Print parameter",pagerType:"Pager type",carbonPaper:"Triple carbon paper(stylus)",printDirection:"Print direction",vertical:"Vertical",horizontal:"Horizontal",doublePrint:"Double print",autoDoublePrint:"Auto double print",manualDoublePrint:"Manual double print",fixedLogo:"Fixed Logo",printMargin:"Print margin",leftMargin:"Left margin",rightMargin:"Light margin",topMargin:"Top margin",bottomMargin:"Bottom margin",sizeUnit:"cm",noEmpty:"Can not be empty"}},split:{resize:"Drag to change size"},searchHelper:{text:"Search helper",orderIndex:"Index",rangeStartTip:"Start position cannot be greater than end position",rangeEndTip:"End position cannot be less than start position"},table:{config:{selectionText:"#",summaryText:"Summation",copyText:"Copy",emptyText:"No Data..."},alert:{total:"Total {total} items",selected:"Selected {total}",clear:"Clear"},selection:{all:"Select all",invert:"Invert select",clear:"Clear all",currentPage:"Select all on current page"},columnFilter:{text:"Define",reset:"Reset",draggable:"Drag and sort",fixedLeft:"Fixed left",fixedRight:"Fixed right",cancelFixed:"Cancel fixed"},editable:{inputPlaceholder:"Please input",selectPlaceholder:"Please select",datePlaceholder:"Select date",datetimePlaceholder:"Select time"},sorter:{text:"Sort",asc:"Ascending",desc:"Descending"},filter:{search:"Search",reset:"Reset",searchText:"Search {text}",searchAreaText:"Search {text}, separated by commas",gtPlaceholder:"is greater than",ltPlaceholder:"is lesser than",eqPlaceholder:"is equal to",neqPlaceholder:"is not equal to",text:"Filter"},screen:{full:"Full Screen",cancelFull:"Cancel Full Screen"},import:{text:"Import",textNoSpace:"Import",success:"Successfully imported {total} records",error:"Import failed, please check that the field name and data format are correct.",settingTitle:"Import setting",importType:"Import type",insertPos:"Insertion position",fillText:"fill",addText:"add",insertText:"insert"},export:{text:"Export",textNoSpace:"Export",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style",warnText:"No table data or exporting"},clipboard:{text:"Paste",textNoSpace:"Paste",success:"Successfully paste {total} records",settingTitle:"Paste setting",rowIndex:"Start row index",colIndex:"Start col index",content:"content",placeholder:"Please paste data here with ctrl+v",supportText:"Note: only excel data can be pasted"},mergeCell:{cancel:"reset",confirm:"merge"},print:{text:"Print"},refresh:{text:"Reload"},toolbox:{text:"Tool box"},selectCollection:{text:"Selected row collection",settingTitle:"Selected row list",closeButton:"Close"},groupSummary:{text:"Summary",settingTitle:"Summary setting",savedSetting:"Saved configuration",saveButton:"Save",closeButton:"Close",confirmButton:"Show summary",removeText:"Remove",configText:"Configuration name",resultText:"Summary result",sumText:"column value summary",maxText:"column max value",minText:"column min value",avgText:"column avg value",countText:"records summary",operation:"Operation",index:"Index",groupItem:"Group item",summaryColumn:"Summary column",calcFormula:"Calculate formula"},highSearch:{text:"Super search",settingTitle:"Super search setting",searchButton:"Start search",closeButton:"Close",removeText:"Remove",andText:"and",orText:"or",gtText:"is greater than",ltText:"is lesser than",gteText:"is equal or greater than",lteText:"is equal or lesser than",eqText:"is equal to",neqText:"is not equal to",inText:"include",ninText:"not include",likeText:"fuzzy matching",configText:"Configuration name",saveButton:"Save",savedSetting:"Saved configuration",operation:"Operation",bracket:"Bracket",fieldName:"Field name",fieldType:"Field type",expression:"Expression",condition:"Condition value",logic:"Logic",noEmpty:"Can not be empty"},fastSearch:{text:"Records location search",settingTitle:"Records location search setting",closeButton:"Close",savedSetting:"Saved configuration",queryCondition:"Please enter query condition",notMatch:"There are no qualified records!",toTheEnd:"It has been found to the end. Do you want to find it from the beginning?",toStart:"The start has been found. Do you want to start from the end?",tabPanes:["Search condition","More conditions"],matchCase:"Case matching",matchFullchar:"Full character matching",clear:"Clear condition",queryPrev:"Find previous",queryNext:"Find next"}}}},M=require("antd/lib/locale/zh_CN");var K=__webpack_require__.n(M);const V=require("antd/lib/locale/en_GB");function U(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const j={[$.name]:{qm:$,antd:__webpack_require__.n(V)()},[o.name]:{qm:o,antd:K()}};class z extends e.Component{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},u(j[e.locale].qm)}static getDerivedStateFromProps(e,t){const{locale:a,size:r}=t.value,{locale:l,size:n}=e;return l!==a&&u(j[l].qm),l!==a||n!==r?{value:Object.assign({},t.value,{locale:l,size:n})}:null}render(){const{global:e}=this.props,{value:a}=this.state;return t().createElement(l.Provider,{value:a},t().createElement(N.ConfigProvider,{locale:j[a.locale].antd,componentSize:a.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}U(z,"propTypes",{locale:r().string,size:(e,t,a)=>{if(!f(e[t]||""))return h("Divider","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},theme:r().string,global:r().object}),U(z,"defaultProps",{locale:"zh-cn",size:"middle",global:{}});const B=z,W=require("omit.js");var G=__webpack_require__.n(W),Y=__webpack_require__(542);function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Z.apply(this,arguments)}function X(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Q extends e.Component{constructor(){super(...arguments),X(this,"state",{isLoading:!1}),X(this,"clickHandle",(async()=>{this.setState({isLoading:!0});try{var e,t;await(null===(e=(t=this.props).click)||void 0===e?void 0:e.call(t))}catch(e){m("Button","`click`方法执行出错")}this.setState({isLoading:!1})}))}render(){const{size:e,loading:a,authConfig:r,click:l,confirm:n}=this.props,{isLoading:i}=this.state,o=e||this.context.size||"",s=(0,Y.mf)(l)?{onClick:this.clickHandle}:null,c={...G()(this.props,["authConfig","click","confirm"]),size:o,loading:i||a||!1,...s};if(r){const{visible:e=1,disabled:t}=r||{};if(!e)return null;t&&(c.disabled=!0)}return n?t().createElement(N.Popconfirm,{title:n.title||d("qm.button.confirmTitle"),disabled:c.disabled,onConfirm:e=>{var t,a;null===(t=n.onConfirm)||void 0===t||t.call(n),null===(a=c.onClick)||void 0===a||a.call(c,e)},onCancel:e=>{var t;null===(t=n.onCancel)||void 0===t||t.call(n,e)}},t().createElement(N.Button,Z({},c,{onClick:Y.ZT}),this.props.children)):t().createElement(N.Button,c,this.props.children)}}X(Q,"propTypes",{click:r().func,confirm:r().shape({title:r().node,onConfirm:r().func,onCancel:r().func})}),X(Q,"contextType",l);const J=Q;var ee,te,ae,re;!function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(ee||(ee={}));class le extends e.Component{render(){const{size:e}=this.props,a=e||this.context.size||"",r=(0,Y.hj)(e)?e:ee[e||a||"default"],l={...this.props,size:r};return t().createElement(N.Space,l,this.props.children)}}re=l,(ae="contextType")in(te=le)?Object.defineProperty(te,ae,{value:re,enumerable:!0,configurable:!0,writable:!0}):te[ae]=re;const ne=le,ie=require("classnames");var oe=__webpack_require__.n(ie);const se=e=>`qm-${e}`,ce=require("@ant-design/icons");function de(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ue extends e.Component{constructor(){super(...arguments),de(this,"clickHandle",(()=>{const{collapse:e,onCollapseChange:t=Y.ZT}=this.props;t(!e)}))}render(){const{size:e,label:a,extra:r,collapse:l,disabled:n,className:i,style:o,id:s}=this.props,c=e||this.context.size||"",u=se("divider"),p={[u]:!0,[`${u}--lg`]:"large"===c,[`${u}--sm`]:"small"===c};return t().createElement("div",{id:s,className:oe()(p,i),style:o},t().createElement("span",{className:oe()(`${u}__title`)},a),t().createElement("div",{className:oe()(`${u}__extra`)},r),void 0!==l&&t().createElement(N.Button,{type:"link",className:oe()(`${u}__collapse`),disabled:n,onClick:this.clickHandle},d(l?"qm.divider.collect":"qm.divider.spread"),l?t().createElement(ce.UpOutlined,null):t().createElement(ce.DownOutlined,null)))}}de(ue,"propTypes",{label:r().string,size:(e,t,a)=>{if(!f(e[t]||""))return h("Divider","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},extra:r().oneOfType([r().element,r().string]),collapse:r().bool}),de(ue,"contextType",l);const pe=ue,he=()=>({height:0,opacity:0}),me=(e,t)=>"height"===t.propertyName,fe={motionName:"rc-collapse-motion",onEnterStart:he,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:he,onEnterEnd:me,onLeaveEnd:me,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"},ge=require("rc-motion");var be=__webpack_require__.n(ge);const ye=t().forwardRef(((e,a)=>{const{forceRender:r,className:l,style:n,boxStyle:i,isActive:o}=e,[s,c]=t().useState(o||r);if(t().useEffect((()=>{(r||o)&&c(!0)}),[r,o]),!s)return null;const d=se("collapse");return t().createElement("div",{ref:a,className:oe()(`${d}-content`,{[`${d}-content-active`]:o,[`${d}-content-inactive`]:!o},l),style:n},t().createElement("div",{className:`${d}-content-box`,style:i},e.children))}));ye.displayName="PanelContent";const ve=ye;function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},xe.apply(this,arguments)}const Ee=e=>{const{defaultActive:a,label:r,extra:l,className:n,style:i,containerStyle:o,disabled:s,forceRender:c,destroyOnClose:d=!1,onChange:u}=e,[p,h]=t().useState(!!a),m=se("collapse"),f=oe()({[`${m}`]:!0,[`${m}-active`]:p,[`${m}-disabled`]:s},n);return t().createElement("div",{className:f,style:i},t().createElement(pe,{label:r,extra:l,collapse:p,disabled:s,onCollapseChange:e=>{h(e),null==u||u(e)}}),t().createElement(be(),xe({visible:p},fe,{leavedClassName:`${m}-content-hidden`,forceRender:c,removeOnLeave:d}),((a,r)=>{let{className:l,style:n}=a;return t().createElement(ve,{ref:r,prefixCls:m,className:l,style:n,boxStyle:o,isActive:p,forceRender:c},e.children)})))},Ce=t().createContext(void 0);function Se(t,a){const r=e.useRef(!1);e.useEffect((()=>{r.current?t():r.current=!0}),a)}const we=require("react-draggable");var Te=__webpack_require__.n(we),Ne=__webpack_require__(386);const Ie=(e,t,a)=>{e&&t&&a&&e.addEventListener(t,a,!1)},_e=(e,t,a)=>{e&&t&&a&&e.removeEventListener(t,a,!1)},Re=e=>e.stopPropagation(),Pe=e=>e.preventDefault(),Oe=(e,t,a)=>{!Ne.Z&&e&&t&&((0,Y.Kn)(t)?Object.keys(t).forEach((a=>{Oe(e,a,t[a])})):(t=(0,Y._A)(t),e.style[t]=a))},Ae=e=>{let t=0,a=e;for(;a;)t+=a.offsetTop,a=a.offsetParent;return t},ke=(e,t)=>{let a=e;for(;a;){var r;if(null!==(r=a.classList)&&void 0!==r&&r.contains(t))return a;a=a.parentNode}return null},He=e=>{const{minValues:a,onDragChange:r,onDragging:l}=e,{splitRef:n,direction:i}=t().useContext(Ce),[o,s]=t().useState(),[c,u]=t().useState(0),p="vertical"===i?"y":"x",h={[`${se("split")}__resize-bar`]:!0,vertical:"vertical"===i,horizontal:"horizontal"===i};return t().createElement(Te(),{bounds:o,axis:p,position:{x:0,y:0},positionOffset:{[p]:-1*c},onStart:()=>{r(!0),(()=>{const e=n.current.children[0];if(!e)return;const t=(()=>{const{w:e,h:t}={w:n.current.offsetWidth,h:n.current.offsetHeight};return[a[0],("vertical"===i?t:e)-a[1]]})(),r=e.offsetWidth,l=e.offsetHeight;s({left:t[0]-r,right:t[1]-r,top:t[0]-l,bottom:t[1]-l})})()},onDrag:(e,t)=>{u(t[p]),l(t[p])},onStop:()=>r(!1)},t().createElement("div",{className:oe()(h),title:d("qm.split.resize")}))};He.displayName="ResizeBar";const Fe=He,Le=t().forwardRef(((e,a)=>{const{offset:r,className:l,style:n}=e,{direction:i,dragging:o}=t().useContext(Ce),s="vertical"===i?"height":"width",c={[se("split-pane")]:!0,isLocked:o,horizontal:"horizontal"===i,vertical:"vertical"===i,[l]:!!l},d=void 0!==r?{[s]:(0,Y.PM)(r)}:{flex:1,[s]:0};return t().createElement("div",{ref:a,className:oe()(c),style:{...d,...n}},e.children)}));Le.displayName="QmSplitPane";const qe=Le;function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},De.apply(this,arguments)}const $e=e=>{const{direction:a="horizontal",defaultValue:r="50%",uniqueKey:n,className:i,style:o,onDragStart:s,onDrag:c=Y.ZT,onDragEnd:d}=e,{global:u}=t().useContext(l),p=t().useRef(null),h=t().useRef(null),m=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,f=e=>Number.parseInt(e,10),g=e=>{var t;const a=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return a>=0?a:0},b=t().useMemo((()=>n?`split_${n}`:""),[n]),[y,v]=t().useState(!1),[x,E]=t().useState(m(r)),C=t().useRef(0);Se((()=>{y?(C.current="vertical"===a?h.current.offsetHeight:h.current.offsetWidth,null==s||s(f(x))):(null==d||d(f(x)),localStorage.setItem(b,x),T(b,x))}),[y]),t().useEffect((()=>{S()}),[]);const S=()=>{if(!b)return;const e=localStorage.getItem(b);e?E(m(e)):w(b).then((e=>{localStorage.setItem(b,m(e||r)),S()})).catch((()=>{}))},w=async e=>{const t=null==u?void 0:u.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}},T=async(e,t)=>{const a=null==u?void 0:u.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}},N=t().useMemo((()=>({splitRef:p,direction:a,dragging:y})),[a,y]),I=[];t().Children.map(e.children,(e=>{var t;(0,Y.l$)(e)&&!(0,Y.M2)(e)&&"QmSplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&I.push(e)}));const[_,R]=I,P=t().useMemo((()=>[g(_),g(R)]),[_,R]),O={[se("split")]:!0,vertical:"vertical"===a};return t().createElement(Ce.Provider,{value:N},t().createElement("div",{ref:p,className:oe()(O,i),style:o},t().createElement(qe,De({},_.props,{ref:h,offset:x})),t().createElement(Fe,{minValues:P,onDragChange:e=>v(e),onDragging:e=>{const t=C.current+e;E(`${t}px`),c(t)}}),t().createElement(qe,R.props)))};$e.Pane=qe,$e.displayName="QmSplit";const Me=$e,Ke=require("react-countup");var Ve=__webpack_require__.n(Ke);function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ue.apply(this,arguments)}function je(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ze extends e.Component{render(){const{size:e,className:a,style:r}=this.props,l=e||this.context.size||"",n=se("countup"),i={[n]:!0,[`${n}--lg`]:"large"===l,[`${n}--sm`]:"small"===l};return t().createElement(Ve(),Ue({},this.props,{className:oe()(i,a),style:r}),this.props.children)}}je(ze,"defaultProps",{duration:2}),je(ze,"contextType",l);const Be=ze;function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},We.apply(this,arguments)}function Ge(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Ye extends e.Component{render(){const{size:e,className:a}=this.props,r=e||this.context.size||"",l=se("empty"),n={...this.props,image:N.Empty.PRESENTED_IMAGE_SIMPLE},i={[l]:!0,[`${l}--lg`]:"large"===r,[`${l}--sm`]:"small"===r};return t().createElement(N.Empty,We({},n,{className:oe()(i,a)}))}}Ge(Ye,"contextType",l),Ge(Ye,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Anchor","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")}});const Ze=Ye;class Xe extends e.Component{render(){const{fullHeight:e,style:a={}}=this.props,r={[`${se("spin")}-full-height`]:e},l={wrapperClassName:oe()(r),...G()(this.props,["fullHeight"]),style:{...a,maxHeight:"none"}};return t().createElement(N.Spin,l,this.props.children)}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Xe,"defaultProps",{tip:"Loading...",fullHeight:!1});const Qe=Xe,Je=require("axios");var et=__webpack_require__.n(Je);const tt=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const a=window.URL.createObjectURL(e);let r=document.createElement("a");r.href=a,r.download=decodeURI(t),r.click(),r=null}};function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},at.apply(this,arguments)}function rt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class lt extends e.Component{constructor(){super(...arguments),rt(this,"state",{loading:!1}),rt(this,"downloadHandle",(async()=>{this.setState({loading:!0});try{var e,t;const{action:a,beforeDownload:r=Y.XT}=this.props,l=(0,Y.HD)(a)?a:await this.getActionUrl();if(!l)return m("Download","参数 `action` 有误!");if(!r(l))return;await this.downloadFile(l),await(0,Y._v)(100),null===(e=(t=this.props).onSuccess)||void 0===e||e.call(t),N.message.success(d("qm.download.success"))}catch(e){var a,r;null===(a=(r=this.props).onError)||void 0===a||a.call(r,e),N.message.error(d("qm.download.error"))}this.setState({loading:!1})}))}async getActionUrl(){const e=this.props.action;if(e.api)try{const t=await e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}async downloadFile(e){const{fileName:t,headers:a,params:r,withCredentials:l}=this.props,n=await et()({url:e,params:r,headers:a,withCredentials:l,responseType:"blob"}),i=n.data,o=n.headers["content-disposition"],s=t||(o?o.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));tt(i,s)}render(){const{size:e}=this.props,{loading:a}=this.state,r=e||this.context.size||"",l=G()(this.props,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return t().createElement(N.Button,at({},l,{size:r,loading:a,onClick:this.downloadHandle}),this.props.children)}}rt(lt,"propTypes",{action:r().oneOfType([r().string,r().shape({api:r().func.isRequired,params:r().object})]),size:(e,t,a)=>{if(!f(e[t]||""))return h("Anchor","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},fileName:r().string,headers:r().object,withCredentials:r().bool,params:r().object,beforeDownload:r().func,onSuccess:r().func,onError:r().func}),rt(lt,"defaultProps",{icon:t().createElement(ce.DownloadOutlined,null),children:d("qm.download.text"),withCredentials:!1}),rt(lt,"contextType",l);const nt=lt,it=require("add-dom-event-listener");var ot=__webpack_require__.n(it);const st=require("scroll-into-view-if-needed");var ct=__webpack_require__.n(st);class dt extends e.Component{renderLabel(){const{activeKey:e,labels:a,onTabClick:r}=this.props;return a.map(((a,l)=>{const n={item:!0,actived:l===e};return t().createElement("div",{key:l,className:oe()(n),onClick:e=>r(l,e)},t().createElement("span",null,a))}))}render(){return t().createElement(t().Fragment,null,this.renderLabel())}}const ut=dt;class pt extends e.Component{render(){const{label:e,showDivider:a,className:r,style:l}=this.props,n={[se("anchor-item")]:!0};return t().createElement("div",{className:oe()(n,r),style:l},a&&t().createElement(pe,{label:e,style:{marginBottom:10}}),this.props.children)}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(pt,"displayName","QmAnchorItem");const ht=pt;function mt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ft extends e.Component{constructor(){super(...arguments),mt(this,"currentState","ready"),mt(this,"itemsTotal",void 0),mt(this,"timer",void 0),mt(this,"scrollEvent",void 0),mt(this,"scrollRef",(0,e.createRef)()),mt(this,"state",{activeKey:0}),mt(this,"onScrollHandle",(e=>{if("ready"!==this.currentState)return;const t=this.findCurrentIndex(e.target.scrollTop);-1!==t&&this.setState({activeKey:t})})),mt(this,"onTabClickHandle",(e=>{const{labelList:t=[]}=this.props,a=this.__is_conf?document.getElementById(t[e].id):this.scrollRef.current.children[e];a&&(this.setState({activeKey:e}),this.currentState="stop",this.timer&&clearTimeout(this.timer),ct()(a,{block:"start",behavior:"smooth",boundary:this.scrollRef.current}),this.timer=setTimeout((()=>this.currentState="ready"),500))})),mt(this,"SCROLL_TO_ITEM",(e=>{e=(e=e<0?0:e)>this.itemsTotal?this.itemsTotal:e,this.onTabClickHandle(e)}))}get __is_conf(){var e;return!(null===(e=this.props.labelList)||void 0===e||!e.length)}componentDidMount(){this.scrollEvent=ot()(this.scrollRef.current,"scroll",(0,Y.P2)(this.onScrollHandle,60))}componentWillUnmount(){this.scrollEvent.remove()}createDistances(){var e;const{labelList:t=[]}=this.props;return(this.__is_conf?t.map((e=>document.getElementById(e.id))):Array.from((null===(e=this.scrollRef.current)||void 0===e?void 0:e.children)||[])).map((e=>((e,t)=>Math.abs(Ae(e)-Ae(t)))(e,this.scrollRef.current)))}findCurrentIndex(e){const t=Math.abs(e),a=this.createDistances();let r=-1;for(let e=0;e<a.length;e++){const l=a[e],n=a[e+1]||1e4;t>=l-1&&t<n&&(r=e)}return r}render(){const{activeKey:e}=this.state,{size:a,labelWidth:r,tabPosition:l,labelList:n=[],className:i,style:o}=this.props,s=a||this.context.size||"",c=se("anchor"),d={[c]:!0,[`${c}-left`]:"left"===l,[`${c}-top`]:"top"===l,[`${c}--lg`]:"large"===s,[`${c}--sm`]:"small"===s},u=[];t().Children.map(this.props.children,(e=>{var t;(0,Y.l$)(e)&&!(0,Y.M2)(e)&&"QmAnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&u.push(e)}));const p=this.__is_conf?n.map((e=>e.label)):u.map((e=>e.props.label));return this.itemsTotal=p.length,t().createElement("div",{className:oe()(d,i),style:o},t().createElement("div",{className:oe()("anchor-nav"),style:{width:r?(0,Y.PM)(r):""}},t().createElement(ut,{activeKey:e,labels:p,onTabClick:this.onTabClickHandle})),t().createElement("div",{ref:this.scrollRef,className:oe()("anchor-container")},this.__is_conf?this.props.children:u))}}mt(ft,"Item",ht),mt(ft,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Anchor","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},labelWidth:(e,t,a)=>{if("number"!=typeof(r=e[t])&&void 0!==r&&!["px","rem","em","vw","vh","%"].some((e=>r.endsWith(e)))&&!r.startsWith("calc"))return h("Anchor","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.");var r},labelList:r().arrayOf(r().shape({id:r().string,label:r().string}))}),mt(ft,"defaultProps",{tabPosition:"left"}),mt(ft,"contextType",l);const gt=ft;class bt extends e.Component{render(){return t().createElement(N.Tabs.TabPane,this.props,this.props.children)}}const yt=bt;function vt(){return vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},vt.apply(this,arguments)}function xt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Et extends e.Component{render(){const{size:e,className:a}=this.props,r=e||this.context.size||"",l=se("tabs"),n={[l]:!0,[`${l}--lg`]:"large"===r,[`${l}--sm`]:"small"===r};return t().createElement(N.Tabs,vt({},this.props,{className:oe()(n,a)}),this.props.children)}}xt(Et,"TabPane",yt),xt(Et,"contextType",l),xt(Et,"defaultProps",{tabBarGutter:10});const Ct=Et;function St(){return St=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},St.apply(this,arguments)}function wt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Tt extends e.Component{constructor(){super(...arguments),wt(this,"titleRef",t().createRef()),wt(this,"$drawer",null),wt(this,"opened",!1),wt(this,"state",{fullscreen:!1,spinning:!1,sloading:!1}),wt(this,"afterVisibleChange",(e=>{const{loading:t}=this.props;var a,r;e?(this.opened=!0,(0,Y.o8)(t)&&setTimeout((()=>this.setState({spinning:!1})),100)):(null===(a=(r=this.props).onClosed)||void 0===a||a.call(r),this.setState({fullscreen:!1}))})),wt(this,"toggleHandle",(()=>{this.$drawer=ke(this.titleRef.current,"ant-drawer-content-wrapper"),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(e=(t=this.props).onFullChange)||void 0===e||e.call(t,this.state.fullscreen)}))})),wt(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),wt(this,"STOP_LOADING",(()=>{this.setState({sloading:!1})}))}componentWillUnmount(){this.$drawer=null}componentDidUpdate(e,t){const{visible:a,loading:r,destroyOnClose:l}=this.props,{fullscreen:n}=this.state;a&&a!==e.visible&&(!l&&this.opened||(0,Y.o8)(r)&&this.setState({spinning:!0})),this.$drawer&&n!==t.fullscreen&&Oe(this.$drawer,n?{width:"100%"}:{width:(0,Y.PM)(this.props.width||"72%")})}renderTitle(){const{fullscreen:e}=this.state,{showFullScreen:a}=this.props;return t().createElement(t().Fragment,null,t().createElement("span",{ref:this.titleRef,className:oe()("text")},this.props.title),a&&t().createElement("span",{className:oe()("full-screen"),onClick:this.toggleHandle},t().createElement(e?ce.FullscreenExitOutlined:ce.FullscreenOutlined)))}render(){const{spinning:e,sloading:a}=this.state,{size:r,className:l,loading:n,maskClosable:i,onClose:o}=this.props,s=this.context.global,c=r||this.context.size||"",d=se("drawer"),u={[d]:!0,[`${d}--lg`]:"large"===c,[`${d}--sm`]:"small"===c};return t().createElement(N.Drawer,St({},G()(this.props,["size","showFullScreen","loading","maskClosable","onClosed"]),{maskClosable:i??(null==s?void 0:s.maskClosable)??!1,className:oe()(u,l),title:this.renderTitle(),footer:null,onClose:o,afterVisibleChange:this.afterVisibleChange}),this.props.children,(n||a||e)&&t().createElement(Qe,{spinning:!0,className:oe()(`${d}-spin`)}))}}wt(Tt,"contextType",l),wt(Tt,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Drawer","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},spinning:r().bool}),wt(Tt,"defaultProps",{width:"72%",showFullScreen:!0,destroyOnClose:!0,footer:null});const Nt=Tt;function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},It.apply(this,arguments)}function _t(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const Rt="10vh";var Pt;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small"}(Pt||(Pt={}));class Ot extends e.Component{constructor(){super(...arguments),_t(this,"$event",null),_t(this,"draggleRef",t().createRef()),_t(this,"opened",!1),_t(this,"state",{fullscreen:!1,spinning:!1,sloading:!1,disabled:!0,bounds:{left:0,top:0,bottom:0,right:0},position:void 0}),_t(this,"addMouseDownEvent",(()=>{this.$event||(this.$event=ot()(document.body,"mousedown",Re))})),_t(this,"removeMouseDownEvent",(()=>{var e;this.$event&&(null===(e=this.$event)||void 0===e||e.remove(),this.$event=null)})),_t(this,"onStart",((e,t)=>{const{clientWidth:a,clientHeight:r}=window.document.documentElement,l=this.draggleRef.current.getBoundingClientRect();l&&this.setState({bounds:{left:-l.left+t.x,right:a-(l.right-t.x)-1,top:-l.top+t.y,bottom:r-(l.bottom-t.y)-1}})})),_t(this,"toggleHandle",(e=>{const t=ke(e.target,"ant-modal");if(!t)return;const a=t.querySelector(".ant-modal-body"),{height:r}=this.props,{fullscreen:l}=this.state;l?(Oe(t,{width:(0,Y.PM)(this.props.width||"60%"),height:"auto",top:Rt}),Oe(a,{height:r?(0,Y.PM)(r):this.defaultHeight,maxHeight:"auto"===r?this.defaultHeight:""})):(Oe(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Oe(a,{height:`calc(100vh - ${Pt[this.$size]}px)`,maxHeight:""})),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(e=(t=this.props).onFullChange)||void 0===e||e.call(t,this.state.fullscreen)}))})),_t(this,"afterVisibleChange",(()=>{const{onClosed:e}=this.props;null==e||e(),this.setState({fullscreen:!1})})),_t(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),_t(this,"STOP_LOADING",(()=>{this.setState({sloading:!1})}))}get $size(){const{size:e}=this.props;return e||this.context.size||""}get defaultHeight(){return`calc(100vh - 10vh - 10vh - ${Pt[this.$size]}px)`}componentDidUpdate(e,t){const{visible:a,loading:r,stopMouseDownEvent:l,destroyOnClose:n}=this.props,{fullscreen:i}=this.state;if(a&&a!==e.visible){if(!n&&this.opened||(0,Y.o8)(r)&&this.setState({spinning:!0}),l&&this.addMouseDownEvent(),!n&&this.opened)return;setTimeout((()=>{this.opened=!0,(0,Y.o8)(r)&&this.setState({spinning:!1})}),400)}a||this.removeMouseDownEvent(),i!==t.fullscreen&&(i?this.setState({position:{x:0,y:0}}):this.setState({position:void 0}))}renderTitle(){const{fullscreen:e,disabled:a}=this.state,{showFullScreen:r}=this.props;return t().createElement("div",{onMouseOver:()=>{a&&this.setState({disabled:!1})},onMouseOut:()=>{this.setState({disabled:!0})}},t().createElement("span",{className:oe()("text")},this.props.title),r&&t().createElement("span",{className:oe()("full-screen"),onClick:this.toggleHandle},t().createElement(e?ce.FullscreenExitOutlined:ce.FullscreenOutlined)))}render(){const{spinning:e,sloading:a,fullscreen:r,disabled:l,bounds:n,position:i}=this.state,{height:o,className:s,loading:c,draggable:d,maskClosable:u,bodyStyle:p,onClose:h}=this.props,m=this.context.global,f=se("modal"),g={height:o?(0,Y.PM)(o):this.defaultHeight,maxHeight:"auto"===o?this.defaultHeight:"",overflow:"auto"},b={[f]:!0,[`${f}--lg`]:"large"===this.$size,[`${f}--sm`]:"small"===this.$size};return t().createElement(N.Modal,It({},G()(this.props,["showFullScreen","loading","maskClosable","stopMouseDownEvent","onClose","onClosed"]),{maskClosable:u??(null==m?void 0:m.maskClosable)??!1,className:oe()(b,s),title:this.renderTitle(),footer:null,bodyStyle:Object.assign({},g,p),onCancel:h,afterClose:this.afterVisibleChange,modalRender:e=>t().createElement(Te(),{disabled:!d||l||r,bounds:n,position:i,onStart:(e,t)=>this.onStart(e,t)},t().createElement("div",{ref:this.draggleRef},e))}),this.props.children,(c||a||e)&&t().createElement(Qe,{spinning:!0,className:oe()(`${f}-spin`)}))}}_t(Ot,"contextType",l),_t(Ot,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Modal","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},spinning:r().bool}),_t(Ot,"defaultProps",{width:"60%",showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:Rt}});const At=Ot,kt=require("memoize-one");var Ht=__webpack_require__.n(kt);const Ft=(0,e.createContext)(void 0),Lt=require("resize-observer-polyfill");var qt=__webpack_require__.n(Lt);const Dt=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];Array.isArray(e)&&e.length&&e.forEach((e=>e(t)))}},$t=function(e,t){!Ne.Z&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new(qt())(Dt),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},Mt=function(e,t){var a;e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||null===(a=e.__ro__)||void 0===a||a.disconnect())},Kt=80,Vt="1",Ut="0",jt=400,zt=["RANGE_INPUT","RANGE_INPUT_NUMBER","RANGE_SEARCH_HELPER","MULTIPLE_CHECKBOX","MULTIPLE_SELECT","RANGE_DATE","RANGE_TIME","MULTIPLE_TREE_SELECT","MULTIPLE_SEARCH_HELPER","MULTIPLE_TREE_TABLE_HELPER","MULTIPLE_CASCADER","UPLOAD_IMG","UPLOAD_FILE"],Bt={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};let Wt,Gt,Yt;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(Wt||(Wt={})),function(e){e.date="YYYY-MM-DD HH:mm:ss",e.datetime="YYYY-MM-DD HH:mm:ss",e.exactdate="YYYY-MM-DD",e.week="YYYY-wo",e.month="YYYY-MM",e.quarter="YYYY-[Q]Q",e.year="YYYY"}(Gt||(Gt={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(Yt||(Yt={}));const Zt={items:r().arrayOf(r().shape({type:r().string.isRequired,fieldName:r().string.isRequired})),initialValues:r().object,initialExtras:r().object,layout:r().oneOf(["horizontal","vertical"]),size:(e,t,a)=>{if(!f(e[t]||""))return h("Form","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},cols:r().number,customClass:r().string,compactMode:r().bool,labelWidth:r().oneOfType([r().number,r().string]),labelAlign:r().oneOf(["left","right"]),labelWrap:r().bool,formType:r().oneOf(["default","search","onlyShow"]),uniqueKey:r().string,defaultRows:r().number,searchButtonCols:r().number,scrollToFirstError:r().bool,authConfig:r().object,isAutoFocus:r().bool,isCollapse:r().bool,isFieldsDefine:r().bool,isSearchBtn:r().bool,isSubmitBtn:r().bool,fieldsChange:r().func,onValuesChange:r().func,onFieldsChange:r().func,onFinish:r().func,onFinishFailed:r().func,onReset:r().func,onCollapse:r().func},Xt={layout:"horizontal",labelWidth:Kt,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:Y.ZT,onFieldsChange:Y.ZT,onFinish:Y.ZT,onFinishFailed:Y.ZT,onReset:Y.ZT,onCollapse:Y.ZT,onFormItemsChange:Y.ZT},Qt=(e,t)=>{if(!e)return null;if(t===Gt.week){const t=e.match(/^(\d{4})-(\d+)/);return t?i()().year(Number(t[1])).week(Number(t[2])):null}if(t===Gt.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?i()().year(Number(t[1])).quarter(Number(t[2])):null}return i()(e,t)},Jt=(e,t)=>e?i()(e).format(t):"",ea=e=>""===e||null==e,ta=(e,t)=>{if(!e)return"";if(!t.includes("|"))return e[t];const a=t.split("|");let r="";for(let t=0,l=a.length;t<l;t++)r+=(e[a[t].trim()]??"")+(t===l-1?"":" | ");return r},aa=(e,t,a)=>{for(const r in a)if(Object.keys(t).includes(r)&&t[r]!==a[r])if(t[r].includes("|")){const l=t[r].split("|"),n=a[r].split("|");l.forEach(((t,a)=>e[t]=e[n[a]]))}else e[t[r]]=e[a[r]]},ra=(e,t,a)=>{for(const r in a)if(Object.keys(t).includes(r)&&t[r]!==a[r])if(t[r].includes("|")){const l=t[r].split("|"),n=a[r].split("|");l.forEach(((t,a)=>e[t]=e[n[a]]))}else e[t[r]]=e[a[r]]},la=(e,t,a)=>e.map((e=>{const r={value:e[t],text:e[a]};return e.disabled&&(r.disabled=!0),e.isLeaf&&(r.isLeaf=!0),Array.isArray(e.children)&&(r.children=la(e.children,t,a)),r})),na=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(a=na(e[r].children,t)),a)return a;if(e[r].value===t)return e[r]}return a},ia=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=[];return e.forEach((e=>{e.value==t.split(",")[a]&&r.push(e),Array.isArray(e.children)&&r.push(...ia(e.children,t,a+1))})),r},oa=e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),sa=(e,t,a,r)=>{var l;const n={};return n.filters=(null===(l=e.filters)||void 0===l?void 0:l.filter((e=>"1"===e.isQuery)).map((e=>{const t={type:e.type,label:e.label,fieldName:e.fieldName,options:{}};return Array.isArray(e.dicData)&&(t.options.itemList=e.dicData),t})))||[],n.table={columns:e.columns||[],rowKey:e.valueName},n.fieldsDefine={valueKey:e.valueKey||e.valueName},n.fieldAliasMap={[r?"textKey":t]:e.displayName[0],[r?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(n.table.fetch={api:a(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(n.echoRequest={fetchApi:a(e.echoSetting.api),formatter:t=>Object.assign({},t,{[e.echoSetting.paramKey]:t.key??t.keys}),dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(n.echoRequest.fieldAliasMap={[r?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(n.tree={fetch:{api:a(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const a={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>a[e.tableField]=e.treeField)),a}}),e.emmediateSetting&&(n.columns=e.emmediateSetting.columns,n.request={fetchApi:a(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),n};var ca=__webpack_require__(517);const da=require("react-sortablejs");function ua(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class pa extends e.Component{get formUniqueKey(){return this.props.uniqueKey?`form_${this.props.uniqueKey}`:""}constructor(e){super(e),ua(this,"linkRef",t().createRef()),ua(this,"state",{visible:!1}),this.initLocalfields()}async getTableFieldsConfig(e){const t=this.context.global,a=null==t?void 0:t.getComponentConfigApi;if(a)try{const t=await a({key:e});if(200===t.code)return t.data}catch(e){}}async saveTableColumnsConfig(e,t){const a=this.context.global,r=null==a?void 0:a.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}}getLocalFields(){if(!this.formUniqueKey)return;const e=JSON.parse(localStorage.getItem(this.formUniqueKey));return e||this.getTableFieldsConfig(this.formUniqueKey).then((e=>{if(!e)return this.setLocalFields(this.props.items);localStorage.setItem(this.formUniqueKey,JSON.stringify(e)),this.initLocalfields()})).catch((()=>{})),e?(0,ca.xor)(e.map((e=>e.fieldName)),this.props.items.map((e=>e.fieldName))).length>0?this.props.items.map((t=>{const{fieldName:a}=t,r=e.find((e=>e.fieldName===a));return r?((0,Y.o8)(r.hidden)||(t.hidden=r.hidden),t):t})):e.map((e=>({...this.props.items.find((t=>t.fieldName===e.fieldName)),...e}))):void 0}setLocalFields(e){if(!this.formUniqueKey)return;const t=e.map((e=>{const t={};return(0,Y.o8)(e.hidden)||(t.hidden=e.hidden),{fieldName:e.fieldName,...t}})),a=JSON.parse(localStorage.getItem(this.formUniqueKey));(0,ca.isEqual)(t,a)||(localStorage.setItem(this.formUniqueKey,JSON.stringify(t)),this.saveTableColumnsConfig(this.formUniqueKey,t))}initLocalfields(){const e=this.getLocalFields();e&&this.changeHandle(e)}changeHandle(e){const{fieldsChange:t}=this.props;null==t||t(e.filter((e=>!e.noAuth)))}popup(){const{items:e}=this.props,a=e.filter((e=>!e.noAuth));return t().createElement(Ft.Consumer,null,(e=>{const r=e.$$form;return t().createElement("div",{className:oe()("ant-dropdown-menu","fields-list")},t().createElement(da.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.fieldName)),l=a.map((e=>e.fieldName));(0,ca.isEqual)(t,l)||(r.setExpandHandle(!0),this.changeHandle(e),this.setLocalFields(e))}},a.map((e=>{var l;return t().createElement("li",{key:e.fieldName,className:"item"},t().createElement(N.Checkbox,{disabled:(null===(l=e.rules)||void 0===l?void 0:l.findIndex((e=>e.required)))>-1,checked:!e.hidden,onChange:t=>{const{checked:r}=t.target;e.hidden=!r,this.changeHandle(a),this.setLocalFields(a)}}),t().createElement(ce.HolderOutlined,{className:"handle",title:d("qm.form.draggable")}),t().createElement("span",{className:"title"},r.getFormItemLabel(e.label||"")))}))))}))}render(){const{visible:e}=this.state,a=se("form-fields-filter");return t().createElement(Ft.Consumer,null,(r=>{const{$size:l}=r.$$form,n={[a]:!0,[`${a}--lg`]:"large"===l,[`${a}--sm`]:"small"===l};return t().createElement(N.Dropdown,{overlayClassName:oe()(n),overlay:this.popup(),trigger:["click"],placement:"bottomRight",overlayStyle:{minWidth:150},getPopupContainer:()=>this.linkRef.current,visible:e,onVisibleChange:e=>{this.setState({visible:e})}},t().createElement("a",{ref:this.linkRef,style:{padding:"5px 0"}},t().createElement(ce.UnorderedListOutlined,null)))}))}}ua(pa,"contextType",l);const ha=pa,ma=e=>{const{value:a,bordered:r}=e;return t().createElement(N.Input,{value:a,title:a,bordered:r,readOnly:!0})};ma.displayName="FormItemView";const fa=ma;function ga(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const ba=t().forwardRef(((e,a)=>{const{$$form:r}=t().useContext(Ft),{value:l,onChange:n,onValuesChange:i}=e,{options:o={},style:s={},placeholder:c=d("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m,onBlur:f=Y.ZT,onEnter:g=Y.ZT}=e.option,{prefix:b,suffix:y,password:v,maxLength:x,pattern:E,toUpper:C,toTrim:S,secretType:w}=o,T=w&&(h||m),I=e=>{null==n||n(e),i(e)},_=v?N.Input.Password:N.Input,R=T?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return e=e.toString(),"finance"===t&&(e=oa(e)),"name"===t&&(e=e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**")),"phone"===t&&(e=e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2")),"IDnumber"===t&&(e=e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2")),"bankNumber"===t&&(e=e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")),e}(l,w):l;return r.isOnlyShow?t().createElement(fa,{value:(e=>e&&v?new Array(e.length).fill("*").join(""):e)(R),bordered:u}):t().createElement(_,{ref:a,value:R,placeholder:c,style:s,title:v?"":R,prefix:b,suffix:y,maxLength:x,bordered:u,allowClear:p,readOnly:h,disabled:m,onBlur:t=>{let a=t.target.value??"";if(S){const e=a.trim();a!==e&&(a=e,I(a))}(t=>{const{onBlur:a}=e;null==a||a(t)})(a),f(a)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;g(t),r.isFilterType&&r.SUBMIT_FORM()}},onChange:e=>{let t=e.target.value;(0,ca.isRegExp)(E)&&(t=E.test(t)?t:l??""),C&&(t=t.toUpperCase()),I(t)}})}));ba.displayName="VInput";class ya extends e.Component{constructor(){super(...arguments),ga(this,"focus",(()=>{const{type:e}=this.props.option;this[e].focus()}))}render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(h)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(ba,{ref:e=>this[a]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(n,t)}}))),u&&t().createElement(N.Col,null,e.renderFormItemButton(n,u)),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}ga(ya,"contextType",Ft);const va=ya,xa=e=>{const{$$form:a}=t().useContext(Ft),{value:r=[],onChange:l,onValuesChange:n}=e,{options:i={},placeholder:o=d("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:u,disabled:p}=e.option,{prefix:h,suffix:m,maxLength:f}=i,g=e=>{const t=e.every((e=>!e))?[]:e;null==l||l(t),n(t,b(t))},b=e=>e.join(" - ");return a.isOnlyShow?t().createElement(fa,{value:b(r),bordered:s}):t().createElement(N.Input.Group,null,t().createElement(N.Input,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:o[0],prefix:h,suffix:m,maxLength:f,allowClear:c,bordered:s,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([t,r[1]])}}),t().createElement(N.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:p,readOnly:!0}),t().createElement(N.Input,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:o[1],prefix:h,suffix:m,maxLength:f,bordered:s,allowClear:c,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([r[0],t])}}))};class Ea extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,s),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(o)},required:e.getFormItemRequired(u)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(xa,{option:this.props.option,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1?arguments[1]:void 0;p(t),e.setViewValue(n,a)}}))),c&&t().createElement(N.Col,{flex:(0,Y.PM)(c.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Ea,"contextType",Ft);const Ca=Ea;function Sa(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const wa=e=>{const t=Number(e);return Number.isNaN(t)?e:t},Ta=t().forwardRef(((e,a)=>{const{$$form:r}=t().useContext(Ft),{value:l,onChange:n,onValuesChange:i}=e,{options:o={},style:s={},placeholder:c=d("qm.form.inputPlaceholder"),bordered:u=!0,readOnly:p,disabled:h,onBlur:m=Y.ZT,onEnter:f=Y.ZT}=e.option,{step:g=1,min:b,max:y,precision:v,textAlign:x="left",controls:E=!0,formatter:C,parser:S}=o,w=e=>{const t=ea(e)?"":Number(e).toFixed(v);return"function"==typeof C?C(t):t},T={[x]:!0,controls:E};return r.isOnlyShow?t().createElement(fa,{value:w(l),bordered:u}):t().createElement(N.InputNumber,{ref:a,value:l,className:oe()(T),placeholder:c,style:{width:"100%",...s},step:g,min:b,max:y,controls:E,precision:v,formatter:C,parser:S,bordered:u,readOnly:p,disabled:h,onBlur:t=>{(0,Y.Y3)((()=>{const a=t.target.value,r="function"==typeof S?S(a):a;(t=>{const{onBlur:a}=e;null==a||a(t)})(wa(r)),m(wa(r))}))},onKeyUp:e=>{if(13===e.keyCode){const t=e.target.value,a="function"==typeof S?S(t):t;f(wa(a))}},onChange:e=>{(e=>{null==n||n(e),i(e,w(e))})(e)}})}));Ta.displayName="VInputNumber";class Na extends e.Component{constructor(){super(...arguments),Sa(this,"focus",(()=>{const{type:e}=this.props.option;this[e].focus()}))}render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(h)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Ta,{ref:e=>this[a]=e,option:this.props.option,onValuesChange:(t,a)=>{m(t),e.setViewValue(n,a)}}))),u&&t().createElement(N.Col,null,e.renderFormItemButton(n,u)),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}Sa(Na,"contextType",Ft);const Ia=Na,_a=e=>{const{$$form:a}=t().useContext(Ft),{value:r=[],onChange:l,onValuesChange:n}=e,{options:i={},placeholder:o=d("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:u,disabled:p}=e.option,{step:h=1,min:m=0,max:f,textAlign:g="left",controls:b=!0,precision:y,formatter:v,parser:x}=i,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),C(e)},C=e=>{const t=e.every((e=>null===e))?[]:[...e];null==l||l(t),n(t,S(t))},S=e=>ea(e)?"":e.map((e=>ea(e)?"":Number(e).toFixed(y))),w={[g]:!0,controls:b};return a.isOnlyShow?t().createElement(fa,{value:S(r),bordered:s}):t().createElement(N.Input.Group,null,t().createElement(N.InputNumber,{value:r[0],className:oe()("site-input-left",w),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:o[0],step:h,min:m,max:f,controls:b,precision:y,formatter:v,parser:x,bordered:s,readOnly:u,disabled:p,onChange:e=>{C([e,r[1]])},onBlur:()=>{E(r)}}),t().createElement(N.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:p,readOnly:!0}),t().createElement(N.InputNumber,{value:r[1],className:oe()("site-input-right",w),style:{width:"calc(50% - 5px)"},placeholder:o[1],step:h,min:m,max:f,controls:b,precision:y,formatter:v,parser:x,bordered:s,readOnly:u,disabled:p,onChange:e=>{C([r[0],e])},onBlur:()=>{E(r)}}))};class Ra extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,s),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(o)},required:e.getFormItemRequired(u)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(_a,{option:this.props.option,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1?arguments[1]:void 0;p(t),e.setViewValue(n,a)}}))),c&&t().createElement(N.Col,{flex:(0,Y.PM)(c.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Ra,"contextType",Ft);const Pa=Ra;let Oa;function Aa(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}!function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(Oa||(Oa={}));const{Search:ka}=N.Input;class Ha extends e.Component{constructor(e){var t;super(e),t=this,Aa(this,"searchHelper",void 0),Aa(this,"alias",void 0),Aa(this,"extras",void 0),Aa(this,"deriveParams",void 0),Aa(this,"valueKey",void 0),Aa(this,"_is_change",!1),Aa(this,"_record",void 0),Aa(this,"_prevValue",void 0),Aa(this,"state",{visible:!1,loading:!1}),Aa(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Aa(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props,{fieldName:t}=this.props.option;this.searchHelper=Object.assign({},e,this.props.option.searchHelper);const{fieldAliasMap:a,extraAliasMap:r,fieldsDefine:l}=this.searchHelper;if(a||m("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof a?a():a||{},this.extras="function"==typeof r?r():r||{},l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(t)||m("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),this.searchHelper.echoRequest&&!this.valueKey&&m("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),Aa(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),Aa(this,"getLastedSearchHelper",(()=>Object.assign({},this.searchHelper,this.props.option.searchHelper))),Aa(this,"getItemText",(async()=>{await this.props.waiting();const e=this.getItemValue();if(e===this._prevValue)return;this._prevValue=e;const{fetchApi:t,params:a={},formatter:r=(e=>e),dataKey:l,callback:n,fieldAliasMap:i,extraAliasMap:o}=this.searchHelper.echoRequest||{},s="function"==typeof i?i():i||{},c="function"==typeof o?o():o||{},{value:d}=this.props;if(t&&!d&&e){this.setState({loading:!0});try{const i=await t(r({...a,key:e}));if(200===i.code){const e=Array.isArray(i.data)?i.data:(0,ca.get)(i.data,l)??[];if(e[0]){const t=e[0];s&&aa(t,this.alias,s),c&&ra(t,this.extras,c),this._record=t,this.setFieldsValue(t),null==n||n([t])}}}catch(e){}this.setState({loading:!1})}})),Aa(this,"todoOpen",(e=>{this.deriveParams=this.createFilters(e),this.setVisible(!0)})),Aa(this,"createFilters",(e=>{const{fieldName:t}=this.props.option,{filterAliasMap:a}=this.searchHelper,r=""!==e?e:void 0,l="function"==typeof a?a():a??[],n={[t]:r};return l.forEach((e=>n[e]=r)),n})),Aa(this,"getSearchHelperTableData",(e=>{const{table:t,initialValue:a={}}=this.searchHelper,{beforeFetch:r=Y.XT,formatter:l=(e=>e)}=t.fetch;return new Promise((async(n,i)=>{const o=(0,ca.merge)({},this.getLastedSearchHelper().table.fetch.params,{...a,...l(this.createFilters(e))},{currentPage:1,pageSize:500});try{if(!r(o))return i();this.setState({loading:!0});const e=await t.fetch.api(o);if((0,Y.Y3)((()=>this.setState({loading:!1}))),200===e.code)return n(Array.isArray(e.data)?e.data:(0,ca.get)(e.data,t.fetch.dataKey)??[])}catch(e){this.setState({loading:!1})}i()}))})),Aa(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;for(const r in this.alias){const l=ta(e,this.alias[r]);void 0!==l&&(t.SET_FIELDS_VALUE({[r]:l}),r===a&&t.setViewValue(a,l))}for(const a in this.extras){const r=ta(e,this.extras[a]);void 0!==r&&t.SET_FIELDS_EXTRA({[a]:r})}})),Aa(this,"resetSearchHelperValue",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1?arguments[1]:void 0;const{fieldName:r}=t.props.option,l=e.filter((e=>{var l;return null===(l=ta(e,t.alias[r]))||void 0===l?void 0:l.toString().toLowerCase().includes(a.toLowerCase())}));if(1===l.length)return t.closeSearchHelper(l[0]);t.openSearchHelper(a)})),Aa(this,"openSearchHelper",(async(e,t)=>{await this.props.waiting();const{$$form:a}=this.context,{beforeOpen:r}=this.searchHelper,l=(r??Y.XT)(a.state.formData);null!=l&&l.then?l.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==l&&(this.todoOpen(e),null==t||t())})),Aa(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;for(const r in this.alias)r!==a&&t.SET_FIELDS_VALUE({[r]:ta(e,this.alias[r])});for(const a in this.extras)t.SET_FIELDS_EXTRA({[a]:ta(e,this.extras[a])});this._record=e;const r=ta(e,this.alias[a]);this.triggerChange(r),this.searchHelperChangeHandle(r);const{closed:l}=this.searchHelper;this.setVisible(!1,(()=>{this.focus(),setTimeout((()=>null==l?void 0:l(e)),200)}))})),Aa(this,"closeButNotSelect",(()=>{const{onlySelect:e=!0}=this.searchHelper;this._is_change&&(e?this.clearSearchHelperValue():this.searchHelperChangeHandle(this.props.value)),this._is_change=!1,this.setVisible(!1,(()=>{this.focus()}))})),Aa(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;if(this.triggerChange(""),null!==this._record){for(const a in this.alias)a!==t&&e.SET_FIELDS_VALUE({[a]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}})),Aa(this,"searchHelperChangeHandle",(e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)})),Aa(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props;null==t||t(e),a(e)})),Aa(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),Aa(this,"focus",(()=>{const{type:e}=this.props.option;this[`${e}_Ref`].focus({cursor:"end"})})),this.initialHandle()}componentDidMount(){this.getItemText()}componentDidUpdate(){this.getItemText()}render(){const{$$form:e}=this.context,{visible:a,loading:r}=this.state,{value:l}=this.props,{type:n,options:i={},searchHelper:o={},style:s={},placeholder:c=d("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{prefix:f,suffix:g,maxLength:b}=i,y={visible:a,title:d("qm.searchHelper.text"),width:o.width??"60%",loading:!1,bodyStyle:{paddingBottom:`${Oa[e.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},v={...this.getLastedSearchHelper(),size:e.$size,initialValue:(0,ca.merge)({},o.initialValue,this.deriveParams),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}};return e.isOnlyShow?t().createElement(fa,{value:l,bordered:u}):t().createElement(t().Fragment,null,t().createElement(ka,{ref:e=>this[`${n}_Ref`]=e,value:l,title:l,loading:r,placeholder:c,style:s,prefix:f,suffix:g,maxLength:b,bordered:u,allowClear:p,readOnly:h,disabled:m,onBlur:e=>{const{value:t}=e.target,{onlySelect:r=!0,table:l}=this.searchHelper;var n;this.triggerBlur(t),this._is_change&&!a&&(t?r?null!=l&&null!==(n=l.fetch)&&void 0!==n&&n.api&&this.getSearchHelperTableData(t).then((e=>this.resetSearchHelperValue(e,t))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(t):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;!a&&this.openSearchHelper(t)}},onDoubleClick:e=>{const{value:t}=e.target;this.openSearchHelper(t)},onChange:e=>{const{value:t}=e.target;this.triggerChange(t),this._is_change=!0},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper(e):(0,Y.Y3)((()=>this.clearSearchHelperValue())))}}),t().createElement(At,y,t().createElement(Go,v)))}}Aa(Ha,"contextType",Ft);class Fa extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),Aa(this,"promiseRef",void 0),Aa(this,"searchRef",void 0),Aa(this,"state",{searchHelper:{}}),Aa(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),Aa(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[]}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(Ha,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e.setViewValue(i,t)}}))),p&&t().createElement(N.Col,null,e.renderFormItemButton(i,p)),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}Aa(Fa,"contextType",Ft);const La=Fa;function qa(){return qa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},qa.apply(this,arguments)}function Da(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const $a=a=>{class r extends e.Component{constructor(){var e;super(...arguments),e=this,Da(this,"startClick",void 0),Da(this,"event1",null),Da(this,"event2",null),Da(this,"$el",null),Da(this,"omitClassNames",[]),Da(this,"state",{clickOutside:!1}),Da(this,"mousedownHandler",(e=>{this.startClick=e})),Da(this,"mouseupHandler",(e=>{this.documentHandler(e,this.startClick)})),Da(this,"documentHandler",((e,t)=>{var a,r;const l=e.target,n=null==t?void 0:t.target,i=!l||!n,o=(null===(a=this.$el)||void 0===a?void 0:a.contains(l))||(null===(r=this.$el)||void 0===r?void 0:r.contains(n)),s=this.$el===l,c=this.omitClassNames.map((e=>document.querySelector(e))),d=c.some((e=>null==e?void 0:e.contains(l)))||c.includes(n);let u;u=!(i||o||s||d),this.setState({clickOutside:u})})),Da(this,"setCurrentElement",(e=>{e&&(this.$el=e)})),Da(this,"setOmitClassNames",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.omitClassNames=t}))}componentDidMount(){this.event1=ot()(document,"mousedown",this.mousedownHandler),this.event2=ot()(document,"mouseup",this.mouseupHandler)}componentWillUnmount(){var e,t;null===(e=this.event1)||void 0===e||e.remove(),null===(t=this.event2)||void 0===t||t.remove()}render(){const{forwardedRef:e}=this.props,{clickOutside:r}=this.state;return t().createElement(a,qa({ref:e},this.props,{clickOutside:r,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return Da(r,"displayName",`OutsideClick(${a.displayName||a.name})`),t().forwardRef(((e,a)=>t().createElement(r,qa({},e,{forwardedRef:a}))))},Ma=require("rc-trigger");var Ka,Va,Ua=__webpack_require__.n(Ma);function ja(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}let za=$a((Va=class extends e.Component{constructor(e){var a;super(e),a=this,ja(this,"searchHelper",void 0),ja(this,"alias",void 0),ja(this,"_records",[]),ja(this,"searchRef",t().createRef()),ja(this,"state",{visible:!1,visible2:!1,loading:!1,itemList:[]}),ja(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props;this.searchHelper=Object.assign({},e,this.props.option.searchHelper);const t=this.searchHelper.fieldAliasMap;t||m("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof t?t():t||{},Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||m("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),ja(this,"getLastedSearchHelper",(()=>{const e=Object.assign({},this.searchHelper,this.props.option.searchHelper);var t;return e.table&&!e.table.rowKey&&(e.table.rowKey=null===(t=this.alias)||void 0===t?void 0:t.valueKey),e})),ja(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),ja(this,"setItemList",(e=>{this.setState({itemList:e})})),ja(this,"setRecords",(e=>{this._records=e})),ja(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),ja(this,"setViewValue",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;t.setViewValue(a,this.createViewText(e))})),ja(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:a}=this.searchHelper,r=(a??Y.XT)(t.state.formData);null!=r&&r.then?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),ja(this,"closeSearchHelper",(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:r}=a.alias;a.setRecords((0,ca.uniqBy)([...a._records.filter((e=>t.includes(e[r]))),...e],r));const l=a.recordsToDict();a.setItemList(l),a.triggerChange(l.map((e=>e.value)));const{closed:n}=a.searchHelper;a.setVisible(!1,(()=>{setTimeout((()=>null==n?void 0:n(a._records)),200)}))})),ja(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),a(e,this.createViewText(e),this._records)})),this.initialHandle()}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:a=[]}=e,{value:r=[],clickOutside:l}=this.props;(0,ca.isEqual)((0,ca.intersection)(a,r),r)||(0,ca.isEqual)(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),l&&t.visible2&&this.setState({visible2:!1})}async getItemList(){var e;if(await this.props.waiting(),!this.searchHelper)return;const{textKey:t,valueKey:a}=this.alias,{fetchApi:r,params:l={},formatter:n=(e=>e),dataKey:i,callback:o,fieldAliasMap:s}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},c="function"==typeof s?s():s||{},{value:d}=this.props;if(r&&!(0,Y.xb)(d)){this.setState({loading:!0});try{const e=await r(n({...l,keys:d}));if(200===e.code){let r=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,i)??[];r.forEach((e=>{null!=c&&c.valueKey&&c.valueKey!==a&&(e[a]=e[c.valueKey]),null!=c&&c.textKey&&c.textKey!==t&&(e[t]=e[c.textKey])})),r=r.filter((e=>d.includes(e[a])));const l=r.map((e=>({value:e[a],text:e[t]})));this.setRecords(r),this.setItemList(l),this.setViewValue(d),null==o||o(r)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,a;const{$$form:r}=this.context,{visible:l,visible2:n,loading:i,itemList:o}=this.state,{value:s}=this.props,{fieldName:c,options:u={},searchHelper:p={},style:h={},placeholder:m=d("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:b,disabled:y}=this.props.option,{collapseTags:v,maxTagTextLength:x}=u,E={visible:l,title:d("qm.searchHelper.text"),width:p.width??"60%",loading:!1,bodyStyle:{paddingBottom:`${Oa[r.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},C={...this.getLastedSearchHelper(),size:r.$size,multiple:!0,initialValue:(0,ca.merge)({},p.initialValue),defaultSelectedKeys:s,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}},S=o.filter((e=>null==s?void 0:s.includes(e.value))),w=t().createElement("ul",{className:"ant-dropdown-menu"},S.length?S.map((e=>t().createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t().createElement("li",{className:"ant-dropdown-menu-item"},d("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=se("form-multiple-search-helper"),{size:_}=r.context,R={[I]:!0,[`${I}--lg`]:"large"===_,[`${I}--sm`]:"small"===_};null===(e=(a=this.props).setOmitClassNames)||void 0===e||e.call(a,[`.${I}`]);const P=o.filter((e=>null==s?void 0:s.includes(e.value))).map((e=>e.text)).join(",");return r.isOnlyShow?t().createElement(fa,{value:P,bordered:f}):t().createElement(t().Fragment,null,t().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t().createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t().createElement(Ua(),{popupVisible:!y&&n,popup:w,popupClassName:oe()(R),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Bt,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(N.Select,{mode:"multiple",maxTagCount:v?"responsive":void 0,maxTagTextLength:x,open:!1,value:s,placeholder:m,loading:i,bordered:f,allowClear:g,disabled:y,style:{width:"100%",...h},title:P,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{const t=e.target;var a,r;t.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(a=(r=this.props).setCurrentElement)||void 0===a||a.call(r,t),this.setState({visible2:!0}))},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(N.Button,{className:"ant-input-search-button",disabled:y,icon:t().createElement(ce.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),t().createElement(At,E,t().createElement(Go,C)))}},ja(Va,"contextType",Ft),Ka=Va))||Ka;class Ba extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),ja(this,"promiseRef",void 0),ja(this,"state",{searchHelper:{}}),ja(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),ja(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(za,{option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:(t,a,r)=>{f(t,r),e.setViewValue(i,a)}}))),p&&t().createElement(N.Col,null,e.renderFormItemButton(i,p)),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}ja(Ba,"contextType",Ft);const Wa=Ba;function Ga(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const{Search:Ya}=N.Input;class Za extends e.Component{constructor(e){super(e),Ga(this,"searchHelper",void 0),Ga(this,"alias",void 0),Ga(this,"extras",void 0),Ga(this,"valueKey",void 0),Ga(this,"_record",void 0),Ga(this,"_prevValue",void 0),Ga(this,"state",{visible:!1,loading:!1}),Ga(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Ga(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props,{fieldName:t}=this.props.option;this.searchHelper=Object.assign({},e,this.props.option.searchHelper);const{fieldAliasMap:a,extraAliasMap:r,fieldsDefine:l}=this.searchHelper;if(a||m("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof a?a():a||{},this.extras="function"==typeof r?r():r||{},l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(t)||m("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),this.searchHelper.echoRequest&&!this.valueKey&&m("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),Ga(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),Ga(this,"getLastedSearchHelper",(()=>Object.assign({},this.searchHelper,this.props.option.searchHelper))),Ga(this,"getItemText",(async()=>{await this.props.waiting();const e=this.getItemValue();if(e===this._prevValue)return;this._prevValue=e;const{fetchApi:t,params:a={},formatter:r=(e=>e),dataKey:l,fieldAliasMap:n,extraAliasMap:i}=this.searchHelper.echoRequest||{},o="function"==typeof n?n():n||{},s="function"==typeof i?i():i||{},{value:c}=this.props;if(t&&!c&&e){this.setState({loading:!0});try{const n=await t(r({...a,key:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:(0,ca.get)(n.data,l)??[];if(e[0]){const t=e[0];o&&aa(t,this.alias,o),s&&ra(t,this.extras,s),this._record=t,this.setFieldsValue(t)}}}catch(e){}this.setState({loading:!1})}})),Ga(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;for(const r in this.alias){const l=ta(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:l}),r===a&&t.setViewValue(a,l)}for(const a in this.extras)t.SET_FIELDS_EXTRA({[a]:ta(e,this.extras[a])})})),Ga(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:a}=this.searchHelper,r=(a??Y.XT)(t.state.formData);null!=r&&r.then?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),Ga(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;for(const r in this.alias)r!==a&&t.SET_FIELDS_VALUE({[r]:ta(e,this.alias[r])});for(const a in this.extras)t.SET_FIELDS_EXTRA({[a]:ta(e,this.extras[a])});this._record=e;const r=ta(e,this.alias[a]);this.triggerChange(r);const{closed:l}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==l?void 0:l(e)),200)}))})),Ga(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const a in this.alias)a!==t&&e.SET_FIELDS_VALUE({[a]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")})),Ga(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props;null==t||t(e),a(e,this._record)})),Ga(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),this.initialHandle()}componentDidMount(){this.getItemText()}componentDidUpdate(){this.getItemText()}render(){const{$$form:e}=this.context,{visible:a,loading:r}=this.state,{value:l=""}=this.props,{type:n,options:i={},searchHelper:o={},style:s={},placeholder:c=d("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{prefix:f,suffix:g,maxLength:b}=i,y={visible:a,title:d("qm.searchHelper.text"),width:o.width??"65%",loading:!1,bodyStyle:{paddingBottom:`${Oa[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},v={...this.getLastedSearchHelper(),size:e.$size,initialValue:(0,ca.merge)({},o.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}};return e.isOnlyShow?t().createElement(fa,{value:l,bordered:u}):t().createElement(t().Fragment,null,t().createElement(Ya,{ref:e=>this[`${n}_Ref`]=e,value:l,title:l,loading:r,placeholder:c,style:s,prefix:f,suffix:g,maxLength:b,bordered:u,allowClear:p,readOnly:h,disabled:m,onBlur:e=>{const{value:t}=e.target;this.triggerBlur(t)},onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:e=>{this.openSearchHelper()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():this.clearSearchHelperValue())}}),t().createElement(At,y,t().createElement(es,v)))}}Ga(Za,"contextType",Ft);class Xa extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),Ga(this,"promiseRef",void 0),Ga(this,"state",{searchHelper:{}}),Ga(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),Ga(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(Za,{option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:(t,a)=>{f(t,a),e.setViewValue(i,t)}}))),p&&t().createElement(N.Col,null,e.renderFormItemButton(i,p)),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}Ga(Xa,"contextType",Ft);const Qa=Xa;var Ja,er;function tr(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}let ar=$a((er=class extends e.Component{constructor(e){var a;super(e),a=this,tr(this,"searchHelper",void 0),tr(this,"alias",void 0),tr(this,"_records",[]),tr(this,"searchRef",t().createRef()),tr(this,"state",{visible:!1,visible2:!1,loading:!1,itemList:[]}),tr(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props;this.searchHelper=Object.assign({},e,this.props.option.searchHelper);const t=this.searchHelper.fieldAliasMap;t||m("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof t?t():t||{},Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||m("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),tr(this,"getLastedSearchHelper",(()=>{const e=Object.assign({},this.searchHelper,this.props.option.searchHelper);var t;return e.table&&!e.table.rowKey&&(e.table.rowKey=null===(t=this.alias)||void 0===t?void 0:t.valueKey),e})),tr(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),tr(this,"setItemList",(e=>{this.setState({itemList:e})})),tr(this,"setRecords",(e=>{this._records=e})),tr(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),tr(this,"setViewValue",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;t.setViewValue(a,this.createViewText(e))})),tr(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:a}=this.searchHelper,r=(a??Y.XT)(t.state.formData);null!=r&&r.then?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),tr(this,"closeSearchHelper",(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:r}=a.alias;a.setRecords((0,ca.uniqBy)([...a._records.filter((e=>t.includes(e[r]))),...e],r));const l=a.recordsToDict();a.setItemList(l),a.triggerChange(l.map((e=>e.value)));const{closed:n}=a.searchHelper;a.setVisible(!1,(()=>{setTimeout((()=>null==n?void 0:n(a._records)),200)}))})),tr(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),a(e,this.createViewText(e),this._records)})),this.initialHandle()}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:a=[]}=e,{value:r=[],clickOutside:l}=this.props;(0,ca.isEqual)((0,ca.intersection)(a,r),r)||(0,ca.isEqual)(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),l&&t.visible2&&this.setState({visible2:!1})}async getItemList(){var e;if(await this.props.waiting(),!this.searchHelper)return;const{textKey:t,valueKey:a}=this.alias,{fetchApi:r,params:l={},formatter:n=(e=>e),dataKey:i,fieldAliasMap:o}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},s="function"==typeof o?o():o||{},{value:c}=this.props;if(r&&!(0,Y.xb)(c)){this.setState({loading:!0});try{const e=await r(n({...l,keys:c}));if(200===e.code){let r=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,i)??[];r.forEach((e=>{null!=s&&s.valueKey&&s.valueKey!==a&&(e[a]=e[s.valueKey]),null!=s&&s.textKey&&s.textKey!==t&&(e[t]=e[s.textKey])})),r=r.filter((e=>c.includes(e[a])));const l=r.map((e=>({value:e[a],text:e[t]})));this.setRecords(r),this.setItemList(l),this.setViewValue(c)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,a;const{$$form:r}=this.context,{visible:l,visible2:n,loading:i,itemList:o}=this.state,{value:s}=this.props,{fieldName:c,options:u={},searchHelper:p={},style:h={},placeholder:m=d("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:b,disabled:y}=this.props.option,{collapseTags:v,maxTagTextLength:x}=u,E={visible:l,title:d("qm.searchHelper.text"),width:p.width??"65%",loading:!1,bodyStyle:{paddingBottom:`${Oa[r.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},C={...this.getLastedSearchHelper(),size:r.$size,multiple:!0,initialValue:(0,ca.merge)({},p.initialValue),defaultSelectedKeys:s,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}},S=o.filter((e=>null==s?void 0:s.includes(e.value))),w=t().createElement("ul",{className:"ant-dropdown-menu"},S.length?S.map((e=>t().createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t().createElement("li",{className:"ant-dropdown-menu-item"},d("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=se("form-multiple-tree-table-helper"),{size:_}=r.context,R={[I]:!0,[`${I}--lg`]:"large"===_,[`${I}--sm`]:"small"===_};null===(e=(a=this.props).setOmitClassNames)||void 0===e||e.call(a,[`.${I}`]);const P=o.filter((e=>null==s?void 0:s.includes(e.value))).map((e=>e.text)).join(",");return r.isOnlyShow?t().createElement(fa,{value:P,bordered:f}):t().createElement(t().Fragment,null,t().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t().createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t().createElement(Ua(),{popupVisible:!y&&n,popup:w,popupClassName:oe()(R),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Bt,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(N.Select,{mode:"multiple",maxTagCount:v?"responsive":void 0,maxTagTextLength:x,open:!1,value:s,placeholder:m,loading:i,bordered:f,allowClear:g,disabled:y,style:{width:"100%",...h},title:P,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{const t=e.target;var a,r;t.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(a=(r=this.props).setCurrentElement)||void 0===a||a.call(r,t),this.setState({visible2:!0}))},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(N.Button,{className:"ant-input-search-button",disabled:y,icon:t().createElement(ce.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),t().createElement(At,E,t().createElement(es,C)))}},tr(er,"contextType",Ft),Ja=er))||Ja;class rr extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),tr(this,"promiseRef",void 0),tr(this,"state",{searchHelper:{}}),tr(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),tr(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(ar,{option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:(t,a,r)=>{f(t,r),e.setViewValue(i,a)}}))),p&&t().createElement(N.Col,null,e.renderFormItemButton(i,p)),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}tr(rr,"contextType",Ft);const lr=rr;function nr(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const ir=new Array(2).fill("");class or extends e.Component{constructor(e){var t;super(e),t=this,nr(this,"searchHelper",void 0),nr(this,"alias",void 0),nr(this,"_is_change",!1),nr(this,"_ceho_data",void 0),nr(this,"_records",[]),nr(this,"_is_clear",!1),nr(this,"state",{visible:!1,loading:!1,itemList:[],textValue:ir}),nr(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props;this.searchHelper=Object.assign({},e,this.props.option.searchHelper);const t=this.searchHelper.fieldAliasMap;t||m("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof t?t():t||{},Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||m("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),nr(this,"getLastedSearchHelper",(()=>Object.assign({},this.searchHelper,this.props.option.searchHelper))),nr(this,"setItemList",(e=>{this.setState({itemList:e})})),nr(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),nr(this,"setTextValue",(e=>{this.setState({textValue:e})})),nr(this,"setRecords",(e=>{this._records=e})),nr(this,"setViewValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())})),nr(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props;this._is_change=!1,null==t||t(e),a(e,this.createViewText(),this._records)})),nr(this,"clearSearchHelperValue",(()=>{this.setRecords([]),this.setTextValue(ir),this.triggerChange([])})),nr(this,"closeSearchHelper",(e=>{const{valueKey:t,textKey:a}=this.alias,r=e.map((e=>({value:e[t],text:e[a]})));this.setRecords(e),this.setItemList(r),this.setTextValue(r.map((e=>e.text??""))),this.triggerChange(e.map((e=>e[t])));const{closed:l}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==l?void 0:l(this._records)),200)}))})),nr(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:a}=this.searchHelper,r=(a??Y.XT)(t.state.formData);null!=r&&r.then?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),nr(this,"createFilters",(e=>{const{fieldName:t}=this.props.option;return{[t]:(0,Y.xb)(e)?void 0:e}})),nr(this,"getSearchHelperTableData",(e=>{const{table:t,initialValue:a={}}=this.searchHelper,{beforeFetch:r=Y.XT,formatter:l=(e=>e)}=t.fetch;return new Promise((async(n,i)=>{const o=(0,ca.merge)({},this.getLastedSearchHelper().table.fetch.params,{...a,...l(this.createFilters(e))},{currentPage:1,pageSize:500});try{if(!r(o))return i();this.setState({loading:!0});const e=await t.fetch.api(o);if((0,Y.Y3)((()=>this.setState({loading:!1}))),200===e.code)return n(Array.isArray(e.data)?e.data:(0,ca.get)(e.data,t.fetch.dataKey)??[])}catch(e){this.setState({loading:!1})}i()}))})),nr(this,"resetSearchHelperValue",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{textValue:a}=t.state,{textKey:r}=t.alias,l=e.filter((e=>{var t;const l=null===(t=e[r])||void 0===t?void 0:t.toString().toLowerCase();return a.some((e=>null==l?void 0:l.includes(e.toLowerCase())))}));if(2===l.length)return t.closeSearchHelper(l);t.openSearchHelper()})),nr(this,"closeButNotSelect",(()=>{this._is_change&&this.clearSearchHelperValue(),this.setVisible(!1)})),this.initialHandle()}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:a=[]}=this.props;(0,ca.isEqual)((0,ca.intersection)(t,a),a)||(0,ca.isEqual)(a,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:r}=this.context,{fieldName:l}=this.props.option;if(!(0,ca.isEqual)(r[l],this._ceho_data)&&(this._ceho_data=r[l],this.setItemList(r[l]),a.length)){const e=ir.map(((e,t)=>{var n;return(null===(n=r[l].find((e=>e.value===a[t])))||void 0===n?void 0:n.text)??""}));this.setTextValue(e)}}async getItemList(){if(await this.props.waiting(),!this.searchHelper)return;const{textKey:e,valueKey:t}=this.alias,{fetchApi:a,params:r={},formatter:l=(e=>e),dataKey:n,fieldAliasMap:i}=this.searchHelper.echoRequest||{},o="function"==typeof i?i():i||{},{value:s}=this.props;if(a&&!(0,Y.xb)(s)){this.setState({loading:!0});try{const i=await a(l({...r,keys:s}));if(200===i.code){let a=Array.isArray(i.data)?i.data:(0,ca.get)(i.data,n)??[];a.forEach((a=>{null!=o&&o.valueKey&&o.valueKey!==t&&(a[t]=a[o.valueKey]),null!=o&&o.textKey&&o.textKey!==e&&(a[e]=a[o.textKey])})),a=a.filter((e=>s.includes(e[t]))).slice(0,2);const r=a.map((a=>({value:a[t],text:a[e]})));this.setRecords(a),this.setItemList(r),this.setTextValue(r.map((e=>e.text??""))),this.setViewValue()}}catch(e){}this.setState({loading:!1})}}createViewText(){const{textKey:e}=this.alias;return this._records.map((t=>t[e])).join(" - ")}render(){const{$$form:e}=this.context,{value:a=[]}=this.props,{visible:r,loading:l,textValue:n}=this.state,{options:i={},searchHelper:o={},placeholder:s=d("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,readOnly:u,disabled:p}=this.props.option,{onlySelect:h=!0}=this.searchHelper||o,m={visible:r,title:d("qm.searchHelper.text"),width:o.width??"65%",loading:!1,bodyStyle:{paddingBottom:`${Oa[e.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},f={...this.getLastedSearchHelper(),size:e.$size,initialValue:(0,ca.merge)({},o.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}};return e.isOnlyShow?t().createElement(fa,{value:n.join(" - "),bordered:c}):t().createElement(t().Fragment,null,t().createElement(N.Input.Group,null,t().createElement(N.Input,{value:n[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:s[0],allowClear:!1,bordered:c,readOnly:u,disabled:p,onBlur:e=>{const{value:t}=e.target;var a,l;this._is_change&&!r&&(t?n.every((e=>!!e))&&null!==(a=this.searchHelper.table)&&void 0!==a&&null!==(l=a.fetch)&&void 0!==l&&l.api&&this.getSearchHelperTableData(n).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):n.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;h||(this._is_change=!0,this.setTextValue([t,n[1]]))}}),t().createElement(N.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:c,disabled:p,readOnly:!0}),t().createElement(N.Input.Search,{value:n[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:s[1],loading:l,bordered:c,allowClear:!0,readOnly:u,disabled:p,onBlur:e=>{const{value:t}=e.target;var a,l;this._is_change&&!r&&(t?n.every((e=>!!e))&&null!==(a=this.searchHelper.table)&&void 0!==a&&null!==(l=a.fetch)&&void 0!==l&&l.api&&this.getSearchHelperTableData(n).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):n.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:h||(this._is_change=!0,this.setTextValue([n[0],t]))},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),t().createElement(At,m,t().createElement(os,f)))}}nr(or,"contextType",Ft);class sr extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),nr(this,"promiseRef",void 0),nr(this,"state",{searchHelper:{}}),nr(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),nr(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,c),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(h)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(or,{option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:(t,a,r)=>{m(t,r),e.setViewValue(i,a)}}))),u&&t().createElement(N.Col,null,e.renderFormItemButton(i,u)),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...d}))))}}nr(sr,"contextType",Ft);const cr=sr,dr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},disabled:s}=e.option,{falseValue:c=Ut,trueValue:u=Vt}=i;return t().createElement(N.Checkbox,{checked:r===u,style:o,disabled:s||a.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==l||l(e),n(e,d(e===u?"am.form.trueText":"am.form.falseText"))})(t?u:c)}})};class ur extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(dr,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(ur,"contextType",Ft);const pr=ur;function hr(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const mr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,items:l,onChange:n,onValuesChange:i}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u}=e.option,{itemList:p=[]}=o,h=(0,Y.xb)(p)?l:p,m=e=>h.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return a.isOnlyShow?t().createElement(fa,{value:m(r),bordered:c}):t().createElement(N.Checkbox.Group,{value:r,style:{width:"100%",...s},disabled:u,onChange:e=>{(e=>{null==n||n(e),i(e,m(e))})(e)}},h.map((e=>t().createElement(N.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class fr extends e.Component{constructor(){super(...arguments),hr(this,"state",{itemList:[]})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,a;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,l=null===(a=this.props.option.request)||void 0===a?void 0:a.params;(0,ca.isEqual)(r,l)||this.getItemList()}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:a={},dataKey:r,valueKey:l="value",textKey:n="text",callback:i}=e;if(t)try{const e=await t(a);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,r)??[],a=t.map((e=>({value:e[l],text:e[n]})));this.setState({itemList:a},(()=>null==i?void 0:i(t)))}}catch(e){}}render(){const{$$form:e}=this.context,{itemList:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(h)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(mr,{option:this.props.option,items:a,onValuesChange:(t,a)=>{m(t),e.setViewValue(i,a)}}))),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}hr(fr,"contextType",Ft);const gr=fr,br=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},allowClear:s=!0,readOnly:c,disabled:d}=e.option,{allowHalf:u,count:p=5,tooltips:h}=i;return t().createElement(N.Rate,{value:r,count:p,style:o,allowHalf:u,allowClear:s,tooltips:h,disabled:d||a.isOnlyShow,onChange:e=>{(e=>{var t;null==l||l(e),n(e,(t=e,h?h[Math.ceil(t)-1]:t.toString()))})(e)}})};class yr extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(br,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(yr,"contextType",Ft);const vr=yr;function xr(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const Er=e=>{const{$$form:a}=t().useContext(Ft),{value:r,items:l,onChange:n,onValuesChange:i}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u}=e.option,{itemList:p=[]}=o,h=(0,Y.xb)(p)?l:p,m=e=>{var t;return(null===(t=h.find((t=>t.value===e)))||void 0===t?void 0:t.text)??""};return a.isOnlyShow?t().createElement(fa,{value:m(r),bordered:c}):t().createElement(N.Radio.Group,{value:r,style:{width:"100%",...s},disabled:u||a.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==n||n(e),i(e,m(e))})(t)}},h.map((e=>t().createElement(N.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Cr extends e.Component{constructor(){super(...arguments),xr(this,"state",{itemList:[]}),xr(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:a={},dataKey:r,valueKey:l="value",textKey:n="text",callback:i}=e;if(t)try{const e=await t(a);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,r)??[],a=t.map((e=>({value:e[l],text:e[n]})));this.setState({itemList:a},(()=>null==i?void 0:i(t)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,a;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,l=null===(a=this.props.option.request)||void 0===a?void 0:a.params;(0,ca.isEqual)(r,l)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(h)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(Er,{option:this.props.option,items:a,onValuesChange:(t,a)=>{m(t),e.setViewValue(i,a)}}))),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}xr(Cr,"contextType",Ft);const Sr=Cr,wr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},disabled:s}=e.option,{falseValue:c=Ut,trueValue:u=Vt}=i;return t().createElement(N.Switch,{checked:r===u,style:o,disabled:s||a.isOnlyShow,checkedChildren:t().createElement(ce.CheckOutlined,null),unCheckedChildren:t().createElement(ce.CloseOutlined,null),onChange:e=>{(e=>{null==l||l(e),n(e,d(e===u?"am.form.trueText":"am.form.falseText"))})(e?u:c)}})};class Tr extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(wr,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Tr,"contextType",Ft);const Nr=Tr,Ir=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:u,readOnly:p,disabled:h,onBlur:m=Y.ZT,onEnter:f=Y.ZT}=e.option,{showCount:g,maxLength:b,autoSize:y}=i,v=Object.assign({},{minRows:1,maxRows:3},y);return t().createElement(N.Input.TextArea,{value:r,placeholder:s,style:o,maxLength:b,showCount:g,autoSize:v,bordered:c,allowClear:u,readOnly:p||a.isOnlyShow,disabled:h,onBlur:t=>{const{value:a}=t.target;(t=>{const{onBlur:a}=e;null==a||a(t)})(a),m(a)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;f(t)}},onChange:e=>{const{value:t}=e.target;(e=>{null==l||l(e),n(e)})(t)}})};class _r extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Ir,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(n,t)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(_r,"contextType",Ft);const Rr=_r,Pr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:o={},style:s={},placeholder:c=d("qm.form.datePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=e.option,{dateType:f="date",minDateTime:g,maxDateTime:b,shortCuts:y=!0}=o,v=t().createRef(),x=e=>{e&&"date"===f&&(e+=" 00:00:00"),null==l||l(e),n(e,E(e))},E=e=>ea(e)?"":["date","exactdate"].includes(f)?e.slice(0,10):e,C=e=>{let t=Jt(i()().subtract(e,"day"),Gt[f]);"date"===f&&(t=t.slice(0,10)),x(t),v.current.blur(),v.current.focus()};return a.isOnlyShow?t().createElement(fa,{value:E(r),bordered:u}):t().createElement(H,{ref:v,style:{width:"100%",...s},picker:Wt[f],bordered:u,showToday:!1,showTime:"datetime"===f,allowClear:p,disabled:m,inputReadOnly:h,disabledDate:e=>((e,t)=>{let[a,r]=t;return a&&r?e.isBefore(a,"day")||e.isAfter(r,"day"):a?e.isBefore(a,"day"):!!r&&e.isAfter(r,"day")})(e,[g,b]),renderExtraFooter:y?()=>t().createElement(t().Fragment,null,t().createElement(N.Tag,{color:"processing",onClick:()=>C(0)},d("qm.form.datePickers")[0]),t().createElement(N.Tag,{color:"processing",onClick:()=>C(1)},d("qm.form.datePickers")[1]),t().createElement(N.Tag,{color:"processing",onClick:()=>C(7)},d("qm.form.datePickers")[2]),t().createElement(N.Tag,{color:"processing",onClick:()=>C(30)},d("qm.form.datePickers")[3])):void 0,value:Qt(r,Gt[f]),onChange:(e,t)=>{x(t)}})};class Or extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Pr,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Or,"contextType",Ft);const Ar=Or,kr=e=>[i()().subtract(e,"day"),i()()],Hr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.daterangePlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{dateType:m="date",disableds:f=[!1,!1],minDateTime:g,maxDateTime:b,shortCuts:y=!0}=i,v={[d("qm.form.dateRangePickers")[0]]:kr(7),[d("qm.form.dateRangePickers")[1]]:kr(30),[d("qm.form.dateRangePickers")[2]]:kr(90),[d("qm.form.dateRangePickers")[3]]:kr(180)},x=e=>ea(e)?"":e.map((e=>["date","exactdate"].includes(m)?null==e?void 0:e.slice(0,10):e)).join(" - ");return a.isOnlyShow?t().createElement(fa,{value:x(r),bordered:c}):t().createElement(H.RangePicker,{style:{width:"100%",...o},picker:Wt[m],bordered:c,showTime:"datetime"===m,allowClear:u,disabled:h?[!0,!0]:f,inputReadOnly:p,disabledDate:e=>((e,t)=>{let[a,r]=t;return a&&r?e.isBefore(a,"day")||e.isAfter(r,"day"):a?e.isBefore(a,"day"):!!r&&e.isAfter(r,"day")})(e,[g,b]),ranges:y?v:void 0,value:(0,Y.xb)(r)?null:[Qt(null==r?void 0:r[0],Gt[m]),Qt(null==r?void 0:r[1],Gt[m])],onChange:(e,t)=>{(e=>{"date"===m&&(e=e.map(((e,t)=>e?0===t?e+" 00:00:00":e+" 23:59:59":e))),e.every((e=>!e))&&(e=[]),null==l||l(e),n(e,x(e))})(t)}})};class Fr extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Hr,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Fr,"contextType",Ft);const Lr=Fr,qr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.timePlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{timeType:m="hour-minute-second",hourStep:f=1,minuteStep:g=1,secondStep:b=1}=i;return a.isOnlyShow?t().createElement(fa,{value:r,bordered:c}):t().createElement(D,{style:{width:"100%",...o},bordered:c,showNow:!0,hourStep:f,minuteStep:g,secondStep:b,allowClear:u,disabled:h,inputReadOnly:p,format:Yt[m],value:Qt(r,Yt[m]),onChange:(e,t)=>{(e=>{const t=Jt(e,Yt[m]);null==l||l(t),n(t)})(e)}})};class Dr extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(qr,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(n,t)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Dr,"contextType",Ft);const $r=Dr,Mr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.timerangePlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{timeType:m="hour-minute-second",disableds:f=[!1,!1],hourStep:g=1,minuteStep:b=1,secondStep:y=1}=i,v=e=>ea(e)?"":e.join(" - ");return a.isOnlyShow?t().createElement(fa,{value:v(r),bordered:c}):t().createElement(D.RangePicker,{style:{width:"100%",...o},bordered:c,showNow:!1,hourStep:g,minuteStep:b,secondStep:y,allowClear:u,disabled:h?[!0,!0]:f,inputReadOnly:p,format:Yt[m],value:(0,Y.xb)(r)?null:[Qt(null==r?void 0:r[0],Yt[m]),Qt(null==r?void 0:r[1],Yt[m])],onChange:(e,t)=>{(e=>{const t=[Jt(null==e?void 0:e[0],Yt[m]),Jt(null==e?void 0:e[1],Yt[m])];null==l||l(t),n(t,v(t))})(e)}})};class Kr extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Mr,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Kr,"contextType",Ft);const Vr=Kr,Ur={PINYINS:["A","AI","AN","ANG","AO","BA","BAI","BAN","BANG","BAO","BEI","BEN","BENG","BI","BIAN","BIAO","BIE","BIN","BING","BO","BU","CA","CAI","CAN","CANG","CAO","CE","CEN","CENG","CHA","CHAI","CHAN","CHANG","CHAO","CHE","CHEN","CHENG","CHI","CHONG","CHOU","CHU","CHUA","CHUAI","CHUAN","CHUANG","CHUI","CHUN","CHUO","CI","CONG","COU","CU","CUAN","CUI","CUN","CUO","DA","DAI","DAN","DANG","DAO","DE","DEN","DENG","DI","DIAN","DIAO","DIE","DING","DIU","DONG","DOU","DU","DUAN","DUI","DUN","DUO","E","EI","EN","ENG","ER","FA","FAN","FANG","FEI","FEN","FENG","FIAO","FO","FOU","FU","GA","GAI","GAN","GANG","GAO","GE","GEI","GEN","GENG","GONG","GOU","GU","GUA","GUAI","GUAN","GUANG","GUI","GUN","GUO","HA","HAI","HAN","HANG","HAO","HE","HEI","HEN","HENG","HM","HONG","HOU","HU","HUA","HUAI","HUAN","HUANG","HUI","HUN","HUO","JI","JIA","JIAN","JIANG","JIAO","JIE","JIN","JING","JIONG","JIU","JU","JUAN","JUE","JUN","KA","KAI","KAN","KANG","KAO","KE","KEN","KENG","KONG","KOU","KU","KUA","KUAI","KUAN","KUANG","KUI","KUN","KUO","LA","LAI","LAN","LANG","LAO","LE","LEI","LENG","LI","LIA","LIAN","LIANG","LIAO","LIE","LIN","LING","LIU","LO","LONG","LOU","LU","LV","LUAN","LVE","LUN","LUO","M","MA","MAI","MAN","MANG","MAO","ME","MEI","MEN","MENG","MI","MIAN","MIAO","MIE","MIN","MING","MIU","MO","MOU","MU","N","NA","NAI","NAN","NANG","NAO","NE","NEI","NEN","NENG","NI","NIAN","NIANG","NIAO","NIE","NIN","NING","NIU","NONG","NOU","NU","NV","NUAN","NVE","NUN","NUO","O","OU","PA","PAI","PAN","PANG","PAO","PEI","PEN","PENG","PI","PIAN","PIAO","PIE","PIN","PING","PO","POU","PU","QI","QIA","QIAN","QIANG","QIAO","QIE","QIN","QING","QIONG","QIU","QU","QUAN","QUE","QUN","RAN","RANG","RAO","RE","REN","RENG","RI","RONG","ROU","RU","RUA","RUAN","RUI","RUN","RUO","SA","SAI","SAN","SANG","SAO","SE","SEN","SENG","SHA","SHAI","SHAN","SHANG","SHAO","SHE","SHEN","SHENG","SHI","SHOU","SHU","SHUA","SHUAI","SHUAN","SHUANG","SHUI","SHUN","SHUO","SI","SONG","SOU","SU","SUAN","SUI","SUN","SUO","TA","TAI","TAN","TANG","TAO","TE","TENG","TI","TIAN","TIAO","TIE","TING","TONG","TOU","TU","TUAN","TUI","TUN","TUO","WA","WAI","WAN","WANG","WEI","WEN","WENG","WO","WU","XI","XIA","XIAN","XIANG","XIAO","XIE","XIN","XING","XIONG","XIU","XU","XUAN","XUE","XUN","YA","YAN","YANG","YAO","YE","YI","YIN","YING","YO","YONG","YOU","YU","YUAN","YUE","YUN","ZA","ZAI","ZAN","ZANG","ZAO","ZE","ZEI","ZEN","ZENG","ZHA","ZHAI","ZHAN","ZHANG","ZHAO","ZHE","ZHEN","ZHENG","ZHI","ZHONG","ZHOU","ZHU","ZHUA","ZHUAI","ZHUAN","ZHUANG","ZHUI","ZHUN","ZHUO","ZI","ZONG","ZOU","ZU","ZUAN","ZUI","ZUN","ZUO",""],UNIHANS:["阿","哎","安","肮","凹","八","挀","扳","邦","勹","陂","奔","伻","屄","边","灬","憋","汃","冫","癶","峬","嚓","偲","参","仓","撡","冊","嵾","曽","叉","芆","辿","伥","抄","车","抻","阷","吃","充","抽","出","欻","揣","巛","刅","吹","旾","逴","呲","匆","凑","粗","汆","崔","邨","搓","咑","呆","丹","当","刀","嘚","扥","灯","氐","甸","刁","爹","丁","丟","东","吺","厾","耑","垖","吨","多","妸","诶","奀","鞥","儿","发","帆","匚","飞","分","丰","覅","仏","紑","夫","旮","侅","甘","冈","皋","戈","给","根","刯","工","勾","估","瓜","乖","关","光","归","丨","呙","哈","咍","佄","夯","茠","诃","黒","拫","亨","噷","叿","齁","乎","花","怀","欢","巟","灰","昏","吙","丌","加","戋","江","艽","阶","巾","坕","冂","丩","凥","姢","噘","军","咔","开","刊","忼","尻","匼","肎","劥","空","抠","扝","夸","蒯","宽","匡","亏","坤","扩","垃","来","兰","啷","捞","肋","勒","崚","哩","俩","奁","良","撩","毟","拎","伶","溜","囖","龙","瞜","噜","驴","娈","掠","抡","罗","呣","妈","埋","嫚","牤","猫","么","呅","门","甿","咪","宀","喵","乜","民","名","谬","摸","哞","毪","嗯","拏","腉","囡","囔","孬","疒","娞","恁","能","妮","拈","娘","鸟","捏","囜","宁","妞","农","羺","奴","女","奻","疟","黁","挪","喔","讴","妑","拍","眅","乓","抛","呸","喷","匉","丕","囨","剽","氕","姘","乒","钋","剖","仆","七","掐","千","呛","悄","癿","亲","靑","卭","丘","区","峑","缺","夋","呥","穣","娆","惹","人","扔","日","茸","厹","邚","挼","堧","婑","瞤","捼","仨","毢","三","桒","掻","閪","森","僧","杀","筛","山","伤","弰","奢","申","升","尸","収","书","刷","衰","闩","双","脽","吮","说","厶","忪","捜","苏","狻","夊","孙","唆","他","囼","坍","汤","夲","忑","熥","剔","天","旫","帖","厅","囲","偷","凸","湍","推","吞","乇","穵","歪","弯","尣","危","昷","翁","挝","乌","夕","虲","仙","乡","灱","些","心","星","凶","休","吁","吅","削","坃","丫","恹","央","幺","倻","一","囙","应","哟","佣","优","扜","囦","曰","晕","帀","災","兂","匨","傮","则","贼","怎","増","扎","捚","沾","张","佋","蜇","贞","争","之","中","州","朱","抓","拽","专","妆","隹","宒","卓","乲","宗","邹","租","钻","厜","尊","昨","兙"],EXCEPTIONS:{曾:"ZENG",沈:"SHEN",嗲:"DIA",碡:"ZHOU",聒:"GUO",炔:"QUE",蚵:"KE",砉:"HUA",嬤:"MO",嬷:"MO",蹒:"PAN",蹊:"XI",丬:"PAN",霰:"XIAN",莘:"XIN",豉:"CHI",饧:"XING",筠:"JUN",长:"CHANG",帧:"ZHEN",峙:"SHI",郍:"NA",芎:"XIONG",谁:"SHUI"}};let jr,zr=null;function Br(e){return e||null===zr?("object"==typeof Intl&&Intl.Collator?(jr=new Intl.Collator(["zh-Hans-CN","zh-CN"]),zr=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):zr=!1,zr):zr}function Wr(e){const t=Ur.UNIHANS,a=Ur.PINYINS,r=Ur.EXCEPTIONS,l={source:e};if(e in r)return l.type=2,l.target=r[e],l;let n,i=-1;if(e.charCodeAt(0)<256)return l.type=1,l.target=e,l;if(n=jr.compare(e,"阿"),n<0)return l.type=3,l.target=e,l;if(0===n)l.type=2,i=0;else{if(n=jr.compare(e,"鿿"),n>0)return l.type=3,l.target=e,l;0===n&&(l.type=2,i=t.length-1)}if(l.type=2,i<0){let a=0,r=t.length-1;for(;a<=r;){i=~~((a+r)/2);const l=t[i];if(n=jr.compare(e,l),0===n)break;n>0?a=i+1:r=i-1}}return n<0&&i--,l.target=a[i],l.target||(l.type=3,l.target=l.source),l}function Gr(e){return"string"==typeof e&&Br()?e.split("").map((e=>Wr(e))):e}const Yr={isSupported:Br,parse:Gr,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Ur)})))},genToken:Wr,convertToPinyin:(e,t,a)=>Gr(e).map((e=>t&&2===e.type?e.target.toLowerCase():e.target)).join(a||"")},Zr={patcher:function(e){e.EXCEPTIONS={嗲:"DIA",碡:"ZHOU",聒:"GUO",炔:"QUE",蚵:"KE",砉:"HUA",嬷:"MO",蹊:"XI",丬:"PAN",霰:"XIAN",豉:"CHI",饧:"XING",帧:"ZHEN",芎:"XIONG",谁:"SHUI",钶:"KE"},e.UNIHANS[91]="伕",e.UNIHANS[347]="仚",e.UNIHANS[393]="诌",e.UNIHANS[39]="婤",e.UNIHANS[50]="腠",e.UNIHANS[369]="攸",e.UNIHANS[123]="乯",e.UNIHANS[171]="刕",e.UNIHANS[102]="佝",e.UNIHANS[126]="犿",e.UNIHANS[176]="列",e.UNIHANS[178]="刢",e.UNIHANS[252]="娝",e.UNIHANS[330]="偸"},shouldPatch:function(e){return"function"==typeof e&&"FOU"===e("伕").target&&"XIA"===e("仚").target&&"ZHONG"===e("诌").target&&"CHONG"===e("婤").target&&"CONG"===e("腠").target&&"YONG"===e("攸").target&&"HOU"===e("乯").target&&"LENG"===e("刕").target&&"GONG"===e("佝").target&&"HUAI"===e("犿").target&&"LIAO"===e("列").target&&"LIN"===e("刢").target&&"E"===e("钶").target}};Yr.isSupported()&&Zr.shouldPatch(Yr.genToken)&&Yr.patchDict(Zr);const Xr=Yr;function Qr(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Jr(){return Jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Jr.apply(this,arguments)}const{Option:el}=N.Select,tl=e=>{const{$$form:a}=t().useContext(Ft),{value:r,items:l,multiple:n,loading:i,onChange:o,onValuesChange:s}=e,{options:c={},style:u={},placeholder:p=d("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,readOnly:f,disabled:g}=e.option,{itemList:b=[],filterable:y=!0,listHeight:v=jt,collapseTags:x,maxTagTextLength:E,openPyt:C=!0}=c,S=(0,Y.xb)(b)?l:b,w=e=>{var t;return n?S.filter((t=>null==e?void 0:e.includes(t.value))).map((e=>e.text)).join(","):(null===(t=S.find((t=>t.value===e)))||void 0===t?void 0:t.text)||""};return a.isOnlyShow?t().createElement(fa,{value:w(r),bordered:h}):t().createElement(N.Select,Jr({value:r,mode:n?"multiple":void 0,placeholder:p,style:u,loading:i,bordered:h,allowClear:m,disabled:g,showSearch:y,listHeight:v,maxTagCount:x?"responsive":void 0,maxTagTextLength:E},n?{title:w(r)}:null,{filterOption:(e,t)=>{var a;const r=(null==t||null===(a=t.children)||void 0===a?void 0:a.toString())||"",l=Xr.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(C?`${r}|${l}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,w(e),S)})(e)}}),S.map((e=>t().createElement(el,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class al extends e.Component{constructor(){super(...arguments),Qr(this,"state",{itemList:[],loading:!1}),Qr(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:a={},dataKey:r,valueKey:l="value",textKey:n="text",callback:i}=e;if(t){this.setState({loading:!0});try{const e=await t(a);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,r)??[],a=t.map((e=>({value:e[l],text:e[n]})));this.setState({itemList:a},(()=>null==i?void 0:i(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,a;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,l=null===(a=this.props.option.request)||void 0===a?void 0:a.params;(0,ca.isEqual)(r,l)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:a,loading:r}=this.state,{type:l,label:n,tooltip:i,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,buttonAfter:h,validateTrigger:m,rules:f=[],onChange:g=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(n),className:oe()(o,u),tooltip:i,hidden:s,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(d)},required:e.getFormItemRequired(f)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:o,noStyle:!0,rules:f,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(n)}},t().createElement(tl,{option:this.props.option,items:a,loading:r,multiple:this.props.multiple,onValuesChange:(t,a,r)=>{g(t,a,r),e.setViewValue(o,a)}}))),h&&t().createElement(N.Col,null,e.renderFormItemButton(o,h)),p&&t().createElement(N.Col,{flex:(0,Y.PM)(p.labelWidth||Kt)},e.renderFormItemExtra({fieldName:o,...p}))))}}Qr(al,"contextType",Ft);const rl=al;function ll(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class nl extends e.Component{constructor(e){super(e),ll(this,"searchHelper",void 0),ll(this,"alias",void 0),ll(this,"extras",void 0),ll(this,"valueKey",void 0),ll(this,"prevValue",""),ll(this,"_record",void 0),ll(this,"_prevValue",void 0),ll(this,"searchRef",t().createRef()),ll(this,"state",{itemList:[],visible:!1,loading:!1,activeIndex:0}),ll(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props,{fieldName:t,options:a,searchHelper:r}=this.props.option;this.searchHelper=Object.assign({},e,a,r);const{fieldAliasMap:l,extraAliasMap:n,fieldsDefine:i}=this.searchHelper;if(l||m("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof l?l():l||{},this.extras="function"==typeof n?n():n||{},i){const e=["valueKey","displayKey","extraKey"];for(const t in i)e.includes(t)&&(this[t]=i[t])}Object.keys(this.alias).includes(t)||m("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),this.searchHelper.echoRequest&&!this.valueKey&&m("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),ll(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),ll(this,"getLatestRequest",(()=>{var e;const{request:t,searchHelper:a}=this.props.option;return Object.assign({},null===(e=this.searchHelper)||void 0===e?void 0:e.request,t,null==a?void 0:a.request)})),ll(this,"getItemText",(async()=>{await this.props.waiting();const e=this.getItemValue();if(e===this._prevValue)return;this._prevValue=e;const{fetchApi:t,params:a={},formatter:r=(e=>e),dataKey:l,fieldAliasMap:n,extraAliasMap:i}=this.searchHelper.echoRequest||{},o="function"==typeof n?n():n||{},s="function"==typeof i?i():i||{},{value:c}=this.props;if(t&&!c&&e)try{const n=await t(r({...a,key:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:(0,Y.U2)(n.data,l)??[];if(e[0]){const t=e[0];o&&aa(t,this.alias,o),s&&ra(t,this.extras,s),this._record=t,this.setFieldsValue(t)}}}catch(e){}})),ll(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;for(const r in this.alias){const l=ta(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:l}),r===a&&t.setViewValue(a,l)}for(const a in this.extras)t.SET_FIELDS_EXTRA({[a]:ta(e,this.extras[a])});this._record=e,this.prevValue=ta(e,this.alias[a])??""})),ll(this,"fetchHandle",(0,Y.Ds)(this.getItemList,200)),ll(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),ll(this,"triggerChange",((e,t)=>{const{onChange:a,onValuesChange:r}=this.props;null==a||a(e),t&&r(e,this._record)})),ll(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),ll(this,"clickHandle",((e,t)=>{const{$$form:a}=this.context,{fieldName:r}=this.props.option;for(const t in this.alias)t!==r&&a.SET_FIELDS_VALUE({[t]:ta(e,this.alias[t])});for(const t in this.extras)a.SET_FIELDS_EXTRA({[t]:ta(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const l=ta(e,this.alias[r]);this.prevValue=l??"",this.triggerChange(l,!0),t&&t()})),this.initialHandle()}componentDidMount(){this.getItemText()}componentDidUpdate(e){var t,a,r,l,n,i;const o=(null===(t=e.option.searchHelper)||void 0===t||null===(a=t.request)||void 0===a?void 0:a.params)||(null===(r=e.option.request)||void 0===r?void 0:r.params),s=(null===(l=this.props.option.searchHelper)||void 0===l||null===(n=l.request)||void 0===n?void 0:n.params)||(null===(i=this.props.option.request)||void 0===i?void 0:i.params);(0,ca.isEqual)(o,s)||this.getItemList(),this.getItemText()}async getItemList(e){const{fieldName:t}=this.props.option,{fetchApi:a,params:r={},formatter:l=(e=>e),dataKey:n}=this.getLatestRequest();if(a){this.setState({loading:!0});try{const i=await a(l({...r,[t]:e}));if(200===i.code){const e=Array.isArray(i.data)?i.data:(0,Y.U2)(i.data,n)??[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}render(){var e;const{$$form:a}=this.context,{visible:r,loading:n,itemList:i}=this.state,{value:o}=this.props,{options:s={},style:c={},placeholder:u=d("qm.form.inputPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:f}=this.props.option,{hideHeader:g,onlySelect:b=!0,listHeight:y=jt}=s,v=(null===(e=this.searchHelper)||void 0===e?void 0:e.columns)||[],x=se("form-immediate"),E=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,C=t().createElement(N.Spin,{spinning:n},i.length?t().createElement("table",{cellSpacing:0,cellPadding:0,className:oe()("table")},!g&&t().createElement("thead",null,t().createElement("tr",null,v.filter((e=>!e.hidden)).map((e=>t().createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),t().createElement("tbody",null,i.map(((e,a)=>t().createElement("tr",{key:a,className:this.state.activeIndex===a?"active":"",onMouseEnter:()=>{this.setState({activeIndex:a})},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},v.filter((e=>!e.hidden)).map((a=>t().createElement("td",{key:a.dataIndex},(0,Y.U2)(e,a.dataIndex))))))))):t().createElement(Ze,null));return t().createElement(l.Consumer,null,(e=>{const l={[x]:!0,[`${x}--lg`]:"large"===(null==e?void 0:e.size),[`${x}--sm`]:"small"===(null==e?void 0:e.size)};return a.isOnlyShow?t().createElement(fa,{value:o,bordered:p}):t().createElement(Ua(),{action:f?[]:["click"],popupVisible:!f&&r,popup:C,popupClassName:oe()(l),popupStyle:{minWidth:E,maxHeight:y},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Bt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(N.Input,{ref:this.searchRef,placeholder:u,allowClear:h,bordered:p,readOnly:m,disabled:f,style:{width:"100%",...c},value:o,title:o,onFocus:()=>{!i.length&&this.fetchHandle(o)},onBlur:e=>{const{value:t}=e.target;b&&t!==this.prevValue&&this.triggerChange(this.prevValue,!1),this.triggerBlur(t)},onKeyUp:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(i[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const a=40===e.keyCode?++t%i.length:(--t+i.length)%i.length;this.setState({activeIndex:a})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),t?(this.handleVisibleChange(!0),this.triggerChange(t,!b)):this.clickHandle(null)}}))}))}}ll(nl,"contextType",Ft);class il extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),ll(this,"promiseRef",void 0),ll(this,"state",{searchHelper:{}}),ll(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),ll(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(nl,{option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;f(t,a),e.setViewValue(i,t)}}))),p&&t().createElement(N.Col,null,e.renderFormItemButton(i,p)),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}ll(il,"contextType",Ft);const ol=il;class sl extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,fieldName:l,className:n,style:i={},collapse:o={}}=this.props.option,{expand:s}=e.state,{showLimit:c,remarkItems:d=[],onCollapse:u=Y.ZT}=o,p=[];if(d.length){const t=e.getBlockDerivedItems().find((e=>e[0].fieldName===l))??[],a=c??t.length-1;t.slice(a+1).forEach((t=>{const a=d.find((e=>e.fieldName===t.fieldName));if(!a)return;const r=a.showLabel?`${t.label}:`:"",l=e.getViewValue(t.fieldName)??"";""!==l&&p.push({...t,text:`${r}${l}`})}))}return t().createElement(N.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},t().createElement(pe,{id:l,label:r,className:n,extra:p.map((e=>e.text)).join(" | "),style:{...i},collapse:s[l],onCollapseChange:t=>{e.setState((e=>({expand:Object.assign({},e.expand,{[l]:t})}))),u(t)}}))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(sl,"contextType",Ft);const cl=sl;function dl(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function ul(){return ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ul.apply(this,arguments)}const pl=(e,t,a,r)=>e.map((e=>e[a]===t?{...e,children:r}:e.children?{...e,children:pl(e.children,t,a,r)}:e)),hl=e=>{const{$$form:a}=t().useContext(Ft),{value:r,items:l,multiple:n,loading:i,onChange:o,onValuesChange:s}=e,{options:c={},style:u={},placeholder:p=d("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,asyncLoad:f,readOnly:g,disabled:b}=e.option,{itemList:y,filterable:v=!0,listHeight:x=jt,checkStrictly:E,checkStrategy:C="SHOW_CHILD",collapseTags:S,openPyt:w=!0}=c,[T,I]=t().useState((0,Y.xb)(y)?l:y);Se((()=>{I((0,Y.xb)(y)?l:y)}),[y,l]);const _=e=>{var t;return(null===(t=na(T,e))||void 0===t?void 0:t.text)||""},R=e=>n?e.map((e=>_(e))).filter((e=>!!e)).join(","):_(e);return a.isOnlyShow?t().createElement(fa,{value:R(r),bordered:h}):t().createElement(N.TreeSelect,ul({fieldNames:{label:"text",value:"value",children:"children"},value:r,multiple:n,treeCheckable:n,treeCheckStrictly:E,showCheckedStrategy:N.TreeSelect[C],placeholder:p,listHeight:x,style:u,loading:i,bordered:h,allowClear:m,disabled:b,treeDefaultExpandAll:!f,showSearch:v,maxTagCount:S?"responsive":void 0,loadData:f?async e=>{let{key:t,children:a}=e;if(!f||a)return;const{fetchApi:r,params:l,dataKey:n,textKey:i="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=f;if(r)try{const e=await r(c({...l,[o]:t}));if(200===e.code){const a=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,n)??[],r=pl(T,t,o,la(a,o,i));I(r),null==s||s(a)}}catch(e){}}:void 0,treeData:T},n?{title:R(r)}:null,{filterTreeNode:(e,t)=>{var a;const r=(null==t||null===(a=t.text)||void 0===a?void 0:a.toString())||"",l=Xr.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(w?`${r}|${l}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,R(e),T)})(e)}}))};class ml extends e.Component{constructor(){super(...arguments),dl(this,"state",{itemList:[],loading:!1}),dl(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:a={},dataKey:r,valueKey:l="value",textKey:n="text",callback:i}=e;if(t){this.setState({loading:!0});try{const e=await t(a);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,r)??[],a=la(t,l,n);this.setState({itemList:a},(()=>null==i?void 0:i(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,a;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,l=null===(a=this.props.option.request)||void 0===a?void 0:a.params;(0,ca.isEqual)(r,l)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:a,loading:r}=this.state,{type:l,label:n,tooltip:i,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(n),className:oe()(o,u),tooltip:i,hidden:s,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(d)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:o,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},t().createElement(hl,{option:this.props.option,items:a,loading:r,multiple:this.props.multiple,onValuesChange:(t,a,r)=>{f(t,a,r),e.setViewValue(o,a)}}))),p&&t().createElement(N.Col,{flex:(0,Y.PM)(p.labelWidth||Kt)},e.renderFormItemExtra({fieldName:o,...p}))))}}dl(ml,"contextType",Ft);const fl=ml;function gl(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function bl(){return bl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},bl.apply(this,arguments)}const yl=e=>{const{$$form:a}=t().useContext(Ft),{value:r,multiple:l,items:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.selectPlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{changeOnSelect:m,checkStrictly:f,checkStrategy:g="SHOW_PARENT",filterable:b=!0,openPyt:y=!0}=i,{itemList:v=[]}=i,x=(0,Y.xb)(v)?n:v,E=e=>(0,Y.xb)(e)?"":l?e.map((e=>ia(x,e).map((e=>e.text)).join("/"))).join(","):ia(x,e).map((e=>e.text)).join("/");return a.isOnlyShow?t().createElement(fa,{value:E(r),bordered:c}):t().createElement(N.Cascader,bl({value:(e=>(0,Y.xb)(e)?[]:l?e.map((e=>e.split(","))):e.split(","))(r),fieldNames:{label:"text",value:"value",children:"children"},options:x,multiple:l,maxTagCount:"responsive",changeOnSelect:m||f,showCheckedStrategy:N.Cascader[g],placeholder:s,style:o,bordered:c,allowClear:u,disabled:h,showSearch:b&&{filter:(e,t)=>t.some((t=>{var a;const r=(null==t||null===(a=t.text)||void 0===a?void 0:a.toString())||"",l=Xr.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(y?`${r}|${l}`:r).toLowerCase().indexOf(e.toLowerCase())>=0}))}},l?{title:E(r)}:null,{onChange:t=>{(t=>{const{onChange:a,onValuesChange:r}=e;null==a||a(t),r(t,E(t),x)})(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return l?e.map((e=>e.join(","))):e.join(",")}(t))}}))};class vl extends e.Component{constructor(){super(...arguments),gl(this,"state",{itemList:[],loading:!1}),gl(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:a={},dataKey:r,valueKey:l="value",textKey:n="text",callback:i}=e;if(t){this.setState({loading:!0});try{const e=await t(a);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,r)??[],a=la(t,l,n);this.setState({itemList:a},(()=>null==i?void 0:i(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,a;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,l=null===(a=this.props.option.request)||void 0===a?void 0:a.params;(0,ca.isEqual)(r,l)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:a}=this.props,{itemList:r}=this.state,{type:l,label:n,tooltip:i,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(n),className:oe()(o,u),tooltip:i,hidden:s,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(d)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:o,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},t().createElement(yl,{option:this.props.option,multiple:a,items:r,onValuesChange:(t,a,r)=>{f(t,a,r),e.setViewValue(o,a)}}))),p&&t().createElement(N.Col,{flex:(0,Y.PM)(p.labelWidth||Kt)},e.renderFormItemExtra({fieldName:o,...p}))))}}gl(vl,"contextType",Ft);const xl=vl,El=require("china-area-data");var Cl=__webpack_require__.n(El);function Sl(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const wl=["110000","120000","310000","500000"],Tl=["810000","820000"],Nl=[{text:"A",value:"A"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"L",value:"L"},{text:"N",value:"N"},{text:"Q",value:"Q"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Il=[{text:"A",value:"A"},{text:"B",value:"B"},{text:"C",value:"C"},{text:"D",value:"D"},{text:"E",value:"E"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"K",value:"K"},{text:"L",value:"L"},{text:"M",value:"M"},{text:"N",value:"N"},{text:"P",value:"P"},{text:"Q",value:"Q"},{text:"R",value:"R"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"W",value:"W"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],_l=e=>Xr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Rl=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(a>2||!e[t])return;const r="86"===t?Object.keys(e[t]).filter((e=>![...wl,...Tl].includes(e))):Object.keys(e[t]);return r.map((r=>({l:_l(e[t][r].slice(0,1)).toUpperCase(),n:e[t][r],c:r,p:t,children:Rl(e,r,a+1)})))},Pl=(e,t)=>t.map((t=>({l:_l(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Ol extends e.Component{constructor(e){super(e),Sl(this,"searchRef",t().createRef()),Sl(this,"scrollRef",t().createRef()),Sl(this,"zxsAndGa",void 0),Sl(this,"provinces",void 0),Sl(this,"allCities",void 0),Sl(this,"letterCities",void 0),Sl(this,"state",{visible:!1,select_type:"0",active_key:""}),Sl(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),Sl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props;null==t||t(e),a(e,this.createTextValue(e)),this.handleVisibleChange(!1)})),this.zxsAndGa=this.createZxsAndGa(),this.provinces=this.createProvince(),this.allCities=this.createAllCity(),this.letterCities=this.createCity()}componentDidMount(){this.setInputReadonly()}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),ct()(this[`${e}Ref`],{block:"start",behavior:"smooth",boundary:this.scrollRef.current})}clickHadnle(e){this.triggerChange(e)}createTextValue(e){var t;return(null===(t=this.allCities.find((t=>t.c===e)))||void 0===t?void 0:t.n)||""}createZxsAndGa(){return[{l:"Z1",n:"直辖市",c:"",p:"",children:Pl(Cl(),wl)},{l:"Z2",n:"港澳",c:"",p:"",children:Pl(Cl(),Tl)}]}createProvince(){return(Rl(Cl(),"86")??[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Il.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...wl,...Tl].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return t().createElement(N.Radio.Group,{size:"small",buttonStyle:"solid",value:e,onChange:e=>{const{value:t}=e.target;this.setState({select_type:t,active_key:""},(()=>{this.scrollRef.current.scrollTop=0}))}},t().createElement(N.Radio.Button,{value:"0"},d("qm.form.citySelectType.0")),t().createElement(N.Radio.Button,{value:"1"},d("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:a}=this.state;return("0"===a?Nl:Il).map((a=>t().createElement("li",{key:a.value,className:oe()({tag:!0,actived:a.value===e}),onClick:()=>this.scrollHandle(a.value.toString())},a.text)))}renderSelect(){const{value:e}=this.props;return t().createElement(N.Select,{size:"small",placeholder:d("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var a;return((null==t||null===(a=t.children)||void 0===a?void 0:a.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>t().createElement(N.Select.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:a}=this.state;return("0"===a?this.provinces:this.letterCities).map(((a,r)=>{var l;return t().createElement("div",{key:r},t().createElement("dt",{ref:e=>this[`${a.l}Ref`]=e},a.n,":"),t().createElement("dd",null,null===(l=a.children)||void 0===l?void 0:l.map((a=>t().createElement("li",{key:a.c,className:oe()({actived:a.c===e}),onClick:()=>this.clickHadnle(a.c)},a.n)))))}))}render(){const{$$form:e}=this.context,{visible:a}=this.state,{value:r}=this.props,{options:n={},style:i={},placeholder:o=d("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:u,disabled:p}=this.props.option,h=se("form-city-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,f=this.createTextValue(r),g=t().createElement("div",{className:"container",style:{...i}},t().createElement("div",{className:"city-drop"},t().createElement("div",{className:"city-drop-toper"},t().createElement("div",{className:"city-drop-toper__type"},this.renderType()),t().createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),t().createElement("div",{className:"city-drop-letter"},this.renderLetter()),t().createElement("div",{ref:this.scrollRef,className:"city-drop-list"},t().createElement("dl",null,this.renderCity(r)))));return t().createElement(l.Consumer,null,(r=>{const l={[h]:!0,[`${h}--lg`]:"large"===(null==r?void 0:r.size),[`${h}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t().createElement(fa,{value:f,bordered:s}):t().createElement(Ua(),{action:p?[]:["click"],popupVisible:!p&&a,popup:g,popupClassName:oe()(l),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Bt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(N.Input,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,readOnly:u,disabled:p,style:{width:"100%",...i},value:f,title:f,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}}))}))}}Sl(Ol,"contextType",Ft);class Al extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Ol,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}Sl(Al,"contextType",Ft);const kl=Al;function Hl(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const Fl=(e,t)=>{if(e[t])return Object.keys(e[t]).map((a=>({text:e[t][a],value:a,children:Fl(e,a)})))};class Ll extends e.Component{constructor(e){super(e),Hl(this,"searchRef",t().createRef()),Hl(this,"prevText",void 0),Hl(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),Hl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props;null==t||t(e),a(e,this.createTextValue(e)),this.handleVisibleChange(!1)}));const a=Fl(Cl(),"86")||[];this.state={results:a,visible:!1,values:[],tabs:[a.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:a}=this.props;t!==a&&this.state.values.join(",")!==(a??"")&&this.initial()}get isFetch(){var e;return!(null===(e=this.props.option.request)||void 0===e||!e.fetchApi)}get leave(){return this.isFetch?4:3}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var a,r;return null===(a=this.state.tabs[t])||void 0===a||null===(r=a.find((t=>t.value===e)))||void 0===r?void 0:r.text})).join("/")}initial(){const{value:e}=this.props,t=e?e.split(","):[];this.setState({values:t},(()=>{this.createTabs(),this.createActiveName(t.length?t.length-1:0)}))}createActiveName(e){this.setState({activeName:e.toString()})}createTabs(){const{results:e,values:t}=this.state;if(!e.length)return;const a=this.state.tabs.slice(0,1);for(let r=0;r<t.length;r++){const l=na(e,t[r]);if(l&&(0,Y.xb)(l.children)){this.isFetch&&this.getStreetList(t[r]);break}Array.isArray(null==l?void 0:l.children)&&(a[r+1]=null==l?void 0:l.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:a})}async getStreetList(e){const{request:t={}}=this.props.option,{fetchApi:a,formatter:r=(e=>e),dataKey:l,valueKey:n="value",textKey:i="text"}=t;if(a)try{const t=await a(r({code:e}));if(200===t.code){const e=Array.isArray(t.data)?t.data:(0,Y.U2)(t.data,l)??[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[i],value:e[n]})))]})))}}catch(e){}}renderTabs(){const{values:e}=this.state,a=this.state.tabs.map(((a,r)=>{var l;const n=(null===(l=a.find((t=>t.value===e[r])))||void 0===l?void 0:l.text)||`${d("qm.form.selectPlaceholder").replace("...","")}(${d("qm.form.regionSelectLabel")[r]})`;return t().createElement(N.Tabs.TabPane,{key:r.toString(),tab:n},t().createElement("div",{className:"region-box"},a.map((a=>t().createElement("span",{key:a.value,className:oe()({"region-box__item":!0,actived:e.includes(a.value.toString())}),title:a.text,onClick:()=>{let{values:e}=this.state;e[r]=a.value.toString(),e=e.slice(0,r+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.leave-1:this.leave;if(r+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(r+1)}))}},a.text)))))}));return a.length?t().createElement(N.Tabs,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},a):t().createElement(Ze,null)}render(){const{$$form:e}=this.context,{visible:a}=this.state,{value:r}=this.props,{options:n={},style:i={},placeholder:o=d("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:u,disabled:p}=this.props.option,h=se("form-region-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,f=t().createElement("div",{className:"container"},this.renderTabs());let g=this.prevText;if(!a){const e=this.createTextValue(r);(""===e||e.split("/").every((e=>""!==e)))&&(g=e,this.prevText=g)}return t().createElement(l.Consumer,null,(r=>{const l={[h]:!0,[`${h}--lg`]:"large"===(null==r?void 0:r.size),[`${h}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t().createElement(fa,{value:g,bordered:s}):t().createElement(Ua(),{action:p?[]:["click"],popupVisible:!p&&a,popup:f,popupClassName:oe()(l),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Bt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(N.Input,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,style:{width:"100%",...i},readOnly:u,disabled:p,value:g,title:g,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&(0,Y.Y3)((()=>this.initial()))}}))}))}}Hl(Ll,"contextType",Ft);class ql extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Ll,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}Hl(ql,"contextType",Ft);const Dl=ql,$l=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},upload:o={},style:s={},disabled:c}=e.option,{multiple:d=!0,maxCount:u=1,fileTypes:p,fileSize:h,onRemove:m}=i,{action:f,headers:g,params:b,withCredentials:y=!1,dataKey:v="",fieldAliasMap:x,button:E}=o,C="function"==typeof x?x():x||{};return t().createElement(_n,{name:"file",action:f,multiple:d,headers:g,data:b,withCredentials:y,maxCount:u,fileTypes:p,fileSize:h,disabled:c||a.isOnlyShow,button:E,showUploadList:{showDownloadIcon:!0,downloadIcon:t().createElement(ce.DownloadOutlined,null)},fileList:r,onChange:e=>{let{file:t,fileList:a}=e;(e=>{const t=e.map((e=>{var t,a;const r={};for(const t in C){var l,n;r[t]=e[t]||(null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n?void 0:n[C[t]])||""}return{uid:e.uid,name:e.name,...r,url:e.url||(v?(0,Y.U2)(null===(a=e.response)||void 0===a?void 0:a.data,v):null===(t=e.response)||void 0===t?void 0:t.data)||"",status:e.status}}));null==l||l(t),t.every((e=>"done"===e.status&&e.url))&&n(t)})(a)},onRemove:m})};class Ml extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement($l,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(n,"")}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Ml,"contextType",Ft);const Kl=Ml,Vl=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},upload:o={},style:s={},disabled:c}=e.option,{multiple:d=!0,maxCount:u=1,fixedSize:p,quality:h,openCropper:m,fileTypes:f,fileSize:g,onRemove:b}=i,{action:y,headers:v,params:x,withCredentials:E=!1,dataKey:C="",fieldAliasMap:S}=o,w="function"==typeof S?S():S||{};return t().createElement(Fn,{name:"file",action:y,multiple:d,headers:v,data:x,withCredentials:E,maxCount:u,fixedSize:p,quality:h,openCropper:m,fileTypes:f,fileSize:g,disabled:c||a.isOnlyShow,fileList:r,onChange:e=>{let{file:t,fileList:a}=e;(e=>{const t=e.map((e=>{var t,a;const r={};for(const t in w){var l,n;r[t]=e[t]||(null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n?void 0:n[w[t]])||""}return{uid:e.uid,name:e.name,...r,url:e.url||(C?(0,Y.U2)(null===(a=e.response)||void 0===a?void 0:a.data,C):null===(t=e.response)||void 0===t?void 0:t.data)||"",status:e.status}}));null==l||l(t),t.every((e=>"done"===e.status&&e.url))&&n(t)})(a)},onRemove:b})};class Ul extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Vl,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(n,"")}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Ul,"contextType",Ft);const jl=Ul,zl=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},upload:o,style:s={},placeholder:c=d("qm.form.inputPlaceholder"),readOnly:u,disabled:p}=e.option,{tinymce:h,thresholdSize:m}=i;return t().createElement(vn,{value:r,tinymce:h,upload:o,thresholdSize:m,style:{width:"100%",...s},disabled:u||p||a.isOnlyShow,onChange:e=>{(e=>{null==l||l(e),n(e)})(e)}})};class Bl extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(zl,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(n,t)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Bl,"contextType",Ft);const Wl=Bl;function Gl(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Yl extends e.Component{constructor(e){super(e),Gl(this,"provide",{$$form:this,echo_data:{}}),Gl(this,"_initialValues",void 0),Gl(this,"_initialOthers",void 0),Gl(this,"_initialExtras",void 0),Gl(this,"wrapperRef",t().createRef()),Gl(this,"formRef",t().createRef()),Gl(this,"state",{formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:this.props.cols??4,collapse:!1}),Gl(this,"resizeObserveHandler",(()=>{var e;const t=null===(e=this.wrapperRef.current)||void 0===e?void 0:e.offsetWidth;if(void 0===t||0===t||this.props.cols>0)return;let a=Math.floor(t/300);a=24%a==0?a:a-1,a=a<1?1:a,a=a>8?8:a,a!==this.state.flexCols&&this.setState({flexCols:a})})),Gl(this,"resizeListenerHandle",(0,Y.Ds)(this.resizeObserveHandler,10)),Gl(this,"getFormItems",Ht()((e=>e.filter((e=>!e.noAuth&&!e.hidden))))),Gl(this,"getFlattenItems",Ht()((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{(0,Y.Kn)(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t}))),Gl(this,"valuesChangeHandle",((e,t)=>{var a,r;null===(a=(r=this.props).onValuesChange)||void 0===a||a.call(r,e,this._initialValues)})),Gl(this,"fieldsChangeHandle",((e,t)=>{var a,r;null===(a=(r=this.props).onFieldsChange)||void 0===a||a.call(r,e,t)})),Gl(this,"finishHandle",(e=>{var t,a;null===(t=(a=this.props).onFinish)||void 0===t||t.call(a,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))})),Gl(this,"finishFailedHandle",(e=>{var t,a;let{values:r,errorFields:l}=e;null===(t=(a=this.props).onFinishFailed)||void 0===t||t.call(a,l)})),Gl(this,"openValidateInfo",(e=>{const a=t().createElement("ul",null,e.map((e=>{const{label:a}=this.formItems.find((t=>t.fieldName===e.name[0]));return t().createElement("li",{key:e.name[0],style:{color:"#f5222d"}},"[",("string"==typeof a?`${a}: `:"")+e.errors.join(","),"]")})));N.notification.error({message:d("qm.form.validatePrompt"),description:a,duration:10})})),Gl(this,"scrollToField",(e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&ct()(t,{scrollMode:"if-needed",block:"nearest",behavior:"smooth"})})),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.createFormAuth()}get $size(){return this.props.size??this.context.size??""}get verticalLayout(){return"vertical"===this.props.layout}get formItems(){return this.getFormItems(this.props.items)}get flattenItems(){return this.getFlattenItems(this.formItems)}get dividers(){return this.formItems.filter((e=>"DIVIDER"===e.type))}get isFilterType(){return"search"===this.props.formType}get isOnlyShow(){return"onlyShow"===this.props.formType}get isCompactMode(){const e=this.context.global;return this.props.compactMode??("small"===this.$size&&!(null==e||!e.compactModeInSmallSize))}get showDividerCollapse(){return this.dividers.some((e=>!!e.collapse))}get showFilterCollapse(){return this.props.isCollapse&&this.formItems.length>=this.state.flexCols}componentDidMount(){this.checkFieldNames(),this.initialHandle(),this.createInputFocus(),this.bindResizeEvent(),this.resizeObserveHandler()}componentDidUpdate(e,t){this.props.items!==e.items&&this.checkFieldNames()}componentWillUnmount(){this.removeResizeEvent()}bindResizeEvent(){$t(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){Mt(this.wrapperRef.current,this.resizeListenerHandle)}initialHandle(){this.setState({formData:this.createFormValue(this.props.initialValues),other:this.createOtherValue(this.props.initialValues),extra:this.createExtraValue(this.props.initialExtras),expand:this.createDividerExpand()})}checkFieldNames(){const e=this.flattenItems.map((e=>e.fieldName));[...new Set(e)].length!==e.length&&m("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),a={};for(const r in e)t.includes(r)||(a[r]=e[r]);return Object.assign({},a)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>(0,Y.Kn)(e.extra))).forEach((a=>{t[a.fieldName]=e[a.fieldName]??""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>(0,Y.Kn)(e.collapse))).forEach((t=>{e[t.fieldName]=t.collapse.defaultExpand??!1})),Object.assign({},e)}getInitialValue(e,t){const{type:a,options:r}=e;return t=t??void 0,zt.includes(a)&&(t=t??[]),"CHECKBOX"!==a&&"SWITCH"!==a||(t=t??(null==r?void 0:r.falseValue)??Ut),t}createFormValue(e){const t={};return this.flattenItems.forEach((a=>{t[a.fieldName]=this.getInitialValue(a,e[a.fieldName])})),Object.assign({},e,t)}createInitialValues(){this._initialValues=this.createFormValue(this.props.initialValues)}createInitialOthers(){this._initialOthers=this.createOtherValue(this.props.initialValues)}createInitialExtras(){this._initialExtras=this.createExtraValue(this.props.initialExtras)}setViewValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";t!==this.getViewValue(e)&&this.setState((a=>({viewData:Object.assign({},a.viewData,{[e]:t})})))}getViewValue(e){return this.state.viewData[e]??""}setExpandHandle(e){this.setState({collapse:e},(()=>{var e,t;null===(e=(t=this.props).onCollapse)||void 0===e||e.call(t,this.state.collapse)}))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:a}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!a||setTimeout((()=>this.CREATE_FOCUS(a)))}getFormItemLabel(e){var t,a;if("string"==typeof e)return e;const{fieldName:r,options:l={}}=e,{itemList:n=[]}=l;if(!n.length)return m("Form",`fieldName 为 ${r} 的表单项的 \`itemList\` 配置有误`),"";const i=(null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([r])[r])??this._initialValues[r]??n[0].value;return(null===(a=n.find((e=>e.value===i)))||void 0===a?void 0:a.text)||""}getBlockDerivedItems(){const e=[];for(let t=0,a=this.dividers.length;t<a;t++){const a=this.formItems.findIndex((e=>e===this.dividers[t]));let r=this.formItems.findIndex((e=>e===this.dividers[t+1]));r=r>-1?r:void 0,e.push(this.formItems.slice(a,r).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay(e){let{type:t,fieldName:a}=e;if("DIVIDER"===t)return!0;const r=this.getBlockDerivedItems();for(let e=0,t=r.length;e<t;e++){var l;const t=r[e],n=this.dividers.find((e=>e.fieldName===t[0].fieldName)),i=(null==n||null===(l=n.collapse)||void 0===l?void 0:l.showLimit)??t.length-1;for(let e=1;e<t.length;e++)if(t[e].fieldName===a&&e>i)return this.state.expand[t[0].fieldName]}return!0}formatFormValue(e){for(const t in e){const a=e[t];if(ea(a)&&(e[t]=""),Array.isArray(a)&&a.forEach(((a,r)=>{ea(a)&&(e[t][r]="")})),t.includes("|")&&Array.isArray(a)){const[r,l]=t.split("|");e[r]=a[0]??"",e[l]=a[1]??""}}if(this.isFilterType)for(const t in e)(0,Y.xb)(e[t])&&(e[t]=void 0);return e}async createFormAuth(){const{authConfig:e}=this.props;if(!e)return;let t=G()(e,["fetch"]);if(e.fetch){const{api:a,params:r,dataKey:l}=e.fetch;try{const e=await a(r);200===e.code&&(t=(l?(0,Y.U2)(e.data,l):e.data)??{})}catch(e){}}if(Array.isArray(t.fieldList)){var a,r;const e=this.props.items.map((e=>{const{fieldName:a}=e,r=t.fieldList.find((e=>e.dataIndex===a));if(r){const{visible:t=1,disabled:a,secretName:l}=r;t||(e.noAuth=!0),a&&(e.disabled=!0),l&&(e.options?e.options.secretType=l:e.options={secretType:l})}return e}));null===(a=(r=this.props).fieldsChange)||void 0===a||a.call(r,e)}}INPUT(e){return t().createElement(va,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return t().createElement(Ca,{option:e})}INPUT_NUMBER(e){return t().createElement(Ia,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return t().createElement(Pa,{option:e})}SEARCH_HELPER(e){return t().createElement(La,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return t().createElement(Wa,{option:e})}TREE_TABLE_HELPER(e){return t().createElement(Qa,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return t().createElement(lr,{option:e})}RANGE_SEARCH_HELPER(e){return t().createElement(cr,{option:e})}CHECKBOX(e){return t().createElement(pr,{option:e})}MULTIPLE_CHECKBOX(e){return t().createElement(gr,{option:e})}RATE(e){return t().createElement(vr,{option:e})}RADIO(e){return t().createElement(Sr,{option:e})}SWITCH(e){return t().createElement(Nr,{option:e})}TEXT_AREA(e){return t().createElement(Rr,{option:e})}DATE(e){return t().createElement(Ar,{option:e})}RANGE_DATE(e){return t().createElement(Lr,{option:e})}TIME(e){return t().createElement($r,{option:e})}RANGE_TIME(e){return t().createElement(Vr,{option:e})}SELECT(e){return t().createElement(rl,{option:e})}MULTIPLE_SELECT(e){return t().createElement(rl,{option:e,multiple:!0})}IMMEDIATE(e){return t().createElement(ol,{option:e})}DIVIDER(e){return t().createElement(cl,{option:e})}TREE_SELECT(e){return t().createElement(fl,{option:e})}MULTIPLE_TREE_SELECT(e){return t().createElement(fl,{option:e,multiple:!0})}CASCADER(e){return t().createElement(xl,{option:e})}MULTIPLE_CASCADER(e){return t().createElement(xl,{option:e,multiple:!0})}CITY_SELECT(e){return t().createElement(kl,{option:e})}REGION_SELECT(e){return t().createElement(Dl,{option:e})}UPLOAD_FILE(e){return t().createElement(Kl,{option:e})}UPLOAD_IMG(e){return t().createElement(jl,{option:e})}TINYMCE(e){return t().createElement(Wl,{option:e})}renderFormLabel(e){if(!(0,Y.Kn)(e))return e;const{type:a,fieldName:r,options:l={},placeholder:n,disabled:i,onChange:o=Y.ZT}=e,{itemList:s=[]}=l;return t().createElement(N.Form.Item,{name:r,noStyle:!0},"SELECT"===a&&t().createElement(N.Select,{placeholder:n,disabled:i,style:{width:"calc(100% - 10px)"},onChange:e=>o(e,s.find((t=>t.value===e)).text)},s.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text)))))}renderFormItemExtra(e){const{fieldName:a,isTooltip:r,style:l={},render:n}=e,{extra:i}=this.state;if(r)return t().createElement(N.Tooltip,{className:"extra-tooltip",title:i[a]},t().createElement(ce.ExclamationCircleOutlined,{style:{marginLeft:4}}));const o=this.formItems.find((e=>e.fieldName===a));return t().createElement("div",{className:"extra-text",title:n?"":i[a],style:l},t().createElement("span",{className:"extra-overflow-cut"},n?n(o,this):i[a]))}renderFormItemButton(e,t){const a=this.formItems.find((t=>t.fieldName===e)),r="function"==typeof t?t(a):t;return this.isOnlyShow?null:r}renderFormItem(e){const{label:a,fieldName:r,className:l,labelWidth:n=this.props.labelWidth,rules:i=[],style:o={},render:s}=e;return(0,Y.xb)(this.state.formData)?null:t().createElement(N.Form.Item,{label:a,name:r,rules:i,className:oe()(r,l),style:{width:"100%",...o},labelCol:{flex:(0,Y.PM)(n)}},null==s?void 0:s(e,this))}createFormItem(e){return(0,Y.mf)(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(m("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:a,defaultRows:r,isFieldsDefine:l}=this.props,n=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:a=0}=e;for(let e=0;e<t;e++)n.push({});n.push(e);for(let e=0;e<a;e++)n.push({})}));const i=24/e,o=[],s=n.reduce(((e,t)=>{const{selfCol:a=1}=t,r=e+a;return o.push(r),r}),0),c=r>Math.ceil(s/e)?Math.ceil(s/e):r,d=[],u=n.map(((a,r)=>{let{selfCol:l=1}=a;const{type:n,fieldName:s}=a;l=l>=24||"DIVIDER"===n||"TINYMCE"===n?e:l;const u=!(!this.state.collapse&&this.showFilterCollapse)||o[r]<c*e,p=!this.showDividerCollapse||this.getFormItemDisplay(a);return u&&d.push(o[r]),t().createElement(N.Col,{key:s??r,span:l*i,style:this.isFilterType?{display:!this.showFilterCollapse||u?"block":"none"}:{display:p?"block":"none"}},n?this.createFormItem((0,Y.I8)(a)):null)}));return l&&"default"===a&&u.push(t().createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...u,this.createSearchButtonLayout(d[d.length-1])]}createSearchButtonLayout(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{flexCols:a,collapse:r}=this.state,{searchButtonCols:l,isSearchBtn:n,isFieldsDefine:i=!0}=this.props;if(!this.isFilterType)return null;const o=24/a,s=l||1,c=a-e%a-s;return n?t().createElement(N.Col,{key:"-",span:s*o,offset:c*o,style:{textAlign:"right"}},t().createElement(N.Space,{style:{marginBottom:12}},t().createElement(J,{type:"primary",size:this.$size,icon:t().createElement(ce.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},d("qm.form.search")),t().createElement(J,{size:this.$size,icon:t().createElement(ce.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},d("qm.form.reset")),i?this.createFieldsDefine():null,this.showFilterCollapse&&t().createElement("a",{onClick:()=>this.setExpandHandle(!r)},r?t().createElement(ce.UpOutlined,null):t().createElement(ce.DownOutlined,null)," ",d(r?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:a,isSubmitBtn:r}=this.props;if(this.isFilterType)return null;const l=24/e;return r&&"default"===a?t().createElement(N.Row,{gutter:0},t().createElement(N.Col,{key:"-",span:l},t().createElement(N.Form.Item,null,t().createElement(N.Space,{style:{marginBottom:12}},t().createElement(J,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},d("qm.form.save")),t().createElement(J,{size:this.$size,onClick:()=>this.RESET_FORM()},d("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:a,fieldsChange:r}=this.props;return t().createElement(ha,{uniqueKey:e,items:a,fieldsChange:r})}set_fields_other(e){this.setState((t=>({other:Object.assign({},t.other,this.createOtherValue(e))})))}get_fields_other(e){if(!e)return this.state.other;const t={};return e.forEach((e=>{t[e]=this.state.other[e]})),t}formValidate(){return new Promise((async(e,t)=>{const[a,r]=await this.VALIDATE_FIELDS(),l=this.formItems.filter((e=>"SEARCH_HELPER"===e.type)).filter((e=>{var t;return null===(t=this[`${e.fieldName}_Ref`])||void 0===t?void 0:t.searchRef._is_change})).map((e=>({name:[e.fieldName],errors:[d("qm.form.searchHelperTips")],warnings:[]})));a||l.length?t((a||[]).concat(l)):e(r)}))}SET_FIELDS_VALUE(e){this.formRef.current.setFieldsValue(e),this.set_fields_other(e)}GET_FIELDS_VALUE(e){return e?Object.assign({},this.get_fields_other(e),this.formRef.current.getFieldsValue(e)):Object.assign({},this.state.other,this.formRef.current.getFieldsValue(!0))}async GET_FORM_DATA(){try{const e=await this.formValidate();return[null,Object.assign({},this.get_fields_other(),this.formatFormValue(e))]}catch(e){return this.props.scrollToFirstError&&this.scrollToField(e[0].name[0]),[e,null]}}async VALIDATE_FIELDS(e){try{return[null,await this.formRef.current.validateFields(e)]}catch({errorFields:e}){return this.isCompactMode&&this.openValidateInfo(e),[e,null]}}SET_FIELDS_EXTRA(e){this.setState((t=>({extra:Object.assign({},t.extra,e)})))}SET_FIELDS_ECHO(e){Object.keys(e).length&&(Object.assign(this.provide,{echo_data:Object.assign({},this.provide.echo_data,e)}),this.forceUpdate())}GET_FIELDS_EXTRA(e){if(!e)return this.state.extra;const t={};return e.forEach((e=>{t[e]=this.state.extra[e]})),t}GET_FIELDS_TOUCHED(e){return this.formRef.current.isFieldsTouched(e)}async SUBMIT_FORM(){try{await this.formValidate(),this.formRef.current.submit()}catch(e){this.isFilterType&&this.setExpandHandle(!0)}}RESET_FORM(){var e,t;let a=[];const r=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName));r.length&&(a=this.flattenItems.map((e=>e.fieldName)).filter((e=>!r.includes(e)))),this.formRef.current.resetFields(a.length?a:void 0),this.setState((e=>{const t=Object.keys(e.other),a=Object.keys(this._initialOthers),r=t.filter((e=>!a.includes(e))),l={};return r.forEach((e=>l[e]=void 0)),{other:Object.assign({},this._initialOthers,l)}})),this.setState({extra:Object.assign({},this._initialExtras)}),null===(e=(t=this.props).onReset)||void 0===e||e.call(t)}CREATE_FOCUS(e){try{this[`${e}_Ref`].focus()}catch(e){m("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,a){const{items:r,fieldsChange:l}=this.props,n=r.filter((e=>!e.noAuth)),i=n.find((t=>t.fieldName===e));if(!i)return m("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!(0,Y.Kn)(t))return m("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");for(const e in t)e&&(0,Y.t8)(i,e,t[e]);a&&(l?l(n):m("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:a,layout:r,labelWidth:l,labelAlign:n,labelWrap:i,customClass:o}=this.props,s=se("form"),c={required:"${label}"+d("qm.form.requiredTips")},u={[s]:!0,[`${s}--lg`]:"large"===this.$size,[`${s}--sm`]:"small"===this.$size,[`${s}__only-show`]:this.isOnlyShow,[`${s}__compact`]:this.isCompactMode,[o]:!!o};return t().createElement("div",{ref:this.wrapperRef,className:oe()(u,e),style:a},t().createElement(N.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:r,labelAlign:n,labelWrap:i,colon:!1,labelCol:{flex:this.verticalLayout?"initial":(0,Y.PM)(l)},validateMessages:c,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},t().createElement(Ft.Provider,{value:this.provide},t().createElement(N.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}Gl(Yl,"contextType",l),Gl(Yl,"propTypes",Zt),Gl(Yl,"defaultProps",Xt);const Zl=Yl,Xl={onActivate:a.func,onAddUndo:a.func,onBeforeAddUndo:a.func,onBeforeExecCommand:a.func,onBeforeGetContent:a.func,onBeforeRenderUI:a.func,onBeforeSetContent:a.func,onBeforePaste:a.func,onBlur:a.func,onChange:a.func,onClearUndos:a.func,onClick:a.func,onContextMenu:a.func,onCommentChange:a.func,onCopy:a.func,onCut:a.func,onDblclick:a.func,onDeactivate:a.func,onDirty:a.func,onDrag:a.func,onDragDrop:a.func,onDragEnd:a.func,onDragGesture:a.func,onDragOver:a.func,onDrop:a.func,onExecCommand:a.func,onFocus:a.func,onFocusIn:a.func,onFocusOut:a.func,onGetContent:a.func,onHide:a.func,onInit:a.func,onKeyDown:a.func,onKeyPress:a.func,onKeyUp:a.func,onLoadContent:a.func,onMouseDown:a.func,onMouseEnter:a.func,onMouseLeave:a.func,onMouseMove:a.func,onMouseOut:a.func,onMouseOver:a.func,onMouseUp:a.func,onNodeChange:a.func,onObjectResizeStart:a.func,onObjectResized:a.func,onObjectSelected:a.func,onPaste:a.func,onPostProcess:a.func,onPostRender:a.func,onPreProcess:a.func,onProgressState:a.func,onRedo:a.func,onRemove:a.func,onReset:a.func,onSaveContent:a.func,onSelectionChange:a.func,onSetAttrib:a.func,onSetContent:a.func,onShow:a.func,onSubmit:a.func,onUndo:a.func,onVisualAid:a.func,onSkinLoadError:a.func,onThemeLoadError:a.func,onModelLoadError:a.func,onPluginLoadError:a.func,onIconsLoadError:a.func,onLanguageLoadError:a.func},Ql={apiKey:a.string,id:a.string,inline:a.bool,init:a.object,initialValue:a.string,onEditorChange:a.func,value:a.string,tagName:a.string,cloudChannel:a.string,plugins:a.oneOfType([a.string,a.array]),toolbar:a.oneOfType([a.string,a.array]),disabled:a.bool,textareaName:a.string,tinymceScriptSrc:a.string,rollback:a.oneOfType([a.number,a.oneOf([!1])]),scriptLoading:a.shape({async:a.bool,defer:a.bool,delay:a.number}),...Xl},Jl=e=>"function"==typeof e,en=e=>e in Xl,tn=e=>e.substr(2),an=(e,t,a,r,l)=>((t,a,r,l,n,i,o)=>{const s=Object.keys(n).filter(en),c=Object.keys(i).filter(en),d=s.filter((e=>void 0===i[e])),u=c.filter((e=>void 0===n[e]));d.forEach((e=>{const t=tn(e),a=o[t];r(t,a),delete o[t]})),u.forEach((r=>{const l=((t,a)=>r=>{var l;return null===(l=t(a))||void 0===l?void 0:l(r,e)})(t,r),n=tn(r);o[n]=l,a(n,l)}))})(l,e.on.bind(e),e.off.bind(e),0,t,a,r);let rn=0;const ln=e=>{const t=Date.now(),a=Math.floor(1e9*Math.random());return rn++,e+"_"+a+rn+String(t)},nn=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),on=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),sn=(e,t)=>on(e).concat(on(t)),cn=e=>{if(!("isConnected"in Node.prototype)){let t=e,a=e.parentNode;for(;null!=a;)t=a,a=t.parentNode;return t===e.ownerDocument}return e.isConnected},dn=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},un=()=>({listeners:[],scriptId:ln("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),pn=(()=>{let e=un();return{load:(t,a,r,l,n,i)=>{const o=()=>((t,a,r,l,n,i)=>{const o=a.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.id=t,o.src=r,o.async=l,o.defer=n;const s=()=>{o.removeEventListener("load",s),e.listeners.forEach((e=>e())),e.scriptLoaded=!0};o.addEventListener("load",s),a.head&&a.head.appendChild(o)})(e.scriptId,t,a,r,l);e.scriptLoaded?i():(e.listeners.push(i),e.scriptLoading||(e.scriptLoading=!0,n>0?setTimeout(o,n):o()))},reinitialize:()=>{e=un()}}})(),hn=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};function mn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class fn extends e.Component{constructor(t){var a,r;super(t),a=this,mn(this,"editor",void 0),mn(this,"id",void 0),mn(this,"elementRef",void 0),mn(this,"inline",void 0),mn(this,"currentContent",void 0),mn(this,"boundHandlers",void 0),mn(this,"rollbackTimer",void 0),mn(this,"valueCursor",void 0),mn(this,"rollbackChange",(()=>{const e=this.editor,t=this.props.value;e&&t&&t!==this.currentContent&&e.undoManager.ignore((()=>{if(e.setContent(t),this.valueCursor&&(!this.inline||e.hasFocus()))try{e.selection.moveToBookmark(this.valueCursor)}catch(e){}})),this.rollbackTimer=void 0})),mn(this,"handleBeforeInput",(e=>{if(void 0!==this.props.value&&this.props.value===this.currentContent&&this.editor&&(!this.inline||this.editor.hasFocus()))try{this.valueCursor=this.editor.selection.getBookmark(3)}catch(e){}})),mn(this,"handleBeforeInputSpecial",(e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)})),mn(this,"handleEditorChange",(e=>{const t=this.editor;if(t&&t.initialized){const e=t.getContent();void 0!==this.props.value&&this.props.value!==e&&!1!==this.props.rollback&&(this.rollbackTimer||(this.rollbackTimer=window.setTimeout(this.rollbackChange,"number"==typeof this.props.rollback?this.props.rollback:200))),e!==this.currentContent&&(this.currentContent=e,"function"==typeof this.props.onEditorChange&&this.props.onEditorChange(e,t))}})),mn(this,"handleEditorChangeSpecial",(e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)})),mn(this,"initialise",(function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const l=a.elementRef.current;if(!l)return;if(!cn(l)){if(0===r)setTimeout((()=>a.initialise(1)),1);else{if(!(r<100))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>a.initialise(r+1)),100)}return}const n=hn(a.view);if(!n)throw new Error("tinymce should have been loaded into global scope");const i={...a.props.init,selector:void 0,target:l,readonly:a.props.disabled,inline:a.inline,plugins:sn(null===(e=a.props.init)||void 0===e?void 0:e.plugins,a.props.plugins),toolbar:a.props.toolbar??(null===(t=a.props.init)||void 0===t?void 0:t.toolbar),setup:e=>{a.editor=e,a.bindHandlers({}),a.inline&&!nn(l)&&e.once("PostRender",(t=>{e.setContent(a.getInitialValue(),{no_events:!0})})),a.props.init&&Jl(a.props.init.setup)&&a.props.init.setup(e)},init_instance_callback:e=>{const t=a.getInitialValue();a.currentContent=a.currentContent??e.getContent(),a.currentContent!==t&&(a.currentContent=t,e.setContent(t),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const r=a.props.disabled??!1;dn(a.editor,r?"readonly":"design"),a.props.init&&Jl(a.props.init.init_instance_callback)&&a.props.init.init_instance_callback(e)}};a.inline||(l.style.visibility=""),nn(l)&&(l.value=a.getInitialValue()),n.init(i)})),this.id=this.props.id||ln("tiny-react"),this.elementRef=e.createRef(),this.inline=this.props.inline??(null===(r=this.props.init)||void 0===r?void 0:r.inline)??!1,this.boundHandlers={}}get view(){var e;return(null===(e=this.elementRef.current)||void 0===e?void 0:e.ownerDocument.defaultView)??window}componentDidUpdate(e){if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=this.currentContent??this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==e.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){const e=this.editor;e.undoManager.transact((()=>{let t;if(!this.inline||e.hasFocus())try{t=e.selection.getBookmark(3)}catch(e){}const a=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const r of[t,a])if(r)try{e.selection.moveToBookmark(r),this.valueCursor=r;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=this.props.disabled??!1;dn(this.editor,e?"readonly":"design")}}}componentDidMount(){if(null!==hn(this.view))this.initialise();else if(this.elementRef.current&&this.elementRef.current.ownerDocument){var e,t,a;pn.load(this.elementRef.current.ownerDocument,this.getScriptSrc(),(null===(e=this.props.scriptLoading)||void 0===e?void 0:e.async)??!1,(null===(t=this.props.scriptLoading)||void 0===t?void 0:t.defer)??!1,(null===(a=this.props.scriptLoading)||void 0===a?void 0:a.delay)??0,this.initialise)}}componentWillUnmount(){const e=this.editor;e&&(e.off(this.changeEvents(),this.handleEditorChange),e.off(this.beforeInputEvent(),this.handleBeforeInput),e.off("keypress",this.handleEditorChangeSpecial),e.off("keydown",this.handleBeforeInputSpecial),e.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach((t=>{e.off(t,this.boundHandlers[t])})),this.boundHandlers={},e.remove(),this.editor=void 0)}render(){return this.inline?this.renderInline():this.renderIframe()}changeEvents(){var e,t,a;return(null===(e=hn(this.view))||void 0===e||null===(t=e.Env)||void 0===t||null===(a=t.browser)||void 0===a?void 0:a.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"}beforeInputEvent(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"}renderInline(){const{tagName:t="div"}=this.props;return e.createElement(t,{ref:this.elementRef,id:this.id})}renderIframe(){return e.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id})}getScriptSrc(){if("string"==typeof this.props.tinymceScriptSrc)return this.props.tinymceScriptSrc;{const e=this.props.cloudChannel;return`https://cdn.tiny.cloud/1/${this.props.apiKey?this.props.apiKey:"no-api-key"}/tinymce/${e}/tinymce.min.js`}}getInitialValue(){return"string"==typeof this.props.initialValue?this.props.initialValue:"string"==typeof this.props.value?this.props.value:""}bindHandlers(e){if(void 0!==this.editor){an(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,a=t(e),r=t(this.props);!a&&r?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):a&&!r&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}function gn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var bn;mn(fn,"propTypes",Ql),mn(fn,"defaultProps",{cloudChannel:"6"}),function(e){e["zh-cn"]="zh_CN",e.en="en"}(bn||(bn={}));class yn extends e.Component{constructor(){super(...arguments),gn(this,"defaultOption",{height:400,plugins:"preview importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap emoticons",menubar:"file edit view insert format tools table help",toolbar:"undo redo | bold italic underline strikethrough | fontfamily fontsize blocks | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl"})}render(){var e;const{size:a,className:r,style:l,tinymce:n={},upload:i={},thresholdSize:o=.5,tinymceScriptSrc:s,disabled:c,value:u,onChange:p=Y.ZT}=this.props,h=this.context.global,m=this.context.locale,f=a||this.context.size||"",g=se("tinymce"),b={[g]:!0,[`${g}--lg`]:"large"===f,[`${g}--sm`]:"small"===f},y={init:{height:n.height||this.defaultOption.height,plugins:n.plugins||this.defaultOption.plugins,toolbar:n.toolbar||this.defaultOption.toolbar,menubar:n.menubar||this.defaultOption.menubar,language:bn[m],skin:"tinymce-5",...G()(n,["height","plugins","toolbar","menubar"]),images_upload_handler:e=>new Promise((async(t,a)=>{const{action:r,headers:l,withCredentials:n,dataKey:s}=i,c=`data:image/jpeg;base64,${e.base64()}`,u=new FormData;u.append("file",e.blob(),e.filename());const p=e.blob().size;if(r&&p/1024/1024>o)try{const{data:e}=await et().post(r,u,{headers:l,withCredentials:n});200===e.code&&t(s?(0,Y.U2)(e.data,s):e.data)}catch(e){N.message.error(d("qm.uploadCropper.uploadError"))}else t(c)}))},value:u,disabled:c,tinymceScriptSrc:s||(null==h||null===(e=h.tinymce)||void 0===e?void 0:e.scriptSrc)||void 0,onEditorChange:(e,t)=>{p(t.getContent())}};return t().createElement("div",{className:oe()(b,r),style:l},t().createElement(fn,y))}}gn(yn,"contextType",l),gn(yn,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Tinymce","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")}});const vn=yn,xn=require("cropperjs");var En=__webpack_require__.n(xn);function Cn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Sn extends e.Component{constructor(){super(...arguments),Cn(this,"imgRef",t().createRef()),Cn(this,"cropper",void 0)}componentDidMount(){const{className:e,style:t,src:a,alt:r,imgStyle:l,...n}=this.props,i={};for(const e in n)void 0!==this.props[e]&&(i[e]=this.props[e]);this.cropper=new(En())(this.imgRef.current,i)}componentWillUnmount(){this.destroy(),this.cropper=null}reset(){return this.cropper.reset()}clear(){return this.cropper.clear()}initCrop(){return this.cropper.crop()}replace(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.cropper.replace(e,t)}enable(){return this.cropper.enable()}disable(){return this.cropper.disable()}destroy(){return this.cropper.destroy()}move(e,t){return this.cropper.move(e,t)}moveTo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.cropper.moveTo(e,t)}relativeZoom(e,t){return this.cropper.zoom(e,t)}zoomTo(e,t){return this.cropper.zoomTo(e,t)}rotate(e){return this.cropper.rotate(e)}rotateTo(e){return this.cropper.rotateTo(e)}scaleX(e){return this.cropper.scaleX(e)}scaleY(e){return this.cropper.scaleY(e)}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.cropper.scale(e,t)}getData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.cropper.getData(e)}setData(e){return this.cropper.setData(e)}getContainerData(){return this.cropper.getContainerData()}getImageData(){return this.cropper.getImageData()}getCanvasData(){return this.cropper.getCanvasData()}setCanvasData(e){return this.cropper.setCanvasData(e)}getCropBoxData(){return this.cropper.getCropBoxData()}setCropBoxData(e){return this.cropper.setCropBoxData(e)}getCroppedCanvas(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.cropper.getCroppedCanvas(e)}setAspectRatio(e){return this.cropper.setAspectRatio(e)}setDragMode(e){return this.cropper.setDragMode(e)}render(){const{className:e,style:a,src:r,alt:l,imgStyle:n}=this.props,i={[se("cropper")]:!0};return t().createElement("div",{className:oe()(i,e),style:a},t().createElement("img",{ref:this.imgRef,src:r,alt:l,style:{maxWidth:"100%",...n}}))}}Cn(Sn,"defaultProps",{src:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0});const wn=Sn;function Tn(){return Tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Tn.apply(this,arguments)}function Nn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class In extends e.Component{constructor(){super(...arguments),Nn(this,"beforeUpload",((e,t)=>new Promise((async(a,r)=>{const{fileTypes:l=[],fileSize:n,beforeUpload:i}=this.props,o=!l.length||l.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),s=!n||e.size/1024/1024<n,c=o&&s;if(o||N.message.warning(d("qm.upload.tooltip",{type:l.join(",")})),s||N.message.warning(d("qm.upload.sizeLimit",{size:n})),!c)return c||N.Upload.LIST_IGNORE;if(i){const l=i(e,t);if(!0===l)return a(e);if(!1===l)return r("not upload");if(l&&"function"==typeof l.then)try{a(await l)}catch(e){r(e)}}a(e)}))))}async downloadFile(e,t){const a=await et()({url:e,responseType:"blob"}),r=a.data,l=a.headers["content-disposition"],n=t||(l?l.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));tt(r,n)}render(){const{button:e,disabled:a,onChange:r}=this.props,l=se("upload-file");return t().createElement(N.Upload,Tn({className:l},G()(this.props,["fileTypes","fileSize","button"]),{beforeUpload:this.beforeUpload,onChange:e=>{null==r||r(e)},onPreview:async e=>{try{e.url&&await this.downloadFile(e.url,e.name)}catch(e){N.message.error(d("qm.download.error"))}},onDownload:async e=>{try{e.url&&await this.downloadFile(e.url,e.name)}catch(e){N.message.error(d("qm.download.error"))}}}),this.props.children?this.props.children:t().createElement(N.Button,{icon:(null==e?void 0:e.icon)||t().createElement(ce.UploadOutlined,null),disabled:a},(null==e?void 0:e.text)||d("qm.upload.text")))}}Nn(In,"defaultProps",{name:"file",multiple:!0,showUploadList:{showDownloadIcon:!0,downloadIcon:t().createElement(ce.DownloadOutlined,null)}});const _n=In;function Rn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Pn extends e.Component{constructor(){super(...arguments),Rn(this,"cropperRef",t().createRef()),Rn(this,"beforeUploadRef",void 0),Rn(this,"fileRef",void 0),Rn(this,"resolveRef",void 0),Rn(this,"rejectRef",void 0),Rn(this,"state",{src:""}),Rn(this,"confirmHandle",(async()=>{const{quality:e}=this.props,{type:t,name:a,uid:r}=this.fileRef;this.cropperRef.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===t?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((async e=>{let l=new File([e],a,{type:t});l.uid=r;const{fileTypes:n=[],fileSize:i}=this.props;if(n.length&&!n.includes(l.name.slice(l.name.lastIndexOf(".")+1).toLowerCase()))return N.message.warning(d("qm.upload.tooltip",{type:n.join(",")})),this.rejectRef("file type is error");if("function"!=typeof this.beforeUploadRef)return this.resolveRef(l);const o=this.beforeUploadRef(l,[l]);if("boolean"==typeof o||o){if(!0===o)return this.resolveRef(l);if(!1===o)return this.rejectRef("not upload");if(o&&"function"==typeof o.then)try{const e=await o,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(l=e),this.resolveRef(l)}catch(e){this.rejectRef(e)}}else m("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}),t,e),await(0,Y._v)(100),this.onClose()})),Rn(this,"onOk",(()=>{this.confirmHandle()})),Rn(this,"onClose",(()=>{this.rejectRef(),this.setSrc("")}))}get previewSize(){const{fixedSize:e}=this.props;return{width:"380px",height:e?`calc(380px * ${e[1]/e[0]})`:"auto"}}setSrc(e){this.setState({src:e})}renderUpload(){const{children:e,beforeCrop:a}=this.props,r=Array.isArray(e)?e[0]:e;if(!r)return null;const{beforeUpload:l,...n}=r.props;return this.beforeUploadRef=l,t().createElement(r.type,{...n,beforeUpload:(e,t)=>new Promise((async(r,l)=>{if(a&&!await a(e,t))return void l();this.fileRef=e,this.resolveRef=r,this.rejectRef=l;const n=new FileReader;n.onload=()=>{this.setSrc(n.result),n.onload=null},n.readAsDataURL(e)}))})}scaleHandle(e){this.cropperRef.current.relativeZoom(e,void 0)}rotateHandle(e){this.cropperRef.current.rotate(e)}renderCropper(){const{fixedSize:e}=this.props;return t().createElement("div",{className:"cropper-preview"},t().createElement("div",{className:"cropper-area"},t().createElement("div",{className:"img-cropper"},t().createElement(wn,{ref:this.cropperRef,aspectRatio:e?e[0]/e[1]:e,src:this.state.src,dragMode:"move",preview:".preview"})),t().createElement("div",{className:"actions"},t().createElement(N.Space,{size:"small"},t().createElement(N.Button,{type:"primary",size:"middle",icon:t().createElement(ce.ZoomInOutlined,null),onClick:()=>this.scaleHandle(.2)},d("qm.uploadCropper.zoomIn")),t().createElement(N.Button,{type:"primary",size:"middle",icon:t().createElement(ce.ZoomOutOutlined,null),onClick:()=>this.scaleHandle(-.2)},d("qm.uploadCropper.zoomOut")),t().createElement(N.Button,{type:"primary",size:"middle",icon:t().createElement(ce.RotateRightOutlined,null),onClick:()=>this.rotateHandle(90)},d("qm.uploadCropper.rotatePlus")),t().createElement(N.Button,{type:"primary",size:"middle",icon:t().createElement(ce.RotateLeftOutlined,null),onClick:()=>this.rotateHandle(-90)},d("qm.uploadCropper.rotateSubtract"))))),t().createElement("div",{className:"preview-area"},t().createElement("div",{className:"preview",style:this.previewSize})))}render(){const{src:e}=this.state,a=se("cropper-preview");return t().createElement(t().Fragment,null,this.renderUpload(),e&&t().createElement(N.Modal,{visible:!0,wrapClassName:oe()(a),title:d("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:this.onOk,onCancel:this.onClose,maskClosable:!1,destroyOnClose:!0},this.renderCropper()))}}Rn(Pn,"contextType",l);const On=Pn;function An(){return An=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},An.apply(this,arguments)}function kn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Hn extends e.Component{constructor(){super(...arguments),kn(this,"state",{previewVisible:!1,previewImage:"",previewTitle:""}),kn(this,"beforeUpload",((e,t)=>new Promise((async(t,a)=>{const{fileTypes:r=[],fileSize:l}=this.props,n=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),i=!l||e.size/1024/1024<l,o=n&&i;if(n||N.message.warning(d("qm.upload.tooltip",{type:r.join(",")})),i||N.message.warning(d("qm.upload.sizeLimit",{size:l})),!o)return o||N.Upload.LIST_IGNORE;t(e)})))),kn(this,"handlePreview",(async e=>{e.url||e.preview||(e.preview=await(e=>new Promise(((t,a)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>a(e)})))(e.originFileObj)),this.setState({previewImage:e.url||e.preview,previewVisible:!0,previewTitle:e.name||e.url.substring(e.url.lastIndexOf("/")+1)})}))}get showUploadButton(){var e;const t=(null===(e=this.props.fileList)||void 0===e?void 0:e.length)??0;return!this.props.maxCount||t<this.props.maxCount}render(){const{previewVisible:e,previewImage:a,previewTitle:r}=this.state,{fixedSize:l,quality:n,fileTypes:i,fileSize:o,openCropper:s,beforeCrop:c}=this.props,u=se("upload-img"),p=t().createElement("div",null,t().createElement(ce.PlusOutlined,null),t().createElement("div",{style:{marginTop:8}},d("qm.uploadCropper.dragableText"))),h=t().createElement(N.Upload,An({className:u},G()(this.props,["fileTypes","fileSize","fixedSize","quality"]),{beforeUpload:this.beforeUpload,onPreview:this.handlePreview}),this.showUploadButton?p:null);return t().createElement(t().Fragment,null,s?t().createElement(On,{fixedSize:l,quality:n,fileTypes:i,fileSize:o,beforeCrop:c},h):h,t().createElement(N.Modal,{visible:e,title:r,bodyStyle:{padding:10},footer:null,onCancel:()=>{this.setState({previewVisible:!1})}},t().createElement("img",{alt:"",style:{width:"100%"},src:a})))}}kn(Hn,"defaultProps",{name:"file",multiple:!0,accept:"image/*",listType:"picture-card",quality:1,openCropper:!0});const Fn=Hn;function Ln(t){const[a,r]=e.useState({width:0,height:0});return e.useEffect((()=>{const e=t.current,a=e=>{const{inlineSize:t,blockSize:a}=e.contentBoxSize[0];r({width:t,height:a})};return e&&$t(e,a),()=>{e&&Mt(e,a)}}),[t]),a}const qn=(e,t,a)=>{let r;for(let l=0;l<e.length;l++){const n=e[l];if(n.children)if(n.children.some((e=>e[a]===t)))r=n[a];else{const e=qn(n.children,t,a);e&&(r=e)}}return r},Dn=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&Dn(e.children,t),t(e)||e.children&&e.children.length))),$n=(e,t)=>{const a=[];return e.forEach((e=>{e.children&&a.push(...$n(e.children,t)),t(e)&&a.push(e)})),a},Mn=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(a=Mn(e[r].children,t)),a)return a;if(t(e[r]))return e[r]}return a},Kn=(e,t,a,r)=>e.map((e=>e[a]===t?{...e,children:r}:e.children?{...e,children:Kn(e.children,t,a,r)}:e)),Vn=(e,t)=>{const a=[];return e.forEach((e=>{e.children&&a.push(...Vn(e.children,t)),Array.isArray(e.children)&&e.children.length&&a.push(e[t])})),a},Un=(e,t,a)=>{for(let r=0;r<e.length;r++){if(e[r][a]===t)return[t];if(Array.isArray(e[r].children)){const l=Un(e[r].children,t,a);if(l)return[e[r][a],l].flat()}}},jn=(e,t)=>{var a;const r=(null===(a=e.children)||void 0===a?void 0:a.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>r.push(...jn(e,t)))),r},zn=t().forwardRef(((e,a)=>{const{filterable:r=!0,multiple:n,draggable:i,dataSource:o,fetch:s,asyncLoad:c,checkStrictly:u,checkStrategy:p="SHOW_CHILD",placeholder:h=d("qm.form.inputPlaceholder"),fieldsDefine:m,value:f,height:g,defaultSelectedKeys:b=[],defaultExpandAll:y=!0,showSearchBar:v=!0,showCollapse:x=!0,onSelectChange:E,onCheckChange:C,onDragChange:S}=e,{size:w}=t().useContext(l),T=t().useMemo((()=>e.size??w??""),[e.size,w]),I=(null==m?void 0:m.valueKey)||"value",_=(null==m?void 0:m.textKey)||"text",R=(null==m||m.children,t().useRef(null)),P=Ln(R),[O,A]=t().useState(g),[k,H]=t().useState(!1),F=(0,Y.Ds)((()=>{A(R.current.offsetHeight-G.current.offsetHeight-10)}),5);Se((()=>{g||F()}),[P.height]);const[L,q]=t().useState([]),[D,$]=t().useState({}),[M,K]=t().useState([]),[V,U]=t().useState([]),[j,z]=t().useState(""),[B,W]=t().useState(y),G=t().useRef(null),Z=t().useRef([]),X=t().useRef([]);t().useEffect((()=>{Array.isArray(o)&&(Q(o),K(J(o)),$({}))}),[o]),t().useEffect((()=>{ae()}),[]),Se((()=>{ae()}),[null==s?void 0:s.params]),Se((()=>{U(te())}),[D]),t().useImperativeHandle(a,(()=>({INSERT_RECORD:(e,t)=>{const a=Mn(L,(t=>e===t[I]));a&&(Array.isArray(a.children)?a.children.push(t):a.children=[t],Q([...L]))},REMOVE_RECORD:e=>{const t=qn(L,e,I);if(void 0===t&&L.find((t=>t[I]===e)))Q(L.filter((t=>t[I]!==e)));else{var a;const r=Mn(L,(e=>t===e[I]));if(!r)return;const l=null===(a=r.children)||void 0===a?void 0:a.findIndex((t=>e===t[I]));l>=0&&(r.children.splice(l,1),Q([...L]))}},UPDATE_RECORD:(e,t)=>{const a=Mn(L,(t=>e===t[I]));a&&((0,ca.merge)(a,t),Q([...L]))}})));const Q=e=>{q(e),Z.current=e,X.current=Vn(e,I)},J=e=>{if(n)return b;const t=$n(e,(e=>b.includes(e[_])));return 1===t.length?[t[0][I]]:[]},ee=e=>{var t;return(null===(t=Un(L,e,I))||void 0===t?void 0:t.slice(0,-1))||[]},te=()=>{if(y)return X.current;const e=[];return M.forEach((t=>{if(n){if("SHOW_ALL"===p&&!X.current.includes(t)&&e.push(...ee(t)),"SHOW_CHILD"===p&&e.push(...ee(t)),"SHOW_PARENT"===p){const a=na(L,t);if(a){const r=ee(t),l=jn(a,I);e.push(...r,...[t,...l].filter((e=>X.current.includes(e))))}}}else e.push(...ee(t))})),[...new Set(e)]},ae=async()=>{if(!s)return;const{api:e,params:t,dataKey:a,callback:r}=s;try{H(!0);const l=await e(t);if(200===l.code){const e=Array.isArray(l.data)?l.data:(0,ca.get)(l.data,a)??[];Q(e),K(J(e)),$({}),null==r||r(e)}}catch(e){}H(!1)},re=e=>`${e}|${Xr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,le=se("search-tree"),ne={[le]:!0,[`${le}--lg`]:"large"===T,[`${le}--sm`]:"small"===T};return t().createElement("div",{ref:R,className:oe()(ne)},t().createElement("div",{ref:G,className:"topper"},v&&t().createElement(N.Input.Search,{value:j,size:T,placeholder:h,allowClear:!0,onChange:e=>(e=>{if(!r)return;const t=Dn(Z.current,(t=>{if(!e)return!0;const a=t[_]||"";return-1!==re(a).indexOf(e)}));z(e),q(t),y||e?U(Vn(t,I)):$({})})(e.target.value)}),x&&t().createElement("a",{className:"trigger",onClick:()=>{W(!B),U(B?[]:X.current)}},B?t().createElement(ce.UpOutlined,null):t().createElement(ce.DownOutlined,null)," ",d(B?"qm.form.collect":"qm.form.spread"))),t().createElement(Qe,{spinning:k},t().createElement(N.Tree,{fieldNames:{title:_,key:I,children:"children"},multiple:n,draggable:i,blockNode:i,checkable:n,selectable:!n,height:O,disabled:e.disabled,checkStrictly:u,selectedKeys:f??M,checkedKeys:f??M,expandedKeys:V,treeData:L,loadData:c?async e=>{let{key:t,children:a}=e;if(!s||a)return;const{api:r,params:l,dataKey:n,formatter:i=(e=>e)}=s;try{const e=await r(i({...l,[I]:t}));if(200===e.code){const a=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,n)??[],r=Kn(Z.current,t,I,a);Q(r)}}catch(e){}}:void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!j)return!1;const t=e[_]||"";return-1!==re(t).indexOf(j)},onDragEnter:e=>{U(e.expandedKeys)},onDrop:e=>{const t=e.node.key,a=e.dragNode.key,r=e.node.pos.split("-"),l=e.dropPosition-Number(r[r.length-1]),n=(e,t,a)=>{for(let r=0;r<e.length;r++){if(e[r][I]===t)return a(e[r],r,e);e[r].children&&n(e[r].children,t,a)}},i=[...L];let o;if(n(i,a,((e,t,a)=>{a.splice(t,1),o=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===l)n(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));else{let e,a=[];n(i,t,((t,r,l)=>{a=l,e=r})),-1===l?a.splice(e,0,o):a.splice(e+1,0,o)}else n(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));Q(i)},onDragEnd:e=>{null==S||S(e,L)},onExpand:e=>{U(e)},onSelect:e=>{K(e);const t=$n(Z.current,(t=>e.includes((0,ca.get)(t,I))));null==E||E(n?t:t[0])},onCheck:e=>{u&&(e=e.checked),K(e),"SHOW_CHILD"===p&&(e=e.filter((e=>!X.current.includes(e)))),"SHOW_PARENT"===p&&(e=e.filter(((e,t,a)=>!a.includes(qn(L,e,I)))));const t=$n(Z.current,(t=>e.includes((0,ca.get)(t,I))));null==C||C(n?t:t[0])}})))}));zn.displayName="SearchTree";const Bn=zn,Wn=(0,e.createContext)(void 0),Gn={dataIndex:r().string.isRequired,title:r().string.isRequired,description:r().string,colSpan:r().number,width:r().number,minWidth:r().number,fixed:r().oneOf(["left","right"]),align:r().oneOf(["left","center","right"]),theadAlign:r().oneOf(["left","center","right"]),printFixed:r().bool,hidden:r().bool,noAuth:r().bool,noFixed:r().bool,ellipsis:r().bool,className:r().string,theadClassName:r().string,children:r().array,sorter:r().oneOfType([r().bool,r().func]),filter:r().shape({type:r().oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:r().arrayOf(r().shape({text:r().string,value:r().oneOfType([r().string,r().number])})),style:r().object}),precision:r().number,formatType:r().oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:r().bool,canCopy:r().bool,editRender:r().func,dictItems:r().arrayOf(r().shape({text:r().string,value:r().oneOfType([r().string,r().number])})),summation:r().shape({sumBySelection:r().bool,displayWhenNotSelect:r().bool,dataKey:r().string,unit:r().string,render:r().func}),groupSummary:r().shape({dataKey:r().string,unit:r().string,render:r().func}),headRender:r().func,render:r().func},Yn=(r().arrayOf(r().shape(Gn)).isRequired,r().func,r().array,r().oneOfType([r().string,r().func]).isRequired,r().bool,r().bool,r().shape({api:r().func.isRequired,params:r().object.isRequired,formatter:r().func,beforeFetch:r().func,afterFetch:r().func,stopToFirst:r().bool,dataKey:r().string,callback:r().func}),r().bool,r().bool,r().string,r().string,r().bool,r().bool,r().oneOfType([r().object,r().func]),r().oneOfType([r().object,r().func]),r().array,r().func,r().bool,r().bool,r().shape({type:r().oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:r().array,selectedRowKeys:r().array,hideSelectAll:r().bool,checkStrictly:r().bool,filterable:r().bool,selectByClickRow:r().bool,selectFirstRowOnChange:r().bool,clearableAfterFetched:r().bool,selectAllOnCurrentPage:r().bool,fetchSelectedRows:r().shape({api:r().func.isRequired,params:r().object,dataKey:r().string}),fetchAllRowKeys:r().shape({api:r().func.isRequired,params:r().object,dataKey:r().string}),disabled:r().func,onChange:r().func,onSelect:r().func,onSelectAll:r().func}),r().shape({currentRowKey:r().oneOfType([r().number,r().string]),disabled:r().func,onChange:r().func}),r().shape({virtual:r().bool}),r().shape({defaultExpandAllRows:r().bool,defaultExpandedRowKeys:r().array,expandedRowKeys:r().array,hideExpandAll:r().bool,rowExpandable:r().func,expandedRowClassName:r().string,expandedRowRender:r().func,onExpand:r().func,onChange:r().func}),r().shape({groupItems:r().arrayOf(r().shape({dataIndex:r().string.isRequired,titleIndex:r().string,color:r().string,backgroundColor:r().string})),fetch:r().shape({api:r().func.isRequired,params:r().object,dataKey:r().string}),onChange:r().func}),r().func,r().bool,r().bool,r().bool,r().bool,r().shape({current:r().number,pageSize:r().number,pageSizeOptions:r().array,showSizeChanger:r().bool,showQuickJumper:r().bool}),r().shape({fileName:r().string,fetch:r().shape({api:r().func.isRequired,params:r().object}),cellStyle:r().bool,hideIcon:r().bool}),r().shape({showLogo:r().bool}),r().shape({fetch:r().shape({api:r().func.isRequired,params:r().object,dataKey:r().string}),fieldList:r().arrayOf(r().object)}),r().shape({position:r().oneOf(["top","bottom"]),hideAlert:r().bool,hideClearButton:r().bool}),r().oneOf(["left","right"]),r().func,r().func,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().func,r().func,r().func,r().func,r().func,r().func,r().func,r().func,r().func,10),Zn="1",Xn="0",Qn="YYYY-MM-DD",Jn="YYYY-MM-DD HH:mm:ss",ei="HH:mm:ss",ti="YYYYMMDDHHmmss",ai={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};let ri;!function(e){e.left="flex-start",e.right="flex-end"}(ri||(ri={}));let li=[];const ni={getFocusInstance:function(){return li[0]??null},getInstance:function(e){return li.find((t=>t.id===e))??null},focus:function(e){const t=this.getInstance(e);t&&0!==li.findIndex((e=>e===t))&&(this.deregister(e),li=[t,...li])},register:function(e,t){e&&t&&(null!==this.getInstance(e)&&this.deregister(e),li=[{id:e,vm:t},...li])},deregister:function(e){e&&(li=li.filter((t=>t.id!==e)))}};var ii=__webpack_require__(353);function oi(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const si=class{constructor(){oi(this,"state",{required:[],validate:[],edited:[],inserted:[],updated:[],removed:[]}),oi(this,"addToRequired",(e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)})),oi(this,"removeFromRequired",(e=>{const t=this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.required.splice(t,1)})),oi(this,"addToValidate",(e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)})),oi(this,"removeFromValidate",(e=>{const t=this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.validate.splice(t,1)})),oi(this,"addToEdited",(e=>{-1===this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.edited.push(e)})),oi(this,"removeFromEdited",(e=>{const t=this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.edited.splice(t,1)})),oi(this,"addToInserted",(e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)})),oi(this,"removeFromInserted",(e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)})),oi(this,"addToUpdated",(e=>{-1===this.state.updated.findIndex((t=>t===e))&&this.state.updated.push(e)})),oi(this,"removeFromUpdated",(e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)})),oi(this,"addToRemoved",(e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)})),oi(this,"removeFromRemoved",(e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)})),oi(this,"clearAllLog",(()=>{this.state.required=[],this.state.validate=[],this.state.edited=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]})),oi(this,"destroy",(()=>{for(const e in this)this[e]=null}))}},ci={defaultColumnWidth:80,selectionColumnWidth:50,rowHeightMaps:{large:42,middle:34,small:26},sortDirections:["ascend","descend"],pagination:{current:1,pageSize:20,pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showQuickJumper:!0},groupSummary:{total:{text:"记录数",value:"*"},recordTotalIndex:"nRecordsCount",summaryFieldName:"tsummary",groupbyFieldName:"tgroupby"},highSearch:{showSQL:!1},treeTable:{textIndent:17},dataKey:"records",summationKey:"summation",totalKey:"total",virtualScrollY:150,sorterFieldName:"tsortby",filterFieldName:"twhere",currentPageName:"currentPage",pageSizeName:"pageSize",showFilterType:!0,printWidth:1040,operationColumn:"__action__",selectionColumn:"__selection__",expandableColumn:"__expandable__",summaryIgnore:"sumIgnored"};let di;const ui=()=>{var e;if(Ne.Z)return 0;if(void 0!==di)return di;const t=document.createElement("div");t.className="qm-scrollbar__wrap",t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const a=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const l=r.offsetWidth;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),di=a-l,di},pi=require("big.js");var hi=__webpack_require__.n(pi);const mi=e=>e.map((e=>(e.children&&(e.children.forEach((t=>{t.parentDataIndex=e.dataIndex,e.fixed?t.fixed=e.fixed:delete t.fixed})),e.children=mi(e.children)),e))),fi=(e,a)=>{const{fetch:r,columns:l,height:n,minHeight:i,maxHeight:o,border:s=!0,rowSelection:c,summation:u,expandable:p,webPagination:h,scrollPagination:m,dragMergeCell:f,showSuperSearch:g,showFastSearch:b,showGroupSummary:y,showTableImport:v,showClipboard:x,showSelectCollection:E,footRender:C}=e,{tableRef:S,tableFullData:w,tableData:T,sorter:N,filters:I,superFilters:_,pagination:R}=a,{selectionRows:P,summaries:O}=S.current,A=t().useMemo((()=>!(null==r||!r.api)),[null==r?void 0:r.api]),k=t().useMemo((()=>!A&&!!h),[A,h]),H=t().useMemo((()=>A&&!!m),[A,m]),F=t().useMemo((()=>(A||k)&&!H),[A,k,H]),L=t().useMemo((()=>!!(n||i||o)),[n,i,o]),q=t().useMemo((()=>(e=>{const t=mi(e),a=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:ci.selectionColumn,title:"radio"===t?d("qm.table.config.selectionText"):"",width:ci.selectionColumnWidth,fixed:"left",type:t}})(c),r=null!=(l=p)&&l.expandedRowRender?{dataIndex:ci.expandableColumn,title:"",width:ci.selectionColumnWidth,fixed:"left",type:"expand"}:null;var l;return a&&t.unshift(a),r&&t.unshift(r),(0,ii.J1)(t)})(l)),[l]),D=t().useMemo((()=>(0,ii.HG)(q)),[q]),$=t().useMemo((()=>D.filter((e=>"function"==typeof e.editRender))),[D]),M=t().useMemo((()=>D.filter((e=>!!e.summation))),[D]),K=t().useMemo((()=>D.filter((e=>"left"===e.fixed))),[D]),V=t().useMemo((()=>D.filter((e=>"right"===e.fixed))),[D]),U=t().useMemo((()=>{const e=D.filter((e=>![ci.expandableColumn,ci.selectionColumn,ci.operationColumn].includes(e.dataIndex)));return e.length?e[0].dataIndex:""}),[D]),j=t().useMemo((()=>M.length>0),[M]),z=t().useMemo((()=>!!C||j),[C,j]),B=t().useMemo((()=>(0,ii.vo)(q).length>1),[q]),W=t().useMemo((()=>s||B),[s,B]),G=t().useMemo((()=>D.some((e=>e.sorter))),[D]),Y=t().useMemo((()=>D.some((e=>e.filter))),[D]),Z=t().useMemo((()=>M.some((e=>!!e.summation.dataKey))),[M]),X=t().useMemo((()=>!A&&!!v),[A,v]),Q=t().useMemo((()=>!!x&&$.length>0),[x,$]),J=t().useMemo((()=>!!E&&"checkbox"===(null==c?void 0:c.type)),[E,c]),ee=t().useMemo((()=>!!g&&Y),[g,Y]),te=t().useMemo((()=>!A&&!!b&&Y),[A,b,Y]),ae=t().useMemo((()=>!!y&&D.some((e=>!!e.groupSummary))),[D]),re=t().useMemo((()=>{var e;return!(null==u||null===(e=u.groupItems)||void 0===e||!e.length)}),[u]),le=t().useMemo((()=>!!f&&!A&&!h),[f,A,h]),ne=t().useMemo((()=>w.some((e=>Array.isArray(e.children)&&e.children.length))),[w]),ie=t().useMemo((()=>!T.length),[T]),oe=t().useMemo((()=>(()=>{const e={};return M.forEach((t=>{const{dataIndex:a,precision:r,summation:l}=t,{sumBySelection:n,displayWhenNotSelect:i,unit:o}=l,s=re?(0,ii.SX)(S.current.tableFullData):S.current.tableFullData,c=!P.length&&!!i;let d=(!n||c?s:P).reduce(((e,t)=>{if(null!=t&&t[ci.summaryIgnore])return e;const r=Number((0,ii.C_)(t,a));return Number.isNaN(r)?e:new(hi())(e).plus(r).toNumber()}),0);!Object.keys(O).includes(a)||n&&!c||(d=Number((0,ii.C_)(O,a))),(0,ii.dN)(e,a,d);let u=r>=0?d.toFixed(r):d;u=(0,ii.uf)(u),(0,ii.dN)(e,`${a}_text`,o?`${u} ${o}`:u)})),[e]})()),[w,P,O]),se=t().useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(M)),[M]),ce=t().useMemo((()=>{const e=(0,ii.W2)(N),t=((e,t)=>{const a=[];if(Object.keys(e).length)for(const t in e){const[r,l]=ci.showFilterType?t.split("|"):[t,""],n=e[t];Object.keys(n).forEach((e=>{a.push({type:l,bracketLeft:"",fieldName:r,expression:e,value:n[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{a.push({type:ci.showFilterType?e.fieldType:"",bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),a.length&&(a[a.length-1].logic=""),a})(I,_);return{...e?{[ci.sorterFieldName]:e}:null,...t.length?{[ci.filterFieldName]:t}:null,...se?{[ci.groupSummary.summaryFieldName]:se,usedJH:1}:null,...(null==r?void 0:r.params)??null,[ci.currentPageName]:R.current,[ci.pageSizeName]:R.pageSize}}),[null==r?void 0:r.params,R.current,R.pageSize,N,I,_,se]);return{isFetch:A,isWebPagination:k,isScrollPagination:H,showPagination:F,shouldUpdateHeight:L,tableColumns:q,flattenColumns:D,editableColumns:$,summationColumns:M,leftFixedColumns:K,rightFixedColumns:V,firstDataIndex:U,showSummary:j,showFooter:z,isHeadGroup:B,bordered:W,isHeadSorter:G,isHeadFilter:Y,isServiceSummation:Z,isSelectCollection:J,isTableImport:X,isTableClipboard:Q,isSuperSearch:ee,isFastSearch:te,isGroupSummary:ae,isGroupSubtotal:re,isDragMergeCell:le,isTreeTable:ne,isTableEmpty:ie,summationRows:oe,fetchParams:ce}},gi=(a,r)=>{const{rowKey:l,dataSource:n,summation:i,fetch:o,rowSelection:s,expandable:c,treeConfig:d,authConfig:u,ignorePageIndex:p,columnsChange:h,onScrollEnd:f,onDataChange:g,onDataLoad:b,onChange:y}=a,{getRowKey:v,tableRef:x,tableElementRef:E,tableBodyRef:C,$size:S,tableColumns:w,tableFullData:T,pagination:N,layout:I,filters:_,sorter:R,superFilters:P,fetchParams:O,selectionKeys:A,rowExpandedKeys:k,highlightKey:H,summationColumns:F,shouldUpdateHeight:L,isFetch:q,isTreeTable:D,isWebPagination:$,isScrollPagination:M,isServiceSummation:K,isGroupSubtotal:V,doLayout:U,setTableData:j,setTableFullData:z,setTableOriginData:B,setAllTableData:W,setDeriveRowKeys:Z,setPagination:X,setSpinning:Q,setSorter:J,setFilters:ee,setSuperFilters:te,setSelectionKeys:ae,setRowExpandedKeys:re,setHighlightKey:le,setSelectionRows:ne,setScrollYLoad:ie,setScrollYStore:oe,setFieldAuth:se,setResizeState:ce,setSummaries:de,setPermission:ue,setRecordsMap:pe,resetTableScroll:he,clearElementStore:me,clearRecordsMap:fe}=r,{store:ge}=x.current,be=Ln(E),ye=t().useRef({...O}),ve=t().useRef({list:[],maps:new Map});Se((()=>{U()}),[w,S,I.tableAutoHeight]),Se((()=>{xe()}),[be]),Se((()=>{Je(),et(),tt(),q||($&&je(),De(n))}),[n,null==o?void 0:o.params]),Se((()=>{const e=Fe(O,ye.current);e||q&&(null==s?void 0:s.clearableAfterFetched)&&at(),e||!(O[ci.currentPageName]>1)||null!=o&&o.stopToFirst?q&&qe():je(),ye.current=O}),[O]),Se((()=>{$&&Ye(),M||he(),Ae()}),[N.current,N.pageSize]),Se((()=>{q||Ee(T.length),U()}),[T]),Se((()=>{D&&null!=d&&d.virtual&&(ze(),Ye())}),[k]);const xe=()=>{const{scrollYLoad:e,resizeState:t}=x.current,{height:a}=t,{width:r,height:l}=be,n=l!==a;U(),n&&L&&e&&Ye(),ce(Object.assign({},t,{width:r,height:l}))},Ee=e=>{e!==N.total&&X((t=>Object.assign({},t,{total:e})))},Ce=(0,Y.Ds)((e=>{Ke(),null==f||f(e)})),we=e=>V?Te(Ne(e,0)):e,Te=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Te(e.children)),delete e.children,t.push(e)})),t},Ne=(e,t)=>{var a;const r=null===(a=i.groupItems)||void 0===a?void 0:a[t];return r?(0,ii.v9)(e,[r.dataIndex]).map((e=>{const a={children:Ne(e,t+1),_group:r.dataIndex};return"function"!=typeof l&&(0,ii.dN)(a,l.toString(),(0,ii.wE)()),r.titleIndex&&(0,ii.dN)(a,r.titleIndex,(0,ii.C_)(e[0],r.titleIndex)),(0,ii.dN)(a,r.dataIndex,(0,ii.C_)(e[0],r.dataIndex)),F.forEach((e=>{var t;const{dataIndex:r}=e,l=null===(t=a.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[ci.summaryIgnore])return e;const a=Number((0,ii.C_)(t,r));return Number.isNaN(a)?e:e+a}),0);(0,ii.dN)(a,r,l)})),a})):(e.forEach(((t,a)=>{t._rowSpan=0===a?e.length:0,t._colSpan=1})),e)},Ie=e=>{const{selectionRows:t,allTableData:a,recordsMap:r}=x.current;if(q)return[...t.filter((t=>e.includes(v(t,t.index)))),...a.filter((a=>{const r=v(a,a.index);return e.includes(r)&&-1===t.findIndex((e=>v(e,e.index)===r))}))];const l=[];for(let t=0,a=e.length;t<a;t++){const a=e[t];r.has(a)&&l.push(r.get(a))}return l},_e=e=>{const{type:t,checkStrictly:a=!0}=s||{},r=Array.isArray(e)?e:A;let l=[];return x.current.treeTable&&!a&&r.forEach((e=>{l.push(...((e,t)=>{var a;const{deriveRowKeys:r}=x.current,l=(0,ii.CD)(r,e);let n=[];if(!l)return n;const i=Pe((null==l?void 0:l.children)||[]),o=(null===(a=(0,ii.Qi)(r,e))||void 0===a?void 0:a.slice(0,-1).reverse())||[];return n=[...new Set([...t,...i])],o.forEach((e=>{var t;const a=(0,ii.CD)(r,e),l=(0,ii.bY)(n,(null==a||null===(t=a.children)||void 0===t?void 0:t.map((e=>e.rowKey)))||[]);n=l?[...n,e]:n.filter((t=>t!==e))})),n})(e,r))})),l="radio"===t?r.slice(0,1):[...new Set([...r,...l])],l},Re=e=>{const{allRowKeys:t,deriveRowKeys:a,flattenRowKeys:r}=x.current,{defaultExpandAllRows:l,expandedRowRender:n}=c||{},i=Array.isArray(e)?e:k;if(x.current.treeTable){n&&m("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...A];H&&e.unshift(H);let o=[];return e.forEach((e=>{const t=(0,ii.Qi)(a,e)||[];o.push(...t.length>1?t.slice(0,-1).reverse():t)})),o=l?t:[...new Set([...i,...o])],o.filter((e=>!r.includes(e)))}return c?l?t.slice(0):[...i]:[]},Pe=e=>{const t=[];for(let a=0;a<e.length;a++)Array.isArray(e[a].children)&&t.push(...Pe(e[a].children)),t.push(e[a].rowKey);return t},Oe=(e,t)=>{const a=[];return e.forEach((e=>{e.children&&a.push(...Oe(e.children,t)),e.rowKey===t&&e.parentRowKey&&a.push(e.parentRowKey)})),a.length&&a.push(...Oe(e,a[a.length-1])),a},Ae=(0,Y.Ds)((()=>{Me(),null==y||y(N,He(_),ke(R),P,{currentDataSource:We()})})),ke=e=>{const t={};for(const a in e)null!==e[a]&&(t[a]=e[a]);return t},He=e=>{const t={};for(const a in e){if(!a.includes("|"))continue;const[r,l]=a.split("|");t[ci.showFilterType?`${r}|${l}`:r]=e[a]}return t},Fe=(e,t)=>{const a=Object.keys((0,ii.e5)(e,t));return 1===a.length&&(a.includes(ci.currentPageName)||a.includes(ci.pageSizeName))},Le=async()=>{var e;if(!o)return;const{formatter:t=(e=>e),beforeFetch:a=Y.XT,afterFetch:r,callback:l}=o;if(!a(O))return;const n=M&&O[ci.currentPageName]>ye.current[ci.currentPageName]&&Fe(O,ye.current),s=!(null==i||null===(e=i.fetch)||void 0===e||!e.api);Q(!0);try{const[e,a]=s?await Promise.all([o.api(t(O)),i.fetch.api(t(O))]):[await o.api(t(O))];if(s?200===e.code&&200===a.code:200===e.code){const t=o.dataKey??ci.dataKey;let i=(0,ca.get)(e.data,t)??[];i="function"==typeof r?await r(i):i;const s=(0,ca.get)(e.data,t.replace(/[^.]+$/,ci.totalKey))||i.length||0;De(n?x.current.tableFullData.concat(i):i),Ee(s),$e((null==a?void 0:a.data)||e.data),null==l||l(e.data)}}catch(e){}(0,ii.RI)(o,"stopToFirst")&&(o.stopToFirst=!1),Q(!1)},qe=function(t,a){const r=e.useRef();return e.useEffect((()=>()=>clearTimeout(r.current)),[]),()=>{clearTimeout(r.current),r.current=setTimeout(t,undefined)}}(Le),De=e=>{const t=e=>e.map(((e,a)=>(Array.isArray(e.children)&&e.children.length&&(e.children=t(e.children)),e.index=a,p||(e.pageIndex=(e=>{const{current:t,pageSize:a}=N;return!q||M?e:(t-1)*a+e})(a)),e))),a=we(t(e));Ze(a),Xe(a),Qe(),ae(_e()),re(Re()),ne(Ie(A)),Me(),null==b||b(a)},$e=e=>{var t;if(!K)return;const a=(null==i||null===(t=i.fetch)||void 0===t?void 0:t.dataKey)??ci.summationKey,r=(a?(0,ca.get)(e,a):e)??{},l={};F.filter((e=>!!e.summation.dataKey)).forEach((e=>{(0,ii.dN)(l,e.dataIndex,Number((0,ii.C_)(r,e.summation.dataKey)))})),de(l)},Me=()=>{const{type:e,selectFirstRowOnChange:t}=s||{};if("radio"===e&&t){const e=We();if(e.length){const t=v(e[0],e[0].index);ae([t])}else ae([])}},Ke=()=>{if(!M)return;const e=Ue();N.current>=e||Ve({...N,current:N.current+1})},Ve=e=>{let{current:t,pageSize:a}=e;X((e=>Object.assign({},e,{current:t,pageSize:a})))},Ue=()=>{const{pageSize:e,total:t}=N;return Math.ceil(t/e)},je=()=>{Ve(Object.assign({},N,{current:1}))},ze=()=>{if(!x.current.treeTable||null==d||!d.virtual)return;const e=Be(x.current.deriveRowKeys,(()=>{const{allTableData:e,allRowKeys:t}=x.current,{rowExpandable:a}=c||{},r=[];return"function"==typeof a&&e.forEach(((e,l)=>!a(e)&&r.push(t[l]))),r.length?k.filter((e=>!r.includes(e))):k})());ve.current.list=e,ve.current.maps.clear(),e.forEach(((e,t)=>ve.current.maps.set(e.rowKey,t)))},Be=(e,t)=>{const a=[];return e.forEach((e=>{e.children&&a.push(...Be(e.children,t)),(void 0===e.parentRowKey||t.includes(e.parentRowKey)&&e.rowKeyPath.split("#").slice(0,-1).every((e=>t.findIndex((t=>t==e))>-1)))&&a.push({rowKey:e.rowKey,level:e.level})})),a},We=()=>$?(()=>{const{current:e,pageSize:t}=N;return x.current.tableFullData.slice((e-1)*t,e*t)})():x.current.tableFullData,Ge=e=>{const{scrollYLoad:t,scrollYStore:a}=x.current;j(t?e.slice(a.startIndex,a.endIndex):e)},Ye=()=>{let e=We();x.current.treeTable&&null!=d&&d.virtual&&(e=(e=>{const{allTableData:t,allRowKeys:a}=x.current,{list:r,maps:l}=ve.current,n=[];for(let e=0,i=a.length;e<i;e++){const i=a[e];l.has(i)&&(t[e]._level=r[l.get(i)].level,n.push(t[e]))}return n})()),ie(e.length>ci.virtualScrollY),(e=>{const{elementStore:t,scrollYStore:a,scrollYLoad:r}=x.current,{startIndex:l,rowHeight:n}=a;let i="",o="";r&&(i=`translateY(${Math.max(0,l*n)+"px"})`,o=e.length*n+"px"),t.$tableBody.style.transform=i,t.$tableYspace.style.height=o})(e),Ge(e)},Ze=e=>{z(e),W(e),Z(e),ze(),Ye()},Xe=e=>{B(e)},Qe=()=>{const{allTableData:e}=x.current;fe(),e.forEach((e=>pe(v(e,e.index),e)))},Je=()=>{J({})},et=()=>{ee({})},tt=()=>{te([])},at=()=>{ae([])};return{initialTable:()=>{(async()=>{if(!u)return;let e=G()(u,["fetch"]);if(u.fetch){const{api:t,params:a,dataKey:r}=u.fetch;try{const l=await t(a);200===l.code&&(e=(r?(0,ca.get)(l.data,r):l.data)??{})}catch(e){}}if(Object.keys(e).length){const{isExport:t=1,isImport:a=1,isPrint:r=1}=e;ue((e=>Object.assign({},e,{export:!!t,import:!!a,print:!!r})))}if(Array.isArray(e.fieldList)){const{originColumns:t}=x.current,r=(0,ii.y1)(a.columns,(a=>{const{dataIndex:r}=a,l=e.fieldList.find((e=>e.dataIndex===r));if(l){const{visible:e=1,disabled:n,secretName:i}=l,o=(0,ii.Ps)(t,r);se(r,{visible:e,disabled:n,secretName:i}),e||(a.noAuth=!0,o.noAuth=!0),i&&(a.formatType=`secret-${i}`,o.formatType=`secret-${i}`)}}));null==h||h(r)}})(),H&&C.current.setClickedValues([H,""]),"radio"===(null==s?void 0:s.type)&&A.length&&C.current.setClickedValues([A[0],""]),q?Le():De(n)},createTableFullData:Ze,getTableData:Le,handleTableData:Ge,createTableData:De,createGroupData:we,createSelectionKeys:_e,createSelectionRows:Ie,createRowExpandedKeys:Re,findParentRowKeys:Oe,getAllChildRowKeys:Pe,doFieldValidate:(e,t,a,r)=>{if(!Array.isArray(e))return m("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(ge.removeFromRequired({x:a,y:r}),ge.removeFromValidate({x:a,y:r}),e.forEach((e=>{var l;e.required&&(0,Y.xb)(t)&&ge.addToRequired({x:a,y:r,text:e.message}),"function"!=typeof e.validator||null!==(l=e.validator)&&void 0!==l&&l.call(e,t)||ge.addToValidate({x:a,y:r,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:a,updated:r,removed:l}=ge.state,n=(0,ca.intersection)(a,l),i=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:i(e),validate:i(t),inserted:a.filter((e=>!n.includes(e))),updated:r.filter((e=>![...(0,ca.intersection)(r,a),...(0,ca.intersection)(r,l)].includes(e))),removed:l.filter((e=>!n.includes(e)))}},dataChange:()=>{null==g||g(x.current.tableFullData)},tableChange:Ae,toLastPage:()=>{const e=Ue();N.current!==e&&Ve(Object.assign({},N,{current:e}))},toFirstPage:je,getPageCount:Ue,pagerChangeHandle:Ve,triggerScrollYEvent:e=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollYStore:t}=x.current,{startIndex:a,endIndex:r,offsetSize:l,visibleSize:n,rowHeight:i}=t,o=Math.floor(e/i),s=Math.max(0,o-1-l),c=o+n+l;(o<=a||o>=r-n-1)&&(a===s&&r===c||(oe(Object.assign({},t,{startIndex:s,endIndex:c})),Ye()))}(e)},scrollBottomDebouncer:Ce,clearTableSorter:Je,clearTableFilter:et,clearSuperFilters:tt,clearRowSelection:at,clearRowHighlight:()=>{le("")},clearTableLog:()=>{ge.clearAllLog()},destroy:()=>{me(),ge.destroy(),ni.deregister(x.current.uid)}}},bi=(e,a)=>{const{height:r,minHeight:l,maxHeight:n,resizable:i,showHeader:o,spanMethod:s}=e,{getRowKey:c,tableRef:d,$size:u,tableColumns:p,flattenColumns:h,leftFixedColumns:m,layout:f,scrollY:g,tableData:b,showFooter:y,showPagination:v,isWebPagination:x,isFullScreen:E,setLayout:C,setScrollX:S,setScrollY:w,setElementStore:T,setScrollYStore:N,setShouldToTop:I}=a,_=t().useRef(g),R=t().useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=f,a={};return l&&Object.assign(a,{minHeight:`${(0,ii.EJ)(l)}px`}),n&&Object.assign(a,{maxHeight:`${(0,ii.EJ)(n)}px`}),E?{...a,maxHeight:"",minHeight:"",height:`${e}px`}:r?{...a,height:"auto"!==r?`${(0,ii.EJ)(r)}px`:`${t}px`}:a}),[r,n,l,E,f]),P=(e,t)=>{const{elementStore:a,scrollYStore:r,allTableData:l}=d.current,n=a.$tableBody.parentNode;if(void 0!==t&&t>=0)n.scrollTop=t*r.rowHeight;else{const t=(x?(0,ii.tL)(b):l).findIndex((t=>e===c(t,t.index)));n.scrollTop=(t<0?0:t)*r.rowHeight}};return{createElementStore:e=>{Object.keys(e).forEach((t=>{T(t,e[t])}))},tableStyles:R,getSpan:(e,t,a,r,l)=>{let n=1,i=1;if("function"==typeof s){const o=s({row:e,column:t,rowIndex:a,columnIndex:r,tableData:l});Array.isArray(o)?(n=o[0],i=o[1]):(0,Y.Kn)(o)&&(n=o.rowSpan,i=o.colSpan)}const{mergeCells:o}=d.current;if(o.length>0){const e=o.find((e=>e.row===a&&e.col===r));e&&(n=e.rowSpan,i=e.colSpan)}return{rowSpan:n,colSpan:i}},getStickyLeft:e=>{h.findIndex((t=>t.dataIndex===e))<0&&(e=(0,ii.t2)((0,ii.Ps)(p,e)).dataIndex);let t=0;for(let a=0;a<h.length;a++){const r=h[a];if(r.dataIndex===e)break;t+=(0,ii.EJ)(r.width||r.renderWidth||0)}return t},getStickyRight:e=>{h.findIndex((t=>t.dataIndex===e))<0&&(e=(0,ii.gU)((0,ii.Ps)(p,e)).dataIndex);let t=0;for(let a=h.length-1;a>=0;a--){const r=h[a];if(r.dataIndex===e)break;t+=(0,ii.EJ)(r.width||r.renderWidth||0)}return t},scrollXToColumn:(e,t)=>{const{elementStore:a}=d.current,r=void 0===t?h.findIndex((t=>t.dataIndex===e)):t;if(r<0)return;const l=m.map((e=>e.width||e.renderWidth||ci.defaultColumnWidth)).reduce(((e,t)=>e+t),0);a.$tableBody.parentNode.scrollLeft=a.$tableBody.querySelectorAll("tbody > tr > td")[r].offsetLeft-l},scrollYToRecord:P,rowInViewport:e=>{const{elementStore:t,scrollYStore:a}=d.current,{viewportHeight:r,gutterWidth:l}=f,n=e*a.rowHeight,i=t.$tableBody.parentNode;return!(n<i.scrollTop||n+a.rowHeight>i.scrollTop+(scrollX?r-l:r))},calcTableHeight:()=>{if("auto"!==r)return;const{elementStore:e,resizeState:t}=d.current,a=t.winHeight-e.$table.getBoundingClientRect().top-(v?Oa["small"!==u?"middle":u]+Yn:0)-Yn;C((e=>Object.assign({},e,{tableAutoHeight:a})))},resetTableScroll:()=>{const{shouldToTop:e}=d.current;e&&P("",0),I(!0)},doLayout:()=>{(()=>{const{elementStore:e,scrollYLoad:t,resizeState:a}=d.current;if(!e.$table.offsetParent)return;const r=e.$table.offsetHeight,l=o?e.$header.offsetHeight:f.headerHeight,n=y?e.$footer.offsetHeight:f.footerHeight,i=r-l-n,s=e.$tableBody.offsetHeight,c=t||s>i;let p=0;if(E){const t=e.$toper?e.$toper.offsetHeight+Yn:0,r=e.$pager?e.$pager.offsetHeight+Yn:0;p=a.winHeight-t-r-20}i!==f.viewportHeight&&(e=>{const{scrollYStore:t,isIE:a}=d.current,{startIndex:r,endIndex:l}=t,n=ci.rowHeightMaps[u],i=Math.max(8,Math.ceil(e/n)+2),o=a?5:0;N(Object.assign({},t,{visibleSize:i,offsetSize:o,endIndex:Math.max(r+i+o,l),rowHeight:n}))})(i),_.current=c,w(c),C((e=>Object.assign({},e,{headerHeight:l,footerHeight:n,viewportHeight:i,tableBodyHeight:s,tableFullHeight:p})))})(),(()=>{const{elementStore:e}=d.current,t=e.$table.clientWidth,a=_.current?f.gutterWidth:0,{defaultColumnWidth:r}=ci,l=h.filter((e=>"number"!=typeof e.width));let n=0;if(h.forEach((e=>{"number"==typeof e.width&&(e.renderWidth=void 0)})),l.length>0){if(h.forEach((e=>{n+=e.width||e.minWidth||r})),n<=t-a){S(!1);const e=t-a-n;if(1===l.length&&i)l[0].renderWidth=(l[0].minWidth||r)+e;else{const t=e/l.reduce(((e,t)=>e+(t.minWidth||r)),0);let a=0;l.forEach(((e,l)=>{if(0===l)return;const n=Math.floor((e.minWidth||r)*t);a+=n,e.renderWidth=(e.minWidth||r)+n})),i&&(l[0].renderWidth=(l[0].minWidth||r)+e-a)}}else S(!0),l.forEach((e=>{e.renderWidth=e.minWidth||r}));C((e=>Object.assign({},e,{tableBodyWidth:Math.max(n,t)})))}else h.forEach((e=>{e.renderWidth=e.width||e.minWidth||r,n+=e.renderWidth})),S(n>t),C((e=>Object.assign({},e,{tableBodyWidth:n})));C((e=>Object.assign({},e,{tableWidth:t})))})()}}};function yi(){const[,t]=e.useReducer((e=>e+1),0);return t}const vi=e=>{const{total:a}=e,{tableRef:r,tableProps:l,selectionKeys:n,isHeadSorter:i,isHeadFilter:o,isTreeTable:s,clearTableSorter:c,clearTableFilter:u,clearSuperFilters:p,clearRowSelection:h,clearRowHighlight:m}=t().useContext(Wn),{infoBarConfig:f,rowSelection:g,rowHighlight:b}=l,{allTableData:y}=r.current,{hideAlert:v,hideClearButton:x}=f||{},E=t().useMemo((()=>!v),[v]),C=t().useMemo((()=>!x&&!!(i||o||g||b)),[x,i,o,g,b]),S={[`${se("table")}__alert`]:!0};return E?t().createElement("div",{className:oe()(S)},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.InfoCircleFilled,null)),t().createElement("span",null,d("qm.table.alert.total",{total:s?y.length:a}),g?`,${d("qm.table.alert.selected",{total:n.length})}`:""),C&&t().createElement("em",{onClick:()=>{c(),u(),p(),h(),m()}},d("qm.table.alert.clear"))):null},xi=t().forwardRef(((e,a)=>{const{isFullScreen:r,open:l=!0}=e,{setFullScreen:n}=t().useContext(Wn),i=()=>{n(!r)};t().useImperativeHandle(a,(()=>({clickHandle:i})));const o=se("table");return l?t().createElement("span",{className:`${o}-full-screen`,title:d(r?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>i()},t().createElement("i",{className:"svgicon icon"},r?t().createElement(ce.FullscreenExitOutlined,null):t().createElement(ce.FullscreenOutlined,null))):null}));xi.displayName="FullScreen";const Ei=xi,Ci=t().forwardRef(((e,a)=>{const{open:r=!0}=e,{getTableData:l}=t().useContext(Wn),n=()=>{l()};t().useImperativeHandle(a,(()=>({clickHandle:n})));const i=se("table");return r?t().createElement("span",{className:`${i}-reload`,title:d("qm.table.refresh.text"),onClick:()=>n()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.ReloadOutlined,null))):null}));Ci.displayName="Reload";const Si=Ci,wi=t().forwardRef(((e,a)=>{var r,n;const{tableColumns:i,open:o=!0}=e,{global:s}=t().useContext(l),{tableRef:c,tableBodyRef:u,tableProps:p,flattenColumns:h,summationRows:m,showSummary:f,getSpan:g}=t().useContext(Wn),{tablePrint:b,showHeader:y}=p,v=(null==s||null===(r=s.print)||void 0===r?void 0:r.leftLogo)??"",x=(null==s||null===(n=s.print)||void 0===n?void 0:n.rightLogo)??"",E=!(!v&&!x),C=t().useMemo((()=>(0,Y.I8)((0,ii.MY)(i,[ci.expandableColumn,ci.selectionColumn,ci.operationColumn]))),[i]),S=t().useMemo((()=>(0,Y.I8)((0,ii.MY)(h,[ci.expandableColumn,ci.selectionColumn,ci.operationColumn]))),[h]),w=t().useMemo((()=>(0,Y.I8)(i.filter((e=>e.printFixed)))),[i]),T=(e,t)=>{const a=Object.assign({},(0,ii.Ps)(t,e.parentDataIndex));return a.children=[e],a.level&&a.level>1?T(a,t):a},N=(e,t)=>(0,ca.map)((0,ca.groupBy)((0,ca.flatten)(e),t),(0,ca.spread)((function(){for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];return(0,ca.mergeWith)(...a,((e,a)=>{if(Array.isArray(e))return N(e.concat(a),t)}))}))),I=()=>{const{allTableData:e}=c.current,t=(e=>{const t=[];let a=[],r=0,l=0;for(;l<e.length;){const n=e[l];r+=n.width||n.renderWidth||n.minWidth||ci.defaultColumnWidth,r<=ci.printWidth?(a.push(n),l===e.length-1&&t.push(a),l++):l>0?(e.splice(0,l),w.length&&e.unshift(...w),t.push(a),a=[],r=0,l=0):(n.width=ci.printWidth,a.push(n),t.push(a),l++)}return t})([...S]),a=((e,t)=>{const a=[];return e.forEach((e=>{let r=[];e.forEach((e=>{1===e.level?r.push(e):r.push(T(e,t))})),r=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const a=e.filter((e=>e.dataIndex===t));return a.length<=1?a[0]:N(a,"dataIndex")[0]})))(r),a.push((0,ii.vo)(r))})),a})(t,C);let r=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<style>\n * {\n margin: 0;\n padding: 0;\n }\n body * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n }\n table--print {\n font-size: 14px;\n text-align: left;\n }\n .table--print th,\n .table--print td {\n padding: 5px;\n border: 1px solid #000;\n }\n .no-border th,\n .no-border td {\n border: 0!important;\n }\n .table--print th[colspan]:not([colspan='1']) {\n text-align: center;\n }\n .page-break {\n page-break-after: always;\n }\n</style>","</head>","<body>"].join("");for(let l=0;l<t.length;l++)r+=_(a[l],t[l],e),r+='<div class="page-break"></div>';return r+"</body></html>"},_=(e,t,a)=>{const{showLogo:r=!0}=b;let l='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return l+=`<colgroup>${t.map((e=>{let{width:t,minWidth:a,renderWidth:r}=e;return`<col style="width:${t||r||a||ci.defaultColumnWidth}px">`})).join("")}</colgroup>`,y&&(l+=["<thead>",r&&E?`<tr><th colspan="${t.length}" style="border: 0">${['<table class="no-border" width="100%" border="0" cellspacing="0" cellpadding="0">',"<tr>",'<td width="50%" align="left">',v?`<img src="${v}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',x?`<img src="${x}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:a}=e;return 0===a?null:`<th colspan="${a}" rowspan="${t}">${e.title}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),a.length&&(l+=`<tbody>${a.map((e=>`<tr>${t.map(((t,r)=>{const{rowSpan:l,colSpan:n}=g(e,t,e.index,r,a);return l&&n?`<td rowspan="${l}" colspan="${n}">${((e,t,a,r)=>u.current.renderCellTitle(a,e,t,r))(e,e.index,t,r)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),f&&m.length&&(l+=["<tfoot>",m.map((e=>`<tr>${t.map(((t,r)=>{const{dataIndex:l,summation:n}=t,i=null!=n&&n.render?n.render(a):(0,ii.C_)(e,`${l}_text`);return`<td>${0===r&&""===i?d("qm.table.config.summaryText"):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),l+="</table>",l},R=()=>{var e;null===(e=((e,t)=>{const{filename:a,type:r,isDownload:l}={filename:"print",type:"html",isDownload:!1},n=`${a}.${r}`;if(window.Blob){const e=new Blob([t],{type:`text/${r}`});if(!l)return Promise.resolve({type:r,content:t,blob:e});tt(e,n)}})(0,I()))||void 0===e||e.then((e=>{let{content:t,blob:a}=e,r=document.createElement("iframe");r.setAttribute("frameborder","0"),r.setAttribute("width","100%"),r.setAttribute("height","0"),r.style.display="none",document.body.appendChild(r),c.current.isIE?(r.contentDocument.write(t),r.contentDocument.execCommand("print"),r.parentNode.removeChild(r),r=null):(r.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{r.parentNode.removeChild(r),r=null}))},r.src=URL.createObjectURL(a))}))};t().useImperativeHandle(a,(()=>({clickHandle:R})));const P=se("table");return o?t().createElement("span",{className:`${P}-print`,title:d("qm.table.print.text"),onClick:()=>R()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.PrinterOutlined,null))):null}));wi.displayName="TablePrint";const Ti=wi,Ni=require("exceljs");var Ii=__webpack_require__.n(Ni);const _i="606060",Ri="thin",Pi="d4d4d4",Oi=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Ai=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},ki=()=>({top:{style:Ri,color:{argb:Pi}},left:{style:Ri,color:{argb:Pi}},bottom:{style:Ri,color:{argb:Pi}},right:{style:Ri,color:{argb:Pi}}}),Hi=e=>{const{children:t}=e;return t&&t.length?Hi(t[0]):e},Fi=e=>{const{precision:t,formatType:a}=e,r=t>=0?t?`0.${new Array(t).fill("0").join("")}`:"0":"";return r?{numFmt:r}:"percent"===a?{numFmt:t>=0?`${r}%`:"0%"}:"finance"===a?{numFmt:t>=0?`#,##${r}`:"#,##0"}:null},Li=()=>{const{tableRef:e,tableProps:a,getSpan:r,showSummary:l,isHeadGroup:n}=t().useContext(Wn),{spanMethod:i,showHeader:o}=a,s=(e,t)=>{var a;return(null===(a=e.find((e=>e.text==t)))||void 0===a?void 0:a.value)??""};return{exportXLSX:async(t,a,s,c)=>{const{columns:u,footSummation:p}=t,{scrollYStore:{rowHeight:h}}=e.current,m=(0,ii.HG)(u),f=(0,ii.vo)(u),g=[],b=[],y=[],v=[];let x=0;const E={};m.forEach((e=>{const{dataIndex:t,title:a,width:r,minWidth:l,renderWidth:n}=e;E[t]=a,y.push({key:t,width:(r||n||l||ci.defaultColumnWidth)/8})})),o&&(n?f.forEach(((e,t)=>{const a={};e.forEach((e=>{const{colSpan:r,rowSpan:l}=e,n=Hi(e),i=m.findIndex((e=>{let{dataIndex:t}=e;return t===n.dataIndex}));a[n.dataIndex]=e.title,0!==r&&(r>1||l>1)&&v.push({s:{r:t,c:i},e:{r:t+l-1,c:i+r-1}})})),g.push(a)})):(m.forEach(((e,t)=>{const{colSpan:a,rowSpan:r}=e;(a>1||r>1)&&v.push({s:{r:x,c:t},e:{r:x+r-1,c:t+a-1}})})),g.push(E)),x+=g.length);const C=a.map(((e,t)=>{const l={};return m.forEach(((n,o)=>{if("function"==typeof i){const{rowSpan:l,colSpan:i}=r(e,n,t,o,a);(i>1||l>1)&&v.push({s:{r:t+x,c:o},e:{r:t+x+l-1,c:o+i-1}})}const s=["percent","finance"].includes(n.formatType);l[n.dataIndex]=s?(0,ii.C_)(e,n.dataIndex):c(e,t,n,o)})),l}));x+=C.length,l&&p&&s(m,a).forEach(((e,t)=>{const r={};m.forEach(((t,l)=>{const{dataIndex:n,summation:i}=t,o=null!=i&&i.render?i.render(a):(0,ii.C_)(e,n);r[n]=0===l&&""===o?d("qm.table.config.summaryText"):(0,Y.l$)(o)?(0,ii.gn)(o).join(""):o})),b.push(r)}));const{sheetName:S,useStyle:w}=t,T=new(Ii().Workbook),N=T.addWorksheet(S);N.columns=y,o&&N.addRows(g).forEach((e=>{w&&Oi(e,h),e.eachCell((e=>{const t=N.getColumn(e.col),a=(0,ii.Ps)(u,t.key),{align:r}=a;Ai(e,r),w&&Object.assign(e,{font:{bold:!0,color:{argb:_i}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:ki()})}))})),N.addRows(C).forEach((e=>{w&&Oi(e,h),e.eachCell((e=>{const t=N.getColumn(e.col),a=(0,ii.Ps)(u,t.key),{align:r}=a;Ai(e,r),Object.assign(e,Fi(a)),w&&Object.assign(e,{font:{color:{argb:_i}},border:ki()})}))})),l&&p&&N.addRows(b).forEach((e=>{w&&Oi(e,h),e.eachCell((e=>{const t=N.getColumn(e.col),a=(0,ii.Ps)(u,t.key),{align:r}=a;Ai(e,r),Object.assign(e,Fi(a)),w&&Object.assign(e,{font:{color:{argb:_i}},border:ki()})}))})),v.forEach((e=>{let{s:t,e:a}=e;N.mergeCells(t.r+1,t.c+1,a.r+1,a.c+1)}));const I=await T.xlsx.writeBuffer();return new Blob([I],{type:"application/octet-stream"})},exportCSV:(e,t)=>{const a=e=>{let t=e;const a=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),r=-1!==e.indexOf('"');return r&&(t=t.replace(/"/g,'""')),(a||r)&&(t='"'+t+'"'),t},r="\ufeff"+(e=>{let t,r,l,n,i="";for(t=0;t<e.rows.length;t+=1){for(l=e.rows[t],r=0;r<l.cells.length;r+=1)n=l.cells[r],i=i+(r?",":"")+a(n.textContent.trim());i+="\r\n"}return i})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var l;return((e,t,a)=>{t=t||"",a=a||512;const r=window.atob(e),l=[];let n;for(n=0;n<r.length;n+=a){const e=r.slice(n,n+a),t=new Array(e.length);let i;for(i=0;i<e.length;i+=1)t[i]=e.charCodeAt(i);const o=new window.Uint8Array(t);l.push(o)}return new window.Blob(l,{type:t})})((l=r,window.btoa(unescape(encodeURIComponent(l)))),"application/csv")},importXLSX:(e,t)=>{const{columns:a,file:r}=e,l=(0,ii.HG)(a),n=new FileReader;n.onerror=()=>{N.message.error(d("qm.table.import.error"))},n.onload=e=>{const a=l.map((e=>e.title)),r=new(Ii().Workbook),n=e.target;n?r.xlsx.load(n.result).then((e=>{const r=e.worksheets[0];if(r){const e=r.getSheetValues(),n=e.findIndex((e=>e&&e.length>0)),i=e[n],o=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(a,i);if(o){const r=e.slice(n+1).map((e=>{const t={};e.forEach(((e,a)=>{let r=e;(0,Y.Kn)(r)&&(r=e.text),(0,ca.isDate)(r)&&(r=(0,ii.p6)(e,Jn)),t[i[a]]=r}));const r={};return a.forEach(((e,a)=>{const{dataIndex:n,dictItems:i}=l[a];var o;Array.isArray(i)&&(null!==(o=t[e])&&void 0!==o&&o.includes(",")?t[e]=t[e].split(",").map((e=>s(i,e))).filter((e=>""!==e)):t[e]=s(i,t[e])),(0,ii.dN)(r,n,t[e])})),r}));null==t||t(r)}else N.message.error(d("qm.table.import.error"))}else N.message.error(d("qm.table.import.error"))})):N.message.error(d("qm.table.import.error"))},n.readAsArrayBuffer(r)}}},qi=e=>{const{fileType:a,onChange:r}=e;let l,n;const i=se("table"),o=e=>{const t=e.name,a=t.lastIndexOf("."),r=t.substring(a+1,t.length);return{filename:t.substring(0,a),type:r}};return t().createElement(J,{onClick:()=>(async()=>{try{const e=await(e=>{const t=Object.assign({},e);return l||(l=document.createElement("form"),n=document.createElement("input"),l.className=`${i}--file-form`,n.name="file",n.type="file",l.appendChild(n),document.body.appendChild(l)),new Promise(((e,a)=>{const r=!t.type;n.multiple=!!t.multiple,n.accept=r?"":`.${t.type}`,n.onchange=i=>{const{files:s}=i.target,c=s[0];let u="";if(!r)for(let e=0;e<s.length;e++){const{type:a}=o(s[e]);if(t.type!==a){u=a;break}}u?(N.message.warning(d("qm.upload.notType",{type:u})),a()):e(c),document.body.removeChild(l),l=null,n=null},l.reset(),n.click()}))})({type:a});null==r||r(e.name,e)}catch(e){}})()},d("qm.upload.text"))},Di=e=>{const{columns:a,onClose:r}=e,{tableRef:l,tableProps:n,createTableData:i,dataChange:o}=t().useContext(Wn),{beforeTableImport:s}=n,{importXLSX:c}=Li(),u=t().useRef(null),[p,h]=t().useState(!1),[m,f]=t().useState(!0),g=e=>e.filter((e=>![ci.expandableColumn,ci.selectionColumn,"index","pageIndex",ci.operationColumn].includes(e.dataIndex))),[b,y]=t().useState([{type:"INPUT",label:d("qm.table.export.fileName"),fieldName:"fileName",render:(e,a)=>{const{fileName:r}=a.GET_FIELDS_VALUE(["fileName"]);return t().createElement(t().Fragment,null,r?t().createElement("span",null,r):t().createElement(qi,{fileType:a.state.formData.fileType,onChange:(e,t)=>{a.SET_FIELDS_VALUE({fileName:e,file:t}),t&&f(!1)}}))}},{type:"SELECT",label:d("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:d("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:d("qm.table.import.fillText"),value:"fill"},{text:d("qm.table.import.addText"),value:"add"},{text:d("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{b.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,y([...b])}},{type:"INPUT_NUMBER",label:d("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:1,max:l.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]),v=se("table");return t().createElement("div",{className:`${v}-import__setting`},t().createElement(Zl,{ref:u,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:{posIndex:"条"},items:b,cols:1,labelWidth:100}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>r(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(J,{type:"primary",loading:p,disabled:m,onClick:()=>(async()=>{const[e,t]=await u.current.GET_FORM_DATA();e||(h(!0),c({columns:g(a),file:t.file},(async e=>{const{tableFullData:a,store:n}=l.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof s)try{e=await s(e)}catch(e){}if("fill"===t.importType&&i(e),"add"===t.importType&&i([...a,...e]),"insert"===t.importType){const{tableFullData:a}=l.current,r=t.posIndex,n=a.slice(0,r).concat(e).concat(a.slice(r));i(n)}e.forEach((e=>{n.addToInserted(e)})),o(),N.message.success(d("qm.table.import.success",{total:e.length})),h(!1),r()})))})()},d("qm.table.import.text"))))},$i=t().forwardRef(((e,a)=>{const{tableColumns:r,open:l=!0}=e,[n,i]=t().useState(!1),o=()=>{i(!0)};t().useImperativeHandle(a,(()=>({clickHandle:o})));const s={[`${se("table")}-import`]:!0},c={visible:n,title:d("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return t().createElement(t().Fragment,null,l&&t().createElement("span",{className:oe()(s),title:d("qm.table.import.textNoSpace"),onClick:()=>o()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.ImportOutlined,null))),t().createElement(At,c,t().createElement(Di,{columns:r,onClose:()=>i(!1)})))}));$i.displayName="TableImport";const Mi=$i,Ki=e=>{const{columns:a,onChange:r}=e,{$size:l}=t().useContext(Wn),n=t().useRef([]),[i,o]=t().useState(!1),[s,c]=t().useState(a);Se((()=>{p()}),[s]),t().useEffect((()=>{u()}),[a]);const u=()=>{const e=[];a.forEach(((t,r)=>{const l=t.colSpan;l>1&&a.slice(r+1,r+l).every((e=>{let{colSpan:t}=e;return 0===t}))&&e.push(a.slice(r,r+l))})),n.current=e},p=()=>{const e=[];s.forEach((t=>{const{colSpan:a,dataIndex:r}=t;if(0===a)return;if(1===a)return e.push(t);const l=n.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(r)));if(-1===l)return e.push(t);e.push(...n[l].map(((e,a)=>{let{dataIndex:r}=e;const l=s.find((e=>e.dataIndex===r));return a>0&&void 0!==t.hidden&&(l.hidden=t.hidden),l})))})),null==r||r(e)},h=se("table"),m={[`${h}__popper`]:!0,"column-filter__popper":!0,[`${h}--lg`]:"large"===l,[`${h}--sm`]:"small"===l},f=[`${h}-column-filter`,{selected:i}];return t().createElement(Ua(),{action:["click"],popupVisible:i,popup:t().createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},t().createElement("div",{className:"main"},t().createElement(da.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:s,setList:e=>{const t=e.map((e=>e.dataIndex)),a=s.map((e=>e.dataIndex));(0,ca.isEqual)(t,a)||c(e)}},s.map((e=>((e,a)=>{const{colSpan:r}=e;if(0===r)return t().createElement("li",{key:e.dataIndex,style:{display:"none"}});const l=["svgicon","handle","main-handle"];return t().createElement("li",{key:e.dataIndex,className:"item"},t().createElement(N.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:a}=t.target;e.hidden=!a,c([...s])}}),t().createElement("i",{className:oe()(l),title:d("qm.table.columnFilter.draggable")},t().createElement(ce.HolderOutlined,null)),t().createElement("span",{className:"text",title:e.title},e.title))})(e)))))),popupClassName:oe()(m),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{o(e)},builtinPlacements:ai,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement("span",{className:oe()(f),title:d("qm.table.columnFilter.text")},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.SettingOutlined,null)),t().createElement("span",null,d("qm.table.columnFilter.text"))))},Vi=e=>{const{defaultValue:a,onClose:r,onOk:l}=e,{tableProps:n,pagination:o,showSummary:s}=t().useContext(Wn),{rowSelection:c}=n,u=t().useRef(null),[p,h]=t().useState(!1),m=t().useMemo((()=>Object.assign({},{fileName:`${i()().format(ti)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},a,{columns:(0,Y.I8)(a.columns||[])})),[]),[f,g]=t().useState([{type:"INPUT",label:d("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:d("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:d("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:d("qm.table.export.all"),value:"all"},{text:d("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==c?void 0:c.type)},{text:d("qm.table.export.custom"),value:"custom"}]},onChange:e=>{f.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,g([...f])}},options:{min:1},disabled:!0},{type:"INPUT",label:d("qm.table.columnFilter.text"),fieldName:"columns",render:(e,a)=>t().createElement(Ki,{columns:a.state.formData.columns,onChange:e=>{a.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:d("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:d("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]),b=se("table");return t().createElement("div",{className:`${b}-export__setting`},t().createElement(Zl,{ref:u,initialValues:m,items:f,cols:1,labelWidth:100}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>r(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(J,{type:"primary",loading:p,onClick:()=>(async()=>{const[e,t]=await u.current.GET_FORM_DATA();if(!e){h(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);l(t),await(0,Y._v)(1e3),h(!1),r()}})()},d("qm.table.export.text"))))},Ui=t().forwardRef(((e,a)=>{const{tableColumns:r,open:n=!0}=e,{global:o}=t().useContext(l),{tableRef:s,tableBodyRef:c,tableProps:u,flattenColumns:p,pagination:h,fetchParams:m,isFetch:f,isGroupSubtotal:g,showSummary:b,getSpan:y}=t().useContext(Wn),{exportExcel:v,fetch:x,showHeader:E}=u,[C,S]=t().useState(!1),[w,T]=t().useState(!1),I=t().useMemo((()=>{var e;return!(null==v||null===(e=v.fetch)||void 0===e||!e.api)}),[v]),_=t().useMemo((()=>!h.total||w),[h.total,w]),R=t().useMemo((()=>(0,ii.MY)(r,[ci.expandableColumn,ci.selectionColumn,ci.operationColumn])),[r]),P=t().useMemo((()=>(0,ii.MY)(p,[ci.expandableColumn,ci.selectionColumn,ci.operationColumn])),[p]),O=(e,t)=>{const a={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:r}=e,l=(g?(0,ii.SX)(t):t).reduce(((e,t)=>{if(null!=t&&t[ci.summaryIgnore])return e;const a=Number((0,ii.C_)(t,r));return Number.isNaN(a)?e:e+a}),0);(0,ii.dN)(a,r,l)})),[a]},A=(e,t,a,r)=>{const{precision:l,formatType:n}=a;let i=c.current.renderCellTitle(a,e,t,r);return l>=0&&!n&&""!==i&&(i=Number(i)),i},{exportXLSX:k,exportCSV:H}=Li(),F=async e=>{const{api:t,dataKey:a}=x;let r=[];try{T(!0);const l=await t({...m,[ci.currentPageName]:1,[ci.pageSizeName]:e??h.total});200===l.code&&(r=(Array.isArray(l.data)?l.data:(0,ca.get)(l.data,a)??[]).map(((e,t)=>{const a={...e,index:t,pageIndex:t};return P.forEach(((e,t)=>{const{dataIndex:r}=e;"index"!==r&&"pageIndex"!==r&&(0,ii.dN)(a,r,(0,ii.C_)(a,r))})),a})))}catch(e){}return T(!1),r},L=e=>{var t;const a=null==o||null===(t=o.table)||void 0===t?void 0:t.recordExportLog;try{null==a||a({fileName:e})}catch(e){}},q=(null==v?void 0:v.fileName)??`${i()().format(ti)}.xlsx`,D=q.slice(q.lastIndexOf(".")+1).toLowerCase(),$=()=>{if(_)return N.message.warning(d("qm.table.export.warnText"));I?(async e=>{T(!0);try{const{api:t,params:a}=v.fetch,r=await t({columns:P.map((e=>{const{title:t,dataIndex:a,hidden:r}=e,{type:l}=e.filter||{};return{title:t,dataIndex:a,type:l,hidden:r}})),...m,...a,tsortby:void 0,tsummary:void 0,tgroupby:void 0,[ci.currentPageName]:void 0,[ci.pageSizeName]:void 0});r.data&&(tt(r.data,e),L(e))}catch(e){}T(!1)})(q):S(!0)};t().useImperativeHandle(a,(()=>({clickHandle:$})));const M={[`${se("table")}-export`]:!0},K={visible:C,title:d("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>S(!1)},V={fileName:q.slice(0,q.lastIndexOf(".")),fileType:D,columns:R,useStyle:null!=v&&v.cellStyle?1:0};return t().createElement(t().Fragment,null,n&&t().createElement("span",{className:oe()(M),title:d("qm.table.export.textNoSpace"),onClick:()=>$()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.DownloadOutlined,null))),t().createElement(At,K,t().createElement(Vi,{defaultValue:V,onClose:()=>S(!1),onOk:e=>{(async e=>{const{fileName:t,fileType:a,exportType:r,startIndex:l=1,endIndex:n}=e,{allTableData:i,selectionRows:o}=s.current;let c=[];if(f?("all"===r&&(c=await F()),"custom"===r&&(c=await F(n),c=c.slice(l-1))):("all"===r&&(c=i.slice(0)),"custom"===r&&(c=i.slice(l-1,n||void 0))),"selected"===r&&(c=o.slice(0)),"xlsx"===a){const a=await k(e,c,O,A);tt(a,`${t}.xlsx`),L(`${t}.xlsx`)}if("csv"===a){const a=H(e,((e,t)=>{const{columns:a,footSummation:r}=e,l=(0,ii.vo)(a),n=(0,ii.HG)(a);let i='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${n.map((e=>{let{width:t,minWidth:a,renderWidth:r}=e;return`<col style="width:${t||r||a||ci.defaultColumnWidth}px">`})).join("")}</colgroup>`,E&&(i+=["<thead>",l.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:a}=e;return 0===a?null:`<th colspan="${a}" rowspan="${t}">${e.title}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(i+=`<tbody>${t.map((e=>`<tr>${n.map(((a,r)=>{const{rowSpan:l,colSpan:n}=y(e,a,e.index,r,t);return l&&n?`<td rowspan="${l}" colspan="${n}">${A(e,e.index,a,r)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),b&&r&&(i+=["<tfoot>",O(n,t).map((e=>`<tr>${n.map(((a,r)=>{const{dataIndex:l,summation:n}=a,i=null!=n&&n.render?n.render(t):(0,ii.C_)(e,l);return`<td>${0===r&&""===i?d("qm.table.config.summaryText"):(0,Y.l$)(i)?(0,ii.gn)(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i})(e,c));tt(a,`${t}.csv`),L(`${t}.csv`)}})(Object.assign({},e,{columns:(0,ii.J1)(e.columns)}))}})))}));Ui.displayName="TableExport";const ji=Ui,zi=e=>{const{columns:a,onClose:r}=e,{tableRef:l,tableBodyRef:n,tableProps:i,dataChange:o}=t().useContext(Wn),{beforeClipboard:s}=i,c=t().useRef(null),[u,p]=t().useState([{type:"INPUT_NUMBER",label:d("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:d("qm.table.clipboard.colIndex"),fieldName:"dataIndex",options:{itemList:a.map(((e,t)=>({value:t,text:e.title})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:d("qm.table.clipboard.content"),fieldName:"content",placeholder:d("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[h,m]=t().useState(!1),f=se("table");return t().createElement("div",{className:`${f}-clipboard__setting`},t().createElement("h3",{className:"info"},d("qm.table.clipboard.supportText")),t().createElement(Zl,{ref:c,initialValues:{},initialExtras:{rowIndex:"行",dataIndex:"列"},items:u,cols:1,labelWidth:100}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>r(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(J,{type:"primary",loading:h,onClick:()=>(async()=>{var e;const[t,i]=await c.current.GET_FORM_DATA();if(t)return;const{tableFullData:u,store:p}=l.current;m(!0);const h=i.content.trim().replace(/(\r|\n)$/,"");let f=h.replace(/"[^"]+"/g,"^");((null===(e=h.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{f=f.replace(/\^/,e)}));let g=f.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof s)try{g=await s(g,g[0].map(((e,t)=>a[i.dataIndex+t].dataIndex)))}catch(t){}g.forEach(((e,t)=>{e.forEach(((e,r)=>{const n=u[i.rowIndex-1+t],o=a[i.dataIndex+r];if(n&&o){let t=!1;if(o.editRender){var s,c;const e=o.editRender(n,o);t=!(e.disabled||(null===(s=e.extra)||void 0===s?void 0:s.disabled)||null!==(c=l.current.fieldAuth[o.dataIndex])&&void 0!==c&&c.disabled)}t&&o.dictItems&&(t=o.dictItems.some((t=>t.value==e))),t&&((0,ii.dN)(n,o.dataIndex,e),p.addToUpdated(n))}}))})),n.current.forceUpdate(),o(),N.message.success(d("qm.table.clipboard.success",{total:g.length})),m(!1),r()})()},d("qm.table.clipboard.text"))))},Bi=t().forwardRef(((e,a)=>{const{flattenColumns:r,open:l=!0}=e,[n,i]=t().useState(!1),o=t().useMemo((()=>(e=>e.filter((e=>![ci.expandableColumn,ci.selectionColumn,"index","pageIndex",ci.operationColumn].includes(e.dataIndex))))(r)),[r]),s=()=>{i(!0)};t().useImperativeHandle(a,(()=>({clickHandle:s})));const c={[`${se("table")}-clipboard`]:!0},u={visible:n,title:d("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return t().createElement(t().Fragment,null,l&&t().createElement("span",{className:oe()(c),title:d("qm.table.clipboard.textNoSpace"),onClick:()=>s()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.CopyOutlined,null))),t().createElement(At,u,t().createElement(zi,{columns:o,onClose:()=>i(!1)})))}));Bi.displayName="TableClipboard";const Wi=Bi,Gi=e=>{const{columns:a,onClose:r}=e,{tableProps:l,tableRef:n,$size:i,selectionKeys:o,setSelectionKeys:s}=t().useContext(Wn),{rowKey:c}=l,u=e=>e.map((e=>{const t={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:e.dictItems??[],render:e.render};return Array.isArray(e.children)&&(t.children=u(e.children)),t})),[p,h]=t().useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...u(a.filter((e=>![ci.expandableColumn,ci.selectionColumn,"index","pageIndex",ci.operationColumn].includes(e.dataIndex))))]),[m]=t().useState(n.current.selectionRows.map((e=>({...e,children:void 0}))));return t().createElement(t().Fragment,null,t().createElement(jo,{size:i,columns:p,dataSource:m,rowKey:c,minHeight:338,rowSelection:{type:"checkbox",selectedRowKeys:o,onChange:e=>s(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>h(e)}),t().createElement("div",{style:{height:10}}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>r()},d("qm.table.selectCollection.closeButton"))))},Yi=t().forwardRef(((e,a)=>{const{columns:r,open:l=!0}=e,{tableProps:n,getRowKey:i,isFetch:o,isTableEmpty:s,setSelectionKeys:c,setSelectionRows:u}=t().useContext(Wn),{rowSelection:p}=n,[h,m]=t().useState(!1),f=t().useRef(!1);Se((()=>{!f.current&&g()}),[s]);const g=async()=>{const{fetchSelectedRows:e,disabled:t=(e=>!1)}=p;if(o&&e)try{const a=await e.api(e.params);if(200===a.code){let r=Array.isArray(a.data)?a.data:(0,ca.get)(a.data,e.dataKey)??[];r=r.filter((e=>!t(e))),u(r),c(r.map(((e,t)=>i(e,t)))),f.current=!0}}catch(e){}},b=()=>{m(!0)};t().useImperativeHandle(a,(()=>({clickHandle:b})));const y=se("table"),v={visible:h,title:d("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>m(!1)};return t().createElement(t().Fragment,null,l&&t().createElement("span",{className:`${y}-select-collection`,title:d("qm.table.selectCollection.text"),onClick:()=>b()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.CheckSquareOutlined,null))),t().createElement(At,v,t().createElement(Gi,{columns:r,onClose:()=>m(!1)})))}));Yi.displayName="SelectCollection";const Zi=Yi,Xi=require("localforage");var Qi=__webpack_require__.n(Xi);const Ji=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/.test(e),eo=e=>{const{onClose:a}=e,{global:r}=t().useContext(l),{tableProps:n,tableRef:i,getRowKey:o,$size:s,flattenColumns:c,pagination:u,setPagination:p,scrollYToRecord:h,setHighlightKey:f,setShouldToTop:g,isTreeTable:b,isWebPagination:y}=t().useContext(Wn),{uniqueKey:v}=n,x=t().useRef(null),E=t().useRef(null),C=t().useRef([]),S=t().useRef(""),w=t().useRef(-1),T=t().useRef("stop");Se((()=>{const{current:e,pageSize:t}=u,a=i.current.tableFullData.slice((e-1)*t,e*t),r=(0,ii.tL)(a).findIndex((e=>o(e,e.index)===S.current));h("",r)}),[u.current]);const I=e=>{let t;switch(e){case"text":case"textarea":default:t="INPUT";break;case"number":t="INPUT_NUMBER";break;case"date":t="DATE";break;case"checkbox":case"radio":t="SELECT"}return t},_=e=>e.filter((e=>null==e?void 0:e.dataIndex)).map((e=>({type:I(e.filter.type),fieldName:e.dataIndex,label:e.title,tooltip:e.description,options:{dateType:"exactdate",itemList:e.dictItems??[]},onChange:async()=>{const[e,t]=await x.current.GET_FORM_DATA(),[a,r]=await E.current.GET_FORM_DATA(),l=(0,ca.omitBy)(Object.assign({},t,r),Y.xb);A(l)}}))),R={case:0,fullchar:0},P=t().useMemo((()=>c.filter((e=>![ci.expandableColumn,ci.selectionColumn,"index","pageIndex",ci.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[c]),[O,A]=t().useState({}),[k,H]=t().useState(R),[F]=t().useState(_([P[0]])),[L]=t().useState(_(P.slice(1))),[q,D]=t().useState(0),$=t().useMemo((()=>!Object.keys(O).length),[O]);Se((()=>{T.current="ready"}),[O,k]);const M=e=>{H(Object.assign({},k,e))},K=(e,t,a)=>new Promise(((r,l)=>{N.Modal.confirm({title:d("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),r()},onCancel:()=>{a(),r()}})})),V=async e=>{if(!Object.keys(O).length)return N.Modal.warning({title:d("qm.button.confirmPrompt"),content:d("qm.table.fastSearch.queryCondition")});if("ready"===T.current&&(T.current="stop",C.current=(e=>{const{allTableData:t}=i.current,a=[];for(let r=0,l=t.length;r<l;r++){const l=t[r];let n=!0;for(const t in e){const{type:a}=P.find((e=>e.dataIndex===t)).filter;let r=(0,ii.C_)(l,t),i=!0;if("text"===a||"textarea"===a?i=new RegExp(k.fullchar?`^${e[t]}$`:e[t],k.case?"":"i").test(r):(r=Ji(r)?r.slice(0,10):r,i=r==e[t]),!i){n=!1;break}}n&&a.push(l)}return a})(O),D(C.current.length)),!C.current.length)return f(""),N.Modal.warning({title:d("qm.button.confirmPrompt"),content:d("qm.table.fastSearch.notMatch")});"next"===e&&(w.current=w.current<0?0:w.current+1,w.current>C.current.length-1&&await K(d("qm.table.fastSearch.toTheEnd"),(()=>w.current=0),(()=>w.current=C.current.length-1))),"prev"===e&&(w.current=w.current<0?C.current.length-1:w.current-1,w.current<0&&await K(d("qm.table.fastSearch.toStart"),(()=>w.current=C.current.length-1),(()=>w.current=0)));const t=C.current[w.current],a=o(t,t.index);let r=t.index;if(b&&y){const e=(0,ii.Qi)(i.current.deriveRowKeys,a)[0];r=i.current.tableFullData.findIndex((t=>o(t,t.index)===e))}((e,t)=>{if(S.current=e,y){const{pageSize:e}=u,a=Math.ceil((t+1)/e);g(!1),p(Object.assign({},u,{current:a}))}else h(e)})(a,r),f(a)},U=()=>{x.current.RESET_FORM(),E.current.RESET_FORM()},j=t().useMemo((()=>v?`fastSearch_${v}`:""),[v]),[z,B]=t().useState([]),[W,Z]=t().useState(""),[X,Q]=t().useState("");Se((()=>{if(X){const{filters:e,config:t}=z.find((e=>e.value===X)).list;x.current.SET_FIELDS_VALUE(G()(e,L.map((e=>e.fieldName)))),E.current.SET_FIELDS_VALUE(G()(e,F.map((e=>e.fieldName)))),A(e),H(t)}else U(),A({}),H(R)}),[X]),t().useEffect((()=>{ee()}),[]);const ee=async()=>{if(!j)return;let e=await Qi().getItem(j);e||(e=await te(j),Array.isArray(e)&&await Qi().setItem(j,e)),Array.isArray(e)&&e.length&&(B(e),Q(e[0].value))},te=async e=>{const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}},ae=async(e,t)=>{const a=null==r?void 0:r.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}},re=se("table");return t().createElement("div",{className:`${re}-fast-search__setting`},t().createElement("div",{className:"main"},t().createElement("div",{className:"top"},t().createElement("div",{className:"container"},t().createElement(Ct,{defaultActiveKey:"1",size:"small",tabBarExtraContent:t().createElement("span",null,d("qm.table.alert.total",{total:q}))},t().createElement(Ct.TabPane,{tab:d("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},t().createElement(Zl,{ref:x,items:F,cols:1,labelWidth:110})),t().createElement(Ct.TabPane,{tab:d("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},t().createElement(Zl,{ref:E,items:L,cols:1,labelWidth:110})))),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(N.Input,{size:s,value:W,placeholder:d("qm.table.highSearch.configText"),disabled:$,onChange:e=>{const{value:t}=e.target;Z(t)}}),t().createElement(J,{type:"primary",disabled:!W||$,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!j)return m("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,ii.wE)(),t=[...z,{text:W,value:e,list:{filters:O,config:k}}];B(t),Q(e),Z(""),await Qi().setItem(j,t),await ae(j,t)})()},d("qm.table.highSearch.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${ci.rowHeightMaps[s]}px`}},t().createElement("span",null,d("qm.table.fastSearch.savedSetting"))),t().createElement("ul",null,z.map((e=>t().createElement("li",{key:e.value,className:oe()({selected:e.value===X}),title:e.text,onClick:()=>(e=>{Q(e!==X?e:"")})(e.value)},t().createElement("span",{className:"title"},e.text),t().createElement("i",{className:"svgicon close",title:d("qm.table.highSearch.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=z.filter((t=>t.value!==e));B(t),e===X&&Q(""),await Qi().setItem(j,t),await ae(j,t)})(e.value)}},t().createElement(ce.CloseCircleOutlined,null))))),!z.length&&t().createElement("div",{style:{padding:Yn}},t().createElement(Ze,null)))))),t().createElement("div",{className:"bottom"},t().createElement("div",null,t().createElement(N.Checkbox,{checked:!!k.case,onChange:e=>M({case:e.target.checked})},d("qm.table.fastSearch.matchCase")),t().createElement(N.Checkbox,{checked:!!k.fullchar,onChange:e=>M({fullchar:e.target.checked})},d("qm.table.fastSearch.matchFullchar"))),t().createElement("div",null,t().createElement(J,{onClick:()=>U()},d("qm.table.fastSearch.clear"))))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${Oa[s]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(J,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.fastSearch.closeButton")),t().createElement(J,{type:"primary",style:{marginRight:8},onClick:()=>V("prev")},d("qm.table.fastSearch.queryPrev")),t().createElement(J,{type:"primary",onClick:()=>V("next")},d("qm.table.fastSearch.queryNext"))))},to=t().forwardRef(((e,a)=>{const{open:r=!0}=e,{$size:l}=t().useContext(Wn),[n,i]=t().useState(!1),o=()=>{i(!0)};t().useImperativeHandle(a,(()=>({clickHandle:o})));const s=se("table"),c={visible:n,title:d("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${Oa[l]+20}px`},onClose:()=>i(!1)};return t().createElement(t().Fragment,null,r&&t().createElement("span",{className:`${s}-super-search`,title:d("qm.table.fastSearch.text"),onClick:()=>o()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.MonitorOutlined,null))),t().createElement(At,c,t().createElement(eo,{onClose:()=>i(!1)})))}));to.displayName="FastSearch";const ao=to,ro=e=>{const{columns:a,group:r,summary:l}=e,{tableRef:n,tableProps:o,$size:s,pagination:c,fetchParams:u,isFetch:p}=t().useContext(Wn),{fetch:h}=o,m=e=>{const t=a.find((t=>t.dataIndex===e));return{title:t.title,precision:t.precision,dictItems:t.dictItems??[]}},f=r.map((e=>({dataIndex:e.group,...m(e.group)}))),g=l.map((e=>e.summary===ci.groupSummary.total.value?{dataIndex:e.summary,title:ci.groupSummary.total.text,formula:e.formula}:{dataIndex:e.summary,...m(e.summary),formula:e.formula})),b=t().useMemo((()=>Object.assign({},u,{[ci.sorterFieldName]:void 0,[ci.groupSummary.summaryFieldName]:l.map((e=>`${e.formula}|${e.summary}`)).join(","),[ci.groupSummary.groupbyFieldName]:r.map((e=>e.group)).join(","),usedJH:2,[ci.currentPageName]:1})),[u,r,l]),[y,v]=t().useState(((e,t)=>[{title:d("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...t.map((e=>{var t;const r=null===(t=a.find((t=>t.dataIndex===e.dataIndex)))||void 0===t?void 0:t.groupSummary;let l=r?{summation:r}:null;return e.dataIndex===ci.groupSummary.total.value&&(l={dataIndex:ci.groupSummary.recordTotalIndex,summation:{render:()=>c.total}}),{...e,..."count"===e.formula||"sum"===e.formula?l:null}}))])(f,g)),[x]=t().useState(p?[]:(e=>{const t=(0,ii.v9)(e,r.map((e=>e.group))),a=[];return t.forEach((e=>{const t={};y.forEach((a=>{const{dataIndex:r}=a;"index"!==r&&(0,ii.dN)(t,r,(0,ii.C_)(e[0],r))})),l.forEach((a=>{const r=a.summary!==ci.groupSummary.total.value?a.summary:ci.groupSummary.recordTotalIndex,l=a.formula;"count"===l&&(0,ii.dN)(t,r,e.length),"sum"===l&&(0,ii.dN)(t,r,(0,ca.sumBy)(e,r)),"max"===l&&(0,ii.dN)(t,r,(0,ca.maxBy)(e,r)[r]),"min"===l&&(0,ii.dN)(t,r,(0,ca.minBy)(e,r)[r]),"avg"===l&&(0,ii.dN)(t,r,((0,ca.sumBy)(e,r)/e.length).toFixed(2))})),a.push(t)})),a})(n.current.tableFullData)),E={size:s,height:400,...p?{fetch:{api:h.api,params:b,dataKey:null==h?void 0:h.dataKey}}:{dataSource:x},columns:y,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${i()().format("YYYYMMDDHHmmss")}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>v(e)};return t().createElement(jo,E)},lo=e=>{const{onClose:a}=e,{global:r}=t().useContext(l),{tableProps:n,$size:i,flattenColumns:o}=t().useContext(Wn),{uniqueKey:s}=n,c=t().useRef(null),u=t().useRef(null),[p,h]=t().useState(!1),[f,g]=t().useState([]),[b,y]=t().useState(""),[v,x]=t().useState("");Se((()=>{if(v){const{group:e,summary:t}=f.find((e=>e.value===v)).list;_(e),A(t)}else{const e=L();_((null==e?void 0:e.group)||[]),A((null==e?void 0:e.summary)||[])}}),[v]),t().useEffect((()=>{q()}),[]);const E=t().useMemo((()=>s?`summary_${s}`:""),[s]),C=t().useMemo((()=>o.filter((e=>![ci.expandableColumn,ci.selectionColumn,"index","pageIndex",ci.operationColumn].includes(e.dataIndex)))),[o]),S=C.filter((e=>!e.groupSummary)).map((e=>({text:e.title,value:e.dataIndex}))),w=[ci.groupSummary.total,...C.filter((e=>!!e.groupSummary)).map((e=>({text:e.title,value:e.dataIndex})))],T=[{text:d("qm.table.groupSummary.sumText"),value:"sum"},{text:d("qm.table.groupSummary.maxText"),value:"max"},{text:d("qm.table.groupSummary.minText"),value:"min"},{text:d("qm.table.groupSummary.avgText"),value:"avg"},{text:d("qm.table.groupSummary.countText"),value:"count"}],[I,_]=t().useState([]),[R,P]=t().useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,a)=>t().createElement("div",null,t().createElement(J,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(a)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:d("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:S.map((e=>({...e,disabled:I.findIndex((t=>t.group===e.value))>-1})))})}]),[O,A]=t().useState([]),[k,H]=t().useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,a)=>t().createElement("div",null,t().createElement(J,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(a)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:d("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:w.map((e=>({...e,disabled:O.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:d("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===ci.groupSummary.total.value?T.slice(T.length-1):T})}]),F=t().useMemo((()=>{const e=I.length&&I.every((e=>Object.values(e).every((e=>""!==e)))),t=O.length&&O.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[I,O]),L=()=>{if(!E)return;const e=sessionStorage.getItem(E);return e?JSON.parse(e):null},q=async()=>{if(!E)return;const e=L();if(e){const{group:t,summary:a}=e;_(t),A(a)}let t=await Qi().getItem(E);t||(t=await D(E),Array.isArray(t)&&await Qi().setItem(E,t)),Array.isArray(t)&&t.length&&(g(t),!e&&x(t[0].value))},D=async e=>{const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}},$=async(e,t)=>{const a=null==r?void 0:r.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}},M=se("table"),K={visible:p,title:d("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>h(!1)};return t().createElement("div",{className:`${M}-group-summary__setting`},t().createElement("div",{className:"main"},t().createElement("div",{style:{width:"30%"}},t().createElement(jo,{ref:c,size:i,columns:R,dataSource:I,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onDataChange:e=>{_(e)}},t().createElement(J,{type:"primary",icon:t().createElement(ce.PlusOutlined,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t().createElement("div",{className:"container line"},t().createElement(jo,{ref:u,size:i,columns:k,dataSource:O,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>H(e),onDataChange:e=>{A(e)}},t().createElement(J,{type:"primary",icon:t().createElement(ce.PlusOutlined,null),onClick:()=>{u.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(N.Input,{size:i,value:b,placeholder:d("qm.table.groupSummary.configText"),disabled:F,onChange:e=>{const{value:t}=e.target;y(t)}}),t().createElement(J,{type:"primary",disabled:!b||F,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!E)return m("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,ii.wE)(),t=[...f,{text:b,value:e,list:{group:I.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))}}];g(t),x(e),y(""),await Qi().setItem(E,t),await $(E,t)})()},d("qm.table.groupSummary.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${ci.rowHeightMaps[i]}px`}},t().createElement("span",null,d("qm.table.groupSummary.savedSetting"))),t().createElement("ul",null,f.map((e=>t().createElement("li",{key:e.value,className:oe()({selected:e.value===v}),title:e.text,onClick:()=>(e=>{x(e!==v?e:"")})(e.value)},t().createElement("span",{className:"title"},e.text),t().createElement("i",{className:"svgicon close",title:d("qm.table.groupSummary.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=f.filter((t=>t.value!==e));g(t),e===v&&x(""),await Qi().setItem(E,t),await $(E,t)})(e.value)}},t().createElement(ce.CloseCircleOutlined,null))))),!f.length&&t().createElement("div",{style:{padding:Yn}},t().createElement(Ze,null)))))),t().createElement(At,K,t().createElement(ro,{columns:C,group:I,summary:O})),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.groupSummary.closeButton")),t().createElement(J,{type:"primary",disabled:F,onClick:()=>(E&&sessionStorage.setItem(E,JSON.stringify({group:I.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))})),void h(!0))},d("qm.table.groupSummary.confirmButton"))))},no=t().forwardRef(((e,a)=>{const{open:r=!0}=e,[l,n]=t().useState(!1),i=()=>{n(!0)};t().useImperativeHandle(a,(()=>({clickHandle:i})));const o=se("table"),s={visible:l,title:d("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>n(!1)};return t().createElement(t().Fragment,null,r&&t().createElement("span",{className:`${o}-group-summary`,title:d("qm.table.groupSummary.text"),onClick:()=>i()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.PieChartOutlined,null))),t().createElement(At,s,t().createElement(lo,{onClose:()=>n(!1)})))}));no.displayName="GroupSummary";const io=no;var oo=__webpack_require__(762);const so=e=>{const{onClose:a}=e,{global:r}=t().useContext(l),{tableProps:n,$size:i,flattenColumns:o,setSuperFilters:s,clearTableFilter:c}=t().useContext(Wn),{uniqueKey:u}=n,p=t().useRef(null),[h,f]=t().useState([]),[g,b]=t().useState([]),[y,v]=t().useState(""),[x,E]=t().useState("");Se((()=>{f(x?g.find((e=>e.value===x)).list:L()||[])}),[x]),t().useEffect((()=>{q()}),[]);const C=t().useMemo((()=>u?`superSearch_${u}`:""),[u]),S=t().useMemo((()=>o.filter((e=>!!e.filter))),[o]),w=(0,ii.TQ)(h),T=t().useMemo((()=>!(w&&(0,oo.$P)(w))),[w]),I=t().useMemo((()=>!!h.length&&T),[h,T]),_=[{value:"and",text:d("qm.table.highSearch.andText")},{value:"or",text:d("qm.table.highSearch.orText")}],R=o.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:e.title}))),P=e=>["in","nin"].includes(e),O=(e,t)=>{let a;switch(e){case"number":a="number";break;case"date":a="date";break;case"checkbox":case"radio":a=t?"select-multiple":"select";break;default:a="text"}return a},A=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:d("qm.table.highSearch.gtText")},{value:"<",text:d("qm.table.highSearch.ltText")},{value:">=",text:d("qm.table.highSearch.gteText")},{value:"<=",text:d("qm.table.highSearch.lteText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":t=[{value:"in",text:d("qm.table.highSearch.inText")},{value:"nin",text:d("qm.table.highSearch.ninText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:d("qm.table.highSearch.likeText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}]}return t},[k,H]=t().useState([{title:d("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,a)=>t().createElement("div",null,t().createElement(J,{type:"text",onClick:()=>{p.current.REMOVE_RECORDS(a)}},d("qm.table.highSearch.removeText")))},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,a)=>t().createElement("span",{style:{fontSize:"20px"}},e)},{title:d("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,editRender:e=>({type:"select",editable:!0,items:R,rules:[{required:!0,message:d("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var a,r;const l=Object.values(t)[0],n=null===(a=S.find((e=>e.dataIndex===l)))||void 0===a?void 0:a.filter.type,i=A(n);e.fieldType=n,e.expression=l?null===(r=i[0])||void 0===r?void 0:r.value:"",e.condition=P(e.expression)?[]:"",l||(e.bracketLeft=e.bracketRight="")}})},{title:d("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:d("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const a=null===(t=S.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:A(a),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=P(e.expression)?[]:""}}}},{title:d("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t;const a=S.find((t=>t.dataIndex===e.fieldName)),r=null==a?void 0:a.filter.type,l=(null==a||null===(t=a.filter)||void 0===t?void 0:t.items)??(null==a?void 0:a.dictItems)??[];return{type:O(r,P(e.expression)),editable:!0,items:l,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,a)=>t().createElement("span",{style:{fontSize:"20px"}},e)},{title:d("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,editRender:e=>({type:"select",editable:!0,items:_,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),F=()=>{C&&sessionStorage.setItem(C,JSON.stringify(h.filter((e=>!!e.fieldName))))},L=()=>{if(!C)return;const e=sessionStorage.getItem(C);return e?JSON.parse(e):null},q=async()=>{if(!C)return;const e=L();e&&f(e);let t=await Qi().getItem(C);t||(t=await D(C),Array.isArray(t)&&await Qi().setItem(C,t)),Array.isArray(t)&&t.length&&(b(t),!e&&E(t[0].value))},D=async e=>{const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}},$=async(e,t)=>{const a=null==r?void 0:r.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}},M=se("table");return t().createElement("div",{className:`${M}-super-search__setting`},t().createElement("div",{className:"main"},t().createElement("div",{className:"container"},t().createElement(jo,{ref:p,size:i,columns:k,dataSource:h,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>H(e),onRowClick:(e,t)=>{const{dataIndex:a}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(a)&&("bracketLeft"===a&&(e[a]=e[a]?"":"("),"bracketRight"===a&&(e[a]=e[a]?"":")"),f([...h]))},onDataChange:e=>{f(e)}},t().createElement(J,{type:"primary",icon:t().createElement(ce.PlusOutlined,null),onClick:()=>{p.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),ci.highSearch.showSQL&&w&&t().createElement("code",{className:"lang-js"},w)),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(N.Input,{size:i,value:y,placeholder:d("qm.table.highSearch.configText"),disabled:T,onChange:e=>{const{value:t}=e.target;v(t)}}),t().createElement(J,{type:"primary",disabled:!y||T,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!C)return m("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,ii.wE)(),t=[...g,{text:y,value:e,list:h.filter((e=>!!e.fieldName))}];b(t),E(e),v(""),await Qi().setItem(C,t),await $(C,t)})()},d("qm.table.highSearch.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${ci.rowHeightMaps[i]}px`}},t().createElement("span",null,d("qm.table.highSearch.savedSetting"))),t().createElement("ul",null,g.map((e=>t().createElement("li",{key:e.value,className:oe()({selected:e.value===x}),title:e.text,onClick:()=>(e=>{E(e!==x?e:"")})(e.value)},t().createElement("span",{className:"title"},e.text),t().createElement("i",{className:"svgicon close",title:d("qm.table.highSearch.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=g.filter((t=>t.value!==e));b(t),e===x&&E(""),await Qi().setItem(C,t),await $(C,t)})(e.value)}},t().createElement(ce.CloseCircleOutlined,null))))),!g.length&&t().createElement("div",{style:{padding:Yn}},t().createElement(Ze,null)))))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.highSearch.closeButton")),t().createElement(J,{type:"primary",disabled:I,onClick:()=>(c(),s(h.map((e=>G()(e,["index","pageIndex"])))),F(),void a())},d("qm.table.highSearch.searchButton"))))},co=t().forwardRef(((e,a)=>{const{open:r=!0}=e,[l,n]=t().useState(!1),i=()=>{n(!0)};t().useImperativeHandle(a,(()=>({clickHandle:i})));const o=se("table"),s={visible:l,title:d("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>n(!1)};return t().createElement(t().Fragment,null,r&&t().createElement("span",{className:`${o}-super-search`,title:d("qm.table.highSearch.text"),onClick:()=>i()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.FunnelPlotOutlined,null))),t().createElement(At,s,t().createElement(so,{onClose:()=>n(!1)})))}));co.displayName="SuperSearch";const uo=co,po=t().forwardRef(((e,a)=>{const{tableColumns:r,showFullScreen:n,showReload:i,showPrint:o,showImport:s,showExport:c,showClipboard:u,showCollection:p,showFastSearch:h,showSuperSearch:f,showGroupSummary:g,showToolBox:b}=e,{global:y}=t().useContext(l),{tableProps:v,flattenColumns:x,isFullScreen:E,$size:C}=t().useContext(Wn),{uniqueKey:S,exportExcel:w}=v,T=t().useRef(null),I=t().useRef(null),_=t().useRef(null),R=t().useRef(null),P=t().useRef(null),O=t().useRef(null),A=t().useRef(null),k=t().useRef(null),H=t().useRef(null),F=t().useRef(null),L=t().useMemo((()=>S?`toolBox_${S}`:""),[S]),[q,D]=t().useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,groupSummary:!1}),$={fullScreen:n,reload:i,print:o,import:s,export:c&&!(null!=w&&w.hideIcon),clipboard:u,collection:p,fastSearch:h,superSearch:f,groupSummary:g},[M,K]=t().useState(!1);Se((()=>{U()}),[q]),t().useEffect((()=>{V()}),[]),t().useImperativeHandle(a,(()=>({exportHandle:()=>{if(!P.current)return m("Table","执行导出需要配置 `exportExcel` 参数");P.current.clickHandle()}})));const V=()=>{if(!L||!b)return;const e=JSON.parse(localStorage.getItem(L));e||j(L).then((e=>{e&&(D(Object.assign({},q,e)),localStorage.setItem(L,JSON.stringify(e)))})).catch((()=>{})),e&&D(Object.assign({},q,e))},U=()=>{if(!L||!b)return;const e={};for(const t in q)q[t]&&(e[t]=q[t]);localStorage.setItem(L,JSON.stringify(e)),z(L,e)},j=async e=>{const t=null==y?void 0:y.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}},z=async(e,t)=>{const a=null==y?void 0:y.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}},B=async e=>{K(!1),await(0,Y._v)(100),e.current.clickHandle()},W=(e,t)=>{D(Object.assign({},q,{[t]:e}))},G=se("table"),Z={"top-toolbox__popper":!0,[`${G}--lg`]:"large"===C,[`${G}--sm`]:"small"===C};return t().createElement(t().Fragment,null,n&&t().createElement(Ei,{ref:T,isFullScreen:E,open:!b||q.fullScreen}),i&&t().createElement(Si,{ref:I,open:!b||q.reload}),o&&t().createElement(Ti,{ref:_,tableColumns:r,open:!b||q.print}),s&&t().createElement(Mi,{ref:R,tableColumns:r,open:!b||q.import}),c&&t().createElement(ji,{ref:P,tableColumns:r,open:(!b||q.export)&&!(null!=w&&w.hideIcon)}),u&&t().createElement(Wi,{ref:O,flattenColumns:x,open:!b||q.clipboard}),p&&t().createElement(Zi,{ref:A,columns:r,open:!b||q.collection}),h&&t().createElement(ao,{ref:k,open:!b||q.fastSearch}),g&&t().createElement(io,{ref:H,open:!b||q.groupSummary}),f&&t().createElement(uo,{ref:F,open:!b||q.superSearch}),b&&t().createElement(N.Dropdown,{overlay:(()=>{const e=[{key:"fullScreen",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.fullScreen,style:{marginRight:6},onChange:e=>W(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.screen.full"))),onClick:()=>B(T)},{key:"reload",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.reload,style:{marginRight:6},onChange:e=>W(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.refresh.text"))),onClick:()=>B(I)},{key:"print",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.print,style:{marginRight:6},onChange:e=>W(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.print.text"))),onClick:()=>B(_)},{key:"import",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.import,style:{marginRight:6},onChange:e=>W(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.import.textNoSpace"))),onClick:()=>B(R)},{key:"export",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.export,style:{marginRight:6},onChange:e=>W(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.export.textNoSpace"))),onClick:()=>B(P)},{key:"clipboard",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.clipboard,style:{marginRight:6},onChange:e=>W(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.clipboard.textNoSpace"))),onClick:()=>B(O)},{key:"collection",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.collection,style:{marginRight:6},onChange:e=>W(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.selectCollection.text"))),onClick:()=>B(A)},{key:"fastSearch",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.fastSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.fastSearch.text"))),onClick:()=>B(k)},{key:"groupSummary",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.groupSummary,style:{marginRight:6},onChange:e=>W(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.groupSummary.text"))),onClick:()=>B(H)},{key:"superSearch",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.superSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.highSearch.text"))),onClick:()=>B(F)}];return t().createElement(N.Menu,{items:e.filter((e=>$[e.key]))})})(),trigger:["click"],placement:"bottomRight",overlayClassName:oe()(Z),overlayStyle:{minWidth:120},visible:M,onVisibleChange:e=>{K(e)}},t().createElement("span",{className:`${G}-toolbox`,title:d("qm.table.toolbox.text")},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.AppstoreAddOutlined,null)))))}));po.displayName="ToolBox";const ho=po,mo=e=>{const{columns:a}=e,{global:r}=t().useContext(l),{tableProps:n,tableRef:i,$size:o}=t().useContext(Wn),{uniqueKey:s,onlyShowIcon:c,columnsChange:u}=n,p=t().useRef([]),h=e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)),m=e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)),f=e=>e.filter((e=>!e.noAuth&&!e.fixed)),[g,b]=t().useState(!1),[y,v]=t().useState(h(a)),[x,E]=t().useState(m(a)),[C,S]=t().useState(f(a)),w=t().useMemo((()=>s?`table_${s}`:""),[s]),T=t().useMemo((()=>[...y,...C,...x]),[y,C,x]);Se((()=>{P(a),R(a),I(a)}),[a]),t().useEffect((()=>{_()}),[]);const I=e=>{if(!w)return;const t=e.map((e=>{const t={};return void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),{dataIndex:e.dataIndex,...t}})),a=JSON.parse(localStorage.getItem(w));(0,ca.isEqual)(t,a)||(localStorage.setItem(w,JSON.stringify(t)),(async(e,t)=>{const a=null==r?void 0:r.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}})(w,t))},_=()=>{const e=(()=>{if(!w)return;const e=JSON.parse(localStorage.getItem(w));return e||(async e=>{const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}})(w).then((e=>{if(!e)return I(a);localStorage.setItem(w,JSON.stringify(e)),_()})).catch((()=>{})),e?(0,ca.xor)(e.map((e=>e.dataIndex)),a.map((e=>e.dataIndex))).length>0?a.map((t=>{const{dataIndex:a}=t,r=e.find((e=>e.dataIndex===a));return r?(void 0!==r.hidden&&(t.hidden=r.hidden),void 0!==r.fixed&&(t.fixed=r.fixed),void 0!==r.width&&(t.width=r.width),void 0!==r.renderWidth&&(t.renderWidth=r.renderWidth),t):t})):e.map((e=>{const t=a.find((t=>t.dataIndex===e.dataIndex));return void 0===e.fixed&&delete t.fixed,{...t,...e}})):void 0})();e&&(R(e),null==u||u(e))},R=e=>{const t=h(e),a=m(e),r=f(e);return v(t),E(a),S(r),[...t,...r,...a]},P=e=>{const t=[];e.filter((e=>!e.noAuth)).forEach(((a,r)=>{const l=a.colSpan;l>1&&e.slice(r+1,r+l).every((e=>{let{colSpan:t}=e;return 0===t}))&&t.push(e.slice(r,r+l))})),p.current=t},O=()=>{const e=[];T.forEach((t=>{const{colSpan:a,dataIndex:r}=t;if(0===a)return;if(1===a)return e.push(t);const l=p.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(r)));if(-1===l)return e.push(t);e.push(...p.current[l].map(((e,a)=>{let{dataIndex:r}=e;const l=T.find((e=>e.dataIndex===r));return a>0&&(void 0!==t.hidden&&(l.hidden=t.hidden),void 0!==t.fixed?l.fixed=t.fixed:l.fixed&&delete l.fixed),l})))})),a.forEach(((t,a)=>{t.noAuth&&e.findIndex((e=>e.dataIndex===t.dataIndex))<0&&e.splice(a,0,t)})),null==u||u(e)},A=(e,t)=>{if(e.noFixed)return;t?e.fixed=t:delete e.fixed;const r=R(a);null==u||u(r)},k=(e,r)=>{const{colSpan:l,noFixed:n}=e;if(0===l)return t().createElement("li",{key:e.dataIndex,style:{display:"none"}});const i=["svgicon","handle",`${r}-handle`];return t().createElement("li",{key:e.dataIndex,className:"item"},t().createElement(N.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:r}=t.target;e.hidden=!r,R(a),O()}}),t().createElement("i",{className:oe()(i),title:d("qm.table.columnFilter.draggable")},t().createElement(ce.HolderOutlined,null)),t().createElement("span",{className:"text",title:e.title},e.title),"main"===r?t().createElement("span",{className:oe()("fixed",n?"disabled":"")},t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.fixedLeft"),onClick:()=>A(e,"left")},t().createElement(ce.StepBackwardOutlined,null)),t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.fixedRight"),onClick:()=>A(e,"right")},t().createElement(ce.StepForwardOutlined,null))):t().createElement("span",{className:oe()("fixed",n?"disabled":"")},t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.cancelFixed"),onClick:()=>A(e)},t().createElement(ce.CloseCircleOutlined,null))))},H=se("table"),F={[`${H}__popper`]:!0,"column-filter__popper":!0,[`${H}--lg`]:"large"===o,[`${H}--sm`]:"small"===o},L=[`${H}-column-filter`,{selected:g}];return t().createElement(Ua(),{action:["click"],popupVisible:g,popup:t().createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},t().createElement("div",{className:"reset"},t().createElement(J,{type:"text",size:"small",onClick:()=>{const e=(0,Y.I8)(i.current.originColumns);R(e),null==u||u(e)}},d("qm.table.columnFilter.reset"))),t().createElement("div",{className:"left"},t().createElement(da.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),a=y.map((e=>e.dataIndex));(0,ca.isEqual)(t,a)||v(e)},onEnd:()=>O()},y.map((e=>k(e,"left"))))),t().createElement("div",{className:"divider"}),t().createElement("div",{className:"main"},t().createElement(da.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:C,setList:e=>{const t=e.map((e=>e.dataIndex)),a=C.map((e=>e.dataIndex));(0,ca.isEqual)(t,a)||S(e)},onEnd:()=>O()},C.map((e=>k(e,"main"))))),t().createElement("div",{className:"divider"}),t().createElement("div",{className:"right"},t().createElement(da.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:x,setList:e=>{const t=e.map((e=>e.dataIndex)),a=x.map((e=>e.dataIndex));(0,ca.isEqual)(t,a)||E(e)},onEnd:()=>O()},x.map((e=>k(e,"right")))))),popupClassName:oe()(F),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{b(e)},builtinPlacements:ai,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t().createElement("span",{className:oe()(L),title:c?d("qm.table.columnFilter.text"):void 0},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.SettingOutlined,null)),!c&&t().createElement("span",null,d("qm.table.columnFilter.text"))))},fo=()=>t().createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t().createElement("path",{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}));function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},go.apply(this,arguments)}const bo=e=>{const{column:a,filters:r}=e,{$size:l,setFilters:n,clearSuperFilters:i}=t().useContext(Wn),o=t().useRef(null),s=t().useRef(null),c=t().useRef(null),[u,p]=t().useState(!1),[h,f]=t().useState({}),g=t().useMemo((()=>{const{dataIndex:e,filter:t}=a;return`${e}|${t.type}`}),[a]),b=t().useMemo((()=>{let e=!1;for(const t in r[g])if(!(0,Y.xb)(r[g][t])){e=!0;break}return e}),[g,r]);t().useEffect((()=>{u&&((0,Y.xb)(r[g])&&y(),setTimeout((()=>v()),50))}),[u]);const y=()=>{f({})},v=()=>{switch(a.filter.type){case"text":o.current.focus();break;case"number":s.current.focus();break;case"textarea":c.current.focus()}},x=e=>{e&&f(e),i(),n((e=>{for(const t in e){for(const a in e[t])(0,Y.xb)(e[t][a])&&delete e[t][a];Object.keys(e[t]).length||delete e[t]}return e})({...r,...h,...e})),p(!1)},E={text:e=>{var a;const{title:r}=e;return t().createElement(N.Input,{ref:o,size:l,placeholder:d("qm.table.filter.searchText",{text:r}),style:{width:"180px"},value:(null===(a=h[g])||void 0===a?void 0:a.like)??"",onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{like:t}})))},onKeyDown:e=>{13===e.keyCode&&x()}})},textarea:e=>{var a;const{title:r}=e;return t().createElement(N.Input.TextArea,{ref:c,size:l,placeholder:d("qm.table.filter.searchAreaText",{text:r}),style:{width:"220px"},value:(null===(a=h[g])||void 0===a?void 0:a.likes)??"",onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{likes:t}})))},onKeyDown:e=>{13===e.keyCode&&x()}})},number:e=>{const a=e=>{var t;return{value:(null===(t=h[g])||void 0===t?void 0:t[e])??"",size:l,onChange:t=>{f((a=>Object.assign({},a,{[g]:Object.assign({},a[g],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t().createElement("ul",null,t().createElement("li",null,t().createElement("span",null,"> "),t().createElement(N.InputNumber,go({ref:s},a(">"),{placeholder:d("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"< "),t().createElement(N.InputNumber,go({},a("<"),{placeholder:d("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"= "),t().createElement(N.InputNumber,go({},a("=="),{placeholder:d("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"!="),t().createElement(N.InputNumber,go({},a("!="),{placeholder:d("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const a=e=>{var t;return{value:(0,ii._3)(null===(t=h[g])||void 0===t?void 0:t[e],Qn),format:Qn,size:l,onChange:t=>{f((a=>Object.assign({},a,{[g]:Object.assign({},a[g],{[e]:(0,ii.p6)(t,Qn)})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t().createElement("ul",null,t().createElement("li",null,t().createElement("span",null,"> "),t().createElement(H,go({},a(">"),{placeholder:d("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"< "),t().createElement(H,go({},a("<"),{placeholder:d("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"= "),t().createElement(H,go({},a("=="),{placeholder:d("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"!="),t().createElement(H,go({},a("!="),{placeholder:d("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var a;const{filter:r,dictItems:l=[]}=e,n=r.items||l;return t().createElement("ul",null,t().createElement(N.Radio.Group,{style:{width:"100%"},value:null===(a=h[g])||void 0===a?void 0:a["=="],onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{"==":t}})))}},n.map((e=>t().createElement("li",{key:e.value},t().createElement(N.Radio,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var a;const{filter:r,dictItems:l=[]}=e,n=r.items||l;return t().createElement("ul",null,t().createElement(N.Checkbox.Group,{style:{width:"100%"},value:null===(a=h[g])||void 0===a?void 0:a.in,onChange:e=>{f((t=>Object.assign({},t,{[g]:{in:e}})))}},n.map((e=>t().createElement("li",{key:e.value},t().createElement(N.Checkbox,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{var a;const{filter:r,dictItems:l=[]}=e,n=r.items||l;return t().createElement("div",{style:{height:200,...r.style}},t().createElement(Bn,{multiple:!0,value:(null===(a=h[g])||void 0===a?void 0:a.in)||[],dataSource:n,onCheckChange:e=>{const t=e.map((e=>e.value));f((e=>Object.assign({},e,{[g]:{in:t}})))}}))}},C=se("table"),S={"head-filter__popper":!0,[`${C}--lg`]:"large"===l,[`${C}--sm`]:"small"===l},w=["cell--filter",{selected:u,actived:b}];return t().createElement(Ua(),{action:["click"],popupVisible:u,popup:(()=>{const e=a.filter.type,r=E[e];return r?t().createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},t().createElement("div",null,r(a)),t().createElement(N.Space,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},t().createElement(J,{size:l,onClick:()=>{x({[g]:{}})}},d("qm.table.filter.reset")),t().createElement(J,{type:"primary",size:l,onClick:()=>x()},d("qm.table.filter.search")))):(m("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:oe()(S),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{p(e)},builtinPlacements:ai,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t().createElement("div",{className:oe()(w),title:d("qm.table.filter.text"),onClick:e=>e.stopPropagation()},t().createElement("span",{className:"svgicon icon"},t().createElement(fo,null))))},yo=e=>{const{column:a}=e,{tableProps:r,tableRef:l,bordered:n}=t().useContext(Wn),{columns:i,resizable:o,columnsChange:s=Y.ZT}=r,c={resizable:!0,"is--line":o&&!n};return t().createElement("div",{className:oe()(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:r}=l.current,n=r.$resizableBar,o=t.offsetWidth/2,c=e.clientX,d=(0,ii.tj)(t,r.$table).left-r.$tableBody.parentNode.scrollLeft+o;r.$table.classList.add("c--resize"),n.style.left=`${d}px`,n.style.display="block";const u=a.width||a.renderWidth;let p=u;return document.onmousemove=function(e){if("number"!=typeof u)return;const t=e.clientX-c,r=u+t;r<(a.minWidth||ci.defaultColumnWidth)||(p=Math.floor(r),n.style.left=`${t+d}px`)},document.onmouseup=function(){r.$table.classList.remove("c--resize"),n.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(a.renderWidth=p,a.width=p,s([...i]))},!1}})},vo=e=>{const{selectionKeys:a}=e,{tableRef:r,tableProps:l,getRowKey:n,pagination:i,fetchParams:o,setSelectionKeys:s,setSpinning:c,isWebPagination:u}=t().useContext(Wn),{rowSelection:p}=l,{fetchAllRowKeys:h,onSelectAll:m}=p,f=t().useRef([]),g=t().useMemo((()=>p.selectAllOnCurrentPage??!1),[p]),b=t().useMemo((()=>(p.filterable??!0)&&!g),[p,g]),y=(()=>{const{allTableData:e,allRowKeys:t}=r.current,{disabled:l=(e=>!1)}=p;return g?(0,ca.union)((()=>{const{tableFullData:e}=r.current,{current:t,pageSize:a}=i;return u?e.slice((t-1)*a,t*a):e})().filter((e=>!l(e))).map((e=>n(e,e.index))),a):t.filter(((t,a)=>!l(e[a])))})(),v=a.length>0&&a.length<(h||g?i.total:r.current.allRowKeys.length),x=!!a.length&&a.length===(f.current.length||y.length),E=async()=>{const e=h;let t=[];c(!0);try{const a=await e.api(o);200===a.code&&(t=Array.isArray(a.data)?a.data:(0,Y.U2)(a.data,e.dataKey)??[],f.current=t)}catch(e){}return c(!1),t},C=async e=>{let t=[];t=h?e?await E():[]:e?y.slice(0):[],s(t),null==m||m(e,t)};return t().createElement("div",{className:"cell--selection"},t().createElement(N.Checkbox,{checked:x,indeterminate:v,disabled:!y.length,onChange:e=>C(e.target.checked)}),b&&t().createElement(N.Dropdown,{overlayClassName:"all-selection__popper",overlay:(()=>{const e=[{key:1,label:d("qm.table.selection.all"),onClick:()=>{C(!0)}},{key:2,label:d("qm.table.selection.invert"),onClick:()=>(async()=>{let e=[];e=h?(0,ca.xor)(a,await E()):(0,ca.xor)(a,y),s(e)})()},{key:3,label:d("qm.table.selection.clear"),onClick:()=>{C(!1)}}];return t().createElement(N.Menu,{items:e})})()},t().createElement(ce.DownOutlined,{className:"svgicon icon"})),g&&t().createElement(N.Tooltip,{placement:"top",title:d("qm.table.selection.currentPage")},t().createElement(ce.InfoCircleOutlined,{className:"info"})))},xo=e=>{const{style:a}=e,{tableProps:r,tableRef:l,isTreeTable:n,setRowExpandedKeys:i}=t().useContext(Wn),{expandable:o}=r,[s,c]=t().useState((null==o?void 0:o.defaultExpandAllRows)||!1);Se((()=>{const{allRowKeys:e,flattenRowKeys:t}=l.current;i(s?e.filter((e=>!(n&&t.includes(e)))):[])}),[s]);const d={[`${se("expand")}--icon`]:!0,expanded:s,collapsed:!s};return t().createElement("span",{className:oe()(d),title:"",onClick:e=>{e.stopPropagation(),c(!s)},style:a})},Eo=()=>t().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t().createElement("path",{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"})),Co=()=>t().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t().createElement("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})),So=e=>{const{tableColumns:a,flattenColumns:r,sorter:l,filters:n}=e,{getRowKey:i,tableProps:o,tableRef:s,layout:c,scrollY:u,superFilters:p,selectionKeys:h,rightFixedColumns:m,firstDataIndex:f,isFetch:g,isTreeTable:b,isGroupSubtotal:y,tableChange:v,setSorter:x,setElementStore:E,resetTableScroll:C,getStickyLeft:S,getStickyRight:w,createGroupData:T,createTableFullData:I}=t().useContext(Wn),{ellipsis:_,resizable:R,multipleSort:P,rowSelection:O,expandable:A}=o,[k,H]=ci.sortDirections,F=t().useRef(null),L=t().useMemo((()=>!g),[g]),q=t().useMemo((()=>!g),[g]),D=t().useMemo((()=>!(null!=A&&A.hideExpandAll)),[A]),$=t().useMemo((()=>g?!!(null!=O&&O.selectAllOnCurrentPage||null!=O&&O.fetchAllRowKeys):!(null!=O&&O.hideSelectAll)),[g,O]);Se((()=>{z(),v(),C()}),[l]),Se((()=>{G(),v(),C()}),[n]),Se((()=>{G(),v(),C()}),[p]),t().useEffect((()=>{M()}),[]);const M=()=>{E("$header",F.current)},K=e=>{const{dataIndex:a,type:r,sorter:n,title:i,description:o}=e;if(a===ci.selectionColumn&&"checkbox"===r){if("checkbox"===r)return t().createElement("div",{className:"cell"},$?t().createElement(vo,{selectionKeys:h}):d("qm.table.config.selectionText"));if("radio"===r)return t().createElement("div",{className:"cell"},i)}const s=[];return s.push(t().createElement("div",{key:0,className:"cell",title:i},b&&a===f&&D?t().createElement(xo,null):null,a===ci.expandableColumn&&D?t().createElement(xo,null):i)),o&&s.push(t().createElement(N.Tooltip,{key:1,placement:"top",title:o},t().createElement(ce.InfoCircleOutlined,{className:"tip"}))),n&&s.push(V(l[a])),s},V=e=>{const a=["svgicon cell--sorter__asc",{actived:e===k}],r=["svgicon cell--sorter__desc",{actived:e===H}];return t().createElement("div",{key:2,className:"cell--sorter",title:d("qm.table.sorter.text")},t().createElement("span",{className:oe()(a)},t().createElement(Eo,null)),t().createElement("span",{className:oe()(r)},t().createElement(Co,null)))},U=e=>t().createElement(bo,{column:e,filters:n}),j=(e,t)=>{const{sorter:a,dataIndex:r}=t;if(a){const e=l[r],t=e?e===H?null:H:k;P?(delete l[r],x(Object.assign({},l,{[r]:t}))):x(Object.assign({},{[r]:t}))}},z=()=>{L&&B()},B=e=>{const t=(0,ca.pickBy)(l,(e=>null!==e));for(const e in t){const a=r.find((t=>t.dataIndex===e));a?W(a,t[e]):delete t[e]}e||Object.keys(t).length||W({dataIndex:"index"},k)},W=(e,t)=>{const{tableFullData:a}=s.current,{dataIndex:r,sorter:l}=e,n=(e,a)=>{const l=(0,ii.C_)(e,r),n=(0,ii.C_)(a,r);return Number.isNaN(l-n)?t===k?l.toString().localeCompare(n.toString()):n.toString().localeCompare(l.toString()):t===k?l-n:n-l},i=y?T((0,ii.SX)(a).sort("function"==typeof l?l:n)):a.sort("function"==typeof l?l:n).slice(0);I(i)},G=()=>{q&&Y()},Y=()=>{const{tableOriginData:e}=s.current,t=p.length?(0,ii.TQ)(p):(0,ii.TQ)(n),a=""!==t?y?T((0,oo.ar)((0,ii.SX)(e),t,b)):(0,oo.ar)(e,t,b):e;I(a),B(!0)},Z=(0,ii.vo)(a),X=se("table"),{tableBodyWidth:Q}=c;return t().createElement("div",{ref:F,className:`${X}--header-wrapper`},t().createElement("table",{className:`${X}--header`,cellSpacing:"0",cellPadding:"0",style:{width:Q?`${Q}px`:""}},(()=>{const{gutterWidth:e}=c;return t().createElement("colgroup",null,r.map((e=>{const{dataIndex:a,width:r,renderWidth:l}=e;return t().createElement("col",{key:a,style:{width:`${r||l}px`,minWidth:`${r||l}px`}})})),u&&t().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t().createElement("thead",null,(e=>{const{isIE:a}=s.current,r=["gutter",{"cell-fix-right":!!m.length}],n=a?null:{right:m.length?0:""};return e.map(((e,a)=>t().createElement("tr",{key:a,className:"header--row"},e.map(((a,r)=>((e,a,r)=>{var n,i;const{isIE:o}=s.current,{gutterWidth:d}=c,{dataIndex:p,colSpan:h,rowSpan:m,fixed:f,align:g,theadAlign:b,theadClassName:y="",sorter:v,filter:x,required:E,headRender:C}=e;if(0===h)return null;const T=b||g,N=["header--column",{"col--ellipsis":e.ellipsis??_,"col--center":"center"===T,"col--right":"right"===T,"column--required":!!E,"column-has-sorter":v,"column-has-filter":x,"column--sort":!!l[p],"cell-fix-left":!o&&"left"===f,"cell-fix-right":!o&&"right"===f,"cell-fix-left-last":!(o||"left"!==f||null!==(n=r[a+1])&&void 0!==n&&n.fixed),"cell-fix-right-first":!(o||"right"!==f||null!==(i=r[a-1])&&void 0!==i&&i.fixed),[y]:!!y}],I=o?null:{left:"left"===f?`${S(p)}px`:"",right:"right"===f?`${w(p)+(u?d:0)}px`:""},P=R&&![ci.expandableColumn,ci.selectionColumn].includes(p);return t().createElement("th",{key:p,className:oe()(N),colSpan:h,rowSpan:m,style:{...I},onClick:t=>j(t,e)},t().createElement("div",{className:"cell--wrapper"},C?t().createElement("div",{className:"cell--text cell"},C(e,s.current.tableFullData)):t().createElement(t().Fragment,null,t().createElement("div",{className:"cell--text"},K(e)),x?U(e):null)),P&&t().createElement(yo,{column:e}))})(a,r,e))),u&&t().createElement("th",{className:oe()(r),style:{...n}}))))})(Z))))},wo=()=>{const{tableProps:e,tableRef:a,layout:r,flattenColumns:l,isDragMergeCell:n}=t().useContext(Wn),{mergeCells:i=[],onMergeChange:o}=e,[s,c]=t().useState(!1),u=t().useRef(null),p=t().useRef(null),h=t().useRef({x:0,y:0,disX:0,disY:0});Se((()=>{n||y()}),[n]);const m=()=>{y(),Oe(u.current,{display:"none"})},f=e=>{const t=[];for(let a=0;a<e.rowSpan;a++)for(let r=0;r<e.colSpan;r++)t.push([e.row+a,e.col+r]);return t},g=()=>{h.current={x:0,y:0,disX:0,disY:0},p.current&&!v(p.current)||(p.current=null,m()),c(!0),document.removeEventListener("mousemove",b)},b=e=>{const{pageX:t,pageY:a}=e,{x:l,y:n,disX:i,disY:o}=h.current;let s=i,c=o,d=t-l,p=a-n;return d<0&&(d=Math.abs(d),s=i-d,Oe(u.current,{left:`${s}px`})),p<0&&(p=Math.abs(p),c=o-p,Oe(u.current,{top:`${c+r.headerHeight}px`})),Oe(u.current,{width:`${d}px`,height:`${p}px`}),E(s,c,d,p),!1},y=()=>{const{elementStore:e}=a.current,t=e.$tableBody.querySelectorAll("tbody > tr");for(let e=0;e<t.length;e++){const a=t[e].children;for(let e=0;e<a.length;e++)a[e].classList.remove("selected")}},v=e=>1===e.rowSpan&&1===e.colSpan,x=e=>e.width||e.renderWidth||e.minWidth||ci.defaultColumnWidth,E=(0,Y.Ds)(((e,t,r,n)=>{const{allTableData:i,scrollYStore:o}=a.current;let s=-1,c=-1,d=-1,u=-1;for(let e=0;e<i.length;e++)t>o.rowHeight*e&&t<o.rowHeight*(e+1)&&(s=e),t+n>o.rowHeight*e&&t+n<o.rowHeight*(e+1)&&(c=e);let h=0;for(let t=0;t<l.length;t++)e>h&&e<h+x(l[t])&&(d=t),e+r>h&&e+r<h+x(l[t])&&(u=t),h+=x(l[t]);const m={row:s,col:d,rowSpan:c-s+1,colSpan:u-d+1};(0,ca.isEqual)(p,m)||(p.current=m,((e,t,r,l)=>{const{elementStore:n,scrollYStore:i}=a.current,o=n.$tableBody.querySelectorAll("tbody > tr");for(let a=0;a<o.length;a++){const n=o[a].children;for(let o=0;o<n.length;o++)if(n[o].classList.remove("selected"),(e!==t||r!==l)&&a+i.startIndex>=e&&a+i.startIndex<=t){const e=Number(n[o].getAttribute("colspan")),t=Number(n[o].getAttribute("data-index")),a=e>1?t+e-1:t;a>=r&&a<=l&&n[o].classList.add("selected")}}})(s,c,d,u))}),10);return{dragStart:e=>{const{pageX:t,pageY:l}=e,{elementStore:n}=a.current,{x:i,y:o}=(e=>{let t=0,a=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,a+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:a}})(n.$table),{scrollLeft:s,scrollTop:d}=n.$tableBody.parentNode;p.current=null,h.current={x:t,y:l,disX:t+s-i,disY:l+d-(o+r.headerHeight)},Oe(u.current,{width:0,height:0,left:t-i+"px",top:l-o+"px",display:"block"}),y(),c(!1),document.addEventListener("mousemove",b,{passive:!0}),document.addEventListener("mouseup",g,{passive:!0,once:!0})},renderDragPanel:()=>t().createElement("div",{ref:u,className:"merge-cell-bar",onMouseDown:e=>e.stopPropagation()},s&&t().createElement(t().Fragment,null,t().createElement(J,{size:"small",className:"btn cancel",onClick:()=>{if(p.current&&!v(p.current)){const e=f(p.current),t=i.findIndex((t=>{const a=f(t);return(0,ca.intersectionWith)(a,e,ca.isEqual).length===a.length}));-1!==t&&(null==o||o(i.filter(((e,a)=>a!==t))))}m()}},d("qm.table.mergeCell.cancel")),t().createElement(J,{size:"small",type:"primary",className:"btn confirm",onClick:()=>{if(p.current&&!v(p.current)){const e=f(p.current);let t=!1;for(let a=0;a<i.length;a++)(0,ca.intersectionWith)(f(i[a]),e,ca.isEqual).length&&(t=!0);t||null==o||o([...i,p.current])}m()}},d("qm.table.mergeCell.confirm")))),closeDragPanel:m}};const To=e=>{const{selectionKeys:a,column:r,record:l,rowKey:n}=e,{tableProps:i,tableRef:o,isTreeTable:s,getAllChildRowKeys:c}=t().useContext(Wn),{rowSelection:d}=i,u=t().useMemo((()=>r.type||""),[r.type]),p=e=>{const t=d.checkStrictly??!0;if(!s||t)return!1;const r=(0,ii.CD)(o.current.deriveRowKeys,e),l=c((null==r?void 0:r.children)??[]);return!(!Array.isArray(null==r?void 0:r.children)||(0,ii.bY)(a,(null==r?void 0:r.children.map((e=>e.rowKey)))||[]))&&l.some((e=>a.includes(e)))};return"radio"===u?(()=>{const e=d.disabled,r=null==e?void 0:e(l),i=!r&&a[0]===n;return t().createElement(N.Radio,{checked:i,disabled:r})})():(()=>{const e=d.disabled,r=null==e?void 0:e(l),i=!!a.includes(n);return t().createElement(N.Checkbox,{checked:i,indeterminate:p(n),disabled:r})})()},No=e=>{const{record:a,rowKey:r,style:l}=e,{tableProps:n,rowExpandedKeys:i,setRowExpandedKeys:o}=t().useContext(Wn),{expandable:s={}}=n,[c]=t().useState("function"==typeof s.rowExpandable&&!s.rowExpandable(a)),d=t().useMemo((()=>i.includes(r)),[i,r]);Se((()=>{var e;null===(e=s.onExpand)||void 0===e||e.call(s,d,a)}),[d]);const u={[`${se("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return t().createElement("span",{className:oe()(u),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?i.filter((e=>e!==r)):[...i,r];o(t)},style:l})},Io=t().forwardRef(((e,a)=>{const{size:r,defaultValue:l,value:n,min:i,max:o,prefix:s,suffix:c,placeholder:d,maxLength:u,precision:p,allowClear:h,readOnly:m,disabled:f,formatter:g=(e=>e.toString()),parser:b=(e=>e),onFocus:y}=e,v=e=>{let t=e.toString();return"."!==t.charAt(t.length-1)&&"-"!==t||(t=t.slice(0,-1)),t&&Number(t)>o&&(t=o.toString()),t&&Number(t)<i&&(t=i.toString()),p>=0&&""!==t&&(t=Number(t).toFixed(p)),t},x=void 0!==n,[E,C]=t().useState(l??""),S=g(x?n:E),w=b(S),T=t=>{var a;x?null===(a=e.onChange)||void 0===a||a.call(e,t):C(t)};return Se((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,w)}),[E]),t().createElement(N.Input,{ref:a,size:r,value:S,maxLength:u,prefix:s,suffix:c,placeholder:d,allowClear:h,readOnly:m,disabled:f,onChange:e=>{const t=b(e.target.value);let a=/^-?\d*(\.\d*)?$/.test(t)||""===t||"-"===t;0===p&&t.includes(".")&&(a=!1),i>=0&&t.startsWith("-")&&(a=!1),a&&T(t)},onFocus:y,onBlur:()=>{var t;const a=v(w);Number(a)!==Number(w)&&T(a),null===(t=e.onBlur)||void 0===t||t.call(e,a,w)},onKeyUp:t=>{var a;13===t.keyCode&&(null===(a=e.onEnter)||void 0===a||a.call(e,v(w),w))}})}));Io.displayName="InputNumber";const _o=Io,{Search:Ro}=N.Input,Po=e=>{var a,r,l,n;const{column:i,record:o,rowKey:s,columnKey:c,clicked:u,text:p}=e,{tableRef:h,tableBodyRef:f,$size:g,flattenColumns:b,doFieldValidate:y,dataChange:v}=t().useContext(Wn),x=t().useRef(null),E=t().useRef(null),C=t().useRef(null),S=t().useRef(null),w=t().useRef(null),T=t().useRef(!1),I=t().useRef([]),_=t().useRef({}),R=yi(),{store:P,fieldAuth:O}=h.current,A=(null===(a=i.editRender)||void 0===a?void 0:a.call(i,o,i))||{},[k,F]=t().useState(!1),[L,q]=t().useState(!1),[$,M]=t().useState(!1),[K,V]=t().useState(A.items||[]),U=(A.editable||(0,ca.isEqual)(u,[s,c]))&&!A.disabled&&!(null!==(r=O[c])&&void 0!==r&&r.disabled),j=`${s}|${c}`,z=2===u.length?`${u[0]}|${u[1]}`:"",B=![...P.state.required,...P.state.validate].some((e=>{let{x:t,y:a}=e;return t===s&&a===c})),W=(null===(l=P.state.required.find((e=>{let{x:t,y:a}=e;return t===s&&a===c})))||void 0===l?void 0:l.text)||"",G=(null===(n=P.state.validate.find((e=>{let{x:t,y:a}=e;return t===s&&a===c})))||void 0===n?void 0:n.text)||"",Z=P.state.edited.some((e=>{let{x:t,y:a}=e;return t===s&&a===c})),X=U||!B||k||$||L,Q=()=>{v()};t().useEffect((()=>{X&&z===j&&te()}),[u]);const J=(e,t)=>{F(e),null==t||t()},ee=e=>{I.current=e},te=()=>{var e,t,a,r;const{type:l}=A;switch(l){case"text":null===(e=E.current)||void 0===e||e.focus();break;case"number":null===(t=C.current)||void 0===t||t.select();break;case"search-helper":null===(a=S.current)||void 0===a||a.focus();break;case"tree-helper":null===(r=w.current)||void 0===r||r.focus()}},ae=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0}))},re=(e,t,a)=>{const{cornerSign:r=!0}=A.extra||{};P.addToUpdated(e),r&&P.addToEdited({x:t,y:a})},le=e=>""!==e?Number(e):"",ne={text:(e,a)=>{const{dataIndex:r}=a,{type:l,extra:n={},rules:i=[],onInput:o,onChange:u,onEnter:p,onBlur:h}=A,m=(0,ii.C_)(e,r),f=n.password?N.Input.Password:N.Input;return t().createElement(f,{ref:E,size:g,value:m,maxLength:n.maxLength,showCount:n.showCount,placeholder:n.placeholder||d("qm.table.editable.inputPlaceholder"),allowClear:n.allowClear,readOnly:n.readOnly,disabled:n.disabled,suffix:n.suffix,onChange:t=>{const a=t.target.value??"";(0,ii.dN)(e,r,a),y(i,a,s,c),R(),null==o||o({[j]:a}),T.current=!0},onFocus:()=>q(!0),onBlur:t=>{q(!1);const a=t.target.value??"";T.current&&(T.current=!1,re(e,s,c),null==u||u({[j]:a},e),null==h||h({[j]:a},e),Q())},onKeyUp:t=>{if(13===t.keyCode){const a=t.target.value??"";null==p||p({[j]:a},e)}}})},number:(e,a)=>{const{dataIndex:r,precision:l,formatType:n}=a,{type:i,extra:o={},rules:u=[],onInput:p,onChange:h,onEnter:m,onBlur:f}=A,b=(0,ii.C_)(e,r);let v,x;return"finance"===n&&(v=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},x=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===n&&(v=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new(hi())(e).times(100).toNumber()}`,x=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:(Number(e)/100).toString()),t().createElement(_o,{ref:C,size:g,value:b,min:o.min,max:o.max,precision:l,prefix:o.prefix,suffix:o.suffix??("percent"===n?"%":void 0),placeholder:o.placeholder||d("qm.table.editable.inputPlaceholder"),maxLength:o.maxLength,allowClear:o.allowClear,readOnly:o.readOnly,disabled:o.disabled,formatter:v,parser:x,onChange:t=>{(0,ii.dN)(e,r,t),y(u,t,s,c),R(),null==p||p({[j]:t}),T.current=!0},onFocus:()=>q(!0),onBlur:(t,a)=>{if(q(!1),!T.current)return;T.current=!1;let l=le(t);"percent"===n&&"."===a.charAt(a.length-1)&&(l=Number(t)/100),(0,ii.dN)(e,r,l),re(e,s,c),null==h||h({[j]:l},e),null==f||f({[j]:t},e),Q()},onEnter:(t,a)=>{let r=le(t);"percent"===n&&"."===a.charAt(a.length-1)&&(r=Number(t)/100),null==m||m({[j]:r},e)}})},select:(e,a,r)=>{const{dataIndex:l,dictItems:n=[]}=a,{type:i,extra:o={},rules:u=[],items:p,onChange:m,onEnter:f}=A,{elementStore:b}=h.current,v=p||n,x=(0,ii.C_)(e,l);let E=x;return t().createElement(N.Select,{mode:r?"multiple":void 0,size:g,dropdownClassName:"table-editable__popper",value:x||void 0,placeholder:o.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,listHeight:o.listHeight,maxTagCount:o.collapseTags?"responsive":void 0,maxTagTextLength:o.maxTagTextLength,disabled:o.disabled,style:{width:"100%"},showSearch:o.filterable??!0,filterOption:(e,t)=>{var a;const r=(null==t||null===(a=t.children)||void 0===a?void 0:a.toString())||"";return`${r}|${Xr.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{(0,ii.dN)(e,l,t),y(u,t,s,c),re(e,s,c),R(),null==m||m({[j]:t},e),Q()},onSelect:e=>{E=e},onInputKeyDown:t=>{13===t.keyCode&&(0,Y.Y3)((()=>null==f?void 0:f({[j]:E},e)))}},v.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>ne.select(e,t,!0),date:(e,a,r)=>{const{dataIndex:l}=a,{type:n,extra:i={},rules:o=[],onChange:u}=A,p=r?Jn:Qn,h=(0,ii.C_)(e,l);return t().createElement(H,{showTime:r,size:g,dropdownClassName:"table-editable__popper",value:(0,ii._3)(h,p)??void 0,format:p,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:a}=i;return t&&a?e.isBefore(t,"day")||e.isAfter(a,"day"):t?e.isBefore(t,"day"):!!a&&e.isAfter(a,"day")})(e),placeholder:d(r?"qm.table.editable.datetimePlaceholder":"qm.table.editable.datePlaceholder"),allowClear:i.allowClear,disabled:i.disabled,style:{width:"100%"},onChange:t=>{const a=(0,ii.p6)(t,p);(0,ii.dN)(e,l,a),y(o,a,s,c),re(e,s,c),R(),null==u||u({[j]:a},e),Q()}})},datetime:(e,t)=>ne.date(e,t,!0),time:(e,a)=>{const{dataIndex:r}=a,{type:l,extra:n={},rules:i=[],onChange:o}=A,u=(0,ii.C_)(e,r);return t().createElement(D,{size:g,dropdownClassName:"table-editable__popper",value:(0,ii._3)(u,ei)??void 0,format:ei,placeholder:d("qm.table.editable.datetimePlaceholder"),allowClear:n.allowClear,disabled:n.disabled,style:{width:"100%"},onChange:t=>{const a=(0,ii.p6)(t,ei);(0,ii.dN)(e,r,a),y(i,a,s,c),re(e,s,c),R(),null==o||o({[j]:a},e),Q()}})},checkbox:(e,a)=>{const{dataIndex:r}=a,{type:l,extra:n={},onChange:i}=A,{trueValue:o=Zn,falseValue:d=Xn,disabled:u}=n,p=(0,ii.C_)(e,r);return t().createElement(N.Checkbox,{checked:p===o,disabled:u,onChange:t=>{const a=t.target.checked?o:d;(0,ii.dN)(e,r,a),re(e,s,c),R(),null==i||i({[j]:a},e),Q()}})},switch:(e,a)=>{const{dataIndex:r}=a,{type:l,extra:n={},onChange:i}=A,{trueValue:o=Zn,falseValue:d=Xn,disabled:u}=n,p=(0,ii.C_)(e,r);return t().createElement(N.Switch,{checked:p===o,disabled:u,onChange:t=>{const a=t?o:d;(0,ii.dN)(e,r,a),re(e,s,c),R(),null==i||i({[j]:a},e),Q()}})},"search-helper":(e,a)=>{const{dataIndex:r,precision:l}=a,{type:n,extra:i={},rules:o=[],helper:u={},onInput:p,onChange:h,onEnter:v}=A,E=(0,ii.C_)(e,r),C=u.fieldAliasMap;C||m("Table","helper 需要配置 `fieldAliasMap` 选项");const w="function"==typeof C?C():C||{};Object.keys(w).includes(r)||m("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值");const N=e=>{const{filterAliasMap:t}=u,a=""!==e?e:void 0,l="function"==typeof t?t():t??[],n={[r]:a};return l.forEach((e=>n[e]=a)),n},I=e=>{_.current=N(e),F(!0)},P=(t,r)=>{const{beforeOpen:l}=u,n=(l??Y.XT)({[j]:E},e,a);null!=n&&n.then?n.then((()=>{I(t),null==r||r()})).catch((()=>{})):!1!==n&&(I(t),null==r||r())},O=e=>{const t={};for(const a in w){const l=w[a];a!==r&&(t[a]=(0,ii.jq)(e,l))}const a=w[r]?(0,ii.jq)(e,w[r]):"";L(a,t);const{closed:l}=u;J(!1,(()=>ae(x.current))),te(),null==l||l(e)},H=()=>{const{onlySelect:e=!0}=u;T.current&&L(e?"":E),T.current=!1,J(!1,(()=>ae(x.current)))},L=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;if((0,Y.Kn)(a)&&Object.keys(a).length){for(const t in a){const r=a[t],l=b.find((e=>e.dataIndex===t));if(l){var n;(0,ii.dN)(e,t,r,l.precision);const a=null===(n=l.editRender)||void 0===n?void 0:n.call(l,e,l);a&&Array.isArray(a.rules)&&y(a.rules,r,s,t)}else(0,ii.dN)(e,t,r)}f.current.forceUpdate()}(0,ii.dN)(e,r,t,l),y(o,t,s,c),re(e,s,c),null==h||h({[j]:t},e),Q(),_.current={},T.current=!1},q={visible:k,title:d("qm.searchHelper.text"),width:u.width??"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${Oa[g]+20}px`},onClose:()=>{H()}},D={...u,size:g,initialValue:(0,ca.merge)({},u.initialValue,_.current),onClose:e=>{e?O(e):H()}};return t().createElement(t().Fragment,null,t().createElement(Ro,{ref:S,value:E,placeholder:i.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,readOnly:i.readOnly,disabled:i.disabled,onBlur:e=>{var t;const{value:a}=e.target,{onlySelect:l=!0,table:n}=u;if(T.current&&!k)return a&&l&&null!=n&&null!==(t=n.fetch)&&void 0!==t&&t.api?(e=>{const{table:t,initialValue:a={}}=u,{beforeFetch:r=Y.XT}=t.fetch;return M(!0),new Promise((async(l,n)=>{const i=(0,ca.merge)({},t.fetch.params,{...a,...N(e)},{currentPage:1,pageSize:500});try{if(r(i)){const e=await t.fetch.api(i);200===e.code?l(Array.isArray(e.data)?e.data:(0,ca.get)(e.data,t.fetch.dataKey)??[]):n()}else n()}catch(e){n()}M(!1)}))})(a).then((e=>function(){let e=arguments.length>1?arguments[1]:void 0;const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter((t=>(0,ii.jq)(t,w[r]).toString().includes(e)));if(1===t.length)return O(t[0]);P(e)}(e,a))).catch((()=>L(""))):void L(a)},onChange:t=>{const{value:a}=t.target;(0,ii.dN)(e,r,a),null==p||p({[j]:a}),T.current=!0,R()},onKeyUp:t=>{if(13===t.keyCode){const a=t.target.value??"";null==v||v({[j]:a},e)}},onDoubleClick:e=>{const{value:t}=e.target;P(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?P(e):L(""))}}),t().createElement(At,q,t().createElement(Go,D)))},"search-helper-multiple":(e,a)=>{const{dataIndex:r}=a,{type:l,items:n=[],extra:i={},rules:o=[],helper:u={},onInput:p,onChange:h,onEnter:f}=A,b=(0,ii.C_)(e,r),v=u.fieldAliasMap;v||m("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof v?v():v||{};Object.keys(E).includes("valueKey")&&Object.keys(E).includes("textKey")||m("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`");const C=t=>{const{beforeOpen:r}=u,l=(r??Y.XT)({[j]:b},e,a);null!=l&&l.then?l.then((()=>{F(!0),null==t||t()})).catch((()=>{})):!1!==l&&(F(!0),null==t||t())},S=()=>{J(!1,(()=>ae(x.current)))},w=t=>{(0,ii.dN)(e,r,t),y(o,t,s,c),re(e,s,c),null==h||h({[j]:t},e,I.current),Q()},T={visible:k,title:d("qm.searchHelper.text"),width:u.width??"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${Oa[g]+20}px`},onClose:()=>{S()}},_={...u,size:g,multiple:!0,initialValue:(0,ca.merge)({},u.initialValue),defaultSelectedKeys:b,onClose:(e,t)=>{e?((e,t)=>{const{textKey:a,valueKey:r}=E;ee((0,ca.uniqBy)([...I.current.filter((e=>t.includes(e[r]))),...e],r));const l=I.current.map((e=>({text:e[a],value:e[r]}))),i=(0,ca.uniqBy)([...l,...n],"value").filter((e=>t.includes(e.value)));V(i),w(i.map((e=>e.value)));const{closed:o}=u;J(!1,(()=>ae(x.current))),null==o||o(I.current)})(e,t):S()}};return t().createElement(t().Fragment,null,t().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t().createElement("span",{className:"ant-input-wrapper ant-input-group"},t().createElement(N.Select,{mode:"multiple",open:!1,value:b,placeholder:i.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,maxTagCount:i.collapseTags?"responsive":void 0,maxTagTextLength:i.maxTagTextLength,disabled:i.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==f||f({[j]:b},e))},onDoubleClick:()=>{C()},onChange:e=>{const{valueKey:t}=E;ee(I.current.filter((a=>e.includes(a[t])))),w(e),R()}},K.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(N.Button,{className:"ant-input-search-button",disabled:i.disabled,icon:t().createElement(ce.SearchOutlined,null),onClick:()=>{C()}})))),t().createElement(At,T,t().createElement(Go,_)))},"tree-helper":(e,a)=>{const{dataIndex:r,precision:l}=a,{type:n,extra:i={},rules:o=[],helper:u={},onChange:p,onEnter:h}=A,v=(0,ii.C_)(e,r),E=u.fieldAliasMap;E||m("Table","helper 需要配置 `fieldAliasMap` 选项");const C="function"==typeof E?E():E||{};Object.keys(C).includes(r)||m("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值");const S=t=>{const{beforeOpen:r}=u,l=(r??Y.XT)({[j]:v},e,a);null!=l&&l.then?l.then((()=>{F(!0),null==t||t()})).catch((()=>{})):!1!==l&&(F(!0),null==t||t())},T=()=>{J(!1,(()=>ae(x.current)))},N=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;if((0,Y.Kn)(a)&&Object.keys(a).length){for(const t in a){const r=a[t],l=b.find((e=>e.dataIndex===t));if(l){var n;(0,ii.dN)(e,t,r,l.precision);const a=null===(n=l.editRender)||void 0===n?void 0:n.call(l,e,l);a&&Array.isArray(a.rules)&&y(a.rules,r,s,t)}else(0,ii.dN)(e,t,r)}f.current.forceUpdate()}(0,ii.dN)(e,r,t,l),y(o,t,s,c),re(e,s,c),null==p||p({[j]:t},e),Q()},I={visible:k,title:d("qm.searchHelper.text"),width:u.width??"30%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${Oa[g]+20}px`},onClose:()=>{T()}},_={...u,defaultSelectedKeys:[v],size:g,onClose:e=>{e?(e=>{const t={};for(const a in C){const l=C[a];a!==r&&(t[a]=(0,ii.jq)(e,l))}const a=C[r]?(0,ii.jq)(e,C[r]):"";N(a,t);const{closed:l}=u;J(!1,(()=>ae(x.current))),te(),null==l||l(e)})(e):T()}};return t().createElement(t().Fragment,null,t().createElement(Ro,{ref:w,value:v,allowClear:i.allowClear??!0,readOnly:i.readOnly,disabled:i.disabled,placeholder:i.placeholder||d("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target;t||R()},onKeyUp:t=>{if(13===t.keyCode){const a=t.target.value??"";null==h||h({[j]:a},e)}},onDoubleClick:()=>{S()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?S():N(""))}}),t().createElement(At,I,t().createElement(as,_)))},"tree-helper-multiple":(e,a)=>{const{dataIndex:r}=a,{type:l,extra:n={},items:i=[],rules:o=[],helper:u={},onInput:p,onChange:h,onEnter:f}=A,b=(0,ii.C_)(e,r),v=u.fieldAliasMap;v||m("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof v?v():v||{};Object.keys(E).includes("valueKey")&&Object.keys(E).includes("textKey")||m("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`");const C=t=>{const{beforeOpen:r}=u,l=(r??Y.XT)({[j]:b},e,a);null!=l&&l.then?l.then((()=>{F(!0),null==t||t()})).catch((()=>{})):!1!==l&&(F(!0),null==t||t())},S=()=>{J(!1,(()=>ae(x.current)))},w=t=>{(0,ii.dN)(e,r,t),y(o,t,s,c),re(e,s,c),null==h||h({[j]:t},e,I.current),Q()},T={visible:k,title:d("qm.searchHelper.text"),width:u.width??"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${Oa[g]+20}px`},onClose:()=>{S()}},_={...u,size:g,multiple:!0,initialValue:(0,ca.merge)({},u.initialValue),defaultSelectedKeys:b,onClose:e=>{e?(e=>{const{textKey:t,valueKey:a}=E;ee(e);const r=I.current.map((e=>({text:e[t],value:e[a]})));V(r),w(r.map((e=>e.value)));const{closed:l}=u;J(!1,(()=>ae(x.current))),null==l||l(I.current)})(e):S()}};return t().createElement(t().Fragment,null,t().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t().createElement("span",{className:"ant-input-wrapper ant-input-group"},t().createElement(N.Select,{mode:"multiple",open:!1,value:b,placeholder:n.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:n.allowClear,maxTagCount:n.collapseTags?"responsive":void 0,maxTagTextLength:n.maxTagTextLength,disabled:n.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==f||f({[j]:b},e))},onDoubleClick:()=>{C()},onChange:e=>{const{valueKey:t}=E;ee(I.current.filter((a=>e.includes(a[t])))),w(e),R()}},K.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(N.Button,{className:"ant-input-search-button",disabled:n.disabled,icon:t().createElement(ce.SearchOutlined,null),onClick:()=>{C()}})))),t().createElement(At,T,t().createElement(as,_)))}};return t().createElement(t().Fragment,null,X?(()=>{const{type:e}=A,a=ne[e];if(!a)return m("Table","单元格编辑的类型 `type` 配置不正确"),null;const r=["cell--edit",{"is-error":!B}];return t().createElement("div",{ref:x,className:oe()(r)},a(o,i),!B&&t().createElement("div",{className:"cell-error"},W||G))})():(()=>{const{extra:e={}}=A;return e.disabledColor?t().createElement("span",{style:{color:e.disabledColor}},p):t().createElement(t().Fragment,null,p)})(),Z&&t().createElement("i",{className:"cell--sign"}))},Oo=require("copy-to-clipboard");var Ao=__webpack_require__.n(Oo);const ko=e=>{const{text:a,options:r,showMessage:l=!0,onCopy:n}=e;return function(e){if(!t().isValidElement(e))return null;for(var a=arguments.length,r=new Array(a>1?a-1:0),l=1;l<a;l++)r[l-1]=arguments[l];return t().cloneElement(e,...r)}(e.children,{onClick:i=>{const o=t().Children.only(e.children),s=Ao()(a,r);null==n||n(a,s),s&&l&&N.message.success(d("qm.clipboard.success")),o&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(i)}})};ko.displayName="CopyToClipboard";const Ho=ko;function Fo(){return Fo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Fo.apply(this,arguments)}const Lo=t().forwardRef(((a,r)=>{const{tableData:l,flattenColumns:n}=a,{getRowKey:o,tableProps:s,tableRef:c,editableColumns:u,leftFixedColumns:p,rightFixedColumns:h,firstDataIndex:f,sorter:g,layout:b,showFooter:y,scrollX:v,scrollY:x,selectionKeys:E,rowExpandedKeys:C,highlightKey:S,isPingLeft:w,isPingRight:T,isTableEmpty:N,isTreeTable:I,isGroupSubtotal:_,isWebPagination:R,isDragMergeCell:P,setElementStore:O,createTableFullData:A,setSelectionKeys:k,setHighlightKey:H,getStickyLeft:F,getStickyRight:L,scrollXToColumn:q,scrollYToRecord:D,rowInViewport:$,dataChange:M,setPingLeft:K,setPingRight:V,setFullScreen:U,setOverlay:j,findParentRowKeys:z,getAllChildRowKeys:B,triggerScrollYEvent:W,scrollBottomDebouncer:G}=t().useContext(Wn),{height:Z,minHeight:X,maxHeight:Q,rowSelection:J,rowHighlight:ee,treeConfig:te,expandable:ae,stripe:re,summation:le,rowStyle:ne,cellStyle:ie,spanMethod:de,ellipsis:ue,showHeader:pe,rowDraggable:he,onRowClick:me,onRowDblclick:fe,onRowContextmenu:ge,onRowEnter:be}=s,ye=t().useRef(null),ve=t().useRef(null),xe=t().useRef({prevST:0,prevSL:0}),{dragStart:Ee,renderDragPanel:Ce,closeDragPanel:we}=wo(),Te={dateFormat:e=>{const t=e?i()(e).format(Qn):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?i()(e).format(Jn):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?i()(e).format(Jn.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>Number.isNaN(Number(e))?e:(100*Number(e)).toFixed(2)+"%",financeFormat:e=>(0,ii.uf)(e.toString()),secretNameFormat:e=>e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**"),secretPhoneFormat:e=>e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2"),secretIDnumberFormat:e=>e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2"),secretBankNumberFormat:e=>e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")},Re=t().useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:a,tableFullHeight:r,tableAutoHeight:l}=b,n={};return N&&Object.assign(n,{minHeight:"100px"}),X&&Object.assign(n,{minHeight:(0,ii.EJ)(X)-e-a+"px"}),Q&&Object.assign(n,{maxHeight:(0,ii.EJ)(Q)-e-a+"px"}),Z||r||l?{...n,maxHeight:"",minHeight:"",height:`${t}px`}:n}),[Z,Q,X,N,b]),Oe=t().useMemo((()=>{const{tableBodyWidth:e,gutterWidth:t}=b;return e&&x?e-t:e}),[b,x]),Ae=t().useMemo((()=>{const{scrollYStore:e}=c.current,{viewportHeight:t,gutterWidth:a}=b;return Math.floor((v?t-a:t)/e.rowHeight)}),[b,v]),[ke,He]=t().useState([]),Fe=yi(),Le=function(t,a){const[r,l]=e.useState(!1);return e.useEffect((()=>{let e;const r=t.current,n=t=>{e=t},i=t=>{((e,t)=>{const n=e.target,i=null==t?void 0:t.target,o=!n||!i,s=(null==r?void 0:r.contains(n))||(null==r?void 0:r.contains(i)),c=r===n,d=null==a?void 0:a.map((e=>document.querySelector(e))),u=(null==d?void 0:d.some((e=>null==e?void 0:e.contains(n))))||(null==d?void 0:d.includes(i));l(!(o||s||c||u))})(t,e)};return r&&(Ie(document,"mousedown",n),Ie(document,"mouseup",i)),()=>{r&&(_e(document,"mousedown",n),_e(document,"mouseup",i))}}),[t]),r}(ye,[".table-editable__popper"]);t().useImperativeHandle(r,(()=>({renderCellTitle:Ge,setClickedValues:Me,forceUpdate:Fe}))),Se((()=>{Le&&(Me([]),P&&we())}),[Le]),Se((()=>{ke.length&&ni.focus(c.current.uid)}),[ke]),t().useEffect((()=>{De(),$e()}),[]);const qe=t().useCallback((e=>{var t,a;const{keyCode:r}=e;if(c.current.uid===(null===(t=ni.getFocusInstance())||void 0===t?void 0:t.id)&&(27===r&&(Me([]),H(""),U(!1)),ke.length&&(((e,t)=>{if(Ne.Z||!e||!t)return!1;let a=e;for(;a;){if(a===t)return!0;a=a.parentNode}return!1})(document.activeElement,ye.current)||"INPUT"!==(null===(a=document.activeElement)||void 0===a?void 0:a.tagName)))){if(13===r&&(Pe(e),"radio"===(null==J?void 0:J.type)||ee)){const t=E[0]??S??null,a=l.find((e=>o(e,e.index)===t))??null;a&&(null==be||be(a,e))}if(38===r||40===r){var n,i;Pe(e);const{allTableData:t}=c.current,a=R?(0,ii.tL)(l):t,s=a.length;let d=a.findIndex((e=>o(e,e.index)===ke[0]));const u=38===r?(--d+s)%s:++d%s,p=a[u],h=o(p,p.index);"radio"!==(null==J?void 0:J.type)||null!==(n=J.disabled)&&void 0!==n&&n.call(J,p)||k([h]),!ee||null!==(i=ee.disabled)&&void 0!==i&&i.call(ee,p)||H(h),$(u)||(38===r&&D(h,u),40===r&&D(h,Ae>u+1?0:u+1-Ae)),Me([h,ke[1]])}if(9===r){if(Pe(e),!u.length)return Me([]);const t=u.length;let a=u.findIndex((e=>e.dataIndex===ke[1]));const r=++a%t,l=u[r].dataIndex;Me([ke[0],l]),q(l)}}}),[ke,l,E,u,Ae]);t().useEffect((()=>{const e=ot()(document,"keydown",qe);return()=>e.remove()}),[qe]);const De=()=>{O("$tableBody",ye.current),O("$tableYspace",ve.current)},$e=()=>{j("overlay"===((e,t)=>{if(Ne.Z||!e||!t)return null;"float"===(t=(0,Y._A)(t))&&(t="cssFloat");try{var a;const r=e.style[t];if(r)return r;const l=null===(a=document.defaultView)||void 0===a?void 0:a.getComputedStyle(e,"");return l?l[t]:""}catch(a){return e.style[t]}})(ye.current.parentNode,"overflowY"))},Me=e=>{(0,ca.isEqual)(e,ke)||He(e)},Ke=(e,t,a)=>a?[...t,e]:t.filter((t=>t!==e)),Ve=(e,t,a)=>{var r;const{deriveRowKeys:l}=c.current,n=(0,ii.CD)(l,e);let i=[];const o=B((null==n?void 0:n.children)||[]),s=(null===(r=(0,ii.Qi)(l,e))||void 0===r?void 0:r.slice(0,-1).reverse())||[];return i=a?[...new Set([...t,e,...o])]:t.filter((t=>![e,...o].includes(t))),s.forEach((e=>{var t;const a=(0,ii.CD)(l,e),r=(0,ii.bY)(i,(null==a||null===(t=a.children)||void 0===t?void 0:t.map((e=>e.rowKey)))||[]);i=r?[...i,e]:i.filter((t=>t!==e))})),i},Ue=e=>Array.isArray(e.children)&&e.children.length>0,je=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=[];return e.forEach((e=>{const l=e.index,i=o(e,e.index);if(r.push(ze(e,l,i,a)),null!=ae&&ae.expandedRowRender){const{expandedRowClassName:a,rowExpandable:o=Y.XT}=ae;C.includes(i)&&o(e)&&r.push(t().createElement("tr",{key:`expand_${i}`,className:"body--row-expanded"},t().createElement("td",{colSpan:n.length,className:"body--column",style:{paddingLeft:J?"100px":"50px"}},t().createElement("div",{className:oe()("cell",a)},ae.expandedRowRender(e,l)))))}if((null==te||!te.virtual)&&Ue(e)){const t="function"!=typeof(null==ae?void 0:ae.rowExpandable)||ae.rowExpandable(e);C.includes(i)&&t&&r.push(...je(e.children,a+1))}})),r},ze=function(e,a,r){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=["body--row",{"body--row-striped":re&&a%2!=0,"body--row-selected":E.includes(r),"body--row-current":S===r,..._?Je(e._group):null}];return t().createElement("tr",{key:r,className:oe()(i)},n.map(((t,n)=>Be(t,n,e,a,r,l))))},Be=(e,a,r,l,n,i)=>{const{isIE:s,isOverlay:d}=c.current,{dataIndex:u,fixed:m,align:f,className:y=""}=e,{rowSpan:v,colSpan:C}=Ze(r,e,l,a),{gutterWidth:S}=b;if(!v||!C)return null;const w=e.ellipsis??ue,T=!s&&"left"===m,N=!s&&"right"===m,R=["body--column",{"col--ellipsis":w,"col--center":"center"===f,"col--right":"right"===f,"column--sort":!!g[u],"cell-fix-left":T,"cell-fix-right":N,"cell-fix-left-last":T&&p[p.length-1].dataIndex===u,"cell-fix-right-first":N&&h[0].dataIndex===u,[y]:!!y}],P=s?null:{left:T?`${F(u)}px`:"",right:N?`${L(u)+(d&&x?S:0)}px`:""},O=ne?"function"==typeof ne?ne(r,l):ne:null,A=ie?"function"==typeof ie?ie(r,e,l,a):ie:null,q=_?Qe(r._group):null,D=Ge(e,r,l,a);return t().createElement("td",{key:u,title:w?D:void 0,rowSpan:v>1?v:void 0,colSpan:C>1?C:void 0,"data-index":a,className:oe()(R),style:{...P,...q,...O,...A},onClick:t=>((e,t,a)=>{var r,l;const{dataIndex:n}=a;if([ci.expandableColumn,ci.operationColumn].includes(n))return;const i=o(t,t.index);Me([i,n]);const s=null===(r=a.editRender)||void 0===r?void 0:r.call(a,t,a),c=s&&!s.disabled,{type:d,selectByClickRow:u=!0,disabled:p=Y.ZT}=J||{};!d||p(t)||c||(u||n===ci.selectionColumn)&&((e,t)=>{const{type:a,checkStrictly:r=!0,onSelect:l}=J||{};if("radio"===a&&k([e]),"checkbox"===a){const a=!E.includes(e),n=I&&!r?Ve(e,E,a):Ke(e,E,a);k(n),null==l||l(a,t,n)}})(i,t),[ci.selectionColumn].includes(n)||(!ee||null!==(l=ee.disabled)&&void 0!==l&&l.call(ee,t)||c||H(i),null==me||me(t,a,e))})(t,r,e),onDoubleClick:t=>((e,t,a)=>{const{dataIndex:r}=a;[ci.expandableColumn,ci.selectionColumn,ci.operationColumn].includes(r)||null==fe||fe(t,a,e)})(t,r,e),onContextMenu:t=>((e,t,a)=>{const{dataIndex:r}=a;[ci.expandableColumn,ci.selectionColumn,ci.operationColumn].includes(r)||null==ge||ge(t,a,e)})(t,r,e)},t().createElement("div",{className:"cell"},We(e,r,l,a,D,n,i)),N&&d&&x&&h[h.length-1].dataIndex===u?t().createElement("i",{className:"gutter-overlay",style:{width:S,right:-1*(S+1)}}):null)},We=(e,a,r,l,n,i,o)=>{const{dataIndex:s,canCopy:c,editRender:u,render:p}=e,h=(0,ii.C_)(a,s);if(s===ci.expandableColumn)return t().createElement(No,{record:a,rowKey:i});if(s===ci.selectionColumn)return t().createElement(To,{selectionKeys:E,column:e,record:a,rowKey:i});const m=Ye(h,e,a);if(u)return t().createElement(Po,{column:e,record:a,rowKey:i,columnKey:s,clicked:ke,text:m});const g=p?p(h,a,e,r,l):m;return I&&s===f?[Xe(null!=te&&te.virtual?a._level:o),t().createElement(No,{key:"expand",record:a,rowKey:i,style:Ue(a)?{}:{visibility:"hidden"}}),g]:c?t().createElement("div",{className:"cell--copy"},t().createElement("span",{className:"text"},g),n&&t().createElement(Ho,{text:n},t().createElement(ce.CopyOutlined,{className:"icon",title:d("qm.table.config.copyText"),onClick:e=>e.stopPropagation()}))):g},Ge=(e,t,a,r)=>{const{dataIndex:l,render:n}=e;if([ci.expandableColumn,ci.selectionColumn,ci.operationColumn].includes(l))return"";let i="";const o=(0,ii.C_)(t,l);if("function"==typeof n){const l=n(o,t,e,a,r);i=(0,Y.l$)(l)?(0,ii.gn)(l).join(""):l}else i=Ye(o,e,t).toString();return i},Ye=(e,t,a)=>{var r;const{dictItems:l,precision:n,formatType:i,editRender:o}=t,s=l||(null==o||null===(r=o(a,t))||void 0===r?void 0:r.items)||[],c=s.find((t=>t.value==e));let d=(null==c?void 0:c.text)??e??"";if(Array.isArray(e)&&(d=e.map((e=>{const t=s.find((t=>t.value==e));return(null==t?void 0:t.text)??e})).join(",")),n>=0&&""!==d&&(d=Number(d).toFixed(n)),"string"==typeof d&&(d=d.replace(/[\r\n]/g,"")),i){const e=Te[`${(0,Y._A)(i)}Format`];e?d=e(d):m("Table","字段的格式化类型 `formatType` 配置不正确")}return d},Ze=(e,t,a,r)=>{let n=1,i=1;if("function"==typeof de){const o=de({row:e,column:t,rowIndex:a,columnIndex:r,tableData:l});if(Array.isArray(o)?(n=o[0],i=o[1]):(0,Y.Kn)(o)&&(n=o.rowSpan,i=o.colSpan),e===l[0]&&0===n){n=1;for(let e=1;e<l.length;e++){const{rowSpan:a}=Ze(l[e],t,l[e].index,r);if(a>0)break;n++}}}const{mergeCells:o}=c.current;if(o.length>0){const e=o.find((e=>e.row===a&&e.col===r));e&&(n=e.rowSpan,i=e.colSpan)}return{rowSpan:n,colSpan:i}},Xe=e=>e?t().createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*ci.treeTable.textIndent+"px"}}):null,Qe=e=>{const{backgroundColor:t,color:a}=le.groupItems.find((t=>t.dataIndex===e))??{};return{backgroundColor:t,color:a}},Je=e=>{const t=le.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},et=se("table"),tt=P?{onMouseDown:Ee}:null;return t().createElement("div",{className:`${et}--body-wrapper`,style:{...Re},onScroll:e=>{const{elementStore:t,scrollYLoad:a}=c.current,{prevST:r,prevSL:l}=xe.current,n=x?b.gutterWidth:0,{scrollTop:i,scrollLeft:o}=e.target;if(o!==l){pe&&(t.$header.scrollLeft=o),y&&(t.$footer.scrollLeft=o);const e=o>0,a=Math.ceil(o)+b.tableWidth<b.tableBodyWidth+n;w!==e&&K(e),T!==a&&V(a)}if(a&&i!==r&&W(i),x&&i!==r){const a=t.$tableYspace.offsetHeight||t.$tableBody.offsetHeight;Math.ceil(i)+b.viewportHeight-n>=a&&G(e)}xe.current.prevST=i,xe.current.prevSL=o}},t().createElement("div",{ref:ve,className:"body--y-space"}),t().createElement("div",{className:"body--x-space",style:{width:Oe?`${Oe}px`:""}}),t().createElement("table",Fo({ref:ye,className:`${et}--body`,tabIndex:-1,cellSpacing:"0",cellPadding:"0"},tt,{style:{width:Oe?`${Oe}px`:""}}),t().createElement("colgroup",null,n.map((e=>{const{dataIndex:a,width:r,renderWidth:l}=e;return t().createElement("col",{key:a,style:{width:`${r||l}px`,minWidth:`${r||l}px`}})}))),he?t().createElement(da.ReactSortable,{itemKey:e=>o(e,e.index),tag:"tbody",animation:200,list:l,setList:e=>{const t=e.map((e=>o(e,e.index))),a=l.map((e=>o(e,e.index)));if((0,ca.isEqual)(t,a))return;const r=[];c.current.tableFullData.forEach((t=>{l.includes(t)?r.push(e.shift()):r.push(t)})),A(r),M()}},l.map((e=>ze(e,e.index,o(e,e.index))))):t().createElement("tbody",null,je(l))),P&&Ce())}));Lo.displayName="TableBody";const qo=Lo,Do=e=>{const{summationRows:a,flattenColumns:r}=e,{getRowKey:l,tableProps:n,tableRef:i,sorter:o,layout:s,scrollY:c,leftFixedColumns:u,rightFixedColumns:p,setElementStore:h,getStickyLeft:m,getStickyRight:f}=t().useContext(Wn),{footRender:g}=n,b=t().useRef(null);t().useEffect((()=>{y()}),[]);const y=()=>{h("$footer",b.current)},v=se("table"),{tableBodyWidth:x}=s;return t().createElement("div",{ref:b,className:`${v}--footer-wrapper`},g?g(r,i.current.tableFullData):t().createElement("table",{className:`${v}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:x?`${x}px`:""}},(()=>{const{gutterWidth:e}=s;return t().createElement("colgroup",null,r.map((e=>{const{dataIndex:a,width:r,renderWidth:l}=e;return t().createElement("col",{key:a,style:{width:`${r||l}px`,minWidth:`${r||l}px`}})})),c&&t().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t().createElement("tfoot",null,(()=>{const{isIE:e}=i.current,l=["gutter",{"cell-fix-right":!!p.length}],n=e?null:{right:p.length?0:""};return a.map(((e,a)=>t().createElement("tr",{key:a,className:"footer--row"},r.map(((a,r)=>((e,a,r)=>{const{isIE:l}=i.current,{gutterWidth:n}=s,{dataIndex:h,fixed:g,align:b,summation:y}=e,v=["footer--column","col--ellipsis",{"col--center":"center"===b,"col--right":"right"===b,"column--sort":!!o[h],"cell-fix-left":!l&&"left"===g,"cell-fix-right":!l&&"right"===g,"cell-fix-left-last":!l&&"left"===g&&u[u.length-1].dataIndex===h,"cell-fix-right-first":!l&&"right"===g&&p[0].dataIndex===h}],x=l?null:{left:"left"===g?`${m(h)}px`:"",right:"right"===g?`${f(h)+(c?n:0)}px`:""},E=null!=y&&y.render?y.render(i.current.tableFullData):(0,ii.C_)(a,`${h}_text`),C=0===r&&""===E?d("qm.table.config.summaryText"):E;return t().createElement("td",{key:h,title:C,className:oe()(v),style:{...x}},t().createElement("div",{className:"cell"},C))})(a,e,r))),c&&t().createElement("td",{className:oe()(l),style:{...n}}))))})())))};var $o;!function(e){e.small="small",e.middle="default",e.large="default"}($o||($o={}));const Mo=e=>{var a,r;const{current:n,pageSize:i,total:o,config:s,onChange:c}=e,{global:d}=t().useContext(l),{tableProps:u,$size:p,setElementStore:h}=t().useContext(Wn),{infoBarConfig:m}=u,f=t().useRef(null);t().useEffect((()=>{g()}),[]);const g=()=>{h("$pager",f.current)},b=(e,t)=>{c(e,t)},y=(null==s?void 0:s.showSizeChanger)??ci.pagination.showSizeChanger,v=(null==s?void 0:s.showQuickJumper)??ci.pagination.showQuickJumper,x=(null==s?void 0:s.pageSizeOptions)||(null==d||null===(a=d.table)||void 0===a||null===(r=a.pagination)||void 0===r?void 0:r.pageSizeOptions)||ci.pagination.pageSizeOptions,E={[`${se("table")}-pager`]:!0};return t().createElement("div",{ref:f,className:oe()(E)},t().createElement("div",{className:"pager-alert"},"bottom"===(null==m?void 0:m.position)&&t().createElement(vi,{total:o})),t().createElement(N.Pagination,{size:$o[p],showSizeChanger:y,showQuickJumper:v,pageSizeOptions:x,current:n,pageSize:i,total:o,onChange:b,onShowSizeChange:b}))},Ko=()=>{const{layout:e}=t().useContext(Wn),a=t().useMemo((()=>{const{headerHeight:t,viewportHeight:a}=e;return{top:`${t}px`,height:`${a}px`}}),[e]),r=se("table");return t().createElement("div",{className:`${r}--empty`,style:a},t().createElement(Ze,null))};function Vo(){return Vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Vo.apply(this,arguments)}const Uo=t().forwardRef(((e,a)=>{const{rowKey:r,columns:n,loading:i,stripe:o,resizable:s,customClass:c,paginationConfig:d,tablePrint:u,exportExcel:p,infoBarConfig:h,topSpaceAlign:f,showTableInfo:g,showFullScreen:b,showRefresh:y,showToolBox:v,showColumnDefine:x,showHeader:E}=e,{size:C}=t().useContext(l),S=t().useMemo((()=>e.size??C??""),[e.size,C]),w=t().useRef(null),T=t().useRef(null),N=t().useRef(null),I=t().useRef(null),_=t().useRef(null),R=yi(),P=t().useCallback(((e,t)=>{const a="function"==typeof r?r(e,t):e[r];return void 0===a?(m("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):a}),[r]),{tableRef:O,tableFullData:A,setElementStore:k,setOriginColumns:H,setTableFullData:F,setTableOriginData:L,setAllTableData:q,setDeriveRowKeys:D,setFieldAuth:$,setMergeCells:M,setScrollYStore:K,setScrollYLoad:V,setResizeState:U,setHandleState:j,setSummaries:z,setSelectionRows:B,setShouldToTop:W,setRecordsMap:G,setOverlay:Z,clearElementStore:X,clearRecordsMap:Q}=((e,a)=>{let{getRowKey:r,$size:l}=a;const n=t().useRef({uid:(0,ii.wE)(),elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],allTableData:[],allRowKeys:[],deriveRowKeys:[],flattenRowKeys:[],fieldAuth:{},mergeCells:[],scrollYStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0,rowHeight:ci.rowHeightMaps[l]},store:new si,resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:null,remove:!1},summaries:{},treeTable:!1,scrollYLoad:!1,shouldToTop:!0,selectionRows:[],recordsMap:new Map,isOverlay:!1,isIE:(0,Y.w1)()}),i=function(e,t,a){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.map((e=>{const n=r(e,e.index),o=a?`${a}#${n}`:`${n}`,s={level:l,rowKey:n,rowKeyPath:o};return e.children&&(s.children=i(e.children,n,o,l+1)),t?Object.assign({},s,{parentRowKey:t}):s}))},o=e=>{const t=[];return e.forEach((e=>{var a;null!==(a=e.children)&&void 0!==a&&a.length?t.push(...o(e.children)):t.push(e.rowKey)})),t};return{tableRef:n,...n.current,setElementStore:(e,t)=>{n.current.elementStore[e]=t},setOriginColumns:e=>{n.current.originColumns=e},setTableFullData:e=>{n.current.tableFullData=e},setTableOriginData:e=>{n.current.tableOriginData=e},setAllTableData:e=>{const t=(0,ii.tL)(e);n.current.allTableData=t,n.current.allRowKeys=t.map((e=>r(e,e.index)))},setDeriveRowKeys:e=>{n.current.deriveRowKeys=i(e,"",""),n.current.flattenRowKeys=o(n.current.deriveRowKeys),n.current.treeTable=n.current.deriveRowKeys.some((e=>Array.isArray(e.children)&&e.children.length))},setFieldAuth:(e,t)=>{n.current.fieldAuth[e]=t},setMergeCells:e=>{const t=[];e.forEach((e=>{t.push(e);for(let a=1;a<e.colSpan;a++)for(let r=0;r<e.rowSpan;r++)t.push({row:e.row+r,col:e.col+a,rowSpan:0,colSpan:0});for(let a=1;a<e.rowSpan;a++)for(let r=0;r<e.colSpan;r++)t.push({row:e.row+a,col:e.col+r,rowSpan:0,colSpan:0})})),n.current.mergeCells=t},setScrollYStore:e=>{n.current.scrollYStore=e},setResizeState:e=>{n.current.resizeState=e},setHandleState:e=>{n.current.handleState=e},setSummaries:e=>{n.current.summaries=e},setScrollYLoad:e=>{n.current.scrollYLoad=e},setShouldToTop:e=>{n.current.shouldToTop=e},setSelectionRows:e=>{n.current.selectionRows=e},setRecordsMap:(e,t)=>{n.current.recordsMap.set(e,t)},setOverlay:e=>{n.current.isOverlay=e},clearElementStore:()=>{for(const e in n.current.elementStore)n.current.elementStore[e]=null},clearRecordsMap:()=>{n.current.recordsMap.clear()}}})(0,{getRowKey:P,$size:S}),{tableData:J,setTableData:ee,filters:te,setFilters:ae,sorter:re,setSorter:le,superFilters:ne,setSuperFilters:ie,pagination:ce,setPagination:de,selectionKeys:ue,setSelectionKeys:pe,rowExpandedKeys:he,setRowExpandedKeys:me,highlightKey:fe,setHighlightKey:ge,layout:be,setLayout:ye,permission:ve,setPermission:xe,spinning:Ee,setSpinning:Ce,scrollX:we,setScrollX:Te,scrollY:Ne,setScrollY:Ie,isPingLeft:_e,setPingLeft:Re,isPingRight:Pe,setPingRight:Oe,isFullScreen:Ae,setFullScreen:ke}=(e=>{var a,r;const{paginationConfig:n,rowSelection:i,expandable:o,rowHighlight:s}=e,{global:c}=t().useContext(l),d={current:ci.pagination.current,pageSize:(null==n?void 0:n.pageSize)??(null==c||null===(a=c.table)||void 0===a||null===(r=a.pagination)||void 0===r?void 0:r.pageSize)??ci.pagination.pageSize,total:0},u=(null==i?void 0:i.selectedRowKeys)??(null==i?void 0:i.defaultSelectedRowKeys)??[],p=(null==o?void 0:o.expandedRowKeys)??(null==o?void 0:o.defaultExpandedRowKeys)??[],[h,m]=t().useState([]),[f,g]=t().useReducer(((e,t)=>(0,ca.isEqual)(e,t)?e:t),{}),[b,y]=t().useReducer(((e,t)=>(0,ca.isEqual)(e,t)?e:t),{}),[v,x]=t().useReducer(((e,t)=>(0,ca.isEqual)(e,t)?e:t),[]),[E,C]=t().useState(d),[S,w]=t().useReducer(((e,t)=>(0,ca.isEqual)(e,t)?e:t),u),[T,N]=t().useReducer(((e,t)=>(0,ca.isEqual)(e,t)?e:t),p),[I,_]=t().useState((null==s?void 0:s.currentRowKey)??""),[R,P]=t().useState({gutterWidth:ui(),tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[O,A]=t().useState({export:!0,import:!0,print:!0}),[k,H]=t().useState(!1),[F,L]=t().useState(!1),[q,D]=t().useState(!1),[$,M]=t().useState(!1),[K,V]=t().useState(!1),[U,j]=t().useState(!1);return{tableData:h,setTableData:m,filters:f,setFilters:g,sorter:b,setSorter:y,superFilters:v,setSuperFilters:x,pagination:E,setPagination:C,selectionKeys:S,setSelectionKeys:w,rowExpandedKeys:T,setRowExpandedKeys:N,highlightKey:I,setHighlightKey:_,layout:R,permission:O,setPermission:A,setLayout:P,spinning:k,setSpinning:H,scrollX:F,setScrollX:L,scrollY:q,setScrollY:D,isPingLeft:$,setPingLeft:M,isPingRight:K,setPingRight:V,isFullScreen:U,setFullScreen:j}})(e),{isFetch:He,isWebPagination:Fe,isScrollPagination:Le,showPagination:qe,shouldUpdateHeight:De,tableColumns:$e,flattenColumns:Me,editableColumns:Ke,summationColumns:Ve,leftFixedColumns:Ue,rightFixedColumns:je,firstDataIndex:ze,showSummary:Be,showFooter:We,isHeadGroup:Ge,bordered:Ye,isHeadSorter:Ze,isHeadFilter:Xe,isServiceSummation:Je,isSelectCollection:et,isTableImport:tt,isTableClipboard:at,isSuperSearch:rt,isFastSearch:lt,isGroupSummary:nt,isGroupSubtotal:it,isDragMergeCell:ot,isTreeTable:st,isTableEmpty:ct,summationRows:dt,fetchParams:ut}=fi(e,{getRowKey:P,tableRef:O,tableFullData:A,tableData:J,sorter:re,filters:te,superFilters:ne,pagination:ce}),{createElementStore:pt,tableStyles:ht,getSpan:mt,getStickyLeft:ft,getStickyRight:gt,scrollXToColumn:bt,scrollYToRecord:yt,rowInViewport:vt,calcTableHeight:xt,resetTableScroll:Et,doLayout:Ct}=bi(e,{getRowKey:P,tableRef:O,$size:S,tableColumns:$e,flattenColumns:Me,leftFixedColumns:Ue,layout:be,scrollY:Ne,tableData:J,showFooter:We,showPagination:qe,isWebPagination:Fe,isFullScreen:Ae,setLayout:ye,setScrollX:Te,setScrollY:Ie,setElementStore:k,setScrollYStore:K,setShouldToTop:W}),{initialTable:St,createTableFullData:wt,getTableData:Tt,handleTableData:Nt,createTableData:It,createGroupData:_t,createSelectionKeys:Rt,createSelectionRows:Pt,createRowExpandedKeys:Ot,findParentRowKeys:At,getAllChildRowKeys:kt,doFieldValidate:Ht,getTableLog:Ft,dataChange:Lt,tableChange:qt,toLastPage:Dt,toFirstPage:$t,getPageCount:Mt,pagerChangeHandle:Kt,triggerScrollYEvent:Vt,scrollBottomDebouncer:Ut,clearTableSorter:jt,clearTableFilter:zt,clearSuperFilters:Bt,clearRowSelection:Wt,clearRowHighlight:Gt,clearTableLog:Yt,destroy:Zt}=gi(e,{getRowKey:P,tableRef:O,tableElementRef:T,tableBodyRef:N,$size:S,tableColumns:$e,tableFullData:A,pagination:ce,layout:be,filters:te,sorter:re,superFilters:ne,fetchParams:ut,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,summationColumns:Ve,shouldUpdateHeight:De,isFetch:He,isTreeTable:st,isWebPagination:Fe,isScrollPagination:Le,isServiceSummation:Je,isGroupSubtotal:it,doLayout:Ct,setTableData:ee,setTableFullData:F,setTableOriginData:L,setAllTableData:q,setDeriveRowKeys:D,setPagination:de,setSpinning:Ce,setSorter:le,setFilters:ae,setSuperFilters:ie,setSelectionKeys:pe,setRowExpandedKeys:me,setHighlightKey:ge,setSelectionRows:B,setScrollYLoad:V,setScrollYStore:K,setFieldAuth:$,setResizeState:U,setSummaries:z,setPermission:xe,setRecordsMap:G,resetTableScroll:Et,clearElementStore:X,clearRecordsMap:Q});((e,a)=>{const{columns:r,summation:l,rowSelection:n,expandable:i,rowHighlight:o,mergeCells:s=[]}=e,{tableRef:c,topElementRef:d,tableElementRef:u,tableBodyRef:p,resizableBarRef:h,$size:f,scrollX:g,pagination:b,selectionKeys:y,rowExpandedKeys:v,highlightKey:x,summationRows:E,summationColumns:C,showSummary:S,isWebPagination:w,isScrollPagination:T,isTreeTable:N,toLastPage:I,toFirstPage:_,getPageCount:R,setHandleState:P,scrollYToRecord:O,setSelectionKeys:A,setOriginColumns:k,setSelectionRows:H,setRowExpandedKeys:F,setHighlightKey:L,setResizeState:q,setMergeCells:D,setPingRight:$,calcTableHeight:M,createSelectionKeys:K,createSelectionRows:V,createRowExpandedKeys:U,createElementStore:j,triggerScrollYEvent:z,forceUpdate:B,initialTable:W,destroy:G}=a,{elementStore:Z,handleState:X,scrollYLoad:Q}=c.current,J=t().useRef(E);Se((()=>{if(!n)return;const{onChange:e}=n;"radio"===n.type&&p.current.setClickedValues(y.length?[y[0],""]:[]),H(V(y)),null==e||e(y,c.current.selectionRows),S&&C.some((e=>e.summation.sumBySelection))&&B()}),[y]),Se((()=>{if(!i)return;const{allTableData:e,allRowKeys:t}=c.current,{onChange:a}=i;null==a||a(v,v.map((a=>e[t.findIndex((e=>e===a))])))}),[v]),Se((()=>{const{allTableData:e,allRowKeys:t}=c.current;var a;N&&F(U()),o&&(p.current.setClickedValues(x?[x,""]:[]),null===(a=o.onChange)||void 0===a||a.call(o,x,e[t.findIndex((e=>e===x))]??null))}),[x]),Se((()=>{var e;(0,ca.isEqual)(E,J.current)||(J.current=E,S&&l&&(null===(e=l.onChange)||void 0===e||e.call(l,E)))}),[E]),Se((()=>{const e=K(n.selectedRowKeys);(0,ca.isEqual)(e,y)||(A(e),N&&F(U()))}),[null==n?void 0:n.selectedRowKeys]),Se((()=>{const e=U(i.expandedRowKeys);(0,ca.isEqual)(e,v)||F(e)}),[null==i?void 0:i.expandedRowKeys]),Se((()=>{const{currentRowKey:e}=o;e!==x&&L(e??"")}),[null==o?void 0:o.currentRowKey]),Se((()=>{const{insert:e,remove:t}=X;e&&(w&&("after"===e?I():_()),O("","after"===e?1e5:0)),t&&b.current>R()&&I(),(e||t)&&P({insert:null,remove:!1})}),[b.total]),Se((()=>{Q&&z(Z.$tableBody.parentNode.scrollTop)}),[Q]),Se((()=>{$(g)}),[g]),Se((()=>{M()}),[f]),Se((()=>{D(s),p.current.forceUpdate()}),[s]),Se((()=>{Q&&(e.height||e.maxHeight||m("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||m("Table","必须设置组件参数 `ellipsis`")),T&&(e.height||e.maxHeight||m("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[Q,T]);const ee=()=>{const{resizeState:e}=c.current,{winHeight:t}=e,a=window.innerHeight;a!==t&&(q(Object.assign({},e,{winHeight:a})),M())};t().useEffect((()=>(j({$toper:d.current,$table:u.current,$resizableBar:h.current}),k((0,Y.I8)(r)),W(),D(s),window.addEventListener("resize",ee,!1),M(),()=>{G(),window.removeEventListener("resize",ee)})),[])})(e,{tableRef:O,topElementRef:w,tableElementRef:T,tableBodyRef:N,resizableBarRef:_,$size:S,scrollX:we,pagination:ce,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,showSummary:Be,summationRows:dt,summationColumns:Ve,isWebPagination:Fe,isScrollPagination:Le,isTreeTable:st,toLastPage:Dt,toFirstPage:$t,getPageCount:Mt,setHandleState:j,scrollYToRecord:yt,setOriginColumns:H,setSelectionKeys:pe,setSelectionRows:B,setRowExpandedKeys:me,setHighlightKey:ge,setResizeState:U,setMergeCells:M,setPingRight:Oe,calcTableHeight:xt,createSelectionKeys:Rt,createSelectionRows:Pt,createRowExpandedKeys:Ot,createElementStore:pt,triggerScrollYEvent:Vt,forceUpdate:R,initialTable:St,destroy:Zt});const Xt=t().useMemo((()=>({getRowKey:P,tableProps:e,tableRef:O,tableBodyRef:N,$size:S,flattenColumns:Me,editableColumns:Ke,leftFixedColumns:Ue,rightFixedColumns:je,firstDataIndex:ze,sorter:re,filters:te,superFilters:ne,layout:be,bordered:Ye,showFooter:We,showSummary:Be,summationRows:dt,scrollX:we,scrollY:Ne,pagination:ce,fetchParams:ut,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,isFetch:He,isPingLeft:_e,isPingRight:Pe,isHeadSorter:Ze,isHeadFilter:Xe,isFullScreen:Ae,isTableEmpty:ct,isHeadGroup:Ge,isTreeTable:st,isGroupSubtotal:it,isWebPagination:Fe,isDragMergeCell:ot,dataChange:Lt,tableChange:qt,getTableData:Tt,setElementStore:k,createTableFullData:wt,setSorter:le,setFilters:ae,setSuperFilters:ie,setSelectionKeys:pe,setHighlightKey:ge,setRowExpandedKeys:me,setSelectionRows:B,getSpan:mt,getStickyLeft:ft,getStickyRight:gt,scrollXToColumn:bt,scrollYToRecord:yt,rowInViewport:vt,setPagination:de,setPingLeft:Re,setPingRight:Oe,setSpinning:Ce,setFullScreen:ke,setShouldToTop:W,setOverlay:Z,doFieldValidate:Ht,createTableData:It,createGroupData:_t,findParentRowKeys:At,getAllChildRowKeys:kt,triggerScrollYEvent:Vt,scrollBottomDebouncer:Ut,resetTableScroll:Et,clearTableSorter:jt,clearTableFilter:zt,clearSuperFilters:Bt,clearRowSelection:Wt,clearRowHighlight:Gt})),[e,S,Me,Ke,Ue,je,ze,re,te,ne,be,Ye,We,Be,dt,we,Ne,ce,ut,ue,he,fe,He,_e,Pe,Ze,Xe,Ae,ct,Ge,st,it,Fe,ot]);((e,a)=>{const{getRowKey:r,tableProps:l,tableRef:n,toolBoxRef:i,flattenColumns:o,editableColumns:s,pagination:c,fetchParams:d,selectionKeys:u,rowExpandedKeys:p,highlightKey:h,isFetch:f,dataChange:g,getTableData:b,handleTableData:y,createTableData:v,calcTableHeight:x,scrollXToColumn:E,scrollYToRecord:C,doFieldValidate:S,setHandleState:w,setSelectionKeys:T,setRowExpandedKeys:N,setHighlightKey:I,setSelectionRows:_,forceUpdate:R,getTableLog:P,clearRowSelection:O,clearRowHighlight:A,clearTableSorter:k,clearTableFilter:H,clearSuperFilters:F,clearTableLog:L}=a,{columns:q,columnsChange:D}=l,$=(e,t,a)=>{for(let l=0;l<e.length;l++){const n=e[l],i=r(n,n.index);Array.isArray(n.children)&&$(n.children,t,a),t.includes(i)&&(null==a||a(n,i),e.splice(l,1),l-=1)}};t().useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{x()},DO_REFRESH:async e=>{f&&(await b(),null==e||e())},GET_LOG:()=>P(),GET_FETCH_PARAMS:()=>{const e={};for(const t in d)Object.keys(c).includes(t)||(e[t]=d[t]);return e},CLEAR_TABLE_DATA:()=>{f||(O(),A(),k(),H(),F(),L(),v([]))},CLEAR_LOG:()=>{L()},FORCE_UPDATE:()=>{R()},DO_EXPORT:()=>{i.current.exportHandle()},SCROLL_TO_RECORD:e=>{C(e)},SCROLL_TO_COLUMN:e=>{E(e)},SET_SELECTION:e=>{T(e)},SET_HIGHLIGHT:e=>{I(e)},SET_EXPANDABLE:e=>{N(e)},SET_SELECTION_ROWS:e=>{_(e)},SET_TABLE_DATA:e=>{y(e)},SET_TABLE_COLUMN:(e,t,a)=>{const r=q.filter((e=>!e.noAuth)),l=r.find((t=>t.dataIndex===e));if(!l)return m("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!(0,Y.Kn)(t))return m("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");for(const e in t)e&&(0,Y.t8)(l,e,t[e]);a&&(D?D(r):m("Table","需要设置 `columnsChange` 参数"))},INSERT_RECORDS:(e,t)=>{const{store:a,tableFullData:l}=n.current,i=(Array.isArray(e)?e:[e]).filter((e=>(0,Y.Kn)(e)));if(!i.length)return;i.forEach((e=>{o.forEach((t=>{const{dataIndex:a}=t;[ci.expandableColumn,ci.selectionColumn,ci.operationColumn].includes(a)||(0,ii.dN)(e,a,(0,ii.C_)(e,a))})),a.addToInserted(e)}));const s="before"===(null==t?void 0:t.mode),c=void 0===(null==t?void 0:t.parentRowKey);let d=l;if(c)d=s?[...i,...d]:d.concat(i);else{const e=(0,ii.ZJ)(l,(e=>t.parentRowKey===r(e,e.index)));e&&(Array.isArray(e.children)?s?e.children.unshift(...i):e.children.push(...i):e.children=i)}v(d),c&&w(Object.assign({},n.current.handleState,{insert:s?"before":"after"})),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:a}=n.current,l=(Array.isArray(e)?e:[e]).map((e=>(0,Y.Kn)(e)?r(e,e.index):e));if(!l.length)return;let i=!1;$(a,l,((e,a)=>{t.addToRemoved(e),s.forEach((r=>{const{dataIndex:l,editRender:n}=r,i=null==n?void 0:n(e,r);if(!i)return;const{rules:o=[],disabled:s}=i;!s&&o.length&&(t.removeFromRequired({x:a,y:l}),t.removeFromValidate({x:a,y:l}),t.removeFromEdited({x:a,y:l}))})),i=!0})),i&&(v(a),T(u.filter((e=>!l.includes(e)))),l.includes(h)&&A(),N(p.filter((e=>!l.includes(e)))),w(Object.assign({},n.current.handleState,{remove:!0})),g())},VALIDATE_FIELDS:e=>{n.current.allTableData.forEach((t=>{s.forEach((a=>{const{dataIndex:l,editRender:n}=a,i=null==n?void 0:n(t,a);if(!i)return;const o=r(t,t.index);if(e&&!e.includes(o))return;const{rules:s=[],disabled:c}=i;!c&&s.length&&S(s,(0,ii.C_)(t,l),o,l)}))}));const{required:t,validate:a}=P(),l=[...t,...a];return l.length&&C(l[0].rowKey),R(),{required:t,validate:a}}})))})(a,{getRowKey:P,tableProps:e,tableRef:O,toolBoxRef:I,flattenColumns:Me,editableColumns:Ke,pagination:ce,fetchParams:ut,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,isFetch:He,dataChange:Lt,getTableData:Tt,handleTableData:Nt,createTableData:It,calcTableHeight:xt,scrollXToColumn:bt,scrollYToRecord:yt,doFieldValidate:Ht,setHandleState:j,setSelectionKeys:pe,setRowExpandedKeys:me,setHighlightKey:ge,setSelectionRows:B,forceUpdate:R,getTableLog:Ft,clearRowSelection:Wt,clearRowHighlight:Gt,clearTableSorter:jt,clearTableFilter:zt,clearSuperFilters:Bt,clearTableLog:Yt}),t().useEffect((()=>{ni.register(O.current.uid,a??{current:null})}),[]);const Qt=se("table"),Jt={[`${Qt}--wrapper`]:!0,[`${Qt}--lg`]:"large"===S,[`${Qt}--sm`]:"small"===S,[`${Qt}--maximize`]:Ae,[c]:!!c},ea={[Qt]:!0,"is--border":Ye,"is--striped":o,"is--fixed":Ue.length||je.length,"is--sortable":Ze,"is--filterable":Xe,"is--head-group":Ge,"is--merge-cell":ot,"is--empty":ct,"show--head":E,"show--foot":We,"ping--left":_e,"ping--right":Pe,"scroll--x":we,"scroll--y":Ne};return t().createElement(Wn.Provider,{value:Xt},t().createElement("div",{className:oe()(Jt)},g&&t().createElement("div",{ref:w,className:`${Qt}-top`},t().createElement("div",{className:`${Qt}-top__space`},"bottom"!==(null==h?void 0:h.position)&&t().createElement(vi,{total:ce.total}),t().createElement("div",{className:`${Qt}-top__space-slot`,style:{justifyContent:ri[f]}},e.children)),t().createElement("div",{className:`${Qt}-top__actions`},t().createElement(ho,{ref:I,showFullScreen:b,showReload:y&&He,showPrint:ve.print&&!!u,showImport:ve.import&&tt,showExport:ve.export&&!!p,showClipboard:at,showCollection:et,showFastSearch:lt,showSuperSearch:rt,showGroupSummary:nt,showToolBox:v,tableColumns:$e}),x&&t().createElement(mo,{columns:n}))),t().createElement(Qe,{spinning:i??Ee},t().createElement("div",{ref:T,className:oe()(ea),style:ht},t().createElement("div",{className:`${Qt}--main-wrapper`},E&&t().createElement(So,{tableColumns:$e,flattenColumns:Me,sorter:re,filters:te}),t().createElement(qo,{ref:N,tableData:J,flattenColumns:Me}),We&&t().createElement(Do,{summationRows:dt,flattenColumns:Me})),Ye&&t().createElement("div",{className:`${Qt}--border-line`}),ct&&t().createElement(Ko,null),s&&t().createElement("div",{ref:_,className:`${Qt}--resizable-bar`}))),qe&&t().createElement(Mo,Vo({},ce,{config:d,onChange:(e,t)=>Kt({current:e,pageSize:t})}))))}));Uo.defaultProps={columns:[],dataSource:[],rowKey:"id",border:!0,resizable:!0,showHeader:!0,ellipsis:!0,multipleSort:!0,topSpaceAlign:"right",showFullScreen:!0,showRefresh:!0,showClipboard:!0,showSelectCollection:!0,showSuperSearch:!0,showFastSearch:!0,showGroupSummary:!0,showColumnDefine:!0,showTableInfo:!0},Uo.displayName="Table";const jo=Uo,zo=jo;function Bo(){return Bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Bo.apply(this,arguments)}const Wo=e=>{var a;const{uniqueKey:r,multiple:n,initialValue:i,selectionRows:o,defaultSelectedKeys:s=[],filters:c=[],table:u={},onClose:p}=e,{size:h}=t().useContext(l),m=t().useMemo((()=>e.size??h??""),[e.size,h]),f=t().useRef(null),g=t().useRef(null),b=t().useRef(null),y=Ln(f),[v,x]=t().useState(u),[E,C]=t().useState(),[S,w]=t().useState(s),[T,N]=t().useState(!1),[I,_]=t().useState(300),[R,P]=t().useState(c),[O,A]=t().useState([{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t().createElement("span",null,e+1)},...u.columns||[]]),[k,H]=t().useState((0,ca.merge)({},null===(a=u.fetch)||void 0===a?void 0:a.params,i)),[F,L]=t().useState([]),q=()=>{const e=f.current,t=e.querySelector(".form-wrap");_(e.offsetHeight-t.offsetHeight-2*Oa[m]-30)},D=(0,Y.Ds)(q,5);Se((()=>{D()}),[y.width]),Se((()=>{(0,ca.isEqual)(c,R)||P(c)}),[c]),t().useEffect((()=>{$()}),[k]),t().useEffect((()=>{o&&b.current.SET_SELECTION_ROWS(o)}),[o]),t().useEffect((()=>{var e;i&&(null===(e=g.current)||void 0===e||e.SET_FIELDS_VALUE(i))}),[]);const $=async()=>{const{webPagination:e,fetch:t}=v;if(!e||null==t||!t.api)return;const{api:a,dataKey:r,beforeFetch:l=Y.XT}=t;if(l(k)){N(!0);try{const e=await a(k);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,r)??[];w([]),await(0,Y._v)(0),L(t)}}catch(e){}N(!1)}},M=e=>{n||(C(e),p(e))},K=e=>{H(Object.assign({},k,e))},V=se("search-helper"),U=v.webPagination?{dataSource:F,loading:T,webPagination:!0}:{fetch:{...v.fetch,params:k}};return t().createElement("div",{ref:f,className:`${V}--wrapper`},t().createElement("div",{className:"form-wrap"},R.length?t().createElement(Zl,{ref:g,items:R,uniqueKey:r?`helper_${r}`:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>P(e),onCollapse:()=>q(),onFinish:e=>K(e),onReset:async()=>{const[e,t]=await g.current.GET_FORM_DATA();e||K(t)}}):null),t().createElement("div",null,t().createElement(zo,Bo({ref:b,height:I,columns:O,rowKey:v.rowKey||"pageIndex"},U,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectedRowKeys:S,onChange:(e,t)=>{w(e),C(n?t:t[0])}},columnsChange:e=>A(e),onRowDblclick:M,onRowEnter:M}))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Oa[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(J,{onClick:()=>p(null),style:{marginRight:8}},d("qm.dialog.cancel")),t().createElement(J,{type:"primary",disabled:!E,onClick:()=>p(E,n?S:void 0)},d("qm.dialog.confirm"))))};Wo.displayName="SearchHelper";const Go=Wo;function Yo(){return Yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Yo.apply(this,arguments)}const Zo=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Zo(e.children)),e.children&&t.push(e.value)})),t},Xo=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(a=Xo(e[r].children,t)),a)return a;if(t(e[r]))return e[r]}return a},Qo=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&Qo(e.children,t),t(e)||e.children&&e.children.length))),Jo=e=>{var a;const{uniqueKey:r,multiple:n,initialValue:i,selectionRows:o,defaultSelectedKeys:s=[],filters:c=[],table:u={},tree:p={},onClose:h}=e,{size:f}=t().useContext(l),g=t().useMemo((()=>e.size??f??""),[e.size,f]),b=t().useRef(null),y=t().useRef(null),v=t().useRef(null),x=Ln(b),[E,C]=t().useState(u),[S,w]=t().useState(),[T,I]=t().useState(s),[_,R]=t().useState(!1),[P,O]=t().useState(300),[A,k]=t().useState(300),[H,F]=t().useState(c),[L,q]=t().useState([{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t().createElement("span",null,e+1)},...u.columns||[]]),[D,$]=t().useState((0,ca.merge)({},null===(a=u.fetch)||void 0===a?void 0:a.params,i)),[M,K]=t().useState([]),V=()=>{const e=b.current,t=e.querySelector(".form-wrap"),a=e.querySelector(".input-wrap");O(e.offsetHeight-a.offsetHeight-10),k(e.offsetHeight-t.offsetHeight-2*Oa[g]-30)},U=(0,Y.Ds)(V,5);Se((()=>{U()}),[x.width]),Se((()=>{(0,ca.isEqual)(c,H)||F(c)}),[c]),t().useEffect((()=>{j()}),[D]),t().useEffect((()=>{o&&v.current.SET_SELECTION_ROWS(o)}),[o]),t().useEffect((()=>{var e;i&&(null===(e=y.current)||void 0===e||e.SET_FIELDS_VALUE(i)),re()}),[]);const j=async()=>{const{webPagination:e,fetch:t}=E;if(!e||null==t||!t.api)return;const{api:a,dataKey:r,beforeFetch:l=Y.XT}=t;if(l(D)){R(!0);try{const e=await a(D);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,r)??[];I([]),await(0,Y._v)(0),K(t)}}catch(e){}R(!1)}},z=e=>{n||(w(e),h(e))},B=e=>{$(Object.assign({},D,e))},[W,G]=t().useState([]),[Z,X]=t().useState([]),[Q,ee]=t().useState(""),te=t().useRef(W),ae=t().useRef([]);Se((()=>{X(Zo(W))}),[W]);const re=async()=>{if(!p.fetch)return;const{api:e,params:t,dataKey:a,valueKey:r="value",textKey:l="text"}=p.fetch;try{const n=await e(t);if(200===n.code){const e=Array.isArray(n.data)?n.data:(0,ca.get)(n.data,a)??[],t=la(e,r,l);G(t),te.current=t,ae.current=e}}catch(e){}},le=e=>`${e}|${Xr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ne=se("tree-table-helper"),ie=E.webPagination?{dataSource:M,loading:_,webPagination:!0}:{fetch:{...E.fetch,params:D}};return t().createElement("div",{ref:b,className:`${ne}--wrapper`},t().createElement(Me,{defaultValue:200,style:{height:"100%"}},t().createElement(Me.Pane,{min:100,style:{overflowY:"auto"}},t().createElement(N.Input.Search,{className:"input-wrap",value:Q,style:{marginBottom:8},placeholder:d("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{const t=Qo(te.current,(t=>{if(!e)return!0;const a=t.text||"";return-1!==le(a).indexOf(e)}));ee(e),G(t)})(e.target.value)}),t().createElement(N.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:P,defaultExpandAll:!0,expandedKeys:Z,treeData:W,filterTreeNode:e=>{if(!Q)return!1;const t=e.text||"";return-1!==le(t).indexOf(Q)},onExpand:e=>{X(e)},onSelect:e=>{const{valueKey:t="value"}=p.fetch;(e=>{if(!p.tableParamsMap)return m("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof p.tableParamsMap?p.tableParamsMap():p.tableParamsMap,a={};for(const r in t)a[r]=(0,ca.get)(e,t[r]);B(a)})(Xo(ae.current,(a=>(0,ca.get)(a,t)===e[0]))||{})}})),t().createElement(Me.Pane,{className:"split-pane"},t().createElement("div",{className:"form-wrap"},H.length?t().createElement(Zl,{ref:y,items:H,uniqueKey:r?`helper_${r}`:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>F(e),onCollapse:()=>V(),onFinish:e=>B(e),onReset:async()=>{const[e,t]=await y.current.GET_FORM_DATA();e||B(t)}}):null),t().createElement("div",null,t().createElement(zo,Yo({ref:v,height:A,columns:L,rowKey:E.rowKey||"pageIndex"},ie,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectedRowKeys:T,onChange:(e,t)=>{I(e),w(n?t:t[0])}},columnsChange:e=>q(e),onRowDblclick:z,onRowEnter:z}))))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Oa[g]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(J,{onClick:()=>h(null),style:{marginRight:8}},d("qm.dialog.cancel")),t().createElement(J,{type:"primary",disabled:!S,onClick:()=>h(S,n?T:void 0)},d("qm.dialog.confirm"))))};Jo.displayName="TreeTableHelper";const es=Jo,ts=e=>{var a,r,n;const{multiple:i,tree:o={},defaultSelectedKeys:s,onClose:c}=e,{size:u}=t().useContext(l),p=t().useMemo((()=>e.size??u??""),[e.size,u]),[h,m]=t().useState(),[f]=t().useState(null===(a=o.fetch)||void 0===a?void 0:a.params),g=se("tree-helper"),b=o.fetch?{...G()(o.fetch,["params","valueKey","textKey"]),params:f}:void 0;return t().createElement("div",{className:`${g}--wrapper`},t().createElement(Bn,{multiple:i,fetch:b,fieldsDefine:{valueKey:null===(r=o.fetch)||void 0===r?void 0:r.valueKey,textKey:null===(n=o.fetch)||void 0===n?void 0:n.textKey},asyncLoad:o.asyncLoad,checkStrictly:o.checkStrictly,checkStrategy:o.checkStrategy,defaultSelectedKeys:s,defaultExpandAll:o.defaultExpandAll,onSelectChange:e=>m(e),onCheckChange:e=>m(e)}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Oa[p]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(J,{onClick:()=>c(null),style:{marginRight:8}},d("qm.dialog.cancel")),t().createElement(J,{type:"primary",disabled:!h,onClick:()=>c(h)},d("qm.dialog.confirm"))))};ts.displayName="TreeHelper";const as=ts;function rs(){return rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},rs.apply(this,arguments)}const ls="_startSign",ns="_endSign",is=e=>{var a;const{uniqueKey:r,initialValue:n,filters:i=[],table:o={},onClose:s}=e,{size:c}=t().useContext(l),u=t().useMemo((()=>e.size??c??""),[e.size,c]),p=t().useRef(null),h=t().useRef(null),m=t().useRef(null),f=Ln(p),[g,b]=t().useState(o),[y,v]=t().useState(!1),[x,E]=t().useState([]),[C,S]=t().useState(300),[w,T]=t().useState(i),[I,_]=t().useState([{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t().createElement("span",null,e+1)},{title:d("qm.form.rangeSearchHelper")[0],dataIndex:ls,width:80,align:"right",render:(e,a)=>t().createElement("span",{className:"icon-sign"},e)},...o.columns||[],{title:d("qm.form.rangeSearchHelper")[1],dataIndex:ns,fixed:"right",width:80,render:(e,a)=>t().createElement("span",{className:"icon-sign"},e)}]),[R,P]=t().useState((0,ca.merge)({},null===(a=o.fetch)||void 0===a?void 0:a.params,n)),[O,A]=t().useState([]),k=t().useMemo((()=>x.map((e=>null==e?void 0:e.pageIndex))),[x]),H=t().useMemo((()=>2===k.length&&k.every((e=>void 0!==e))),[k]),F=()=>{const e=p.current.parentNode.children[0],t=e.querySelector(".form-wrap");S(e.offsetHeight-t.offsetHeight-2*Oa[u]-30)},L=(0,Y.Ds)(F,5);Se((()=>{L()}),[f.width]),Se((()=>{(0,ca.isEqual)(i,w)||T(i)}),[i]),t().useEffect((()=>{q()}),[R]);const q=async()=>{const{webPagination:e,fetch:t}=g;if(!e||null==t||!t.api)return;const{api:a,dataKey:r,beforeFetch:l=Y.XT}=t;if(l(R)){v(!0);try{const e=await a(R);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,r)??[];A(t)}}catch(e){}v(!1)}},D=(e,t)=>{delete e[t]},$=()=>{x.forEach((e=>{e&&(D(e,ls),D(e,ns))})),E([])},M=e=>{$(),P(Object.assign({},R,e))},K=se("range-helper"),V=g.webPagination?{dataSource:O,loading:y,webPagination:!0}:{fetch:{...g.fetch,params:R}};return t().createElement("div",{ref:p,className:`${K}--wrapper`},t().createElement("div",{className:"form-wrap"},w.length?t().createElement(Zl,{ref:h,items:w,initialValues:n,uniqueKey:r?`helper_${r}`:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>T(e),onCollapse:()=>F(),onFinish:e=>M(e),onReset:async()=>{const[e,t]=await h.current.GET_FORM_DATA();e||M(t)}}):null),t().createElement("div",null,t().createElement(zo,rs({ref:m,height:C,columns:I,rowKey:g.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=k[0]&&e.pageIndex<=k[1]?{backgroundColor:"#f5f5f5"}:{}},V,{columnsChange:e=>_(e),onRowClick:(e,t)=>{const{dataIndex:a}=t;[ls,ns].includes(a)&&(a===ls&&(e[a]?(D(e,a),E([void 0,x[1]])):e.pageIndex>k[1]?N.message.warning(d("qm.searchHelper.rangeStartTip")):(x[0]&&D(x[0],a),e[a]="[",E([e,x[1]]))),a===ns&&(e[a]?(D(e,a),E([x[0],void 0])):e.pageIndex<k[0]?N.message.warning(d("qm.searchHelper.rangeEndTip")):(x[1]&&D(x[1],a),e[a]="]",E([x[0],e]))),m.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===k[0]&&(e[ls]="["),e.pageIndex===k[1]&&(e[ns]="]")}))}}),t().createElement(J,{type:"primary",icon:t().createElement(ce.ClearOutlined,null),title:d("qm.table.alert.clear"),onClick:()=>$()}))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Oa[u]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(J,{onClick:()=>s(null),style:{marginRight:8}},d("qm.dialog.cancel")),t().createElement(J,{type:"primary",disabled:!H,onClick:()=>s(x.map((e=>(e=>{const t={};for(const a in e)[ls,ns].includes(a)||(t[a]=e[a]);return t})(e))))},d("qm.dialog.confirm"))))};is.displayName="RangeTableHelper";const os=is,ss={previewWidth:1100,defaultDistance:.45,logoHeight:60},cs=(0,e.createContext)(void 0);var ds=null;function us(){try{var e=navigator.userAgent;if(e.match(/Windows\sPhone/i))return!0;if(e.match(/iPhone|iPod|iPad/i))return!0;if(e.match(/Android/i))return!0;if(e.match(/Edge\D?\d+/i))return!0;var t=e.match(/Trident\D?\d+/i),a=e.match(/MSIE\D?\d+/i),r=e.match(/OPR\D?\d+/i),l=e.match(/Firefox\D?\d+/i),n=e.match(/x64/i);if(!t&&!a&&n)return!0;if(l){if((l=l[0].match(/\d+/))[0]>=41||n)return!0}else if(r){if((r=r[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!a){var i=e.match(/Chrome\D?\d+/i);if(i&&(i=i[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function ps(e,t){var a;try{var r=navigator.userAgent,l=!!r.match(/MSIE/i)||!!r.match(/Trident/i);if(us()){try{a=getCLodop()}catch(e){}if(!a&&"complete"!==document.readyState)return void N.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!a)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else if(l&&r.match(/x64/i),e||t?a=l?e:t:ds?a=ds:((a=document.createElement("object")).setAttribute("width",0),a.setAttribute("height",0),a.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),l?a.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):a.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(a),ds=a),!a||!a.VERSION)return r.indexOf("Chrome"),r.indexOf("Firefox"),a;return a.VERSION<"6.2.2.6"&&us(),a}catch(e){N.message.error("getLodop 出错:"+e)}}us();const hs=e=>{const t=e/25.4*(()=>{const e=[],{deviceXDPI:t,deviceYDPI:a}=window.screen;if(t&&a)e[0]=t,e[1]=a;else{var r;let t=document.createElement("DIV");t.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(t),e[0]=parseInt(t.offsetWidth.toString()),e[1]=parseInt(t.offsetHeight.toString()),null===(r=t.parentNode)||void 0===r||r.removeChild(t),t=null}return e})()[0];return Math.ceil(t)},ms=t().forwardRef(((e,a)=>{const{templateRender:r,directPrint:n}=e,{global:i}=t().useContext(l),{$$preview:o}=t().useContext(cs),{state:s,isWindowsPrinter:c,pageSize:d}=o,u=t().useRef(null),p=t().useRef({}),h=t().useRef([]),f=t().useRef([]),g=t().useRef([]),[b,y]=t().useState(!0);t().useImperativeHandle(a,(()=>({createPreviewDom:O,createExportHtml:k,createPrintHtml:A,SHOW_PREVIEW:H,DIRECT_PRINT:F}))),Se((()=>{P()}),[s.form.printerType,s.form.setting.direction,s.form.setting.distance,s.form.setting.fixedLogo]),t().useEffect((()=>{p.current.templateEl=u.current.querySelector(".origin-template").children[0],p.current.previewEl=u.current.querySelector(".workspace")}),[]);const v=t().useMemo((()=>{const{form:{setting:{direction:e}}}=s,t=c?10*ss.defaultDistance+10*ss.defaultDistance:0;return("vertical"===e?d[0]:d[1])-t}),[s,c,d]),x=t().useMemo((()=>{const{form:{setting:{direction:e}}}=s,t=c?10*ss.defaultDistance+10*ss.defaultDistance:0;return("vertical"===e?d[1]:d[0])-t}),[s,c,d]),E=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return hs(v-10*(e.left-ss.defaultDistance)-10*(e.right-ss.defaultDistance))}),[s,v]),C=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return hs(x-10*(e.top-ss.defaultDistance)-10*(e.bottom-ss.defaultDistance))}),[s,x]),S=s.form.scale,w=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return{left:hs(10*e.left),right:hs(10*e.right),top:hs(10*e.top),bottom:hs(10*e.bottom)}}),[s]),T=t().useMemo((()=>{const{form:{printerType:e}}=s,{left:t,right:a,top:r,bottom:l}=w,n=E+t+a,i=ss.previewWidth-n<=0?0:(ss.previewWidth-n)/2,o=Math.abs((1-S)*n/2);let c=0;return S>1&&(c=o>i?-1*i:-1*o),S<1&&(c=n-2*o>ss.previewWidth?0:i>0?o:(ss.previewWidth-(n-2*o))/2),{width:`${E}px`,height:"stylus"===e?"auto":C+"px",paddingLeft:`${t}px`,paddingRight:`${a}px`,paddingTop:`${r}px`,paddingBottom:`${l}px`,transform:`translateX(${c}px) scale(${S})`,opacity:b?0:1}}),[s,b,w,S,C,E]),N=(h.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e))),()=>{var e,t;const a=(null==i||null===(e=i.print)||void 0===e?void 0:e.leftLogo)??"",r=(null==i||null===(t=i.print)||void 0===t?void 0:t.rightLogo)??"";return[`<tr style="height: ${ss.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',a?`<img src="${a}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',r?`<img src="${r}" border="0" height="46" />`:"","</td>","</tr>"].join("")}),I=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},_=()=>{let e=document.createElement("tr");var t,a;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=I().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(a=p.current.templateEl.children[0]).children[0]?a.insertBefore(t,a.children[0]):a.appendChild(t),e=null},R=()=>{const e=p.current.templateEl.children[0].children,t=[],a=[];for(let r=0;r<e.length;r++){if("template-cols"===e[r].getAttribute("type"))continue;const l=e[r].clientHeight;e[r].style.height=l+"px",a.push(l),t.push(e[r].outerHTML)}f.current=a,h.current=t},P=()=>{if(!h.current.length)return;const{form:{setting:e,printerType:t}}=s;if(n)return g.current.push([I(),N(),...h.current]);const a=e.fixedLogo?C-ss.logoHeight:C;let r=[];if(g.current=[],"stylus"===t)g.current.push([I(),...e.fixedLogo?[N()]:[],...h.current]);else{let t=0;for(let l=0,n=f.current.length;l<n;l++){const i=h.current[l],o=f.current[l];e.fixedLogo||0!==l||(t+=ss.logoHeight),t+=o,t<=a?r.push(i):(g.current.push([I(),...e.fixedLogo?[N()]:[],...r]),r=[],t=0,l-=1),l===n-1&&r.length&&g.current.push([I(),...e.fixedLogo?[N()]:[],...r])}}var l;e.fixedLogo||null===(l=g.current[0])||void 0===l||l.splice(1,0,N());for(let e=0,t=g.current.length;e<t&&e!==t-1;e++)g.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');o.setState({currentPage:1,totalPage:g.current.length}),O()},O=()=>{var e;const{currentPage:t}=s;let a=`<table cellspacing="0" cellpadding="0" border="0" class="${p.current.templateEl.className}">`;a+=(null===(e=g.current[t-1])||void 0===e?void 0:e.join(""))??"",a+="</table>",p.current.previewEl.innerHTML=a,p.current.previewEl.parentNode.scrollTop=0},A=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${p.current.templateEl.className}">`;if(void 0!==e)t+=[...g.current[e-1]].join("");else for(let e=0;e<g.current.length;e++)t+=g.current[e].join("");return t+="</table>",t},k=()=>{const e=[];for(let t=0;t<h.current.length;t++)e[t]=h.current[t].replace(/[\r\n]/g,"").replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+N()+I()+e.join("")+"</table>"},H=async()=>{var e;if("TABLE"!==(null===(e=p.current.templateEl)||void 0===e?void 0:e.tagName))return L();p.current.previewEl.innerHTML||(_(),await(0,Y._v)(0),R(),P(),y(!1))},F=async()=>{var e;if("TABLE"!==(null===(e=p.current.templateEl)||void 0===e?void 0:e.tagName))return L();_(),await(0,Y._v)(0),R(),P(),y(!1),o.doPrint(A()),await(0,Y._v)(0),o.doClose()},L=()=>{m("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},q={[se("print-container")]:!0,"no-visible":n};return t().createElement("div",{ref:u,className:oe()(q)},t().createElement(Qe,{wrapperClassName:"spin",spinning:b,tip:"Loading..."},t().createElement("div",{className:"preview"},t().createElement("div",{className:"origin-template",style:{width:`${E}px`,marginLeft:`-${Math.floor(E/2)}px`}},null==r?void 0:r()),t().createElement("div",{className:"workspace",style:T}))))}));ms.displayName="Container";const fs=ms;function gs(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class bs extends e.Component{constructor(){super(...arguments),gs(this,"formRef",t().createRef()),gs(this,"createFormList",(()=>[{type:"DIVIDER",fieldName:"_1",label:d("qm.print.setPanel.printParameter")},{type:"SELECT",label:d("qm.print.setPanel.pagerType"),fieldName:"pageSize",options:{itemList:[{text:"A2",value:"420*594"},{text:"A3",value:"420*297"},{text:"A4",value:"210*297"},{text:"A5",value:"210*148"},{text:d("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:d("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:d("qm.print.setPanel.vertical"),value:"vertical"},{text:d("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:d("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:d("qm.print.setPanel.manualDoublePrint"),value:"manual"}]},disabled:!this.props.setting.doubleSide},options:{trueValue:1,falseValue:0},onChange:e=>{const{formList:t}=this.state;t.find((e=>"doubleSide"===e.fieldName)).label.disabled=!e,this.setState({formList:t})}},{type:"CHECKBOX",label:d("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:d("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:d("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:ss.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:d("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:d("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:ss.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:d("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:d("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:ss.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:d("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:d("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:ss.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:d("qm.print.setPanel.noEmpty")}]}])),gs(this,"getInitialvalue",(()=>{const{setting:e}=this.props,{distance:t}=e;return Object.assign({},{disleft:t.left,disright:t.right,distop:t.top,disbottom:t.bottom,pageSize:e.pageSize,direction:e.direction,doubleSide:e.doubleSide,doubleSideType:e.doubleSideType,fixedLogo:e.fixedLogo})})),gs(this,"getInitialExtra",(()=>({disleft:d("qm.print.setPanel.sizeUnit"),disright:d("qm.print.setPanel.sizeUnit"),distop:d("qm.print.setPanel.sizeUnit"),disbottom:d("qm.print.setPanel.sizeUnit")}))),gs(this,"state",{formList:this.createFormList()}),gs(this,"confirmHandle",(async()=>{const[e,t]=await this.formRef.current.GET_FORM_DATA();e||(this.props.onChange({distance:{left:t.disleft,right:t.disright,top:t.distop,bottom:t.disbottom},pageSize:t.pageSize,direction:t.direction,doubleSide:t.doubleSide,doubleSideType:t.doubleSideType,fixedLogo:t.fixedLogo}),this.cancelHandle())})),gs(this,"cancelHandle",(()=>{this.props.onClose()}))}render(){const{formList:e}=this.state;return t().createElement(t().Fragment,null,t().createElement(Zl,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},d("qm.dialog.close")),t().createElement(J,{type:"primary",onClick:()=>this.confirmHandle()},d("qm.dialog.confirm"))))}}gs(bs,"contextType",l);const ys=bs;function vs(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class xs extends e.Component{constructor(){var e,a,r;super(...arguments),vs(this,"provide",{$$preview:this}),vs(this,"containRef",t().createRef()),vs(this,"state",{visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(a=this.props.defaultConfig)||void 0===a?void 0:a.copies)||1,scale:1,setting:{distance:{left:ss.defaultDistance,right:ss.defaultDistance,top:ss.defaultDistance,bottom:ss.defaultDistance},pageSize:"210*297",direction:(null===(r=this.props.defaultConfig)||void 0===r?void 0:r.direction)||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0}),vs(this,"pageChangeHandle",(e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))})),vs(this,"exportClickHandle",(()=>{this.doExport(this.containRef.current.createExportHtml())})),vs(this,"printClickHandle",(async()=>{if(this.doPrint(this.containRef.current.createPrintHtml(this.state.printPage)),this.props.uniqueKey)try{const e={...this.state.form,printerName:this.printerItems.find((e=>e.value===this.state.form.printerName)).text};await Qi().setItem(this.printerKey,e),await this.savePrintConfig(this.printerKey,e)}catch(e){}})),vs(this,"doClose",(()=>{var e,t;null===(e=(t=this.props).onClose)||void 0===e||e.call(t)})),vs(this,"getPrintConfig",(async e=>{const t=this.context.global,a=null==t?void 0:t.getComponentConfigApi;if(a)try{const t=await a({key:e});if(200===t.code)return t.data}catch(e){}})),vs(this,"savePrintConfig",(async(e,t)=>{const a=this.context.global,r=null==a?void 0:a.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}})),vs(this,"createStyle",(()=>'\n <style type="text/css">\n table {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n table-layout: fixed;\n }\n table tr td {\n padding: 2px;\n line-height: 1.2;\n word-wrap: break-word;\n }\n .fs12 {\n font-size: 12px;\n }\n .fs13 {\n font-size: 13px;\n }\n .fs14 {\n font-size: 14px;\n }\n .fw500 {\n font-weight: 500;\n }\n .fw700 {\n font-weight: 700;\n }\n .fl {\n float: left;\n }\n .fr {\n float: right;\n }\n .tc {\n text-align: center;\n }\n .tr {\n text-align: right;\n }\n .bor {\n border: 1px solid #000;\n }\n .bor-t {\n border-top: 1px solid #000;\n }\n .bor-b {\n border-bottom: 1px solid #000;\n }\n .bor-l {\n border-left: 1px solid #000;\n }\n .bor-r {\n border-right: 1px solid #000;\n }\n .no-bor {\n border: none !important;\n }\n </style>\n ')),vs(this,"doPrint",(e=>{const t=ps();if(!t)return;const{uniqueKey:a,closeAfterPrint:r}=this.props,{form:{setting:l,printerName:n,printerType:i,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:c}=ss,{left:u,right:p,top:h,bottom:m}=l.distance;t.PRINT_INIT(a??Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(n),t.SET_PRINT_COPIES(o),l.doubleSide&&("auto"===l.doubleSideType?(t.SET_PRINT_MODE("PRINT_DUPLEX",2),t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1)):t.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",1)),t.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1),"laser"===i&&("vertical"===l.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===l.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===i&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*m*2,""),t.ADD_PRINT_TABLE(10*(h-c)+"mm",10*(u-c)+"mm",`RightMargin: ${10*(p-c)}mm`,`BottomMargin: ${"stylus"!==i?10*(m-c):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?r&&this.doClose():N.message.error(d("qm.print.printError"))},t.PRINT()})),vs(this,"doExport",(e=>{const t=ps();if(!t)return;const{uniqueKey:a,closeAfterPrint:r}=this.props,{form:{setting:l}}=this.state;t.PRINT_INIT(a??Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?r&&this.doClose():N.message.error(d("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===l.direction?1:2),t.SAVE_TO_FILE(`${i()().format("YYYYMMDDHHmmss")}.xlsx`)}))}get printerTypeItems(){return[{text:d("qm.print.laserPrinter"),value:"laser"},{text:d("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=ps(),t=[{text:d("qm.print.defaultPrinter"),value:-1}];try{const a=e.GET_PRINTER_COUNT();for(let r=0;r<a;r++)t.push({text:e.GET_PRINTER_NAME(r),value:r})}catch(e){m("Print","[ClientPrint]: 请安装 LODOP 打印插件")}return t}get isWindowsPrinter(){const{form:{printerName:e}}=this.state;return!/OneNote|Microsoft|Fax/.test(this.printerItems.find((t=>t.value===e)).text)}get pageSize(){return this.state.form.setting.pageSize.split("*").map((e=>Number(e)))}get printerKey(){return this.props.uniqueKey?`print_${this.props.uniqueKey}`:""}async componentDidMount(){if(this.props.uniqueKey)try{let t=await Qi().getItem(this.printerKey);var e;t||(t=await this.getPrintConfig(this.printerKey),(0,Y.Kn)(t)&&await Qi().setItem(this.printerKey,t)),(0,Y.Kn)(t)&&Object.keys(t).length&&(0,ca.merge)(this.state.form,{...t,printerName:(null===(e=this.printerItems.find((e=>e.text===t.printerName)))||void 0===e?void 0:e.value)??-1})}catch(e){}}render(){const{preview:e,templateRender:a}=this.props,{visible:r,form:l,currentPage:n,totalPage:i,printPage:o}=this.state,s=se("print-preview"),c={visible:r,title:d("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},u={[s]:!0};return e?t().createElement(t().Fragment,null,t().createElement("div",{className:oe()(u)},t().createElement("div",{className:"outer"},t().createElement("div",{className:"header"},t().createElement("span",null,d("qm.print.printer"),":",t().createElement(N.Select,{value:l.printerName,onChange:e=>{this.setState((t=>(0,ca.merge)({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",null,d("qm.print.type"),":",t().createElement(N.Select,{value:l.printerType,onChange:e=>{this.setState((t=>(0,ca.merge)({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",null,d("qm.print.copies"),":",t().createElement(N.InputNumber,{value:l.copies,min:1,precision:0,onChange:e=>{this.setState((t=>(0,ca.merge)({},t,{form:{copies:e??1}})))},style:{width:"50px"}})),t().createElement("span",null,d("qm.print.printPage.0"),t().createElement(N.InputNumber,{value:o,min:1,max:i,precision:0,onChange:e=>{this.setState({printPage:e??void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),d("qm.print.printPage.1")),t().createElement("span",null,t().createElement(N.Pagination,{size:"small",current:n,pageSize:1,total:i,onChange:this.pageChangeHandle})),t().createElement("span",null,t().createElement(J,{type:"text",icon:t().createElement(ce.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},d("qm.print.setting"))),t().createElement("span",null,t().createElement(J,{type:"text",icon:t().createElement(ce.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},d("qm.print.export"))),t().createElement("span",null,t().createElement(J,{icon:t().createElement(ce.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},d("qm.print.print")))),t().createElement("div",{className:"main"},t().createElement(cs.Provider,{value:this.provide},t().createElement(fs,{ref:this.containRef,templateRender:a,directPrint:!1}))),t().createElement("div",{className:"footer"},t().createElement("span",null,d("qm.print.scale"),":",t().createElement(N.Slider,{value:l.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>(0,ca.merge)({},t,{form:{scale:e}})))}}),t().createElement("em",{className:"scale-text"},`${Math.floor(100*l.scale)}%`)),t().createElement("span",null,d("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),t().createElement("span",null,d("qm.print.pageNumber"),":",d("qm.print.pagination",{currentPage:n,totalPage:i}))))),t().createElement(At,c,t().createElement(ys,{setting:l.setting,onChange:e=>{this.setState((t=>(0,ca.merge)({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):t().createElement(cs.Provider,{value:this.provide},t().createElement(fs,{ref:this.containRef,templateRender:a,directPrint:!0}))}}vs(xs,"contextType",l);const Es=xs;function Cs(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Ss extends e.Component{constructor(){super(...arguments),Cs(this,"previewRef",t().createRef()),Cs(this,"state",{visible:!1,loading:!1}),Cs(this,"clickHandle",(async()=>{this.setState({loading:!0});try{var e,t;const a=await(null===(e=(t=this.props).click)||void 0===e?void 0:e.call(t));if(this.setState({loading:!1}),"boolean"==typeof a&&!a)return;await this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),Cs(this,"createRender",(()=>{const{visible:e}=this.state,{templateRender:a,uniqueKey:r,defaultConfig:l,preview:n,closeAfterPrint:i}=this.props,o={visible:e,title:d("qm.print.preview"),width:`${ss.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},s={ref:this.previewRef,templateRender:a,uniqueKey:r,defaultConfig:l,preview:n,closeAfterPrint:i,onClose:()=>{this.setState({visible:!1})}};return n?t().createElement(At,o,t().createElement(Es,s)):e?t().createElement(Es,s):null})),Cs(this,"DO_PRINT",(async()=>{const{preview:e}=this.props;await(0,Y._v)(0),this.setState({visible:!0}),await(0,Y._v)(e?500:0);const t=this.previewRef.current.containRef.current;e?t.SHOW_PREVIEW():t.DIRECT_PRINT()}))}render(){const{loading:e}=this.state,{size:a,icon:r,type:l,disabled:n,shape:i}=this.props,o={size:a||this.context.size||"",type:l,shape:i,icon:r,loading:e,disabled:n,click:this.clickHandle};return t().createElement(t().Fragment,null,this.props.children&&t().createElement(J,o,this.props.children),this.createRender())}}Cs(Ss,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Print","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},templateRender:r().elementType}),Cs(Ss,"defaultProps",{preview:!0,type:"primary",icon:t().createElement(ce.PrinterOutlined,null)}),Cs(Ss,"contextType",l);const ws=Ss,Ts="1.5.13"})(),__webpack_exports__})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("QmDesign",["react"],t):"object"==typeof exports?exports.QmDesign=t(require("react")):e.QmDesign=t(e.React)}("undefined"!=typeof self?self:this,(__WEBPACK_EXTERNAL_MODULE__787__=>(()=>{"use strict";var __webpack_modules__={386:(e,t,a)=>{a.d(t,{Z:()=>r});const r="undefined"==typeof window},542:(e,t,a)=>{a.d(t,{Ds:()=>n.debounce,HD:()=>n.isString,I8:()=>y,Kn:()=>n.isPlainObject,M2:()=>c,P2:()=>n.throttle,PM:()=>v,RI:()=>p,U2:()=>n.get,XT:()=>u,Y3:()=>m,ZT:()=>d,_A:()=>f,_v:()=>h,hj:()=>n.isNumber,l$:()=>s,mf:()=>n.isFunction,o8:()=>n.isUndefined,t8:()=>n.set,w1:()=>o,xb:()=>g});var r=a(787),l=a.n(r),n=a(517),i=a(386);const o=()=>!i.Z&&/MSIE|Trident/.test(navigator.userAgent),s=e=>l().isValidElement(e),c=e=>s(e)&&e.type===l().Fragment,d=()=>{},u=()=>!0,p=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),h=async e=>new Promise((t=>setTimeout(t,e))),m=e=>{Promise.resolve().then(e)},f=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),g=e=>!!(!e&&0!==e||(0,n.isArray)(e)&&!e.length||(0,n.isPlainObject)(e)&&!Object.keys(e).length);function b(e,t){let a=-1;const r=e.length;for(;++a<r;)t(e[a],a);return e}const y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if((0,n.isPlainObject)(e)||(0,n.isArray)(e)){const a=Array.isArray(e),r=a?[]:{};if(t.get(e))return e;t.set(e,r);const l=a?void 0:Object.keys(e);return b(l||e,((a,n)=>{l&&(n=a),r[n]=y(e[n],t)})),r}return e},v=e=>(0,n.isNumber)(e)?`${e}px`:e.toString()},762:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$P:()=>isBracketBalance,A_:()=>array_format,Pz:()=>stringify,ar:()=>where});var _lib_filter_string__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(874),_lib_variables_replacement__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(704),_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(353),_lib_operations__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(981);window.__query__=function(){return(0,_lib_operations__WEBPACK_IMPORTED_MODULE_3__.D)(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])};const stringify=_lib_filter_string__WEBPACK_IMPORTED_MODULE_0__.Z.stringify,array_format=_lib_filter_string__WEBPACK_IMPORTED_MODULE_0__.Z.array_format,isBracketBalance=_lib_variables_replacement__WEBPACK_IMPORTED_MODULE_1__.Z.isBracketBalance,where=(array,query,isTree)=>{let result=[];if(query=_lib_filter_string__WEBPACK_IMPORTED_MODULE_0__.Z.replace_symbols(query),isTree)query=_lib_variables_replacement__WEBPACK_IMPORTED_MODULE_1__.Z.replace_variables(query,"record"),result=(0,_utils__WEBPACK_IMPORTED_MODULE_2__.Nl)(array,(record=>eval(query)));else{query=_lib_variables_replacement__WEBPACK_IMPORTED_MODULE_1__.Z.replace_variables(query,"array[i]");for(let i=0,len=array.length;i<len;i++)eval(query)&&result.push(array[i])}return result}},874:(e,t,a)=>{a.d(t,{Z:()=>l});const r=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"],l={operations:function(e){const t=e.split(" "),a=[];let l=0;a[l]=[];for(let e=0;e<t.length;e++)r.includes(t[e])?(a[l]=a[l].join(" "),l++,a[l]=[]):a[l].push(t[e]);return a[l]=a[l].join(" "),a},number_operations:function(e){return this.operations(e).length},string_format:function(e){return"string"!=typeof e?e:e.split(/[\s'\s"]/).join("")},stringify:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return"string"==typeof e?"'"+e.trim().replace(/(')/g,"\\$1").replace(/\(/g,"├").replace(/\)/g,"┤").replace(/\s/g,t)+"'":e},array_format:function(e){let t="[";for(let a=0,r=(e=Array.isArray(e)?e:[e]).length;a<r;a++)t+="number"==typeof e[a]?e[a]:"'"+e[a]+"'",a<r-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,a){return e.split(t).join(a)},replace_symbols:function(e){return e=this.find_replace(e," AND "," && "),e=this.find_replace(e," and "," && "),e=this.find_replace(e," OR "," || "),e=this.find_replace(e," or "," || "),e=this.find_replace(e," <> "," != "),e=this.find_replace(e," LIKE "," like "),e=this.find_replace(e," LIKES "," likes "),e=this.find_replace(e," IN "," in "),this.find_replace(e," NIN "," nin ")}}},981:(e,t,a)=>{a.d(t,{D:()=>s});const r=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,l=["string","number","boolean","symbol"],n=e=>l.includes(typeof e),i=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),o=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(r,"\\$1"),"i"),s=(e,t,a)=>{e=e??"";let r=!0;switch(t){case"like":r=null!==e.toString().match(o(a));break;case"likes":r=a.split(/,|,/).some((t=>null!==e.toString().match(o(t))));break;case"in":n(a)&&(a=[a]),Array.isArray(a)&&(r=Array.isArray(e)?a.every((t=>e.includes(t))):a.includes(e));break;case"nin":n(a)&&(a=[a]),Array.isArray(a)&&(r=!(Array.isArray(e)?a.some((t=>e.includes(t))):a.includes(e)));break;case"!=":case"<>":r=(i(e)?e.slice(0,10):e)!=a;break;case"<":r=(i(e)?e.slice(0,10):e)<a;break;case"<=":r=(i(e)?e.slice(0,10):e)<=a;break;case">":r=(i(e)?e.slice(0,10):e)>a;break;case">=":r=(i(e)?e.slice(0,10):e)>=a;break;default:r=(i(e)?e.slice(0,10):e)==a}return r}},704:(e,t,a)=>{a.d(t,{Z:()=>l});const r=["==","<",">","<=",">=","!=","like","likes","in","nin"],l={isBracketBalance:function(e){let t=0;const a=e.length;for(let r=0;r<a;r++){const a=e.charAt(r);"("===a&&t++,")"===a&&t--}return 0===t},replace_variables:function(e,t){let a="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?a+=" "+e[t]+" ":a+=e[t];const l=a.split(" ").filter((e=>""!==e));for(let e=0;e<l.length;e++)r.includes(l[e])&&("this"!=l[e-1]?l[e-1]=t+"."+l[e-1]:l[e-1]=t),r.includes(l[e])&&(l.splice(e-1,3,`__query__(${l[e-1]}, '${l[e]}', ${l[e+1]})`),e-=2);return l.join(" ")}}},353:(e,t,a)=>{a.d(t,{CD:()=>g,C_:()=>S,EJ:()=>x,HG:()=>s,J1:()=>c,MY:()=>f,Nl:()=>q,Ps:()=>p,Qi:()=>F,RI:()=>i.RI,SX:()=>O,TQ:()=>k,W2:()=>A,ZJ:()=>L,_3:()=>I,bY:()=>C,dN:()=>w,e5:()=>E,gU:()=>m,gn:()=>P,jq:()=>T,p6:()=>_,t2:()=>h,tL:()=>b,tj:()=>v,uf:()=>N,v9:()=>H,vo:()=>y,wE:()=>R,y1:()=>u});var r=a(517),l=a(635),n=a.n(l),i=a(542),o=a(762);const s=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...s(e.children)):t.push(e)})),t},c=e=>e.filter((e=>(e.children&&(e.children=c(e.children)),!e.hidden&&!e.noAuth))),d=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...d(e.children))})),t},u=(e,t)=>e.map((e=>(e.children&&(e.children=u(e.children,t)),null==t||t(e),e))),p=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(e[r].children&&(a=p(e[r].children,t)),a)return a;if(e[r].dataIndex===t)return e[r]}return a},h=e=>{const t=e.children;return t?t[0].children?h(t[0]):t[0]:e},m=e=>{const t=e.children;return t?t[t.length-1].children?m(t[t.length-1]):t[t.length-1]:e},f=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),g=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(e[r].children&&(a=g(e[r].children,t)),a)return a;if(e[r].rowKey===t)return e[r]}return a},b=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...b(e.children))})),t},y=e=>{let t=1;const a=(e,r)=>{if(r&&(e.level=r.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((r=>{e.fixed?r.fixed=e.fixed:delete r.fixed,a(r,e),t+=r.colSpan})),e.colSpan=t}else e.colSpan=e.colSpan??1};e.forEach((e=>{e.level=1,a(e,null)}));const r=[];for(let e=0;e<t;e++)r.push([]);return d(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,r[e.level-1].push(e)})),r},v=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){const r=e.parentNode;if(a.top+=e.offsetTop,a.left+=e.offsetLeft,r&&r!==document.documentElement&&r!==document.body&&(a.top-=r.scrollTop,a.left-=r.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return v(e.offsetParent,t,a)}return a},x=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,E=(e,t)=>(0,r.transform)(e,((e,a,l)=>{(0,r.isEqual)(a,t[l])||(e[l]=(0,i.Kn)(a)&&(0,i.Kn)(t[l])?E(a,t[l]):a)})),C=(e,t)=>(0,r.intersection)(e,t).length===t.length,S=(e,t)=>(0,r.get)(e,t)??"",w=(e,t,a,l)=>{l>=0&&null!=a&&(a=Number(a).toFixed(l)),(0,r.set)(e,t,a??"")},T=(e,t)=>{if(!t.includes("|"))return S(e,t);const a=[];return t.split("|").forEach((t=>{t&&a.push(S(e,t))})),a.join(" | ")},N=e=>{const t=(e=e.toString()).split("."),a="-"===t[0].charAt(0)?"-":"";let r=a?t[0].slice(1):t[0],l="";for(;r.length>3;)l=`,${r.slice(-3)}${l}`,r=r.slice(0,r.length-3);return r&&(l=r+l),`${a}${l}${t[1]?`.${t[1]}`:""}`},I=(e,t)=>e?n()(e,t):null,_=(e,t)=>e?n()(e).format(t):"",R=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}));return e+t},P=e=>{const t=[];if((0,i.l$)(e)){const{children:a}=e.props;Array.isArray(a)?a.forEach((e=>t.push(...P(e)))):a&&t.push(...P(a))}else t.push(e);return t},O=e=>e.filter((e=>!e._group)),A=e=>{const t=[];return Object.keys(e).forEach((a=>{null!==e[a]&&t.push(`${a}|${e[a]}`)})),t.join(",")},k=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a="";if(Array.isArray(e)){let r=0;for(let l=0,n=e.length;l<n;l++){const n=e[l];if(!n.fieldName)continue;const i=Array.isArray(n.condition)?(0,o.A_)(n.condition):(0,o.Pz)(n.condition,"^");a+=`${n.bracketLeft} ${t?`${n.fieldName}|${n.fieldType}`:n.fieldName} ${n.expression} ${i} ${n.bracketRight} ${n.logic} `,r=n.logic.length}a=a.slice(0,-1*r-2)}else{const r=5;for(const r in e){const[l,n]=r.includes("|")?r.split("|"):[r,""],i=e[r];for(const e in i){const r=Array.isArray(i[e])?(0,o.A_)(i[e]):(0,o.Pz)(i[e],"^");"''"!==r&&"[]"!==r&&(a+=`${t?`${l}|${n}`:l} ${e} ${r} and `)}}a=a.slice(0,-1*r)}return a.replace(/\s+/g," ").trim()},H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const a=e=>{const a=[];return t.forEach((t=>a.push(S(e,t)))),a},r={};return e.forEach((e=>{const t=JSON.stringify(a(e));r[t]=r[t]||[],r[t].push(e)})),Object.keys(r).map((e=>r[e]))},F=(e,t)=>{for(let a=0;a<e.length;a++){if(e[a].rowKey===t)return[t];if(Array.isArray(e[a].children)){const r=F(e[a].children,t);if(r)return[e[a].rowKey,r].flat()}}},L=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(a=L(e[r].children,t)),a)return a;if(t(e[r]))return e[r]}return a},q=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&q(e.children,t),t(e)||e.children&&e.children.length)))},635:e=>{e.exports=require("dayjs")},517:e=>{e.exports=require("lodash-es")},787:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__787__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var a=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](a,a.exports,__webpack_require__),a.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Affix:()=>N.Affix,Alert:()=>N.Alert,Anchor:()=>N.Anchor,AutoComplete:()=>N.AutoComplete,Avatar:()=>N.Avatar,BackTop:()=>N.BackTop,Badge:()=>N.Badge,Breadcrumb:()=>N.Breadcrumb,Button:()=>N.Button,Calendar:()=>O,Card:()=>N.Card,Carousel:()=>N.Carousel,Cascader:()=>N.Cascader,Checkbox:()=>N.Checkbox,Col:()=>N.Col,Collapse:()=>N.Collapse,Comment:()=>N.Comment,ConfigProvider:()=>N.ConfigProvider,DatePicker:()=>H,Descriptions:()=>N.Descriptions,Divider:()=>N.Divider,Drawer:()=>N.Drawer,Dropdown:()=>N.Dropdown,Empty:()=>N.Empty,Form:()=>N.Form,Grid:()=>N.Grid,Image:()=>N.Image,Input:()=>N.Input,InputNumber:()=>N.InputNumber,Layout:()=>N.Layout,List:()=>N.List,Mentions:()=>N.Mentions,Menu:()=>N.Menu,Modal:()=>N.Modal,PageHeader:()=>N.PageHeader,Pagination:()=>N.Pagination,Popconfirm:()=>N.Popconfirm,Popover:()=>N.Popover,Progress:()=>N.Progress,QmAnchor:()=>gt,QmButton:()=>J,QmCollapse:()=>Ee,QmConfigProvider:()=>B,QmCopyToClipboard:()=>Ho,QmCountup:()=>Be,QmCropper:()=>wn,QmDivider:()=>pe,QmDownload:()=>nt,QmDrawer:()=>Nt,QmEmpty:()=>Ze,QmForm:()=>Zl,QmModal:()=>At,QmPrint:()=>ws,QmRangeTableHelper:()=>os,QmSearchHelper:()=>Go,QmSearchTree:()=>Bn,QmSpace:()=>ne,QmSpin:()=>Qe,QmSplit:()=>Me,QmTable:()=>zo,QmTabs:()=>Ct,QmTinymce:()=>vn,QmTreeHelper:()=>as,QmTreeTableHelper:()=>es,QmUploadFile:()=>_n,QmUploadImg:()=>Fn,Radio:()=>N.Radio,Rate:()=>N.Rate,Result:()=>N.Result,Row:()=>N.Row,Select:()=>N.Select,Skeleton:()=>N.Skeleton,Slider:()=>N.Slider,Space:()=>N.Space,Spin:()=>N.Spin,Statistic:()=>N.Statistic,Steps:()=>N.Steps,Switch:()=>N.Switch,Tabs:()=>N.Tabs,Tag:()=>N.Tag,TimePicker:()=>D,Timeline:()=>N.Timeline,Tooltip:()=>N.Tooltip,Transfer:()=>N.Transfer,Tree:()=>N.Tree,TreeSelect:()=>N.TreeSelect,Typography:()=>N.Typography,Upload:()=>N.Upload,message:()=>N.message,notification:()=>N.notification,pinyin:()=>Xr,version:()=>Ts});var e=__webpack_require__(787),t=__webpack_require__.n(e);const a=require("prop-types");var r=__webpack_require__.n(a);const l=(0,e.createContext)({locale:"zh-cn",size:"middle"});var n=__webpack_require__(635),i=__webpack_require__.n(n);const o={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?"},divider:{collect:"收起",spread:"展开"},dialog:{fullScreen:"全屏",cancelFullScreen:"取消全屏",close:"关 闭",confirm:"确 定",cancel:"取 消"},form:{search:"搜 索",reset:"重 置",save:"保 存",spread:"展开",collect:"收起",trueText:"是",falseText:"否",draggable:"拖动排序",requiredTips:"不能为空",searchHelperTips:"搜索帮助正在加载值",inputPlaceholder:"请输入...",selectPlaceholder:"请选择...",treePlaceholder:"树节点过滤",rangeInputNumberPlaceholder:["开始值","结束值"],rangeSearchHelper:["起始位置","结束位置"],datePlaceholder:"选择日期",timePlaceholder:"选择时间",weekPlaceholder:"选择周",monthPlaceholder:"选择月",quarterPlaceholder:"选择季度",yearPlaceholder:"选择年",daterangePlaceholder:["开始日期","结束日期"],timerangePlaceholder:["开始时间","结束时间"],monthrangePlaceholder:["开始月份","结束月份"],yearrangePlaceholder:["开始年份","结束年份"],datePickers:["今天","昨天","一周前","一个月前"],dateRangePickers:["最近一周","最近一个月","最近三个月","最近六个月"],citySelectType:["按省份","按城市"],regionSelectLabel:["省","市","区","街道"],validatePrompt:"表单校验提示"},clipboard:{success:"复制成功",error:"复制失败"},download:{text:"下载",success:"文件下载成功",error:"文件下载失败!"},upload:{tooltip:"只能上传 {type} 格式",notType:"不支持的文件类型 {type}",sizeLimit:"大小不能超过 {size}M",uploadError:"文件上传失败!",downError:"文件下载失败!",text:"点击上传"},uploadCropper:{dragableText:"拖放或点击",tooltip:"只能上传 {type} 格式的图片",preview:"图片预览",cropper:"图片裁剪",uploadError:"图片上传失败!",downError:"图片下载失败!",text:"上传图片",zoomIn:"放大",zoomOut:"缩小",rotatePlus:"顺时针",rotateSubtract:"逆时针"},print:{preview:"打印预览",pageSetting:"页面设置",printError:"打印失败!",exportError:"导出失败!",defaultPrinter:"默认打印机",laserPrinter:"激光打印机",stylusPrinter:"针式打印机",printer:"打印机",type:"类型",copies:"份数",printPage:["打印第","几页"],setting:"设置",export:"导出",print:"打印",scale:"缩放",paper:"纸张",pageNumber:"页码",pagination:"第{currentPage}页 / 共{totalPage}页",setPanel:{printParameter:"打印参数",pagerType:"纸张类型",carbonPaper:"三联复写纸(针式)",printDirection:"打印方向",vertical:"纵向",horizontal:"横向",doublePrint:"双面打印",autoDoublePrint:"自动双面打印",manualDoublePrint:"手动双面打印",fixedLogo:"固定Logo",printMargin:"打印边距",leftMargin:"左边距",rightMargin:"右边距",topMargin:"上边距",bottomMargin:"下边距",sizeUnit:"厘米",noEmpty:"不能为空"}},split:{resize:"拖动改变大小"},searchHelper:{text:"搜索帮助",orderIndex:"序号",rangeStartTip:"起始位置不能大于结束位置",rangeEndTip:"结束位置不能小于起始位置"},table:{config:{selectionText:"选择",summaryText:"合计",copyText:"复制",emptyText:"暂无数据..."},alert:{total:"共 {total} 条",selected:"已选择 {total} 项",clear:"清空"},selection:{all:"全选所有",invert:"反选所有",clear:"清空所有",currentPage:"当前页全选"},columnFilter:{text:"列定义",reset:"重置",draggable:"拖动排序",fixedLeft:"固定左侧",fixedRight:"固定右侧",cancelFixed:"取消固定"},editable:{inputPlaceholder:"请输入",selectPlaceholder:"请选择",datePlaceholder:"选择日期",datetimePlaceholder:"选择时间"},sorter:{text:"排序",asc:"升序",desc:"降序"},filter:{search:"搜 索",reset:"重 置",searchText:"搜索{text}",searchAreaText:"搜索{text},用逗号隔开",gtPlaceholder:"大于",ltPlaceholder:"小于",eqPlaceholder:"等于",neqPlaceholder:"不等于",text:"筛选"},screen:{full:"全屏",cancelFull:"取消全屏"},import:{text:"导 入",textNoSpace:"导入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",textNoSpace:"导出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式",warnText:"暂无表格数据或正在导出"},clipboard:{text:"粘 贴",textNoSpace:"粘贴",success:"成功粘贴 {total} 条记录",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},mergeCell:{cancel:"恢复",confirm:"合并"},print:{text:"打印"},refresh:{text:"刷新"},toolbox:{text:"工具箱"},selectCollection:{text:"行选集合",settingTitle:"行选列表",closeButton:"关 闭"},groupSummary:{text:"汇总",settingTitle:"汇总设置",savedSetting:"保存的汇总设置",saveButton:"保 存",closeButton:"关 闭",confirmButton:"显示汇总",removeText:"移除",configText:"配置名称",resultText:"汇总结果",sumText:"列值汇总",maxText:"列最大值",minText:"列最小值",avgText:"列平均值",countText:"条数汇总",operation:"操作",index:"序号",groupItem:"分组项",summaryColumn:"汇总列",calcFormula:"计算公式"},highSearch:{text:"高级检索",settingTitle:"高级检索设置",searchButton:"开始检索",closeButton:"关 闭",removeText:"移除",andText:"并且",orText:"或者",gtText:"大于",ltText:"小于",gteText:"大于等于",lteText:"小于等于",eqText:"等于",neqText:"不等于",inText:"包含",ninText:"不包含",likeText:"模糊匹配",configText:"配置名称",saveButton:"保 存",savedSetting:"保存的高级检索设置",operation:"操作",bracket:"括号",fieldName:"字段名",fieldType:"字段类型",expression:"运算",condition:"条件值",logic:"逻辑",noEmpty:"字段名不能为空"},fastSearch:{text:"数据定位查找",settingTitle:"数据定位查找设置",closeButton:"关 闭",savedSetting:"保存的数据查找设置",queryCondition:"请输入查询条件",notMatch:"没有符合条件的记录!",toTheEnd:"已查找到表格末尾,是否从头开始查找?",toStart:"已查找到表格开始,是否从末尾开始查找",tabPanes:["查找条件","更多条件"],matchCase:"大小写匹配",matchFullchar:"全字符匹配",clear:"清空条件",queryPrev:"查找上一个",queryNext:"查找下一个"}}}};require("dayjs/locale/zh-cn");let s=o;function c(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,a)=>t[a])):e}const d=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];const[r,l]=t;let n;const i=r.split(".");let o=s;for(let e=0,t=i.length;e<t;e++){if(n=o[i[e]],e===t-1)return c(n,l);if(!n)return"";o=n}return""},u=e=>{s=e||s,s.name&&i().locale(s.name)};class p extends Error{constructor(e){super(e),this.name="QmDesignError"}}function h(e,t){throw new p(`[${e}] ${t}`)}function m(e,t){console.warn(new p(`[${e}] ${t}`))}const f=e=>["","small","middle","large"].includes(e),g=require("dayjs/plugin/localeData");var b=__webpack_require__.n(g);const y=require("dayjs/plugin/advancedFormat");var v=__webpack_require__.n(y);const x=require("dayjs/plugin/customParseFormat");var E=__webpack_require__.n(x);const C=require("dayjs/plugin/quarterOfYear");var S=__webpack_require__.n(C);const w=require("dayjs/plugin/weekOfYear");var T=__webpack_require__.n(w);i().extend(b()),i().extend(v()),i().extend(E()),i().extend(S()),i().extend(T());const N=require("antd"),I=require("rc-picker/es/generate/dayjs");var _=__webpack_require__.n(I);const R=require("antd/es/calendar/generateCalendar");var P=__webpack_require__.n(R);require("antd/es/calendar/style");const O=P()(_()),A=require("antd/es/date-picker/generatePicker");var k=__webpack_require__.n(A);require("antd/es/date-picker/style/index");const H=k()(_());function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},F.apply(this,arguments)}const L=e.forwardRef(((t,a)=>e.createElement(H,F({},t,{picker:"time",mode:void 0,ref:a}))));L.displayName="TimePicker";const q=e.forwardRef(((t,a)=>e.createElement(H.RangePicker,F({},t,{picker:"time",mode:void 0,ref:a}))));q.displayName="RangePicker",L.RangePicker=q;const D=L,$={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?"},divider:{collect:"Collapse",spread:"Expand"},dialog:{fullScreen:"Full Screen",cancelFullScreen:"Cancel Full Screen",close:"Close",confirm:"Confirm",cancel:"Cancel"},form:{search:"Search",reset:"Reset",save:"Save",spread:"Expand",collect:"Collapse",trueText:"Yes",falseText:"No",draggable:"Drag and sort",requiredTips:" is required",searchHelperTips:"Search Helper is loading value",inputPlaceholder:"Please enter...",selectPlaceholder:"Please select...",treePlaceholder:"Tree node filter",rangeInputNumberPlaceholder:["Start value","End value"],rangeSearchHelper:["Start","End"],datePlaceholder:"Select date",timePlaceholder:"Select time",weekPlaceholder:"Select week",monthPlaceholder:"Select month",quarterPlaceholder:"Select quarter",yearPlaceholder:"Select year",daterangePlaceholder:["Start date","End date"],timerangePlaceholder:["Start time","End time"],monthrangePlaceholder:["Start month","End month"],yearrangePlaceholder:["Start year","End year"],datePickers:["Today","Yesterday","A Week Ago","A Month Ago"],dateRangePickers:["Nearly A Week","Nearly A Month","Nearly Three Months","Nearly Six Months"],citySelectType:["Province","City"],regionSelectLabel:["Province","City","Region","Street"],validatePrompt:"Form validation tips"},clipboard:{success:"Copy successful",error:"Copy failed"},download:{text:"Download",success:"File downloaded successfully",error:"File download failed!"},upload:{tooltip:"Can only upload {type} format",notType:"Unsupported file types {type}",sizeLimit:"Size cannot exceed {size}M",uploadError:"Failed to upload files!",downError:"File download failed!",text:"click and upload"},uploadCropper:{dragableText:"Drop or click",tooltip:"Can only upload {type} format",preview:"Preview image",cropper:"Cropper image",uploadError:"Failed to upload images!",downError:"Image download failed!",text:"Upload image",zoomIn:"Zoom in",zoomOut:"Zoom out",rotatePlus:"Rotate plus",rotateSubtract:"Rotate subtract"},print:{preview:"Print preview",pageSetting:"Page setting",printError:"Print failed!",exportError:"Export failed!",defaultPrinter:"Default printer",laserPrinter:"Laser printer",stylusPrinter:"Stylus printer",printer:"Printer",type:"Type",copies:"Copies",printPage:["Print","page"],setting:"Setting",export:"Export",print:"Print",scale:"Scale",paper:"Paper",pageNumber:"Number",pagination:"{currentPage} / {totalPage} page",setPanel:{printParameter:"Print parameter",pagerType:"Pager type",carbonPaper:"Triple carbon paper(stylus)",printDirection:"Print direction",vertical:"Vertical",horizontal:"Horizontal",doublePrint:"Double print",autoDoublePrint:"Auto double print",manualDoublePrint:"Manual double print",fixedLogo:"Fixed Logo",printMargin:"Print margin",leftMargin:"Left margin",rightMargin:"Light margin",topMargin:"Top margin",bottomMargin:"Bottom margin",sizeUnit:"cm",noEmpty:"Can not be empty"}},split:{resize:"Drag to change size"},searchHelper:{text:"Search helper",orderIndex:"Index",rangeStartTip:"Start position cannot be greater than end position",rangeEndTip:"End position cannot be less than start position"},table:{config:{selectionText:"#",summaryText:"Summation",copyText:"Copy",emptyText:"No Data..."},alert:{total:"Total {total} items",selected:"Selected {total}",clear:"Clear"},selection:{all:"Select all",invert:"Invert select",clear:"Clear all",currentPage:"Select all on current page"},columnFilter:{text:"Define",reset:"Reset",draggable:"Drag and sort",fixedLeft:"Fixed left",fixedRight:"Fixed right",cancelFixed:"Cancel fixed"},editable:{inputPlaceholder:"Please input",selectPlaceholder:"Please select",datePlaceholder:"Select date",datetimePlaceholder:"Select time"},sorter:{text:"Sort",asc:"Ascending",desc:"Descending"},filter:{search:"Search",reset:"Reset",searchText:"Search {text}",searchAreaText:"Search {text}, separated by commas",gtPlaceholder:"is greater than",ltPlaceholder:"is lesser than",eqPlaceholder:"is equal to",neqPlaceholder:"is not equal to",text:"Filter"},screen:{full:"Full Screen",cancelFull:"Cancel Full Screen"},import:{text:"Import",textNoSpace:"Import",success:"Successfully imported {total} records",error:"Import failed, please check that the field name and data format are correct.",settingTitle:"Import setting",importType:"Import type",insertPos:"Insertion position",fillText:"fill",addText:"add",insertText:"insert"},export:{text:"Export",textNoSpace:"Export",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style",warnText:"No table data or exporting"},clipboard:{text:"Paste",textNoSpace:"Paste",success:"Successfully paste {total} records",settingTitle:"Paste setting",rowIndex:"Start row index",colIndex:"Start col index",content:"content",placeholder:"Please paste data here with ctrl+v",supportText:"Note: only excel data can be pasted"},mergeCell:{cancel:"reset",confirm:"merge"},print:{text:"Print"},refresh:{text:"Reload"},toolbox:{text:"Tool box"},selectCollection:{text:"Selected row collection",settingTitle:"Selected row list",closeButton:"Close"},groupSummary:{text:"Summary",settingTitle:"Summary setting",savedSetting:"Saved configuration",saveButton:"Save",closeButton:"Close",confirmButton:"Show summary",removeText:"Remove",configText:"Configuration name",resultText:"Summary result",sumText:"column value summary",maxText:"column max value",minText:"column min value",avgText:"column avg value",countText:"records summary",operation:"Operation",index:"Index",groupItem:"Group item",summaryColumn:"Summary column",calcFormula:"Calculate formula"},highSearch:{text:"Super search",settingTitle:"Super search setting",searchButton:"Start search",closeButton:"Close",removeText:"Remove",andText:"and",orText:"or",gtText:"is greater than",ltText:"is lesser than",gteText:"is equal or greater than",lteText:"is equal or lesser than",eqText:"is equal to",neqText:"is not equal to",inText:"include",ninText:"not include",likeText:"fuzzy matching",configText:"Configuration name",saveButton:"Save",savedSetting:"Saved configuration",operation:"Operation",bracket:"Bracket",fieldName:"Field name",fieldType:"Field type",expression:"Expression",condition:"Condition value",logic:"Logic",noEmpty:"Can not be empty"},fastSearch:{text:"Records location search",settingTitle:"Records location search setting",closeButton:"Close",savedSetting:"Saved configuration",queryCondition:"Please enter query condition",notMatch:"There are no qualified records!",toTheEnd:"It has been found to the end. Do you want to find it from the beginning?",toStart:"The start has been found. Do you want to start from the end?",tabPanes:["Search condition","More conditions"],matchCase:"Case matching",matchFullchar:"Full character matching",clear:"Clear condition",queryPrev:"Find previous",queryNext:"Find next"}}}},M=require("antd/lib/locale/zh_CN");var K=__webpack_require__.n(M);const V=require("antd/lib/locale/en_GB");function U(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const j={[$.name]:{qm:$,antd:__webpack_require__.n(V)()},[o.name]:{qm:o,antd:K()}};class z extends e.Component{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},u(j[e.locale].qm)}static getDerivedStateFromProps(e,t){const{locale:a,size:r}=t.value,{locale:l,size:n}=e;return l!==a&&u(j[l].qm),l!==a||n!==r?{value:Object.assign({},t.value,{locale:l,size:n})}:null}render(){const{global:e}=this.props,{value:a}=this.state;return t().createElement(l.Provider,{value:a},t().createElement(N.ConfigProvider,{locale:j[a.locale].antd,componentSize:a.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}U(z,"propTypes",{locale:r().string,size:(e,t,a)=>{if(!f(e[t]||""))return h("Divider","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},theme:r().string,global:r().object}),U(z,"defaultProps",{locale:"zh-cn",size:"middle",global:{}});const B=z,W=require("omit.js");var G=__webpack_require__.n(W),Y=__webpack_require__(542);function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Z.apply(this,arguments)}function X(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Q extends e.Component{constructor(){super(...arguments),X(this,"state",{isLoading:!1}),X(this,"clickHandle",(async()=>{this.setState({isLoading:!0});try{var e,t;await(null===(e=(t=this.props).click)||void 0===e?void 0:e.call(t))}catch(e){m("Button","`click`方法执行出错")}this.setState({isLoading:!1})}))}render(){const{size:e,loading:a,authConfig:r,click:l,confirm:n}=this.props,{isLoading:i}=this.state,o=e||this.context.size||"",s=(0,Y.mf)(l)?{onClick:this.clickHandle}:null,c={...G()(this.props,["authConfig","click","confirm"]),size:o,loading:i||a||!1,...s};if(r){const{visible:e=1,disabled:t}=r||{};if(!e)return null;t&&(c.disabled=!0)}return n?t().createElement(N.Popconfirm,{title:n.title||d("qm.button.confirmTitle"),disabled:c.disabled,onConfirm:e=>{var t,a;null===(t=n.onConfirm)||void 0===t||t.call(n),null===(a=c.onClick)||void 0===a||a.call(c,e)},onCancel:e=>{var t;null===(t=n.onCancel)||void 0===t||t.call(n,e)}},t().createElement(N.Button,Z({},c,{onClick:Y.ZT}),this.props.children)):t().createElement(N.Button,c,this.props.children)}}X(Q,"propTypes",{click:r().func,confirm:r().shape({title:r().node,onConfirm:r().func,onCancel:r().func})}),X(Q,"contextType",l);const J=Q;var ee,te,ae,re;!function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(ee||(ee={}));class le extends e.Component{render(){const{size:e}=this.props,a=e||this.context.size||"",r=(0,Y.hj)(e)?e:ee[e||a||"default"],l={...this.props,size:r};return t().createElement(N.Space,l,this.props.children)}}re=l,(ae="contextType")in(te=le)?Object.defineProperty(te,ae,{value:re,enumerable:!0,configurable:!0,writable:!0}):te[ae]=re;const ne=le,ie=require("classnames");var oe=__webpack_require__.n(ie);const se=e=>`qm-${e}`,ce=require("@ant-design/icons");function de(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ue extends e.Component{constructor(){super(...arguments),de(this,"clickHandle",(()=>{const{collapse:e,onCollapseChange:t=Y.ZT}=this.props;t(!e)}))}render(){const{size:e,label:a,extra:r,collapse:l,disabled:n,className:i,style:o,id:s}=this.props,c=e||this.context.size||"",u=se("divider"),p={[u]:!0,[`${u}--lg`]:"large"===c,[`${u}--sm`]:"small"===c};return t().createElement("div",{id:s,className:oe()(p,i),style:o},t().createElement("span",{className:oe()(`${u}__title`)},a),t().createElement("div",{className:oe()(`${u}__extra`)},r),void 0!==l&&t().createElement(N.Button,{type:"link",className:oe()(`${u}__collapse`),disabled:n,onClick:this.clickHandle},d(l?"qm.divider.collect":"qm.divider.spread"),l?t().createElement(ce.UpOutlined,null):t().createElement(ce.DownOutlined,null)))}}de(ue,"propTypes",{label:r().string,size:(e,t,a)=>{if(!f(e[t]||""))return h("Divider","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},extra:r().oneOfType([r().element,r().string]),collapse:r().bool}),de(ue,"contextType",l);const pe=ue,he=()=>({height:0,opacity:0}),me=(e,t)=>"height"===t.propertyName,fe={motionName:"rc-collapse-motion",onEnterStart:he,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:he,onEnterEnd:me,onLeaveEnd:me,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"},ge=require("rc-motion");var be=__webpack_require__.n(ge);const ye=t().forwardRef(((e,a)=>{const{forceRender:r,className:l,style:n,boxStyle:i,isActive:o}=e,[s,c]=t().useState(o||r);if(t().useEffect((()=>{(r||o)&&c(!0)}),[r,o]),!s)return null;const d=se("collapse");return t().createElement("div",{ref:a,className:oe()(`${d}-content`,{[`${d}-content-active`]:o,[`${d}-content-inactive`]:!o},l),style:n},t().createElement("div",{className:`${d}-content-box`,style:i},e.children))}));ye.displayName="PanelContent";const ve=ye;function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},xe.apply(this,arguments)}const Ee=e=>{const{defaultActive:a,label:r,extra:l,className:n,style:i,containerStyle:o,disabled:s,forceRender:c,destroyOnClose:d=!1,onChange:u}=e,[p,h]=t().useState(!!a),m=se("collapse"),f=oe()({[`${m}`]:!0,[`${m}-active`]:p,[`${m}-disabled`]:s},n);return t().createElement("div",{className:f,style:i},t().createElement(pe,{label:r,extra:l,collapse:p,disabled:s,onCollapseChange:e=>{h(e),null==u||u(e)}}),t().createElement(be(),xe({visible:p},fe,{leavedClassName:`${m}-content-hidden`,forceRender:c,removeOnLeave:d}),((a,r)=>{let{className:l,style:n}=a;return t().createElement(ve,{ref:r,prefixCls:m,className:l,style:n,boxStyle:o,isActive:p,forceRender:c},e.children)})))},Ce=t().createContext(void 0);function Se(t,a){const r=e.useRef(!1);e.useEffect((()=>{r.current?t():r.current=!0}),a)}const we=require("react-draggable");var Te=__webpack_require__.n(we),Ne=__webpack_require__(386);const Ie=(e,t,a)=>{e&&t&&a&&e.addEventListener(t,a,!1)},_e=(e,t,a)=>{e&&t&&a&&e.removeEventListener(t,a,!1)},Re=e=>e.stopPropagation(),Pe=e=>e.preventDefault(),Oe=(e,t,a)=>{!Ne.Z&&e&&t&&((0,Y.Kn)(t)?Object.keys(t).forEach((a=>{Oe(e,a,t[a])})):(t=(0,Y._A)(t),e.style[t]=a))},Ae=e=>{let t=0,a=e;for(;a;)t+=a.offsetTop,a=a.offsetParent;return t},ke=(e,t)=>{let a=e;for(;a;){var r;if(null!==(r=a.classList)&&void 0!==r&&r.contains(t))return a;a=a.parentNode}return null},He=e=>{const{minValues:a,onDragChange:r,onDragging:l}=e,{splitRef:n,direction:i}=t().useContext(Ce),[o,s]=t().useState(),[c,u]=t().useState(0),p="vertical"===i?"y":"x",h={[`${se("split")}__resize-bar`]:!0,vertical:"vertical"===i,horizontal:"horizontal"===i};return t().createElement(Te(),{bounds:o,axis:p,position:{x:0,y:0},positionOffset:{[p]:-1*c},onStart:()=>{r(!0),(()=>{const e=n.current.children[0];if(!e)return;const t=(()=>{const{w:e,h:t}={w:n.current.offsetWidth,h:n.current.offsetHeight};return[a[0],("vertical"===i?t:e)-a[1]]})(),r=e.offsetWidth,l=e.offsetHeight;s({left:t[0]-r,right:t[1]-r,top:t[0]-l,bottom:t[1]-l})})()},onDrag:(e,t)=>{u(t[p]),l(t[p])},onStop:()=>r(!1)},t().createElement("div",{className:oe()(h),title:d("qm.split.resize")}))};He.displayName="ResizeBar";const Fe=He,Le=t().forwardRef(((e,a)=>{const{offset:r,className:l,style:n}=e,{direction:i,dragging:o}=t().useContext(Ce),s="vertical"===i?"height":"width",c={[se("split-pane")]:!0,isLocked:o,horizontal:"horizontal"===i,vertical:"vertical"===i,[l]:!!l},d=void 0!==r?{[s]:(0,Y.PM)(r)}:{flex:1,[s]:0};return t().createElement("div",{ref:a,className:oe()(c),style:{...d,...n}},e.children)}));Le.displayName="QmSplitPane";const qe=Le;function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},De.apply(this,arguments)}const $e=e=>{const{direction:a="horizontal",defaultValue:r="50%",uniqueKey:n,className:i,style:o,onDragStart:s,onDrag:c=Y.ZT,onDragEnd:d}=e,{global:u}=t().useContext(l),p=t().useRef(null),h=t().useRef(null),m=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,f=e=>Number.parseInt(e,10),g=e=>{var t;const a=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return a>=0?a:0},b=t().useMemo((()=>n?`split_${n}`:""),[n]),[y,v]=t().useState(!1),[x,E]=t().useState(m(r)),C=t().useRef(0);Se((()=>{y?(C.current="vertical"===a?h.current.offsetHeight:h.current.offsetWidth,null==s||s(f(x))):(null==d||d(f(x)),localStorage.setItem(b,x),T(b,x))}),[y]),t().useEffect((()=>{S()}),[]);const S=()=>{if(!b)return;const e=localStorage.getItem(b);e?E(m(e)):w(b).then((e=>{localStorage.setItem(b,m(e||r)),S()})).catch((()=>{}))},w=async e=>{const t=null==u?void 0:u.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}},T=async(e,t)=>{const a=null==u?void 0:u.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}},N=t().useMemo((()=>({splitRef:p,direction:a,dragging:y})),[a,y]),I=[];t().Children.map(e.children,(e=>{var t;(0,Y.l$)(e)&&!(0,Y.M2)(e)&&"QmSplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&I.push(e)}));const[_,R]=I,P=t().useMemo((()=>[g(_),g(R)]),[_,R]),O={[se("split")]:!0,vertical:"vertical"===a};return t().createElement(Ce.Provider,{value:N},t().createElement("div",{ref:p,className:oe()(O,i),style:o},t().createElement(qe,De({},_.props,{ref:h,offset:x})),t().createElement(Fe,{minValues:P,onDragChange:e=>v(e),onDragging:e=>{const t=C.current+e;E(`${t}px`),c(t)}}),t().createElement(qe,R.props)))};$e.Pane=qe,$e.displayName="QmSplit";const Me=$e,Ke=require("react-countup");var Ve=__webpack_require__.n(Ke);function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ue.apply(this,arguments)}function je(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ze extends e.Component{render(){const{size:e,className:a,style:r}=this.props,l=e||this.context.size||"",n=se("countup"),i={[n]:!0,[`${n}--lg`]:"large"===l,[`${n}--sm`]:"small"===l};return t().createElement(Ve(),Ue({},this.props,{className:oe()(i,a),style:r}),this.props.children)}}je(ze,"defaultProps",{duration:2}),je(ze,"contextType",l);const Be=ze;function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},We.apply(this,arguments)}function Ge(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Ye extends e.Component{render(){const{size:e,className:a}=this.props,r=e||this.context.size||"",l=se("empty"),n={...this.props,image:N.Empty.PRESENTED_IMAGE_SIMPLE},i={[l]:!0,[`${l}--lg`]:"large"===r,[`${l}--sm`]:"small"===r};return t().createElement(N.Empty,We({},n,{className:oe()(i,a)}))}}Ge(Ye,"contextType",l),Ge(Ye,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Anchor","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")}});const Ze=Ye;class Xe extends e.Component{render(){const{fullHeight:e,style:a={}}=this.props,r={[`${se("spin")}-full-height`]:e},l={wrapperClassName:oe()(r),...G()(this.props,["fullHeight"]),style:{...a,maxHeight:"none"}};return t().createElement(N.Spin,l,this.props.children)}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Xe,"defaultProps",{tip:"Loading...",fullHeight:!1});const Qe=Xe,Je=require("axios");var et=__webpack_require__.n(Je);const tt=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const a=window.URL.createObjectURL(e);let r=document.createElement("a");r.href=a,r.download=decodeURI(t),r.click(),r=null}};function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},at.apply(this,arguments)}function rt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class lt extends e.Component{constructor(){super(...arguments),rt(this,"state",{loading:!1}),rt(this,"downloadHandle",(async()=>{this.setState({loading:!0});try{var e,t;const{action:a,beforeDownload:r=Y.XT}=this.props,l=(0,Y.HD)(a)?a:await this.getActionUrl();if(!l)return m("Download","参数 `action` 有误!");if(!r(l))return;await this.downloadFile(l),await(0,Y._v)(100),null===(e=(t=this.props).onSuccess)||void 0===e||e.call(t),N.message.success(d("qm.download.success"))}catch(e){var a,r;null===(a=(r=this.props).onError)||void 0===a||a.call(r,e),N.message.error(d("qm.download.error"))}this.setState({loading:!1})}))}async getActionUrl(){const e=this.props.action;if(e.api)try{const t=await e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}async downloadFile(e){const{fileName:t,headers:a,params:r,withCredentials:l}=this.props,n=await et()({url:e,params:r,headers:a,withCredentials:l,responseType:"blob"}),i=n.data,o=n.headers["content-disposition"],s=t||(o?o.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));tt(i,s)}render(){const{size:e}=this.props,{loading:a}=this.state,r=e||this.context.size||"",l=G()(this.props,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return t().createElement(N.Button,at({},l,{size:r,loading:a,onClick:this.downloadHandle}),this.props.children)}}rt(lt,"propTypes",{action:r().oneOfType([r().string,r().shape({api:r().func.isRequired,params:r().object})]),size:(e,t,a)=>{if(!f(e[t]||""))return h("Anchor","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},fileName:r().string,headers:r().object,withCredentials:r().bool,params:r().object,beforeDownload:r().func,onSuccess:r().func,onError:r().func}),rt(lt,"defaultProps",{icon:t().createElement(ce.DownloadOutlined,null),children:d("qm.download.text"),withCredentials:!1}),rt(lt,"contextType",l);const nt=lt,it=require("add-dom-event-listener");var ot=__webpack_require__.n(it);const st=require("scroll-into-view-if-needed");var ct=__webpack_require__.n(st);class dt extends e.Component{renderLabel(){const{activeKey:e,labels:a,onTabClick:r}=this.props;return a.map(((a,l)=>{const n={item:!0,actived:l===e};return t().createElement("div",{key:l,className:oe()(n),onClick:e=>r(l,e)},t().createElement("span",null,a))}))}render(){return t().createElement(t().Fragment,null,this.renderLabel())}}const ut=dt;class pt extends e.Component{render(){const{label:e,showDivider:a,className:r,style:l}=this.props,n={[se("anchor-item")]:!0};return t().createElement("div",{className:oe()(n,r),style:l},a&&t().createElement(pe,{label:e,style:{marginBottom:10}}),this.props.children)}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(pt,"displayName","QmAnchorItem");const ht=pt;function mt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class ft extends e.Component{constructor(){super(...arguments),mt(this,"currentState","ready"),mt(this,"itemsTotal",void 0),mt(this,"timer",void 0),mt(this,"scrollEvent",void 0),mt(this,"scrollRef",(0,e.createRef)()),mt(this,"state",{activeKey:0}),mt(this,"onScrollHandle",(e=>{if("ready"!==this.currentState)return;const t=this.findCurrentIndex(e.target.scrollTop);-1!==t&&this.setState({activeKey:t})})),mt(this,"onTabClickHandle",(e=>{const{labelList:t=[]}=this.props,a=this.__is_conf?document.getElementById(t[e].id):this.scrollRef.current.children[e];a&&(this.setState({activeKey:e}),this.currentState="stop",this.timer&&clearTimeout(this.timer),ct()(a,{block:"start",behavior:"smooth",boundary:this.scrollRef.current}),this.timer=setTimeout((()=>this.currentState="ready"),500))})),mt(this,"SCROLL_TO_ITEM",(e=>{e=(e=e<0?0:e)>this.itemsTotal?this.itemsTotal:e,this.onTabClickHandle(e)}))}get __is_conf(){var e;return!(null===(e=this.props.labelList)||void 0===e||!e.length)}componentDidMount(){this.scrollEvent=ot()(this.scrollRef.current,"scroll",(0,Y.P2)(this.onScrollHandle,60))}componentWillUnmount(){this.scrollEvent.remove()}createDistances(){var e;const{labelList:t=[]}=this.props;return(this.__is_conf?t.map((e=>document.getElementById(e.id))):Array.from((null===(e=this.scrollRef.current)||void 0===e?void 0:e.children)||[])).map((e=>((e,t)=>Math.abs(Ae(e)-Ae(t)))(e,this.scrollRef.current)))}findCurrentIndex(e){const t=Math.abs(e),a=this.createDistances();let r=-1;for(let e=0;e<a.length;e++){const l=a[e],n=a[e+1]||1e4;t>=l-1&&t<n&&(r=e)}return r}render(){const{activeKey:e}=this.state,{size:a,labelWidth:r,tabPosition:l,labelList:n=[],className:i,style:o}=this.props,s=a||this.context.size||"",c=se("anchor"),d={[c]:!0,[`${c}-left`]:"left"===l,[`${c}-top`]:"top"===l,[`${c}--lg`]:"large"===s,[`${c}--sm`]:"small"===s},u=[];t().Children.map(this.props.children,(e=>{var t;(0,Y.l$)(e)&&!(0,Y.M2)(e)&&"QmAnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&u.push(e)}));const p=this.__is_conf?n.map((e=>e.label)):u.map((e=>e.props.label));return this.itemsTotal=p.length,t().createElement("div",{className:oe()(d,i),style:o},t().createElement("div",{className:oe()("anchor-nav"),style:{width:r?(0,Y.PM)(r):""}},t().createElement(ut,{activeKey:e,labels:p,onTabClick:this.onTabClickHandle})),t().createElement("div",{ref:this.scrollRef,className:oe()("anchor-container")},this.__is_conf?this.props.children:u))}}mt(ft,"Item",ht),mt(ft,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Anchor","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},labelWidth:(e,t,a)=>{if("number"!=typeof(r=e[t])&&void 0!==r&&!["px","rem","em","vw","vh","%"].some((e=>r.endsWith(e)))&&!r.startsWith("calc"))return h("Anchor","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.");var r},labelList:r().arrayOf(r().shape({id:r().string,label:r().string}))}),mt(ft,"defaultProps",{tabPosition:"left"}),mt(ft,"contextType",l);const gt=ft;class bt extends e.Component{render(){return t().createElement(N.Tabs.TabPane,this.props,this.props.children)}}const yt=bt;function vt(){return vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},vt.apply(this,arguments)}function xt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Et extends e.Component{render(){const{size:e,className:a}=this.props,r=e||this.context.size||"",l=se("tabs"),n={[l]:!0,[`${l}--lg`]:"large"===r,[`${l}--sm`]:"small"===r};return t().createElement(N.Tabs,vt({},this.props,{className:oe()(n,a)}),this.props.children)}}xt(Et,"TabPane",yt),xt(Et,"contextType",l),xt(Et,"defaultProps",{tabBarGutter:10});const Ct=Et;function St(){return St=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},St.apply(this,arguments)}function wt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Tt extends e.Component{constructor(){super(...arguments),wt(this,"titleRef",t().createRef()),wt(this,"$drawer",null),wt(this,"opened",!1),wt(this,"state",{fullscreen:!1,spinning:!1,sloading:!1}),wt(this,"afterVisibleChange",(e=>{const{loading:t}=this.props;var a,r;e?(this.opened=!0,(0,Y.o8)(t)&&setTimeout((()=>this.setState({spinning:!1})),100)):(null===(a=(r=this.props).onClosed)||void 0===a||a.call(r),this.setState({fullscreen:!1}))})),wt(this,"toggleHandle",(()=>{this.$drawer=ke(this.titleRef.current,"ant-drawer-content-wrapper"),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(e=(t=this.props).onFullChange)||void 0===e||e.call(t,this.state.fullscreen)}))})),wt(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),wt(this,"STOP_LOADING",(()=>{this.setState({sloading:!1})}))}componentWillUnmount(){this.$drawer=null}componentDidUpdate(e,t){const{visible:a,loading:r,destroyOnClose:l}=this.props,{fullscreen:n}=this.state;a&&a!==e.visible&&(!l&&this.opened||(0,Y.o8)(r)&&this.setState({spinning:!0})),this.$drawer&&n!==t.fullscreen&&Oe(this.$drawer,n?{width:"100%"}:{width:(0,Y.PM)(this.props.width||"72%")})}renderTitle(){const{fullscreen:e}=this.state,{showFullScreen:a}=this.props;return t().createElement(t().Fragment,null,t().createElement("span",{ref:this.titleRef,className:oe()("text")},this.props.title),a&&t().createElement("span",{className:oe()("full-screen"),onClick:this.toggleHandle},t().createElement(e?ce.FullscreenExitOutlined:ce.FullscreenOutlined)))}render(){const{spinning:e,sloading:a}=this.state,{size:r,className:l,loading:n,maskClosable:i,onClose:o}=this.props,s=this.context.global,c=r||this.context.size||"",d=se("drawer"),u={[d]:!0,[`${d}--lg`]:"large"===c,[`${d}--sm`]:"small"===c};return t().createElement(N.Drawer,St({},G()(this.props,["size","showFullScreen","loading","maskClosable","onClosed"]),{maskClosable:i??(null==s?void 0:s.maskClosable)??!1,className:oe()(u,l),title:this.renderTitle(),footer:null,onClose:o,afterVisibleChange:this.afterVisibleChange}),this.props.children,(n||a||e)&&t().createElement(Qe,{spinning:!0,className:oe()(`${d}-spin`)}))}}wt(Tt,"contextType",l),wt(Tt,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Drawer","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},spinning:r().bool}),wt(Tt,"defaultProps",{width:"72%",showFullScreen:!0,destroyOnClose:!0,footer:null});const Nt=Tt;function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},It.apply(this,arguments)}function _t(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const Rt="10vh";var Pt;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small"}(Pt||(Pt={}));class Ot extends e.Component{constructor(){super(...arguments),_t(this,"$event",null),_t(this,"draggleRef",t().createRef()),_t(this,"opened",!1),_t(this,"state",{fullscreen:!1,spinning:!1,sloading:!1,disabled:!0,bounds:{left:0,top:0,bottom:0,right:0},position:void 0}),_t(this,"addMouseDownEvent",(()=>{this.$event||(this.$event=ot()(document.body,"mousedown",Re))})),_t(this,"removeMouseDownEvent",(()=>{var e;this.$event&&(null===(e=this.$event)||void 0===e||e.remove(),this.$event=null)})),_t(this,"onStart",((e,t)=>{const{clientWidth:a,clientHeight:r}=window.document.documentElement,l=this.draggleRef.current.getBoundingClientRect();l&&this.setState({bounds:{left:-l.left+t.x,right:a-(l.right-t.x)-1,top:-l.top+t.y,bottom:r-(l.bottom-t.y)-1}})})),_t(this,"toggleHandle",(e=>{const t=ke(e.target,"ant-modal");if(!t)return;const a=t.querySelector(".ant-modal-body"),{height:r}=this.props,{fullscreen:l}=this.state;l?(Oe(t,{width:(0,Y.PM)(this.props.width||"60%"),height:"auto",top:Rt}),Oe(a,{height:r?(0,Y.PM)(r):this.defaultHeight,maxHeight:"auto"===r?this.defaultHeight:""})):(Oe(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Oe(a,{height:`calc(100vh - ${Pt[this.$size]}px)`,maxHeight:""})),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(e=(t=this.props).onFullChange)||void 0===e||e.call(t,this.state.fullscreen)}))})),_t(this,"afterVisibleChange",(()=>{const{onClosed:e}=this.props;null==e||e(),this.setState({fullscreen:!1})})),_t(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),_t(this,"STOP_LOADING",(()=>{this.setState({sloading:!1})}))}get $size(){const{size:e}=this.props;return e||this.context.size||""}get defaultHeight(){return`calc(100vh - 10vh - 10vh - ${Pt[this.$size]}px)`}componentDidUpdate(e,t){const{visible:a,loading:r,stopMouseDownEvent:l,destroyOnClose:n}=this.props,{fullscreen:i}=this.state;if(a&&a!==e.visible){if(!n&&this.opened||(0,Y.o8)(r)&&this.setState({spinning:!0}),l&&this.addMouseDownEvent(),!n&&this.opened)return;setTimeout((()=>{this.opened=!0,(0,Y.o8)(r)&&this.setState({spinning:!1})}),400)}a||this.removeMouseDownEvent(),i!==t.fullscreen&&(i?this.setState({position:{x:0,y:0}}):this.setState({position:void 0}))}renderTitle(){const{fullscreen:e,disabled:a}=this.state,{showFullScreen:r}=this.props;return t().createElement("div",{onMouseOver:()=>{a&&this.setState({disabled:!1})},onMouseOut:()=>{this.setState({disabled:!0})}},t().createElement("span",{className:oe()("text")},this.props.title),r&&t().createElement("span",{className:oe()("full-screen"),onClick:this.toggleHandle},t().createElement(e?ce.FullscreenExitOutlined:ce.FullscreenOutlined)))}render(){const{spinning:e,sloading:a,fullscreen:r,disabled:l,bounds:n,position:i}=this.state,{height:o,className:s,loading:c,draggable:d,maskClosable:u,bodyStyle:p,onClose:h}=this.props,m=this.context.global,f=se("modal"),g={height:o?(0,Y.PM)(o):this.defaultHeight,maxHeight:"auto"===o?this.defaultHeight:"",overflow:"auto"},b={[f]:!0,[`${f}--lg`]:"large"===this.$size,[`${f}--sm`]:"small"===this.$size};return t().createElement(N.Modal,It({},G()(this.props,["showFullScreen","loading","maskClosable","stopMouseDownEvent","onClose","onClosed"]),{maskClosable:u??(null==m?void 0:m.maskClosable)??!1,className:oe()(b,s),title:this.renderTitle(),footer:null,bodyStyle:Object.assign({},g,p),onCancel:h,afterClose:this.afterVisibleChange,modalRender:e=>t().createElement(Te(),{disabled:!d||l||r,bounds:n,position:i,onStart:(e,t)=>this.onStart(e,t)},t().createElement("div",{ref:this.draggleRef},e))}),this.props.children,(c||a||e)&&t().createElement(Qe,{spinning:!0,className:oe()(`${f}-spin`)}))}}_t(Ot,"contextType",l),_t(Ot,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Modal","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},spinning:r().bool}),_t(Ot,"defaultProps",{width:"60%",showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:Rt}});const At=Ot,kt=require("memoize-one");var Ht=__webpack_require__.n(kt);const Ft=(0,e.createContext)(void 0),Lt=require("resize-observer-polyfill");var qt=__webpack_require__.n(Lt);const Dt=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];Array.isArray(e)&&e.length&&e.forEach((e=>e(t)))}},$t=function(e,t){!Ne.Z&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new(qt())(Dt),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},Mt=function(e,t){var a;e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||null===(a=e.__ro__)||void 0===a||a.disconnect())},Kt=80,Vt="1",Ut="0",jt=400,zt=["RANGE_INPUT","RANGE_INPUT_NUMBER","RANGE_SEARCH_HELPER","MULTIPLE_CHECKBOX","MULTIPLE_SELECT","RANGE_DATE","RANGE_TIME","MULTIPLE_TREE_SELECT","MULTIPLE_SEARCH_HELPER","MULTIPLE_TREE_TABLE_HELPER","MULTIPLE_CASCADER","UPLOAD_IMG","UPLOAD_FILE"],Bt={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};let Wt,Gt,Yt;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(Wt||(Wt={})),function(e){e.date="YYYY-MM-DD HH:mm:ss",e.datetime="YYYY-MM-DD HH:mm:ss",e.exactdate="YYYY-MM-DD",e.week="YYYY-wo",e.month="YYYY-MM",e.quarter="YYYY-[Q]Q",e.year="YYYY"}(Gt||(Gt={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(Yt||(Yt={}));const Zt={items:r().arrayOf(r().shape({type:r().string.isRequired,fieldName:r().string.isRequired})),initialValues:r().object,initialExtras:r().object,layout:r().oneOf(["horizontal","vertical"]),size:(e,t,a)=>{if(!f(e[t]||""))return h("Form","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},cols:r().number,customClass:r().string,compactMode:r().bool,labelWidth:r().oneOfType([r().number,r().string]),labelAlign:r().oneOf(["left","right"]),labelWrap:r().bool,formType:r().oneOf(["default","search","onlyShow"]),disabled:r().bool,uniqueKey:r().string,defaultRows:r().number,searchButtonCols:r().number,scrollToFirstError:r().bool,authConfig:r().object,isAutoFocus:r().bool,isCollapse:r().bool,isFieldsDefine:r().bool,isSearchBtn:r().bool,isSubmitBtn:r().bool,fieldsChange:r().func,onValuesChange:r().func,onFieldsChange:r().func,onFinish:r().func,onFinishFailed:r().func,onReset:r().func,onCollapse:r().func},Xt={layout:"horizontal",labelWidth:Kt,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:Y.ZT,onFieldsChange:Y.ZT,onFinish:Y.ZT,onFinishFailed:Y.ZT,onReset:Y.ZT,onCollapse:Y.ZT,onFormItemsChange:Y.ZT},Qt=(e,t)=>{if(!e)return null;if(t===Gt.week){const t=e.match(/^(\d{4})-(\d+)/);return t?i()().year(Number(t[1])).week(Number(t[2])):null}if(t===Gt.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?i()().year(Number(t[1])).quarter(Number(t[2])):null}return i()(e,t)},Jt=(e,t)=>e?i()(e).format(t):"",ea=e=>""===e||null==e,ta=(e,t)=>{if(!e)return"";if(!t.includes("|"))return e[t];const a=t.split("|");let r="";for(let t=0,l=a.length;t<l;t++)r+=(e[a[t].trim()]??"")+(t===l-1?"":" | ");return r},aa=(e,t,a)=>{for(const r in a)if(Object.keys(t).includes(r)&&t[r]!==a[r])if(t[r].includes("|")){const l=t[r].split("|"),n=a[r].split("|");l.forEach(((t,a)=>e[t]=e[n[a]]))}else e[t[r]]=e[a[r]]},ra=(e,t,a)=>{for(const r in a)if(Object.keys(t).includes(r)&&t[r]!==a[r])if(t[r].includes("|")){const l=t[r].split("|"),n=a[r].split("|");l.forEach(((t,a)=>e[t]=e[n[a]]))}else e[t[r]]=e[a[r]]},la=(e,t,a)=>e.map((e=>{const r={value:e[t],text:e[a]};return e.disabled&&(r.disabled=!0),e.isLeaf&&(r.isLeaf=!0),Array.isArray(e.children)&&(r.children=la(e.children,t,a)),r})),na=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(a=na(e[r].children,t)),a)return a;if(e[r].value===t)return e[r]}return a},ia=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=[];return e.forEach((e=>{e.value==t.split(",")[a]&&r.push(e),Array.isArray(e.children)&&r.push(...ia(e.children,t,a+1))})),r},oa=e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),sa=(e,t,a,r)=>{var l;const n={};return n.filters=(null===(l=e.filters)||void 0===l?void 0:l.filter((e=>"1"===e.isQuery)).map((e=>{const t={type:e.type,label:e.label,fieldName:e.fieldName,options:{}};return Array.isArray(e.dicData)&&(t.options.itemList=e.dicData),t})))||[],n.table={columns:e.columns||[],rowKey:e.valueName},n.fieldsDefine={valueKey:e.valueKey||e.valueName},n.fieldAliasMap={[r?"textKey":t]:e.displayName[0],[r?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(n.table.fetch={api:a(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(n.echoRequest={fetchApi:a(e.echoSetting.api),formatter:t=>Object.assign({},t,{[e.echoSetting.paramKey]:t.key??t.keys}),dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(n.echoRequest.fieldAliasMap={[r?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(n.tree={fetch:{api:a(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const a={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>a[e.tableField]=e.treeField)),a}}),e.emmediateSetting&&(n.columns=e.emmediateSetting.columns,n.request={fetchApi:a(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),n};var ca=__webpack_require__(517);const da=require("react-sortablejs");function ua(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class pa extends e.Component{get formUniqueKey(){return this.props.uniqueKey?`form_${this.props.uniqueKey}`:""}constructor(e){super(e),ua(this,"linkRef",t().createRef()),ua(this,"state",{visible:!1}),this.initLocalfields()}async getTableFieldsConfig(e){const t=this.context.global,a=null==t?void 0:t.getComponentConfigApi;if(a)try{const t=await a({key:e});if(200===t.code)return t.data}catch(e){}}async saveTableColumnsConfig(e,t){const a=this.context.global,r=null==a?void 0:a.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}}getLocalFields(){if(!this.formUniqueKey)return;const e=JSON.parse(localStorage.getItem(this.formUniqueKey));return e||this.getTableFieldsConfig(this.formUniqueKey).then((e=>{if(!e)return this.setLocalFields(this.props.items);localStorage.setItem(this.formUniqueKey,JSON.stringify(e)),this.initLocalfields()})).catch((()=>{})),e?(0,ca.xor)(e.map((e=>e.fieldName)),this.props.items.map((e=>e.fieldName))).length>0?this.props.items.map((t=>{const{fieldName:a}=t,r=e.find((e=>e.fieldName===a));return r?((0,Y.o8)(r.hidden)||(t.hidden=r.hidden),t):t})):e.map((e=>({...this.props.items.find((t=>t.fieldName===e.fieldName)),...e}))):void 0}setLocalFields(e){if(!this.formUniqueKey)return;const t=e.map((e=>{const t={};return(0,Y.o8)(e.hidden)||(t.hidden=e.hidden),{fieldName:e.fieldName,...t}})),a=JSON.parse(localStorage.getItem(this.formUniqueKey));(0,ca.isEqual)(t,a)||(localStorage.setItem(this.formUniqueKey,JSON.stringify(t)),this.saveTableColumnsConfig(this.formUniqueKey,t))}initLocalfields(){const e=this.getLocalFields();e&&this.changeHandle(e)}changeHandle(e){const{fieldsChange:t}=this.props;null==t||t(e.filter((e=>!e.noAuth)))}popup(){const{items:e}=this.props,a=e.filter((e=>!e.noAuth));return t().createElement(Ft.Consumer,null,(e=>{const r=e.$$form;return t().createElement("div",{className:oe()("ant-dropdown-menu","fields-list")},t().createElement(da.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.fieldName)),l=a.map((e=>e.fieldName));(0,ca.isEqual)(t,l)||(r.setExpandHandle(!0),this.changeHandle(e),this.setLocalFields(e))}},a.map((e=>{var l;return t().createElement("li",{key:e.fieldName,className:"item"},t().createElement(N.Checkbox,{disabled:(null===(l=e.rules)||void 0===l?void 0:l.findIndex((e=>e.required)))>-1,checked:!e.hidden,onChange:t=>{const{checked:r}=t.target;e.hidden=!r,this.changeHandle(a),this.setLocalFields(a)}}),t().createElement(ce.HolderOutlined,{className:"handle",title:d("qm.form.draggable")}),t().createElement("span",{className:"title"},r.getFormItemLabel(e.label||"")))}))))}))}render(){const{visible:e}=this.state,a=se("form-fields-filter");return t().createElement(Ft.Consumer,null,(r=>{const{$size:l}=r.$$form,n={[a]:!0,[`${a}--lg`]:"large"===l,[`${a}--sm`]:"small"===l};return t().createElement(N.Dropdown,{overlayClassName:oe()(n),overlay:this.popup(),trigger:["click"],placement:"bottomRight",overlayStyle:{minWidth:150},getPopupContainer:()=>this.linkRef.current,visible:e,onVisibleChange:e=>{this.setState({visible:e})}},t().createElement("a",{ref:this.linkRef,style:{padding:"5px 0"}},t().createElement(ce.UnorderedListOutlined,null)))}))}}ua(pa,"contextType",l);const ha=pa,ma=e=>{const{value:a,bordered:r}=e;return t().createElement(N.Input,{value:a,title:a,bordered:r,readOnly:!0})};ma.displayName="FormItemView";const fa=ma;function ga(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const ba=t().forwardRef(((e,a)=>{const{$$form:r}=t().useContext(Ft),{value:l,onChange:n,onValuesChange:i}=e,{options:o={},style:s={},placeholder:c=d("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m,onBlur:f=Y.ZT,onEnter:g=Y.ZT}=e.option,{prefix:b,suffix:y,password:v,maxLength:x,pattern:E,toUpper:C,toTrim:S,secretType:w}=o,T=w&&(h||m),I=e=>{null==n||n(e),i(e)},_=v?N.Input.Password:N.Input,R=T?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return e=e.toString(),"finance"===t&&(e=oa(e)),"name"===t&&(e=e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**")),"phone"===t&&(e=e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2")),"IDnumber"===t&&(e=e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2")),"bankNumber"===t&&(e=e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")),e}(l,w):l;return r.isOnlyShow?t().createElement(fa,{value:(e=>e&&v?new Array(e.length).fill("*").join(""):e)(R),bordered:u}):t().createElement(_,{ref:a,value:R,placeholder:c,style:s,title:v?"":R,prefix:b,suffix:y,maxLength:x,bordered:u,allowClear:p,readOnly:h,disabled:m,onBlur:t=>{let a=t.target.value??"";if(S){const e=a.trim();a!==e&&(a=e,I(a))}(t=>{const{onBlur:a}=e;null==a||a(t)})(a),f(a)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;g(t),r.isFilterType&&r.SUBMIT_FORM()}},onChange:e=>{let t=e.target.value;(0,ca.isRegExp)(E)&&(t=E.test(t)?t:l??""),C&&(t=t.toUpperCase()),I(t)}})}));ba.displayName="VInput";class ya extends e.Component{constructor(){super(...arguments),ga(this,"focus",(()=>{const{type:e}=this.props.option;this[e].focus()}))}render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(h)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(ba,{ref:e=>this[a]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(n,t)}}))),u&&t().createElement(N.Col,null,e.renderFormItemButton(n,u)),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}ga(ya,"contextType",Ft);const va=ya,xa=e=>{const{$$form:a}=t().useContext(Ft),{value:r=[],onChange:l,onValuesChange:n}=e,{options:i={},placeholder:o=d("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:u,disabled:p}=e.option,{prefix:h,suffix:m,maxLength:f}=i,g=e=>{const t=e.every((e=>!e))?[]:e;null==l||l(t),n(t,b(t))},b=e=>e.join(" - ");return a.isOnlyShow?t().createElement(fa,{value:b(r),bordered:s}):t().createElement(N.Input.Group,null,t().createElement(N.Input,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:o[0],prefix:h,suffix:m,maxLength:f,allowClear:c,bordered:s,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([t,r[1]])}}),t().createElement(N.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:p,readOnly:!0}),t().createElement(N.Input,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:o[1],prefix:h,suffix:m,maxLength:f,bordered:s,allowClear:c,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([r[0],t])}}))};class Ea extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,s),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(o)},required:e.getFormItemRequired(u)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(xa,{option:this.props.option,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1?arguments[1]:void 0;p(t),e.setViewValue(n,a)}}))),c&&t().createElement(N.Col,{flex:(0,Y.PM)(c.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Ea,"contextType",Ft);const Ca=Ea;function Sa(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const wa=e=>{const t=Number(e);return Number.isNaN(t)?e:t},Ta=t().forwardRef(((e,a)=>{const{$$form:r}=t().useContext(Ft),{value:l,onChange:n,onValuesChange:i}=e,{options:o={},style:s={},placeholder:c=d("qm.form.inputPlaceholder"),bordered:u=!0,readOnly:p,disabled:h,onBlur:m=Y.ZT,onEnter:f=Y.ZT}=e.option,{step:g=1,min:b,max:y,precision:v,textAlign:x="left",controls:E=!0,formatter:C,parser:S}=o,w=e=>{const t=ea(e)?"":Number(e).toFixed(v);return"function"==typeof C?C(t):t},T={[x]:!0,controls:E};return r.isOnlyShow?t().createElement(fa,{value:w(l),bordered:u}):t().createElement(N.InputNumber,{ref:a,value:l,className:oe()(T),placeholder:c,style:{width:"100%",...s},step:g,min:b,max:y,controls:E,precision:v,formatter:C,parser:S,bordered:u,readOnly:p,disabled:h,onBlur:t=>{(0,Y.Y3)((()=>{const a=t.target.value,r="function"==typeof S?S(a):a;(t=>{const{onBlur:a}=e;null==a||a(t)})(wa(r)),m(wa(r))}))},onKeyUp:e=>{if(13===e.keyCode){const t=e.target.value,a="function"==typeof S?S(t):t;f(wa(a))}},onChange:e=>{(e=>{null==n||n(e),i(e,w(e))})(e)}})}));Ta.displayName="VInputNumber";class Na extends e.Component{constructor(){super(...arguments),Sa(this,"focus",(()=>{const{type:e}=this.props.option;this[e].focus()}))}render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(h)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Ta,{ref:e=>this[a]=e,option:this.props.option,onValuesChange:(t,a)=>{m(t),e.setViewValue(n,a)}}))),u&&t().createElement(N.Col,null,e.renderFormItemButton(n,u)),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}Sa(Na,"contextType",Ft);const Ia=Na,_a=e=>{const{$$form:a}=t().useContext(Ft),{value:r=[],onChange:l,onValuesChange:n}=e,{options:i={},placeholder:o=d("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:u,disabled:p}=e.option,{step:h=1,min:m=0,max:f,textAlign:g="left",controls:b=!0,precision:y,formatter:v,parser:x}=i,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),C(e)},C=e=>{const t=e.every((e=>null===e))?[]:[...e];null==l||l(t),n(t,S(t))},S=e=>ea(e)?"":e.map((e=>ea(e)?"":Number(e).toFixed(y))),w={[g]:!0,controls:b};return a.isOnlyShow?t().createElement(fa,{value:S(r),bordered:s}):t().createElement(N.Input.Group,null,t().createElement(N.InputNumber,{value:r[0],className:oe()("site-input-left",w),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:o[0],step:h,min:m,max:f,controls:b,precision:y,formatter:v,parser:x,bordered:s,readOnly:u,disabled:p,onChange:e=>{C([e,r[1]])},onBlur:()=>{E(r)}}),t().createElement(N.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:p,readOnly:!0}),t().createElement(N.InputNumber,{value:r[1],className:oe()("site-input-right",w),style:{width:"calc(50% - 5px)"},placeholder:o[1],step:h,min:m,max:f,controls:b,precision:y,formatter:v,parser:x,bordered:s,readOnly:u,disabled:p,onChange:e=>{C([r[0],e])},onBlur:()=>{E(r)}}))};class Ra extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,s),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(o)},required:e.getFormItemRequired(u)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(_a,{option:this.props.option,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1?arguments[1]:void 0;p(t),e.setViewValue(n,a)}}))),c&&t().createElement(N.Col,{flex:(0,Y.PM)(c.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Ra,"contextType",Ft);const Pa=Ra;let Oa;function Aa(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}!function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(Oa||(Oa={}));const{Search:ka}=N.Input;class Ha extends e.Component{constructor(e){var t;super(e),t=this,Aa(this,"searchHelper",void 0),Aa(this,"alias",void 0),Aa(this,"extras",void 0),Aa(this,"deriveParams",void 0),Aa(this,"valueKey",void 0),Aa(this,"_is_change",!1),Aa(this,"_record",void 0),Aa(this,"_prevValue",void 0),Aa(this,"state",{visible:!1,loading:!1}),Aa(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Aa(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props,{fieldName:t}=this.props.option;this.searchHelper=Object.assign({},e,this.props.option.searchHelper);const{fieldAliasMap:a,extraAliasMap:r,fieldsDefine:l}=this.searchHelper;if(a||m("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof a?a():a||{},this.extras="function"==typeof r?r():r||{},l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(t)||m("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),this.searchHelper.echoRequest&&!this.valueKey&&m("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),Aa(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),Aa(this,"getLastedSearchHelper",(()=>Object.assign({},this.searchHelper,this.props.option.searchHelper))),Aa(this,"getItemText",(async()=>{await this.props.waiting();const e=this.getItemValue();if(e===this._prevValue)return;this._prevValue=e;const{fetchApi:t,params:a={},formatter:r=(e=>e),dataKey:l,callback:n,fieldAliasMap:i,extraAliasMap:o}=this.searchHelper.echoRequest||{},s="function"==typeof i?i():i||{},c="function"==typeof o?o():o||{},{value:d}=this.props;if(t&&!d&&e){this.setState({loading:!0});try{const i=await t(r({...a,key:e}));if(200===i.code){const e=Array.isArray(i.data)?i.data:(0,ca.get)(i.data,l)??[];if(e[0]){const t=e[0];s&&aa(t,this.alias,s),c&&ra(t,this.extras,c),this._record=t,this.setFieldsValue(t),null==n||n([t])}}}catch(e){}this.setState({loading:!1})}})),Aa(this,"todoOpen",(e=>{this.deriveParams=this.createFilters(e),this.setVisible(!0)})),Aa(this,"createFilters",(e=>{const{fieldName:t}=this.props.option,{filterAliasMap:a}=this.searchHelper,r=""!==e?e:void 0,l="function"==typeof a?a():a??[],n={[t]:r};return l.forEach((e=>n[e]=r)),n})),Aa(this,"getSearchHelperTableData",(e=>{const{table:t,initialValue:a={}}=this.searchHelper,{beforeFetch:r=Y.XT,formatter:l=(e=>e)}=t.fetch;return new Promise((async(n,i)=>{const o=(0,ca.merge)({},this.getLastedSearchHelper().table.fetch.params,{...a,...l(this.createFilters(e))},{currentPage:1,pageSize:500});try{if(!r(o))return i();this.setState({loading:!0});const e=await t.fetch.api(o);if((0,Y.Y3)((()=>this.setState({loading:!1}))),200===e.code)return n(Array.isArray(e.data)?e.data:(0,ca.get)(e.data,t.fetch.dataKey)??[])}catch(e){this.setState({loading:!1})}i()}))})),Aa(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;for(const r in this.alias){const l=ta(e,this.alias[r]);void 0!==l&&(t.SET_FIELDS_VALUE({[r]:l}),r===a&&t.setViewValue(a,l))}for(const a in this.extras){const r=ta(e,this.extras[a]);void 0!==r&&t.SET_FIELDS_EXTRA({[a]:r})}})),Aa(this,"resetSearchHelperValue",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1?arguments[1]:void 0;const{fieldName:r}=t.props.option,l=e.filter((e=>{var l;return null===(l=ta(e,t.alias[r]))||void 0===l?void 0:l.toString().toLowerCase().includes(a.toLowerCase())}));if(1===l.length)return t.closeSearchHelper(l[0]);t.openSearchHelper(a)})),Aa(this,"openSearchHelper",(async(e,t)=>{await this.props.waiting();const{$$form:a}=this.context,{beforeOpen:r}=this.searchHelper,l=(r??Y.XT)(a.state.formData);null!=l&&l.then?l.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==l&&(this.todoOpen(e),null==t||t())})),Aa(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;for(const r in this.alias)r!==a&&t.SET_FIELDS_VALUE({[r]:ta(e,this.alias[r])});for(const a in this.extras)t.SET_FIELDS_EXTRA({[a]:ta(e,this.extras[a])});this._record=e;const r=ta(e,this.alias[a]);this.triggerChange(r),this.searchHelperChangeHandle(r);const{closed:l}=this.searchHelper;this.setVisible(!1,(()=>{this.focus(),setTimeout((()=>null==l?void 0:l(e)),200)}))})),Aa(this,"closeButNotSelect",(()=>{const{onlySelect:e=!0}=this.searchHelper;this._is_change&&(e?this.clearSearchHelperValue():this.searchHelperChangeHandle(this.props.value)),this._is_change=!1,this.setVisible(!1,(()=>{this.focus()}))})),Aa(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;if(this.triggerChange(""),null!==this._record){for(const a in this.alias)a!==t&&e.SET_FIELDS_VALUE({[a]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}})),Aa(this,"searchHelperChangeHandle",(e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)})),Aa(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props;null==t||t(e),a(e)})),Aa(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),Aa(this,"focus",(()=>{const{type:e}=this.props.option;this[`${e}_Ref`].focus({cursor:"end"})})),this.initialHandle()}componentDidMount(){this.getItemText()}componentDidUpdate(){this.getItemText()}render(){const{$$form:e}=this.context,{visible:a,loading:r}=this.state,{value:l}=this.props,{type:n,options:i={},searchHelper:o={},style:s={},placeholder:c=d("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{prefix:f,suffix:g,maxLength:b}=i,y={visible:a,title:d("qm.searchHelper.text"),width:o.width??"60%",loading:!1,bodyStyle:{paddingBottom:`${Oa[e.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},v={...this.getLastedSearchHelper(),size:e.$size,initialValue:(0,ca.merge)({},o.initialValue,this.deriveParams),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}};return e.isOnlyShow?t().createElement(fa,{value:l,bordered:u}):t().createElement(t().Fragment,null,t().createElement(ka,{ref:e=>this[`${n}_Ref`]=e,value:l,title:l,loading:r,placeholder:c,style:s,prefix:f,suffix:g,maxLength:b,bordered:u,allowClear:p,readOnly:h,disabled:m,onBlur:e=>{const{value:t}=e.target,{onlySelect:r=!0,table:l}=this.searchHelper;var n;this.triggerBlur(t),this._is_change&&!a&&(t?r?null!=l&&null!==(n=l.fetch)&&void 0!==n&&n.api&&this.getSearchHelperTableData(t).then((e=>this.resetSearchHelperValue(e,t))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(t):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;!a&&this.openSearchHelper(t)}},onDoubleClick:e=>{const{value:t}=e.target;this.openSearchHelper(t)},onChange:e=>{const{value:t}=e.target;this.triggerChange(t),this._is_change=!0},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper(e):(0,Y.Y3)((()=>this.clearSearchHelperValue())))}}),t().createElement(At,y,t().createElement(Go,v)))}}Aa(Ha,"contextType",Ft);class Fa extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),Aa(this,"promiseRef",void 0),Aa(this,"searchRef",void 0),Aa(this,"state",{searchHelper:{}}),Aa(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),Aa(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[]}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(Ha,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e.setViewValue(i,t)}}))),p&&t().createElement(N.Col,null,e.renderFormItemButton(i,p)),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}Aa(Fa,"contextType",Ft);const La=Fa;function qa(){return qa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},qa.apply(this,arguments)}function Da(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const $a=a=>{class r extends e.Component{constructor(){var e;super(...arguments),e=this,Da(this,"startClick",void 0),Da(this,"event1",null),Da(this,"event2",null),Da(this,"$el",null),Da(this,"omitClassNames",[]),Da(this,"state",{clickOutside:!1}),Da(this,"mousedownHandler",(e=>{this.startClick=e})),Da(this,"mouseupHandler",(e=>{this.documentHandler(e,this.startClick)})),Da(this,"documentHandler",((e,t)=>{var a,r;const l=e.target,n=null==t?void 0:t.target,i=!l||!n,o=(null===(a=this.$el)||void 0===a?void 0:a.contains(l))||(null===(r=this.$el)||void 0===r?void 0:r.contains(n)),s=this.$el===l,c=this.omitClassNames.map((e=>document.querySelector(e))),d=c.some((e=>null==e?void 0:e.contains(l)))||c.includes(n);let u;u=!(i||o||s||d),this.setState({clickOutside:u})})),Da(this,"setCurrentElement",(e=>{e&&(this.$el=e)})),Da(this,"setOmitClassNames",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.omitClassNames=t}))}componentDidMount(){this.event1=ot()(document,"mousedown",this.mousedownHandler),this.event2=ot()(document,"mouseup",this.mouseupHandler)}componentWillUnmount(){var e,t;null===(e=this.event1)||void 0===e||e.remove(),null===(t=this.event2)||void 0===t||t.remove()}render(){const{forwardedRef:e}=this.props,{clickOutside:r}=this.state;return t().createElement(a,qa({ref:e},this.props,{clickOutside:r,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return Da(r,"displayName",`OutsideClick(${a.displayName||a.name})`),t().forwardRef(((e,a)=>t().createElement(r,qa({},e,{forwardedRef:a}))))},Ma=require("rc-trigger");var Ka,Va,Ua=__webpack_require__.n(Ma);function ja(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}let za=$a((Va=class extends e.Component{constructor(e){var a;super(e),a=this,ja(this,"searchHelper",void 0),ja(this,"alias",void 0),ja(this,"_records",[]),ja(this,"searchRef",t().createRef()),ja(this,"state",{visible:!1,visible2:!1,loading:!1,itemList:[]}),ja(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props;this.searchHelper=Object.assign({},e,this.props.option.searchHelper);const t=this.searchHelper.fieldAliasMap;t||m("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof t?t():t||{},Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||m("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),ja(this,"getLastedSearchHelper",(()=>{const e=Object.assign({},this.searchHelper,this.props.option.searchHelper);var t;return e.table&&!e.table.rowKey&&(e.table.rowKey=null===(t=this.alias)||void 0===t?void 0:t.valueKey),e})),ja(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),ja(this,"setItemList",(e=>{this.setState({itemList:e})})),ja(this,"setRecords",(e=>{this._records=e})),ja(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),ja(this,"setViewValue",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;t.setViewValue(a,this.createViewText(e))})),ja(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:a}=this.searchHelper,r=(a??Y.XT)(t.state.formData);null!=r&&r.then?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),ja(this,"closeSearchHelper",(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:r}=a.alias;a.setRecords((0,ca.uniqBy)([...a._records.filter((e=>t.includes(e[r]))),...e],r));const l=a.recordsToDict();a.setItemList(l),a.triggerChange(l.map((e=>e.value)));const{closed:n}=a.searchHelper;a.setVisible(!1,(()=>{setTimeout((()=>null==n?void 0:n(a._records)),200)}))})),ja(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),a(e,this.createViewText(e),this._records)})),this.initialHandle()}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:a=[]}=e,{value:r=[],clickOutside:l}=this.props;(0,ca.isEqual)((0,ca.intersection)(a,r),r)||(0,ca.isEqual)(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),l&&t.visible2&&this.setState({visible2:!1})}async getItemList(){var e;if(await this.props.waiting(),!this.searchHelper)return;const{textKey:t,valueKey:a}=this.alias,{fetchApi:r,params:l={},formatter:n=(e=>e),dataKey:i,callback:o,fieldAliasMap:s}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},c="function"==typeof s?s():s||{},{value:d}=this.props;if(r&&!(0,Y.xb)(d)){this.setState({loading:!0});try{const e=await r(n({...l,keys:d}));if(200===e.code){let r=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,i)??[];r.forEach((e=>{null!=c&&c.valueKey&&c.valueKey!==a&&(e[a]=e[c.valueKey]),null!=c&&c.textKey&&c.textKey!==t&&(e[t]=e[c.textKey])})),r=r.filter((e=>d.includes(e[a])));const l=r.map((e=>({value:e[a],text:e[t]})));this.setRecords(r),this.setItemList(l),this.setViewValue(d),null==o||o(r)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,a;const{$$form:r}=this.context,{visible:l,visible2:n,loading:i,itemList:o}=this.state,{value:s}=this.props,{fieldName:c,options:u={},searchHelper:p={},style:h={},placeholder:m=d("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:b,disabled:y}=this.props.option,{collapseTags:v,maxTagTextLength:x}=u,E={visible:l,title:d("qm.searchHelper.text"),width:p.width??"60%",loading:!1,bodyStyle:{paddingBottom:`${Oa[r.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},C={...this.getLastedSearchHelper(),size:r.$size,multiple:!0,initialValue:(0,ca.merge)({},p.initialValue),defaultSelectedKeys:s,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}},S=o.filter((e=>null==s?void 0:s.includes(e.value))),w=t().createElement("ul",{className:"ant-dropdown-menu"},S.length?S.map((e=>t().createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t().createElement("li",{className:"ant-dropdown-menu-item"},d("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=se("form-multiple-search-helper"),{size:_}=r.context,R={[I]:!0,[`${I}--lg`]:"large"===_,[`${I}--sm`]:"small"===_};null===(e=(a=this.props).setOmitClassNames)||void 0===e||e.call(a,[`.${I}`]);const P=o.filter((e=>null==s?void 0:s.includes(e.value))).map((e=>e.text)).join(",");return r.isOnlyShow?t().createElement(fa,{value:P,bordered:f}):t().createElement(t().Fragment,null,t().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t().createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t().createElement(Ua(),{popupVisible:!y&&n,popup:w,popupClassName:oe()(R),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Bt,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(N.Select,{mode:"multiple",maxTagCount:v?"responsive":void 0,maxTagTextLength:x,open:!1,value:s,placeholder:m,loading:i,bordered:f,allowClear:g,disabled:y,style:{width:"100%",...h},title:P,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{const t=e.target;var a,r;t.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(a=(r=this.props).setCurrentElement)||void 0===a||a.call(r,t),this.setState({visible2:!0}))},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(N.Button,{className:"ant-input-search-button",disabled:y,icon:t().createElement(ce.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),t().createElement(At,E,t().createElement(Go,C)))}},ja(Va,"contextType",Ft),Ka=Va))||Ka;class Ba extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),ja(this,"promiseRef",void 0),ja(this,"state",{searchHelper:{}}),ja(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),ja(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(za,{option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:(t,a,r)=>{f(t,r),e.setViewValue(i,a)}}))),p&&t().createElement(N.Col,null,e.renderFormItemButton(i,p)),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}ja(Ba,"contextType",Ft);const Wa=Ba;function Ga(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const{Search:Ya}=N.Input;class Za extends e.Component{constructor(e){super(e),Ga(this,"searchHelper",void 0),Ga(this,"alias",void 0),Ga(this,"extras",void 0),Ga(this,"valueKey",void 0),Ga(this,"_record",void 0),Ga(this,"_prevValue",void 0),Ga(this,"state",{visible:!1,loading:!1}),Ga(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Ga(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props,{fieldName:t}=this.props.option;this.searchHelper=Object.assign({},e,this.props.option.searchHelper);const{fieldAliasMap:a,extraAliasMap:r,fieldsDefine:l}=this.searchHelper;if(a||m("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof a?a():a||{},this.extras="function"==typeof r?r():r||{},l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(t)||m("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),this.searchHelper.echoRequest&&!this.valueKey&&m("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),Ga(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),Ga(this,"getLastedSearchHelper",(()=>Object.assign({},this.searchHelper,this.props.option.searchHelper))),Ga(this,"getItemText",(async()=>{await this.props.waiting();const e=this.getItemValue();if(e===this._prevValue)return;this._prevValue=e;const{fetchApi:t,params:a={},formatter:r=(e=>e),dataKey:l,fieldAliasMap:n,extraAliasMap:i}=this.searchHelper.echoRequest||{},o="function"==typeof n?n():n||{},s="function"==typeof i?i():i||{},{value:c}=this.props;if(t&&!c&&e){this.setState({loading:!0});try{const n=await t(r({...a,key:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:(0,ca.get)(n.data,l)??[];if(e[0]){const t=e[0];o&&aa(t,this.alias,o),s&&ra(t,this.extras,s),this._record=t,this.setFieldsValue(t)}}}catch(e){}this.setState({loading:!1})}})),Ga(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;for(const r in this.alias){const l=ta(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:l}),r===a&&t.setViewValue(a,l)}for(const a in this.extras)t.SET_FIELDS_EXTRA({[a]:ta(e,this.extras[a])})})),Ga(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:a}=this.searchHelper,r=(a??Y.XT)(t.state.formData);null!=r&&r.then?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),Ga(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;for(const r in this.alias)r!==a&&t.SET_FIELDS_VALUE({[r]:ta(e,this.alias[r])});for(const a in this.extras)t.SET_FIELDS_EXTRA({[a]:ta(e,this.extras[a])});this._record=e;const r=ta(e,this.alias[a]);this.triggerChange(r);const{closed:l}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==l?void 0:l(e)),200)}))})),Ga(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const a in this.alias)a!==t&&e.SET_FIELDS_VALUE({[a]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")})),Ga(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props;null==t||t(e),a(e,this._record)})),Ga(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),this.initialHandle()}componentDidMount(){this.getItemText()}componentDidUpdate(){this.getItemText()}render(){const{$$form:e}=this.context,{visible:a,loading:r}=this.state,{value:l=""}=this.props,{type:n,options:i={},searchHelper:o={},style:s={},placeholder:c=d("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{prefix:f,suffix:g,maxLength:b}=i,y={visible:a,title:d("qm.searchHelper.text"),width:o.width??"65%",loading:!1,bodyStyle:{paddingBottom:`${Oa[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},v={...this.getLastedSearchHelper(),size:e.$size,initialValue:(0,ca.merge)({},o.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}};return e.isOnlyShow?t().createElement(fa,{value:l,bordered:u}):t().createElement(t().Fragment,null,t().createElement(Ya,{ref:e=>this[`${n}_Ref`]=e,value:l,title:l,loading:r,placeholder:c,style:s,prefix:f,suffix:g,maxLength:b,bordered:u,allowClear:p,readOnly:h,disabled:m,onBlur:e=>{const{value:t}=e.target;this.triggerBlur(t)},onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:e=>{this.openSearchHelper()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():this.clearSearchHelperValue())}}),t().createElement(At,y,t().createElement(es,v)))}}Ga(Za,"contextType",Ft);class Xa extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),Ga(this,"promiseRef",void 0),Ga(this,"state",{searchHelper:{}}),Ga(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),Ga(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(Za,{option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:(t,a)=>{f(t,a),e.setViewValue(i,t)}}))),p&&t().createElement(N.Col,null,e.renderFormItemButton(i,p)),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}Ga(Xa,"contextType",Ft);const Qa=Xa;var Ja,er;function tr(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}let ar=$a((er=class extends e.Component{constructor(e){var a;super(e),a=this,tr(this,"searchHelper",void 0),tr(this,"alias",void 0),tr(this,"_records",[]),tr(this,"searchRef",t().createRef()),tr(this,"state",{visible:!1,visible2:!1,loading:!1,itemList:[]}),tr(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props;this.searchHelper=Object.assign({},e,this.props.option.searchHelper);const t=this.searchHelper.fieldAliasMap;t||m("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof t?t():t||{},Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||m("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),tr(this,"getLastedSearchHelper",(()=>{const e=Object.assign({},this.searchHelper,this.props.option.searchHelper);var t;return e.table&&!e.table.rowKey&&(e.table.rowKey=null===(t=this.alias)||void 0===t?void 0:t.valueKey),e})),tr(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),tr(this,"setItemList",(e=>{this.setState({itemList:e})})),tr(this,"setRecords",(e=>{this._records=e})),tr(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),tr(this,"setViewValue",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;t.setViewValue(a,this.createViewText(e))})),tr(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:a}=this.searchHelper,r=(a??Y.XT)(t.state.formData);null!=r&&r.then?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),tr(this,"closeSearchHelper",(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:r}=a.alias;a.setRecords((0,ca.uniqBy)([...a._records.filter((e=>t.includes(e[r]))),...e],r));const l=a.recordsToDict();a.setItemList(l),a.triggerChange(l.map((e=>e.value)));const{closed:n}=a.searchHelper;a.setVisible(!1,(()=>{setTimeout((()=>null==n?void 0:n(a._records)),200)}))})),tr(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),a(e,this.createViewText(e),this._records)})),this.initialHandle()}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:a=[]}=e,{value:r=[],clickOutside:l}=this.props;(0,ca.isEqual)((0,ca.intersection)(a,r),r)||(0,ca.isEqual)(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),l&&t.visible2&&this.setState({visible2:!1})}async getItemList(){var e;if(await this.props.waiting(),!this.searchHelper)return;const{textKey:t,valueKey:a}=this.alias,{fetchApi:r,params:l={},formatter:n=(e=>e),dataKey:i,fieldAliasMap:o}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},s="function"==typeof o?o():o||{},{value:c}=this.props;if(r&&!(0,Y.xb)(c)){this.setState({loading:!0});try{const e=await r(n({...l,keys:c}));if(200===e.code){let r=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,i)??[];r.forEach((e=>{null!=s&&s.valueKey&&s.valueKey!==a&&(e[a]=e[s.valueKey]),null!=s&&s.textKey&&s.textKey!==t&&(e[t]=e[s.textKey])})),r=r.filter((e=>c.includes(e[a])));const l=r.map((e=>({value:e[a],text:e[t]})));this.setRecords(r),this.setItemList(l),this.setViewValue(c)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,a;const{$$form:r}=this.context,{visible:l,visible2:n,loading:i,itemList:o}=this.state,{value:s}=this.props,{fieldName:c,options:u={},searchHelper:p={},style:h={},placeholder:m=d("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:b,disabled:y}=this.props.option,{collapseTags:v,maxTagTextLength:x}=u,E={visible:l,title:d("qm.searchHelper.text"),width:p.width??"65%",loading:!1,bodyStyle:{paddingBottom:`${Oa[r.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},C={...this.getLastedSearchHelper(),size:r.$size,multiple:!0,initialValue:(0,ca.merge)({},p.initialValue),defaultSelectedKeys:s,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}},S=o.filter((e=>null==s?void 0:s.includes(e.value))),w=t().createElement("ul",{className:"ant-dropdown-menu"},S.length?S.map((e=>t().createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t().createElement("li",{className:"ant-dropdown-menu-item"},d("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=se("form-multiple-tree-table-helper"),{size:_}=r.context,R={[I]:!0,[`${I}--lg`]:"large"===_,[`${I}--sm`]:"small"===_};null===(e=(a=this.props).setOmitClassNames)||void 0===e||e.call(a,[`.${I}`]);const P=o.filter((e=>null==s?void 0:s.includes(e.value))).map((e=>e.text)).join(",");return r.isOnlyShow?t().createElement(fa,{value:P,bordered:f}):t().createElement(t().Fragment,null,t().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t().createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t().createElement(Ua(),{popupVisible:!y&&n,popup:w,popupClassName:oe()(R),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Bt,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(N.Select,{mode:"multiple",maxTagCount:v?"responsive":void 0,maxTagTextLength:x,open:!1,value:s,placeholder:m,loading:i,bordered:f,allowClear:g,disabled:y,style:{width:"100%",...h},title:P,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{const t=e.target;var a,r;t.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(a=(r=this.props).setCurrentElement)||void 0===a||a.call(r,t),this.setState({visible2:!0}))},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(N.Button,{className:"ant-input-search-button",disabled:y,icon:t().createElement(ce.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),t().createElement(At,E,t().createElement(es,C)))}},tr(er,"contextType",Ft),Ja=er))||Ja;class rr extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),tr(this,"promiseRef",void 0),tr(this,"state",{searchHelper:{}}),tr(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),tr(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(ar,{option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:(t,a,r)=>{f(t,r),e.setViewValue(i,a)}}))),p&&t().createElement(N.Col,null,e.renderFormItemButton(i,p)),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}tr(rr,"contextType",Ft);const lr=rr;function nr(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const ir=new Array(2).fill("");class or extends e.Component{constructor(e){var t;super(e),t=this,nr(this,"searchHelper",void 0),nr(this,"alias",void 0),nr(this,"_is_change",!1),nr(this,"_ceho_data",void 0),nr(this,"_records",[]),nr(this,"_is_clear",!1),nr(this,"state",{visible:!1,loading:!1,itemList:[],textValue:ir}),nr(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props;this.searchHelper=Object.assign({},e,this.props.option.searchHelper);const t=this.searchHelper.fieldAliasMap;t||m("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof t?t():t||{},Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||m("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),nr(this,"getLastedSearchHelper",(()=>Object.assign({},this.searchHelper,this.props.option.searchHelper))),nr(this,"setItemList",(e=>{this.setState({itemList:e})})),nr(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),nr(this,"setTextValue",(e=>{this.setState({textValue:e})})),nr(this,"setRecords",(e=>{this._records=e})),nr(this,"setViewValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())})),nr(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props;this._is_change=!1,null==t||t(e),a(e,this.createViewText(),this._records)})),nr(this,"clearSearchHelperValue",(()=>{this.setRecords([]),this.setTextValue(ir),this.triggerChange([])})),nr(this,"closeSearchHelper",(e=>{const{valueKey:t,textKey:a}=this.alias,r=e.map((e=>({value:e[t],text:e[a]})));this.setRecords(e),this.setItemList(r),this.setTextValue(r.map((e=>e.text??""))),this.triggerChange(e.map((e=>e[t])));const{closed:l}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==l?void 0:l(this._records)),200)}))})),nr(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:a}=this.searchHelper,r=(a??Y.XT)(t.state.formData);null!=r&&r.then?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),nr(this,"createFilters",(e=>{const{fieldName:t}=this.props.option;return{[t]:(0,Y.xb)(e)?void 0:e}})),nr(this,"getSearchHelperTableData",(e=>{const{table:t,initialValue:a={}}=this.searchHelper,{beforeFetch:r=Y.XT,formatter:l=(e=>e)}=t.fetch;return new Promise((async(n,i)=>{const o=(0,ca.merge)({},this.getLastedSearchHelper().table.fetch.params,{...a,...l(this.createFilters(e))},{currentPage:1,pageSize:500});try{if(!r(o))return i();this.setState({loading:!0});const e=await t.fetch.api(o);if((0,Y.Y3)((()=>this.setState({loading:!1}))),200===e.code)return n(Array.isArray(e.data)?e.data:(0,ca.get)(e.data,t.fetch.dataKey)??[])}catch(e){this.setState({loading:!1})}i()}))})),nr(this,"resetSearchHelperValue",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{textValue:a}=t.state,{textKey:r}=t.alias,l=e.filter((e=>{var t;const l=null===(t=e[r])||void 0===t?void 0:t.toString().toLowerCase();return a.some((e=>null==l?void 0:l.includes(e.toLowerCase())))}));if(2===l.length)return t.closeSearchHelper(l);t.openSearchHelper()})),nr(this,"closeButNotSelect",(()=>{this._is_change&&this.clearSearchHelperValue(),this.setVisible(!1)})),this.initialHandle()}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:a=[]}=this.props;(0,ca.isEqual)((0,ca.intersection)(t,a),a)||(0,ca.isEqual)(a,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:r}=this.context,{fieldName:l}=this.props.option;if(!(0,ca.isEqual)(r[l],this._ceho_data)&&(this._ceho_data=r[l],this.setItemList(r[l]),a.length)){const e=ir.map(((e,t)=>{var n;return(null===(n=r[l].find((e=>e.value===a[t])))||void 0===n?void 0:n.text)??""}));this.setTextValue(e)}}async getItemList(){if(await this.props.waiting(),!this.searchHelper)return;const{textKey:e,valueKey:t}=this.alias,{fetchApi:a,params:r={},formatter:l=(e=>e),dataKey:n,fieldAliasMap:i}=this.searchHelper.echoRequest||{},o="function"==typeof i?i():i||{},{value:s}=this.props;if(a&&!(0,Y.xb)(s)){this.setState({loading:!0});try{const i=await a(l({...r,keys:s}));if(200===i.code){let a=Array.isArray(i.data)?i.data:(0,ca.get)(i.data,n)??[];a.forEach((a=>{null!=o&&o.valueKey&&o.valueKey!==t&&(a[t]=a[o.valueKey]),null!=o&&o.textKey&&o.textKey!==e&&(a[e]=a[o.textKey])})),a=a.filter((e=>s.includes(e[t]))).slice(0,2);const r=a.map((a=>({value:a[t],text:a[e]})));this.setRecords(a),this.setItemList(r),this.setTextValue(r.map((e=>e.text??""))),this.setViewValue()}}catch(e){}this.setState({loading:!1})}}createViewText(){const{textKey:e}=this.alias;return this._records.map((t=>t[e])).join(" - ")}render(){const{$$form:e}=this.context,{value:a=[]}=this.props,{visible:r,loading:l,textValue:n}=this.state,{options:i={},searchHelper:o={},placeholder:s=d("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,readOnly:u,disabled:p}=this.props.option,{onlySelect:h=!0}=this.searchHelper||o,m={visible:r,title:d("qm.searchHelper.text"),width:o.width??"65%",loading:!1,bodyStyle:{paddingBottom:`${Oa[e.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},f={...this.getLastedSearchHelper(),size:e.$size,initialValue:(0,ca.merge)({},o.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}};return e.isOnlyShow?t().createElement(fa,{value:n.join(" - "),bordered:c}):t().createElement(t().Fragment,null,t().createElement(N.Input.Group,null,t().createElement(N.Input,{value:n[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:s[0],allowClear:!1,bordered:c,readOnly:u,disabled:p,onBlur:e=>{const{value:t}=e.target;var a,l;this._is_change&&!r&&(t?n.every((e=>!!e))&&null!==(a=this.searchHelper.table)&&void 0!==a&&null!==(l=a.fetch)&&void 0!==l&&l.api&&this.getSearchHelperTableData(n).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):n.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;h||(this._is_change=!0,this.setTextValue([t,n[1]]))}}),t().createElement(N.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:c,disabled:p,readOnly:!0}),t().createElement(N.Input.Search,{value:n[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:s[1],loading:l,bordered:c,allowClear:!0,readOnly:u,disabled:p,onBlur:e=>{const{value:t}=e.target;var a,l;this._is_change&&!r&&(t?n.every((e=>!!e))&&null!==(a=this.searchHelper.table)&&void 0!==a&&null!==(l=a.fetch)&&void 0!==l&&l.api&&this.getSearchHelperTableData(n).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):n.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:h||(this._is_change=!0,this.setTextValue([n[0],t]))},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),t().createElement(At,m,t().createElement(os,f)))}}nr(or,"contextType",Ft);class sr extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),nr(this,"promiseRef",void 0),nr(this,"state",{searchHelper:{}}),nr(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),nr(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,c),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(h)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(or,{option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:(t,a,r)=>{m(t,r),e.setViewValue(i,a)}}))),u&&t().createElement(N.Col,null,e.renderFormItemButton(i,u)),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...d}))))}}nr(sr,"contextType",Ft);const cr=sr,dr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},disabled:s}=e.option,{falseValue:c=Ut,trueValue:u=Vt}=i;return t().createElement(N.Checkbox,{checked:r===u,style:o,disabled:s||a.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==l||l(e),n(e,d(e===u?"am.form.trueText":"am.form.falseText"))})(t?u:c)}})};class ur extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(dr,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(ur,"contextType",Ft);const pr=ur;function hr(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const mr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,items:l,onChange:n,onValuesChange:i}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u}=e.option,{itemList:p=[]}=o,h=(0,Y.xb)(p)?l:p,m=e=>h.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return a.isOnlyShow?t().createElement(fa,{value:m(r),bordered:c}):t().createElement(N.Checkbox.Group,{value:r,style:{width:"100%",...s},disabled:u,onChange:e=>{(e=>{null==n||n(e),i(e,m(e))})(e)}},h.map((e=>t().createElement(N.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class fr extends e.Component{constructor(){super(...arguments),hr(this,"state",{itemList:[]})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,a;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,l=null===(a=this.props.option.request)||void 0===a?void 0:a.params;(0,ca.isEqual)(r,l)||this.getItemList()}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:a={},dataKey:r,valueKey:l="value",textKey:n="text",callback:i}=e;if(t)try{const e=await t(a);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,r)??[],a=t.map((e=>({value:e[l],text:e[n]})));this.setState({itemList:a},(()=>null==i?void 0:i(t)))}}catch(e){}}render(){const{$$form:e}=this.context,{itemList:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(h)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(mr,{option:this.props.option,items:a,onValuesChange:(t,a)=>{m(t),e.setViewValue(i,a)}}))),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}hr(fr,"contextType",Ft);const gr=fr,br=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},allowClear:s=!0,readOnly:c,disabled:d}=e.option,{allowHalf:u,count:p=5,tooltips:h}=i;return t().createElement(N.Rate,{value:r,count:p,style:o,allowHalf:u,allowClear:s,tooltips:h,disabled:d||a.isOnlyShow,onChange:e=>{(e=>{var t;null==l||l(e),n(e,(t=e,h?h[Math.ceil(t)-1]:t.toString()))})(e)}})};class yr extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(br,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(yr,"contextType",Ft);const vr=yr;function xr(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const Er=e=>{const{$$form:a}=t().useContext(Ft),{value:r,items:l,onChange:n,onValuesChange:i}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u}=e.option,{itemList:p=[]}=o,h=(0,Y.xb)(p)?l:p,m=e=>{var t;return(null===(t=h.find((t=>t.value===e)))||void 0===t?void 0:t.text)??""};return a.isOnlyShow?t().createElement(fa,{value:m(r),bordered:c}):t().createElement(N.Radio.Group,{value:r,style:{width:"100%",...s},disabled:u||a.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==n||n(e),i(e,m(e))})(t)}},h.map((e=>t().createElement(N.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Cr extends e.Component{constructor(){super(...arguments),xr(this,"state",{itemList:[]}),xr(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:a={},dataKey:r,valueKey:l="value",textKey:n="text",callback:i}=e;if(t)try{const e=await t(a);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,r)??[],a=t.map((e=>({value:e[l],text:e[n]})));this.setState({itemList:a},(()=>null==i?void 0:i(t)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,a;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,l=null===(a=this.props.option.request)||void 0===a?void 0:a.params;(0,ca.isEqual)(r,l)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(h)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(Er,{option:this.props.option,items:a,onValuesChange:(t,a)=>{m(t),e.setViewValue(i,a)}}))),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}xr(Cr,"contextType",Ft);const Sr=Cr,wr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},disabled:s}=e.option,{falseValue:c=Ut,trueValue:u=Vt}=i;return t().createElement(N.Switch,{checked:r===u,style:o,disabled:s||a.isOnlyShow,checkedChildren:t().createElement(ce.CheckOutlined,null),unCheckedChildren:t().createElement(ce.CloseOutlined,null),onChange:e=>{(e=>{null==l||l(e),n(e,d(e===u?"am.form.trueText":"am.form.falseText"))})(e?u:c)}})};class Tr extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(wr,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Tr,"contextType",Ft);const Nr=Tr,Ir=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:u,readOnly:p,disabled:h,onBlur:m=Y.ZT,onEnter:f=Y.ZT}=e.option,{showCount:g,maxLength:b,autoSize:y}=i,v=Object.assign({},{minRows:1,maxRows:3},y);return t().createElement(N.Input.TextArea,{value:r,placeholder:s,style:o,maxLength:b,showCount:g,autoSize:v,bordered:c,allowClear:u,readOnly:p||a.isOnlyShow,disabled:h,onBlur:t=>{const{value:a}=t.target;(t=>{const{onBlur:a}=e;null==a||a(t)})(a),m(a)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;f(t)}},onChange:e=>{const{value:t}=e.target;(e=>{null==l||l(e),n(e)})(t)}})};class _r extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Ir,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(n,t)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(_r,"contextType",Ft);const Rr=_r,Pr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:o={},style:s={},placeholder:c=d("qm.form.datePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=e.option,{dateType:f="date",minDateTime:g,maxDateTime:b,shortCuts:y=!0}=o,v=t().createRef(),x=e=>{e&&"date"===f&&(e+=" 00:00:00"),null==l||l(e),n(e,E(e))},E=e=>ea(e)?"":["date","exactdate"].includes(f)?e.slice(0,10):e,C=e=>{let t=Jt(i()().subtract(e,"day"),Gt[f]);"date"===f&&(t=t.slice(0,10)),x(t),v.current.blur(),v.current.focus()};return a.isOnlyShow?t().createElement(fa,{value:E(r),bordered:u}):t().createElement(H,{ref:v,style:{width:"100%",...s},picker:Wt[f],bordered:u,showToday:!1,showTime:"datetime"===f,allowClear:p,disabled:m,inputReadOnly:h,disabledDate:e=>((e,t)=>{let[a,r]=t;return a&&r?e.isBefore(a,"day")||e.isAfter(r,"day"):a?e.isBefore(a,"day"):!!r&&e.isAfter(r,"day")})(e,[g,b]),renderExtraFooter:y?()=>t().createElement(t().Fragment,null,t().createElement(N.Tag,{color:"processing",onClick:()=>C(0)},d("qm.form.datePickers")[0]),t().createElement(N.Tag,{color:"processing",onClick:()=>C(1)},d("qm.form.datePickers")[1]),t().createElement(N.Tag,{color:"processing",onClick:()=>C(7)},d("qm.form.datePickers")[2]),t().createElement(N.Tag,{color:"processing",onClick:()=>C(30)},d("qm.form.datePickers")[3])):void 0,value:Qt(r,Gt[f]),onChange:(e,t)=>{x(t)}})};class Or extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Pr,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Or,"contextType",Ft);const Ar=Or,kr=e=>[i()().subtract(e,"day"),i()()],Hr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.daterangePlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{dateType:m="date",disableds:f=[!1,!1],minDateTime:g,maxDateTime:b,shortCuts:y=!0}=i,v={[d("qm.form.dateRangePickers")[0]]:kr(7),[d("qm.form.dateRangePickers")[1]]:kr(30),[d("qm.form.dateRangePickers")[2]]:kr(90),[d("qm.form.dateRangePickers")[3]]:kr(180)},x=e=>ea(e)?"":e.map((e=>["date","exactdate"].includes(m)?null==e?void 0:e.slice(0,10):e)).join(" - ");return a.isOnlyShow?t().createElement(fa,{value:x(r),bordered:c}):t().createElement(H.RangePicker,{style:{width:"100%",...o},picker:Wt[m],bordered:c,showTime:"datetime"===m,allowClear:u,disabled:h?[!0,!0]:f,inputReadOnly:p,disabledDate:e=>((e,t)=>{let[a,r]=t;return a&&r?e.isBefore(a,"day")||e.isAfter(r,"day"):a?e.isBefore(a,"day"):!!r&&e.isAfter(r,"day")})(e,[g,b]),ranges:y?v:void 0,value:(0,Y.xb)(r)?null:[Qt(null==r?void 0:r[0],Gt[m]),Qt(null==r?void 0:r[1],Gt[m])],onChange:(e,t)=>{(e=>{"date"===m&&(e=e.map(((e,t)=>e?0===t?e+" 00:00:00":e+" 23:59:59":e))),e.every((e=>!e))&&(e=[]),null==l||l(e),n(e,x(e))})(t)}})};class Fr extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Hr,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Fr,"contextType",Ft);const Lr=Fr,qr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.timePlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{timeType:m="hour-minute-second",hourStep:f=1,minuteStep:g=1,secondStep:b=1}=i;return a.isOnlyShow?t().createElement(fa,{value:r,bordered:c}):t().createElement(D,{style:{width:"100%",...o},bordered:c,showNow:!0,hourStep:f,minuteStep:g,secondStep:b,allowClear:u,disabled:h,inputReadOnly:p,format:Yt[m],value:Qt(r,Yt[m]),onChange:(e,t)=>{(e=>{const t=Jt(e,Yt[m]);null==l||l(t),n(t)})(e)}})};class Dr extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(qr,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(n,t)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Dr,"contextType",Ft);const $r=Dr,Mr=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.timerangePlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{timeType:m="hour-minute-second",disableds:f=[!1,!1],hourStep:g=1,minuteStep:b=1,secondStep:y=1}=i,v=e=>ea(e)?"":e.join(" - ");return a.isOnlyShow?t().createElement(fa,{value:v(r),bordered:c}):t().createElement(D.RangePicker,{style:{width:"100%",...o},bordered:c,showNow:!1,hourStep:g,minuteStep:b,secondStep:y,allowClear:u,disabled:h?[!0,!0]:f,inputReadOnly:p,format:Yt[m],value:(0,Y.xb)(r)?null:[Qt(null==r?void 0:r[0],Yt[m]),Qt(null==r?void 0:r[1],Yt[m])],onChange:(e,t)=>{(e=>{const t=[Jt(null==e?void 0:e[0],Yt[m]),Jt(null==e?void 0:e[1],Yt[m])];null==l||l(t),n(t,v(t))})(e)}})};class Kr extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Mr,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Kr,"contextType",Ft);const Vr=Kr,Ur={PINYINS:["A","AI","AN","ANG","AO","BA","BAI","BAN","BANG","BAO","BEI","BEN","BENG","BI","BIAN","BIAO","BIE","BIN","BING","BO","BU","CA","CAI","CAN","CANG","CAO","CE","CEN","CENG","CHA","CHAI","CHAN","CHANG","CHAO","CHE","CHEN","CHENG","CHI","CHONG","CHOU","CHU","CHUA","CHUAI","CHUAN","CHUANG","CHUI","CHUN","CHUO","CI","CONG","COU","CU","CUAN","CUI","CUN","CUO","DA","DAI","DAN","DANG","DAO","DE","DEN","DENG","DI","DIAN","DIAO","DIE","DING","DIU","DONG","DOU","DU","DUAN","DUI","DUN","DUO","E","EI","EN","ENG","ER","FA","FAN","FANG","FEI","FEN","FENG","FIAO","FO","FOU","FU","GA","GAI","GAN","GANG","GAO","GE","GEI","GEN","GENG","GONG","GOU","GU","GUA","GUAI","GUAN","GUANG","GUI","GUN","GUO","HA","HAI","HAN","HANG","HAO","HE","HEI","HEN","HENG","HM","HONG","HOU","HU","HUA","HUAI","HUAN","HUANG","HUI","HUN","HUO","JI","JIA","JIAN","JIANG","JIAO","JIE","JIN","JING","JIONG","JIU","JU","JUAN","JUE","JUN","KA","KAI","KAN","KANG","KAO","KE","KEN","KENG","KONG","KOU","KU","KUA","KUAI","KUAN","KUANG","KUI","KUN","KUO","LA","LAI","LAN","LANG","LAO","LE","LEI","LENG","LI","LIA","LIAN","LIANG","LIAO","LIE","LIN","LING","LIU","LO","LONG","LOU","LU","LV","LUAN","LVE","LUN","LUO","M","MA","MAI","MAN","MANG","MAO","ME","MEI","MEN","MENG","MI","MIAN","MIAO","MIE","MIN","MING","MIU","MO","MOU","MU","N","NA","NAI","NAN","NANG","NAO","NE","NEI","NEN","NENG","NI","NIAN","NIANG","NIAO","NIE","NIN","NING","NIU","NONG","NOU","NU","NV","NUAN","NVE","NUN","NUO","O","OU","PA","PAI","PAN","PANG","PAO","PEI","PEN","PENG","PI","PIAN","PIAO","PIE","PIN","PING","PO","POU","PU","QI","QIA","QIAN","QIANG","QIAO","QIE","QIN","QING","QIONG","QIU","QU","QUAN","QUE","QUN","RAN","RANG","RAO","RE","REN","RENG","RI","RONG","ROU","RU","RUA","RUAN","RUI","RUN","RUO","SA","SAI","SAN","SANG","SAO","SE","SEN","SENG","SHA","SHAI","SHAN","SHANG","SHAO","SHE","SHEN","SHENG","SHI","SHOU","SHU","SHUA","SHUAI","SHUAN","SHUANG","SHUI","SHUN","SHUO","SI","SONG","SOU","SU","SUAN","SUI","SUN","SUO","TA","TAI","TAN","TANG","TAO","TE","TENG","TI","TIAN","TIAO","TIE","TING","TONG","TOU","TU","TUAN","TUI","TUN","TUO","WA","WAI","WAN","WANG","WEI","WEN","WENG","WO","WU","XI","XIA","XIAN","XIANG","XIAO","XIE","XIN","XING","XIONG","XIU","XU","XUAN","XUE","XUN","YA","YAN","YANG","YAO","YE","YI","YIN","YING","YO","YONG","YOU","YU","YUAN","YUE","YUN","ZA","ZAI","ZAN","ZANG","ZAO","ZE","ZEI","ZEN","ZENG","ZHA","ZHAI","ZHAN","ZHANG","ZHAO","ZHE","ZHEN","ZHENG","ZHI","ZHONG","ZHOU","ZHU","ZHUA","ZHUAI","ZHUAN","ZHUANG","ZHUI","ZHUN","ZHUO","ZI","ZONG","ZOU","ZU","ZUAN","ZUI","ZUN","ZUO",""],UNIHANS:["阿","哎","安","肮","凹","八","挀","扳","邦","勹","陂","奔","伻","屄","边","灬","憋","汃","冫","癶","峬","嚓","偲","参","仓","撡","冊","嵾","曽","叉","芆","辿","伥","抄","车","抻","阷","吃","充","抽","出","欻","揣","巛","刅","吹","旾","逴","呲","匆","凑","粗","汆","崔","邨","搓","咑","呆","丹","当","刀","嘚","扥","灯","氐","甸","刁","爹","丁","丟","东","吺","厾","耑","垖","吨","多","妸","诶","奀","鞥","儿","发","帆","匚","飞","分","丰","覅","仏","紑","夫","旮","侅","甘","冈","皋","戈","给","根","刯","工","勾","估","瓜","乖","关","光","归","丨","呙","哈","咍","佄","夯","茠","诃","黒","拫","亨","噷","叿","齁","乎","花","怀","欢","巟","灰","昏","吙","丌","加","戋","江","艽","阶","巾","坕","冂","丩","凥","姢","噘","军","咔","开","刊","忼","尻","匼","肎","劥","空","抠","扝","夸","蒯","宽","匡","亏","坤","扩","垃","来","兰","啷","捞","肋","勒","崚","哩","俩","奁","良","撩","毟","拎","伶","溜","囖","龙","瞜","噜","驴","娈","掠","抡","罗","呣","妈","埋","嫚","牤","猫","么","呅","门","甿","咪","宀","喵","乜","民","名","谬","摸","哞","毪","嗯","拏","腉","囡","囔","孬","疒","娞","恁","能","妮","拈","娘","鸟","捏","囜","宁","妞","农","羺","奴","女","奻","疟","黁","挪","喔","讴","妑","拍","眅","乓","抛","呸","喷","匉","丕","囨","剽","氕","姘","乒","钋","剖","仆","七","掐","千","呛","悄","癿","亲","靑","卭","丘","区","峑","缺","夋","呥","穣","娆","惹","人","扔","日","茸","厹","邚","挼","堧","婑","瞤","捼","仨","毢","三","桒","掻","閪","森","僧","杀","筛","山","伤","弰","奢","申","升","尸","収","书","刷","衰","闩","双","脽","吮","说","厶","忪","捜","苏","狻","夊","孙","唆","他","囼","坍","汤","夲","忑","熥","剔","天","旫","帖","厅","囲","偷","凸","湍","推","吞","乇","穵","歪","弯","尣","危","昷","翁","挝","乌","夕","虲","仙","乡","灱","些","心","星","凶","休","吁","吅","削","坃","丫","恹","央","幺","倻","一","囙","应","哟","佣","优","扜","囦","曰","晕","帀","災","兂","匨","傮","则","贼","怎","増","扎","捚","沾","张","佋","蜇","贞","争","之","中","州","朱","抓","拽","专","妆","隹","宒","卓","乲","宗","邹","租","钻","厜","尊","昨","兙"],EXCEPTIONS:{曾:"ZENG",沈:"SHEN",嗲:"DIA",碡:"ZHOU",聒:"GUO",炔:"QUE",蚵:"KE",砉:"HUA",嬤:"MO",嬷:"MO",蹒:"PAN",蹊:"XI",丬:"PAN",霰:"XIAN",莘:"XIN",豉:"CHI",饧:"XING",筠:"JUN",长:"CHANG",帧:"ZHEN",峙:"SHI",郍:"NA",芎:"XIONG",谁:"SHUI"}};let jr,zr=null;function Br(e){return e||null===zr?("object"==typeof Intl&&Intl.Collator?(jr=new Intl.Collator(["zh-Hans-CN","zh-CN"]),zr=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):zr=!1,zr):zr}function Wr(e){const t=Ur.UNIHANS,a=Ur.PINYINS,r=Ur.EXCEPTIONS,l={source:e};if(e in r)return l.type=2,l.target=r[e],l;let n,i=-1;if(e.charCodeAt(0)<256)return l.type=1,l.target=e,l;if(n=jr.compare(e,"阿"),n<0)return l.type=3,l.target=e,l;if(0===n)l.type=2,i=0;else{if(n=jr.compare(e,"鿿"),n>0)return l.type=3,l.target=e,l;0===n&&(l.type=2,i=t.length-1)}if(l.type=2,i<0){let a=0,r=t.length-1;for(;a<=r;){i=~~((a+r)/2);const l=t[i];if(n=jr.compare(e,l),0===n)break;n>0?a=i+1:r=i-1}}return n<0&&i--,l.target=a[i],l.target||(l.type=3,l.target=l.source),l}function Gr(e){return"string"==typeof e&&Br()?e.split("").map((e=>Wr(e))):e}const Yr={isSupported:Br,parse:Gr,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Ur)})))},genToken:Wr,convertToPinyin:(e,t,a)=>Gr(e).map((e=>t&&2===e.type?e.target.toLowerCase():e.target)).join(a||"")},Zr={patcher:function(e){e.EXCEPTIONS={嗲:"DIA",碡:"ZHOU",聒:"GUO",炔:"QUE",蚵:"KE",砉:"HUA",嬷:"MO",蹊:"XI",丬:"PAN",霰:"XIAN",豉:"CHI",饧:"XING",帧:"ZHEN",芎:"XIONG",谁:"SHUI",钶:"KE"},e.UNIHANS[91]="伕",e.UNIHANS[347]="仚",e.UNIHANS[393]="诌",e.UNIHANS[39]="婤",e.UNIHANS[50]="腠",e.UNIHANS[369]="攸",e.UNIHANS[123]="乯",e.UNIHANS[171]="刕",e.UNIHANS[102]="佝",e.UNIHANS[126]="犿",e.UNIHANS[176]="列",e.UNIHANS[178]="刢",e.UNIHANS[252]="娝",e.UNIHANS[330]="偸"},shouldPatch:function(e){return"function"==typeof e&&"FOU"===e("伕").target&&"XIA"===e("仚").target&&"ZHONG"===e("诌").target&&"CHONG"===e("婤").target&&"CONG"===e("腠").target&&"YONG"===e("攸").target&&"HOU"===e("乯").target&&"LENG"===e("刕").target&&"GONG"===e("佝").target&&"HUAI"===e("犿").target&&"LIAO"===e("列").target&&"LIN"===e("刢").target&&"E"===e("钶").target}};Yr.isSupported()&&Zr.shouldPatch(Yr.genToken)&&Yr.patchDict(Zr);const Xr=Yr;function Qr(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Jr(){return Jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Jr.apply(this,arguments)}const{Option:el}=N.Select,tl=e=>{const{$$form:a}=t().useContext(Ft),{value:r,items:l,multiple:n,loading:i,onChange:o,onValuesChange:s}=e,{options:c={},style:u={},placeholder:p=d("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,readOnly:f,disabled:g}=e.option,{itemList:b=[],filterable:y=!0,listHeight:v=jt,collapseTags:x,maxTagTextLength:E,openPyt:C=!0}=c,S=(0,Y.xb)(b)?l:b,w=e=>{var t;return n?S.filter((t=>null==e?void 0:e.includes(t.value))).map((e=>e.text)).join(","):(null===(t=S.find((t=>t.value===e)))||void 0===t?void 0:t.text)||""};return a.isOnlyShow?t().createElement(fa,{value:w(r),bordered:h}):t().createElement(N.Select,Jr({value:r,mode:n?"multiple":void 0,placeholder:p,style:u,loading:i,bordered:h,allowClear:m,disabled:g,showSearch:y,listHeight:v,maxTagCount:x?"responsive":void 0,maxTagTextLength:E},n?{title:w(r)}:null,{filterOption:(e,t)=>{var a;const r=(null==t||null===(a=t.children)||void 0===a?void 0:a.toString())||"",l=Xr.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(C?`${r}|${l}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,w(e),S)})(e)}}),S.map((e=>t().createElement(el,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class al extends e.Component{constructor(){super(...arguments),Qr(this,"state",{itemList:[],loading:!1}),Qr(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:a={},dataKey:r,valueKey:l="value",textKey:n="text",callback:i}=e;if(t){this.setState({loading:!0});try{const e=await t(a);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,r)??[],a=t.map((e=>({value:e[l],text:e[n]})));this.setState({itemList:a},(()=>null==i?void 0:i(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,a;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,l=null===(a=this.props.option.request)||void 0===a?void 0:a.params;(0,ca.isEqual)(r,l)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:a,loading:r}=this.state,{type:l,label:n,tooltip:i,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,buttonAfter:h,validateTrigger:m,rules:f=[],onChange:g=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(n),className:oe()(o,u),tooltip:i,hidden:s,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(d)},required:e.getFormItemRequired(f)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:o,noStyle:!0,rules:f,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(n)}},t().createElement(tl,{option:this.props.option,items:a,loading:r,multiple:this.props.multiple,onValuesChange:(t,a,r)=>{g(t,a,r),e.setViewValue(o,a)}}))),h&&t().createElement(N.Col,null,e.renderFormItemButton(o,h)),p&&t().createElement(N.Col,{flex:(0,Y.PM)(p.labelWidth||Kt)},e.renderFormItemExtra({fieldName:o,...p}))))}}Qr(al,"contextType",Ft);const rl=al;function ll(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class nl extends e.Component{constructor(e){super(e),ll(this,"searchHelper",void 0),ll(this,"alias",void 0),ll(this,"extras",void 0),ll(this,"valueKey",void 0),ll(this,"prevValue",""),ll(this,"_record",void 0),ll(this,"_prevValue",void 0),ll(this,"searchRef",t().createRef()),ll(this,"state",{itemList:[],visible:!1,loading:!1,activeIndex:0}),ll(this,"initialHandle",(async()=>{await this.props.waiting();const{helperConfig:e}=this.props,{fieldName:t,options:a,searchHelper:r}=this.props.option;this.searchHelper=Object.assign({},e,a,r);const{fieldAliasMap:l,extraAliasMap:n,fieldsDefine:i}=this.searchHelper;if(l||m("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof l?l():l||{},this.extras="function"==typeof n?n():n||{},i){const e=["valueKey","displayKey","extraKey"];for(const t in i)e.includes(t)&&(this[t]=i[t])}Object.keys(this.alias).includes(t)||m("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),this.searchHelper.echoRequest&&!this.valueKey&&m("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),ll(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),ll(this,"getLatestRequest",(()=>{var e;const{request:t,searchHelper:a}=this.props.option;return Object.assign({},null===(e=this.searchHelper)||void 0===e?void 0:e.request,t,null==a?void 0:a.request)})),ll(this,"getItemText",(async()=>{await this.props.waiting();const e=this.getItemValue();if(e===this._prevValue)return;this._prevValue=e;const{fetchApi:t,params:a={},formatter:r=(e=>e),dataKey:l,fieldAliasMap:n,extraAliasMap:i}=this.searchHelper.echoRequest||{},o="function"==typeof n?n():n||{},s="function"==typeof i?i():i||{},{value:c}=this.props;if(t&&!c&&e)try{const n=await t(r({...a,key:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:(0,Y.U2)(n.data,l)??[];if(e[0]){const t=e[0];o&&aa(t,this.alias,o),s&&ra(t,this.extras,s),this._record=t,this.setFieldsValue(t)}}}catch(e){}})),ll(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:a}=this.props.option;for(const r in this.alias){const l=ta(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:l}),r===a&&t.setViewValue(a,l)}for(const a in this.extras)t.SET_FIELDS_EXTRA({[a]:ta(e,this.extras[a])});this._record=e,this.prevValue=ta(e,this.alias[a])??""})),ll(this,"fetchHandle",(0,Y.Ds)(this.getItemList,200)),ll(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),ll(this,"triggerChange",((e,t)=>{const{onChange:a,onValuesChange:r}=this.props;null==a||a(e),t&&r(e,this._record)})),ll(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),ll(this,"clickHandle",((e,t)=>{const{$$form:a}=this.context,{fieldName:r}=this.props.option;for(const t in this.alias)t!==r&&a.SET_FIELDS_VALUE({[t]:ta(e,this.alias[t])});for(const t in this.extras)a.SET_FIELDS_EXTRA({[t]:ta(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const l=ta(e,this.alias[r]);this.prevValue=l??"",this.triggerChange(l,!0),t&&t()})),this.initialHandle()}componentDidMount(){this.getItemText()}componentDidUpdate(e){var t,a,r,l,n,i;const o=(null===(t=e.option.searchHelper)||void 0===t||null===(a=t.request)||void 0===a?void 0:a.params)||(null===(r=e.option.request)||void 0===r?void 0:r.params),s=(null===(l=this.props.option.searchHelper)||void 0===l||null===(n=l.request)||void 0===n?void 0:n.params)||(null===(i=this.props.option.request)||void 0===i?void 0:i.params);(0,ca.isEqual)(o,s)||this.getItemList(),this.getItemText()}async getItemList(e){const{fieldName:t}=this.props.option,{fetchApi:a,params:r={},formatter:l=(e=>e),dataKey:n}=this.getLatestRequest();if(a){this.setState({loading:!0});try{const i=await a(l({...r,[t]:e}));if(200===i.code){const e=Array.isArray(i.data)?i.data:(0,Y.U2)(i.data,n)??[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}render(){var e;const{$$form:a}=this.context,{visible:r,loading:n,itemList:i}=this.state,{value:o}=this.props,{options:s={},style:c={},placeholder:u=d("qm.form.inputPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:f}=this.props.option,{hideHeader:g,onlySelect:b=!0,listHeight:y=jt}=s,v=(null===(e=this.searchHelper)||void 0===e?void 0:e.columns)||[],x=se("form-immediate"),E=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,C=t().createElement(N.Spin,{spinning:n},i.length?t().createElement("table",{cellSpacing:0,cellPadding:0,className:oe()("table")},!g&&t().createElement("thead",null,t().createElement("tr",null,v.filter((e=>!e.hidden)).map((e=>t().createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),t().createElement("tbody",null,i.map(((e,a)=>t().createElement("tr",{key:a,className:this.state.activeIndex===a?"active":"",onMouseEnter:()=>{this.setState({activeIndex:a})},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},v.filter((e=>!e.hidden)).map((a=>t().createElement("td",{key:a.dataIndex},(0,Y.U2)(e,a.dataIndex))))))))):t().createElement(Ze,null));return t().createElement(l.Consumer,null,(e=>{const l={[x]:!0,[`${x}--lg`]:"large"===(null==e?void 0:e.size),[`${x}--sm`]:"small"===(null==e?void 0:e.size)};return a.isOnlyShow?t().createElement(fa,{value:o,bordered:p}):t().createElement(Ua(),{action:f?[]:["click"],popupVisible:!f&&r,popup:C,popupClassName:oe()(l),popupStyle:{minWidth:E,maxHeight:y},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Bt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(N.Input,{ref:this.searchRef,placeholder:u,allowClear:h,bordered:p,readOnly:m,disabled:f,style:{width:"100%",...c},value:o,title:o,onFocus:()=>{!i.length&&this.fetchHandle(o)},onBlur:e=>{const{value:t}=e.target;b&&t!==this.prevValue&&this.triggerChange(this.prevValue,!1),this.triggerBlur(t)},onKeyUp:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(i[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const a=40===e.keyCode?++t%i.length:(--t+i.length)%i.length;this.setState({activeIndex:a})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),t?(this.handleVisibleChange(!0),this.triggerChange(t,!b)):this.clickHandle(null)}}))}))}}ll(nl,"contextType",Ft);class il extends e.Component{constructor(e,t){let{$$form:a}=t;super(e),ll(this,"promiseRef",void 0),ll(this,"state",{searchHelper:{}}),ll(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){h("Form","搜索帮助获取定义信息的接口出错")}})),ll(this,"getHelperConfig",(e=>{var t,a;const{global:r}=e,{name:l,fieldsDefine:n}=this.props.option.searchHelper||{};if(!l)return;if(null==r||null===(t=r.searchHelper)||void 0===t||!t.getServerConfig||null==r||null===(a=r.searchHelper)||void 0===a||!a.createFetchApi)return m("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,t)=>{try{const a=await r.searchHelper.getServerConfig({searchHelperId:l});if(200===a.code){const t=sa(Object.assign({},a.data,n),i,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))})),this.getHelperConfig(a.context)}render(){const{$$form:e}=this.context,{searchHelper:a}=this.state,{type:r,label:l,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(l),className:oe()(i,d),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(c)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t().createElement(nl,{option:this.props.option,helperConfig:a,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;f(t,a),e.setViewValue(i,t)}}))),p&&t().createElement(N.Col,null,e.renderFormItemButton(i,p)),u&&t().createElement(N.Col,{flex:(0,Y.PM)(u.labelWidth||Kt)},e.renderFormItemExtra({fieldName:i,...u}))))}}ll(il,"contextType",Ft);const ol=il;class sl extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,fieldName:l,className:n,style:i={},collapse:o={}}=this.props.option,{expand:s}=e.state,{showLimit:c,remarkItems:d=[],onCollapse:u=Y.ZT}=o,p=[];if(d.length){const t=e.getBlockDerivedItems().find((e=>e[0].fieldName===l))??[],a=c??t.length-1;t.slice(a+1).forEach((t=>{const a=d.find((e=>e.fieldName===t.fieldName));if(!a)return;const r=a.showLabel?`${t.label}:`:"",l=e.getViewValue(t.fieldName)??"";""!==l&&p.push({...t,text:`${r}${l}`})}))}return t().createElement(N.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},t().createElement(pe,{id:l,label:r,className:n,extra:p.map((e=>e.text)).join(" | "),style:{...i},collapse:s[l],onCollapseChange:t=>{e.setState((e=>({expand:Object.assign({},e.expand,{[l]:t})}))),u(t)}}))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(sl,"contextType",Ft);const cl=sl;function dl(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function ul(){return ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ul.apply(this,arguments)}const pl=(e,t,a,r)=>e.map((e=>e[a]===t?{...e,children:r}:e.children?{...e,children:pl(e.children,t,a,r)}:e)),hl=e=>{const{$$form:a}=t().useContext(Ft),{value:r,items:l,multiple:n,loading:i,onChange:o,onValuesChange:s}=e,{options:c={},style:u={},placeholder:p=d("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,asyncLoad:f,readOnly:g,disabled:b}=e.option,{itemList:y,filterable:v=!0,listHeight:x=jt,checkStrictly:E,checkStrategy:C="SHOW_CHILD",collapseTags:S,openPyt:w=!0}=c,[T,I]=t().useState((0,Y.xb)(y)?l:y);Se((()=>{I((0,Y.xb)(y)?l:y)}),[y,l]);const _=e=>{var t;return(null===(t=na(T,e))||void 0===t?void 0:t.text)||""},R=e=>n?e.map((e=>_(e))).filter((e=>!!e)).join(","):_(e);return a.isOnlyShow?t().createElement(fa,{value:R(r),bordered:h}):t().createElement(N.TreeSelect,ul({fieldNames:{label:"text",value:"value",children:"children"},value:r,multiple:n,treeCheckable:n,treeCheckStrictly:E,showCheckedStrategy:N.TreeSelect[C],placeholder:p,listHeight:x,style:u,loading:i,bordered:h,allowClear:m,disabled:b,treeDefaultExpandAll:!f,showSearch:v,maxTagCount:S?"responsive":void 0,loadData:f?async e=>{let{key:t,children:a}=e;if(!f||a)return;const{fetchApi:r,params:l,dataKey:n,textKey:i="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=f;if(r)try{const e=await r(c({...l,[o]:t}));if(200===e.code){const a=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,n)??[],r=pl(T,t,o,la(a,o,i));I(r),null==s||s(a)}}catch(e){}}:void 0,treeData:T},n?{title:R(r)}:null,{filterTreeNode:(e,t)=>{var a;const r=(null==t||null===(a=t.text)||void 0===a?void 0:a.toString())||"",l=Xr.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(w?`${r}|${l}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,R(e),T)})(e)}}))};class ml extends e.Component{constructor(){super(...arguments),dl(this,"state",{itemList:[],loading:!1}),dl(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:a={},dataKey:r,valueKey:l="value",textKey:n="text",callback:i}=e;if(t){this.setState({loading:!0});try{const e=await t(a);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,r)??[],a=la(t,l,n);this.setState({itemList:a},(()=>null==i?void 0:i(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,a;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,l=null===(a=this.props.option.request)||void 0===a?void 0:a.params;(0,ca.isEqual)(r,l)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:a,loading:r}=this.state,{type:l,label:n,tooltip:i,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(n),className:oe()(o,u),tooltip:i,hidden:s,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(d)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:o,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},t().createElement(hl,{option:this.props.option,items:a,loading:r,multiple:this.props.multiple,onValuesChange:(t,a,r)=>{f(t,a,r),e.setViewValue(o,a)}}))),p&&t().createElement(N.Col,{flex:(0,Y.PM)(p.labelWidth||Kt)},e.renderFormItemExtra({fieldName:o,...p}))))}}dl(ml,"contextType",Ft);const fl=ml;function gl(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function bl(){return bl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},bl.apply(this,arguments)}const yl=e=>{const{$$form:a}=t().useContext(Ft),{value:r,multiple:l,items:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.selectPlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{changeOnSelect:m,checkStrictly:f,checkStrategy:g="SHOW_PARENT",filterable:b=!0,openPyt:y=!0}=i,{itemList:v=[]}=i,x=(0,Y.xb)(v)?n:v,E=e=>(0,Y.xb)(e)?"":l?e.map((e=>ia(x,e).map((e=>e.text)).join("/"))).join(","):ia(x,e).map((e=>e.text)).join("/");return a.isOnlyShow?t().createElement(fa,{value:E(r),bordered:c}):t().createElement(N.Cascader,bl({value:(e=>(0,Y.xb)(e)?[]:l?e.map((e=>e.split(","))):e.split(","))(r),fieldNames:{label:"text",value:"value",children:"children"},options:x,multiple:l,maxTagCount:"responsive",changeOnSelect:m||f,showCheckedStrategy:N.Cascader[g],placeholder:s,style:o,bordered:c,allowClear:u,disabled:h,showSearch:b&&{filter:(e,t)=>t.some((t=>{var a;const r=(null==t||null===(a=t.text)||void 0===a?void 0:a.toString())||"",l=Xr.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(y?`${r}|${l}`:r).toLowerCase().indexOf(e.toLowerCase())>=0}))}},l?{title:E(r)}:null,{onChange:t=>{(t=>{const{onChange:a,onValuesChange:r}=e;null==a||a(t),r(t,E(t),x)})(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return l?e.map((e=>e.join(","))):e.join(",")}(t))}}))};class vl extends e.Component{constructor(){super(...arguments),gl(this,"state",{itemList:[],loading:!1}),gl(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:a={},dataKey:r,valueKey:l="value",textKey:n="text",callback:i}=e;if(t){this.setState({loading:!0});try{const e=await t(a);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Y.U2)(e.data,r)??[],a=la(t,l,n);this.setState({itemList:a},(()=>null==i?void 0:i(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,a;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,l=null===(a=this.props.option.request)||void 0===a?void 0:a.params;(0,ca.isEqual)(r,l)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:a}=this.props,{itemList:r}=this.state,{type:l,label:n,tooltip:i,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(n),className:oe()(o,u),tooltip:i,hidden:s,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(d)},required:e.getFormItemRequired(m)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:o,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},t().createElement(yl,{option:this.props.option,multiple:a,items:r,onValuesChange:(t,a,r)=>{f(t,a,r),e.setViewValue(o,a)}}))),p&&t().createElement(N.Col,{flex:(0,Y.PM)(p.labelWidth||Kt)},e.renderFormItemExtra({fieldName:o,...p}))))}}gl(vl,"contextType",Ft);const xl=vl,El=require("china-area-data");var Cl=__webpack_require__.n(El);function Sl(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const wl=["110000","120000","310000","500000"],Tl=["810000","820000"],Nl=[{text:"A",value:"A"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"L",value:"L"},{text:"N",value:"N"},{text:"Q",value:"Q"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Il=[{text:"A",value:"A"},{text:"B",value:"B"},{text:"C",value:"C"},{text:"D",value:"D"},{text:"E",value:"E"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"K",value:"K"},{text:"L",value:"L"},{text:"M",value:"M"},{text:"N",value:"N"},{text:"P",value:"P"},{text:"Q",value:"Q"},{text:"R",value:"R"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"W",value:"W"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],_l=e=>Xr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Rl=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(a>2||!e[t])return;const r="86"===t?Object.keys(e[t]).filter((e=>![...wl,...Tl].includes(e))):Object.keys(e[t]);return r.map((r=>({l:_l(e[t][r].slice(0,1)).toUpperCase(),n:e[t][r],c:r,p:t,children:Rl(e,r,a+1)})))},Pl=(e,t)=>t.map((t=>({l:_l(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Ol extends e.Component{constructor(e){super(e),Sl(this,"searchRef",t().createRef()),Sl(this,"scrollRef",t().createRef()),Sl(this,"zxsAndGa",void 0),Sl(this,"provinces",void 0),Sl(this,"allCities",void 0),Sl(this,"letterCities",void 0),Sl(this,"state",{visible:!1,select_type:"0",active_key:""}),Sl(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),Sl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props;null==t||t(e),a(e,this.createTextValue(e)),this.handleVisibleChange(!1)})),this.zxsAndGa=this.createZxsAndGa(),this.provinces=this.createProvince(),this.allCities=this.createAllCity(),this.letterCities=this.createCity()}componentDidMount(){this.setInputReadonly()}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),ct()(this[`${e}Ref`],{block:"start",behavior:"smooth",boundary:this.scrollRef.current})}clickHadnle(e){this.triggerChange(e)}createTextValue(e){var t;return(null===(t=this.allCities.find((t=>t.c===e)))||void 0===t?void 0:t.n)||""}createZxsAndGa(){return[{l:"Z1",n:"直辖市",c:"",p:"",children:Pl(Cl(),wl)},{l:"Z2",n:"港澳",c:"",p:"",children:Pl(Cl(),Tl)}]}createProvince(){return(Rl(Cl(),"86")??[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Il.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...wl,...Tl].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return t().createElement(N.Radio.Group,{size:"small",buttonStyle:"solid",value:e,onChange:e=>{const{value:t}=e.target;this.setState({select_type:t,active_key:""},(()=>{this.scrollRef.current.scrollTop=0}))}},t().createElement(N.Radio.Button,{value:"0"},d("qm.form.citySelectType.0")),t().createElement(N.Radio.Button,{value:"1"},d("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:a}=this.state;return("0"===a?Nl:Il).map((a=>t().createElement("li",{key:a.value,className:oe()({tag:!0,actived:a.value===e}),onClick:()=>this.scrollHandle(a.value.toString())},a.text)))}renderSelect(){const{value:e}=this.props;return t().createElement(N.Select,{size:"small",placeholder:d("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var a;return((null==t||null===(a=t.children)||void 0===a?void 0:a.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>t().createElement(N.Select.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:a}=this.state;return("0"===a?this.provinces:this.letterCities).map(((a,r)=>{var l;return t().createElement("div",{key:r},t().createElement("dt",{ref:e=>this[`${a.l}Ref`]=e},a.n,":"),t().createElement("dd",null,null===(l=a.children)||void 0===l?void 0:l.map((a=>t().createElement("li",{key:a.c,className:oe()({actived:a.c===e}),onClick:()=>this.clickHadnle(a.c)},a.n)))))}))}render(){const{$$form:e}=this.context,{visible:a}=this.state,{value:r}=this.props,{options:n={},style:i={},placeholder:o=d("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:u,disabled:p}=this.props.option,h=se("form-city-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,f=this.createTextValue(r),g=t().createElement("div",{className:"container",style:{...i}},t().createElement("div",{className:"city-drop"},t().createElement("div",{className:"city-drop-toper"},t().createElement("div",{className:"city-drop-toper__type"},this.renderType()),t().createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),t().createElement("div",{className:"city-drop-letter"},this.renderLetter()),t().createElement("div",{ref:this.scrollRef,className:"city-drop-list"},t().createElement("dl",null,this.renderCity(r)))));return t().createElement(l.Consumer,null,(r=>{const l={[h]:!0,[`${h}--lg`]:"large"===(null==r?void 0:r.size),[`${h}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t().createElement(fa,{value:f,bordered:s}):t().createElement(Ua(),{action:p?[]:["click"],popupVisible:!p&&a,popup:g,popupClassName:oe()(l),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Bt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(N.Input,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,readOnly:u,disabled:p,style:{width:"100%",...i},value:f,title:f,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}}))}))}}Sl(Ol,"contextType",Ft);class Al extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Ol,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}Sl(Al,"contextType",Ft);const kl=Al;function Hl(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const Fl=(e,t)=>{if(e[t])return Object.keys(e[t]).map((a=>({text:e[t][a],value:a,children:Fl(e,a)})))};class Ll extends e.Component{constructor(e){super(e),Hl(this,"searchRef",t().createRef()),Hl(this,"prevText",void 0),Hl(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),Hl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:a}=this.props;null==t||t(e),a(e,this.createTextValue(e)),this.handleVisibleChange(!1)}));const a=Fl(Cl(),"86")||[];this.state={results:a,visible:!1,values:[],tabs:[a.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:a}=this.props;t!==a&&this.state.values.join(",")!==(a??"")&&this.initial()}get isFetch(){var e;return!(null===(e=this.props.option.request)||void 0===e||!e.fetchApi)}get leave(){return this.isFetch?4:3}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var a,r;return null===(a=this.state.tabs[t])||void 0===a||null===(r=a.find((t=>t.value===e)))||void 0===r?void 0:r.text})).join("/")}initial(){const{value:e}=this.props,t=e?e.split(","):[];this.setState({values:t},(()=>{this.createTabs(),this.createActiveName(t.length?t.length-1:0)}))}createActiveName(e){this.setState({activeName:e.toString()})}createTabs(){const{results:e,values:t}=this.state;if(!e.length)return;const a=this.state.tabs.slice(0,1);for(let r=0;r<t.length;r++){const l=na(e,t[r]);if(l&&(0,Y.xb)(l.children)){this.isFetch&&this.getStreetList(t[r]);break}Array.isArray(null==l?void 0:l.children)&&(a[r+1]=null==l?void 0:l.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:a})}async getStreetList(e){const{request:t={}}=this.props.option,{fetchApi:a,formatter:r=(e=>e),dataKey:l,valueKey:n="value",textKey:i="text"}=t;if(a)try{const t=await a(r({code:e}));if(200===t.code){const e=Array.isArray(t.data)?t.data:(0,Y.U2)(t.data,l)??[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[i],value:e[n]})))]})))}}catch(e){}}renderTabs(){const{values:e}=this.state,a=this.state.tabs.map(((a,r)=>{var l;const n=(null===(l=a.find((t=>t.value===e[r])))||void 0===l?void 0:l.text)||`${d("qm.form.selectPlaceholder").replace("...","")}(${d("qm.form.regionSelectLabel")[r]})`;return t().createElement(N.Tabs.TabPane,{key:r.toString(),tab:n},t().createElement("div",{className:"region-box"},a.map((a=>t().createElement("span",{key:a.value,className:oe()({"region-box__item":!0,actived:e.includes(a.value.toString())}),title:a.text,onClick:()=>{let{values:e}=this.state;e[r]=a.value.toString(),e=e.slice(0,r+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.leave-1:this.leave;if(r+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(r+1)}))}},a.text)))))}));return a.length?t().createElement(N.Tabs,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},a):t().createElement(Ze,null)}render(){const{$$form:e}=this.context,{visible:a}=this.state,{value:r}=this.props,{options:n={},style:i={},placeholder:o=d("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:u,disabled:p}=this.props.option,h=se("form-region-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,f=t().createElement("div",{className:"container"},this.renderTabs());let g=this.prevText;if(!a){const e=this.createTextValue(r);(""===e||e.split("/").every((e=>""!==e)))&&(g=e,this.prevText=g)}return t().createElement(l.Consumer,null,(r=>{const l={[h]:!0,[`${h}--lg`]:"large"===(null==r?void 0:r.size),[`${h}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t().createElement(fa,{value:g,bordered:s}):t().createElement(Ua(),{action:p?[]:["click"],popupVisible:!p&&a,popup:f,popupClassName:oe()(l),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Bt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(N.Input,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,style:{width:"100%",...i},readOnly:u,disabled:p,value:g,title:g,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&(0,Y.Y3)((()=>this.initial()))}}))}))}}Hl(Ll,"contextType",Ft);class ql extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Ll,{option:this.props.option,onValuesChange:(t,a)=>{h(t),e.setViewValue(n,a)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}Hl(ql,"contextType",Ft);const Dl=ql,$l=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},upload:o={},style:s={},disabled:c}=e.option,{multiple:d=!0,maxCount:u=1,fileTypes:p,fileSize:h,onRemove:m}=i,{action:f,headers:g,params:b,withCredentials:y=!1,dataKey:v="",fieldAliasMap:x,button:E}=o,C="function"==typeof x?x():x||{};return t().createElement(_n,{name:"file",action:f,multiple:d,headers:g,data:b,withCredentials:y,maxCount:u,fileTypes:p,fileSize:h,disabled:c||a.isOnlyShow,button:E,showUploadList:{showDownloadIcon:!0,downloadIcon:t().createElement(ce.DownloadOutlined,null)},fileList:r,onChange:e=>{let{file:t,fileList:a}=e;(e=>{const t=e.map((e=>{var t,a;const r={};for(const t in C){var l,n;r[t]=e[t]||(null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n?void 0:n[C[t]])||""}return{uid:e.uid,name:e.name,...r,url:e.url||(v?(0,Y.U2)(null===(a=e.response)||void 0===a?void 0:a.data,v):null===(t=e.response)||void 0===t?void 0:t.data)||"",status:e.status}}));null==l||l(t),t.every((e=>"done"===e.status&&e.url))&&n(t)})(a)},onRemove:m})};class Ml extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement($l,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(n,"")}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Ml,"contextType",Ft);const Kl=Ml,Vl=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},upload:o={},style:s={},disabled:c}=e.option,{multiple:d=!0,maxCount:u=1,fixedSize:p,quality:h,openCropper:m,fileTypes:f,fileSize:g,onRemove:b}=i,{action:y,headers:v,params:x,withCredentials:E=!1,dataKey:C="",fieldAliasMap:S}=o,w="function"==typeof S?S():S||{};return t().createElement(Fn,{name:"file",action:y,multiple:d,headers:v,data:x,withCredentials:E,maxCount:u,fixedSize:p,quality:h,openCropper:m,fileTypes:f,fileSize:g,disabled:c||a.isOnlyShow,fileList:r,onChange:e=>{let{file:t,fileList:a}=e;(e=>{const t=e.map((e=>{var t,a;const r={};for(const t in w){var l,n;r[t]=e[t]||(null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n?void 0:n[w[t]])||""}return{uid:e.uid,name:e.name,...r,url:e.url||(C?(0,Y.U2)(null===(a=e.response)||void 0===a?void 0:a.data,C):null===(t=e.response)||void 0===t?void 0:t.data)||"",status:e.status}}));null==l||l(t),t.every((e=>"done"===e.status&&e.url))&&n(t)})(a)},onRemove:b})};class Ul extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(Vl,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(n,"")}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Ul,"contextType",Ft);const jl=Ul,zl=e=>{const{$$form:a}=t().useContext(Ft),{value:r,onChange:l,onValuesChange:n}=e,{options:i={},upload:o,style:s={},placeholder:c=d("qm.form.inputPlaceholder"),readOnly:u,disabled:p}=e.option,{tinymce:h,thresholdSize:m}=i;return t().createElement(vn,{value:r,tinymce:h,upload:o,thresholdSize:m,style:{width:"100%",...s},disabled:u||p||a.isOnlyShow,onChange:e=>{(e=>{null==l||l(e),n(e)})(e)}})};class Bl extends e.Component{render(){const{$$form:e}=this.context,{type:a,label:r,tooltip:l,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=Y.ZT}=this.props.option;return t().createElement(N.Form.Item,{label:e.renderFormLabel(r),className:oe()(n,c),tooltip:l,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,Y.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(N.Row,{wrap:!1,gutter:4},t().createElement(N.Col,{flex:"auto"},t().createElement(N.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(zl,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(n,t)}}))),d&&t().createElement(N.Col,{flex:(0,Y.PM)(d.labelWidth||Kt)},e.renderFormItemExtra({fieldName:n,...d}))))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(Bl,"contextType",Ft);const Wl=Bl;function Gl(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Yl extends e.Component{constructor(e){super(e),Gl(this,"provide",{$$form:this,echo_data:{}}),Gl(this,"_initialValues",void 0),Gl(this,"_initialOthers",void 0),Gl(this,"_initialExtras",void 0),Gl(this,"wrapperRef",t().createRef()),Gl(this,"formRef",t().createRef()),Gl(this,"state",{formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:this.props.cols??4,collapse:!1}),Gl(this,"resizeObserveHandler",(()=>{var e;const t=null===(e=this.wrapperRef.current)||void 0===e?void 0:e.offsetWidth;if(void 0===t||0===t||this.props.cols>0)return;let a=Math.floor(t/300);a=24%a==0?a:a-1,a=a<1?1:a,a=a>8?8:a,a!==this.state.flexCols&&this.setState({flexCols:a})})),Gl(this,"resizeListenerHandle",(0,Y.Ds)(this.resizeObserveHandler,10)),Gl(this,"getFormItems",Ht()((e=>e.filter((e=>!e.noAuth&&!e.hidden))))),Gl(this,"getFlattenItems",Ht()((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{(0,Y.Kn)(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t}))),Gl(this,"valuesChangeHandle",((e,t)=>{var a,r;null===(a=(r=this.props).onValuesChange)||void 0===a||a.call(r,e,this._initialValues)})),Gl(this,"fieldsChangeHandle",((e,t)=>{var a,r;null===(a=(r=this.props).onFieldsChange)||void 0===a||a.call(r,e,t)})),Gl(this,"finishHandle",(e=>{var t,a;null===(t=(a=this.props).onFinish)||void 0===t||t.call(a,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))})),Gl(this,"finishFailedHandle",(e=>{var t,a;let{values:r,errorFields:l}=e;null===(t=(a=this.props).onFinishFailed)||void 0===t||t.call(a,l)})),Gl(this,"openValidateInfo",(e=>{const a=t().createElement("ul",null,e.map((e=>{const{label:a}=this.formItems.find((t=>t.fieldName===e.name[0]));return t().createElement("li",{key:e.name[0],style:{color:"#f5222d"}},"[",("string"==typeof a?`${a}: `:"")+e.errors.join(","),"]")})));N.notification.error({message:d("qm.form.validatePrompt"),description:a,duration:10})})),Gl(this,"scrollToField",(e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&ct()(t,{scrollMode:"if-needed",block:"nearest",behavior:"smooth"})})),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.createFormAuth()}get $size(){return this.props.size??this.context.size??""}get verticalLayout(){return"vertical"===this.props.layout}get formItems(){return this.getFormItems(this.props.items)}get flattenItems(){return this.getFlattenItems(this.formItems)}get dividers(){return this.formItems.filter((e=>"DIVIDER"===e.type))}get isFilterType(){return"search"===this.props.formType}get isOnlyShow(){return"onlyShow"===this.props.formType}get isCompactMode(){const e=this.context.global;return this.props.compactMode??("small"===this.$size&&!(null==e||!e.compactModeInSmallSize))}get showDividerCollapse(){return this.dividers.some((e=>!!e.collapse))}get showFilterCollapse(){return this.props.isCollapse&&this.formItems.length>=this.state.flexCols}componentDidMount(){this.checkFieldNames(),this.initialHandle(),this.createInputFocus(),this.bindResizeEvent(),this.resizeObserveHandler()}componentDidUpdate(e,t){this.props.items!==e.items&&this.checkFieldNames()}componentWillUnmount(){this.removeResizeEvent()}bindResizeEvent(){$t(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){Mt(this.wrapperRef.current,this.resizeListenerHandle)}initialHandle(){this.setState({formData:this.createFormValue(this.props.initialValues),other:this.createOtherValue(this.props.initialValues),extra:this.createExtraValue(this.props.initialExtras),expand:this.createDividerExpand()})}checkFieldNames(){const e=this.flattenItems.map((e=>e.fieldName));[...new Set(e)].length!==e.length&&m("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),a={};for(const r in e)t.includes(r)||(a[r]=e[r]);return Object.assign({},a)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>(0,Y.Kn)(e.extra))).forEach((a=>{t[a.fieldName]=e[a.fieldName]??""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>(0,Y.Kn)(e.collapse))).forEach((t=>{e[t.fieldName]=t.collapse.defaultExpand??!1})),Object.assign({},e)}getInitialValue(e,t){const{type:a,options:r}=e;return t=t??void 0,zt.includes(a)&&(t=t??[]),"CHECKBOX"!==a&&"SWITCH"!==a||(t=t??(null==r?void 0:r.falseValue)??Ut),t}createFormValue(e){const t={};return this.flattenItems.forEach((a=>{t[a.fieldName]=this.getInitialValue(a,e[a.fieldName])})),Object.assign({},e,t)}createInitialValues(){this._initialValues=this.createFormValue(this.props.initialValues)}createInitialOthers(){this._initialOthers=this.createOtherValue(this.props.initialValues)}createInitialExtras(){this._initialExtras=this.createExtraValue(this.props.initialExtras)}setViewValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";t!==this.getViewValue(e)&&this.setState((a=>({viewData:Object.assign({},a.viewData,{[e]:t})})))}getViewValue(e){return this.state.viewData[e]??""}setExpandHandle(e){this.setState({collapse:e},(()=>{var e,t;null===(e=(t=this.props).onCollapse)||void 0===e||e.call(t,this.state.collapse)}))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:a}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!a||setTimeout((()=>this.CREATE_FOCUS(a)))}getFormItemLabel(e){var t,a;if("string"==typeof e)return e;const{fieldName:r,options:l={}}=e,{itemList:n=[]}=l;if(!n.length)return m("Form",`fieldName 为 ${r} 的表单项的 \`itemList\` 配置有误`),"";const i=(null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([r])[r])??this._initialValues[r]??n[0].value;return(null===(a=n.find((e=>e.value===i)))||void 0===a?void 0:a.text)||""}getBlockDerivedItems(){const e=[];for(let t=0,a=this.dividers.length;t<a;t++){const a=this.formItems.findIndex((e=>e===this.dividers[t]));let r=this.formItems.findIndex((e=>e===this.dividers[t+1]));r=r>-1?r:void 0,e.push(this.formItems.slice(a,r).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay(e){let{type:t,fieldName:a}=e;if("DIVIDER"===t)return!0;const r=this.getBlockDerivedItems();for(let e=0,t=r.length;e<t;e++){var l;const t=r[e],n=this.dividers.find((e=>e.fieldName===t[0].fieldName)),i=(null==n||null===(l=n.collapse)||void 0===l?void 0:l.showLimit)??t.length-1;for(let e=1;e<t.length;e++)if(t[e].fieldName===a&&e>i)return this.state.expand[t[0].fieldName]}return!0}formatFormValue(e){for(const t in e){const a=e[t];if(ea(a)&&(e[t]=""),Array.isArray(a)&&a.forEach(((a,r)=>{ea(a)&&(e[t][r]="")})),t.includes("|")&&Array.isArray(a)){const[r,l]=t.split("|");e[r]=a[0]??"",e[l]=a[1]??""}}if(this.isFilterType)for(const t in e)(0,Y.xb)(e[t])&&(e[t]=void 0);return e}async createFormAuth(){const{authConfig:e}=this.props;if(!e)return;let t=G()(e,["fetch"]);if(e.fetch){const{api:a,params:r,dataKey:l}=e.fetch;try{const e=await a(r);200===e.code&&(t=(l?(0,Y.U2)(e.data,l):e.data)??{})}catch(e){}}if(Array.isArray(t.fieldList)){var a,r;const e=this.props.items.map((e=>{const{fieldName:a}=e,r=t.fieldList.find((e=>e.dataIndex===a));if(r){const{visible:t=1,disabled:a,secretName:l}=r;t||(e.noAuth=!0),a&&(e.disabled=!0),l&&(e.options?e.options.secretType=l:e.options={secretType:l})}return e}));null===(a=(r=this.props).fieldsChange)||void 0===a||a.call(r,e)}}INPUT(e){return t().createElement(va,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return t().createElement(Ca,{option:e})}INPUT_NUMBER(e){return t().createElement(Ia,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return t().createElement(Pa,{option:e})}SEARCH_HELPER(e){return t().createElement(La,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return t().createElement(Wa,{option:e})}TREE_TABLE_HELPER(e){return t().createElement(Qa,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return t().createElement(lr,{option:e})}RANGE_SEARCH_HELPER(e){return t().createElement(cr,{option:e})}CHECKBOX(e){return t().createElement(pr,{option:e})}MULTIPLE_CHECKBOX(e){return t().createElement(gr,{option:e})}RATE(e){return t().createElement(vr,{option:e})}RADIO(e){return t().createElement(Sr,{option:e})}SWITCH(e){return t().createElement(Nr,{option:e})}TEXT_AREA(e){return t().createElement(Rr,{option:e})}DATE(e){return t().createElement(Ar,{option:e})}RANGE_DATE(e){return t().createElement(Lr,{option:e})}TIME(e){return t().createElement($r,{option:e})}RANGE_TIME(e){return t().createElement(Vr,{option:e})}SELECT(e){return t().createElement(rl,{option:e})}MULTIPLE_SELECT(e){return t().createElement(rl,{option:e,multiple:!0})}IMMEDIATE(e){return t().createElement(ol,{option:e})}DIVIDER(e){return t().createElement(cl,{option:e})}TREE_SELECT(e){return t().createElement(fl,{option:e})}MULTIPLE_TREE_SELECT(e){return t().createElement(fl,{option:e,multiple:!0})}CASCADER(e){return t().createElement(xl,{option:e})}MULTIPLE_CASCADER(e){return t().createElement(xl,{option:e,multiple:!0})}CITY_SELECT(e){return t().createElement(kl,{option:e})}REGION_SELECT(e){return t().createElement(Dl,{option:e})}UPLOAD_FILE(e){return t().createElement(Kl,{option:e})}UPLOAD_IMG(e){return t().createElement(jl,{option:e})}TINYMCE(e){return t().createElement(Wl,{option:e})}renderFormLabel(e){if(!(0,Y.Kn)(e))return e;const{type:a,fieldName:r,options:l={},placeholder:n,disabled:i,onChange:o=Y.ZT}=e,{itemList:s=[]}=l;return t().createElement(N.Form.Item,{name:r,noStyle:!0},"SELECT"===a&&t().createElement(N.Select,{placeholder:n,disabled:i,style:{width:"calc(100% - 10px)"},onChange:e=>o(e,s.find((t=>t.value===e)).text)},s.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text)))))}renderFormItemExtra(e){const{fieldName:a,isTooltip:r,style:l={},render:n}=e,{extra:i}=this.state;if(r)return t().createElement(N.Tooltip,{className:"extra-tooltip",title:i[a]},t().createElement(ce.ExclamationCircleOutlined,{style:{marginLeft:4}}));const o=this.formItems.find((e=>e.fieldName===a));return t().createElement("div",{className:"extra-text",title:n?"":i[a],style:l},t().createElement("span",{className:"extra-overflow-cut"},n?n(o,this):i[a]))}renderFormItemButton(e,t){const a=this.formItems.find((t=>t.fieldName===e)),r="function"==typeof t?t(a):t;return this.isOnlyShow?null:r}renderFormItem(e){const{label:a,fieldName:r,className:l,labelWidth:n=this.props.labelWidth,rules:i=[],style:o={},render:s}=e;return(0,Y.xb)(this.state.formData)?null:t().createElement(N.Form.Item,{label:a,name:r,rules:i,className:oe()(r,l),style:{width:"100%",...o},labelCol:{flex:(0,Y.PM)(n)}},null==s?void 0:s(e,this))}createFormItem(e){return(0,Y.mf)(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(m("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:a,defaultRows:r,isFieldsDefine:l}=this.props,n=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:a=0}=e;for(let e=0;e<t;e++)n.push({});n.push(e);for(let e=0;e<a;e++)n.push({})}));const i=24/e,o=[],s=n.reduce(((e,t)=>{const{selfCol:a=1}=t,r=e+a;return o.push(r),r}),0),c=r>Math.ceil(s/e)?Math.ceil(s/e):r,d=[],u=n.map(((a,r)=>{let{selfCol:l=1}=a;const{type:n,fieldName:s}=a;l=l>=24||"DIVIDER"===n||"TINYMCE"===n?e:l;const u=!(!this.state.collapse&&this.showFilterCollapse)||o[r]<c*e,p=!this.showDividerCollapse||this.getFormItemDisplay(a);return u&&d.push(o[r]),t().createElement(N.Col,{key:s??r,span:l*i,style:this.isFilterType?{display:!this.showFilterCollapse||u?"block":"none"}:{display:p?"block":"none"}},n?this.createFormItem((0,Y.I8)(a)):null)}));return l&&"default"===a&&u.push(t().createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...u,this.createSearchButtonLayout(d[d.length-1])]}createSearchButtonLayout(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{flexCols:a,collapse:r}=this.state,{searchButtonCols:l,isSearchBtn:n,isFieldsDefine:i=!0}=this.props;if(!this.isFilterType)return null;const o=24/a,s=l||1,c=a-e%a-s;return n?t().createElement(N.Col,{key:"-",span:s*o,offset:c*o,style:{textAlign:"right"}},t().createElement(N.Space,{style:{marginBottom:12}},t().createElement(J,{type:"primary",size:this.$size,icon:t().createElement(ce.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},d("qm.form.search")),t().createElement(J,{size:this.$size,icon:t().createElement(ce.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},d("qm.form.reset")),i?this.createFieldsDefine():null,this.showFilterCollapse&&t().createElement("a",{onClick:()=>this.setExpandHandle(!r)},r?t().createElement(ce.UpOutlined,null):t().createElement(ce.DownOutlined,null)," ",d(r?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:a,isSubmitBtn:r}=this.props;if(this.isFilterType)return null;const l=24/e;return r&&"default"===a?t().createElement(N.Row,{gutter:0},t().createElement(N.Col,{key:"-",span:l},t().createElement(N.Form.Item,null,t().createElement(N.Space,{style:{marginBottom:12}},t().createElement(J,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},d("qm.form.save")),t().createElement(J,{size:this.$size,onClick:()=>this.RESET_FORM()},d("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:a,fieldsChange:r}=this.props;return t().createElement(ha,{uniqueKey:e,items:a,fieldsChange:r})}set_fields_other(e){this.setState((t=>({other:Object.assign({},t.other,this.createOtherValue(e))})))}get_fields_other(e){if(!e)return this.state.other;const t={};return e.forEach((e=>{t[e]=this.state.other[e]})),t}formValidate(){return new Promise((async(e,t)=>{const[a,r]=await this.VALIDATE_FIELDS(),l=this.formItems.filter((e=>"SEARCH_HELPER"===e.type)).filter((e=>{var t;return null===(t=this[`${e.fieldName}_Ref`])||void 0===t?void 0:t.searchRef._is_change})).map((e=>({name:[e.fieldName],errors:[d("qm.form.searchHelperTips")],warnings:[]})));a||l.length?t((a||[]).concat(l)):e(r)}))}SET_FIELDS_VALUE(e){this.formRef.current.setFieldsValue(e),this.set_fields_other(e)}GET_FIELDS_VALUE(e){return e?Object.assign({},this.get_fields_other(e),this.formRef.current.getFieldsValue(e)):Object.assign({},this.state.other,this.formRef.current.getFieldsValue(!0))}async GET_FORM_DATA(){try{const e=await this.formValidate();return[null,Object.assign({},this.get_fields_other(),this.formatFormValue(e))]}catch(e){return this.props.scrollToFirstError&&this.scrollToField(e[0].name[0]),[e,null]}}async VALIDATE_FIELDS(e){try{return[null,await this.formRef.current.validateFields(e)]}catch({errorFields:e}){return this.isCompactMode&&this.openValidateInfo(e),[e,null]}}SET_FIELDS_EXTRA(e){this.setState((t=>({extra:Object.assign({},t.extra,e)})))}SET_FIELDS_ECHO(e){Object.keys(e).length&&(Object.assign(this.provide,{echo_data:Object.assign({},this.provide.echo_data,e)}),this.forceUpdate())}GET_FIELDS_EXTRA(e){if(!e)return this.state.extra;const t={};return e.forEach((e=>{t[e]=this.state.extra[e]})),t}GET_FIELDS_TOUCHED(e){return this.formRef.current.isFieldsTouched(e)}async SUBMIT_FORM(){try{await this.formValidate(),this.formRef.current.submit()}catch(e){this.isFilterType&&this.setExpandHandle(!0)}}RESET_FORM(){var e,t;let a=[];const r=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName));r.length&&(a=this.flattenItems.map((e=>e.fieldName)).filter((e=>!r.includes(e)))),this.formRef.current.resetFields(a.length?a:void 0),this.setState((e=>{const t=Object.keys(e.other),a=Object.keys(this._initialOthers),r=t.filter((e=>!a.includes(e))),l={};return r.forEach((e=>l[e]=void 0)),{other:Object.assign({},this._initialOthers,l)}})),this.setState({extra:Object.assign({},this._initialExtras)}),null===(e=(t=this.props).onReset)||void 0===e||e.call(t)}CREATE_FOCUS(e){try{this[`${e}_Ref`].focus()}catch(e){m("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,a){const{items:r,fieldsChange:l}=this.props,n=r.filter((e=>!e.noAuth)),i=n.find((t=>t.fieldName===e));if(!i)return m("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!(0,Y.Kn)(t))return m("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");for(const e in t)e&&(0,Y.t8)(i,e,t[e]);a&&(l?l(n):m("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:a,layout:r,disabled:l,labelWidth:n,labelAlign:i,labelWrap:o,customClass:s}=this.props,c=se("form"),u={required:"${label}"+d("qm.form.requiredTips")},p={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}__only-show`]:this.isOnlyShow,[`${c}__compact`]:this.isCompactMode,[s]:!!s};return t().createElement("div",{ref:this.wrapperRef,className:oe()(p,e),style:a},t().createElement(N.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:r,labelAlign:i,labelWrap:o,colon:!1,disabled:l,labelCol:{flex:this.verticalLayout?"initial":(0,Y.PM)(n)},validateMessages:u,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},t().createElement(Ft.Provider,{value:this.provide},t().createElement(N.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}Gl(Yl,"contextType",l),Gl(Yl,"propTypes",Zt),Gl(Yl,"defaultProps",Xt);const Zl=Yl,Xl={onActivate:a.func,onAddUndo:a.func,onBeforeAddUndo:a.func,onBeforeExecCommand:a.func,onBeforeGetContent:a.func,onBeforeRenderUI:a.func,onBeforeSetContent:a.func,onBeforePaste:a.func,onBlur:a.func,onChange:a.func,onClearUndos:a.func,onClick:a.func,onContextMenu:a.func,onCommentChange:a.func,onCopy:a.func,onCut:a.func,onDblclick:a.func,onDeactivate:a.func,onDirty:a.func,onDrag:a.func,onDragDrop:a.func,onDragEnd:a.func,onDragGesture:a.func,onDragOver:a.func,onDrop:a.func,onExecCommand:a.func,onFocus:a.func,onFocusIn:a.func,onFocusOut:a.func,onGetContent:a.func,onHide:a.func,onInit:a.func,onKeyDown:a.func,onKeyPress:a.func,onKeyUp:a.func,onLoadContent:a.func,onMouseDown:a.func,onMouseEnter:a.func,onMouseLeave:a.func,onMouseMove:a.func,onMouseOut:a.func,onMouseOver:a.func,onMouseUp:a.func,onNodeChange:a.func,onObjectResizeStart:a.func,onObjectResized:a.func,onObjectSelected:a.func,onPaste:a.func,onPostProcess:a.func,onPostRender:a.func,onPreProcess:a.func,onProgressState:a.func,onRedo:a.func,onRemove:a.func,onReset:a.func,onSaveContent:a.func,onSelectionChange:a.func,onSetAttrib:a.func,onSetContent:a.func,onShow:a.func,onSubmit:a.func,onUndo:a.func,onVisualAid:a.func,onSkinLoadError:a.func,onThemeLoadError:a.func,onModelLoadError:a.func,onPluginLoadError:a.func,onIconsLoadError:a.func,onLanguageLoadError:a.func},Ql={apiKey:a.string,id:a.string,inline:a.bool,init:a.object,initialValue:a.string,onEditorChange:a.func,value:a.string,tagName:a.string,cloudChannel:a.string,plugins:a.oneOfType([a.string,a.array]),toolbar:a.oneOfType([a.string,a.array]),disabled:a.bool,textareaName:a.string,tinymceScriptSrc:a.string,rollback:a.oneOfType([a.number,a.oneOf([!1])]),scriptLoading:a.shape({async:a.bool,defer:a.bool,delay:a.number}),...Xl},Jl=e=>"function"==typeof e,en=e=>e in Xl,tn=e=>e.substr(2),an=(e,t,a,r,l)=>((t,a,r,l,n,i,o)=>{const s=Object.keys(n).filter(en),c=Object.keys(i).filter(en),d=s.filter((e=>void 0===i[e])),u=c.filter((e=>void 0===n[e]));d.forEach((e=>{const t=tn(e),a=o[t];r(t,a),delete o[t]})),u.forEach((r=>{const l=((t,a)=>r=>{var l;return null===(l=t(a))||void 0===l?void 0:l(r,e)})(t,r),n=tn(r);o[n]=l,a(n,l)}))})(l,e.on.bind(e),e.off.bind(e),0,t,a,r);let rn=0;const ln=e=>{const t=Date.now(),a=Math.floor(1e9*Math.random());return rn++,e+"_"+a+rn+String(t)},nn=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),on=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),sn=(e,t)=>on(e).concat(on(t)),cn=e=>{if(!("isConnected"in Node.prototype)){let t=e,a=e.parentNode;for(;null!=a;)t=a,a=t.parentNode;return t===e.ownerDocument}return e.isConnected},dn=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},un=()=>({listeners:[],scriptId:ln("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),pn=(()=>{let e=un();return{load:(t,a,r,l,n,i)=>{const o=()=>((t,a,r,l,n,i)=>{const o=a.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.id=t,o.src=r,o.async=l,o.defer=n;const s=()=>{o.removeEventListener("load",s),e.listeners.forEach((e=>e())),e.scriptLoaded=!0};o.addEventListener("load",s),a.head&&a.head.appendChild(o)})(e.scriptId,t,a,r,l);e.scriptLoaded?i():(e.listeners.push(i),e.scriptLoading||(e.scriptLoading=!0,n>0?setTimeout(o,n):o()))},reinitialize:()=>{e=un()}}})(),hn=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};function mn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class fn extends e.Component{constructor(t){var a,r;super(t),a=this,mn(this,"editor",void 0),mn(this,"id",void 0),mn(this,"elementRef",void 0),mn(this,"inline",void 0),mn(this,"currentContent",void 0),mn(this,"boundHandlers",void 0),mn(this,"rollbackTimer",void 0),mn(this,"valueCursor",void 0),mn(this,"rollbackChange",(()=>{const e=this.editor,t=this.props.value;e&&t&&t!==this.currentContent&&e.undoManager.ignore((()=>{if(e.setContent(t),this.valueCursor&&(!this.inline||e.hasFocus()))try{e.selection.moveToBookmark(this.valueCursor)}catch(e){}})),this.rollbackTimer=void 0})),mn(this,"handleBeforeInput",(e=>{if(void 0!==this.props.value&&this.props.value===this.currentContent&&this.editor&&(!this.inline||this.editor.hasFocus()))try{this.valueCursor=this.editor.selection.getBookmark(3)}catch(e){}})),mn(this,"handleBeforeInputSpecial",(e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)})),mn(this,"handleEditorChange",(e=>{const t=this.editor;if(t&&t.initialized){const e=t.getContent();void 0!==this.props.value&&this.props.value!==e&&!1!==this.props.rollback&&(this.rollbackTimer||(this.rollbackTimer=window.setTimeout(this.rollbackChange,"number"==typeof this.props.rollback?this.props.rollback:200))),e!==this.currentContent&&(this.currentContent=e,"function"==typeof this.props.onEditorChange&&this.props.onEditorChange(e,t))}})),mn(this,"handleEditorChangeSpecial",(e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)})),mn(this,"initialise",(function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const l=a.elementRef.current;if(!l)return;if(!cn(l)){if(0===r)setTimeout((()=>a.initialise(1)),1);else{if(!(r<100))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>a.initialise(r+1)),100)}return}const n=hn(a.view);if(!n)throw new Error("tinymce should have been loaded into global scope");const i={...a.props.init,selector:void 0,target:l,readonly:a.props.disabled,inline:a.inline,plugins:sn(null===(e=a.props.init)||void 0===e?void 0:e.plugins,a.props.plugins),toolbar:a.props.toolbar??(null===(t=a.props.init)||void 0===t?void 0:t.toolbar),setup:e=>{a.editor=e,a.bindHandlers({}),a.inline&&!nn(l)&&e.once("PostRender",(t=>{e.setContent(a.getInitialValue(),{no_events:!0})})),a.props.init&&Jl(a.props.init.setup)&&a.props.init.setup(e)},init_instance_callback:e=>{const t=a.getInitialValue();a.currentContent=a.currentContent??e.getContent(),a.currentContent!==t&&(a.currentContent=t,e.setContent(t),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const r=a.props.disabled??!1;dn(a.editor,r?"readonly":"design"),a.props.init&&Jl(a.props.init.init_instance_callback)&&a.props.init.init_instance_callback(e)}};a.inline||(l.style.visibility=""),nn(l)&&(l.value=a.getInitialValue()),n.init(i)})),this.id=this.props.id||ln("tiny-react"),this.elementRef=e.createRef(),this.inline=this.props.inline??(null===(r=this.props.init)||void 0===r?void 0:r.inline)??!1,this.boundHandlers={}}get view(){var e;return(null===(e=this.elementRef.current)||void 0===e?void 0:e.ownerDocument.defaultView)??window}componentDidUpdate(e){if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=this.currentContent??this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==e.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){const e=this.editor;e.undoManager.transact((()=>{let t;if(!this.inline||e.hasFocus())try{t=e.selection.getBookmark(3)}catch(e){}const a=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const r of[t,a])if(r)try{e.selection.moveToBookmark(r),this.valueCursor=r;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=this.props.disabled??!1;dn(this.editor,e?"readonly":"design")}}}componentDidMount(){if(null!==hn(this.view))this.initialise();else if(this.elementRef.current&&this.elementRef.current.ownerDocument){var e,t,a;pn.load(this.elementRef.current.ownerDocument,this.getScriptSrc(),(null===(e=this.props.scriptLoading)||void 0===e?void 0:e.async)??!1,(null===(t=this.props.scriptLoading)||void 0===t?void 0:t.defer)??!1,(null===(a=this.props.scriptLoading)||void 0===a?void 0:a.delay)??0,this.initialise)}}componentWillUnmount(){const e=this.editor;e&&(e.off(this.changeEvents(),this.handleEditorChange),e.off(this.beforeInputEvent(),this.handleBeforeInput),e.off("keypress",this.handleEditorChangeSpecial),e.off("keydown",this.handleBeforeInputSpecial),e.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach((t=>{e.off(t,this.boundHandlers[t])})),this.boundHandlers={},e.remove(),this.editor=void 0)}render(){return this.inline?this.renderInline():this.renderIframe()}changeEvents(){var e,t,a;return(null===(e=hn(this.view))||void 0===e||null===(t=e.Env)||void 0===t||null===(a=t.browser)||void 0===a?void 0:a.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"}beforeInputEvent(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"}renderInline(){const{tagName:t="div"}=this.props;return e.createElement(t,{ref:this.elementRef,id:this.id})}renderIframe(){return e.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id})}getScriptSrc(){if("string"==typeof this.props.tinymceScriptSrc)return this.props.tinymceScriptSrc;{const e=this.props.cloudChannel;return`https://cdn.tiny.cloud/1/${this.props.apiKey?this.props.apiKey:"no-api-key"}/tinymce/${e}/tinymce.min.js`}}getInitialValue(){return"string"==typeof this.props.initialValue?this.props.initialValue:"string"==typeof this.props.value?this.props.value:""}bindHandlers(e){if(void 0!==this.editor){an(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,a=t(e),r=t(this.props);!a&&r?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):a&&!r&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}function gn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var bn;mn(fn,"propTypes",Ql),mn(fn,"defaultProps",{cloudChannel:"6"}),function(e){e["zh-cn"]="zh_CN",e.en="en"}(bn||(bn={}));class yn extends e.Component{constructor(){super(...arguments),gn(this,"defaultOption",{height:400,plugins:"preview importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap emoticons",menubar:"file edit view insert format tools table help",toolbar:"undo redo | bold italic underline strikethrough | fontfamily fontsize blocks | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl"})}render(){var e;const{size:a,className:r,style:l,tinymce:n={},upload:i={},thresholdSize:o=.5,tinymceScriptSrc:s,disabled:c,value:u,onChange:p=Y.ZT}=this.props,h=this.context.global,m=this.context.locale,f=a||this.context.size||"",g=se("tinymce"),b={[g]:!0,[`${g}--lg`]:"large"===f,[`${g}--sm`]:"small"===f},y={init:{height:n.height||this.defaultOption.height,plugins:n.plugins||this.defaultOption.plugins,toolbar:n.toolbar||this.defaultOption.toolbar,menubar:n.menubar||this.defaultOption.menubar,language:bn[m],skin:"tinymce-5",...G()(n,["height","plugins","toolbar","menubar"]),images_upload_handler:e=>new Promise((async(t,a)=>{const{action:r,headers:l,withCredentials:n,dataKey:s}=i,c=`data:image/jpeg;base64,${e.base64()}`,u=new FormData;u.append("file",e.blob(),e.filename());const p=e.blob().size;if(r&&p/1024/1024>o)try{const{data:e}=await et().post(r,u,{headers:l,withCredentials:n});200===e.code&&t(s?(0,Y.U2)(e.data,s):e.data)}catch(e){N.message.error(d("qm.uploadCropper.uploadError"))}else t(c)}))},value:u,disabled:c,tinymceScriptSrc:s||(null==h||null===(e=h.tinymce)||void 0===e?void 0:e.scriptSrc)||void 0,onEditorChange:(e,t)=>{p(t.getContent())}};return t().createElement("div",{className:oe()(b,r),style:l},t().createElement(fn,y))}}gn(yn,"contextType",l),gn(yn,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Tinymce","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")}});const vn=yn,xn=require("cropperjs");var En=__webpack_require__.n(xn);function Cn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Sn extends e.Component{constructor(){super(...arguments),Cn(this,"imgRef",t().createRef()),Cn(this,"cropper",void 0)}componentDidMount(){const{className:e,style:t,src:a,alt:r,imgStyle:l,...n}=this.props,i={};for(const e in n)void 0!==this.props[e]&&(i[e]=this.props[e]);this.cropper=new(En())(this.imgRef.current,i)}componentWillUnmount(){this.destroy(),this.cropper=null}reset(){return this.cropper.reset()}clear(){return this.cropper.clear()}initCrop(){return this.cropper.crop()}replace(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.cropper.replace(e,t)}enable(){return this.cropper.enable()}disable(){return this.cropper.disable()}destroy(){return this.cropper.destroy()}move(e,t){return this.cropper.move(e,t)}moveTo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.cropper.moveTo(e,t)}relativeZoom(e,t){return this.cropper.zoom(e,t)}zoomTo(e,t){return this.cropper.zoomTo(e,t)}rotate(e){return this.cropper.rotate(e)}rotateTo(e){return this.cropper.rotateTo(e)}scaleX(e){return this.cropper.scaleX(e)}scaleY(e){return this.cropper.scaleY(e)}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.cropper.scale(e,t)}getData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.cropper.getData(e)}setData(e){return this.cropper.setData(e)}getContainerData(){return this.cropper.getContainerData()}getImageData(){return this.cropper.getImageData()}getCanvasData(){return this.cropper.getCanvasData()}setCanvasData(e){return this.cropper.setCanvasData(e)}getCropBoxData(){return this.cropper.getCropBoxData()}setCropBoxData(e){return this.cropper.setCropBoxData(e)}getCroppedCanvas(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.cropper.getCroppedCanvas(e)}setAspectRatio(e){return this.cropper.setAspectRatio(e)}setDragMode(e){return this.cropper.setDragMode(e)}render(){const{className:e,style:a,src:r,alt:l,imgStyle:n}=this.props,i={[se("cropper")]:!0};return t().createElement("div",{className:oe()(i,e),style:a},t().createElement("img",{ref:this.imgRef,src:r,alt:l,style:{maxWidth:"100%",...n}}))}}Cn(Sn,"defaultProps",{src:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0});const wn=Sn;function Tn(){return Tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Tn.apply(this,arguments)}function Nn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class In extends e.Component{constructor(){super(...arguments),Nn(this,"beforeUpload",((e,t)=>new Promise((async(a,r)=>{const{fileTypes:l=[],fileSize:n,beforeUpload:i}=this.props,o=!l.length||l.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),s=!n||e.size/1024/1024<n,c=o&&s;if(o||N.message.warning(d("qm.upload.tooltip",{type:l.join(",")})),s||N.message.warning(d("qm.upload.sizeLimit",{size:n})),!c)return c||N.Upload.LIST_IGNORE;if(i){const l=i(e,t);if(!0===l)return a(e);if(!1===l)return r("not upload");if(l&&"function"==typeof l.then)try{a(await l)}catch(e){r(e)}}a(e)}))))}async downloadFile(e,t){const a=await et()({url:e,responseType:"blob"}),r=a.data,l=a.headers["content-disposition"],n=t||(l?l.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));tt(r,n)}render(){const{button:e,disabled:a,onChange:r}=this.props,l=se("upload-file");return t().createElement(N.Upload,Tn({className:l},G()(this.props,["fileTypes","fileSize","button"]),{beforeUpload:this.beforeUpload,onChange:e=>{null==r||r(e)},onPreview:async e=>{try{e.url&&await this.downloadFile(e.url,e.name)}catch(e){N.message.error(d("qm.download.error"))}},onDownload:async e=>{try{e.url&&await this.downloadFile(e.url,e.name)}catch(e){N.message.error(d("qm.download.error"))}}}),this.props.children?this.props.children:t().createElement(N.Button,{icon:(null==e?void 0:e.icon)||t().createElement(ce.UploadOutlined,null),disabled:a},(null==e?void 0:e.text)||d("qm.upload.text")))}}Nn(In,"defaultProps",{name:"file",multiple:!0,showUploadList:{showDownloadIcon:!0,downloadIcon:t().createElement(ce.DownloadOutlined,null)}});const _n=In;function Rn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Pn extends e.Component{constructor(){super(...arguments),Rn(this,"cropperRef",t().createRef()),Rn(this,"beforeUploadRef",void 0),Rn(this,"fileRef",void 0),Rn(this,"resolveRef",void 0),Rn(this,"rejectRef",void 0),Rn(this,"state",{src:""}),Rn(this,"confirmHandle",(async()=>{const{quality:e}=this.props,{type:t,name:a,uid:r}=this.fileRef;this.cropperRef.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===t?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((async e=>{let l=new File([e],a,{type:t});l.uid=r;const{fileTypes:n=[],fileSize:i}=this.props;if(n.length&&!n.includes(l.name.slice(l.name.lastIndexOf(".")+1).toLowerCase()))return N.message.warning(d("qm.upload.tooltip",{type:n.join(",")})),this.rejectRef("file type is error");if("function"!=typeof this.beforeUploadRef)return this.resolveRef(l);const o=this.beforeUploadRef(l,[l]);if("boolean"==typeof o||o){if(!0===o)return this.resolveRef(l);if(!1===o)return this.rejectRef("not upload");if(o&&"function"==typeof o.then)try{const e=await o,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(l=e),this.resolveRef(l)}catch(e){this.rejectRef(e)}}else m("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}),t,e),await(0,Y._v)(100),this.onClose()})),Rn(this,"onOk",(()=>{this.confirmHandle()})),Rn(this,"onClose",(()=>{this.rejectRef(),this.setSrc("")}))}get previewSize(){const{fixedSize:e}=this.props;return{width:"380px",height:e?`calc(380px * ${e[1]/e[0]})`:"auto"}}setSrc(e){this.setState({src:e})}renderUpload(){const{children:e,beforeCrop:a}=this.props,r=Array.isArray(e)?e[0]:e;if(!r)return null;const{beforeUpload:l,...n}=r.props;return this.beforeUploadRef=l,t().createElement(r.type,{...n,beforeUpload:(e,t)=>new Promise((async(r,l)=>{if(a&&!await a(e,t))return void l();this.fileRef=e,this.resolveRef=r,this.rejectRef=l;const n=new FileReader;n.onload=()=>{this.setSrc(n.result),n.onload=null},n.readAsDataURL(e)}))})}scaleHandle(e){this.cropperRef.current.relativeZoom(e,void 0)}rotateHandle(e){this.cropperRef.current.rotate(e)}renderCropper(){const{fixedSize:e}=this.props;return t().createElement("div",{className:"cropper-preview"},t().createElement("div",{className:"cropper-area"},t().createElement("div",{className:"img-cropper"},t().createElement(wn,{ref:this.cropperRef,aspectRatio:e?e[0]/e[1]:e,src:this.state.src,dragMode:"move",preview:".preview"})),t().createElement("div",{className:"actions"},t().createElement(N.Space,{size:"small"},t().createElement(N.Button,{type:"primary",size:"middle",icon:t().createElement(ce.ZoomInOutlined,null),onClick:()=>this.scaleHandle(.2)},d("qm.uploadCropper.zoomIn")),t().createElement(N.Button,{type:"primary",size:"middle",icon:t().createElement(ce.ZoomOutOutlined,null),onClick:()=>this.scaleHandle(-.2)},d("qm.uploadCropper.zoomOut")),t().createElement(N.Button,{type:"primary",size:"middle",icon:t().createElement(ce.RotateRightOutlined,null),onClick:()=>this.rotateHandle(90)},d("qm.uploadCropper.rotatePlus")),t().createElement(N.Button,{type:"primary",size:"middle",icon:t().createElement(ce.RotateLeftOutlined,null),onClick:()=>this.rotateHandle(-90)},d("qm.uploadCropper.rotateSubtract"))))),t().createElement("div",{className:"preview-area"},t().createElement("div",{className:"preview",style:this.previewSize})))}render(){const{src:e}=this.state,a=se("cropper-preview");return t().createElement(t().Fragment,null,this.renderUpload(),e&&t().createElement(N.Modal,{visible:!0,wrapClassName:oe()(a),title:d("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:this.onOk,onCancel:this.onClose,maskClosable:!1,destroyOnClose:!0},this.renderCropper()))}}Rn(Pn,"contextType",l);const On=Pn;function An(){return An=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},An.apply(this,arguments)}function kn(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Hn extends e.Component{constructor(){super(...arguments),kn(this,"state",{previewVisible:!1,previewImage:"",previewTitle:""}),kn(this,"beforeUpload",((e,t)=>new Promise((async(t,a)=>{const{fileTypes:r=[],fileSize:l}=this.props,n=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),i=!l||e.size/1024/1024<l,o=n&&i;if(n||N.message.warning(d("qm.upload.tooltip",{type:r.join(",")})),i||N.message.warning(d("qm.upload.sizeLimit",{size:l})),!o)return o||N.Upload.LIST_IGNORE;t(e)})))),kn(this,"handlePreview",(async e=>{e.url||e.preview||(e.preview=await(e=>new Promise(((t,a)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>a(e)})))(e.originFileObj)),this.setState({previewImage:e.url||e.preview,previewVisible:!0,previewTitle:e.name||e.url.substring(e.url.lastIndexOf("/")+1)})}))}get showUploadButton(){var e;const t=(null===(e=this.props.fileList)||void 0===e?void 0:e.length)??0;return!this.props.maxCount||t<this.props.maxCount}render(){const{previewVisible:e,previewImage:a,previewTitle:r}=this.state,{fixedSize:l,quality:n,fileTypes:i,fileSize:o,openCropper:s,beforeCrop:c}=this.props,u=se("upload-img"),p=t().createElement("div",null,t().createElement(ce.PlusOutlined,null),t().createElement("div",{style:{marginTop:8}},d("qm.uploadCropper.dragableText"))),h=t().createElement(N.Upload,An({className:u},G()(this.props,["fileTypes","fileSize","fixedSize","quality"]),{beforeUpload:this.beforeUpload,onPreview:this.handlePreview}),this.showUploadButton?p:null);return t().createElement(t().Fragment,null,s?t().createElement(On,{fixedSize:l,quality:n,fileTypes:i,fileSize:o,beforeCrop:c},h):h,t().createElement(N.Modal,{visible:e,title:r,bodyStyle:{padding:10},footer:null,onCancel:()=>{this.setState({previewVisible:!1})}},t().createElement("img",{alt:"",style:{width:"100%"},src:a})))}}kn(Hn,"defaultProps",{name:"file",multiple:!0,accept:"image/*",listType:"picture-card",quality:1,openCropper:!0});const Fn=Hn;function Ln(t){const[a,r]=e.useState({width:0,height:0});return e.useEffect((()=>{const e=t.current,a=e=>{const{inlineSize:t,blockSize:a}=e.contentBoxSize[0];r({width:t,height:a})};return e&&$t(e,a),()=>{e&&Mt(e,a)}}),[t]),a}const qn=(e,t,a)=>{let r;for(let l=0;l<e.length;l++){const n=e[l];if(n.children)if(n.children.some((e=>e[a]===t)))r=n[a];else{const e=qn(n.children,t,a);e&&(r=e)}}return r},Dn=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&Dn(e.children,t),t(e)||e.children&&e.children.length))),$n=(e,t)=>{const a=[];return e.forEach((e=>{e.children&&a.push(...$n(e.children,t)),t(e)&&a.push(e)})),a},Mn=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(a=Mn(e[r].children,t)),a)return a;if(t(e[r]))return e[r]}return a},Kn=(e,t,a,r)=>e.map((e=>e[a]===t?{...e,children:r}:e.children?{...e,children:Kn(e.children,t,a,r)}:e)),Vn=(e,t)=>{const a=[];return e.forEach((e=>{e.children&&a.push(...Vn(e.children,t)),Array.isArray(e.children)&&e.children.length&&a.push(e[t])})),a},Un=(e,t,a)=>{for(let r=0;r<e.length;r++){if(e[r][a]===t)return[t];if(Array.isArray(e[r].children)){const l=Un(e[r].children,t,a);if(l)return[e[r][a],l].flat()}}},jn=(e,t)=>{var a;const r=(null===(a=e.children)||void 0===a?void 0:a.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>r.push(...jn(e,t)))),r},zn=t().forwardRef(((e,a)=>{const{filterable:r=!0,multiple:n,draggable:i,dataSource:o,fetch:s,asyncLoad:c,checkStrictly:u,checkStrategy:p="SHOW_CHILD",placeholder:h=d("qm.form.inputPlaceholder"),fieldsDefine:m,value:f,height:g,defaultSelectedKeys:b=[],defaultExpandAll:y=!0,showSearchBar:v=!0,showCollapse:x=!0,onSelectChange:E,onCheckChange:C,onDragChange:S}=e,{size:w}=t().useContext(l),T=t().useMemo((()=>e.size??w??""),[e.size,w]),I=(null==m?void 0:m.valueKey)||"value",_=(null==m?void 0:m.textKey)||"text",R=(null==m||m.children,t().useRef(null)),P=Ln(R),[O,A]=t().useState(g),[k,H]=t().useState(!1),F=(0,Y.Ds)((()=>{A(R.current.offsetHeight-G.current.offsetHeight-10)}),5);Se((()=>{g||F()}),[P.height]);const[L,q]=t().useState([]),[D,$]=t().useState({}),[M,K]=t().useState([]),[V,U]=t().useState([]),[j,z]=t().useState(""),[B,W]=t().useState(y),G=t().useRef(null),Z=t().useRef([]),X=t().useRef([]);t().useEffect((()=>{Array.isArray(o)&&(Q(o),K(J(o)),$({}))}),[o]),t().useEffect((()=>{ae()}),[]),Se((()=>{ae()}),[null==s?void 0:s.params]),Se((()=>{U(te())}),[D]),t().useImperativeHandle(a,(()=>({INSERT_RECORD:(e,t)=>{const a=Mn(L,(t=>e===t[I]));a&&(Array.isArray(a.children)?a.children.push(t):a.children=[t],Q([...L]))},REMOVE_RECORD:e=>{const t=qn(L,e,I);if(void 0===t&&L.find((t=>t[I]===e)))Q(L.filter((t=>t[I]!==e)));else{var a;const r=Mn(L,(e=>t===e[I]));if(!r)return;const l=null===(a=r.children)||void 0===a?void 0:a.findIndex((t=>e===t[I]));l>=0&&(r.children.splice(l,1),Q([...L]))}},UPDATE_RECORD:(e,t)=>{const a=Mn(L,(t=>e===t[I]));a&&((0,ca.merge)(a,t),Q([...L]))}})));const Q=e=>{q(e),Z.current=e,X.current=Vn(e,I)},J=e=>{if(n)return b;const t=$n(e,(e=>b.includes(e[_])));return 1===t.length?[t[0][I]]:[]},ee=e=>{var t;return(null===(t=Un(L,e,I))||void 0===t?void 0:t.slice(0,-1))||[]},te=()=>{if(y)return X.current;const e=[];return M.forEach((t=>{if(n){if("SHOW_ALL"===p&&!X.current.includes(t)&&e.push(...ee(t)),"SHOW_CHILD"===p&&e.push(...ee(t)),"SHOW_PARENT"===p){const a=na(L,t);if(a){const r=ee(t),l=jn(a,I);e.push(...r,...[t,...l].filter((e=>X.current.includes(e))))}}}else e.push(...ee(t))})),[...new Set(e)]},ae=async()=>{if(!s)return;const{api:e,params:t,dataKey:a,callback:r}=s;try{H(!0);const l=await e(t);if(200===l.code){const e=Array.isArray(l.data)?l.data:(0,ca.get)(l.data,a)??[];Q(e),K(J(e)),$({}),null==r||r(e)}}catch(e){}H(!1)},re=e=>`${e}|${Xr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,le=se("search-tree"),ne={[le]:!0,[`${le}--lg`]:"large"===T,[`${le}--sm`]:"small"===T};return t().createElement("div",{ref:R,className:oe()(ne)},t().createElement("div",{ref:G,className:"topper"},v&&t().createElement(N.Input.Search,{value:j,size:T,placeholder:h,allowClear:!0,onChange:e=>(e=>{if(!r)return;const t=Dn(Z.current,(t=>{if(!e)return!0;const a=t[_]||"";return-1!==re(a).indexOf(e)}));z(e),q(t),y||e?U(Vn(t,I)):$({})})(e.target.value)}),x&&t().createElement("a",{className:"trigger",onClick:()=>{W(!B),U(B?[]:X.current)}},B?t().createElement(ce.UpOutlined,null):t().createElement(ce.DownOutlined,null)," ",d(B?"qm.form.collect":"qm.form.spread"))),t().createElement(Qe,{spinning:k},t().createElement(N.Tree,{fieldNames:{title:_,key:I,children:"children"},multiple:n,draggable:i,blockNode:i,checkable:n,selectable:!n,height:O,disabled:e.disabled,checkStrictly:u,selectedKeys:f??M,checkedKeys:f??M,expandedKeys:V,treeData:L,loadData:c?async e=>{let{key:t,children:a}=e;if(!s||a)return;const{api:r,params:l,dataKey:n,formatter:i=(e=>e)}=s;try{const e=await r(i({...l,[I]:t}));if(200===e.code){const a=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,n)??[],r=Kn(Z.current,t,I,a);Q(r)}}catch(e){}}:void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!j)return!1;const t=e[_]||"";return-1!==re(t).indexOf(j)},onDragEnter:e=>{U(e.expandedKeys)},onDrop:e=>{const t=e.node.key,a=e.dragNode.key,r=e.node.pos.split("-"),l=e.dropPosition-Number(r[r.length-1]),n=(e,t,a)=>{for(let r=0;r<e.length;r++){if(e[r][I]===t)return a(e[r],r,e);e[r].children&&n(e[r].children,t,a)}},i=[...L];let o;if(n(i,a,((e,t,a)=>{a.splice(t,1),o=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===l)n(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));else{let e,a=[];n(i,t,((t,r,l)=>{a=l,e=r})),-1===l?a.splice(e,0,o):a.splice(e+1,0,o)}else n(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));Q(i)},onDragEnd:e=>{null==S||S(e,L)},onExpand:e=>{U(e)},onSelect:e=>{K(e);const t=$n(Z.current,(t=>e.includes((0,ca.get)(t,I))));null==E||E(n?t:t[0])},onCheck:e=>{u&&(e=e.checked),K(e),"SHOW_CHILD"===p&&(e=e.filter((e=>!X.current.includes(e)))),"SHOW_PARENT"===p&&(e=e.filter(((e,t,a)=>!a.includes(qn(L,e,I)))));const t=$n(Z.current,(t=>e.includes((0,ca.get)(t,I))));null==C||C(n?t:t[0])}})))}));zn.displayName="SearchTree";const Bn=zn,Wn=(0,e.createContext)(void 0),Gn={dataIndex:r().string.isRequired,title:r().string.isRequired,description:r().string,colSpan:r().number,width:r().number,minWidth:r().number,fixed:r().oneOf(["left","right"]),align:r().oneOf(["left","center","right"]),theadAlign:r().oneOf(["left","center","right"]),printFixed:r().bool,hidden:r().bool,noAuth:r().bool,noFixed:r().bool,ellipsis:r().bool,className:r().string,theadClassName:r().string,children:r().array,sorter:r().oneOfType([r().bool,r().func]),filter:r().shape({type:r().oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:r().arrayOf(r().shape({text:r().string,value:r().oneOfType([r().string,r().number])})),style:r().object}),precision:r().number,formatType:r().oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:r().bool,canCopy:r().bool,editRender:r().func,dictItems:r().arrayOf(r().shape({text:r().string,value:r().oneOfType([r().string,r().number])})),summation:r().shape({sumBySelection:r().bool,displayWhenNotSelect:r().bool,dataKey:r().string,unit:r().string,render:r().func}),groupSummary:r().shape({dataKey:r().string,unit:r().string,render:r().func}),headRender:r().func,render:r().func},Yn=(r().arrayOf(r().shape(Gn)).isRequired,r().func,r().array,r().oneOfType([r().string,r().func]).isRequired,r().bool,r().bool,r().shape({api:r().func.isRequired,params:r().object.isRequired,formatter:r().func,beforeFetch:r().func,afterFetch:r().func,stopToFirst:r().bool,dataKey:r().string,callback:r().func}),r().bool,r().bool,r().string,r().string,r().bool,r().bool,r().oneOfType([r().object,r().func]),r().oneOfType([r().object,r().func]),r().array,r().func,r().bool,r().bool,r().shape({type:r().oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:r().array,selectedRowKeys:r().array,hideSelectAll:r().bool,checkStrictly:r().bool,filterable:r().bool,selectByClickRow:r().bool,selectFirstRowOnChange:r().bool,clearableAfterFetched:r().bool,selectAllOnCurrentPage:r().bool,fetchSelectedRows:r().shape({api:r().func.isRequired,params:r().object,dataKey:r().string}),fetchAllRowKeys:r().shape({api:r().func.isRequired,params:r().object,dataKey:r().string}),disabled:r().func,onChange:r().func,onSelect:r().func,onSelectAll:r().func}),r().shape({currentRowKey:r().oneOfType([r().number,r().string]),disabled:r().func,onChange:r().func}),r().shape({virtual:r().bool}),r().shape({defaultExpandAllRows:r().bool,defaultExpandedRowKeys:r().array,expandedRowKeys:r().array,hideExpandAll:r().bool,rowExpandable:r().func,expandedRowClassName:r().string,expandedRowRender:r().func,onExpand:r().func,onChange:r().func}),r().shape({groupItems:r().arrayOf(r().shape({dataIndex:r().string.isRequired,titleIndex:r().string,color:r().string,backgroundColor:r().string})),fetch:r().shape({api:r().func.isRequired,params:r().object,dataKey:r().string}),onChange:r().func}),r().func,r().bool,r().bool,r().bool,r().bool,r().shape({current:r().number,pageSize:r().number,pageSizeOptions:r().array,showSizeChanger:r().bool,showQuickJumper:r().bool}),r().shape({fileName:r().string,fetch:r().shape({api:r().func.isRequired,params:r().object}),cellStyle:r().bool,hideIcon:r().bool}),r().shape({showLogo:r().bool}),r().shape({fetch:r().shape({api:r().func.isRequired,params:r().object,dataKey:r().string}),fieldList:r().arrayOf(r().object)}),r().shape({position:r().oneOf(["top","bottom"]),hideAlert:r().bool,hideClearButton:r().bool}),r().oneOf(["left","right"]),r().func,r().func,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().bool,r().func,r().func,r().func,r().func,r().func,r().func,r().func,r().func,r().func,10),Zn="1",Xn="0",Qn="YYYY-MM-DD",Jn="YYYY-MM-DD HH:mm:ss",ei="HH:mm:ss",ti="YYYYMMDDHHmmss",ai={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};let ri;!function(e){e.left="flex-start",e.right="flex-end"}(ri||(ri={}));let li=[];const ni={getFocusInstance:function(){return li[0]??null},getInstance:function(e){return li.find((t=>t.id===e))??null},focus:function(e){const t=this.getInstance(e);t&&0!==li.findIndex((e=>e===t))&&(this.deregister(e),li=[t,...li])},register:function(e,t){e&&t&&(null!==this.getInstance(e)&&this.deregister(e),li=[{id:e,vm:t},...li])},deregister:function(e){e&&(li=li.filter((t=>t.id!==e)))}};var ii=__webpack_require__(353);function oi(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const si=class{constructor(){oi(this,"state",{required:[],validate:[],edited:[],inserted:[],updated:[],removed:[]}),oi(this,"addToRequired",(e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)})),oi(this,"removeFromRequired",(e=>{const t=this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.required.splice(t,1)})),oi(this,"addToValidate",(e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)})),oi(this,"removeFromValidate",(e=>{const t=this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.validate.splice(t,1)})),oi(this,"addToEdited",(e=>{-1===this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.edited.push(e)})),oi(this,"removeFromEdited",(e=>{const t=this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.edited.splice(t,1)})),oi(this,"addToInserted",(e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)})),oi(this,"removeFromInserted",(e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)})),oi(this,"addToUpdated",(e=>{-1===this.state.updated.findIndex((t=>t===e))&&this.state.updated.push(e)})),oi(this,"removeFromUpdated",(e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)})),oi(this,"addToRemoved",(e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)})),oi(this,"removeFromRemoved",(e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)})),oi(this,"clearAllLog",(()=>{this.state.required=[],this.state.validate=[],this.state.edited=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]})),oi(this,"destroy",(()=>{for(const e in this)this[e]=null}))}},ci={defaultColumnWidth:80,selectionColumnWidth:50,rowHeightMaps:{large:42,middle:34,small:26},sortDirections:["ascend","descend"],pagination:{current:1,pageSize:20,pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showQuickJumper:!0},groupSummary:{total:{text:"记录数",value:"*"},recordTotalIndex:"nRecordsCount",summaryFieldName:"tsummary",groupbyFieldName:"tgroupby"},highSearch:{showSQL:!1},treeTable:{textIndent:17},dataKey:"records",summationKey:"summation",totalKey:"total",virtualScrollY:150,sorterFieldName:"tsortby",filterFieldName:"twhere",currentPageName:"currentPage",pageSizeName:"pageSize",showFilterType:!0,printWidth:1040,operationColumn:"__action__",selectionColumn:"__selection__",expandableColumn:"__expandable__",summaryIgnore:"sumIgnored"};let di;const ui=()=>{var e;if(Ne.Z)return 0;if(void 0!==di)return di;const t=document.createElement("div");t.className="qm-scrollbar__wrap",t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const a=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const l=r.offsetWidth;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),di=a-l,di},pi=require("big.js");var hi=__webpack_require__.n(pi);const mi=e=>e.map((e=>(e.children&&(e.children.forEach((t=>{t.parentDataIndex=e.dataIndex,e.fixed?t.fixed=e.fixed:delete t.fixed})),e.children=mi(e.children)),e))),fi=(e,a)=>{const{fetch:r,columns:l,height:n,minHeight:i,maxHeight:o,border:s=!0,rowSelection:c,summation:u,expandable:p,webPagination:h,scrollPagination:m,dragMergeCell:f,showSuperSearch:g,showFastSearch:b,showGroupSummary:y,showTableImport:v,showClipboard:x,showSelectCollection:E,footRender:C}=e,{tableRef:S,tableFullData:w,tableData:T,sorter:N,filters:I,superFilters:_,pagination:R}=a,{selectionRows:P,summaries:O}=S.current,A=t().useMemo((()=>!(null==r||!r.api)),[null==r?void 0:r.api]),k=t().useMemo((()=>!A&&!!h),[A,h]),H=t().useMemo((()=>A&&!!m),[A,m]),F=t().useMemo((()=>(A||k)&&!H),[A,k,H]),L=t().useMemo((()=>!!(n||i||o)),[n,i,o]),q=t().useMemo((()=>(e=>{const t=mi(e),a=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:ci.selectionColumn,title:"radio"===t?d("qm.table.config.selectionText"):"",width:ci.selectionColumnWidth,fixed:"left",type:t}})(c),r=null!=(l=p)&&l.expandedRowRender?{dataIndex:ci.expandableColumn,title:"",width:ci.selectionColumnWidth,fixed:"left",type:"expand"}:null;var l;return a&&t.unshift(a),r&&t.unshift(r),(0,ii.J1)(t)})(l)),[l]),D=t().useMemo((()=>(0,ii.HG)(q)),[q]),$=t().useMemo((()=>D.filter((e=>"function"==typeof e.editRender))),[D]),M=t().useMemo((()=>D.filter((e=>!!e.summation))),[D]),K=t().useMemo((()=>D.filter((e=>"left"===e.fixed))),[D]),V=t().useMemo((()=>D.filter((e=>"right"===e.fixed))),[D]),U=t().useMemo((()=>{const e=D.filter((e=>![ci.expandableColumn,ci.selectionColumn,ci.operationColumn].includes(e.dataIndex)));return e.length?e[0].dataIndex:""}),[D]),j=t().useMemo((()=>M.length>0),[M]),z=t().useMemo((()=>!!C||j),[C,j]),B=t().useMemo((()=>(0,ii.vo)(q).length>1),[q]),W=t().useMemo((()=>s||B),[s,B]),G=t().useMemo((()=>D.some((e=>e.sorter))),[D]),Y=t().useMemo((()=>D.some((e=>e.filter))),[D]),Z=t().useMemo((()=>M.some((e=>!!e.summation.dataKey))),[M]),X=t().useMemo((()=>!A&&!!v),[A,v]),Q=t().useMemo((()=>!!x&&$.length>0),[x,$]),J=t().useMemo((()=>!!E&&"checkbox"===(null==c?void 0:c.type)),[E,c]),ee=t().useMemo((()=>!!g&&Y),[g,Y]),te=t().useMemo((()=>!A&&!!b&&Y),[A,b,Y]),ae=t().useMemo((()=>!!y&&D.some((e=>!!e.groupSummary))),[D]),re=t().useMemo((()=>{var e;return!(null==u||null===(e=u.groupItems)||void 0===e||!e.length)}),[u]),le=t().useMemo((()=>!!f&&!A&&!h),[f,A,h]),ne=t().useMemo((()=>w.some((e=>Array.isArray(e.children)&&e.children.length))),[w]),ie=t().useMemo((()=>!T.length),[T]),oe=t().useMemo((()=>(()=>{const e={};return M.forEach((t=>{const{dataIndex:a,precision:r,summation:l}=t,{sumBySelection:n,displayWhenNotSelect:i,unit:o}=l,s=re?(0,ii.SX)(S.current.tableFullData):S.current.tableFullData,c=!P.length&&!!i;let d=(!n||c?s:P).reduce(((e,t)=>{if(null!=t&&t[ci.summaryIgnore])return e;const r=Number((0,ii.C_)(t,a));return Number.isNaN(r)?e:new(hi())(e).plus(r).toNumber()}),0);!Object.keys(O).includes(a)||n&&!c||(d=Number((0,ii.C_)(O,a))),(0,ii.dN)(e,a,d);let u=r>=0?d.toFixed(r):d;u=(0,ii.uf)(u),(0,ii.dN)(e,`${a}_text`,o?`${u} ${o}`:u)})),[e]})()),[w,P,O]),se=t().useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(M)),[M]),ce=t().useMemo((()=>{const e=(0,ii.W2)(N),t=((e,t)=>{const a=[];if(Object.keys(e).length)for(const t in e){const[r,l]=ci.showFilterType?t.split("|"):[t,""],n=e[t];Object.keys(n).forEach((e=>{a.push({type:l,bracketLeft:"",fieldName:r,expression:e,value:n[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{a.push({type:ci.showFilterType?e.fieldType:"",bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),a.length&&(a[a.length-1].logic=""),a})(I,_);return{...e?{[ci.sorterFieldName]:e}:null,...t.length?{[ci.filterFieldName]:t}:null,...se?{[ci.groupSummary.summaryFieldName]:se,usedJH:1}:null,...(null==r?void 0:r.params)??null,[ci.currentPageName]:R.current,[ci.pageSizeName]:R.pageSize}}),[null==r?void 0:r.params,R.current,R.pageSize,N,I,_,se]);return{isFetch:A,isWebPagination:k,isScrollPagination:H,showPagination:F,shouldUpdateHeight:L,tableColumns:q,flattenColumns:D,editableColumns:$,summationColumns:M,leftFixedColumns:K,rightFixedColumns:V,firstDataIndex:U,showSummary:j,showFooter:z,isHeadGroup:B,bordered:W,isHeadSorter:G,isHeadFilter:Y,isServiceSummation:Z,isSelectCollection:J,isTableImport:X,isTableClipboard:Q,isSuperSearch:ee,isFastSearch:te,isGroupSummary:ae,isGroupSubtotal:re,isDragMergeCell:le,isTreeTable:ne,isTableEmpty:ie,summationRows:oe,fetchParams:ce}},gi=(a,r)=>{const{rowKey:l,dataSource:n,summation:i,fetch:o,rowSelection:s,expandable:c,treeConfig:d,authConfig:u,ignorePageIndex:p,columnsChange:h,onScrollEnd:f,onDataChange:g,onDataLoad:b,onChange:y}=a,{getRowKey:v,tableRef:x,tableElementRef:E,tableBodyRef:C,$size:S,tableColumns:w,tableFullData:T,pagination:N,layout:I,filters:_,sorter:R,superFilters:P,fetchParams:O,selectionKeys:A,rowExpandedKeys:k,highlightKey:H,summationColumns:F,shouldUpdateHeight:L,isFetch:q,isTreeTable:D,isWebPagination:$,isScrollPagination:M,isServiceSummation:K,isGroupSubtotal:V,doLayout:U,setTableData:j,setTableFullData:z,setTableOriginData:B,setAllTableData:W,setDeriveRowKeys:Z,setPagination:X,setSpinning:Q,setSorter:J,setFilters:ee,setSuperFilters:te,setSelectionKeys:ae,setRowExpandedKeys:re,setHighlightKey:le,setSelectionRows:ne,setScrollYLoad:ie,setScrollYStore:oe,setFieldAuth:se,setResizeState:ce,setSummaries:de,setPermission:ue,setRecordsMap:pe,resetTableScroll:he,clearElementStore:me,clearRecordsMap:fe}=r,{store:ge}=x.current,be=Ln(E),ye=t().useRef({...O}),ve=t().useRef({list:[],maps:new Map});Se((()=>{U()}),[w,S,I.tableAutoHeight]),Se((()=>{xe()}),[be]),Se((()=>{Je(),et(),tt(),q||($&&je(),De(n))}),[n,null==o?void 0:o.params]),Se((()=>{const e=Fe(O,ye.current);e||q&&(null==s?void 0:s.clearableAfterFetched)&&at(),e||!(O[ci.currentPageName]>1)||null!=o&&o.stopToFirst?q&&qe():je(),ye.current=O}),[O]),Se((()=>{$&&Ye(),M||he(),Ae()}),[N.current,N.pageSize]),Se((()=>{q||Ee(T.length),U()}),[T]),Se((()=>{D&&null!=d&&d.virtual&&(ze(),Ye())}),[k]);const xe=()=>{const{scrollYLoad:e,resizeState:t}=x.current,{height:a}=t,{width:r,height:l}=be,n=l!==a;U(),n&&L&&e&&Ye(),ce(Object.assign({},t,{width:r,height:l}))},Ee=e=>{e!==N.total&&X((t=>Object.assign({},t,{total:e})))},Ce=(0,Y.Ds)((e=>{Ke(),null==f||f(e)})),we=e=>V?Te(Ne(e,0)):e,Te=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Te(e.children)),delete e.children,t.push(e)})),t},Ne=(e,t)=>{var a;const r=null===(a=i.groupItems)||void 0===a?void 0:a[t];return r?(0,ii.v9)(e,[r.dataIndex]).map((e=>{const a={children:Ne(e,t+1),_group:r.dataIndex};return"function"!=typeof l&&(0,ii.dN)(a,l.toString(),(0,ii.wE)()),r.titleIndex&&(0,ii.dN)(a,r.titleIndex,(0,ii.C_)(e[0],r.titleIndex)),(0,ii.dN)(a,r.dataIndex,(0,ii.C_)(e[0],r.dataIndex)),F.forEach((e=>{var t;const{dataIndex:r}=e,l=null===(t=a.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[ci.summaryIgnore])return e;const a=Number((0,ii.C_)(t,r));return Number.isNaN(a)?e:e+a}),0);(0,ii.dN)(a,r,l)})),a})):(e.forEach(((t,a)=>{t._rowSpan=0===a?e.length:0,t._colSpan=1})),e)},Ie=e=>{const{selectionRows:t,allTableData:a,recordsMap:r}=x.current;if(q)return[...t.filter((t=>e.includes(v(t,t.index)))),...a.filter((a=>{const r=v(a,a.index);return e.includes(r)&&-1===t.findIndex((e=>v(e,e.index)===r))}))];const l=[];for(let t=0,a=e.length;t<a;t++){const a=e[t];r.has(a)&&l.push(r.get(a))}return l},_e=e=>{const{type:t,checkStrictly:a=!0}=s||{},r=Array.isArray(e)?e:A;let l=[];return x.current.treeTable&&!a&&r.forEach((e=>{l.push(...((e,t)=>{var a;const{deriveRowKeys:r}=x.current,l=(0,ii.CD)(r,e);let n=[];if(!l)return n;const i=Pe((null==l?void 0:l.children)||[]),o=(null===(a=(0,ii.Qi)(r,e))||void 0===a?void 0:a.slice(0,-1).reverse())||[];return n=[...new Set([...t,...i])],o.forEach((e=>{var t;const a=(0,ii.CD)(r,e),l=(0,ii.bY)(n,(null==a||null===(t=a.children)||void 0===t?void 0:t.map((e=>e.rowKey)))||[]);n=l?[...n,e]:n.filter((t=>t!==e))})),n})(e,r))})),l="radio"===t?r.slice(0,1):[...new Set([...r,...l])],l},Re=e=>{const{allRowKeys:t,deriveRowKeys:a,flattenRowKeys:r}=x.current,{defaultExpandAllRows:l,expandedRowRender:n}=c||{},i=Array.isArray(e)?e:k;if(x.current.treeTable){n&&m("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...A];H&&e.unshift(H);let o=[];return e.forEach((e=>{const t=(0,ii.Qi)(a,e)||[];o.push(...t.length>1?t.slice(0,-1).reverse():t)})),o=l?t:[...new Set([...i,...o])],o.filter((e=>!r.includes(e)))}return c?l?t.slice(0):[...i]:[]},Pe=e=>{const t=[];for(let a=0;a<e.length;a++)Array.isArray(e[a].children)&&t.push(...Pe(e[a].children)),t.push(e[a].rowKey);return t},Oe=(e,t)=>{const a=[];return e.forEach((e=>{e.children&&a.push(...Oe(e.children,t)),e.rowKey===t&&e.parentRowKey&&a.push(e.parentRowKey)})),a.length&&a.push(...Oe(e,a[a.length-1])),a},Ae=(0,Y.Ds)((()=>{Me(),null==y||y(N,He(_),ke(R),P,{currentDataSource:We()})})),ke=e=>{const t={};for(const a in e)null!==e[a]&&(t[a]=e[a]);return t},He=e=>{const t={};for(const a in e){if(!a.includes("|"))continue;const[r,l]=a.split("|");t[ci.showFilterType?`${r}|${l}`:r]=e[a]}return t},Fe=(e,t)=>{const a=Object.keys((0,ii.e5)(e,t));return 1===a.length&&(a.includes(ci.currentPageName)||a.includes(ci.pageSizeName))},Le=async()=>{var e;if(!o)return;const{formatter:t=(e=>e),beforeFetch:a=Y.XT,afterFetch:r,callback:l}=o;if(!a(O))return;const n=M&&O[ci.currentPageName]>ye.current[ci.currentPageName]&&Fe(O,ye.current),s=!(null==i||null===(e=i.fetch)||void 0===e||!e.api);Q(!0);try{const[e,a]=s?await Promise.all([o.api(t(O)),i.fetch.api(t(O))]):[await o.api(t(O))];if(s?200===e.code&&200===a.code:200===e.code){const t=o.dataKey??ci.dataKey;let i=(0,ca.get)(e.data,t)??[];i="function"==typeof r?await r(i):i;const s=(0,ca.get)(e.data,t.replace(/[^.]+$/,ci.totalKey))||i.length||0;De(n?x.current.tableFullData.concat(i):i),Ee(s),$e((null==a?void 0:a.data)||e.data),null==l||l(e.data)}}catch(e){}(0,ii.RI)(o,"stopToFirst")&&(o.stopToFirst=!1),Q(!1)},qe=function(t,a){const r=e.useRef();return e.useEffect((()=>()=>clearTimeout(r.current)),[]),()=>{clearTimeout(r.current),r.current=setTimeout(t,undefined)}}(Le),De=e=>{const t=e=>e.map(((e,a)=>(Array.isArray(e.children)&&e.children.length&&(e.children=t(e.children)),e.index=a,p||(e.pageIndex=(e=>{const{current:t,pageSize:a}=N;return!q||M?e:(t-1)*a+e})(a)),e))),a=we(t(e));Ze(a),Xe(a),Qe(),ae(_e()),re(Re()),ne(Ie(A)),Me(),null==b||b(a)},$e=e=>{var t;if(!K)return;const a=(null==i||null===(t=i.fetch)||void 0===t?void 0:t.dataKey)??ci.summationKey,r=(a?(0,ca.get)(e,a):e)??{},l={};F.filter((e=>!!e.summation.dataKey)).forEach((e=>{(0,ii.dN)(l,e.dataIndex,Number((0,ii.C_)(r,e.summation.dataKey)))})),de(l)},Me=()=>{const{type:e,selectFirstRowOnChange:t}=s||{};if("radio"===e&&t){const e=We();if(e.length){const t=v(e[0],e[0].index);ae([t])}else ae([])}},Ke=()=>{if(!M)return;const e=Ue();N.current>=e||Ve({...N,current:N.current+1})},Ve=e=>{let{current:t,pageSize:a}=e;X((e=>Object.assign({},e,{current:t,pageSize:a})))},Ue=()=>{const{pageSize:e,total:t}=N;return Math.ceil(t/e)},je=()=>{Ve(Object.assign({},N,{current:1}))},ze=()=>{if(!x.current.treeTable||null==d||!d.virtual)return;const e=Be(x.current.deriveRowKeys,(()=>{const{allTableData:e,allRowKeys:t}=x.current,{rowExpandable:a}=c||{},r=[];return"function"==typeof a&&e.forEach(((e,l)=>!a(e)&&r.push(t[l]))),r.length?k.filter((e=>!r.includes(e))):k})());ve.current.list=e,ve.current.maps.clear(),e.forEach(((e,t)=>ve.current.maps.set(e.rowKey,t)))},Be=(e,t)=>{const a=[];return e.forEach((e=>{e.children&&a.push(...Be(e.children,t)),(void 0===e.parentRowKey||t.includes(e.parentRowKey)&&e.rowKeyPath.split("#").slice(0,-1).every((e=>t.findIndex((t=>t==e))>-1)))&&a.push({rowKey:e.rowKey,level:e.level})})),a},We=()=>$?(()=>{const{current:e,pageSize:t}=N;return x.current.tableFullData.slice((e-1)*t,e*t)})():x.current.tableFullData,Ge=e=>{const{scrollYLoad:t,scrollYStore:a}=x.current;j(t?e.slice(a.startIndex,a.endIndex):e)},Ye=()=>{let e=We();x.current.treeTable&&null!=d&&d.virtual&&(e=(e=>{const{allTableData:t,allRowKeys:a}=x.current,{list:r,maps:l}=ve.current,n=[];for(let e=0,i=a.length;e<i;e++){const i=a[e];l.has(i)&&(t[e]._level=r[l.get(i)].level,n.push(t[e]))}return n})()),ie(e.length>ci.virtualScrollY),(e=>{const{elementStore:t,scrollYStore:a,scrollYLoad:r}=x.current,{startIndex:l,rowHeight:n}=a;let i="",o="";r&&(i=`translateY(${Math.max(0,l*n)+"px"})`,o=e.length*n+"px"),t.$tableBody.style.transform=i,t.$tableYspace.style.height=o})(e),Ge(e)},Ze=e=>{z(e),W(e),Z(e),ze(),Ye()},Xe=e=>{B(e)},Qe=()=>{const{allTableData:e}=x.current;fe(),e.forEach((e=>pe(v(e,e.index),e)))},Je=()=>{J({})},et=()=>{ee({})},tt=()=>{te([])},at=()=>{ae([])};return{initialTable:()=>{(async()=>{if(!u)return;let e=G()(u,["fetch"]);if(u.fetch){const{api:t,params:a,dataKey:r}=u.fetch;try{const l=await t(a);200===l.code&&(e=(r?(0,ca.get)(l.data,r):l.data)??{})}catch(e){}}if(Object.keys(e).length){const{isExport:t=1,isImport:a=1,isPrint:r=1}=e;ue((e=>Object.assign({},e,{export:!!t,import:!!a,print:!!r})))}if(Array.isArray(e.fieldList)){const{originColumns:t}=x.current,r=(0,ii.y1)(a.columns,(a=>{const{dataIndex:r}=a,l=e.fieldList.find((e=>e.dataIndex===r));if(l){const{visible:e=1,disabled:n,secretName:i}=l,o=(0,ii.Ps)(t,r);se(r,{visible:e,disabled:n,secretName:i}),e||(a.noAuth=!0,o.noAuth=!0),i&&(a.formatType=`secret-${i}`,o.formatType=`secret-${i}`)}}));null==h||h(r)}})(),H&&C.current.setClickedValues([H,""]),"radio"===(null==s?void 0:s.type)&&A.length&&C.current.setClickedValues([A[0],""]),q?Le():De(n)},createTableFullData:Ze,getTableData:Le,handleTableData:Ge,createTableData:De,createGroupData:we,createSelectionKeys:_e,createSelectionRows:Ie,createRowExpandedKeys:Re,findParentRowKeys:Oe,getAllChildRowKeys:Pe,doFieldValidate:(e,t,a,r)=>{if(!Array.isArray(e))return m("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(ge.removeFromRequired({x:a,y:r}),ge.removeFromValidate({x:a,y:r}),e.forEach((e=>{var l;e.required&&(0,Y.xb)(t)&&ge.addToRequired({x:a,y:r,text:e.message}),"function"!=typeof e.validator||null!==(l=e.validator)&&void 0!==l&&l.call(e,t)||ge.addToValidate({x:a,y:r,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:a,updated:r,removed:l}=ge.state,n=(0,ca.intersection)(a,l),i=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:i(e),validate:i(t),inserted:a.filter((e=>!n.includes(e))),updated:r.filter((e=>![...(0,ca.intersection)(r,a),...(0,ca.intersection)(r,l)].includes(e))),removed:l.filter((e=>!n.includes(e)))}},dataChange:()=>{null==g||g(x.current.tableFullData)},tableChange:Ae,toLastPage:()=>{const e=Ue();N.current!==e&&Ve(Object.assign({},N,{current:e}))},toFirstPage:je,getPageCount:Ue,pagerChangeHandle:Ve,triggerScrollYEvent:e=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollYStore:t}=x.current,{startIndex:a,endIndex:r,offsetSize:l,visibleSize:n,rowHeight:i}=t,o=Math.floor(e/i),s=Math.max(0,o-1-l),c=o+n+l;(o<=a||o>=r-n-1)&&(a===s&&r===c||(oe(Object.assign({},t,{startIndex:s,endIndex:c})),Ye()))}(e)},scrollBottomDebouncer:Ce,clearTableSorter:Je,clearTableFilter:et,clearSuperFilters:tt,clearRowSelection:at,clearRowHighlight:()=>{le("")},clearTableLog:()=>{ge.clearAllLog()},destroy:()=>{me(),ge.destroy(),ni.deregister(x.current.uid)}}},bi=(e,a)=>{const{height:r,minHeight:l,maxHeight:n,resizable:i,showHeader:o,spanMethod:s}=e,{getRowKey:c,tableRef:d,$size:u,tableColumns:p,flattenColumns:h,leftFixedColumns:m,layout:f,scrollY:g,tableData:b,showFooter:y,showPagination:v,isWebPagination:x,isFullScreen:E,setLayout:C,setScrollX:S,setScrollY:w,setElementStore:T,setScrollYStore:N,setShouldToTop:I}=a,_=t().useRef(g),R=t().useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=f,a={};return l&&Object.assign(a,{minHeight:`${(0,ii.EJ)(l)}px`}),n&&Object.assign(a,{maxHeight:`${(0,ii.EJ)(n)}px`}),E?{...a,maxHeight:"",minHeight:"",height:`${e}px`}:r?{...a,height:"auto"!==r?`${(0,ii.EJ)(r)}px`:`${t}px`}:a}),[r,n,l,E,f]),P=(e,t)=>{const{elementStore:a,scrollYStore:r,allTableData:l}=d.current,n=a.$tableBody.parentNode;if(void 0!==t&&t>=0)n.scrollTop=t*r.rowHeight;else{const t=(x?(0,ii.tL)(b):l).findIndex((t=>e===c(t,t.index)));n.scrollTop=(t<0?0:t)*r.rowHeight}};return{createElementStore:e=>{Object.keys(e).forEach((t=>{T(t,e[t])}))},tableStyles:R,getSpan:(e,t,a,r,l)=>{let n=1,i=1;if("function"==typeof s){const o=s({row:e,column:t,rowIndex:a,columnIndex:r,tableData:l});Array.isArray(o)?(n=o[0],i=o[1]):(0,Y.Kn)(o)&&(n=o.rowSpan,i=o.colSpan)}const{mergeCells:o}=d.current;if(o.length>0){const e=o.find((e=>e.row===a&&e.col===r));e&&(n=e.rowSpan,i=e.colSpan)}return{rowSpan:n,colSpan:i}},getStickyLeft:e=>{h.findIndex((t=>t.dataIndex===e))<0&&(e=(0,ii.t2)((0,ii.Ps)(p,e)).dataIndex);let t=0;for(let a=0;a<h.length;a++){const r=h[a];if(r.dataIndex===e)break;t+=(0,ii.EJ)(r.width||r.renderWidth||0)}return t},getStickyRight:e=>{h.findIndex((t=>t.dataIndex===e))<0&&(e=(0,ii.gU)((0,ii.Ps)(p,e)).dataIndex);let t=0;for(let a=h.length-1;a>=0;a--){const r=h[a];if(r.dataIndex===e)break;t+=(0,ii.EJ)(r.width||r.renderWidth||0)}return t},scrollXToColumn:(e,t)=>{const{elementStore:a}=d.current,r=void 0===t?h.findIndex((t=>t.dataIndex===e)):t;if(r<0)return;const l=m.map((e=>e.width||e.renderWidth||ci.defaultColumnWidth)).reduce(((e,t)=>e+t),0);a.$tableBody.parentNode.scrollLeft=a.$tableBody.querySelectorAll("tbody > tr > td")[r].offsetLeft-l},scrollYToRecord:P,rowInViewport:e=>{const{elementStore:t,scrollYStore:a}=d.current,{viewportHeight:r,gutterWidth:l}=f,n=e*a.rowHeight,i=t.$tableBody.parentNode;return!(n<i.scrollTop||n+a.rowHeight>i.scrollTop+(scrollX?r-l:r))},calcTableHeight:()=>{if("auto"!==r)return;const{elementStore:e,resizeState:t}=d.current,a=t.winHeight-e.$table.getBoundingClientRect().top-(v?Oa["small"!==u?"middle":u]+Yn:0)-Yn;C((e=>Object.assign({},e,{tableAutoHeight:a})))},resetTableScroll:()=>{const{shouldToTop:e}=d.current;e&&P("",0),I(!0)},doLayout:()=>{(()=>{const{elementStore:e,scrollYLoad:t,resizeState:a}=d.current;if(!e.$table.offsetParent)return;const r=e.$table.offsetHeight,l=o?e.$header.offsetHeight:f.headerHeight,n=y?e.$footer.offsetHeight:f.footerHeight,i=r-l-n,s=e.$tableBody.offsetHeight,c=t||s>i;let p=0;if(E){const t=e.$toper?e.$toper.offsetHeight+Yn:0,r=e.$pager?e.$pager.offsetHeight+Yn:0;p=a.winHeight-t-r-20}i!==f.viewportHeight&&(e=>{const{scrollYStore:t,isIE:a}=d.current,{startIndex:r,endIndex:l}=t,n=ci.rowHeightMaps[u],i=Math.max(8,Math.ceil(e/n)+2),o=a?5:0;N(Object.assign({},t,{visibleSize:i,offsetSize:o,endIndex:Math.max(r+i+o,l),rowHeight:n}))})(i),_.current=c,w(c),C((e=>Object.assign({},e,{headerHeight:l,footerHeight:n,viewportHeight:i,tableBodyHeight:s,tableFullHeight:p})))})(),(()=>{const{elementStore:e}=d.current,t=e.$table.clientWidth,a=_.current?f.gutterWidth:0,{defaultColumnWidth:r}=ci,l=h.filter((e=>"number"!=typeof e.width));let n=0;if(h.forEach((e=>{"number"==typeof e.width&&(e.renderWidth=void 0)})),l.length>0){if(h.forEach((e=>{n+=e.width||e.minWidth||r})),n<=t-a){S(!1);const e=t-a-n;if(1===l.length&&i)l[0].renderWidth=(l[0].minWidth||r)+e;else{const t=e/l.reduce(((e,t)=>e+(t.minWidth||r)),0);let a=0;l.forEach(((e,l)=>{if(0===l)return;const n=Math.floor((e.minWidth||r)*t);a+=n,e.renderWidth=(e.minWidth||r)+n})),i&&(l[0].renderWidth=(l[0].minWidth||r)+e-a)}}else S(!0),l.forEach((e=>{e.renderWidth=e.minWidth||r}));C((e=>Object.assign({},e,{tableBodyWidth:Math.max(n,t)})))}else h.forEach((e=>{e.renderWidth=e.width||e.minWidth||r,n+=e.renderWidth})),S(n>t),C((e=>Object.assign({},e,{tableBodyWidth:n})));C((e=>Object.assign({},e,{tableWidth:t})))})()}}};function yi(){const[,t]=e.useReducer((e=>e+1),0);return t}const vi=e=>{const{total:a}=e,{tableRef:r,tableProps:l,selectionKeys:n,isHeadSorter:i,isHeadFilter:o,isTreeTable:s,clearTableSorter:c,clearTableFilter:u,clearSuperFilters:p,clearRowSelection:h,clearRowHighlight:m}=t().useContext(Wn),{infoBarConfig:f,rowSelection:g,rowHighlight:b}=l,{allTableData:y}=r.current,{hideAlert:v,hideClearButton:x}=f||{},E=t().useMemo((()=>!v),[v]),C=t().useMemo((()=>!x&&!!(i||o||g||b)),[x,i,o,g,b]),S={[`${se("table")}__alert`]:!0};return E?t().createElement("div",{className:oe()(S)},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.InfoCircleFilled,null)),t().createElement("span",null,d("qm.table.alert.total",{total:s?y.length:a}),g?`,${d("qm.table.alert.selected",{total:n.length})}`:""),C&&t().createElement("em",{onClick:()=>{c(),u(),p(),h(),m()}},d("qm.table.alert.clear"))):null},xi=t().forwardRef(((e,a)=>{const{isFullScreen:r,open:l=!0}=e,{setFullScreen:n}=t().useContext(Wn),i=()=>{n(!r)};t().useImperativeHandle(a,(()=>({clickHandle:i})));const o=se("table");return l?t().createElement("span",{className:`${o}-full-screen`,title:d(r?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>i()},t().createElement("i",{className:"svgicon icon"},r?t().createElement(ce.FullscreenExitOutlined,null):t().createElement(ce.FullscreenOutlined,null))):null}));xi.displayName="FullScreen";const Ei=xi,Ci=t().forwardRef(((e,a)=>{const{open:r=!0}=e,{getTableData:l}=t().useContext(Wn),n=()=>{l()};t().useImperativeHandle(a,(()=>({clickHandle:n})));const i=se("table");return r?t().createElement("span",{className:`${i}-reload`,title:d("qm.table.refresh.text"),onClick:()=>n()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.ReloadOutlined,null))):null}));Ci.displayName="Reload";const Si=Ci,wi=t().forwardRef(((e,a)=>{var r,n;const{tableColumns:i,open:o=!0}=e,{global:s}=t().useContext(l),{tableRef:c,tableBodyRef:u,tableProps:p,flattenColumns:h,summationRows:m,showSummary:f,getSpan:g}=t().useContext(Wn),{tablePrint:b,showHeader:y}=p,v=(null==s||null===(r=s.print)||void 0===r?void 0:r.leftLogo)??"",x=(null==s||null===(n=s.print)||void 0===n?void 0:n.rightLogo)??"",E=!(!v&&!x),C=t().useMemo((()=>(0,Y.I8)((0,ii.MY)(i,[ci.expandableColumn,ci.selectionColumn,ci.operationColumn]))),[i]),S=t().useMemo((()=>(0,Y.I8)((0,ii.MY)(h,[ci.expandableColumn,ci.selectionColumn,ci.operationColumn]))),[h]),w=t().useMemo((()=>(0,Y.I8)(i.filter((e=>e.printFixed)))),[i]),T=(e,t)=>{const a=Object.assign({},(0,ii.Ps)(t,e.parentDataIndex));return a.children=[e],a.level&&a.level>1?T(a,t):a},N=(e,t)=>(0,ca.map)((0,ca.groupBy)((0,ca.flatten)(e),t),(0,ca.spread)((function(){for(var e=arguments.length,a=new Array(e),r=0;r<e;r++)a[r]=arguments[r];return(0,ca.mergeWith)(...a,((e,a)=>{if(Array.isArray(e))return N(e.concat(a),t)}))}))),I=()=>{const{allTableData:e}=c.current,t=(e=>{const t=[];let a=[],r=0,l=0;for(;l<e.length;){const n=e[l];r+=n.width||n.renderWidth||n.minWidth||ci.defaultColumnWidth,r<=ci.printWidth?(a.push(n),l===e.length-1&&t.push(a),l++):l>0?(e.splice(0,l),w.length&&e.unshift(...w),t.push(a),a=[],r=0,l=0):(n.width=ci.printWidth,a.push(n),t.push(a),l++)}return t})([...S]),a=((e,t)=>{const a=[];return e.forEach((e=>{let r=[];e.forEach((e=>{1===e.level?r.push(e):r.push(T(e,t))})),r=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const a=e.filter((e=>e.dataIndex===t));return a.length<=1?a[0]:N(a,"dataIndex")[0]})))(r),a.push((0,ii.vo)(r))})),a})(t,C);let r=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<style>\n * {\n margin: 0;\n padding: 0;\n }\n body * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n }\n table--print {\n font-size: 14px;\n text-align: left;\n }\n .table--print th,\n .table--print td {\n padding: 5px;\n border: 1px solid #000;\n }\n .no-border th,\n .no-border td {\n border: 0!important;\n }\n .table--print th[colspan]:not([colspan='1']) {\n text-align: center;\n }\n .page-break {\n page-break-after: always;\n }\n</style>","</head>","<body>"].join("");for(let l=0;l<t.length;l++)r+=_(a[l],t[l],e),r+='<div class="page-break"></div>';return r+"</body></html>"},_=(e,t,a)=>{const{showLogo:r=!0}=b;let l='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return l+=`<colgroup>${t.map((e=>{let{width:t,minWidth:a,renderWidth:r}=e;return`<col style="width:${t||r||a||ci.defaultColumnWidth}px">`})).join("")}</colgroup>`,y&&(l+=["<thead>",r&&E?`<tr><th colspan="${t.length}" style="border: 0">${['<table class="no-border" width="100%" border="0" cellspacing="0" cellpadding="0">',"<tr>",'<td width="50%" align="left">',v?`<img src="${v}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',x?`<img src="${x}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:a}=e;return 0===a?null:`<th colspan="${a}" rowspan="${t}">${e.title}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),a.length&&(l+=`<tbody>${a.map((e=>`<tr>${t.map(((t,r)=>{const{rowSpan:l,colSpan:n}=g(e,t,e.index,r,a);return l&&n?`<td rowspan="${l}" colspan="${n}">${((e,t,a,r)=>u.current.renderCellTitle(a,e,t,r))(e,e.index,t,r)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),f&&m.length&&(l+=["<tfoot>",m.map((e=>`<tr>${t.map(((t,r)=>{const{dataIndex:l,summation:n}=t,i=null!=n&&n.render?n.render(a):(0,ii.C_)(e,`${l}_text`);return`<td>${0===r&&""===i?d("qm.table.config.summaryText"):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),l+="</table>",l},R=()=>{var e;null===(e=((e,t)=>{const{filename:a,type:r,isDownload:l}={filename:"print",type:"html",isDownload:!1},n=`${a}.${r}`;if(window.Blob){const e=new Blob([t],{type:`text/${r}`});if(!l)return Promise.resolve({type:r,content:t,blob:e});tt(e,n)}})(0,I()))||void 0===e||e.then((e=>{let{content:t,blob:a}=e,r=document.createElement("iframe");r.setAttribute("frameborder","0"),r.setAttribute("width","100%"),r.setAttribute("height","0"),r.style.display="none",document.body.appendChild(r),c.current.isIE?(r.contentDocument.write(t),r.contentDocument.execCommand("print"),r.parentNode.removeChild(r),r=null):(r.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{r.parentNode.removeChild(r),r=null}))},r.src=URL.createObjectURL(a))}))};t().useImperativeHandle(a,(()=>({clickHandle:R})));const P=se("table");return o?t().createElement("span",{className:`${P}-print`,title:d("qm.table.print.text"),onClick:()=>R()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.PrinterOutlined,null))):null}));wi.displayName="TablePrint";const Ti=wi,Ni=require("exceljs");var Ii=__webpack_require__.n(Ni);const _i="606060",Ri="thin",Pi="d4d4d4",Oi=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Ai=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},ki=()=>({top:{style:Ri,color:{argb:Pi}},left:{style:Ri,color:{argb:Pi}},bottom:{style:Ri,color:{argb:Pi}},right:{style:Ri,color:{argb:Pi}}}),Hi=e=>{const{children:t}=e;return t&&t.length?Hi(t[0]):e},Fi=e=>{const{precision:t,formatType:a}=e,r=t>=0?t?`0.${new Array(t).fill("0").join("")}`:"0":"";return r?{numFmt:r}:"percent"===a?{numFmt:t>=0?`${r}%`:"0%"}:"finance"===a?{numFmt:t>=0?`#,##${r}`:"#,##0"}:null},Li=()=>{const{tableRef:e,tableProps:a,getSpan:r,showSummary:l,isHeadGroup:n}=t().useContext(Wn),{spanMethod:i,showHeader:o}=a,s=(e,t)=>{var a;return(null===(a=e.find((e=>e.text==t)))||void 0===a?void 0:a.value)??""};return{exportXLSX:async(t,a,s,c)=>{const{columns:u,footSummation:p}=t,{scrollYStore:{rowHeight:h}}=e.current,m=(0,ii.HG)(u),f=(0,ii.vo)(u),g=[],b=[],y=[],v=[];let x=0;const E={};m.forEach((e=>{const{dataIndex:t,title:a,width:r,minWidth:l,renderWidth:n}=e;E[t]=a,y.push({key:t,width:(r||n||l||ci.defaultColumnWidth)/8})})),o&&(n?f.forEach(((e,t)=>{const a={};e.forEach((e=>{const{colSpan:r,rowSpan:l}=e,n=Hi(e),i=m.findIndex((e=>{let{dataIndex:t}=e;return t===n.dataIndex}));a[n.dataIndex]=e.title,0!==r&&(r>1||l>1)&&v.push({s:{r:t,c:i},e:{r:t+l-1,c:i+r-1}})})),g.push(a)})):(m.forEach(((e,t)=>{const{colSpan:a,rowSpan:r}=e;(a>1||r>1)&&v.push({s:{r:x,c:t},e:{r:x+r-1,c:t+a-1}})})),g.push(E)),x+=g.length);const C=a.map(((e,t)=>{const l={};return m.forEach(((n,o)=>{if("function"==typeof i){const{rowSpan:l,colSpan:i}=r(e,n,t,o,a);(i>1||l>1)&&v.push({s:{r:t+x,c:o},e:{r:t+x+l-1,c:o+i-1}})}const s=["percent","finance"].includes(n.formatType);l[n.dataIndex]=s?(0,ii.C_)(e,n.dataIndex):c(e,t,n,o)})),l}));x+=C.length,l&&p&&s(m,a).forEach(((e,t)=>{const r={};m.forEach(((t,l)=>{const{dataIndex:n,summation:i}=t,o=null!=i&&i.render?i.render(a):(0,ii.C_)(e,n);r[n]=0===l&&""===o?d("qm.table.config.summaryText"):(0,Y.l$)(o)?(0,ii.gn)(o).join(""):o})),b.push(r)}));const{sheetName:S,useStyle:w}=t,T=new(Ii().Workbook),N=T.addWorksheet(S);N.columns=y,o&&N.addRows(g).forEach((e=>{w&&Oi(e,h),e.eachCell((e=>{const t=N.getColumn(e.col),a=(0,ii.Ps)(u,t.key),{align:r}=a;Ai(e,r),w&&Object.assign(e,{font:{bold:!0,color:{argb:_i}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:ki()})}))})),N.addRows(C).forEach((e=>{w&&Oi(e,h),e.eachCell((e=>{const t=N.getColumn(e.col),a=(0,ii.Ps)(u,t.key),{align:r}=a;Ai(e,r),Object.assign(e,Fi(a)),w&&Object.assign(e,{font:{color:{argb:_i}},border:ki()})}))})),l&&p&&N.addRows(b).forEach((e=>{w&&Oi(e,h),e.eachCell((e=>{const t=N.getColumn(e.col),a=(0,ii.Ps)(u,t.key),{align:r}=a;Ai(e,r),Object.assign(e,Fi(a)),w&&Object.assign(e,{font:{color:{argb:_i}},border:ki()})}))})),v.forEach((e=>{let{s:t,e:a}=e;N.mergeCells(t.r+1,t.c+1,a.r+1,a.c+1)}));const I=await T.xlsx.writeBuffer();return new Blob([I],{type:"application/octet-stream"})},exportCSV:(e,t)=>{const a=e=>{let t=e;const a=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),r=-1!==e.indexOf('"');return r&&(t=t.replace(/"/g,'""')),(a||r)&&(t='"'+t+'"'),t},r="\ufeff"+(e=>{let t,r,l,n,i="";for(t=0;t<e.rows.length;t+=1){for(l=e.rows[t],r=0;r<l.cells.length;r+=1)n=l.cells[r],i=i+(r?",":"")+a(n.textContent.trim());i+="\r\n"}return i})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var l;return((e,t,a)=>{t=t||"",a=a||512;const r=window.atob(e),l=[];let n;for(n=0;n<r.length;n+=a){const e=r.slice(n,n+a),t=new Array(e.length);let i;for(i=0;i<e.length;i+=1)t[i]=e.charCodeAt(i);const o=new window.Uint8Array(t);l.push(o)}return new window.Blob(l,{type:t})})((l=r,window.btoa(unescape(encodeURIComponent(l)))),"application/csv")},importXLSX:(e,t)=>{const{columns:a,file:r}=e,l=(0,ii.HG)(a),n=new FileReader;n.onerror=()=>{N.message.error(d("qm.table.import.error"))},n.onload=e=>{const a=l.map((e=>e.title)),r=new(Ii().Workbook),n=e.target;n?r.xlsx.load(n.result).then((e=>{const r=e.worksheets[0];if(r){const e=r.getSheetValues(),n=e.findIndex((e=>e&&e.length>0)),i=e[n],o=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(a,i);if(o){const r=e.slice(n+1).map((e=>{const t={};e.forEach(((e,a)=>{let r=e;(0,Y.Kn)(r)&&(r=e.text),(0,ca.isDate)(r)&&(r=(0,ii.p6)(e,Jn)),t[i[a]]=r}));const r={};return a.forEach(((e,a)=>{const{dataIndex:n,dictItems:i}=l[a];var o;Array.isArray(i)&&(null!==(o=t[e])&&void 0!==o&&o.includes(",")?t[e]=t[e].split(",").map((e=>s(i,e))).filter((e=>""!==e)):t[e]=s(i,t[e])),(0,ii.dN)(r,n,t[e])})),r}));null==t||t(r)}else N.message.error(d("qm.table.import.error"))}else N.message.error(d("qm.table.import.error"))})):N.message.error(d("qm.table.import.error"))},n.readAsArrayBuffer(r)}}},qi=e=>{const{fileType:a,onChange:r}=e;let l,n;const i=se("table"),o=e=>{const t=e.name,a=t.lastIndexOf("."),r=t.substring(a+1,t.length);return{filename:t.substring(0,a),type:r}};return t().createElement(J,{onClick:()=>(async()=>{try{const e=await(e=>{const t=Object.assign({},e);return l||(l=document.createElement("form"),n=document.createElement("input"),l.className=`${i}--file-form`,n.name="file",n.type="file",l.appendChild(n),document.body.appendChild(l)),new Promise(((e,a)=>{const r=!t.type;n.multiple=!!t.multiple,n.accept=r?"":`.${t.type}`,n.onchange=i=>{const{files:s}=i.target,c=s[0];let u="";if(!r)for(let e=0;e<s.length;e++){const{type:a}=o(s[e]);if(t.type!==a){u=a;break}}u?(N.message.warning(d("qm.upload.notType",{type:u})),a()):e(c),document.body.removeChild(l),l=null,n=null},l.reset(),n.click()}))})({type:a});null==r||r(e.name,e)}catch(e){}})()},d("qm.upload.text"))},Di=e=>{const{columns:a,onClose:r}=e,{tableRef:l,tableProps:n,createTableData:i,dataChange:o}=t().useContext(Wn),{beforeTableImport:s}=n,{importXLSX:c}=Li(),u=t().useRef(null),[p,h]=t().useState(!1),[m,f]=t().useState(!0),g=e=>e.filter((e=>![ci.expandableColumn,ci.selectionColumn,"index","pageIndex",ci.operationColumn].includes(e.dataIndex))),[b,y]=t().useState([{type:"INPUT",label:d("qm.table.export.fileName"),fieldName:"fileName",render:(e,a)=>{const{fileName:r}=a.GET_FIELDS_VALUE(["fileName"]);return t().createElement(t().Fragment,null,r?t().createElement("span",null,r):t().createElement(qi,{fileType:a.state.formData.fileType,onChange:(e,t)=>{a.SET_FIELDS_VALUE({fileName:e,file:t}),t&&f(!1)}}))}},{type:"SELECT",label:d("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:d("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:d("qm.table.import.fillText"),value:"fill"},{text:d("qm.table.import.addText"),value:"add"},{text:d("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{b.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,y([...b])}},{type:"INPUT_NUMBER",label:d("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:1,max:l.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]),v=se("table");return t().createElement("div",{className:`${v}-import__setting`},t().createElement(Zl,{ref:u,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:{posIndex:"条"},items:b,cols:1,labelWidth:100}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>r(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(J,{type:"primary",loading:p,disabled:m,onClick:()=>(async()=>{const[e,t]=await u.current.GET_FORM_DATA();e||(h(!0),c({columns:g(a),file:t.file},(async e=>{const{tableFullData:a,store:n}=l.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof s)try{e=await s(e)}catch(e){}if("fill"===t.importType&&i(e),"add"===t.importType&&i([...a,...e]),"insert"===t.importType){const{tableFullData:a}=l.current,r=t.posIndex,n=a.slice(0,r).concat(e).concat(a.slice(r));i(n)}e.forEach((e=>{n.addToInserted(e)})),o(),N.message.success(d("qm.table.import.success",{total:e.length})),h(!1),r()})))})()},d("qm.table.import.text"))))},$i=t().forwardRef(((e,a)=>{const{tableColumns:r,open:l=!0}=e,[n,i]=t().useState(!1),o=()=>{i(!0)};t().useImperativeHandle(a,(()=>({clickHandle:o})));const s={[`${se("table")}-import`]:!0},c={visible:n,title:d("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return t().createElement(t().Fragment,null,l&&t().createElement("span",{className:oe()(s),title:d("qm.table.import.textNoSpace"),onClick:()=>o()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.ImportOutlined,null))),t().createElement(At,c,t().createElement(Di,{columns:r,onClose:()=>i(!1)})))}));$i.displayName="TableImport";const Mi=$i,Ki=e=>{const{columns:a,onChange:r}=e,{$size:l}=t().useContext(Wn),n=t().useRef([]),[i,o]=t().useState(!1),[s,c]=t().useState(a);Se((()=>{p()}),[s]),t().useEffect((()=>{u()}),[a]);const u=()=>{const e=[];a.forEach(((t,r)=>{const l=t.colSpan;l>1&&a.slice(r+1,r+l).every((e=>{let{colSpan:t}=e;return 0===t}))&&e.push(a.slice(r,r+l))})),n.current=e},p=()=>{const e=[];s.forEach((t=>{const{colSpan:a,dataIndex:r}=t;if(0===a)return;if(1===a)return e.push(t);const l=n.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(r)));if(-1===l)return e.push(t);e.push(...n[l].map(((e,a)=>{let{dataIndex:r}=e;const l=s.find((e=>e.dataIndex===r));return a>0&&void 0!==t.hidden&&(l.hidden=t.hidden),l})))})),null==r||r(e)},h=se("table"),m={[`${h}__popper`]:!0,"column-filter__popper":!0,[`${h}--lg`]:"large"===l,[`${h}--sm`]:"small"===l},f=[`${h}-column-filter`,{selected:i}];return t().createElement(Ua(),{action:["click"],popupVisible:i,popup:t().createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},t().createElement("div",{className:"main"},t().createElement(da.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:s,setList:e=>{const t=e.map((e=>e.dataIndex)),a=s.map((e=>e.dataIndex));(0,ca.isEqual)(t,a)||c(e)}},s.map((e=>((e,a)=>{const{colSpan:r}=e;if(0===r)return t().createElement("li",{key:e.dataIndex,style:{display:"none"}});const l=["svgicon","handle","main-handle"];return t().createElement("li",{key:e.dataIndex,className:"item"},t().createElement(N.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:a}=t.target;e.hidden=!a,c([...s])}}),t().createElement("i",{className:oe()(l),title:d("qm.table.columnFilter.draggable")},t().createElement(ce.HolderOutlined,null)),t().createElement("span",{className:"text",title:e.title},e.title))})(e)))))),popupClassName:oe()(m),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{o(e)},builtinPlacements:ai,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement("span",{className:oe()(f),title:d("qm.table.columnFilter.text")},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.SettingOutlined,null)),t().createElement("span",null,d("qm.table.columnFilter.text"))))},Vi=e=>{const{defaultValue:a,onClose:r,onOk:l}=e,{tableProps:n,pagination:o,showSummary:s}=t().useContext(Wn),{rowSelection:c}=n,u=t().useRef(null),[p,h]=t().useState(!1),m=t().useMemo((()=>Object.assign({},{fileName:`${i()().format(ti)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},a,{columns:(0,Y.I8)(a.columns||[])})),[]),[f,g]=t().useState([{type:"INPUT",label:d("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:d("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:d("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:d("qm.table.export.all"),value:"all"},{text:d("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==c?void 0:c.type)},{text:d("qm.table.export.custom"),value:"custom"}]},onChange:e=>{f.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,g([...f])}},options:{min:1},disabled:!0},{type:"INPUT",label:d("qm.table.columnFilter.text"),fieldName:"columns",render:(e,a)=>t().createElement(Ki,{columns:a.state.formData.columns,onChange:e=>{a.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:d("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:d("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]),b=se("table");return t().createElement("div",{className:`${b}-export__setting`},t().createElement(Zl,{ref:u,initialValues:m,items:f,cols:1,labelWidth:100}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>r(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(J,{type:"primary",loading:p,onClick:()=>(async()=>{const[e,t]=await u.current.GET_FORM_DATA();if(!e){h(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);l(t),await(0,Y._v)(1e3),h(!1),r()}})()},d("qm.table.export.text"))))},Ui=t().forwardRef(((e,a)=>{const{tableColumns:r,open:n=!0}=e,{global:o}=t().useContext(l),{tableRef:s,tableBodyRef:c,tableProps:u,flattenColumns:p,pagination:h,fetchParams:m,isFetch:f,isGroupSubtotal:g,showSummary:b,getSpan:y}=t().useContext(Wn),{exportExcel:v,fetch:x,showHeader:E}=u,[C,S]=t().useState(!1),[w,T]=t().useState(!1),I=t().useMemo((()=>{var e;return!(null==v||null===(e=v.fetch)||void 0===e||!e.api)}),[v]),_=t().useMemo((()=>!h.total||w),[h.total,w]),R=t().useMemo((()=>(0,ii.MY)(r,[ci.expandableColumn,ci.selectionColumn,ci.operationColumn])),[r]),P=t().useMemo((()=>(0,ii.MY)(p,[ci.expandableColumn,ci.selectionColumn,ci.operationColumn])),[p]),O=(e,t)=>{const a={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:r}=e,l=(g?(0,ii.SX)(t):t).reduce(((e,t)=>{if(null!=t&&t[ci.summaryIgnore])return e;const a=Number((0,ii.C_)(t,r));return Number.isNaN(a)?e:e+a}),0);(0,ii.dN)(a,r,l)})),[a]},A=(e,t,a,r)=>{const{precision:l,formatType:n}=a;let i=c.current.renderCellTitle(a,e,t,r);return l>=0&&!n&&""!==i&&(i=Number(i)),i},{exportXLSX:k,exportCSV:H}=Li(),F=async e=>{const{api:t,dataKey:a}=x;let r=[];try{T(!0);const l=await t({...m,[ci.currentPageName]:1,[ci.pageSizeName]:e??h.total});200===l.code&&(r=(Array.isArray(l.data)?l.data:(0,ca.get)(l.data,a)??[]).map(((e,t)=>{const a={...e,index:t,pageIndex:t};return P.forEach(((e,t)=>{const{dataIndex:r}=e;"index"!==r&&"pageIndex"!==r&&(0,ii.dN)(a,r,(0,ii.C_)(a,r))})),a})))}catch(e){}return T(!1),r},L=e=>{var t;const a=null==o||null===(t=o.table)||void 0===t?void 0:t.recordExportLog;try{null==a||a({fileName:e})}catch(e){}},q=(null==v?void 0:v.fileName)??`${i()().format(ti)}.xlsx`,D=q.slice(q.lastIndexOf(".")+1).toLowerCase(),$=()=>{if(_)return N.message.warning(d("qm.table.export.warnText"));I?(async e=>{T(!0);try{const{api:t,params:a}=v.fetch,r=await t({columns:P.map((e=>{const{title:t,dataIndex:a,hidden:r}=e,{type:l}=e.filter||{};return{title:t,dataIndex:a,type:l,hidden:r}})),...m,...a,tsortby:void 0,tsummary:void 0,tgroupby:void 0,[ci.currentPageName]:void 0,[ci.pageSizeName]:void 0});r.data&&(tt(r.data,e),L(e))}catch(e){}T(!1)})(q):S(!0)};t().useImperativeHandle(a,(()=>({clickHandle:$})));const M={[`${se("table")}-export`]:!0},K={visible:C,title:d("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>S(!1)},V={fileName:q.slice(0,q.lastIndexOf(".")),fileType:D,columns:R,useStyle:null!=v&&v.cellStyle?1:0};return t().createElement(t().Fragment,null,n&&t().createElement("span",{className:oe()(M),title:d("qm.table.export.textNoSpace"),onClick:()=>$()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.DownloadOutlined,null))),t().createElement(At,K,t().createElement(Vi,{defaultValue:V,onClose:()=>S(!1),onOk:e=>{(async e=>{const{fileName:t,fileType:a,exportType:r,startIndex:l=1,endIndex:n}=e,{allTableData:i,selectionRows:o}=s.current;let c=[];if(f?("all"===r&&(c=await F()),"custom"===r&&(c=await F(n),c=c.slice(l-1))):("all"===r&&(c=i.slice(0)),"custom"===r&&(c=i.slice(l-1,n||void 0))),"selected"===r&&(c=o.slice(0)),"xlsx"===a){const a=await k(e,c,O,A);tt(a,`${t}.xlsx`),L(`${t}.xlsx`)}if("csv"===a){const a=H(e,((e,t)=>{const{columns:a,footSummation:r}=e,l=(0,ii.vo)(a),n=(0,ii.HG)(a);let i='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${n.map((e=>{let{width:t,minWidth:a,renderWidth:r}=e;return`<col style="width:${t||r||a||ci.defaultColumnWidth}px">`})).join("")}</colgroup>`,E&&(i+=["<thead>",l.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:a}=e;return 0===a?null:`<th colspan="${a}" rowspan="${t}">${e.title}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(i+=`<tbody>${t.map((e=>`<tr>${n.map(((a,r)=>{const{rowSpan:l,colSpan:n}=y(e,a,e.index,r,t);return l&&n?`<td rowspan="${l}" colspan="${n}">${A(e,e.index,a,r)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),b&&r&&(i+=["<tfoot>",O(n,t).map((e=>`<tr>${n.map(((a,r)=>{const{dataIndex:l,summation:n}=a,i=null!=n&&n.render?n.render(t):(0,ii.C_)(e,l);return`<td>${0===r&&""===i?d("qm.table.config.summaryText"):(0,Y.l$)(i)?(0,ii.gn)(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i})(e,c));tt(a,`${t}.csv`),L(`${t}.csv`)}})(Object.assign({},e,{columns:(0,ii.J1)(e.columns)}))}})))}));Ui.displayName="TableExport";const ji=Ui,zi=e=>{const{columns:a,onClose:r}=e,{tableRef:l,tableBodyRef:n,tableProps:i,dataChange:o}=t().useContext(Wn),{beforeClipboard:s}=i,c=t().useRef(null),[u,p]=t().useState([{type:"INPUT_NUMBER",label:d("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:d("qm.table.clipboard.colIndex"),fieldName:"dataIndex",options:{itemList:a.map(((e,t)=>({value:t,text:e.title})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:d("qm.table.clipboard.content"),fieldName:"content",placeholder:d("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[h,m]=t().useState(!1),f=se("table");return t().createElement("div",{className:`${f}-clipboard__setting`},t().createElement("h3",{className:"info"},d("qm.table.clipboard.supportText")),t().createElement(Zl,{ref:c,initialValues:{},initialExtras:{rowIndex:"行",dataIndex:"列"},items:u,cols:1,labelWidth:100}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>r(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(J,{type:"primary",loading:h,onClick:()=>(async()=>{var e;const[t,i]=await c.current.GET_FORM_DATA();if(t)return;const{tableFullData:u,store:p}=l.current;m(!0);const h=i.content.trim().replace(/(\r|\n)$/,"");let f=h.replace(/"[^"]+"/g,"^");((null===(e=h.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{f=f.replace(/\^/,e)}));let g=f.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof s)try{g=await s(g,g[0].map(((e,t)=>a[i.dataIndex+t].dataIndex)))}catch(t){}g.forEach(((e,t)=>{e.forEach(((e,r)=>{const n=u[i.rowIndex-1+t],o=a[i.dataIndex+r];if(n&&o){let t=!1;if(o.editRender){var s,c;const e=o.editRender(n,o);t=!(e.disabled||(null===(s=e.extra)||void 0===s?void 0:s.disabled)||null!==(c=l.current.fieldAuth[o.dataIndex])&&void 0!==c&&c.disabled)}t&&o.dictItems&&(t=o.dictItems.some((t=>t.value==e))),t&&((0,ii.dN)(n,o.dataIndex,e),p.addToUpdated(n))}}))})),n.current.forceUpdate(),o(),N.message.success(d("qm.table.clipboard.success",{total:g.length})),m(!1),r()})()},d("qm.table.clipboard.text"))))},Bi=t().forwardRef(((e,a)=>{const{flattenColumns:r,open:l=!0}=e,[n,i]=t().useState(!1),o=t().useMemo((()=>(e=>e.filter((e=>![ci.expandableColumn,ci.selectionColumn,"index","pageIndex",ci.operationColumn].includes(e.dataIndex))))(r)),[r]),s=()=>{i(!0)};t().useImperativeHandle(a,(()=>({clickHandle:s})));const c={[`${se("table")}-clipboard`]:!0},u={visible:n,title:d("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return t().createElement(t().Fragment,null,l&&t().createElement("span",{className:oe()(c),title:d("qm.table.clipboard.textNoSpace"),onClick:()=>s()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.CopyOutlined,null))),t().createElement(At,u,t().createElement(zi,{columns:o,onClose:()=>i(!1)})))}));Bi.displayName="TableClipboard";const Wi=Bi,Gi=e=>{const{columns:a,onClose:r}=e,{tableProps:l,tableRef:n,$size:i,selectionKeys:o,setSelectionKeys:s}=t().useContext(Wn),{rowKey:c}=l,u=e=>e.map((e=>{const t={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:e.dictItems??[],render:e.render};return Array.isArray(e.children)&&(t.children=u(e.children)),t})),[p,h]=t().useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...u(a.filter((e=>![ci.expandableColumn,ci.selectionColumn,"index","pageIndex",ci.operationColumn].includes(e.dataIndex))))]),[m]=t().useState(n.current.selectionRows.map((e=>({...e,children:void 0}))));return t().createElement(t().Fragment,null,t().createElement(jo,{size:i,columns:p,dataSource:m,rowKey:c,minHeight:338,rowSelection:{type:"checkbox",selectedRowKeys:o,onChange:e=>s(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>h(e)}),t().createElement("div",{style:{height:10}}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>r()},d("qm.table.selectCollection.closeButton"))))},Yi=t().forwardRef(((e,a)=>{const{columns:r,open:l=!0}=e,{tableProps:n,getRowKey:i,isFetch:o,isTableEmpty:s,setSelectionKeys:c,setSelectionRows:u}=t().useContext(Wn),{rowSelection:p}=n,[h,m]=t().useState(!1),f=t().useRef(!1);Se((()=>{!f.current&&g()}),[s]);const g=async()=>{const{fetchSelectedRows:e,disabled:t=(e=>!1)}=p;if(o&&e)try{const a=await e.api(e.params);if(200===a.code){let r=Array.isArray(a.data)?a.data:(0,ca.get)(a.data,e.dataKey)??[];r=r.filter((e=>!t(e))),u(r),c(r.map(((e,t)=>i(e,t)))),f.current=!0}}catch(e){}},b=()=>{m(!0)};t().useImperativeHandle(a,(()=>({clickHandle:b})));const y=se("table"),v={visible:h,title:d("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>m(!1)};return t().createElement(t().Fragment,null,l&&t().createElement("span",{className:`${y}-select-collection`,title:d("qm.table.selectCollection.text"),onClick:()=>b()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.CheckSquareOutlined,null))),t().createElement(At,v,t().createElement(Gi,{columns:r,onClose:()=>m(!1)})))}));Yi.displayName="SelectCollection";const Zi=Yi,Xi=require("localforage");var Qi=__webpack_require__.n(Xi);const Ji=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/.test(e),eo=e=>{const{onClose:a}=e,{global:r}=t().useContext(l),{tableProps:n,tableRef:i,getRowKey:o,$size:s,flattenColumns:c,pagination:u,setPagination:p,scrollYToRecord:h,setHighlightKey:f,setShouldToTop:g,isTreeTable:b,isWebPagination:y}=t().useContext(Wn),{uniqueKey:v}=n,x=t().useRef(null),E=t().useRef(null),C=t().useRef([]),S=t().useRef(""),w=t().useRef(-1),T=t().useRef("stop");Se((()=>{const{current:e,pageSize:t}=u,a=i.current.tableFullData.slice((e-1)*t,e*t),r=(0,ii.tL)(a).findIndex((e=>o(e,e.index)===S.current));h("",r)}),[u.current]);const I=e=>{let t;switch(e){case"text":case"textarea":default:t="INPUT";break;case"number":t="INPUT_NUMBER";break;case"date":t="DATE";break;case"checkbox":case"radio":t="SELECT"}return t},_=e=>e.filter((e=>null==e?void 0:e.dataIndex)).map((e=>({type:I(e.filter.type),fieldName:e.dataIndex,label:e.title,tooltip:e.description,options:{dateType:"exactdate",itemList:e.dictItems??[]},onChange:async()=>{const[e,t]=await x.current.GET_FORM_DATA(),[a,r]=await E.current.GET_FORM_DATA(),l=(0,ca.omitBy)(Object.assign({},t,r),Y.xb);A(l)}}))),R={case:0,fullchar:0},P=t().useMemo((()=>c.filter((e=>![ci.expandableColumn,ci.selectionColumn,"index","pageIndex",ci.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[c]),[O,A]=t().useState({}),[k,H]=t().useState(R),[F]=t().useState(_([P[0]])),[L]=t().useState(_(P.slice(1))),[q,D]=t().useState(0),$=t().useMemo((()=>!Object.keys(O).length),[O]);Se((()=>{T.current="ready"}),[O,k]);const M=e=>{H(Object.assign({},k,e))},K=(e,t,a)=>new Promise(((r,l)=>{N.Modal.confirm({title:d("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),r()},onCancel:()=>{a(),r()}})})),V=async e=>{if(!Object.keys(O).length)return N.Modal.warning({title:d("qm.button.confirmPrompt"),content:d("qm.table.fastSearch.queryCondition")});if("ready"===T.current&&(T.current="stop",C.current=(e=>{const{allTableData:t}=i.current,a=[];for(let r=0,l=t.length;r<l;r++){const l=t[r];let n=!0;for(const t in e){const{type:a}=P.find((e=>e.dataIndex===t)).filter;let r=(0,ii.C_)(l,t),i=!0;if("text"===a||"textarea"===a?i=new RegExp(k.fullchar?`^${e[t]}$`:e[t],k.case?"":"i").test(r):(r=Ji(r)?r.slice(0,10):r,i=r==e[t]),!i){n=!1;break}}n&&a.push(l)}return a})(O),D(C.current.length)),!C.current.length)return f(""),N.Modal.warning({title:d("qm.button.confirmPrompt"),content:d("qm.table.fastSearch.notMatch")});"next"===e&&(w.current=w.current<0?0:w.current+1,w.current>C.current.length-1&&await K(d("qm.table.fastSearch.toTheEnd"),(()=>w.current=0),(()=>w.current=C.current.length-1))),"prev"===e&&(w.current=w.current<0?C.current.length-1:w.current-1,w.current<0&&await K(d("qm.table.fastSearch.toStart"),(()=>w.current=C.current.length-1),(()=>w.current=0)));const t=C.current[w.current],a=o(t,t.index);let r=t.index;if(b&&y){const e=(0,ii.Qi)(i.current.deriveRowKeys,a)[0];r=i.current.tableFullData.findIndex((t=>o(t,t.index)===e))}((e,t)=>{if(S.current=e,y){const{pageSize:e}=u,a=Math.ceil((t+1)/e);g(!1),p(Object.assign({},u,{current:a}))}else h(e)})(a,r),f(a)},U=()=>{x.current.RESET_FORM(),E.current.RESET_FORM()},j=t().useMemo((()=>v?`fastSearch_${v}`:""),[v]),[z,B]=t().useState([]),[W,Z]=t().useState(""),[X,Q]=t().useState("");Se((()=>{if(X){const{filters:e,config:t}=z.find((e=>e.value===X)).list;x.current.SET_FIELDS_VALUE(G()(e,L.map((e=>e.fieldName)))),E.current.SET_FIELDS_VALUE(G()(e,F.map((e=>e.fieldName)))),A(e),H(t)}else U(),A({}),H(R)}),[X]),t().useEffect((()=>{ee()}),[]);const ee=async()=>{if(!j)return;let e=await Qi().getItem(j);e||(e=await te(j),Array.isArray(e)&&await Qi().setItem(j,e)),Array.isArray(e)&&e.length&&(B(e),Q(e[0].value))},te=async e=>{const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}},ae=async(e,t)=>{const a=null==r?void 0:r.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}},re=se("table");return t().createElement("div",{className:`${re}-fast-search__setting`},t().createElement("div",{className:"main"},t().createElement("div",{className:"top"},t().createElement("div",{className:"container"},t().createElement(Ct,{defaultActiveKey:"1",size:"small",tabBarExtraContent:t().createElement("span",null,d("qm.table.alert.total",{total:q}))},t().createElement(Ct.TabPane,{tab:d("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},t().createElement(Zl,{ref:x,items:F,cols:1,labelWidth:110})),t().createElement(Ct.TabPane,{tab:d("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},t().createElement(Zl,{ref:E,items:L,cols:1,labelWidth:110})))),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(N.Input,{size:s,value:W,placeholder:d("qm.table.highSearch.configText"),disabled:$,onChange:e=>{const{value:t}=e.target;Z(t)}}),t().createElement(J,{type:"primary",disabled:!W||$,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!j)return m("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,ii.wE)(),t=[...z,{text:W,value:e,list:{filters:O,config:k}}];B(t),Q(e),Z(""),await Qi().setItem(j,t),await ae(j,t)})()},d("qm.table.highSearch.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${ci.rowHeightMaps[s]}px`}},t().createElement("span",null,d("qm.table.fastSearch.savedSetting"))),t().createElement("ul",null,z.map((e=>t().createElement("li",{key:e.value,className:oe()({selected:e.value===X}),title:e.text,onClick:()=>(e=>{Q(e!==X?e:"")})(e.value)},t().createElement("span",{className:"title"},e.text),t().createElement("i",{className:"svgicon close",title:d("qm.table.highSearch.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=z.filter((t=>t.value!==e));B(t),e===X&&Q(""),await Qi().setItem(j,t),await ae(j,t)})(e.value)}},t().createElement(ce.CloseCircleOutlined,null))))),!z.length&&t().createElement("div",{style:{padding:Yn}},t().createElement(Ze,null)))))),t().createElement("div",{className:"bottom"},t().createElement("div",null,t().createElement(N.Checkbox,{checked:!!k.case,onChange:e=>M({case:e.target.checked})},d("qm.table.fastSearch.matchCase")),t().createElement(N.Checkbox,{checked:!!k.fullchar,onChange:e=>M({fullchar:e.target.checked})},d("qm.table.fastSearch.matchFullchar"))),t().createElement("div",null,t().createElement(J,{onClick:()=>U()},d("qm.table.fastSearch.clear"))))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${Oa[s]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(J,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.fastSearch.closeButton")),t().createElement(J,{type:"primary",style:{marginRight:8},onClick:()=>V("prev")},d("qm.table.fastSearch.queryPrev")),t().createElement(J,{type:"primary",onClick:()=>V("next")},d("qm.table.fastSearch.queryNext"))))},to=t().forwardRef(((e,a)=>{const{open:r=!0}=e,{$size:l}=t().useContext(Wn),[n,i]=t().useState(!1),o=()=>{i(!0)};t().useImperativeHandle(a,(()=>({clickHandle:o})));const s=se("table"),c={visible:n,title:d("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${Oa[l]+20}px`},onClose:()=>i(!1)};return t().createElement(t().Fragment,null,r&&t().createElement("span",{className:`${s}-super-search`,title:d("qm.table.fastSearch.text"),onClick:()=>o()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.MonitorOutlined,null))),t().createElement(At,c,t().createElement(eo,{onClose:()=>i(!1)})))}));to.displayName="FastSearch";const ao=to,ro=e=>{const{columns:a,group:r,summary:l}=e,{tableRef:n,tableProps:o,$size:s,pagination:c,fetchParams:u,isFetch:p}=t().useContext(Wn),{fetch:h}=o,m=e=>{const t=a.find((t=>t.dataIndex===e));return{title:t.title,precision:t.precision,dictItems:t.dictItems??[]}},f=r.map((e=>({dataIndex:e.group,...m(e.group)}))),g=l.map((e=>e.summary===ci.groupSummary.total.value?{dataIndex:e.summary,title:ci.groupSummary.total.text,formula:e.formula}:{dataIndex:e.summary,...m(e.summary),formula:e.formula})),b=t().useMemo((()=>Object.assign({},u,{[ci.sorterFieldName]:void 0,[ci.groupSummary.summaryFieldName]:l.map((e=>`${e.formula}|${e.summary}`)).join(","),[ci.groupSummary.groupbyFieldName]:r.map((e=>e.group)).join(","),usedJH:2,[ci.currentPageName]:1})),[u,r,l]),[y,v]=t().useState(((e,t)=>[{title:d("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...t.map((e=>{var t;const r=null===(t=a.find((t=>t.dataIndex===e.dataIndex)))||void 0===t?void 0:t.groupSummary;let l=r?{summation:r}:null;return e.dataIndex===ci.groupSummary.total.value&&(l={dataIndex:ci.groupSummary.recordTotalIndex,summation:{render:()=>c.total}}),{...e,..."count"===e.formula||"sum"===e.formula?l:null}}))])(f,g)),[x]=t().useState(p?[]:(e=>{const t=(0,ii.v9)(e,r.map((e=>e.group))),a=[];return t.forEach((e=>{const t={};y.forEach((a=>{const{dataIndex:r}=a;"index"!==r&&(0,ii.dN)(t,r,(0,ii.C_)(e[0],r))})),l.forEach((a=>{const r=a.summary!==ci.groupSummary.total.value?a.summary:ci.groupSummary.recordTotalIndex,l=a.formula;"count"===l&&(0,ii.dN)(t,r,e.length),"sum"===l&&(0,ii.dN)(t,r,(0,ca.sumBy)(e,r)),"max"===l&&(0,ii.dN)(t,r,(0,ca.maxBy)(e,r)[r]),"min"===l&&(0,ii.dN)(t,r,(0,ca.minBy)(e,r)[r]),"avg"===l&&(0,ii.dN)(t,r,((0,ca.sumBy)(e,r)/e.length).toFixed(2))})),a.push(t)})),a})(n.current.tableFullData)),E={size:s,height:400,...p?{fetch:{api:h.api,params:b,dataKey:null==h?void 0:h.dataKey}}:{dataSource:x},columns:y,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${i()().format("YYYYMMDDHHmmss")}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>v(e)};return t().createElement(jo,E)},lo=e=>{const{onClose:a}=e,{global:r}=t().useContext(l),{tableProps:n,$size:i,flattenColumns:o}=t().useContext(Wn),{uniqueKey:s}=n,c=t().useRef(null),u=t().useRef(null),[p,h]=t().useState(!1),[f,g]=t().useState([]),[b,y]=t().useState(""),[v,x]=t().useState("");Se((()=>{if(v){const{group:e,summary:t}=f.find((e=>e.value===v)).list;_(e),A(t)}else{const e=L();_((null==e?void 0:e.group)||[]),A((null==e?void 0:e.summary)||[])}}),[v]),t().useEffect((()=>{q()}),[]);const E=t().useMemo((()=>s?`summary_${s}`:""),[s]),C=t().useMemo((()=>o.filter((e=>![ci.expandableColumn,ci.selectionColumn,"index","pageIndex",ci.operationColumn].includes(e.dataIndex)))),[o]),S=C.filter((e=>!e.groupSummary)).map((e=>({text:e.title,value:e.dataIndex}))),w=[ci.groupSummary.total,...C.filter((e=>!!e.groupSummary)).map((e=>({text:e.title,value:e.dataIndex})))],T=[{text:d("qm.table.groupSummary.sumText"),value:"sum"},{text:d("qm.table.groupSummary.maxText"),value:"max"},{text:d("qm.table.groupSummary.minText"),value:"min"},{text:d("qm.table.groupSummary.avgText"),value:"avg"},{text:d("qm.table.groupSummary.countText"),value:"count"}],[I,_]=t().useState([]),[R,P]=t().useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,a)=>t().createElement("div",null,t().createElement(J,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(a)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:d("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:S.map((e=>({...e,disabled:I.findIndex((t=>t.group===e.value))>-1})))})}]),[O,A]=t().useState([]),[k,H]=t().useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,a)=>t().createElement("div",null,t().createElement(J,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(a)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:d("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:w.map((e=>({...e,disabled:O.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:d("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===ci.groupSummary.total.value?T.slice(T.length-1):T})}]),F=t().useMemo((()=>{const e=I.length&&I.every((e=>Object.values(e).every((e=>""!==e)))),t=O.length&&O.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[I,O]),L=()=>{if(!E)return;const e=sessionStorage.getItem(E);return e?JSON.parse(e):null},q=async()=>{if(!E)return;const e=L();if(e){const{group:t,summary:a}=e;_(t),A(a)}let t=await Qi().getItem(E);t||(t=await D(E),Array.isArray(t)&&await Qi().setItem(E,t)),Array.isArray(t)&&t.length&&(g(t),!e&&x(t[0].value))},D=async e=>{const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}},$=async(e,t)=>{const a=null==r?void 0:r.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}},M=se("table"),K={visible:p,title:d("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>h(!1)};return t().createElement("div",{className:`${M}-group-summary__setting`},t().createElement("div",{className:"main"},t().createElement("div",{style:{width:"30%"}},t().createElement(jo,{ref:c,size:i,columns:R,dataSource:I,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onDataChange:e=>{_(e)}},t().createElement(J,{type:"primary",icon:t().createElement(ce.PlusOutlined,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t().createElement("div",{className:"container line"},t().createElement(jo,{ref:u,size:i,columns:k,dataSource:O,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>H(e),onDataChange:e=>{A(e)}},t().createElement(J,{type:"primary",icon:t().createElement(ce.PlusOutlined,null),onClick:()=>{u.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(N.Input,{size:i,value:b,placeholder:d("qm.table.groupSummary.configText"),disabled:F,onChange:e=>{const{value:t}=e.target;y(t)}}),t().createElement(J,{type:"primary",disabled:!b||F,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!E)return m("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,ii.wE)(),t=[...f,{text:b,value:e,list:{group:I.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))}}];g(t),x(e),y(""),await Qi().setItem(E,t),await $(E,t)})()},d("qm.table.groupSummary.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${ci.rowHeightMaps[i]}px`}},t().createElement("span",null,d("qm.table.groupSummary.savedSetting"))),t().createElement("ul",null,f.map((e=>t().createElement("li",{key:e.value,className:oe()({selected:e.value===v}),title:e.text,onClick:()=>(e=>{x(e!==v?e:"")})(e.value)},t().createElement("span",{className:"title"},e.text),t().createElement("i",{className:"svgicon close",title:d("qm.table.groupSummary.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=f.filter((t=>t.value!==e));g(t),e===v&&x(""),await Qi().setItem(E,t),await $(E,t)})(e.value)}},t().createElement(ce.CloseCircleOutlined,null))))),!f.length&&t().createElement("div",{style:{padding:Yn}},t().createElement(Ze,null)))))),t().createElement(At,K,t().createElement(ro,{columns:C,group:I,summary:O})),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.groupSummary.closeButton")),t().createElement(J,{type:"primary",disabled:F,onClick:()=>(E&&sessionStorage.setItem(E,JSON.stringify({group:I.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))})),void h(!0))},d("qm.table.groupSummary.confirmButton"))))},no=t().forwardRef(((e,a)=>{const{open:r=!0}=e,[l,n]=t().useState(!1),i=()=>{n(!0)};t().useImperativeHandle(a,(()=>({clickHandle:i})));const o=se("table"),s={visible:l,title:d("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>n(!1)};return t().createElement(t().Fragment,null,r&&t().createElement("span",{className:`${o}-group-summary`,title:d("qm.table.groupSummary.text"),onClick:()=>i()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.PieChartOutlined,null))),t().createElement(At,s,t().createElement(lo,{onClose:()=>n(!1)})))}));no.displayName="GroupSummary";const io=no;var oo=__webpack_require__(762);const so=e=>{const{onClose:a}=e,{global:r}=t().useContext(l),{tableProps:n,$size:i,flattenColumns:o,setSuperFilters:s,clearTableFilter:c}=t().useContext(Wn),{uniqueKey:u}=n,p=t().useRef(null),[h,f]=t().useState([]),[g,b]=t().useState([]),[y,v]=t().useState(""),[x,E]=t().useState("");Se((()=>{f(x?g.find((e=>e.value===x)).list:L()||[])}),[x]),t().useEffect((()=>{q()}),[]);const C=t().useMemo((()=>u?`superSearch_${u}`:""),[u]),S=t().useMemo((()=>o.filter((e=>!!e.filter))),[o]),w=(0,ii.TQ)(h),T=t().useMemo((()=>!(w&&(0,oo.$P)(w))),[w]),I=t().useMemo((()=>!!h.length&&T),[h,T]),_=[{value:"and",text:d("qm.table.highSearch.andText")},{value:"or",text:d("qm.table.highSearch.orText")}],R=o.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:e.title}))),P=e=>["in","nin"].includes(e),O=(e,t)=>{let a;switch(e){case"number":a="number";break;case"date":a="date";break;case"checkbox":case"radio":a=t?"select-multiple":"select";break;default:a="text"}return a},A=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:d("qm.table.highSearch.gtText")},{value:"<",text:d("qm.table.highSearch.ltText")},{value:">=",text:d("qm.table.highSearch.gteText")},{value:"<=",text:d("qm.table.highSearch.lteText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":t=[{value:"in",text:d("qm.table.highSearch.inText")},{value:"nin",text:d("qm.table.highSearch.ninText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:d("qm.table.highSearch.likeText")},{value:"==",text:d("qm.table.highSearch.eqText")},{value:"!=",text:d("qm.table.highSearch.neqText")}]}return t},[k,H]=t().useState([{title:d("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,a)=>t().createElement("div",null,t().createElement(J,{type:"text",onClick:()=>{p.current.REMOVE_RECORDS(a)}},d("qm.table.highSearch.removeText")))},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,a)=>t().createElement("span",{style:{fontSize:"20px"}},e)},{title:d("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,editRender:e=>({type:"select",editable:!0,items:R,rules:[{required:!0,message:d("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var a,r;const l=Object.values(t)[0],n=null===(a=S.find((e=>e.dataIndex===l)))||void 0===a?void 0:a.filter.type,i=A(n);e.fieldType=n,e.expression=l?null===(r=i[0])||void 0===r?void 0:r.value:"",e.condition=P(e.expression)?[]:"",l||(e.bracketLeft=e.bracketRight="")}})},{title:d("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:d("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const a=null===(t=S.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:A(a),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=P(e.expression)?[]:""}}}},{title:d("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t;const a=S.find((t=>t.dataIndex===e.fieldName)),r=null==a?void 0:a.filter.type,l=(null==a||null===(t=a.filter)||void 0===t?void 0:t.items)??(null==a?void 0:a.dictItems)??[];return{type:O(r,P(e.expression)),editable:!0,items:l,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,a)=>t().createElement("span",{style:{fontSize:"20px"}},e)},{title:d("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,editRender:e=>({type:"select",editable:!0,items:_,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),F=()=>{C&&sessionStorage.setItem(C,JSON.stringify(h.filter((e=>!!e.fieldName))))},L=()=>{if(!C)return;const e=sessionStorage.getItem(C);return e?JSON.parse(e):null},q=async()=>{if(!C)return;const e=L();e&&f(e);let t=await Qi().getItem(C);t||(t=await D(C),Array.isArray(t)&&await Qi().setItem(C,t)),Array.isArray(t)&&t.length&&(b(t),!e&&E(t[0].value))},D=async e=>{const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}},$=async(e,t)=>{const a=null==r?void 0:r.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}},M=se("table");return t().createElement("div",{className:`${M}-super-search__setting`},t().createElement("div",{className:"main"},t().createElement("div",{className:"container"},t().createElement(jo,{ref:p,size:i,columns:k,dataSource:h,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>H(e),onRowClick:(e,t)=>{const{dataIndex:a}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(a)&&("bracketLeft"===a&&(e[a]=e[a]?"":"("),"bracketRight"===a&&(e[a]=e[a]?"":")"),f([...h]))},onDataChange:e=>{f(e)}},t().createElement(J,{type:"primary",icon:t().createElement(ce.PlusOutlined,null),onClick:()=>{p.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),ci.highSearch.showSQL&&w&&t().createElement("code",{className:"lang-js"},w)),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(N.Input,{size:i,value:y,placeholder:d("qm.table.highSearch.configText"),disabled:T,onChange:e=>{const{value:t}=e.target;v(t)}}),t().createElement(J,{type:"primary",disabled:!y||T,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!C)return m("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,ii.wE)(),t=[...g,{text:y,value:e,list:h.filter((e=>!!e.fieldName))}];b(t),E(e),v(""),await Qi().setItem(C,t),await $(C,t)})()},d("qm.table.highSearch.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${ci.rowHeightMaps[i]}px`}},t().createElement("span",null,d("qm.table.highSearch.savedSetting"))),t().createElement("ul",null,g.map((e=>t().createElement("li",{key:e.value,className:oe()({selected:e.value===x}),title:e.text,onClick:()=>(e=>{E(e!==x?e:"")})(e.value)},t().createElement("span",{className:"title"},e.text),t().createElement("i",{className:"svgicon close",title:d("qm.table.highSearch.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=g.filter((t=>t.value!==e));b(t),e===x&&E(""),await Qi().setItem(C,t),await $(C,t)})(e.value)}},t().createElement(ce.CloseCircleOutlined,null))))),!g.length&&t().createElement("div",{style:{padding:Yn}},t().createElement(Ze,null)))))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.highSearch.closeButton")),t().createElement(J,{type:"primary",disabled:I,onClick:()=>(c(),s(h.map((e=>G()(e,["index","pageIndex"])))),F(),void a())},d("qm.table.highSearch.searchButton"))))},co=t().forwardRef(((e,a)=>{const{open:r=!0}=e,[l,n]=t().useState(!1),i=()=>{n(!0)};t().useImperativeHandle(a,(()=>({clickHandle:i})));const o=se("table"),s={visible:l,title:d("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>n(!1)};return t().createElement(t().Fragment,null,r&&t().createElement("span",{className:`${o}-super-search`,title:d("qm.table.highSearch.text"),onClick:()=>i()},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.FunnelPlotOutlined,null))),t().createElement(At,s,t().createElement(so,{onClose:()=>n(!1)})))}));co.displayName="SuperSearch";const uo=co,po=t().forwardRef(((e,a)=>{const{tableColumns:r,showFullScreen:n,showReload:i,showPrint:o,showImport:s,showExport:c,showClipboard:u,showCollection:p,showFastSearch:h,showSuperSearch:f,showGroupSummary:g,showToolBox:b}=e,{global:y}=t().useContext(l),{tableProps:v,flattenColumns:x,isFullScreen:E,$size:C}=t().useContext(Wn),{uniqueKey:S,exportExcel:w}=v,T=t().useRef(null),I=t().useRef(null),_=t().useRef(null),R=t().useRef(null),P=t().useRef(null),O=t().useRef(null),A=t().useRef(null),k=t().useRef(null),H=t().useRef(null),F=t().useRef(null),L=t().useMemo((()=>S?`toolBox_${S}`:""),[S]),[q,D]=t().useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,groupSummary:!1}),$={fullScreen:n,reload:i,print:o,import:s,export:c&&!(null!=w&&w.hideIcon),clipboard:u,collection:p,fastSearch:h,superSearch:f,groupSummary:g},[M,K]=t().useState(!1);Se((()=>{U()}),[q]),t().useEffect((()=>{V()}),[]),t().useImperativeHandle(a,(()=>({exportHandle:()=>{if(!P.current)return m("Table","执行导出需要配置 `exportExcel` 参数");P.current.clickHandle()}})));const V=()=>{if(!L||!b)return;const e=JSON.parse(localStorage.getItem(L));e||j(L).then((e=>{e&&(D(Object.assign({},q,e)),localStorage.setItem(L,JSON.stringify(e)))})).catch((()=>{})),e&&D(Object.assign({},q,e))},U=()=>{if(!L||!b)return;const e={};for(const t in q)q[t]&&(e[t]=q[t]);localStorage.setItem(L,JSON.stringify(e)),z(L,e)},j=async e=>{const t=null==y?void 0:y.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}},z=async(e,t)=>{const a=null==y?void 0:y.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}},B=async e=>{K(!1),await(0,Y._v)(100),e.current.clickHandle()},W=(e,t)=>{D(Object.assign({},q,{[t]:e}))},G=se("table"),Z={"top-toolbox__popper":!0,[`${G}--lg`]:"large"===C,[`${G}--sm`]:"small"===C};return t().createElement(t().Fragment,null,n&&t().createElement(Ei,{ref:T,isFullScreen:E,open:!b||q.fullScreen}),i&&t().createElement(Si,{ref:I,open:!b||q.reload}),o&&t().createElement(Ti,{ref:_,tableColumns:r,open:!b||q.print}),s&&t().createElement(Mi,{ref:R,tableColumns:r,open:!b||q.import}),c&&t().createElement(ji,{ref:P,tableColumns:r,open:(!b||q.export)&&!(null!=w&&w.hideIcon)}),u&&t().createElement(Wi,{ref:O,flattenColumns:x,open:!b||q.clipboard}),p&&t().createElement(Zi,{ref:A,columns:r,open:!b||q.collection}),h&&t().createElement(ao,{ref:k,open:!b||q.fastSearch}),g&&t().createElement(io,{ref:H,open:!b||q.groupSummary}),f&&t().createElement(uo,{ref:F,open:!b||q.superSearch}),b&&t().createElement(N.Dropdown,{overlay:(()=>{const e=[{key:"fullScreen",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.fullScreen,style:{marginRight:6},onChange:e=>W(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.screen.full"))),onClick:()=>B(T)},{key:"reload",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.reload,style:{marginRight:6},onChange:e=>W(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.refresh.text"))),onClick:()=>B(I)},{key:"print",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.print,style:{marginRight:6},onChange:e=>W(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.print.text"))),onClick:()=>B(_)},{key:"import",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.import,style:{marginRight:6},onChange:e=>W(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.import.textNoSpace"))),onClick:()=>B(R)},{key:"export",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.export,style:{marginRight:6},onChange:e=>W(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.export.textNoSpace"))),onClick:()=>B(P)},{key:"clipboard",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.clipboard,style:{marginRight:6},onChange:e=>W(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.clipboard.textNoSpace"))),onClick:()=>B(O)},{key:"collection",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.collection,style:{marginRight:6},onChange:e=>W(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.selectCollection.text"))),onClick:()=>B(A)},{key:"fastSearch",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.fastSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.fastSearch.text"))),onClick:()=>B(k)},{key:"groupSummary",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.groupSummary,style:{marginRight:6},onChange:e=>W(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.groupSummary.text"))),onClick:()=>B(H)},{key:"superSearch",label:t().createElement(t().Fragment,null,t().createElement(N.Checkbox,{checked:q.superSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),t().createElement("span",null,d("qm.table.highSearch.text"))),onClick:()=>B(F)}];return t().createElement(N.Menu,{items:e.filter((e=>$[e.key]))})})(),trigger:["click"],placement:"bottomRight",overlayClassName:oe()(Z),overlayStyle:{minWidth:120},visible:M,onVisibleChange:e=>{K(e)}},t().createElement("span",{className:`${G}-toolbox`,title:d("qm.table.toolbox.text")},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.AppstoreAddOutlined,null)))))}));po.displayName="ToolBox";const ho=po,mo=e=>{const{columns:a}=e,{global:r}=t().useContext(l),{tableProps:n,tableRef:i,$size:o}=t().useContext(Wn),{uniqueKey:s,onlyShowIcon:c,columnsChange:u}=n,p=t().useRef([]),h=e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)),m=e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)),f=e=>e.filter((e=>!e.noAuth&&!e.fixed)),[g,b]=t().useState(!1),[y,v]=t().useState(h(a)),[x,E]=t().useState(m(a)),[C,S]=t().useState(f(a)),w=t().useMemo((()=>s?`table_${s}`:""),[s]),T=t().useMemo((()=>[...y,...C,...x]),[y,C,x]);Se((()=>{P(a),R(a),I(a)}),[a]),t().useEffect((()=>{_()}),[]);const I=e=>{if(!w)return;const t=e.map((e=>{const t={};return void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),{dataIndex:e.dataIndex,...t}})),a=JSON.parse(localStorage.getItem(w));(0,ca.isEqual)(t,a)||(localStorage.setItem(w,JSON.stringify(t)),(async(e,t)=>{const a=null==r?void 0:r.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}})(w,t))},_=()=>{const e=(()=>{if(!w)return;const e=JSON.parse(localStorage.getItem(w));return e||(async e=>{const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const a=await t({key:e});if(200===a.code)return a.data}catch(e){}})(w).then((e=>{if(!e)return I(a);localStorage.setItem(w,JSON.stringify(e)),_()})).catch((()=>{})),e?(0,ca.xor)(e.map((e=>e.dataIndex)),a.map((e=>e.dataIndex))).length>0?a.map((t=>{const{dataIndex:a}=t,r=e.find((e=>e.dataIndex===a));return r?(void 0!==r.hidden&&(t.hidden=r.hidden),void 0!==r.fixed&&(t.fixed=r.fixed),void 0!==r.width&&(t.width=r.width),void 0!==r.renderWidth&&(t.renderWidth=r.renderWidth),t):t})):e.map((e=>{const t=a.find((t=>t.dataIndex===e.dataIndex));return void 0===e.fixed&&delete t.fixed,{...t,...e}})):void 0})();e&&(R(e),null==u||u(e))},R=e=>{const t=h(e),a=m(e),r=f(e);return v(t),E(a),S(r),[...t,...r,...a]},P=e=>{const t=[];e.filter((e=>!e.noAuth)).forEach(((a,r)=>{const l=a.colSpan;l>1&&e.slice(r+1,r+l).every((e=>{let{colSpan:t}=e;return 0===t}))&&t.push(e.slice(r,r+l))})),p.current=t},O=()=>{const e=[];T.forEach((t=>{const{colSpan:a,dataIndex:r}=t;if(0===a)return;if(1===a)return e.push(t);const l=p.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(r)));if(-1===l)return e.push(t);e.push(...p.current[l].map(((e,a)=>{let{dataIndex:r}=e;const l=T.find((e=>e.dataIndex===r));return a>0&&(void 0!==t.hidden&&(l.hidden=t.hidden),void 0!==t.fixed?l.fixed=t.fixed:l.fixed&&delete l.fixed),l})))})),a.forEach(((t,a)=>{t.noAuth&&e.findIndex((e=>e.dataIndex===t.dataIndex))<0&&e.splice(a,0,t)})),null==u||u(e)},A=(e,t)=>{if(e.noFixed)return;t?e.fixed=t:delete e.fixed;const r=R(a);null==u||u(r)},k=(e,r)=>{const{colSpan:l,noFixed:n}=e;if(0===l)return t().createElement("li",{key:e.dataIndex,style:{display:"none"}});const i=["svgicon","handle",`${r}-handle`];return t().createElement("li",{key:e.dataIndex,className:"item"},t().createElement(N.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:r}=t.target;e.hidden=!r,R(a),O()}}),t().createElement("i",{className:oe()(i),title:d("qm.table.columnFilter.draggable")},t().createElement(ce.HolderOutlined,null)),t().createElement("span",{className:"text",title:e.title},e.title),"main"===r?t().createElement("span",{className:oe()("fixed",n?"disabled":"")},t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.fixedLeft"),onClick:()=>A(e,"left")},t().createElement(ce.StepBackwardOutlined,null)),t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.fixedRight"),onClick:()=>A(e,"right")},t().createElement(ce.StepForwardOutlined,null))):t().createElement("span",{className:oe()("fixed",n?"disabled":"")},t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.cancelFixed"),onClick:()=>A(e)},t().createElement(ce.CloseCircleOutlined,null))))},H=se("table"),F={[`${H}__popper`]:!0,"column-filter__popper":!0,[`${H}--lg`]:"large"===o,[`${H}--sm`]:"small"===o},L=[`${H}-column-filter`,{selected:g}];return t().createElement(Ua(),{action:["click"],popupVisible:g,popup:t().createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},t().createElement("div",{className:"reset"},t().createElement(J,{type:"text",size:"small",onClick:()=>{const e=(0,Y.I8)(i.current.originColumns);R(e),null==u||u(e)}},d("qm.table.columnFilter.reset"))),t().createElement("div",{className:"left"},t().createElement(da.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),a=y.map((e=>e.dataIndex));(0,ca.isEqual)(t,a)||v(e)},onEnd:()=>O()},y.map((e=>k(e,"left"))))),t().createElement("div",{className:"divider"}),t().createElement("div",{className:"main"},t().createElement(da.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:C,setList:e=>{const t=e.map((e=>e.dataIndex)),a=C.map((e=>e.dataIndex));(0,ca.isEqual)(t,a)||S(e)},onEnd:()=>O()},C.map((e=>k(e,"main"))))),t().createElement("div",{className:"divider"}),t().createElement("div",{className:"right"},t().createElement(da.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:x,setList:e=>{const t=e.map((e=>e.dataIndex)),a=x.map((e=>e.dataIndex));(0,ca.isEqual)(t,a)||E(e)},onEnd:()=>O()},x.map((e=>k(e,"right")))))),popupClassName:oe()(F),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{b(e)},builtinPlacements:ai,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t().createElement("span",{className:oe()(L),title:c?d("qm.table.columnFilter.text"):void 0},t().createElement("i",{className:"svgicon icon"},t().createElement(ce.SettingOutlined,null)),!c&&t().createElement("span",null,d("qm.table.columnFilter.text"))))},fo=()=>t().createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t().createElement("path",{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}));function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},go.apply(this,arguments)}const bo=e=>{const{column:a,filters:r}=e,{$size:l,setFilters:n,clearSuperFilters:i}=t().useContext(Wn),o=t().useRef(null),s=t().useRef(null),c=t().useRef(null),[u,p]=t().useState(!1),[h,f]=t().useState({}),g=t().useMemo((()=>{const{dataIndex:e,filter:t}=a;return`${e}|${t.type}`}),[a]),b=t().useMemo((()=>{let e=!1;for(const t in r[g])if(!(0,Y.xb)(r[g][t])){e=!0;break}return e}),[g,r]);t().useEffect((()=>{u&&((0,Y.xb)(r[g])&&y(),setTimeout((()=>v()),50))}),[u]);const y=()=>{f({})},v=()=>{switch(a.filter.type){case"text":o.current.focus();break;case"number":s.current.focus();break;case"textarea":c.current.focus()}},x=e=>{e&&f(e),i(),n((e=>{for(const t in e){for(const a in e[t])(0,Y.xb)(e[t][a])&&delete e[t][a];Object.keys(e[t]).length||delete e[t]}return e})({...r,...h,...e})),p(!1)},E={text:e=>{var a;const{title:r}=e;return t().createElement(N.Input,{ref:o,size:l,placeholder:d("qm.table.filter.searchText",{text:r}),style:{width:"180px"},value:(null===(a=h[g])||void 0===a?void 0:a.like)??"",onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{like:t}})))},onKeyDown:e=>{13===e.keyCode&&x()}})},textarea:e=>{var a;const{title:r}=e;return t().createElement(N.Input.TextArea,{ref:c,size:l,placeholder:d("qm.table.filter.searchAreaText",{text:r}),style:{width:"220px"},value:(null===(a=h[g])||void 0===a?void 0:a.likes)??"",onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{likes:t}})))},onKeyDown:e=>{13===e.keyCode&&x()}})},number:e=>{const a=e=>{var t;return{value:(null===(t=h[g])||void 0===t?void 0:t[e])??"",size:l,onChange:t=>{f((a=>Object.assign({},a,{[g]:Object.assign({},a[g],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t().createElement("ul",null,t().createElement("li",null,t().createElement("span",null,"> "),t().createElement(N.InputNumber,go({ref:s},a(">"),{placeholder:d("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"< "),t().createElement(N.InputNumber,go({},a("<"),{placeholder:d("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"= "),t().createElement(N.InputNumber,go({},a("=="),{placeholder:d("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"!="),t().createElement(N.InputNumber,go({},a("!="),{placeholder:d("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const a=e=>{var t;return{value:(0,ii._3)(null===(t=h[g])||void 0===t?void 0:t[e],Qn),format:Qn,size:l,onChange:t=>{f((a=>Object.assign({},a,{[g]:Object.assign({},a[g],{[e]:(0,ii.p6)(t,Qn)})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t().createElement("ul",null,t().createElement("li",null,t().createElement("span",null,"> "),t().createElement(H,go({},a(">"),{placeholder:d("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"< "),t().createElement(H,go({},a("<"),{placeholder:d("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"= "),t().createElement(H,go({},a("=="),{placeholder:d("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"!="),t().createElement(H,go({},a("!="),{placeholder:d("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var a;const{filter:r,dictItems:l=[]}=e,n=r.items||l;return t().createElement("ul",null,t().createElement(N.Radio.Group,{style:{width:"100%"},value:null===(a=h[g])||void 0===a?void 0:a["=="],onChange:e=>{const{value:t}=e.target;f((e=>Object.assign({},e,{[g]:{"==":t}})))}},n.map((e=>t().createElement("li",{key:e.value},t().createElement(N.Radio,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var a;const{filter:r,dictItems:l=[]}=e,n=r.items||l;return t().createElement("ul",null,t().createElement(N.Checkbox.Group,{style:{width:"100%"},value:null===(a=h[g])||void 0===a?void 0:a.in,onChange:e=>{f((t=>Object.assign({},t,{[g]:{in:e}})))}},n.map((e=>t().createElement("li",{key:e.value},t().createElement(N.Checkbox,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{var a;const{filter:r,dictItems:l=[]}=e,n=r.items||l;return t().createElement("div",{style:{height:200,...r.style}},t().createElement(Bn,{multiple:!0,value:(null===(a=h[g])||void 0===a?void 0:a.in)||[],dataSource:n,onCheckChange:e=>{const t=e.map((e=>e.value));f((e=>Object.assign({},e,{[g]:{in:t}})))}}))}},C=se("table"),S={"head-filter__popper":!0,[`${C}--lg`]:"large"===l,[`${C}--sm`]:"small"===l},w=["cell--filter",{selected:u,actived:b}];return t().createElement(Ua(),{action:["click"],popupVisible:u,popup:(()=>{const e=a.filter.type,r=E[e];return r?t().createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},t().createElement("div",null,r(a)),t().createElement(N.Space,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},t().createElement(J,{size:l,onClick:()=>{x({[g]:{}})}},d("qm.table.filter.reset")),t().createElement(J,{type:"primary",size:l,onClick:()=>x()},d("qm.table.filter.search")))):(m("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:oe()(S),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{p(e)},builtinPlacements:ai,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t().createElement("div",{className:oe()(w),title:d("qm.table.filter.text"),onClick:e=>e.stopPropagation()},t().createElement("span",{className:"svgicon icon"},t().createElement(fo,null))))},yo=e=>{const{column:a}=e,{tableProps:r,tableRef:l,bordered:n}=t().useContext(Wn),{columns:i,resizable:o,columnsChange:s=Y.ZT}=r,c={resizable:!0,"is--line":o&&!n};return t().createElement("div",{className:oe()(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:r}=l.current,n=r.$resizableBar,o=t.offsetWidth/2,c=e.clientX,d=(0,ii.tj)(t,r.$table).left-r.$tableBody.parentNode.scrollLeft+o;r.$table.classList.add("c--resize"),n.style.left=`${d}px`,n.style.display="block";const u=a.width||a.renderWidth;let p=u;return document.onmousemove=function(e){if("number"!=typeof u)return;const t=e.clientX-c,r=u+t;r<(a.minWidth||ci.defaultColumnWidth)||(p=Math.floor(r),n.style.left=`${t+d}px`)},document.onmouseup=function(){r.$table.classList.remove("c--resize"),n.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(a.renderWidth=p,a.width=p,s([...i]))},!1}})},vo=e=>{const{selectionKeys:a}=e,{tableRef:r,tableProps:l,getRowKey:n,pagination:i,fetchParams:o,setSelectionKeys:s,setSpinning:c,isWebPagination:u}=t().useContext(Wn),{rowSelection:p}=l,{fetchAllRowKeys:h,onSelectAll:m}=p,f=t().useRef([]),g=t().useMemo((()=>p.selectAllOnCurrentPage??!1),[p]),b=t().useMemo((()=>(p.filterable??!0)&&!g),[p,g]),y=(()=>{const{allTableData:e,allRowKeys:t}=r.current,{disabled:l=(e=>!1)}=p;return g?(0,ca.union)((()=>{const{tableFullData:e}=r.current,{current:t,pageSize:a}=i;return u?e.slice((t-1)*a,t*a):e})().filter((e=>!l(e))).map((e=>n(e,e.index))),a):t.filter(((t,a)=>!l(e[a])))})(),v=a.length>0&&a.length<(h||g?i.total:r.current.allRowKeys.length),x=!!a.length&&a.length===(f.current.length||y.length),E=async()=>{const e=h;let t=[];c(!0);try{const a=await e.api(o);200===a.code&&(t=Array.isArray(a.data)?a.data:(0,Y.U2)(a.data,e.dataKey)??[],f.current=t)}catch(e){}return c(!1),t},C=async e=>{let t=[];t=h?e?await E():[]:e?y.slice(0):[],s(t),null==m||m(e,t)};return t().createElement("div",{className:"cell--selection"},t().createElement(N.Checkbox,{checked:x,indeterminate:v,disabled:!y.length,onChange:e=>C(e.target.checked)}),b&&t().createElement(N.Dropdown,{overlayClassName:"all-selection__popper",overlay:(()=>{const e=[{key:1,label:d("qm.table.selection.all"),onClick:()=>{C(!0)}},{key:2,label:d("qm.table.selection.invert"),onClick:()=>(async()=>{let e=[];e=h?(0,ca.xor)(a,await E()):(0,ca.xor)(a,y),s(e)})()},{key:3,label:d("qm.table.selection.clear"),onClick:()=>{C(!1)}}];return t().createElement(N.Menu,{items:e})})()},t().createElement(ce.DownOutlined,{className:"svgicon icon"})),g&&t().createElement(N.Tooltip,{placement:"top",title:d("qm.table.selection.currentPage")},t().createElement(ce.InfoCircleOutlined,{className:"info"})))},xo=e=>{const{style:a}=e,{tableProps:r,tableRef:l,isTreeTable:n,setRowExpandedKeys:i}=t().useContext(Wn),{expandable:o}=r,[s,c]=t().useState((null==o?void 0:o.defaultExpandAllRows)||!1);Se((()=>{const{allRowKeys:e,flattenRowKeys:t}=l.current;i(s?e.filter((e=>!(n&&t.includes(e)))):[])}),[s]);const d={[`${se("expand")}--icon`]:!0,expanded:s,collapsed:!s};return t().createElement("span",{className:oe()(d),title:"",onClick:e=>{e.stopPropagation(),c(!s)},style:a})},Eo=()=>t().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t().createElement("path",{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"})),Co=()=>t().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t().createElement("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})),So=e=>{const{tableColumns:a,flattenColumns:r,sorter:l,filters:n}=e,{getRowKey:i,tableProps:o,tableRef:s,layout:c,scrollY:u,superFilters:p,selectionKeys:h,rightFixedColumns:m,firstDataIndex:f,isFetch:g,isTreeTable:b,isGroupSubtotal:y,tableChange:v,setSorter:x,setElementStore:E,resetTableScroll:C,getStickyLeft:S,getStickyRight:w,createGroupData:T,createTableFullData:I}=t().useContext(Wn),{ellipsis:_,resizable:R,multipleSort:P,rowSelection:O,expandable:A}=o,[k,H]=ci.sortDirections,F=t().useRef(null),L=t().useMemo((()=>!g),[g]),q=t().useMemo((()=>!g),[g]),D=t().useMemo((()=>!(null!=A&&A.hideExpandAll)),[A]),$=t().useMemo((()=>g?!!(null!=O&&O.selectAllOnCurrentPage||null!=O&&O.fetchAllRowKeys):!(null!=O&&O.hideSelectAll)),[g,O]);Se((()=>{z(),v(),C()}),[l]),Se((()=>{G(),v(),C()}),[n]),Se((()=>{G(),v(),C()}),[p]),t().useEffect((()=>{M()}),[]);const M=()=>{E("$header",F.current)},K=e=>{const{dataIndex:a,type:r,sorter:n,title:i,description:o}=e;if(a===ci.selectionColumn&&"checkbox"===r){if("checkbox"===r)return t().createElement("div",{className:"cell"},$?t().createElement(vo,{selectionKeys:h}):d("qm.table.config.selectionText"));if("radio"===r)return t().createElement("div",{className:"cell"},i)}const s=[];return s.push(t().createElement("div",{key:0,className:"cell",title:i},b&&a===f&&D?t().createElement(xo,null):null,a===ci.expandableColumn&&D?t().createElement(xo,null):i)),o&&s.push(t().createElement(N.Tooltip,{key:1,placement:"top",title:o},t().createElement(ce.InfoCircleOutlined,{className:"tip"}))),n&&s.push(V(l[a])),s},V=e=>{const a=["svgicon cell--sorter__asc",{actived:e===k}],r=["svgicon cell--sorter__desc",{actived:e===H}];return t().createElement("div",{key:2,className:"cell--sorter",title:d("qm.table.sorter.text")},t().createElement("span",{className:oe()(a)},t().createElement(Eo,null)),t().createElement("span",{className:oe()(r)},t().createElement(Co,null)))},U=e=>t().createElement(bo,{column:e,filters:n}),j=(e,t)=>{const{sorter:a,dataIndex:r}=t;if(a){const e=l[r],t=e?e===H?null:H:k;P?(delete l[r],x(Object.assign({},l,{[r]:t}))):x(Object.assign({},{[r]:t}))}},z=()=>{L&&B()},B=e=>{const t=(0,ca.pickBy)(l,(e=>null!==e));for(const e in t){const a=r.find((t=>t.dataIndex===e));a?W(a,t[e]):delete t[e]}e||Object.keys(t).length||W({dataIndex:"index"},k)},W=(e,t)=>{const{tableFullData:a}=s.current,{dataIndex:r,sorter:l}=e,n=(e,a)=>{const l=(0,ii.C_)(e,r),n=(0,ii.C_)(a,r);return Number.isNaN(l-n)?t===k?l.toString().localeCompare(n.toString()):n.toString().localeCompare(l.toString()):t===k?l-n:n-l},i=y?T((0,ii.SX)(a).sort("function"==typeof l?l:n)):a.sort("function"==typeof l?l:n).slice(0);I(i)},G=()=>{q&&Y()},Y=()=>{const{tableOriginData:e}=s.current,t=p.length?(0,ii.TQ)(p):(0,ii.TQ)(n),a=""!==t?y?T((0,oo.ar)((0,ii.SX)(e),t,b)):(0,oo.ar)(e,t,b):e;I(a),B(!0)},Z=(0,ii.vo)(a),X=se("table"),{tableBodyWidth:Q}=c;return t().createElement("div",{ref:F,className:`${X}--header-wrapper`},t().createElement("table",{className:`${X}--header`,cellSpacing:"0",cellPadding:"0",style:{width:Q?`${Q}px`:""}},(()=>{const{gutterWidth:e}=c;return t().createElement("colgroup",null,r.map((e=>{const{dataIndex:a,width:r,renderWidth:l}=e;return t().createElement("col",{key:a,style:{width:`${r||l}px`,minWidth:`${r||l}px`}})})),u&&t().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t().createElement("thead",null,(e=>{const{isIE:a}=s.current,r=["gutter",{"cell-fix-right":!!m.length}],n=a?null:{right:m.length?0:""};return e.map(((e,a)=>t().createElement("tr",{key:a,className:"header--row"},e.map(((a,r)=>((e,a,r)=>{var n,i;const{isIE:o}=s.current,{gutterWidth:d}=c,{dataIndex:p,colSpan:h,rowSpan:m,fixed:f,align:g,theadAlign:b,theadClassName:y="",sorter:v,filter:x,required:E,headRender:C}=e;if(0===h)return null;const T=b||g,N=["header--column",{"col--ellipsis":e.ellipsis??_,"col--center":"center"===T,"col--right":"right"===T,"column--required":!!E,"column-has-sorter":v,"column-has-filter":x,"column--sort":!!l[p],"cell-fix-left":!o&&"left"===f,"cell-fix-right":!o&&"right"===f,"cell-fix-left-last":!(o||"left"!==f||null!==(n=r[a+1])&&void 0!==n&&n.fixed),"cell-fix-right-first":!(o||"right"!==f||null!==(i=r[a-1])&&void 0!==i&&i.fixed),[y]:!!y}],I=o?null:{left:"left"===f?`${S(p)}px`:"",right:"right"===f?`${w(p)+(u?d:0)}px`:""},P=R&&![ci.expandableColumn,ci.selectionColumn].includes(p);return t().createElement("th",{key:p,className:oe()(N),colSpan:h,rowSpan:m,style:{...I},onClick:t=>j(t,e)},t().createElement("div",{className:"cell--wrapper"},C?t().createElement("div",{className:"cell--text cell"},C(e,s.current.tableFullData)):t().createElement(t().Fragment,null,t().createElement("div",{className:"cell--text"},K(e)),x?U(e):null)),P&&t().createElement(yo,{column:e}))})(a,r,e))),u&&t().createElement("th",{className:oe()(r),style:{...n}}))))})(Z))))},wo=()=>{const{tableProps:e,tableRef:a,layout:r,flattenColumns:l,isDragMergeCell:n}=t().useContext(Wn),{mergeCells:i=[],onMergeChange:o}=e,[s,c]=t().useState(!1),u=t().useRef(null),p=t().useRef(null),h=t().useRef({x:0,y:0,disX:0,disY:0});Se((()=>{n||y()}),[n]);const m=()=>{y(),Oe(u.current,{display:"none"})},f=e=>{const t=[];for(let a=0;a<e.rowSpan;a++)for(let r=0;r<e.colSpan;r++)t.push([e.row+a,e.col+r]);return t},g=()=>{h.current={x:0,y:0,disX:0,disY:0},p.current&&!v(p.current)||(p.current=null,m()),c(!0),document.removeEventListener("mousemove",b)},b=e=>{const{pageX:t,pageY:a}=e,{x:l,y:n,disX:i,disY:o}=h.current;let s=i,c=o,d=t-l,p=a-n;return d<0&&(d=Math.abs(d),s=i-d,Oe(u.current,{left:`${s}px`})),p<0&&(p=Math.abs(p),c=o-p,Oe(u.current,{top:`${c+r.headerHeight}px`})),Oe(u.current,{width:`${d}px`,height:`${p}px`}),E(s,c,d,p),!1},y=()=>{const{elementStore:e}=a.current,t=e.$tableBody.querySelectorAll("tbody > tr");for(let e=0;e<t.length;e++){const a=t[e].children;for(let e=0;e<a.length;e++)a[e].classList.remove("selected")}},v=e=>1===e.rowSpan&&1===e.colSpan,x=e=>e.width||e.renderWidth||e.minWidth||ci.defaultColumnWidth,E=(0,Y.Ds)(((e,t,r,n)=>{const{allTableData:i,scrollYStore:o}=a.current;let s=-1,c=-1,d=-1,u=-1;for(let e=0;e<i.length;e++)t>o.rowHeight*e&&t<o.rowHeight*(e+1)&&(s=e),t+n>o.rowHeight*e&&t+n<o.rowHeight*(e+1)&&(c=e);let h=0;for(let t=0;t<l.length;t++)e>h&&e<h+x(l[t])&&(d=t),e+r>h&&e+r<h+x(l[t])&&(u=t),h+=x(l[t]);const m={row:s,col:d,rowSpan:c-s+1,colSpan:u-d+1};(0,ca.isEqual)(p,m)||(p.current=m,((e,t,r,l)=>{const{elementStore:n,scrollYStore:i}=a.current,o=n.$tableBody.querySelectorAll("tbody > tr");for(let a=0;a<o.length;a++){const n=o[a].children;for(let o=0;o<n.length;o++)if(n[o].classList.remove("selected"),(e!==t||r!==l)&&a+i.startIndex>=e&&a+i.startIndex<=t){const e=Number(n[o].getAttribute("colspan")),t=Number(n[o].getAttribute("data-index")),a=e>1?t+e-1:t;a>=r&&a<=l&&n[o].classList.add("selected")}}})(s,c,d,u))}),10);return{dragStart:e=>{const{pageX:t,pageY:l}=e,{elementStore:n}=a.current,{x:i,y:o}=(e=>{let t=0,a=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,a+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:a}})(n.$table),{scrollLeft:s,scrollTop:d}=n.$tableBody.parentNode;p.current=null,h.current={x:t,y:l,disX:t+s-i,disY:l+d-(o+r.headerHeight)},Oe(u.current,{width:0,height:0,left:t-i+"px",top:l-o+"px",display:"block"}),y(),c(!1),document.addEventListener("mousemove",b,{passive:!0}),document.addEventListener("mouseup",g,{passive:!0,once:!0})},renderDragPanel:()=>t().createElement("div",{ref:u,className:"merge-cell-bar",onMouseDown:e=>e.stopPropagation()},s&&t().createElement(t().Fragment,null,t().createElement(J,{size:"small",className:"btn cancel",onClick:()=>{if(p.current&&!v(p.current)){const e=f(p.current),t=i.findIndex((t=>{const a=f(t);return(0,ca.intersectionWith)(a,e,ca.isEqual).length===a.length}));-1!==t&&(null==o||o(i.filter(((e,a)=>a!==t))))}m()}},d("qm.table.mergeCell.cancel")),t().createElement(J,{size:"small",type:"primary",className:"btn confirm",onClick:()=>{if(p.current&&!v(p.current)){const e=f(p.current);let t=!1;for(let a=0;a<i.length;a++)(0,ca.intersectionWith)(f(i[a]),e,ca.isEqual).length&&(t=!0);t||null==o||o([...i,p.current])}m()}},d("qm.table.mergeCell.confirm")))),closeDragPanel:m}};const To=e=>{const{selectionKeys:a,column:r,record:l,rowKey:n}=e,{tableProps:i,tableRef:o,isTreeTable:s,getAllChildRowKeys:c}=t().useContext(Wn),{rowSelection:d}=i,u=t().useMemo((()=>r.type||""),[r.type]),p=e=>{const t=d.checkStrictly??!0;if(!s||t)return!1;const r=(0,ii.CD)(o.current.deriveRowKeys,e),l=c((null==r?void 0:r.children)??[]);return!(!Array.isArray(null==r?void 0:r.children)||(0,ii.bY)(a,(null==r?void 0:r.children.map((e=>e.rowKey)))||[]))&&l.some((e=>a.includes(e)))};return"radio"===u?(()=>{const e=d.disabled,r=null==e?void 0:e(l),i=!r&&a[0]===n;return t().createElement(N.Radio,{checked:i,disabled:r})})():(()=>{const e=d.disabled,r=null==e?void 0:e(l),i=!!a.includes(n);return t().createElement(N.Checkbox,{checked:i,indeterminate:p(n),disabled:r})})()},No=e=>{const{record:a,rowKey:r,style:l}=e,{tableProps:n,rowExpandedKeys:i,setRowExpandedKeys:o}=t().useContext(Wn),{expandable:s={}}=n,[c]=t().useState("function"==typeof s.rowExpandable&&!s.rowExpandable(a)),d=t().useMemo((()=>i.includes(r)),[i,r]);Se((()=>{var e;null===(e=s.onExpand)||void 0===e||e.call(s,d,a)}),[d]);const u={[`${se("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return t().createElement("span",{className:oe()(u),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?i.filter((e=>e!==r)):[...i,r];o(t)},style:l})},Io=t().forwardRef(((e,a)=>{const{size:r,defaultValue:l,value:n,min:i,max:o,prefix:s,suffix:c,placeholder:d,maxLength:u,precision:p,allowClear:h,readOnly:m,disabled:f,formatter:g=(e=>e.toString()),parser:b=(e=>e),onFocus:y}=e,v=e=>{let t=e.toString();return"."!==t.charAt(t.length-1)&&"-"!==t||(t=t.slice(0,-1)),t&&Number(t)>o&&(t=o.toString()),t&&Number(t)<i&&(t=i.toString()),p>=0&&""!==t&&(t=Number(t).toFixed(p)),t},x=void 0!==n,[E,C]=t().useState(l??""),S=g(x?n:E),w=b(S),T=t=>{var a;x?null===(a=e.onChange)||void 0===a||a.call(e,t):C(t)};return Se((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,w)}),[E]),t().createElement(N.Input,{ref:a,size:r,value:S,maxLength:u,prefix:s,suffix:c,placeholder:d,allowClear:h,readOnly:m,disabled:f,onChange:e=>{const t=b(e.target.value);let a=/^-?\d*(\.\d*)?$/.test(t)||""===t||"-"===t;0===p&&t.includes(".")&&(a=!1),i>=0&&t.startsWith("-")&&(a=!1),a&&T(t)},onFocus:y,onBlur:()=>{var t;const a=v(w);Number(a)!==Number(w)&&T(a),null===(t=e.onBlur)||void 0===t||t.call(e,a,w)},onKeyUp:t=>{var a;13===t.keyCode&&(null===(a=e.onEnter)||void 0===a||a.call(e,v(w),w))}})}));Io.displayName="InputNumber";const _o=Io,{Search:Ro}=N.Input,Po=e=>{var a,r,l,n;const{column:i,record:o,rowKey:s,columnKey:c,clicked:u,text:p}=e,{tableRef:h,tableBodyRef:f,$size:g,flattenColumns:b,doFieldValidate:y,dataChange:v}=t().useContext(Wn),x=t().useRef(null),E=t().useRef(null),C=t().useRef(null),S=t().useRef(null),w=t().useRef(null),T=t().useRef(!1),I=t().useRef([]),_=t().useRef({}),R=yi(),{store:P,fieldAuth:O}=h.current,A=(null===(a=i.editRender)||void 0===a?void 0:a.call(i,o,i))||{},[k,F]=t().useState(!1),[L,q]=t().useState(!1),[$,M]=t().useState(!1),[K,V]=t().useState(A.items||[]),U=(A.editable||(0,ca.isEqual)(u,[s,c]))&&!A.disabled&&!(null!==(r=O[c])&&void 0!==r&&r.disabled),j=`${s}|${c}`,z=2===u.length?`${u[0]}|${u[1]}`:"",B=![...P.state.required,...P.state.validate].some((e=>{let{x:t,y:a}=e;return t===s&&a===c})),W=(null===(l=P.state.required.find((e=>{let{x:t,y:a}=e;return t===s&&a===c})))||void 0===l?void 0:l.text)||"",G=(null===(n=P.state.validate.find((e=>{let{x:t,y:a}=e;return t===s&&a===c})))||void 0===n?void 0:n.text)||"",Z=P.state.edited.some((e=>{let{x:t,y:a}=e;return t===s&&a===c})),X=U||!B||k||$||L,Q=()=>{v()};t().useEffect((()=>{X&&z===j&&te()}),[u]);const J=(e,t)=>{F(e),null==t||t()},ee=e=>{I.current=e},te=()=>{var e,t,a,r;const{type:l}=A;switch(l){case"text":null===(e=E.current)||void 0===e||e.focus();break;case"number":null===(t=C.current)||void 0===t||t.select();break;case"search-helper":null===(a=S.current)||void 0===a||a.focus();break;case"tree-helper":null===(r=w.current)||void 0===r||r.focus()}},ae=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0}))},re=(e,t,a)=>{const{cornerSign:r=!0}=A.extra||{};P.addToUpdated(e),r&&P.addToEdited({x:t,y:a})},le=e=>""!==e?Number(e):"",ne={text:(e,a)=>{const{dataIndex:r}=a,{type:l,extra:n={},rules:i=[],onInput:o,onChange:u,onEnter:p,onBlur:h}=A,m=(0,ii.C_)(e,r),f=n.password?N.Input.Password:N.Input;return t().createElement(f,{ref:E,size:g,value:m,maxLength:n.maxLength,showCount:n.showCount,placeholder:n.placeholder||d("qm.table.editable.inputPlaceholder"),allowClear:n.allowClear,readOnly:n.readOnly,disabled:n.disabled,suffix:n.suffix,onChange:t=>{const a=t.target.value??"";(0,ii.dN)(e,r,a),y(i,a,s,c),R(),null==o||o({[j]:a}),T.current=!0},onFocus:()=>q(!0),onBlur:t=>{q(!1);const a=t.target.value??"";T.current&&(T.current=!1,re(e,s,c),null==u||u({[j]:a},e),null==h||h({[j]:a},e),Q())},onKeyUp:t=>{if(13===t.keyCode){const a=t.target.value??"";null==p||p({[j]:a},e)}}})},number:(e,a)=>{const{dataIndex:r,precision:l,formatType:n}=a,{type:i,extra:o={},rules:u=[],onInput:p,onChange:h,onEnter:m,onBlur:f}=A,b=(0,ii.C_)(e,r);let v,x;return"finance"===n&&(v=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},x=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===n&&(v=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new(hi())(e).times(100).toNumber()}`,x=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:(Number(e)/100).toString()),t().createElement(_o,{ref:C,size:g,value:b,min:o.min,max:o.max,precision:l,prefix:o.prefix,suffix:o.suffix??("percent"===n?"%":void 0),placeholder:o.placeholder||d("qm.table.editable.inputPlaceholder"),maxLength:o.maxLength,allowClear:o.allowClear,readOnly:o.readOnly,disabled:o.disabled,formatter:v,parser:x,onChange:t=>{(0,ii.dN)(e,r,t),y(u,t,s,c),R(),null==p||p({[j]:t}),T.current=!0},onFocus:()=>q(!0),onBlur:(t,a)=>{if(q(!1),!T.current)return;T.current=!1;let l=le(t);"percent"===n&&"."===a.charAt(a.length-1)&&(l=Number(t)/100),(0,ii.dN)(e,r,l),re(e,s,c),null==h||h({[j]:l},e),null==f||f({[j]:t},e),Q()},onEnter:(t,a)=>{let r=le(t);"percent"===n&&"."===a.charAt(a.length-1)&&(r=Number(t)/100),null==m||m({[j]:r},e)}})},select:(e,a,r)=>{const{dataIndex:l,dictItems:n=[]}=a,{type:i,extra:o={},rules:u=[],items:p,onChange:m,onEnter:f}=A,{elementStore:b}=h.current,v=p||n,x=(0,ii.C_)(e,l);let E=x;return t().createElement(N.Select,{mode:r?"multiple":void 0,size:g,dropdownClassName:"table-editable__popper",value:x||void 0,placeholder:o.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,listHeight:o.listHeight,maxTagCount:o.collapseTags?"responsive":void 0,maxTagTextLength:o.maxTagTextLength,disabled:o.disabled,style:{width:"100%"},showSearch:o.filterable??!0,filterOption:(e,t)=>{var a;const r=(null==t||null===(a=t.children)||void 0===a?void 0:a.toString())||"";return`${r}|${Xr.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{(0,ii.dN)(e,l,t),y(u,t,s,c),re(e,s,c),R(),null==m||m({[j]:t},e),Q()},onSelect:e=>{E=e},onInputKeyDown:t=>{13===t.keyCode&&(0,Y.Y3)((()=>null==f?void 0:f({[j]:E},e)))}},v.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>ne.select(e,t,!0),date:(e,a,r)=>{const{dataIndex:l}=a,{type:n,extra:i={},rules:o=[],onChange:u}=A,p=r?Jn:Qn,h=(0,ii.C_)(e,l);return t().createElement(H,{showTime:r,size:g,dropdownClassName:"table-editable__popper",value:(0,ii._3)(h,p)??void 0,format:p,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:a}=i;return t&&a?e.isBefore(t,"day")||e.isAfter(a,"day"):t?e.isBefore(t,"day"):!!a&&e.isAfter(a,"day")})(e),placeholder:d(r?"qm.table.editable.datetimePlaceholder":"qm.table.editable.datePlaceholder"),allowClear:i.allowClear,disabled:i.disabled,style:{width:"100%"},onChange:t=>{const a=(0,ii.p6)(t,p);(0,ii.dN)(e,l,a),y(o,a,s,c),re(e,s,c),R(),null==u||u({[j]:a},e),Q()}})},datetime:(e,t)=>ne.date(e,t,!0),time:(e,a)=>{const{dataIndex:r}=a,{type:l,extra:n={},rules:i=[],onChange:o}=A,u=(0,ii.C_)(e,r);return t().createElement(D,{size:g,dropdownClassName:"table-editable__popper",value:(0,ii._3)(u,ei)??void 0,format:ei,placeholder:d("qm.table.editable.datetimePlaceholder"),allowClear:n.allowClear,disabled:n.disabled,style:{width:"100%"},onChange:t=>{const a=(0,ii.p6)(t,ei);(0,ii.dN)(e,r,a),y(i,a,s,c),re(e,s,c),R(),null==o||o({[j]:a},e),Q()}})},checkbox:(e,a)=>{const{dataIndex:r}=a,{type:l,extra:n={},onChange:i}=A,{trueValue:o=Zn,falseValue:d=Xn,disabled:u}=n,p=(0,ii.C_)(e,r);return t().createElement(N.Checkbox,{checked:p===o,disabled:u,onChange:t=>{const a=t.target.checked?o:d;(0,ii.dN)(e,r,a),re(e,s,c),R(),null==i||i({[j]:a},e),Q()}})},switch:(e,a)=>{const{dataIndex:r}=a,{type:l,extra:n={},onChange:i}=A,{trueValue:o=Zn,falseValue:d=Xn,disabled:u}=n,p=(0,ii.C_)(e,r);return t().createElement(N.Switch,{checked:p===o,disabled:u,onChange:t=>{const a=t?o:d;(0,ii.dN)(e,r,a),re(e,s,c),R(),null==i||i({[j]:a},e),Q()}})},"search-helper":(e,a)=>{const{dataIndex:r,precision:l}=a,{type:n,extra:i={},rules:o=[],helper:u={},onInput:p,onChange:h,onEnter:v}=A,E=(0,ii.C_)(e,r),C=u.fieldAliasMap;C||m("Table","helper 需要配置 `fieldAliasMap` 选项");const w="function"==typeof C?C():C||{};Object.keys(w).includes(r)||m("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值");const N=e=>{const{filterAliasMap:t}=u,a=""!==e?e:void 0,l="function"==typeof t?t():t??[],n={[r]:a};return l.forEach((e=>n[e]=a)),n},I=e=>{_.current=N(e),F(!0)},P=(t,r)=>{const{beforeOpen:l}=u,n=(l??Y.XT)({[j]:E},e,a);null!=n&&n.then?n.then((()=>{I(t),null==r||r()})).catch((()=>{})):!1!==n&&(I(t),null==r||r())},O=e=>{const t={};for(const a in w){const l=w[a];a!==r&&(t[a]=(0,ii.jq)(e,l))}const a=w[r]?(0,ii.jq)(e,w[r]):"";L(a,t);const{closed:l}=u;J(!1,(()=>ae(x.current))),te(),null==l||l(e)},H=()=>{const{onlySelect:e=!0}=u;T.current&&L(e?"":E),T.current=!1,J(!1,(()=>ae(x.current)))},L=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;if((0,Y.Kn)(a)&&Object.keys(a).length){for(const t in a){const r=a[t],l=b.find((e=>e.dataIndex===t));if(l){var n;(0,ii.dN)(e,t,r,l.precision);const a=null===(n=l.editRender)||void 0===n?void 0:n.call(l,e,l);a&&Array.isArray(a.rules)&&y(a.rules,r,s,t)}else(0,ii.dN)(e,t,r)}f.current.forceUpdate()}(0,ii.dN)(e,r,t,l),y(o,t,s,c),re(e,s,c),null==h||h({[j]:t},e),Q(),_.current={},T.current=!1},q={visible:k,title:d("qm.searchHelper.text"),width:u.width??"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${Oa[g]+20}px`},onClose:()=>{H()}},D={...u,size:g,initialValue:(0,ca.merge)({},u.initialValue,_.current),onClose:e=>{e?O(e):H()}};return t().createElement(t().Fragment,null,t().createElement(Ro,{ref:S,value:E,placeholder:i.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,readOnly:i.readOnly,disabled:i.disabled,onBlur:e=>{var t;const{value:a}=e.target,{onlySelect:l=!0,table:n}=u;if(T.current&&!k)return a&&l&&null!=n&&null!==(t=n.fetch)&&void 0!==t&&t.api?(e=>{const{table:t,initialValue:a={}}=u,{beforeFetch:r=Y.XT}=t.fetch;return M(!0),new Promise((async(l,n)=>{const i=(0,ca.merge)({},t.fetch.params,{...a,...N(e)},{currentPage:1,pageSize:500});try{if(r(i)){const e=await t.fetch.api(i);200===e.code?l(Array.isArray(e.data)?e.data:(0,ca.get)(e.data,t.fetch.dataKey)??[]):n()}else n()}catch(e){n()}M(!1)}))})(a).then((e=>function(){let e=arguments.length>1?arguments[1]:void 0;const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter((t=>(0,ii.jq)(t,w[r]).toString().includes(e)));if(1===t.length)return O(t[0]);P(e)}(e,a))).catch((()=>L(""))):void L(a)},onChange:t=>{const{value:a}=t.target;(0,ii.dN)(e,r,a),null==p||p({[j]:a}),T.current=!0,R()},onKeyUp:t=>{if(13===t.keyCode){const a=t.target.value??"";null==v||v({[j]:a},e)}},onDoubleClick:e=>{const{value:t}=e.target;P(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?P(e):L(""))}}),t().createElement(At,q,t().createElement(Go,D)))},"search-helper-multiple":(e,a)=>{const{dataIndex:r}=a,{type:l,items:n=[],extra:i={},rules:o=[],helper:u={},onInput:p,onChange:h,onEnter:f}=A,b=(0,ii.C_)(e,r),v=u.fieldAliasMap;v||m("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof v?v():v||{};Object.keys(E).includes("valueKey")&&Object.keys(E).includes("textKey")||m("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`");const C=t=>{const{beforeOpen:r}=u,l=(r??Y.XT)({[j]:b},e,a);null!=l&&l.then?l.then((()=>{F(!0),null==t||t()})).catch((()=>{})):!1!==l&&(F(!0),null==t||t())},S=()=>{J(!1,(()=>ae(x.current)))},w=t=>{(0,ii.dN)(e,r,t),y(o,t,s,c),re(e,s,c),null==h||h({[j]:t},e,I.current),Q()},T={visible:k,title:d("qm.searchHelper.text"),width:u.width??"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${Oa[g]+20}px`},onClose:()=>{S()}},_={...u,size:g,multiple:!0,initialValue:(0,ca.merge)({},u.initialValue),defaultSelectedKeys:b,onClose:(e,t)=>{e?((e,t)=>{const{textKey:a,valueKey:r}=E;ee((0,ca.uniqBy)([...I.current.filter((e=>t.includes(e[r]))),...e],r));const l=I.current.map((e=>({text:e[a],value:e[r]}))),i=(0,ca.uniqBy)([...l,...n],"value").filter((e=>t.includes(e.value)));V(i),w(i.map((e=>e.value)));const{closed:o}=u;J(!1,(()=>ae(x.current))),null==o||o(I.current)})(e,t):S()}};return t().createElement(t().Fragment,null,t().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t().createElement("span",{className:"ant-input-wrapper ant-input-group"},t().createElement(N.Select,{mode:"multiple",open:!1,value:b,placeholder:i.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,maxTagCount:i.collapseTags?"responsive":void 0,maxTagTextLength:i.maxTagTextLength,disabled:i.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==f||f({[j]:b},e))},onDoubleClick:()=>{C()},onChange:e=>{const{valueKey:t}=E;ee(I.current.filter((a=>e.includes(a[t])))),w(e),R()}},K.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(N.Button,{className:"ant-input-search-button",disabled:i.disabled,icon:t().createElement(ce.SearchOutlined,null),onClick:()=>{C()}})))),t().createElement(At,T,t().createElement(Go,_)))},"tree-helper":(e,a)=>{const{dataIndex:r,precision:l}=a,{type:n,extra:i={},rules:o=[],helper:u={},onChange:p,onEnter:h}=A,v=(0,ii.C_)(e,r),E=u.fieldAliasMap;E||m("Table","helper 需要配置 `fieldAliasMap` 选项");const C="function"==typeof E?E():E||{};Object.keys(C).includes(r)||m("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值");const S=t=>{const{beforeOpen:r}=u,l=(r??Y.XT)({[j]:v},e,a);null!=l&&l.then?l.then((()=>{F(!0),null==t||t()})).catch((()=>{})):!1!==l&&(F(!0),null==t||t())},T=()=>{J(!1,(()=>ae(x.current)))},N=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;if((0,Y.Kn)(a)&&Object.keys(a).length){for(const t in a){const r=a[t],l=b.find((e=>e.dataIndex===t));if(l){var n;(0,ii.dN)(e,t,r,l.precision);const a=null===(n=l.editRender)||void 0===n?void 0:n.call(l,e,l);a&&Array.isArray(a.rules)&&y(a.rules,r,s,t)}else(0,ii.dN)(e,t,r)}f.current.forceUpdate()}(0,ii.dN)(e,r,t,l),y(o,t,s,c),re(e,s,c),null==p||p({[j]:t},e),Q()},I={visible:k,title:d("qm.searchHelper.text"),width:u.width??"30%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${Oa[g]+20}px`},onClose:()=>{T()}},_={...u,defaultSelectedKeys:[v],size:g,onClose:e=>{e?(e=>{const t={};for(const a in C){const l=C[a];a!==r&&(t[a]=(0,ii.jq)(e,l))}const a=C[r]?(0,ii.jq)(e,C[r]):"";N(a,t);const{closed:l}=u;J(!1,(()=>ae(x.current))),te(),null==l||l(e)})(e):T()}};return t().createElement(t().Fragment,null,t().createElement(Ro,{ref:w,value:v,allowClear:i.allowClear??!0,readOnly:i.readOnly,disabled:i.disabled,placeholder:i.placeholder||d("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target;t||R()},onKeyUp:t=>{if(13===t.keyCode){const a=t.target.value??"";null==h||h({[j]:a},e)}},onDoubleClick:()=>{S()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?S():N(""))}}),t().createElement(At,I,t().createElement(as,_)))},"tree-helper-multiple":(e,a)=>{const{dataIndex:r}=a,{type:l,extra:n={},items:i=[],rules:o=[],helper:u={},onInput:p,onChange:h,onEnter:f}=A,b=(0,ii.C_)(e,r),v=u.fieldAliasMap;v||m("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof v?v():v||{};Object.keys(E).includes("valueKey")&&Object.keys(E).includes("textKey")||m("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`");const C=t=>{const{beforeOpen:r}=u,l=(r??Y.XT)({[j]:b},e,a);null!=l&&l.then?l.then((()=>{F(!0),null==t||t()})).catch((()=>{})):!1!==l&&(F(!0),null==t||t())},S=()=>{J(!1,(()=>ae(x.current)))},w=t=>{(0,ii.dN)(e,r,t),y(o,t,s,c),re(e,s,c),null==h||h({[j]:t},e,I.current),Q()},T={visible:k,title:d("qm.searchHelper.text"),width:u.width??"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${Oa[g]+20}px`},onClose:()=>{S()}},_={...u,size:g,multiple:!0,initialValue:(0,ca.merge)({},u.initialValue),defaultSelectedKeys:b,onClose:e=>{e?(e=>{const{textKey:t,valueKey:a}=E;ee(e);const r=I.current.map((e=>({text:e[t],value:e[a]})));V(r),w(r.map((e=>e.value)));const{closed:l}=u;J(!1,(()=>ae(x.current))),null==l||l(I.current)})(e):S()}};return t().createElement(t().Fragment,null,t().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t().createElement("span",{className:"ant-input-wrapper ant-input-group"},t().createElement(N.Select,{mode:"multiple",open:!1,value:b,placeholder:n.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:n.allowClear,maxTagCount:n.collapseTags?"responsive":void 0,maxTagTextLength:n.maxTagTextLength,disabled:n.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==f||f({[j]:b},e))},onDoubleClick:()=>{C()},onChange:e=>{const{valueKey:t}=E;ee(I.current.filter((a=>e.includes(a[t])))),w(e),R()}},K.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(N.Button,{className:"ant-input-search-button",disabled:n.disabled,icon:t().createElement(ce.SearchOutlined,null),onClick:()=>{C()}})))),t().createElement(At,T,t().createElement(as,_)))}};return t().createElement(t().Fragment,null,X?(()=>{const{type:e}=A,a=ne[e];if(!a)return m("Table","单元格编辑的类型 `type` 配置不正确"),null;const r=["cell--edit",{"is-error":!B}];return t().createElement("div",{ref:x,className:oe()(r)},a(o,i),!B&&t().createElement("div",{className:"cell-error"},W||G))})():(()=>{const{extra:e={}}=A;return e.disabledColor?t().createElement("span",{style:{color:e.disabledColor}},p):t().createElement(t().Fragment,null,p)})(),Z&&t().createElement("i",{className:"cell--sign"}))},Oo=require("copy-to-clipboard");var Ao=__webpack_require__.n(Oo);const ko=e=>{const{text:a,options:r,showMessage:l=!0,onCopy:n}=e;return function(e){if(!t().isValidElement(e))return null;for(var a=arguments.length,r=new Array(a>1?a-1:0),l=1;l<a;l++)r[l-1]=arguments[l];return t().cloneElement(e,...r)}(e.children,{onClick:i=>{const o=t().Children.only(e.children),s=Ao()(a,r);null==n||n(a,s),s&&l&&N.message.success(d("qm.clipboard.success")),o&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(i)}})};ko.displayName="CopyToClipboard";const Ho=ko;function Fo(){return Fo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Fo.apply(this,arguments)}const Lo=t().forwardRef(((a,r)=>{const{tableData:l,flattenColumns:n}=a,{getRowKey:o,tableProps:s,tableRef:c,editableColumns:u,leftFixedColumns:p,rightFixedColumns:h,firstDataIndex:f,sorter:g,layout:b,showFooter:y,scrollX:v,scrollY:x,selectionKeys:E,rowExpandedKeys:C,highlightKey:S,isPingLeft:w,isPingRight:T,isTableEmpty:N,isTreeTable:I,isGroupSubtotal:_,isWebPagination:R,isDragMergeCell:P,setElementStore:O,createTableFullData:A,setSelectionKeys:k,setHighlightKey:H,getStickyLeft:F,getStickyRight:L,scrollXToColumn:q,scrollYToRecord:D,rowInViewport:$,dataChange:M,setPingLeft:K,setPingRight:V,setFullScreen:U,setOverlay:j,findParentRowKeys:z,getAllChildRowKeys:B,triggerScrollYEvent:W,scrollBottomDebouncer:G}=t().useContext(Wn),{height:Z,minHeight:X,maxHeight:Q,rowSelection:J,rowHighlight:ee,treeConfig:te,expandable:ae,stripe:re,summation:le,rowStyle:ne,cellStyle:ie,spanMethod:de,ellipsis:ue,showHeader:pe,rowDraggable:he,onRowClick:me,onRowDblclick:fe,onRowContextmenu:ge,onRowEnter:be}=s,ye=t().useRef(null),ve=t().useRef(null),xe=t().useRef({prevST:0,prevSL:0}),{dragStart:Ee,renderDragPanel:Ce,closeDragPanel:we}=wo(),Te={dateFormat:e=>{const t=e?i()(e).format(Qn):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?i()(e).format(Jn):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?i()(e).format(Jn.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>Number.isNaN(Number(e))?e:(100*Number(e)).toFixed(2)+"%",financeFormat:e=>(0,ii.uf)(e.toString()),secretNameFormat:e=>e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**"),secretPhoneFormat:e=>e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2"),secretIDnumberFormat:e=>e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2"),secretBankNumberFormat:e=>e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")},Re=t().useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:a,tableFullHeight:r,tableAutoHeight:l}=b,n={};return N&&Object.assign(n,{minHeight:"100px"}),X&&Object.assign(n,{minHeight:(0,ii.EJ)(X)-e-a+"px"}),Q&&Object.assign(n,{maxHeight:(0,ii.EJ)(Q)-e-a+"px"}),Z||r||l?{...n,maxHeight:"",minHeight:"",height:`${t}px`}:n}),[Z,Q,X,N,b]),Oe=t().useMemo((()=>{const{tableBodyWidth:e,gutterWidth:t}=b;return e&&x?e-t:e}),[b,x]),Ae=t().useMemo((()=>{const{scrollYStore:e}=c.current,{viewportHeight:t,gutterWidth:a}=b;return Math.floor((v?t-a:t)/e.rowHeight)}),[b,v]),[ke,He]=t().useState([]),Fe=yi(),Le=function(t,a){const[r,l]=e.useState(!1);return e.useEffect((()=>{let e;const r=t.current,n=t=>{e=t},i=t=>{((e,t)=>{const n=e.target,i=null==t?void 0:t.target,o=!n||!i,s=(null==r?void 0:r.contains(n))||(null==r?void 0:r.contains(i)),c=r===n,d=null==a?void 0:a.map((e=>document.querySelector(e))),u=(null==d?void 0:d.some((e=>null==e?void 0:e.contains(n))))||(null==d?void 0:d.includes(i));l(!(o||s||c||u))})(t,e)};return r&&(Ie(document,"mousedown",n),Ie(document,"mouseup",i)),()=>{r&&(_e(document,"mousedown",n),_e(document,"mouseup",i))}}),[t]),r}(ye,[".table-editable__popper"]);t().useImperativeHandle(r,(()=>({renderCellTitle:Ge,setClickedValues:Me,forceUpdate:Fe}))),Se((()=>{Le&&(Me([]),P&&we())}),[Le]),Se((()=>{ke.length&&ni.focus(c.current.uid)}),[ke]),t().useEffect((()=>{De(),$e()}),[]);const qe=t().useCallback((e=>{var t,a;const{keyCode:r}=e;if(c.current.uid===(null===(t=ni.getFocusInstance())||void 0===t?void 0:t.id)&&(27===r&&(Me([]),H(""),U(!1)),ke.length&&(((e,t)=>{if(Ne.Z||!e||!t)return!1;let a=e;for(;a;){if(a===t)return!0;a=a.parentNode}return!1})(document.activeElement,ye.current)||"INPUT"!==(null===(a=document.activeElement)||void 0===a?void 0:a.tagName)))){if(13===r&&(Pe(e),"radio"===(null==J?void 0:J.type)||ee)){const t=E[0]??S??null,a=l.find((e=>o(e,e.index)===t))??null;a&&(null==be||be(a,e))}if(38===r||40===r){var n,i;Pe(e);const{allTableData:t}=c.current,a=R?(0,ii.tL)(l):t,s=a.length;let d=a.findIndex((e=>o(e,e.index)===ke[0]));const u=38===r?(--d+s)%s:++d%s,p=a[u],h=o(p,p.index);"radio"!==(null==J?void 0:J.type)||null!==(n=J.disabled)&&void 0!==n&&n.call(J,p)||k([h]),!ee||null!==(i=ee.disabled)&&void 0!==i&&i.call(ee,p)||H(h),$(u)||(38===r&&D(h,u),40===r&&D(h,Ae>u+1?0:u+1-Ae)),Me([h,ke[1]])}if(9===r){if(Pe(e),!u.length)return Me([]);const t=u.length;let a=u.findIndex((e=>e.dataIndex===ke[1]));const r=++a%t,l=u[r].dataIndex;Me([ke[0],l]),q(l)}}}),[ke,l,E,u,Ae]);t().useEffect((()=>{const e=ot()(document,"keydown",qe);return()=>e.remove()}),[qe]);const De=()=>{O("$tableBody",ye.current),O("$tableYspace",ve.current)},$e=()=>{j("overlay"===((e,t)=>{if(Ne.Z||!e||!t)return null;"float"===(t=(0,Y._A)(t))&&(t="cssFloat");try{var a;const r=e.style[t];if(r)return r;const l=null===(a=document.defaultView)||void 0===a?void 0:a.getComputedStyle(e,"");return l?l[t]:""}catch(a){return e.style[t]}})(ye.current.parentNode,"overflowY"))},Me=e=>{(0,ca.isEqual)(e,ke)||He(e)},Ke=(e,t,a)=>a?[...t,e]:t.filter((t=>t!==e)),Ve=(e,t,a)=>{var r;const{deriveRowKeys:l}=c.current,n=(0,ii.CD)(l,e);let i=[];const o=B((null==n?void 0:n.children)||[]),s=(null===(r=(0,ii.Qi)(l,e))||void 0===r?void 0:r.slice(0,-1).reverse())||[];return i=a?[...new Set([...t,e,...o])]:t.filter((t=>![e,...o].includes(t))),s.forEach((e=>{var t;const a=(0,ii.CD)(l,e),r=(0,ii.bY)(i,(null==a||null===(t=a.children)||void 0===t?void 0:t.map((e=>e.rowKey)))||[]);i=r?[...i,e]:i.filter((t=>t!==e))})),i},Ue=e=>Array.isArray(e.children)&&e.children.length>0,je=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=[];return e.forEach((e=>{const l=e.index,i=o(e,e.index);if(r.push(ze(e,l,i,a)),null!=ae&&ae.expandedRowRender){const{expandedRowClassName:a,rowExpandable:o=Y.XT}=ae;C.includes(i)&&o(e)&&r.push(t().createElement("tr",{key:`expand_${i}`,className:"body--row-expanded"},t().createElement("td",{colSpan:n.length,className:"body--column",style:{paddingLeft:J?"100px":"50px"}},t().createElement("div",{className:oe()("cell",a)},ae.expandedRowRender(e,l)))))}if((null==te||!te.virtual)&&Ue(e)){const t="function"!=typeof(null==ae?void 0:ae.rowExpandable)||ae.rowExpandable(e);C.includes(i)&&t&&r.push(...je(e.children,a+1))}})),r},ze=function(e,a,r){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=["body--row",{"body--row-striped":re&&a%2!=0,"body--row-selected":E.includes(r),"body--row-current":S===r,..._?Je(e._group):null}];return t().createElement("tr",{key:r,className:oe()(i)},n.map(((t,n)=>Be(t,n,e,a,r,l))))},Be=(e,a,r,l,n,i)=>{const{isIE:s,isOverlay:d}=c.current,{dataIndex:u,fixed:m,align:f,className:y=""}=e,{rowSpan:v,colSpan:C}=Ze(r,e,l,a),{gutterWidth:S}=b;if(!v||!C)return null;const w=e.ellipsis??ue,T=!s&&"left"===m,N=!s&&"right"===m,R=["body--column",{"col--ellipsis":w,"col--center":"center"===f,"col--right":"right"===f,"column--sort":!!g[u],"cell-fix-left":T,"cell-fix-right":N,"cell-fix-left-last":T&&p[p.length-1].dataIndex===u,"cell-fix-right-first":N&&h[0].dataIndex===u,[y]:!!y}],P=s?null:{left:T?`${F(u)}px`:"",right:N?`${L(u)+(d&&x?S:0)}px`:""},O=ne?"function"==typeof ne?ne(r,l):ne:null,A=ie?"function"==typeof ie?ie(r,e,l,a):ie:null,q=_?Qe(r._group):null,D=Ge(e,r,l,a);return t().createElement("td",{key:u,title:w?D:void 0,rowSpan:v>1?v:void 0,colSpan:C>1?C:void 0,"data-index":a,className:oe()(R),style:{...P,...q,...O,...A},onClick:t=>((e,t,a)=>{var r,l;const{dataIndex:n}=a;if([ci.expandableColumn,ci.operationColumn].includes(n))return;const i=o(t,t.index);Me([i,n]);const s=null===(r=a.editRender)||void 0===r?void 0:r.call(a,t,a),c=s&&!s.disabled,{type:d,selectByClickRow:u=!0,disabled:p=Y.ZT}=J||{};!d||p(t)||c||(u||n===ci.selectionColumn)&&((e,t)=>{const{type:a,checkStrictly:r=!0,onSelect:l}=J||{};if("radio"===a&&k([e]),"checkbox"===a){const a=!E.includes(e),n=I&&!r?Ve(e,E,a):Ke(e,E,a);k(n),null==l||l(a,t,n)}})(i,t),[ci.selectionColumn].includes(n)||(!ee||null!==(l=ee.disabled)&&void 0!==l&&l.call(ee,t)||c||H(i),null==me||me(t,a,e))})(t,r,e),onDoubleClick:t=>((e,t,a)=>{const{dataIndex:r}=a;[ci.expandableColumn,ci.selectionColumn,ci.operationColumn].includes(r)||null==fe||fe(t,a,e)})(t,r,e),onContextMenu:t=>((e,t,a)=>{const{dataIndex:r}=a;[ci.expandableColumn,ci.selectionColumn,ci.operationColumn].includes(r)||null==ge||ge(t,a,e)})(t,r,e)},t().createElement("div",{className:"cell"},We(e,r,l,a,D,n,i)),N&&d&&x&&h[h.length-1].dataIndex===u?t().createElement("i",{className:"gutter-overlay",style:{width:S,right:-1*(S+1)}}):null)},We=(e,a,r,l,n,i,o)=>{const{dataIndex:s,canCopy:c,editRender:u,render:p}=e,h=(0,ii.C_)(a,s);if(s===ci.expandableColumn)return t().createElement(No,{record:a,rowKey:i});if(s===ci.selectionColumn)return t().createElement(To,{selectionKeys:E,column:e,record:a,rowKey:i});const m=Ye(h,e,a);if(u)return t().createElement(Po,{column:e,record:a,rowKey:i,columnKey:s,clicked:ke,text:m});const g=p?p(h,a,e,r,l):m;return I&&s===f?[Xe(null!=te&&te.virtual?a._level:o),t().createElement(No,{key:"expand",record:a,rowKey:i,style:Ue(a)?{}:{visibility:"hidden"}}),g]:c?t().createElement("div",{className:"cell--copy"},t().createElement("span",{className:"text"},g),n&&t().createElement(Ho,{text:n},t().createElement(ce.CopyOutlined,{className:"icon",title:d("qm.table.config.copyText"),onClick:e=>e.stopPropagation()}))):g},Ge=(e,t,a,r)=>{const{dataIndex:l,render:n}=e;if([ci.expandableColumn,ci.selectionColumn,ci.operationColumn].includes(l))return"";let i="";const o=(0,ii.C_)(t,l);if("function"==typeof n){const l=n(o,t,e,a,r);i=(0,Y.l$)(l)?(0,ii.gn)(l).join(""):l}else i=Ye(o,e,t).toString();return i},Ye=(e,t,a)=>{var r;const{dictItems:l,precision:n,formatType:i,editRender:o}=t,s=l||(null==o||null===(r=o(a,t))||void 0===r?void 0:r.items)||[],c=s.find((t=>t.value==e));let d=(null==c?void 0:c.text)??e??"";if(Array.isArray(e)&&(d=e.map((e=>{const t=s.find((t=>t.value==e));return(null==t?void 0:t.text)??e})).join(",")),n>=0&&""!==d&&(d=Number(d).toFixed(n)),"string"==typeof d&&(d=d.replace(/[\r\n]/g,"")),i){const e=Te[`${(0,Y._A)(i)}Format`];e?d=e(d):m("Table","字段的格式化类型 `formatType` 配置不正确")}return d},Ze=(e,t,a,r)=>{let n=1,i=1;if("function"==typeof de){const o=de({row:e,column:t,rowIndex:a,columnIndex:r,tableData:l});if(Array.isArray(o)?(n=o[0],i=o[1]):(0,Y.Kn)(o)&&(n=o.rowSpan,i=o.colSpan),e===l[0]&&0===n){n=1;for(let e=1;e<l.length;e++){const{rowSpan:a}=Ze(l[e],t,l[e].index,r);if(a>0)break;n++}}}const{mergeCells:o}=c.current;if(o.length>0){const e=o.find((e=>e.row===a&&e.col===r));e&&(n=e.rowSpan,i=e.colSpan)}return{rowSpan:n,colSpan:i}},Xe=e=>e?t().createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*ci.treeTable.textIndent+"px"}}):null,Qe=e=>{const{backgroundColor:t,color:a}=le.groupItems.find((t=>t.dataIndex===e))??{};return{backgroundColor:t,color:a}},Je=e=>{const t=le.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},et=se("table"),tt=P?{onMouseDown:Ee}:null;return t().createElement("div",{className:`${et}--body-wrapper`,style:{...Re},onScroll:e=>{const{elementStore:t,scrollYLoad:a}=c.current,{prevST:r,prevSL:l}=xe.current,n=x?b.gutterWidth:0,{scrollTop:i,scrollLeft:o}=e.target;if(o!==l){pe&&(t.$header.scrollLeft=o),y&&(t.$footer.scrollLeft=o);const e=o>0,a=Math.ceil(o)+b.tableWidth<b.tableBodyWidth+n;w!==e&&K(e),T!==a&&V(a)}if(a&&i!==r&&W(i),x&&i!==r){const a=t.$tableYspace.offsetHeight||t.$tableBody.offsetHeight;Math.ceil(i)+b.viewportHeight-n>=a&&G(e)}xe.current.prevST=i,xe.current.prevSL=o}},t().createElement("div",{ref:ve,className:"body--y-space"}),t().createElement("div",{className:"body--x-space",style:{width:Oe?`${Oe}px`:""}}),t().createElement("table",Fo({ref:ye,className:`${et}--body`,tabIndex:-1,cellSpacing:"0",cellPadding:"0"},tt,{style:{width:Oe?`${Oe}px`:""}}),t().createElement("colgroup",null,n.map((e=>{const{dataIndex:a,width:r,renderWidth:l}=e;return t().createElement("col",{key:a,style:{width:`${r||l}px`,minWidth:`${r||l}px`}})}))),he?t().createElement(da.ReactSortable,{itemKey:e=>o(e,e.index),tag:"tbody",animation:200,list:l,setList:e=>{const t=e.map((e=>o(e,e.index))),a=l.map((e=>o(e,e.index)));if((0,ca.isEqual)(t,a))return;const r=[];c.current.tableFullData.forEach((t=>{l.includes(t)?r.push(e.shift()):r.push(t)})),A(r),M()}},l.map((e=>ze(e,e.index,o(e,e.index))))):t().createElement("tbody",null,je(l))),P&&Ce())}));Lo.displayName="TableBody";const qo=Lo,Do=e=>{const{summationRows:a,flattenColumns:r}=e,{getRowKey:l,tableProps:n,tableRef:i,sorter:o,layout:s,scrollY:c,leftFixedColumns:u,rightFixedColumns:p,setElementStore:h,getStickyLeft:m,getStickyRight:f}=t().useContext(Wn),{footRender:g}=n,b=t().useRef(null);t().useEffect((()=>{y()}),[]);const y=()=>{h("$footer",b.current)},v=se("table"),{tableBodyWidth:x}=s;return t().createElement("div",{ref:b,className:`${v}--footer-wrapper`},g?g(r,i.current.tableFullData):t().createElement("table",{className:`${v}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:x?`${x}px`:""}},(()=>{const{gutterWidth:e}=s;return t().createElement("colgroup",null,r.map((e=>{const{dataIndex:a,width:r,renderWidth:l}=e;return t().createElement("col",{key:a,style:{width:`${r||l}px`,minWidth:`${r||l}px`}})})),c&&t().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t().createElement("tfoot",null,(()=>{const{isIE:e}=i.current,l=["gutter",{"cell-fix-right":!!p.length}],n=e?null:{right:p.length?0:""};return a.map(((e,a)=>t().createElement("tr",{key:a,className:"footer--row"},r.map(((a,r)=>((e,a,r)=>{const{isIE:l}=i.current,{gutterWidth:n}=s,{dataIndex:h,fixed:g,align:b,summation:y}=e,v=["footer--column","col--ellipsis",{"col--center":"center"===b,"col--right":"right"===b,"column--sort":!!o[h],"cell-fix-left":!l&&"left"===g,"cell-fix-right":!l&&"right"===g,"cell-fix-left-last":!l&&"left"===g&&u[u.length-1].dataIndex===h,"cell-fix-right-first":!l&&"right"===g&&p[0].dataIndex===h}],x=l?null:{left:"left"===g?`${m(h)}px`:"",right:"right"===g?`${f(h)+(c?n:0)}px`:""},E=null!=y&&y.render?y.render(i.current.tableFullData):(0,ii.C_)(a,`${h}_text`),C=0===r&&""===E?d("qm.table.config.summaryText"):E;return t().createElement("td",{key:h,title:C,className:oe()(v),style:{...x}},t().createElement("div",{className:"cell"},C))})(a,e,r))),c&&t().createElement("td",{className:oe()(l),style:{...n}}))))})())))};var $o;!function(e){e.small="small",e.middle="default",e.large="default"}($o||($o={}));const Mo=e=>{var a,r;const{current:n,pageSize:i,total:o,config:s,onChange:c}=e,{global:d}=t().useContext(l),{tableProps:u,$size:p,setElementStore:h}=t().useContext(Wn),{infoBarConfig:m}=u,f=t().useRef(null);t().useEffect((()=>{g()}),[]);const g=()=>{h("$pager",f.current)},b=(e,t)=>{c(e,t)},y=(null==s?void 0:s.showSizeChanger)??ci.pagination.showSizeChanger,v=(null==s?void 0:s.showQuickJumper)??ci.pagination.showQuickJumper,x=(null==s?void 0:s.pageSizeOptions)||(null==d||null===(a=d.table)||void 0===a||null===(r=a.pagination)||void 0===r?void 0:r.pageSizeOptions)||ci.pagination.pageSizeOptions,E={[`${se("table")}-pager`]:!0};return t().createElement("div",{ref:f,className:oe()(E)},t().createElement("div",{className:"pager-alert"},"bottom"===(null==m?void 0:m.position)&&t().createElement(vi,{total:o})),t().createElement(N.Pagination,{size:$o[p],showSizeChanger:y,showQuickJumper:v,pageSizeOptions:x,current:n,pageSize:i,total:o,onChange:b,onShowSizeChange:b}))},Ko=()=>{const{layout:e}=t().useContext(Wn),a=t().useMemo((()=>{const{headerHeight:t,viewportHeight:a}=e;return{top:`${t}px`,height:`${a}px`}}),[e]),r=se("table");return t().createElement("div",{className:`${r}--empty`,style:a},t().createElement(Ze,null))};function Vo(){return Vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Vo.apply(this,arguments)}const Uo=t().forwardRef(((e,a)=>{const{rowKey:r,columns:n,loading:i,stripe:o,resizable:s,customClass:c,paginationConfig:d,tablePrint:u,exportExcel:p,infoBarConfig:h,topSpaceAlign:f,showTableInfo:g,showFullScreen:b,showRefresh:y,showToolBox:v,showColumnDefine:x,showHeader:E}=e,{size:C}=t().useContext(l),S=t().useMemo((()=>e.size??C??""),[e.size,C]),w=t().useRef(null),T=t().useRef(null),N=t().useRef(null),I=t().useRef(null),_=t().useRef(null),R=yi(),P=t().useCallback(((e,t)=>{const a="function"==typeof r?r(e,t):e[r];return void 0===a?(m("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):a}),[r]),{tableRef:O,tableFullData:A,setElementStore:k,setOriginColumns:H,setTableFullData:F,setTableOriginData:L,setAllTableData:q,setDeriveRowKeys:D,setFieldAuth:$,setMergeCells:M,setScrollYStore:K,setScrollYLoad:V,setResizeState:U,setHandleState:j,setSummaries:z,setSelectionRows:B,setShouldToTop:W,setRecordsMap:G,setOverlay:Z,clearElementStore:X,clearRecordsMap:Q}=((e,a)=>{let{getRowKey:r,$size:l}=a;const n=t().useRef({uid:(0,ii.wE)(),elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],allTableData:[],allRowKeys:[],deriveRowKeys:[],flattenRowKeys:[],fieldAuth:{},mergeCells:[],scrollYStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0,rowHeight:ci.rowHeightMaps[l]},store:new si,resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:null,remove:!1},summaries:{},treeTable:!1,scrollYLoad:!1,shouldToTop:!0,selectionRows:[],recordsMap:new Map,isOverlay:!1,isIE:(0,Y.w1)()}),i=function(e,t,a){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.map((e=>{const n=r(e,e.index),o=a?`${a}#${n}`:`${n}`,s={level:l,rowKey:n,rowKeyPath:o};return e.children&&(s.children=i(e.children,n,o,l+1)),t?Object.assign({},s,{parentRowKey:t}):s}))},o=e=>{const t=[];return e.forEach((e=>{var a;null!==(a=e.children)&&void 0!==a&&a.length?t.push(...o(e.children)):t.push(e.rowKey)})),t};return{tableRef:n,...n.current,setElementStore:(e,t)=>{n.current.elementStore[e]=t},setOriginColumns:e=>{n.current.originColumns=e},setTableFullData:e=>{n.current.tableFullData=e},setTableOriginData:e=>{n.current.tableOriginData=e},setAllTableData:e=>{const t=(0,ii.tL)(e);n.current.allTableData=t,n.current.allRowKeys=t.map((e=>r(e,e.index)))},setDeriveRowKeys:e=>{n.current.deriveRowKeys=i(e,"",""),n.current.flattenRowKeys=o(n.current.deriveRowKeys),n.current.treeTable=n.current.deriveRowKeys.some((e=>Array.isArray(e.children)&&e.children.length))},setFieldAuth:(e,t)=>{n.current.fieldAuth[e]=t},setMergeCells:e=>{const t=[];e.forEach((e=>{t.push(e);for(let a=1;a<e.colSpan;a++)for(let r=0;r<e.rowSpan;r++)t.push({row:e.row+r,col:e.col+a,rowSpan:0,colSpan:0});for(let a=1;a<e.rowSpan;a++)for(let r=0;r<e.colSpan;r++)t.push({row:e.row+a,col:e.col+r,rowSpan:0,colSpan:0})})),n.current.mergeCells=t},setScrollYStore:e=>{n.current.scrollYStore=e},setResizeState:e=>{n.current.resizeState=e},setHandleState:e=>{n.current.handleState=e},setSummaries:e=>{n.current.summaries=e},setScrollYLoad:e=>{n.current.scrollYLoad=e},setShouldToTop:e=>{n.current.shouldToTop=e},setSelectionRows:e=>{n.current.selectionRows=e},setRecordsMap:(e,t)=>{n.current.recordsMap.set(e,t)},setOverlay:e=>{n.current.isOverlay=e},clearElementStore:()=>{for(const e in n.current.elementStore)n.current.elementStore[e]=null},clearRecordsMap:()=>{n.current.recordsMap.clear()}}})(0,{getRowKey:P,$size:S}),{tableData:J,setTableData:ee,filters:te,setFilters:ae,sorter:re,setSorter:le,superFilters:ne,setSuperFilters:ie,pagination:ce,setPagination:de,selectionKeys:ue,setSelectionKeys:pe,rowExpandedKeys:he,setRowExpandedKeys:me,highlightKey:fe,setHighlightKey:ge,layout:be,setLayout:ye,permission:ve,setPermission:xe,spinning:Ee,setSpinning:Ce,scrollX:we,setScrollX:Te,scrollY:Ne,setScrollY:Ie,isPingLeft:_e,setPingLeft:Re,isPingRight:Pe,setPingRight:Oe,isFullScreen:Ae,setFullScreen:ke}=(e=>{var a,r;const{paginationConfig:n,rowSelection:i,expandable:o,rowHighlight:s}=e,{global:c}=t().useContext(l),d={current:ci.pagination.current,pageSize:(null==n?void 0:n.pageSize)??(null==c||null===(a=c.table)||void 0===a||null===(r=a.pagination)||void 0===r?void 0:r.pageSize)??ci.pagination.pageSize,total:0},u=(null==i?void 0:i.selectedRowKeys)??(null==i?void 0:i.defaultSelectedRowKeys)??[],p=(null==o?void 0:o.expandedRowKeys)??(null==o?void 0:o.defaultExpandedRowKeys)??[],[h,m]=t().useState([]),[f,g]=t().useReducer(((e,t)=>(0,ca.isEqual)(e,t)?e:t),{}),[b,y]=t().useReducer(((e,t)=>(0,ca.isEqual)(e,t)?e:t),{}),[v,x]=t().useReducer(((e,t)=>(0,ca.isEqual)(e,t)?e:t),[]),[E,C]=t().useState(d),[S,w]=t().useReducer(((e,t)=>(0,ca.isEqual)(e,t)?e:t),u),[T,N]=t().useReducer(((e,t)=>(0,ca.isEqual)(e,t)?e:t),p),[I,_]=t().useState((null==s?void 0:s.currentRowKey)??""),[R,P]=t().useState({gutterWidth:ui(),tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[O,A]=t().useState({export:!0,import:!0,print:!0}),[k,H]=t().useState(!1),[F,L]=t().useState(!1),[q,D]=t().useState(!1),[$,M]=t().useState(!1),[K,V]=t().useState(!1),[U,j]=t().useState(!1);return{tableData:h,setTableData:m,filters:f,setFilters:g,sorter:b,setSorter:y,superFilters:v,setSuperFilters:x,pagination:E,setPagination:C,selectionKeys:S,setSelectionKeys:w,rowExpandedKeys:T,setRowExpandedKeys:N,highlightKey:I,setHighlightKey:_,layout:R,permission:O,setPermission:A,setLayout:P,spinning:k,setSpinning:H,scrollX:F,setScrollX:L,scrollY:q,setScrollY:D,isPingLeft:$,setPingLeft:M,isPingRight:K,setPingRight:V,isFullScreen:U,setFullScreen:j}})(e),{isFetch:He,isWebPagination:Fe,isScrollPagination:Le,showPagination:qe,shouldUpdateHeight:De,tableColumns:$e,flattenColumns:Me,editableColumns:Ke,summationColumns:Ve,leftFixedColumns:Ue,rightFixedColumns:je,firstDataIndex:ze,showSummary:Be,showFooter:We,isHeadGroup:Ge,bordered:Ye,isHeadSorter:Ze,isHeadFilter:Xe,isServiceSummation:Je,isSelectCollection:et,isTableImport:tt,isTableClipboard:at,isSuperSearch:rt,isFastSearch:lt,isGroupSummary:nt,isGroupSubtotal:it,isDragMergeCell:ot,isTreeTable:st,isTableEmpty:ct,summationRows:dt,fetchParams:ut}=fi(e,{getRowKey:P,tableRef:O,tableFullData:A,tableData:J,sorter:re,filters:te,superFilters:ne,pagination:ce}),{createElementStore:pt,tableStyles:ht,getSpan:mt,getStickyLeft:ft,getStickyRight:gt,scrollXToColumn:bt,scrollYToRecord:yt,rowInViewport:vt,calcTableHeight:xt,resetTableScroll:Et,doLayout:Ct}=bi(e,{getRowKey:P,tableRef:O,$size:S,tableColumns:$e,flattenColumns:Me,leftFixedColumns:Ue,layout:be,scrollY:Ne,tableData:J,showFooter:We,showPagination:qe,isWebPagination:Fe,isFullScreen:Ae,setLayout:ye,setScrollX:Te,setScrollY:Ie,setElementStore:k,setScrollYStore:K,setShouldToTop:W}),{initialTable:St,createTableFullData:wt,getTableData:Tt,handleTableData:Nt,createTableData:It,createGroupData:_t,createSelectionKeys:Rt,createSelectionRows:Pt,createRowExpandedKeys:Ot,findParentRowKeys:At,getAllChildRowKeys:kt,doFieldValidate:Ht,getTableLog:Ft,dataChange:Lt,tableChange:qt,toLastPage:Dt,toFirstPage:$t,getPageCount:Mt,pagerChangeHandle:Kt,triggerScrollYEvent:Vt,scrollBottomDebouncer:Ut,clearTableSorter:jt,clearTableFilter:zt,clearSuperFilters:Bt,clearRowSelection:Wt,clearRowHighlight:Gt,clearTableLog:Yt,destroy:Zt}=gi(e,{getRowKey:P,tableRef:O,tableElementRef:T,tableBodyRef:N,$size:S,tableColumns:$e,tableFullData:A,pagination:ce,layout:be,filters:te,sorter:re,superFilters:ne,fetchParams:ut,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,summationColumns:Ve,shouldUpdateHeight:De,isFetch:He,isTreeTable:st,isWebPagination:Fe,isScrollPagination:Le,isServiceSummation:Je,isGroupSubtotal:it,doLayout:Ct,setTableData:ee,setTableFullData:F,setTableOriginData:L,setAllTableData:q,setDeriveRowKeys:D,setPagination:de,setSpinning:Ce,setSorter:le,setFilters:ae,setSuperFilters:ie,setSelectionKeys:pe,setRowExpandedKeys:me,setHighlightKey:ge,setSelectionRows:B,setScrollYLoad:V,setScrollYStore:K,setFieldAuth:$,setResizeState:U,setSummaries:z,setPermission:xe,setRecordsMap:G,resetTableScroll:Et,clearElementStore:X,clearRecordsMap:Q});((e,a)=>{const{columns:r,summation:l,rowSelection:n,expandable:i,rowHighlight:o,mergeCells:s=[]}=e,{tableRef:c,topElementRef:d,tableElementRef:u,tableBodyRef:p,resizableBarRef:h,$size:f,scrollX:g,pagination:b,selectionKeys:y,rowExpandedKeys:v,highlightKey:x,summationRows:E,summationColumns:C,showSummary:S,isWebPagination:w,isScrollPagination:T,isTreeTable:N,toLastPage:I,toFirstPage:_,getPageCount:R,setHandleState:P,scrollYToRecord:O,setSelectionKeys:A,setOriginColumns:k,setSelectionRows:H,setRowExpandedKeys:F,setHighlightKey:L,setResizeState:q,setMergeCells:D,setPingRight:$,calcTableHeight:M,createSelectionKeys:K,createSelectionRows:V,createRowExpandedKeys:U,createElementStore:j,triggerScrollYEvent:z,forceUpdate:B,initialTable:W,destroy:G}=a,{elementStore:Z,handleState:X,scrollYLoad:Q}=c.current,J=t().useRef(E);Se((()=>{if(!n)return;const{onChange:e}=n;"radio"===n.type&&p.current.setClickedValues(y.length?[y[0],""]:[]),H(V(y)),null==e||e(y,c.current.selectionRows),S&&C.some((e=>e.summation.sumBySelection))&&B()}),[y]),Se((()=>{if(!i)return;const{allTableData:e,allRowKeys:t}=c.current,{onChange:a}=i;null==a||a(v,v.map((a=>e[t.findIndex((e=>e===a))])))}),[v]),Se((()=>{const{allTableData:e,allRowKeys:t}=c.current;var a;N&&F(U()),o&&(p.current.setClickedValues(x?[x,""]:[]),null===(a=o.onChange)||void 0===a||a.call(o,x,e[t.findIndex((e=>e===x))]??null))}),[x]),Se((()=>{var e;(0,ca.isEqual)(E,J.current)||(J.current=E,S&&l&&(null===(e=l.onChange)||void 0===e||e.call(l,E)))}),[E]),Se((()=>{const e=K(n.selectedRowKeys);(0,ca.isEqual)(e,y)||(A(e),N&&F(U()))}),[null==n?void 0:n.selectedRowKeys]),Se((()=>{const e=U(i.expandedRowKeys);(0,ca.isEqual)(e,v)||F(e)}),[null==i?void 0:i.expandedRowKeys]),Se((()=>{const{currentRowKey:e}=o;e!==x&&L(e??"")}),[null==o?void 0:o.currentRowKey]),Se((()=>{const{insert:e,remove:t}=X;e&&(w&&("after"===e?I():_()),O("","after"===e?1e5:0)),t&&b.current>R()&&I(),(e||t)&&P({insert:null,remove:!1})}),[b.total]),Se((()=>{Q&&z(Z.$tableBody.parentNode.scrollTop)}),[Q]),Se((()=>{$(g)}),[g]),Se((()=>{M()}),[f]),Se((()=>{D(s),p.current.forceUpdate()}),[s]),Se((()=>{Q&&(e.height||e.maxHeight||m("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||m("Table","必须设置组件参数 `ellipsis`")),T&&(e.height||e.maxHeight||m("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[Q,T]);const ee=()=>{const{resizeState:e}=c.current,{winHeight:t}=e,a=window.innerHeight;a!==t&&(q(Object.assign({},e,{winHeight:a})),M())};t().useEffect((()=>(j({$toper:d.current,$table:u.current,$resizableBar:h.current}),k((0,Y.I8)(r)),W(),D(s),window.addEventListener("resize",ee,!1),M(),()=>{G(),window.removeEventListener("resize",ee)})),[])})(e,{tableRef:O,topElementRef:w,tableElementRef:T,tableBodyRef:N,resizableBarRef:_,$size:S,scrollX:we,pagination:ce,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,showSummary:Be,summationRows:dt,summationColumns:Ve,isWebPagination:Fe,isScrollPagination:Le,isTreeTable:st,toLastPage:Dt,toFirstPage:$t,getPageCount:Mt,setHandleState:j,scrollYToRecord:yt,setOriginColumns:H,setSelectionKeys:pe,setSelectionRows:B,setRowExpandedKeys:me,setHighlightKey:ge,setResizeState:U,setMergeCells:M,setPingRight:Oe,calcTableHeight:xt,createSelectionKeys:Rt,createSelectionRows:Pt,createRowExpandedKeys:Ot,createElementStore:pt,triggerScrollYEvent:Vt,forceUpdate:R,initialTable:St,destroy:Zt});const Xt=t().useMemo((()=>({getRowKey:P,tableProps:e,tableRef:O,tableBodyRef:N,$size:S,flattenColumns:Me,editableColumns:Ke,leftFixedColumns:Ue,rightFixedColumns:je,firstDataIndex:ze,sorter:re,filters:te,superFilters:ne,layout:be,bordered:Ye,showFooter:We,showSummary:Be,summationRows:dt,scrollX:we,scrollY:Ne,pagination:ce,fetchParams:ut,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,isFetch:He,isPingLeft:_e,isPingRight:Pe,isHeadSorter:Ze,isHeadFilter:Xe,isFullScreen:Ae,isTableEmpty:ct,isHeadGroup:Ge,isTreeTable:st,isGroupSubtotal:it,isWebPagination:Fe,isDragMergeCell:ot,dataChange:Lt,tableChange:qt,getTableData:Tt,setElementStore:k,createTableFullData:wt,setSorter:le,setFilters:ae,setSuperFilters:ie,setSelectionKeys:pe,setHighlightKey:ge,setRowExpandedKeys:me,setSelectionRows:B,getSpan:mt,getStickyLeft:ft,getStickyRight:gt,scrollXToColumn:bt,scrollYToRecord:yt,rowInViewport:vt,setPagination:de,setPingLeft:Re,setPingRight:Oe,setSpinning:Ce,setFullScreen:ke,setShouldToTop:W,setOverlay:Z,doFieldValidate:Ht,createTableData:It,createGroupData:_t,findParentRowKeys:At,getAllChildRowKeys:kt,triggerScrollYEvent:Vt,scrollBottomDebouncer:Ut,resetTableScroll:Et,clearTableSorter:jt,clearTableFilter:zt,clearSuperFilters:Bt,clearRowSelection:Wt,clearRowHighlight:Gt})),[e,S,Me,Ke,Ue,je,ze,re,te,ne,be,Ye,We,Be,dt,we,Ne,ce,ut,ue,he,fe,He,_e,Pe,Ze,Xe,Ae,ct,Ge,st,it,Fe,ot]);((e,a)=>{const{getRowKey:r,tableProps:l,tableRef:n,toolBoxRef:i,flattenColumns:o,editableColumns:s,pagination:c,fetchParams:d,selectionKeys:u,rowExpandedKeys:p,highlightKey:h,isFetch:f,dataChange:g,getTableData:b,handleTableData:y,createTableData:v,calcTableHeight:x,scrollXToColumn:E,scrollYToRecord:C,doFieldValidate:S,setHandleState:w,setSelectionKeys:T,setRowExpandedKeys:N,setHighlightKey:I,setSelectionRows:_,forceUpdate:R,getTableLog:P,clearRowSelection:O,clearRowHighlight:A,clearTableSorter:k,clearTableFilter:H,clearSuperFilters:F,clearTableLog:L}=a,{columns:q,columnsChange:D}=l,$=(e,t,a)=>{for(let l=0;l<e.length;l++){const n=e[l],i=r(n,n.index);Array.isArray(n.children)&&$(n.children,t,a),t.includes(i)&&(null==a||a(n,i),e.splice(l,1),l-=1)}};t().useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{x()},DO_REFRESH:async e=>{f&&(await b(),null==e||e())},GET_LOG:()=>P(),GET_FETCH_PARAMS:()=>{const e={};for(const t in d)Object.keys(c).includes(t)||(e[t]=d[t]);return e},CLEAR_TABLE_DATA:()=>{f||(O(),A(),k(),H(),F(),L(),v([]))},CLEAR_LOG:()=>{L()},FORCE_UPDATE:()=>{R()},DO_EXPORT:()=>{i.current.exportHandle()},SCROLL_TO_RECORD:e=>{C(e)},SCROLL_TO_COLUMN:e=>{E(e)},SET_SELECTION:e=>{T(e)},SET_HIGHLIGHT:e=>{I(e)},SET_EXPANDABLE:e=>{N(e)},SET_SELECTION_ROWS:e=>{_(e)},SET_TABLE_DATA:e=>{y(e)},SET_TABLE_COLUMN:(e,t,a)=>{const r=q.filter((e=>!e.noAuth)),l=r.find((t=>t.dataIndex===e));if(!l)return m("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!(0,Y.Kn)(t))return m("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");for(const e in t)e&&(0,Y.t8)(l,e,t[e]);a&&(D?D(r):m("Table","需要设置 `columnsChange` 参数"))},INSERT_RECORDS:(e,t)=>{const{store:a,tableFullData:l}=n.current,i=(Array.isArray(e)?e:[e]).filter((e=>(0,Y.Kn)(e)));if(!i.length)return;i.forEach((e=>{o.forEach((t=>{const{dataIndex:a}=t;[ci.expandableColumn,ci.selectionColumn,ci.operationColumn].includes(a)||(0,ii.dN)(e,a,(0,ii.C_)(e,a))})),a.addToInserted(e)}));const s="before"===(null==t?void 0:t.mode),c=void 0===(null==t?void 0:t.parentRowKey);let d=l;if(c)d=s?[...i,...d]:d.concat(i);else{const e=(0,ii.ZJ)(l,(e=>t.parentRowKey===r(e,e.index)));e&&(Array.isArray(e.children)?s?e.children.unshift(...i):e.children.push(...i):e.children=i)}v(d),c&&w(Object.assign({},n.current.handleState,{insert:s?"before":"after"})),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:a}=n.current,l=(Array.isArray(e)?e:[e]).map((e=>(0,Y.Kn)(e)?r(e,e.index):e));if(!l.length)return;let i=!1;$(a,l,((e,a)=>{t.addToRemoved(e),s.forEach((r=>{const{dataIndex:l,editRender:n}=r,i=null==n?void 0:n(e,r);if(!i)return;const{rules:o=[],disabled:s}=i;!s&&o.length&&(t.removeFromRequired({x:a,y:l}),t.removeFromValidate({x:a,y:l}),t.removeFromEdited({x:a,y:l}))})),i=!0})),i&&(v(a),T(u.filter((e=>!l.includes(e)))),l.includes(h)&&A(),N(p.filter((e=>!l.includes(e)))),w(Object.assign({},n.current.handleState,{remove:!0})),g())},VALIDATE_FIELDS:e=>{n.current.allTableData.forEach((t=>{s.forEach((a=>{const{dataIndex:l,editRender:n}=a,i=null==n?void 0:n(t,a);if(!i)return;const o=r(t,t.index);if(e&&!e.includes(o))return;const{rules:s=[],disabled:c}=i;!c&&s.length&&S(s,(0,ii.C_)(t,l),o,l)}))}));const{required:t,validate:a}=P(),l=[...t,...a];return l.length&&C(l[0].rowKey),R(),{required:t,validate:a}}})))})(a,{getRowKey:P,tableProps:e,tableRef:O,toolBoxRef:I,flattenColumns:Me,editableColumns:Ke,pagination:ce,fetchParams:ut,selectionKeys:ue,rowExpandedKeys:he,highlightKey:fe,isFetch:He,dataChange:Lt,getTableData:Tt,handleTableData:Nt,createTableData:It,calcTableHeight:xt,scrollXToColumn:bt,scrollYToRecord:yt,doFieldValidate:Ht,setHandleState:j,setSelectionKeys:pe,setRowExpandedKeys:me,setHighlightKey:ge,setSelectionRows:B,forceUpdate:R,getTableLog:Ft,clearRowSelection:Wt,clearRowHighlight:Gt,clearTableSorter:jt,clearTableFilter:zt,clearSuperFilters:Bt,clearTableLog:Yt}),t().useEffect((()=>{ni.register(O.current.uid,a??{current:null})}),[]);const Qt=se("table"),Jt={[`${Qt}--wrapper`]:!0,[`${Qt}--lg`]:"large"===S,[`${Qt}--sm`]:"small"===S,[`${Qt}--maximize`]:Ae,[c]:!!c},ea={[Qt]:!0,"is--border":Ye,"is--striped":o,"is--fixed":Ue.length||je.length,"is--sortable":Ze,"is--filterable":Xe,"is--head-group":Ge,"is--merge-cell":ot,"is--empty":ct,"show--head":E,"show--foot":We,"ping--left":_e,"ping--right":Pe,"scroll--x":we,"scroll--y":Ne};return t().createElement(Wn.Provider,{value:Xt},t().createElement("div",{className:oe()(Jt)},g&&t().createElement("div",{ref:w,className:`${Qt}-top`},t().createElement("div",{className:`${Qt}-top__space`},"bottom"!==(null==h?void 0:h.position)&&t().createElement(vi,{total:ce.total}),t().createElement("div",{className:`${Qt}-top__space-slot`,style:{justifyContent:ri[f]}},e.children)),t().createElement("div",{className:`${Qt}-top__actions`},t().createElement(ho,{ref:I,showFullScreen:b,showReload:y&&He,showPrint:ve.print&&!!u,showImport:ve.import&&tt,showExport:ve.export&&!!p,showClipboard:at,showCollection:et,showFastSearch:lt,showSuperSearch:rt,showGroupSummary:nt,showToolBox:v,tableColumns:$e}),x&&t().createElement(mo,{columns:n}))),t().createElement(Qe,{spinning:i??Ee},t().createElement("div",{ref:T,className:oe()(ea),style:ht},t().createElement("div",{className:`${Qt}--main-wrapper`},E&&t().createElement(So,{tableColumns:$e,flattenColumns:Me,sorter:re,filters:te}),t().createElement(qo,{ref:N,tableData:J,flattenColumns:Me}),We&&t().createElement(Do,{summationRows:dt,flattenColumns:Me})),Ye&&t().createElement("div",{className:`${Qt}--border-line`}),ct&&t().createElement(Ko,null),s&&t().createElement("div",{ref:_,className:`${Qt}--resizable-bar`}))),qe&&t().createElement(Mo,Vo({},ce,{config:d,onChange:(e,t)=>Kt({current:e,pageSize:t})}))))}));Uo.defaultProps={columns:[],dataSource:[],rowKey:"id",border:!0,resizable:!0,showHeader:!0,ellipsis:!0,multipleSort:!0,topSpaceAlign:"right",showFullScreen:!0,showRefresh:!0,showClipboard:!0,showSelectCollection:!0,showSuperSearch:!0,showFastSearch:!0,showGroupSummary:!0,showColumnDefine:!0,showTableInfo:!0},Uo.displayName="Table";const jo=Uo,zo=jo;function Bo(){return Bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Bo.apply(this,arguments)}const Wo=e=>{var a;const{uniqueKey:r,multiple:n,initialValue:i,selectionRows:o,defaultSelectedKeys:s=[],filters:c=[],table:u={},onClose:p}=e,{size:h}=t().useContext(l),m=t().useMemo((()=>e.size??h??""),[e.size,h]),f=t().useRef(null),g=t().useRef(null),b=t().useRef(null),y=Ln(f),[v,x]=t().useState(u),[E,C]=t().useState(),[S,w]=t().useState(s),[T,N]=t().useState(!1),[I,_]=t().useState(300),[R,P]=t().useState(c),[O,A]=t().useState([{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t().createElement("span",null,e+1)},...u.columns||[]]),[k,H]=t().useState((0,ca.merge)({},null===(a=u.fetch)||void 0===a?void 0:a.params,i)),[F,L]=t().useState([]),q=()=>{const e=f.current,t=e.querySelector(".form-wrap");_(e.offsetHeight-t.offsetHeight-2*Oa[m]-30)},D=(0,Y.Ds)(q,5);Se((()=>{D()}),[y.width]),Se((()=>{(0,ca.isEqual)(c,R)||P(c)}),[c]),t().useEffect((()=>{$()}),[k]),t().useEffect((()=>{o&&b.current.SET_SELECTION_ROWS(o)}),[o]),t().useEffect((()=>{var e;i&&(null===(e=g.current)||void 0===e||e.SET_FIELDS_VALUE(i))}),[]);const $=async()=>{const{webPagination:e,fetch:t}=v;if(!e||null==t||!t.api)return;const{api:a,dataKey:r,beforeFetch:l=Y.XT}=t;if(l(k)){N(!0);try{const e=await a(k);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,r)??[];w([]),await(0,Y._v)(0),L(t)}}catch(e){}N(!1)}},M=e=>{n||(C(e),p(e))},K=e=>{H(Object.assign({},k,e))},V=se("search-helper"),U=v.webPagination?{dataSource:F,loading:T,webPagination:!0}:{fetch:{...v.fetch,params:k}};return t().createElement("div",{ref:f,className:`${V}--wrapper`},t().createElement("div",{className:"form-wrap"},R.length?t().createElement(Zl,{ref:g,items:R,uniqueKey:r?`helper_${r}`:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>P(e),onCollapse:()=>q(),onFinish:e=>K(e),onReset:async()=>{const[e,t]=await g.current.GET_FORM_DATA();e||K(t)}}):null),t().createElement("div",null,t().createElement(zo,Bo({ref:b,height:I,columns:O,rowKey:v.rowKey||"pageIndex"},U,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectedRowKeys:S,onChange:(e,t)=>{w(e),C(n?t:t[0])}},columnsChange:e=>A(e),onRowDblclick:M,onRowEnter:M}))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Oa[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(J,{onClick:()=>p(null),style:{marginRight:8}},d("qm.dialog.cancel")),t().createElement(J,{type:"primary",disabled:!E,onClick:()=>p(E,n?S:void 0)},d("qm.dialog.confirm"))))};Wo.displayName="SearchHelper";const Go=Wo;function Yo(){return Yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Yo.apply(this,arguments)}const Zo=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Zo(e.children)),e.children&&t.push(e.value)})),t},Xo=(e,t)=>{let a=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(a=Xo(e[r].children,t)),a)return a;if(t(e[r]))return e[r]}return a},Qo=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&Qo(e.children,t),t(e)||e.children&&e.children.length))),Jo=e=>{var a;const{uniqueKey:r,multiple:n,initialValue:i,selectionRows:o,defaultSelectedKeys:s=[],filters:c=[],table:u={},tree:p={},onClose:h}=e,{size:f}=t().useContext(l),g=t().useMemo((()=>e.size??f??""),[e.size,f]),b=t().useRef(null),y=t().useRef(null),v=t().useRef(null),x=Ln(b),[E,C]=t().useState(u),[S,w]=t().useState(),[T,I]=t().useState(s),[_,R]=t().useState(!1),[P,O]=t().useState(300),[A,k]=t().useState(300),[H,F]=t().useState(c),[L,q]=t().useState([{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t().createElement("span",null,e+1)},...u.columns||[]]),[D,$]=t().useState((0,ca.merge)({},null===(a=u.fetch)||void 0===a?void 0:a.params,i)),[M,K]=t().useState([]),V=()=>{const e=b.current,t=e.querySelector(".form-wrap"),a=e.querySelector(".input-wrap");O(e.offsetHeight-a.offsetHeight-10),k(e.offsetHeight-t.offsetHeight-2*Oa[g]-30)},U=(0,Y.Ds)(V,5);Se((()=>{U()}),[x.width]),Se((()=>{(0,ca.isEqual)(c,H)||F(c)}),[c]),t().useEffect((()=>{j()}),[D]),t().useEffect((()=>{o&&v.current.SET_SELECTION_ROWS(o)}),[o]),t().useEffect((()=>{var e;i&&(null===(e=y.current)||void 0===e||e.SET_FIELDS_VALUE(i)),re()}),[]);const j=async()=>{const{webPagination:e,fetch:t}=E;if(!e||null==t||!t.api)return;const{api:a,dataKey:r,beforeFetch:l=Y.XT}=t;if(l(D)){R(!0);try{const e=await a(D);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,r)??[];I([]),await(0,Y._v)(0),K(t)}}catch(e){}R(!1)}},z=e=>{n||(w(e),h(e))},B=e=>{$(Object.assign({},D,e))},[W,G]=t().useState([]),[Z,X]=t().useState([]),[Q,ee]=t().useState(""),te=t().useRef(W),ae=t().useRef([]);Se((()=>{X(Zo(W))}),[W]);const re=async()=>{if(!p.fetch)return;const{api:e,params:t,dataKey:a,valueKey:r="value",textKey:l="text"}=p.fetch;try{const n=await e(t);if(200===n.code){const e=Array.isArray(n.data)?n.data:(0,ca.get)(n.data,a)??[],t=la(e,r,l);G(t),te.current=t,ae.current=e}}catch(e){}},le=e=>`${e}|${Xr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ne=se("tree-table-helper"),ie=E.webPagination?{dataSource:M,loading:_,webPagination:!0}:{fetch:{...E.fetch,params:D}};return t().createElement("div",{ref:b,className:`${ne}--wrapper`},t().createElement(Me,{defaultValue:200,style:{height:"100%"}},t().createElement(Me.Pane,{min:100,style:{overflowY:"auto"}},t().createElement(N.Input.Search,{className:"input-wrap",value:Q,style:{marginBottom:8},placeholder:d("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{const t=Qo(te.current,(t=>{if(!e)return!0;const a=t.text||"";return-1!==le(a).indexOf(e)}));ee(e),G(t)})(e.target.value)}),t().createElement(N.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:P,defaultExpandAll:!0,expandedKeys:Z,treeData:W,filterTreeNode:e=>{if(!Q)return!1;const t=e.text||"";return-1!==le(t).indexOf(Q)},onExpand:e=>{X(e)},onSelect:e=>{const{valueKey:t="value"}=p.fetch;(e=>{if(!p.tableParamsMap)return m("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof p.tableParamsMap?p.tableParamsMap():p.tableParamsMap,a={};for(const r in t)a[r]=(0,ca.get)(e,t[r]);B(a)})(Xo(ae.current,(a=>(0,ca.get)(a,t)===e[0]))||{})}})),t().createElement(Me.Pane,{className:"split-pane"},t().createElement("div",{className:"form-wrap"},H.length?t().createElement(Zl,{ref:y,items:H,uniqueKey:r?`helper_${r}`:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>F(e),onCollapse:()=>V(),onFinish:e=>B(e),onReset:async()=>{const[e,t]=await y.current.GET_FORM_DATA();e||B(t)}}):null),t().createElement("div",null,t().createElement(zo,Yo({ref:v,height:A,columns:L,rowKey:E.rowKey||"pageIndex"},ie,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectedRowKeys:T,onChange:(e,t)=>{I(e),w(n?t:t[0])}},columnsChange:e=>q(e),onRowDblclick:z,onRowEnter:z}))))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Oa[g]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(J,{onClick:()=>h(null),style:{marginRight:8}},d("qm.dialog.cancel")),t().createElement(J,{type:"primary",disabled:!S,onClick:()=>h(S,n?T:void 0)},d("qm.dialog.confirm"))))};Jo.displayName="TreeTableHelper";const es=Jo,ts=e=>{var a,r,n;const{multiple:i,tree:o={},defaultSelectedKeys:s,onClose:c}=e,{size:u}=t().useContext(l),p=t().useMemo((()=>e.size??u??""),[e.size,u]),[h,m]=t().useState(),[f]=t().useState(null===(a=o.fetch)||void 0===a?void 0:a.params),g=se("tree-helper"),b=o.fetch?{...G()(o.fetch,["params","valueKey","textKey"]),params:f}:void 0;return t().createElement("div",{className:`${g}--wrapper`},t().createElement(Bn,{multiple:i,fetch:b,fieldsDefine:{valueKey:null===(r=o.fetch)||void 0===r?void 0:r.valueKey,textKey:null===(n=o.fetch)||void 0===n?void 0:n.textKey},asyncLoad:o.asyncLoad,checkStrictly:o.checkStrictly,checkStrategy:o.checkStrategy,defaultSelectedKeys:s,defaultExpandAll:o.defaultExpandAll,onSelectChange:e=>m(e),onCheckChange:e=>m(e)}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Oa[p]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(J,{onClick:()=>c(null),style:{marginRight:8}},d("qm.dialog.cancel")),t().createElement(J,{type:"primary",disabled:!h,onClick:()=>c(h)},d("qm.dialog.confirm"))))};ts.displayName="TreeHelper";const as=ts;function rs(){return rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},rs.apply(this,arguments)}const ls="_startSign",ns="_endSign",is=e=>{var a;const{uniqueKey:r,initialValue:n,filters:i=[],table:o={},onClose:s}=e,{size:c}=t().useContext(l),u=t().useMemo((()=>e.size??c??""),[e.size,c]),p=t().useRef(null),h=t().useRef(null),m=t().useRef(null),f=Ln(p),[g,b]=t().useState(o),[y,v]=t().useState(!1),[x,E]=t().useState([]),[C,S]=t().useState(300),[w,T]=t().useState(i),[I,_]=t().useState([{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t().createElement("span",null,e+1)},{title:d("qm.form.rangeSearchHelper")[0],dataIndex:ls,width:80,align:"right",render:(e,a)=>t().createElement("span",{className:"icon-sign"},e)},...o.columns||[],{title:d("qm.form.rangeSearchHelper")[1],dataIndex:ns,fixed:"right",width:80,render:(e,a)=>t().createElement("span",{className:"icon-sign"},e)}]),[R,P]=t().useState((0,ca.merge)({},null===(a=o.fetch)||void 0===a?void 0:a.params,n)),[O,A]=t().useState([]),k=t().useMemo((()=>x.map((e=>null==e?void 0:e.pageIndex))),[x]),H=t().useMemo((()=>2===k.length&&k.every((e=>void 0!==e))),[k]),F=()=>{const e=p.current.parentNode.children[0],t=e.querySelector(".form-wrap");S(e.offsetHeight-t.offsetHeight-2*Oa[u]-30)},L=(0,Y.Ds)(F,5);Se((()=>{L()}),[f.width]),Se((()=>{(0,ca.isEqual)(i,w)||T(i)}),[i]),t().useEffect((()=>{q()}),[R]);const q=async()=>{const{webPagination:e,fetch:t}=g;if(!e||null==t||!t.api)return;const{api:a,dataKey:r,beforeFetch:l=Y.XT}=t;if(l(R)){v(!0);try{const e=await a(R);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,ca.get)(e.data,r)??[];A(t)}}catch(e){}v(!1)}},D=(e,t)=>{delete e[t]},$=()=>{x.forEach((e=>{e&&(D(e,ls),D(e,ns))})),E([])},M=e=>{$(),P(Object.assign({},R,e))},K=se("range-helper"),V=g.webPagination?{dataSource:O,loading:y,webPagination:!0}:{fetch:{...g.fetch,params:R}};return t().createElement("div",{ref:p,className:`${K}--wrapper`},t().createElement("div",{className:"form-wrap"},w.length?t().createElement(Zl,{ref:h,items:w,initialValues:n,uniqueKey:r?`helper_${r}`:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>T(e),onCollapse:()=>F(),onFinish:e=>M(e),onReset:async()=>{const[e,t]=await h.current.GET_FORM_DATA();e||M(t)}}):null),t().createElement("div",null,t().createElement(zo,rs({ref:m,height:C,columns:I,rowKey:g.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=k[0]&&e.pageIndex<=k[1]?{backgroundColor:"#f5f5f5"}:{}},V,{columnsChange:e=>_(e),onRowClick:(e,t)=>{const{dataIndex:a}=t;[ls,ns].includes(a)&&(a===ls&&(e[a]?(D(e,a),E([void 0,x[1]])):e.pageIndex>k[1]?N.message.warning(d("qm.searchHelper.rangeStartTip")):(x[0]&&D(x[0],a),e[a]="[",E([e,x[1]]))),a===ns&&(e[a]?(D(e,a),E([x[0],void 0])):e.pageIndex<k[0]?N.message.warning(d("qm.searchHelper.rangeEndTip")):(x[1]&&D(x[1],a),e[a]="]",E([x[0],e]))),m.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===k[0]&&(e[ls]="["),e.pageIndex===k[1]&&(e[ns]="]")}))}}),t().createElement(J,{type:"primary",icon:t().createElement(ce.ClearOutlined,null),title:d("qm.table.alert.clear"),onClick:()=>$()}))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Oa[u]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(J,{onClick:()=>s(null),style:{marginRight:8}},d("qm.dialog.cancel")),t().createElement(J,{type:"primary",disabled:!H,onClick:()=>s(x.map((e=>(e=>{const t={};for(const a in e)[ls,ns].includes(a)||(t[a]=e[a]);return t})(e))))},d("qm.dialog.confirm"))))};is.displayName="RangeTableHelper";const os=is,ss={previewWidth:1100,defaultDistance:.45,logoHeight:60},cs=(0,e.createContext)(void 0);var ds=null;function us(){try{var e=navigator.userAgent;if(e.match(/Windows\sPhone/i))return!0;if(e.match(/iPhone|iPod|iPad/i))return!0;if(e.match(/Android/i))return!0;if(e.match(/Edge\D?\d+/i))return!0;var t=e.match(/Trident\D?\d+/i),a=e.match(/MSIE\D?\d+/i),r=e.match(/OPR\D?\d+/i),l=e.match(/Firefox\D?\d+/i),n=e.match(/x64/i);if(!t&&!a&&n)return!0;if(l){if((l=l[0].match(/\d+/))[0]>=41||n)return!0}else if(r){if((r=r[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!a){var i=e.match(/Chrome\D?\d+/i);if(i&&(i=i[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function ps(e,t){var a;try{var r=navigator.userAgent,l=!!r.match(/MSIE/i)||!!r.match(/Trident/i);if(us()){try{a=getCLodop()}catch(e){}if(!a&&"complete"!==document.readyState)return void N.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!a)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else if(l&&r.match(/x64/i),e||t?a=l?e:t:ds?a=ds:((a=document.createElement("object")).setAttribute("width",0),a.setAttribute("height",0),a.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),l?a.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):a.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(a),ds=a),!a||!a.VERSION)return r.indexOf("Chrome"),r.indexOf("Firefox"),a;return a.VERSION<"6.2.2.6"&&us(),a}catch(e){N.message.error("getLodop 出错:"+e)}}us();const hs=e=>{const t=e/25.4*(()=>{const e=[],{deviceXDPI:t,deviceYDPI:a}=window.screen;if(t&&a)e[0]=t,e[1]=a;else{var r;let t=document.createElement("DIV");t.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(t),e[0]=parseInt(t.offsetWidth.toString()),e[1]=parseInt(t.offsetHeight.toString()),null===(r=t.parentNode)||void 0===r||r.removeChild(t),t=null}return e})()[0];return Math.ceil(t)},ms=t().forwardRef(((e,a)=>{const{templateRender:r,directPrint:n}=e,{global:i}=t().useContext(l),{$$preview:o}=t().useContext(cs),{state:s,isWindowsPrinter:c,pageSize:d}=o,u=t().useRef(null),p=t().useRef({}),h=t().useRef([]),f=t().useRef([]),g=t().useRef([]),[b,y]=t().useState(!0);t().useImperativeHandle(a,(()=>({createPreviewDom:O,createExportHtml:k,createPrintHtml:A,SHOW_PREVIEW:H,DIRECT_PRINT:F}))),Se((()=>{P()}),[s.form.printerType,s.form.setting.direction,s.form.setting.distance,s.form.setting.fixedLogo]),t().useEffect((()=>{p.current.templateEl=u.current.querySelector(".origin-template").children[0],p.current.previewEl=u.current.querySelector(".workspace")}),[]);const v=t().useMemo((()=>{const{form:{setting:{direction:e}}}=s,t=c?10*ss.defaultDistance+10*ss.defaultDistance:0;return("vertical"===e?d[0]:d[1])-t}),[s,c,d]),x=t().useMemo((()=>{const{form:{setting:{direction:e}}}=s,t=c?10*ss.defaultDistance+10*ss.defaultDistance:0;return("vertical"===e?d[1]:d[0])-t}),[s,c,d]),E=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return hs(v-10*(e.left-ss.defaultDistance)-10*(e.right-ss.defaultDistance))}),[s,v]),C=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return hs(x-10*(e.top-ss.defaultDistance)-10*(e.bottom-ss.defaultDistance))}),[s,x]),S=s.form.scale,w=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return{left:hs(10*e.left),right:hs(10*e.right),top:hs(10*e.top),bottom:hs(10*e.bottom)}}),[s]),T=t().useMemo((()=>{const{form:{printerType:e}}=s,{left:t,right:a,top:r,bottom:l}=w,n=E+t+a,i=ss.previewWidth-n<=0?0:(ss.previewWidth-n)/2,o=Math.abs((1-S)*n/2);let c=0;return S>1&&(c=o>i?-1*i:-1*o),S<1&&(c=n-2*o>ss.previewWidth?0:i>0?o:(ss.previewWidth-(n-2*o))/2),{width:`${E}px`,height:"stylus"===e?"auto":C+"px",paddingLeft:`${t}px`,paddingRight:`${a}px`,paddingTop:`${r}px`,paddingBottom:`${l}px`,transform:`translateX(${c}px) scale(${S})`,opacity:b?0:1}}),[s,b,w,S,C,E]),N=(h.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e))),()=>{var e,t;const a=(null==i||null===(e=i.print)||void 0===e?void 0:e.leftLogo)??"",r=(null==i||null===(t=i.print)||void 0===t?void 0:t.rightLogo)??"";return[`<tr style="height: ${ss.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',a?`<img src="${a}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',r?`<img src="${r}" border="0" height="46" />`:"","</td>","</tr>"].join("")}),I=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},_=()=>{let e=document.createElement("tr");var t,a;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=I().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(a=p.current.templateEl.children[0]).children[0]?a.insertBefore(t,a.children[0]):a.appendChild(t),e=null},R=()=>{const e=p.current.templateEl.children[0].children,t=[],a=[];for(let r=0;r<e.length;r++){if("template-cols"===e[r].getAttribute("type"))continue;const l=e[r].clientHeight;e[r].style.height=l+"px",a.push(l),t.push(e[r].outerHTML)}f.current=a,h.current=t},P=()=>{if(!h.current.length)return;const{form:{setting:e,printerType:t}}=s;if(n)return g.current.push([I(),N(),...h.current]);const a=e.fixedLogo?C-ss.logoHeight:C;let r=[];if(g.current=[],"stylus"===t)g.current.push([I(),...e.fixedLogo?[N()]:[],...h.current]);else{let t=0;for(let l=0,n=f.current.length;l<n;l++){const i=h.current[l],o=f.current[l];e.fixedLogo||0!==l||(t+=ss.logoHeight),t+=o,t<=a?r.push(i):(g.current.push([I(),...e.fixedLogo?[N()]:[],...r]),r=[],t=0,l-=1),l===n-1&&r.length&&g.current.push([I(),...e.fixedLogo?[N()]:[],...r])}}var l;e.fixedLogo||null===(l=g.current[0])||void 0===l||l.splice(1,0,N());for(let e=0,t=g.current.length;e<t&&e!==t-1;e++)g.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');o.setState({currentPage:1,totalPage:g.current.length}),O()},O=()=>{var e;const{currentPage:t}=s;let a=`<table cellspacing="0" cellpadding="0" border="0" class="${p.current.templateEl.className}">`;a+=(null===(e=g.current[t-1])||void 0===e?void 0:e.join(""))??"",a+="</table>",p.current.previewEl.innerHTML=a,p.current.previewEl.parentNode.scrollTop=0},A=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${p.current.templateEl.className}">`;if(void 0!==e)t+=[...g.current[e-1]].join("");else for(let e=0;e<g.current.length;e++)t+=g.current[e].join("");return t+="</table>",t},k=()=>{const e=[];for(let t=0;t<h.current.length;t++)e[t]=h.current[t].replace(/[\r\n]/g,"").replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+N()+I()+e.join("")+"</table>"},H=async()=>{var e;if("TABLE"!==(null===(e=p.current.templateEl)||void 0===e?void 0:e.tagName))return L();p.current.previewEl.innerHTML||(_(),await(0,Y._v)(0),R(),P(),y(!1))},F=async()=>{var e;if("TABLE"!==(null===(e=p.current.templateEl)||void 0===e?void 0:e.tagName))return L();_(),await(0,Y._v)(0),R(),P(),y(!1),o.doPrint(A()),await(0,Y._v)(0),o.doClose()},L=()=>{m("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},q={[se("print-container")]:!0,"no-visible":n};return t().createElement("div",{ref:u,className:oe()(q)},t().createElement(Qe,{wrapperClassName:"spin",spinning:b,tip:"Loading..."},t().createElement("div",{className:"preview"},t().createElement("div",{className:"origin-template",style:{width:`${E}px`,marginLeft:`-${Math.floor(E/2)}px`}},null==r?void 0:r()),t().createElement("div",{className:"workspace",style:T}))))}));ms.displayName="Container";const fs=ms;function gs(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class bs extends e.Component{constructor(){super(...arguments),gs(this,"formRef",t().createRef()),gs(this,"createFormList",(()=>[{type:"DIVIDER",fieldName:"_1",label:d("qm.print.setPanel.printParameter")},{type:"SELECT",label:d("qm.print.setPanel.pagerType"),fieldName:"pageSize",options:{itemList:[{text:"A2",value:"420*594"},{text:"A3",value:"420*297"},{text:"A4",value:"210*297"},{text:"A5",value:"210*148"},{text:d("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:d("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:d("qm.print.setPanel.vertical"),value:"vertical"},{text:d("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:d("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:d("qm.print.setPanel.manualDoublePrint"),value:"manual"}]},disabled:!this.props.setting.doubleSide},options:{trueValue:1,falseValue:0},onChange:e=>{const{formList:t}=this.state;t.find((e=>"doubleSide"===e.fieldName)).label.disabled=!e,this.setState({formList:t})}},{type:"CHECKBOX",label:d("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:d("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:d("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:ss.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:d("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:d("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:ss.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:d("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:d("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:ss.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:d("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:d("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:ss.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:d("qm.print.setPanel.noEmpty")}]}])),gs(this,"getInitialvalue",(()=>{const{setting:e}=this.props,{distance:t}=e;return Object.assign({},{disleft:t.left,disright:t.right,distop:t.top,disbottom:t.bottom,pageSize:e.pageSize,direction:e.direction,doubleSide:e.doubleSide,doubleSideType:e.doubleSideType,fixedLogo:e.fixedLogo})})),gs(this,"getInitialExtra",(()=>({disleft:d("qm.print.setPanel.sizeUnit"),disright:d("qm.print.setPanel.sizeUnit"),distop:d("qm.print.setPanel.sizeUnit"),disbottom:d("qm.print.setPanel.sizeUnit")}))),gs(this,"state",{formList:this.createFormList()}),gs(this,"confirmHandle",(async()=>{const[e,t]=await this.formRef.current.GET_FORM_DATA();e||(this.props.onChange({distance:{left:t.disleft,right:t.disright,top:t.distop,bottom:t.disbottom},pageSize:t.pageSize,direction:t.direction,doubleSide:t.doubleSide,doubleSideType:t.doubleSideType,fixedLogo:t.fixedLogo}),this.cancelHandle())})),gs(this,"cancelHandle",(()=>{this.props.onClose()}))}render(){const{formList:e}=this.state;return t().createElement(t().Fragment,null,t().createElement(Zl,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t().createElement(J,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},d("qm.dialog.close")),t().createElement(J,{type:"primary",onClick:()=>this.confirmHandle()},d("qm.dialog.confirm"))))}}gs(bs,"contextType",l);const ys=bs;function vs(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class xs extends e.Component{constructor(){var e,a,r;super(...arguments),vs(this,"provide",{$$preview:this}),vs(this,"containRef",t().createRef()),vs(this,"state",{visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(a=this.props.defaultConfig)||void 0===a?void 0:a.copies)||1,scale:1,setting:{distance:{left:ss.defaultDistance,right:ss.defaultDistance,top:ss.defaultDistance,bottom:ss.defaultDistance},pageSize:"210*297",direction:(null===(r=this.props.defaultConfig)||void 0===r?void 0:r.direction)||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0}),vs(this,"pageChangeHandle",(e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))})),vs(this,"exportClickHandle",(()=>{this.doExport(this.containRef.current.createExportHtml())})),vs(this,"printClickHandle",(async()=>{if(this.doPrint(this.containRef.current.createPrintHtml(this.state.printPage)),this.props.uniqueKey)try{const e={...this.state.form,printerName:this.printerItems.find((e=>e.value===this.state.form.printerName)).text};await Qi().setItem(this.printerKey,e),await this.savePrintConfig(this.printerKey,e)}catch(e){}})),vs(this,"doClose",(()=>{var e,t;null===(e=(t=this.props).onClose)||void 0===e||e.call(t)})),vs(this,"getPrintConfig",(async e=>{const t=this.context.global,a=null==t?void 0:t.getComponentConfigApi;if(a)try{const t=await a({key:e});if(200===t.code)return t.data}catch(e){}})),vs(this,"savePrintConfig",(async(e,t)=>{const a=this.context.global,r=null==a?void 0:a.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}})),vs(this,"createStyle",(()=>'\n <style type="text/css">\n table {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n table-layout: fixed;\n }\n table tr td {\n padding: 2px;\n line-height: 1.2;\n word-wrap: break-word;\n }\n .fs12 {\n font-size: 12px;\n }\n .fs13 {\n font-size: 13px;\n }\n .fs14 {\n font-size: 14px;\n }\n .fw500 {\n font-weight: 500;\n }\n .fw700 {\n font-weight: 700;\n }\n .fl {\n float: left;\n }\n .fr {\n float: right;\n }\n .tc {\n text-align: center;\n }\n .tr {\n text-align: right;\n }\n .bor {\n border: 1px solid #000;\n }\n .bor-t {\n border-top: 1px solid #000;\n }\n .bor-b {\n border-bottom: 1px solid #000;\n }\n .bor-l {\n border-left: 1px solid #000;\n }\n .bor-r {\n border-right: 1px solid #000;\n }\n .no-bor {\n border: none !important;\n }\n </style>\n ')),vs(this,"doPrint",(e=>{const t=ps();if(!t)return;const{uniqueKey:a,closeAfterPrint:r}=this.props,{form:{setting:l,printerName:n,printerType:i,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:c}=ss,{left:u,right:p,top:h,bottom:m}=l.distance;t.PRINT_INIT(a??Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(n),t.SET_PRINT_COPIES(o),l.doubleSide&&("auto"===l.doubleSideType?(t.SET_PRINT_MODE("PRINT_DUPLEX",2),t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1)):t.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",1)),t.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1),"laser"===i&&("vertical"===l.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===l.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===i&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*m*2,""),t.ADD_PRINT_TABLE(10*(h-c)+"mm",10*(u-c)+"mm",`RightMargin: ${10*(p-c)}mm`,`BottomMargin: ${"stylus"!==i?10*(m-c):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?r&&this.doClose():N.message.error(d("qm.print.printError"))},t.PRINT()})),vs(this,"doExport",(e=>{const t=ps();if(!t)return;const{uniqueKey:a,closeAfterPrint:r}=this.props,{form:{setting:l}}=this.state;t.PRINT_INIT(a??Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?r&&this.doClose():N.message.error(d("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===l.direction?1:2),t.SAVE_TO_FILE(`${i()().format("YYYYMMDDHHmmss")}.xlsx`)}))}get printerTypeItems(){return[{text:d("qm.print.laserPrinter"),value:"laser"},{text:d("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=ps(),t=[{text:d("qm.print.defaultPrinter"),value:-1}];try{const a=e.GET_PRINTER_COUNT();for(let r=0;r<a;r++)t.push({text:e.GET_PRINTER_NAME(r),value:r})}catch(e){m("Print","[ClientPrint]: 请安装 LODOP 打印插件")}return t}get isWindowsPrinter(){const{form:{printerName:e}}=this.state;return!/OneNote|Microsoft|Fax/.test(this.printerItems.find((t=>t.value===e)).text)}get pageSize(){return this.state.form.setting.pageSize.split("*").map((e=>Number(e)))}get printerKey(){return this.props.uniqueKey?`print_${this.props.uniqueKey}`:""}async componentDidMount(){if(this.props.uniqueKey)try{let t=await Qi().getItem(this.printerKey);var e;t||(t=await this.getPrintConfig(this.printerKey),(0,Y.Kn)(t)&&await Qi().setItem(this.printerKey,t)),(0,Y.Kn)(t)&&Object.keys(t).length&&(0,ca.merge)(this.state.form,{...t,printerName:(null===(e=this.printerItems.find((e=>e.text===t.printerName)))||void 0===e?void 0:e.value)??-1})}catch(e){}}render(){const{preview:e,templateRender:a}=this.props,{visible:r,form:l,currentPage:n,totalPage:i,printPage:o}=this.state,s=se("print-preview"),c={visible:r,title:d("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},u={[s]:!0};return e?t().createElement(t().Fragment,null,t().createElement("div",{className:oe()(u)},t().createElement("div",{className:"outer"},t().createElement("div",{className:"header"},t().createElement("span",null,d("qm.print.printer"),":",t().createElement(N.Select,{value:l.printerName,onChange:e=>{this.setState((t=>(0,ca.merge)({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",null,d("qm.print.type"),":",t().createElement(N.Select,{value:l.printerType,onChange:e=>{this.setState((t=>(0,ca.merge)({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>t().createElement(N.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",null,d("qm.print.copies"),":",t().createElement(N.InputNumber,{value:l.copies,min:1,precision:0,onChange:e=>{this.setState((t=>(0,ca.merge)({},t,{form:{copies:e??1}})))},style:{width:"50px"}})),t().createElement("span",null,d("qm.print.printPage.0"),t().createElement(N.InputNumber,{value:o,min:1,max:i,precision:0,onChange:e=>{this.setState({printPage:e??void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),d("qm.print.printPage.1")),t().createElement("span",null,t().createElement(N.Pagination,{size:"small",current:n,pageSize:1,total:i,onChange:this.pageChangeHandle})),t().createElement("span",null,t().createElement(J,{type:"text",icon:t().createElement(ce.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},d("qm.print.setting"))),t().createElement("span",null,t().createElement(J,{type:"text",icon:t().createElement(ce.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},d("qm.print.export"))),t().createElement("span",null,t().createElement(J,{icon:t().createElement(ce.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},d("qm.print.print")))),t().createElement("div",{className:"main"},t().createElement(cs.Provider,{value:this.provide},t().createElement(fs,{ref:this.containRef,templateRender:a,directPrint:!1}))),t().createElement("div",{className:"footer"},t().createElement("span",null,d("qm.print.scale"),":",t().createElement(N.Slider,{value:l.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>(0,ca.merge)({},t,{form:{scale:e}})))}}),t().createElement("em",{className:"scale-text"},`${Math.floor(100*l.scale)}%`)),t().createElement("span",null,d("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),t().createElement("span",null,d("qm.print.pageNumber"),":",d("qm.print.pagination",{currentPage:n,totalPage:i}))))),t().createElement(At,c,t().createElement(ys,{setting:l.setting,onChange:e=>{this.setState((t=>(0,ca.merge)({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):t().createElement(cs.Provider,{value:this.provide},t().createElement(fs,{ref:this.containRef,templateRender:a,directPrint:!0}))}}vs(xs,"contextType",l);const Es=xs;function Cs(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Ss extends e.Component{constructor(){super(...arguments),Cs(this,"previewRef",t().createRef()),Cs(this,"state",{visible:!1,loading:!1}),Cs(this,"clickHandle",(async()=>{this.setState({loading:!0});try{var e,t;const a=await(null===(e=(t=this.props).click)||void 0===e?void 0:e.call(t));if(this.setState({loading:!1}),"boolean"==typeof a&&!a)return;await this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),Cs(this,"createRender",(()=>{const{visible:e}=this.state,{templateRender:a,uniqueKey:r,defaultConfig:l,preview:n,closeAfterPrint:i}=this.props,o={visible:e,title:d("qm.print.preview"),width:`${ss.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},s={ref:this.previewRef,templateRender:a,uniqueKey:r,defaultConfig:l,preview:n,closeAfterPrint:i,onClose:()=>{this.setState({visible:!1})}};return n?t().createElement(At,o,t().createElement(Es,s)):e?t().createElement(Es,s):null})),Cs(this,"DO_PRINT",(async()=>{const{preview:e}=this.props;await(0,Y._v)(0),this.setState({visible:!0}),await(0,Y._v)(e?500:0);const t=this.previewRef.current.containRef.current;e?t.SHOW_PREVIEW():t.DIRECT_PRINT()}))}render(){const{loading:e}=this.state,{size:a,icon:r,type:l,disabled:n,shape:i}=this.props,o={size:a||this.context.size||"",type:l,shape:i,icon:r,loading:e,disabled:n,click:this.clickHandle};return t().createElement(t().Fragment,null,this.props.children&&t().createElement(J,o,this.props.children),this.createRender())}}Cs(Ss,"propTypes",{size:(e,t,a)=>{if(!f(e[t]||""))return h("Print","Invalid prop `"+t+"` supplied to `"+a+"`. Validation failed.")},templateRender:r().elementType}),Cs(Ss,"defaultProps",{preview:!0,type:"primary",icon:t().createElement(ce.PrinterOutlined,null)}),Cs(Ss,"contextType",l);const ws=Ss,Ts="1.5.14"})(),__webpack_exports__})()));