@jiaozhiye/qm-design-react 1.2.0-beta.21 → 1.2.0-beta.22

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,l)=>{l.d(t,{Z:()=>a});const a="undefined"==typeof window},542:(e,t,l)=>{l.d(t,{Ds:()=>n.debounce,HD:()=>n.isString,Kn:()=>n.isPlainObject,M2:()=>c,P2:()=>n.throttle,PM:()=>b,RI:()=>p,U2:()=>n.get,XT:()=>u,Y3:()=>h,Y6:()=>y,ZT:()=>d,_A:()=>f,_v:()=>m,hj:()=>n.isNumber,l$:()=>s,mf:()=>n.isFunction,o8:()=>n.isUndefined,w1:()=>o,xb:()=>g});var a=l(787),r=l.n(a),n=l(517),i=l(386);const o=()=>!i.Z&&/MSIE|Trident/.test(navigator.userAgent),s=e=>r().isValidElement(e),c=e=>s(e)&&e.type===r().Fragment,d=()=>{},u=()=>!0,p=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m=async e=>new Promise((t=>setTimeout(t,e))),h=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),b=e=>(0,n.isNumber)(e)?`${e}px`:e.toString(),y=e=>{try{const t=JSON.parse(window.parent.localStorage.getItem("auths")||"{}");return(0,n.get)(t,e)}catch(e){}}},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,l)=>{l.d(t,{Z:()=>r});const a=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"],r={operations:function(e){const t=e.split(" "),l=[];let r=0;l[r]=[];for(let e=0;e<t.length;e++)a.includes(t[e])?(l[r]=l[r].join(" "),r++,l[r]=[]):l[r].push(t[e]);return l[r]=l[r].join(" "),l},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 l=0,a=(e=Array.isArray(e)?e:[e]).length;l<a;l++)t+="number"==typeof e[l]?e[l]:"'"+e[l]+"'",l<a-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,l){return e.split(t).join(l)},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,l)=>{l.d(t,{D:()=>s});const a=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,r=["string","number","boolean","symbol"],n=e=>r.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(a,"\\$1"),"i"),s=(e,t,l)=>{e=e??"";let a=!0;switch(t){case"like":a=null!==e.toString().match(o(l));break;case"likes":a=l.split(/,|,/).some((t=>null!==e.toString().match(o(t))));break;case"in":n(l)&&(l=[l]),Array.isArray(l)&&(a=Array.isArray(e)?l.every((t=>e.includes(t))):l.includes(e));break;case"nin":n(l)&&(l=[l]),Array.isArray(l)&&(a=!(Array.isArray(e)?l.some((t=>e.includes(t))):l.includes(e)));break;case"!=":case"<>":a=(i(e)?e.slice(0,10):e)!=l;break;case"<":a=(i(e)?e.slice(0,10):e)<l;break;case"<=":a=(i(e)?e.slice(0,10):e)<=l;break;case">":a=(i(e)?e.slice(0,10):e)>l;break;case">=":a=(i(e)?e.slice(0,10):e)>=l;break;default:a=(i(e)?e.slice(0,10):e)==l}return a}},704:(e,t,l)=>{l.d(t,{Z:()=>r});const a=["==","<",">","<=",">=","!=","like","likes","in","nin"],r={isBracketBalance:function(e){let t=0;const l=e.length;for(let a=0;a<l;a++){const l=e.charAt(a);"("===l&&t++,")"===l&&t--}return 0===t},replace_variables:function(e,t){let l="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?l+=" "+e[t]+" ":l+=e[t];const r=l.split(" ").filter((e=>""!==e));for(let e=0;e<r.length;e++)a.includes(r[e])&&("this"!=r[e-1]?r[e-1]=t+"."+r[e-1]:r[e-1]=t),a.includes(r[e])&&(r.splice(e-1,3,`__query__(${r[e-1]}, '${r[e]}', ${r[e+1]})`),e-=2);return r.join(" ")}}},353:(e,t,l)=>{l.d(t,{CD:()=>g,C_:()=>S,EJ:()=>x,HG:()=>s,J1:()=>c,MY:()=>f,Nl:()=>q,Ps:()=>p,Qi:()=>F,RI:()=>i.RI,SX:()=>P,TQ:()=>A,W2:()=>O,_3:()=>I,bY:()=>C,dN:()=>w,e5:()=>E,gU:()=>h,gn:()=>R,p6:()=>N,t2:()=>m,tL:()=>b,tj:()=>v,uf:()=>T,v9:()=>k,vo:()=>y,wE:()=>_,y1:()=>u});var a=l(517),r=l(635),n=l.n(r),i=l(542),o=l(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 l=null;for(let a=0;a<e.length;a++){if(e[a].children&&(l=p(e[a].children,t)),l)return l;if(e[a].dataIndex===t)return e[a]}return l},m=e=>{const t=e.children;return t?t[0].children?m(t[0]):t[0]:e},h=e=>{const t=e.children;return t?t[t.length-1].children?h(t[t.length-1]):t[t.length-1]:e},f=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),g=(e,t)=>{let l=null;for(let a=0;a<e.length;a++){if(e[a].children&&(l=g(e[a].children,t)),l)return l;if(e[a].rowKey===t)return e[a]}return l},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 l=(e,a)=>{if(a&&(e.level=a.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((a=>{e.fixed?a.fixed=e.fixed:delete a.fixed,l(a,e),t+=a.colSpan})),e.colSpan=t}else e.colSpan=e.colSpan??1};e.forEach((e=>{e.level=1,l(e,null)}));const a=[];for(let e=0;e<t;e++)a.push([]);return d(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,a[e.level-1].push(e)})),a},v=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){const a=e.parentNode;if(l.top+=e.offsetTop,l.left+=e.offsetLeft,a&&a!==document.documentElement&&a!==document.body&&(l.top-=a.scrollTop,l.left-=a.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return v(e.offsetParent,t,l)}return l},x=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,E=(e,t)=>(0,a.transform)(e,((e,l,r)=>{(0,a.isEqual)(l,t[r])||(e[r]=(0,i.Kn)(l)&&(0,i.Kn)(t[r])?E(l,t[r]):l)})),C=(e,t)=>(0,a.intersection)(e,t).length===t.length,S=(e,t)=>(0,a.get)(e,t)??"",w=(e,t,l,r)=>{l=l??"",r>=0&&""!==l&&(l=Number(l).toFixed(r)),(0,a.set)(e,t,l)},T=e=>{const t=(e=e.toString()).split("."),l="-"===t[0].charAt(0)?"-":"";let a=l?t[0].slice(1):t[0],r="";for(;a.length>3;)r=`,${a.slice(-3)}${r}`,a=a.slice(0,a.length-3);return a&&(r=a+r),`${l}${r}${t[1]?`.${t[1]}`:""}`},I=(e,t)=>e?n()(e,t):null,N=(e,t)=>e?n()(e).format(t):"",_=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},R=e=>{const t=[];if((0,i.l$)(e)){const{children:l}=e.props;Array.isArray(l)?l.forEach((e=>t.push(...R(e)))):l&&t.push(...R(l))}else t.push(e);return t},P=e=>e.filter((e=>!e._group)),O=e=>{const t=[];return Object.keys(e).forEach((l=>{null!==e[l]&&t.push(`${l}|${e[l]}`)})),t.join(",")},A=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l="";if(Array.isArray(e)){let a=0;for(let r=0,n=e.length;r<n;r++){const n=e[r];if(!n.fieldName)continue;const i=Array.isArray(n.condition)?(0,o.A_)(n.condition):(0,o.Pz)(n.condition,"^");l+=`${n.bracketLeft} ${t?`${n.fieldName}|${n.fieldType}`:n.fieldName} ${n.expression} ${i} ${n.bracketRight} ${n.logic} `,a=n.logic.length}l=l.slice(0,-1*a-2)}else{const a=5;for(const a in e){const[r,n]=a.includes("|")?a.split("|"):[a,""],i=e[a];for(const e in i){const a=Array.isArray(i[e])?(0,o.A_)(i[e]):(0,o.Pz)(i[e],"^");"''"!==a&&"[]"!==a&&(l+=`${t?`${r}|${n}`:r} ${e} ${a} and `)}}l=l.slice(0,-1*a)}return l.replace(/\s+/g," ").trim()},k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const l=e=>{const l=[];return t.forEach((t=>l.push(S(e,t)))),l},a={};return e.forEach((e=>{const t=JSON.stringify(l(e));a[t]=a[t]||[],a[t].push(e)})),Object.keys(a).map((e=>a[e]))},F=(e,t)=>{for(let l=0;l<e.length;l++){if(e[l].rowKey===t)return[t];if(Array.isArray(e[l].children)){const a=F(e[l].children,t);if(a)return[e[l].rowKey,a].flat()}}},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 l=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](l,l.exports,__webpack_require__),l.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 l in t)__webpack_require__.o(t,l)&&!__webpack_require__.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__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:()=>E.Affix,Alert:()=>E.Alert,Anchor:()=>E.Anchor,AutoComplete:()=>E.AutoComplete,Avatar:()=>E.Avatar,BackTop:()=>E.BackTop,Badge:()=>E.Badge,Breadcrumb:()=>E.Breadcrumb,Button:()=>E.Button,Calendar:()=>I,Card:()=>E.Card,Carousel:()=>E.Carousel,Cascader:()=>E.Cascader,Checkbox:()=>E.Checkbox,Col:()=>E.Col,Collapse:()=>E.Collapse,Comment:()=>E.Comment,ConfigProvider:()=>E.ConfigProvider,DatePicker:()=>R,Descriptions:()=>E.Descriptions,Divider:()=>E.Divider,Drawer:()=>E.Drawer,Dropdown:()=>E.Dropdown,Empty:()=>E.Empty,Form:()=>E.Form,Grid:()=>E.Grid,Image:()=>E.Image,Input:()=>E.Input,InputNumber:()=>E.InputNumber,Layout:()=>E.Layout,List:()=>E.List,Mentions:()=>E.Mentions,Menu:()=>E.Menu,Modal:()=>E.Modal,PageHeader:()=>E.PageHeader,Pagination:()=>E.Pagination,Popconfirm:()=>E.Popconfirm,Popover:()=>E.Popover,Progress:()=>E.Progress,QmAnchor:()=>dt,QmButton:()=>G,QmCollapse:()=>ge,QmConfigProvider:()=>K,QmCopyToClipboard:()=>Mi,QmCountup:()=>Me,QmCropper:()=>Zr,QmDivider:()=>oe,QmDownload:()=>Je,QmDrawer:()=>xt,QmEmpty:()=>ze,QmForm:()=>Cr,QmModal:()=>It,QmPrint:()=>ko,QmSearchHelper:()=>eo,QmSpace:()=>ee,QmSpin:()=>Be,QmSplit:()=>Fe,QmTable:()=>Xi,QmTabs:()=>gt,QmTinymce:()=>jr,QmTreeHelper:()=>go,QmTreeTableHelper:()=>io,QmUploadFile:()=>en,QmUploadImg:()=>sn,Radio:()=>E.Radio,Rate:()=>E.Rate,Result:()=>E.Result,Row:()=>E.Row,Select:()=>E.Select,Skeleton:()=>E.Skeleton,Slider:()=>E.Slider,Space:()=>E.Space,Spin:()=>E.Spin,Statistic:()=>E.Statistic,Steps:()=>E.Steps,Switch:()=>E.Switch,Tabs:()=>E.Tabs,Tag:()=>E.Tag,TimePicker:()=>k,Timeline:()=>E.Timeline,Tooltip:()=>E.Tooltip,Transfer:()=>E.Transfer,Tree:()=>E.Tree,TreeSelect:()=>E.TreeSelect,Typography:()=>E.Typography,Upload:()=>E.Upload,message:()=>E.message,notification:()=>E.notification,pinyin:()=>Ia,version:()=>Fo});var e=__webpack_require__(787),t=__webpack_require__.n(e);const l=require("prop-types");var a=__webpack_require__.n(l);const r=(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:"确 定"},form:{search:"搜 索",reset:"重 置",save:"保 存",spread:"展开",collect:"收起",trueText:"是",falseText:"否",draggable:"拖动排序",requiredTips:"不能为空",inputPlaceholder:"请输入...",selectPlaceholder:"请选择...",treePlaceholder:"树节点过滤",rangeInputNumberPlaceholder:["开始值","结束值"],datePlaceholder:"选择日期",timePlaceholder:"选择时间",weekPlaceholder:"选择周",monthPlaceholder:"选择月",yearPlaceholder:"选择年",daterangePlaceholder:["开始日期","结束日期"],timerangePlaceholder:["开始时间","结束时间"],monthrangePlaceholder:["开始月份","结束月份"],yearrangePlaceholder:["开始年份","结束年份"],datePickers:["今天","昨天","一周前","一个月前"],dateRangePickers:["最近一周","最近一个月","最近三个月","最近六个月"],citySelectType:["按省份","按城市"],regionSelectLabel:["省","市","区","街道"]},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:"序号"},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:"导 入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式"},clipboard:{text:"粘 贴",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},mergeCell:{cancel:"恢复",confirm:"合并"},print:{text:"打印"},refresh:{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,l)=>t[l])):e}const d=function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];const[a,r]=t;let n;const i=a.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,r);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 m(e,t){throw new p(`[${e}] ${t}`)}function h(e,t){console.warn(new p(`[${e}] ${t}`))}const f=e=>"number"==typeof e||void 0===e||["px","rem","em","vw","vh","%"].some((t=>e.endsWith(t)))||e.startsWith("calc"),g=e=>["","small","middle","large"].includes(e),b=require("dayjs/plugin/weekday");var y=__webpack_require__.n(b);const v=require("dayjs/plugin/localeData");var x=__webpack_require__.n(v);i().extend(y()),i().extend(x());const E=require("antd"),C=require("rc-picker/es/generate/dayjs");var S=__webpack_require__.n(C);const w=require("antd/es/calendar/generateCalendar");var T=__webpack_require__.n(w);require("antd/es/calendar/style");const I=T()(S()),N=require("antd/es/date-picker/generatePicker");var _=__webpack_require__.n(N);require("antd/es/date-picker/style/index");const R=_()(S());function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},P.apply(this,arguments)}const O=e.forwardRef(((t,l)=>e.createElement(R,P({},t,{picker:"time",mode:void 0,ref:l}))));O.displayName="TimePicker";const A=e.forwardRef(((t,l)=>e.createElement(R.RangePicker,P({},t,{picker:"time",mode:void 0,ref:l}))));A.displayName="RangePicker",O.RangePicker=A;const k=O,F={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"},form:{search:"Search",reset:"Reset",save:"Save",spread:"Expand",collect:"Collapse",trueText:"Yes",falseText:"No",draggable:"Drag and sort",requiredTips:" is required",inputPlaceholder:"Please enter...",selectPlaceholder:"Please select...",treePlaceholder:"Tree node filter",rangeInputNumberPlaceholder:["Start value","End value"],datePlaceholder:"Select date",timePlaceholder:"Select time",weekPlaceholder:"Select week",monthPlaceholder:"Select month",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"]},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"},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",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",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style"},clipboard:{text:"Paste",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"},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"}}}},q=require("antd/lib/locale/zh_CN");var L=__webpack_require__.n(q);const D=require("antd/lib/locale/en_GB");function H(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const $={[F.name]:{qm:F,antd:__webpack_require__.n(D)()},[o.name]:{qm:o,antd:L()}};class M extends e.Component{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},u($[e.locale].qm)}static getDerivedStateFromProps(e,t){const{locale:l,size:a}=t.value,{locale:r,size:n}=e;return r!==l&&u($[r].qm),r!==l||n!==a?{value:Object.assign({},t.value,{locale:r,size:n})}:null}render(){const{global:e}=this.props,{value:l}=this.state;return t().createElement(r.Provider,{value:l},t().createElement(E.ConfigProvider,{locale:$[l.locale].antd,componentSize:l.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}H(M,"propTypes",{locale:a().string,size:(e,t,l)=>{if(!g(e[t]||""))return m("QmDivider","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},theme:a().string,global:a().object}),H(M,"defaultProps",{locale:"zh-cn",size:"middle",global:{}});const K=M,V=require("omit.js");var U=__webpack_require__.n(V),z=__webpack_require__(542);function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},j.apply(this,arguments)}function B(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class W extends e.Component{constructor(){super(...arguments),B(this,"state",{isLoading:!1}),B(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){h("QmButton","`click`方法执行出错")}this.setState({isLoading:!1})}))}render(){const{size:e,loading:l,authCode:a,click:r,confirm:n}=this.props,{isLoading:i}=this.state,o=e||this.context.size||"",s=(0,z.mf)(r)?{onClick:this.clickHandle}:null,c={...U()(this.props,["authCode","click","confirm"]),size:o,loading:i||l||!1,...s};if(a){const e=(0,z.Y6)(a);if(e){const{visible:t=1,disabled:l}=e;if(!t)return null;l&&(c.disabled=!0)}}return n?t().createElement(E.Popconfirm,{title:n.title||d("qm.button.confirmTitle"),disabled:c.disabled,onConfirm:e=>{var t,l;null===(t=n.onConfirm)||void 0===t||t.call(n),null===(l=c.onClick)||void 0===l||l.call(c,e)},onCancel:e=>{var t;null===(t=n.onCancel)||void 0===t||t.call(n,e)}},t().createElement(E.Button,j({},c,{onClick:z.ZT}),this.props.children)):t().createElement(E.Button,c,this.props.children)}}B(W,"propTypes",{click:a().func,confirm:a().shape({title:a().string,onConfirm:a().func,onCancel:a().func})}),B(W,"contextType",r);const G=W;var Y,Z,X,Q;!function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(Y||(Y={}));class J extends e.Component{render(){const{size:e}=this.props,l=e||this.context.size||"",a=(0,z.hj)(e)?e:Y[e||l||"default"],r={...this.props,size:a};return t().createElement(E.Space,r,this.props.children)}}Q=r,(X="contextType")in(Z=J)?Object.defineProperty(Z,X,{value:Q,enumerable:!0,configurable:!0,writable:!0}):Z[X]=Q;const ee=J,te=require("classnames");var le=__webpack_require__.n(te);const ae=e=>`qm-${e}`,re=require("@ant-design/icons");function ne(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class ie extends e.Component{constructor(){super(...arguments),ne(this,"clickHandle",(()=>{const{collapse:e,onCollapseChange:t=z.ZT}=this.props;t(!e)}))}render(){const{size:e,label:l,extra:a,collapse:r,disabled:n,className:i,style:o,id:s}=this.props,c=e||this.context.size||"",u=ae("divider"),p={[u]:!0,[`${u}--lg`]:"large"===c,[`${u}--sm`]:"small"===c};return t().createElement("div",{id:s,className:le()(p,i),style:o},t().createElement("span",{className:le()(`${u}__title`)},l),t().createElement("div",{className:le()(`${u}__extra`)},a),!(0,z.o8)(r)&&t().createElement(E.Button,{type:"link",className:le()(`${u}__collapse`),disabled:n,onClick:this.clickHandle},d(r?"qm.divider.collect":"qm.divider.spread"),r?t().createElement(re.UpOutlined,null):t().createElement(re.DownOutlined,null)))}}ne(ie,"propTypes",{label:a().string,size:(e,t,l)=>{if(!g(e[t]||""))return m("QmDivider","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},extra:a().oneOfType([a().element,a().string]),collapse:a().bool}),ne(ie,"contextType",r);const oe=ie,se=()=>({height:0,opacity:0}),ce=(e,t)=>"height"===t.propertyName,de={motionName:"rc-collapse-motion",onEnterStart:se,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:se,onEnterEnd:ce,onLeaveEnd:ce,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"},ue=require("rc-motion");var pe=__webpack_require__.n(ue);const me=t().forwardRef(((e,l)=>{const{forceRender:a,className:r,style:n,boxStyle:i,isActive:o}=e,[s,c]=t().useState(o||a);if(t().useEffect((()=>{(a||o)&&c(!0)}),[a,o]),!s)return null;const d=ae("collapse");return t().createElement("div",{ref:l,className:le()(`${d}-content`,{[`${d}-content-active`]:o,[`${d}-content-inactive`]:!o},r),style:n},t().createElement("div",{className:`${d}-content-box`,style:i},e.children))}));me.displayName="PanelContent";const he=me;function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},fe.apply(this,arguments)}const ge=e=>{const{defaultActive:l,label:a,className:r,style:n,containerStyle:i,disabled:o,forceRender:s,destroyOnClose:c=!1}=e,[d,u]=t().useState(!!l),p=ae("collapse"),m=le()({[`${p}`]:!0,[`${p}-active`]:d,[`${p}-disabled`]:o},r);return t().createElement("div",{className:m,style:n},t().createElement(oe,{label:a,collapse:d,disabled:o,onCollapseChange:e=>{u(e)}}),t().createElement(pe(),fe({visible:d},de,{leavedClassName:`${p}-content-hidden`,forceRender:s,removeOnLeave:c}),((l,a)=>{let{className:r,style:n}=l;return t().createElement(he,{ref:a,prefixCls:p,className:r,style:n,boxStyle:i,isActive:d,forceRender:s},e.children)})))},be=t().createContext(void 0);function ye(t,l){const a=e.useRef(!1);e.useEffect((()=>{a.current?t():a.current=!0}),l)}const ve=require("react-draggable");var xe=__webpack_require__.n(ve),Ee=__webpack_require__(386);const Ce=(e,t,l)=>{e&&t&&l&&e.addEventListener(t,l,!1)},Se=(e,t,l)=>{e&&t&&l&&e.removeEventListener(t,l,!1)},we=e=>e.preventDefault(),Te=(e,t,l)=>{!Ee.Z&&e&&t&&((0,z.Kn)(t)?Object.keys(t).forEach((l=>{Te(e,l,t[l])})):(t=(0,z._A)(t),e.style[t]=l))},Ie=e=>{let t=0,l=e;for(;l;)t+=l.offsetTop,l=l.offsetParent;return t},Ne=(e,t)=>{let l=e;for(;l;){var a;if(null!==(a=l.classList)&&void 0!==a&&a.contains(t))return l;l=l.parentNode}return null},_e=e=>{const{minValues:l,onDragChange:a,onDragging:r}=e,{splitRef:n,direction:i}=t().useContext(be),[o,s]=t().useState(),[c,u]=t().useState(0),p="vertical"===i?"y":"x",m={[`${ae("split")}__resize-bar`]:!0,vertical:"vertical"===i,horizontal:"horizontal"===i};return t().createElement(xe(),{bounds:o,axis:p,position:{x:0,y:0},positionOffset:{[p]:-1*c},onStart:()=>{a(!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[l[0],("vertical"===i?t:e)-l[1]]})(),a=e.offsetWidth,r=e.offsetHeight;s({left:t[0]-a,right:t[1]-a,top:t[0]-r,bottom:t[1]-r})})()},onDrag:(e,t)=>{u(t[p]),r(t[p])},onStop:()=>a(!1)},t().createElement("div",{className:le()(m),title:d("qm.split.resize")}))};_e.displayName="ResizeBar";const Re=_e,Pe=t().forwardRef(((e,l)=>{const{offset:a,className:r,style:n}=e,{direction:i,dragging:o}=t().useContext(be),s="vertical"===i?"height":"width",c={[ae("split-pane")]:!0,isLocked:o,horizontal:"horizontal"===i,vertical:"vertical"===i,[r]:!!r},d=void 0!==a?{[s]:(0,z.PM)(a)}:{flex:1,[s]:0};return t().createElement("div",{ref:l,className:le()(c),style:{...d,...n}},e.children)}));Pe.displayName="QmSplitPane";const Oe=Pe;function Ae(){return Ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Ae.apply(this,arguments)}const ke=e=>{const{direction:l="horizontal",defaultValue:a="50%",uniqueKey:n,className:i,style:o,onDragStart:s,onDrag:c=z.ZT,onDragEnd:d}=e,{global:u}=t().useContext(r),p=t().useRef(null),m=t().useRef(null),h=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 l=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return l>=0?l:0},b=t().useMemo((()=>n?`split_${n}`:""),[n]),[y,v]=t().useState(!1),[x,E]=t().useState(h(a)),C=t().useRef(0);ye((()=>{y?(C.current="vertical"===l?m.current.offsetHeight:m.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(h(e)):w(b).then((e=>{localStorage.setItem(b,h(e||a)),S()})).catch((()=>{}))},w=async e=>{const t=null==u?void 0:u.getComponentConfigApi;if(t)try{const l=await t({key:e});if(200===l.code)return l.data}catch(e){}},T=async(e,t)=>{const l=null==u?void 0:u.saveComponentConfigApi;if(l)try{await l({[e]:t})}catch(e){}},I=t().useMemo((()=>({splitRef:p,direction:l,dragging:y})),[l,y]),N=[];t().Children.map(e.children,(e=>{var t;(0,z.l$)(e)&&!(0,z.M2)(e)&&"QmSplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&N.push(e)}));const[_,R]=N,P=t().useMemo((()=>[g(_),g(R)]),[_,R]),O={[ae("split")]:!0,vertical:"vertical"===l};return t().createElement(be.Provider,{value:I},t().createElement("div",{ref:p,className:le()(O,i),style:o},t().createElement(Oe,Ae({},_.props,{ref:m,offset:x})),t().createElement(Re,{minValues:P,onDragChange:e=>v(e),onDragging:e=>{const t=C.current+e;E(`${t}px`),c(t)}}),t().createElement(Oe,R.props)))};ke.Pane=Oe,ke.displayName="QmSplit";const Fe=ke,qe=require("react-countup");var Le=__webpack_require__.n(qe);function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},De.apply(this,arguments)}function He(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class $e extends e.Component{render(){const{size:e,className:l,style:a}=this.props,r=e||this.context.size||"",n=ae("countup"),i={[n]:!0,[`${n}--lg`]:"large"===r,[`${n}--sm`]:"small"===r};return t().createElement(Le(),De({},this.props,{className:le()(i,l),style:a}),this.props.children)}}He($e,"defaultProps",{duration:2}),He($e,"contextType",r);const Me=$e;function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Ke.apply(this,arguments)}function Ve(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Ue extends e.Component{render(){const{size:e,className:l}=this.props,a=e||this.context.size||"",r=ae("empty"),n={...this.props,image:E.Empty.PRESENTED_IMAGE_SIMPLE},i={[r]:!0,[`${r}--lg`]:"large"===a,[`${r}--sm`]:"small"===a};return t().createElement(E.Empty,Ke({},n,{className:le()(i,l)}))}}Ve(Ue,"contextType",r),Ve(Ue,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmAnchor","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")}});const ze=Ue;class je extends e.Component{render(){const e={...this.props,style:{...this.props.style,maxHeight:"none"}};return t().createElement(E.Spin,e,this.props.children)}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(je,"defaultProps",{tip:"Loading..."});const Be=je,We=require("axios");var Ge=__webpack_require__.n(We);const Ye=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const l=window.URL.createObjectURL(e);let a=document.createElement("a");a.href=l,a.download=decodeURI(t),a.click(),a=null}};function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Ze.apply(this,arguments)}function Xe(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Qe extends e.Component{constructor(){super(...arguments),Xe(this,"state",{loading:!1}),Xe(this,"downloadHandle",(async()=>{this.setState({loading:!0});try{var e,t;const{action:l,beforeDownload:a=(()=>!0)}=this.props,r=(0,z.HD)(l)?l:await this.getActionUrl();if(!r)return h("QmDownload","参数 `action` 有误!");if(!a(r))return;await this.downloadFile(r),await(0,z._v)(100),null===(e=(t=this.props).onSuccess)||void 0===e||e.call(t),E.message.success(d("qm.download.success"))}catch(e){var l,a;null===(l=(a=this.props).onError)||void 0===l||l.call(a,e),E.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:l,params:a,withCredentials:r}=this.props,n=await Ge()({url:e,params:a,headers:l,withCredentials:r,responseType:"blob"}),i=n.data,o=n.headers["content-disposition"],s=t||(o?o.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Ye(i,s)}render(){const{size:e}=this.props,{loading:l}=this.state,a=e||this.context.size||"",r=U()(this.props,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return t().createElement(E.Button,Ze({},r,{size:a,loading:l,onClick:this.downloadHandle}),this.props.children)}}Xe(Qe,"propTypes",{action:a().oneOfType([a().string,a().shape({api:a().func.isRequired,params:a().object})]),size:(e,t,l)=>{if(!g(e[t]||""))return m("QmAnchor","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},fileName:a().string,headers:a().object,withCredentials:a().bool,params:a().object,beforeDownload:a().func,onSuccess:a().func,onError:a().func}),Xe(Qe,"defaultProps",{icon:t().createElement(re.DownloadOutlined,null),children:d("qm.download.text"),withCredentials:!1}),Xe(Qe,"contextType",r);const Je=Qe,et=require("add-dom-event-listener");var tt=__webpack_require__.n(et);const lt=require("scroll-into-view-if-needed");var at=__webpack_require__.n(lt);class rt extends e.Component{renderLabel(e){const{activeKey:l,labels:a,onTabClick:r}=this.props;return a.map(((a,n)=>{const i={[`${e}__item`]:!0,actived:n===l};return t().createElement("div",{key:n,className:le()(i),onClick:e=>r(n,e)},t().createElement("span",null,a))}))}render(){const e=ae("anchor-nav"),l={[e]:!0};return t().createElement("div",{className:le()(l)},this.renderLabel(e))}}const nt=rt;class it extends e.Component{render(){const{label:e,showDivider:l,className:a,style:r}=this.props,n={[ae("anchor-item")]:!0};return t().createElement("div",{className:le()(n,a),style:r},l&&t().createElement(oe,{label:e,style:{marginBottom:"10px"}}),this.props.children)}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(it,"displayName","QmAnchorItem");const ot=it;function st(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class ct extends e.Component{constructor(){super(...arguments),st(this,"currentState","ready"),st(this,"itemsTotal",void 0),st(this,"timer",void 0),st(this,"scrollEvent",void 0),st(this,"scrollRef",(0,e.createRef)()),st(this,"state",{activeKey:0}),st(this,"onScrollHandle",(e=>{if("ready"!==this.currentState)return;const t=this.findCurrentIndex(e.target.scrollTop);-1!==t&&this.setState({activeKey:t})})),st(this,"onTabClickHandle",(e=>{const{labelList:t=[]}=this.props,l=this.__is_conf?document.getElementById(t[e].id):this.scrollRef.current.children[e];l&&(this.setState({activeKey:e}),this.currentState="stop",this.timer&&clearTimeout(this.timer),at()(l,{block:"start",behavior:"smooth",boundary:this.scrollRef.current}),this.timer=setTimeout((()=>this.currentState="ready"),500))})),st(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=tt()(this.scrollRef.current,"scroll",(0,z.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(Ie(e)-Ie(t)))(e,this.scrollRef.current)))}findCurrentIndex(e){const t=Math.abs(e),l=this.createDistances();let a=-1;for(let e=0;e<l.length;e++){const r=l[e],n=l[e+1]||1e4;t>=r-1&&t<n&&(a=e)}return a}render(){const{activeKey:e}=this.state,{size:l,labelWidth:a,labelList:r=[],className:n,style:i}=this.props,o=l||this.context.size||"",s=ae("anchor"),c={[s]:!0,[`${s}--lg`]:"large"===o,[`${s}--sm`]:"small"===o},d=[];t().Children.map(this.props.children,(e=>{var t;(0,z.l$)(e)&&!(0,z.M2)(e)&&"QmAnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&d.push(e)}));const u=this.__is_conf?r.map((e=>e.label)):d.map((e=>e.props.label));return this.itemsTotal=u.length,t().createElement("div",{className:le()(c,n),style:i},t().createElement("div",{className:le()(`${s}__label`),style:{width:(0,z.PM)(a)}},t().createElement(nt,{activeKey:e,labels:u,onTabClick:this.onTabClickHandle})),t().createElement("div",{ref:this.scrollRef,className:le()(`${s}__container`)},this.__is_conf?this.props.children:d))}}st(ct,"Item",ot),st(ct,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmAnchor","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},labelWidth:(e,t,l)=>{if(!f(e[t]))return m("QmAnchor","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},labelList:a().arrayOf(a().shape({id:a().string,label:a().string}))}),st(ct,"defaultProps",{labelWidth:80}),st(ct,"contextType",r);const dt=ct;class ut extends e.Component{render(){return t().createElement(E.Tabs.TabPane,this.props,this.props.children)}}const pt=ut;function mt(){return mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},mt.apply(this,arguments)}function ht(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class ft extends e.Component{render(){const{size:e,className:l}=this.props,a=e||this.context.size||"",r=ae("tabs"),n={[r]:!0,[`${r}--lg`]:"large"===a,[`${r}--sm`]:"small"===a};return t().createElement(E.Tabs,mt({},this.props,{className:le()(n,l)}),this.props.children)}}ht(ft,"TabPane",pt),ht(ft,"contextType",r),ht(ft,"defaultProps",{tabBarGutter:10});const gt=ft;function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},bt.apply(this,arguments)}function yt(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class vt extends e.Component{constructor(){super(...arguments),yt(this,"titleRef",t().createRef()),yt(this,"$drawer",null),yt(this,"opened",!1),yt(this,"state",{fullscreen:!1,spinning:!1,sloading:!1}),yt(this,"afterVisibleChange",(e=>{const{loading:t}=this.props;var l,a;e?(this.opened=!0,(0,z.o8)(t)&&setTimeout((()=>this.setState({spinning:!1})),100)):(null===(l=(a=this.props).onClosed)||void 0===l||l.call(a),this.setState({fullscreen:!1}))})),yt(this,"toggleHandle",(()=>{this.$drawer||(this.$drawer=Ne(this.titleRef.current,"ant-drawer-content-wrapper")),this.setState((e=>({fullscreen:!e.fullscreen})))})),yt(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),yt(this,"STOP_LOADING",(()=>{this.setState({sloading:!1})}))}componentWillUnmount(){this.$drawer=null}componentDidUpdate(e,t){const{visible:l,loading:a,destroyOnClose:r}=this.props,{fullscreen:n}=this.state;l&&l!==e.visible&&(!r&&this.opened||(0,z.o8)(a)&&this.setState({spinning:!0})),this.$drawer&&n!==t.fullscreen&&Te(this.$drawer,n?{width:"100%"}:{width:(0,z.PM)(this.props.width||"72%")})}renderTitle(){const{fullscreen:e}=this.state,{showFullScreen:l}=this.props;return t().createElement(t().Fragment,null,t().createElement("span",{ref:this.titleRef,className:le()("text")},this.props.title),l&&t().createElement("span",{className:le()("full-screen"),onClick:this.toggleHandle},t().createElement(e?re.FullscreenExitOutlined:re.FullscreenOutlined)))}render(){const{spinning:e,sloading:l}=this.state,{size:a,className:r,loading:n,maskClosable:i,onClose:o}=this.props,s=this.context.global,c=a||this.context.size||"",d=ae("drawer"),u={[d]:!0,[`${d}--lg`]:"large"===c,[`${d}--sm`]:"small"===c};return t().createElement(E.Drawer,bt({},U()(this.props,["size","showFullScreen","loading","maskClosable","onClosed"]),{maskClosable:i??(null==s?void 0:s.maskClosable)??!1,className:le()(u,r),title:this.renderTitle(),footer:null,onClose:o,afterVisibleChange:this.afterVisibleChange}),this.props.children,(n||l||e)&&t().createElement(Be,{spinning:!0,className:le()(`${d}-spin`)}))}}yt(vt,"contextType",r),yt(vt,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmDrawer","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},spinning:a().bool}),yt(vt,"defaultProps",{width:"72%",showFullScreen:!0,destroyOnClose:!0,footer:null});const xt=vt;function Et(){return Et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Et.apply(this,arguments)}function Ct(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const St="10vh";var wt;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small"}(wt||(wt={}));class Tt extends e.Component{constructor(){super(...arguments),Ct(this,"draggleRef",t().createRef()),Ct(this,"opened",!1),Ct(this,"state",{fullscreen:!1,spinning:!1,sloading:!1,disabled:!0,bounds:{left:0,top:0,bottom:0,right:0},position:void 0}),Ct(this,"onStart",((e,t)=>{const{clientWidth:l,clientHeight:a}=window.document.documentElement,r=this.draggleRef.current.getBoundingClientRect();r&&this.setState({bounds:{left:-r.left+t.x,right:l-(r.right-t.x)-1,top:-r.top+t.y,bottom:a-(r.bottom-t.y)-1}})})),Ct(this,"toggleHandle",(e=>{const t=Ne(e.target,"ant-modal");if(!t)return;const l=t.querySelector(".ant-modal-body"),{height:a}=this.props,{fullscreen:r}=this.state;r?(Te(t,{width:(0,z.PM)(this.props.width||"60%"),height:"auto",top:St}),Te(l,{height:a?(0,z.PM)(a):this.defaultHeight,maxHeight:"auto"===a?this.defaultHeight:""})):(Te(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Te(l,{height:`calc(100vh - ${wt[this.$size]}px)`,maxHeight:""})),this.setState((e=>({fullscreen:!e.fullscreen})))})),Ct(this,"afterVisibleChange",(()=>{const{onClosed:e}=this.props;null==e||e(),this.setState({fullscreen:!1})})),Ct(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),Ct(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 - ${wt[this.$size]}px)`}componentDidUpdate(e,t){const{visible:l,loading:a,destroyOnClose:r}=this.props,{fullscreen:n}=this.state;if(l&&l!==e.visible){if(!r&&this.opened||(0,z.o8)(a)&&this.setState({spinning:!0}),!r&&this.opened)return;setTimeout((()=>{this.opened=!0,(0,z.o8)(a)&&this.setState({spinning:!1})}),400)}n!==t.fullscreen&&(n?this.setState({position:{x:0,y:0}}):this.setState({position:void 0}))}renderTitle(){const{fullscreen:e,disabled:l}=this.state,{showFullScreen:a}=this.props;return t().createElement("div",{onMouseOver:()=>{l&&this.setState({disabled:!1})},onMouseOut:()=>{this.setState({disabled:!0})}},t().createElement("span",{className:le()("text")},this.props.title),a&&t().createElement("span",{className:le()("full-screen"),onClick:this.toggleHandle},t().createElement(e?re.FullscreenExitOutlined:re.FullscreenOutlined)))}render(){const{spinning:e,sloading:l,fullscreen:a,disabled:r,bounds:n,position:i}=this.state,{height:o,className:s,loading:c,draggable:d,maskClosable:u,bodyStyle:p,onClose:m}=this.props,h=this.context.global,f=ae("modal"),g={height:o?(0,z.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(E.Modal,Et({},U()(this.props,["showFullScreen","loading","maskClosable","onClose","onClosed"]),{maskClosable:u??(null==h?void 0:h.maskClosable)??!1,className:le()(b,s),title:this.renderTitle(),footer:null,bodyStyle:Object.assign({},g,p),onCancel:m,afterClose:this.afterVisibleChange,modalRender:e=>t().createElement(xe(),{disabled:!d||r||a,bounds:n,position:i,onStart:(e,t)=>this.onStart(e,t)},t().createElement("div",{ref:this.draggleRef},e))}),this.props.children,(c||l||e)&&t().createElement(Be,{spinning:!0,className:le()(`${f}-spin`)}))}}Ct(Tt,"contextType",r),Ct(Tt,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmModal","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},spinning:a().bool}),Ct(Tt,"defaultProps",{width:"60%",showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:St}});const It=Tt;var Nt=__webpack_require__(517);const _t=require("memoize-one");var Rt=__webpack_require__.n(_t);const Pt=(0,e.createContext)(void 0),Ot=require("resize-observer-polyfill");var At=__webpack_require__.n(Ot);const kt=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];e.length&&e.forEach((e=>e(t)))}},Ft=function(e,t){!Ee.Z&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new(At())(kt),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},qt=function(e,t){var l;e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||null===(l=e.__ro__)||void 0===l||l.disconnect())},Lt=require("dayjs/plugin/advancedFormat");var Dt=__webpack_require__.n(Lt);const Ht=require("dayjs/plugin/customParseFormat");var $t=__webpack_require__.n(Ht);i().extend(Dt()),i().extend($t());const Mt=(e,t)=>e?i()(e,t):null,Kt=(e,t)=>e?i()(e).format(t):"",Vt=e=>""===e||null==e,Ut=(e,t,l)=>e.map((e=>{const a={value:e[t],text:e[l]};return e.disabled&&(a.disabled=!0),Array.isArray(e.children)&&(a.children=Ut(e.children,t,l)),a})),zt=(e,t)=>{let l=null;for(let a=0;a<e.length;a++){if(Array.isArray(e[a].children)&&(l=zt(e[a].children,t)),l)return l;if(e[a].value===t)return e[a]}return l},jt=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const a=[];return e.forEach((e=>{e.value==t.split(",")[l]&&a.push(e),Array.isArray(e.children)&&a.push(...jt(e.children,t,l+1))})),a},Bt=e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),Wt=80,Gt="1",Yt="0",Zt=["RANGE_INPUT","RANGE_INPUT_NUMBER","MULTIPLE_CHECKBOX","MULTIPLE_SELECT","RANGE_DATE","RANGE_TIME","MULTIPLE_TREE_SELECT","MULTIPLE_SEARCH_HELPER","MULTIPLE_CASCADER","UPLOAD_FILE"],Xt={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};let Qt,Jt,el;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(Qt||(Qt={})),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"}(Jt||(Jt={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(el||(el={}));const tl={items:a().arrayOf(a().shape({type:a().string.isRequired,fieldName:a().string.isRequired})),initialValues:a().object,initialExtras:a().object,layout:a().oneOf(["horizontal","vertical"]),size:(e,t,l)=>{if(!g(e[t]||""))return m("QmForm","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},cols:a().number,customClass:a().string,labelWidth:a().oneOfType([a().number,a().string]),labelAlign:a().oneOf(["left","right"]),formType:a().oneOf(["default","search","onlyShow"]),uniqueKey:a().string,authCode:a().string,defaultRows:a().number,authConfig:a().shape({fetch:a().shape({api:a().func.isRequired,params:a().object,dataKey:a().string})}),isAutoFocus:a().bool,isCollapse:a().bool,isFieldsDefine:a().bool,isSearchBtn:a().bool,isSubmitBtn:a().bool,fieldsChange:a().func,onValuesChange:a().func,onFieldsChange:a().func,onFinish:a().func,onFinishFailed:a().func,onReset:a().func,onCollapse:a().func},ll={layout:"horizontal",labelWidth:Wt,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:z.ZT,onFieldsChange:z.ZT,onFinish:z.ZT,onFinishFailed:z.ZT,onReset:z.ZT,onCollapse:z.ZT,onFormItemsChange:z.ZT},al=require("react-sortablejs");function rl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class nl extends e.Component{constructor(){super(...arguments),rl(this,"linkRef",t().createRef()),rl(this,"state",{visible:!1})}get formUniqueKey(){return this.props.uniqueKey?`form_${this.props.uniqueKey}`:""}componentDidMount(){this.initLocalfields()}async getTableFieldsConfig(e){const t=this.context.global,l=null==t?void 0:t.getComponentConfigApi;if(l)try{const t=await l({key:e});if(200===t.code)return t.data}catch(e){}}async saveTableColumnsConfig(e,t){const l=this.context.global,a=null==l?void 0:l.saveComponentConfigApi;if(a)try{await a({[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,Nt.xor)(e.map((e=>e.fieldName)),this.props.items.map((e=>e.fieldName))).length>0?this.props.items.map((t=>{const{fieldName:l}=t,a=e.find((e=>e.fieldName===l));return a?((0,z.o8)(a.hidden)||(t.hidden=a.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,z.o8)(e.hidden)||(t.hidden=e.hidden),{fieldName:e.fieldName,...t}})),l=JSON.parse(localStorage.getItem(this.formUniqueKey));(0,Nt.isEqual)(t,l)||(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,l=e.filter((e=>!e.noAuth));return t().createElement(Pt.Consumer,null,(e=>{const a=e.$$form;return t().createElement("div",{className:le()("ant-dropdown-menu","fields-list")},t().createElement(al.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:l,setList:e=>{const t=e.map((e=>e.fieldName)),r=l.map((e=>e.fieldName));(0,Nt.isEqual)(t,r)||(a.setExpandHandle(!0),this.changeHandle(e),this.setLocalFields(e))}},l.map((e=>{var r;return t().createElement("li",{key:e.fieldName,className:"item"},t().createElement(E.Checkbox,{disabled:(null===(r=e.rules)||void 0===r?void 0:r.findIndex((e=>e.required)))>-1,checked:!e.hidden,onChange:t=>{const{checked:a}=t.target;e.hidden=!a,this.changeHandle(l),this.setLocalFields(l)}}),t().createElement(re.HolderOutlined,{className:"handle",title:d("qm.form.draggable")}),t().createElement("span",{className:"title"},a.getFormItemLabel(e.label)))}))))}))}render(){const{visible:e}=this.state,l=ae("form-fields-filter");return t().createElement(Pt.Consumer,null,(a=>{const{$size:r}=a.$$form,n={[l]:!0,[`${l}--lg`]:"large"===r,[`${l}--sm`]:"small"===r};return t().createElement(E.Dropdown,{overlayClassName:le()(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(re.UnorderedListOutlined,null)))}))}}rl(nl,"contextType",r);const il=nl;function ol(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class sl extends e.Component{constructor(){super(...arguments),ol(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e)})),ol(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)}))}render(){const{$$form:e}=this.context,{value:l}=this.props,{type:a,options:r={},style:n={},placeholder:i=d("qm.form.inputPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:c,disabled:u,onBlur:p=z.ZT,onEnter:m=z.ZT}=this.props.option,{prefix:h,suffix:f,password:g,maxLength:b,pattern:y,toUpper:v,toTrim:x,secretType:C}=r,S=C&&(c||u),w=g?E.Input.Password:E.Input,T=S?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return e+="","finance"===t&&(e=Bt(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,C):l;return t().createElement(w,{ref:e=>this[a]=e,value:T,placeholder:i,style:n,title:T,prefix:h,suffix:f,maxLength:b,bordered:o,allowClear:s,readOnly:c,disabled:u,onBlur:e=>{let t=e.target.value??"";if(x){const e=t.trim();t!==e&&(t=e,this.triggerChange(t))}this.triggerBlur(t),p(t)},onKeyUp:t=>{if(13===t.keyCode){const{value:l}=t.target;m(l),e.isFilterType&&e.SUBMIT_FORM()}},onChange:e=>{let t=e.target.value;(0,Nt.isRegExp)(y)&&(t=y.test(t)?t:l??""),v&&(t=t.toUpperCase()),this.triggerChange(t)}})}}ol(sl,"contextType",Pt);class cl extends e.Component{constructor(){super(...arguments),ol(this,"inputRef",t().createRef()),ol(this,"focus",(()=>{const{type:e}=this.props.option;this.inputRef.current[e].focus()}))}render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(sl,{ref:this.inputRef,option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}ol(cl,"contextType",Pt);const dl=cl;function ul(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class pl extends e.Component{constructor(){super(...arguments),ul(this,"triggerChange",(e=>{const{onChange:t=z.ZT,onValuesChange:l}=this.props;t(e=e.every((e=>!e))?[]:e),l(e)}))}render(){const{value:e=[]}=this.props,{options:l={},placeholder:a=d("qm.form.rangeInputNumberPlaceholder"),bordered:r=!0,allowClear:n,readOnly:i,disabled:o}=this.props.option,{prefix:s,suffix:c,maxLength:u}=l;return t().createElement(E.Input.Group,{compact:!0},t().createElement(E.Input,{value:e[0],className:"site-input-left",style:{width:"calc(50% - 10px)"},placeholder:a[0],prefix:s,suffix:c,maxLength:u,allowClear:n,bordered:r,readOnly:i,disabled:o,onChange:t=>{const{value:l}=t.target;this.triggerChange([l,e[1]])}}),t().createElement(E.Input,{className:"site-input-split",style:{width:20,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:r,disabled:o,readOnly:!0}),t().createElement(E.Input,{value:e[1],className:"site-input-right",style:{width:"calc(50% - 10px)"},placeholder:a[1],prefix:s,suffix:c,maxLength:u,bordered:r,allowClear:n,readOnly:i,disabled:o,onChange:t=>{const{value:l}=t.target;this.triggerChange([e[0],l])}}))}}ul(pl,"contextType",Pt);class ml extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,labelWidth:o=e.props.labelWidth,extra:s,validateTrigger:c,rules:d=[],onChange:u=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(o)},required:e.getFormItemRequired(d)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:d,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(pl,{option:this.props.option,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];u(t),e.setViewValue(n,t.join("-"))}}))),s&&t().createElement(E.Col,{flex:(0,z.PM)(s.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...s}))))}}ul(ml,"contextType",Pt);const hl=ml;function fl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const gl=e=>{const t=Number(e);return Number.isNaN(t)?e:t};class bl extends e.Component{constructor(){super(...arguments),fl(this,"focus",(()=>{const{type:e}=this.props.option;this[e].focus()}))}render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:u,rules:p=[],style:m={},placeholder:h=d("qm.form.inputPlaceholder"),bordered:f=!0,allowClear:g,readOnly:b,disabled:y,onChange:v=z.ZT,onBlur:x=z.ZT,onEnter:C=z.ZT}=this.props.option,{step:S=1,min:w=0,max:T,controls:I,precision:N,formatter:_,parser:R}=o;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(E.InputNumber,{ref:e=>this[l]=e,placeholder:h,style:{width:"100%",...m},step:S,min:w,max:T,controls:I,precision:N,formatter:_,parser:R,bordered:f,readOnly:b,disabled:y,onBlur:e=>{(0,z.Y3)((()=>{const{value:t}=e.target;x(gl((null==R?void 0:R(t))??t))}))},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;C(gl((null==R?void 0:R(t))??t))}},onChange:t=>{e.setViewValue(n,(null==t?void 0:t.toString())??""),v(t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}fl(bl,"contextType",Pt);const yl=bl;function vl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class xl extends e.Component{constructor(){super(...arguments),vl(this,"validateValues",(e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),this.triggerChange(e)})),vl(this,"triggerChange",(e=>{const{onChange:t=z.ZT,onValuesChange:l}=this.props,a=e.every((e=>null===e))?[]:[...e];t(a),l(a)}))}render(){const{value:e=[]}=this.props,{options:l={},placeholder:a=d("qm.form.rangeInputNumberPlaceholder"),bordered:r=!0,allowClear:n,readOnly:i,disabled:o}=this.props.option,{step:s=1,min:c=0,max:u,controls:p,precision:m,formatter:h,parser:f}=l;return t().createElement(E.Input.Group,{compact:!0},t().createElement(E.InputNumber,{value:e[0],className:"site-input-left",style:{width:"calc(50% - 10px)"},placeholder:a[0],step:s,min:c,max:u,controls:p,precision:m,formatter:h,parser:f,bordered:r,readOnly:i,disabled:o,onChange:t=>{this.triggerChange([t,e[1]])},onBlur:()=>{this.validateValues(e)}}),t().createElement(E.Input,{className:"site-input-split",style:{width:20,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:r,disabled:o,readOnly:!0}),t().createElement(E.InputNumber,{value:e[1],className:"site-input-right",style:{width:"calc(50% - 10px)"},placeholder:a[1],step:s,min:c,max:u,controls:p,precision:m,formatter:h,parser:f,bordered:r,readOnly:i,disabled:o,onChange:t=>{this.triggerChange([e[0],t])},onBlur:()=>{this.validateValues(e)}}))}}vl(xl,"contextType",Pt);class El extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,labelWidth:o=e.props.labelWidth,extra:s,validateTrigger:c,rules:d=[],onChange:u=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(o)},required:e.getFormItemRequired(d)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:d,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(xl,{option:this.props.option,onValuesChange:t=>{u(t),e.setViewValue(n,t.join("-"))}}))),s&&t().createElement(E.Col,{flex:(0,z.PM)(s.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...s}))))}}vl(El,"contextType",Pt);const Cl=El;let Sl;function wl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}!function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(Sl||(Sl={}));const{Search:Tl}=E.Input;class Il extends e.Component{constructor(e){var t;super(e),t=this,wl(this,"searchHelper",void 0),wl(this,"alias",void 0),wl(this,"extras",void 0),wl(this,"deriveParams",void 0),wl(this,"valueKey",void 0),wl(this,"_is_change",!1),wl(this,"_record",void 0),wl(this,"_prevValue",void 0),wl(this,"state",{visible:!1,loading:!1}),wl(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),wl(this,"initialHandle",(()=>{const{fieldName:e,searchHelper:t}=this.props.option;this.searchHelper=t||{};const{fieldAliasMap:l,extraAliasMap:a,fieldsDefine:r}=this.searchHelper;if(l||h("QmForm","searchHelper 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof l?l():l||{},this.extras="function"==typeof a?a():a||{},r){const e=["valueKey","displayKey","extraKey"];for(const t in r)e.includes(t)&&(this[t]=r[t])}Object.keys(this.alias).includes(e)||h("QmForm","fieldAliasMap 选项必须包含自身 `fieldName` 值"),this.searchHelper.echoRequest&&!this.valueKey&&h("QmForm","echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),wl(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),wl(this,"getItemText",(async()=>{const{fetchApi:e,params:t={},formatter:l=(e=>e),dataKey:a,fieldAliasMap:r,extraAliasMap:n}=this.searchHelper.echoRequest||{},i="function"==typeof r?r():r||{},o="function"==typeof n?n():n||{},{value:s}=this.props;if(e&&!s&&this._prevValue){this.setState({loading:!0});try{const r=await e(l({...t,key:this._prevValue}));if(200===r.code){const e=Array.isArray(r.data)?r.data:(0,Nt.get)(r.data,a)??[];if(e[0]){const t=e[0];if(i)for(const e in i)Object.keys(this.alias).includes(e)&&this.alias[e]!==i[e]&&(t[this.alias[e]]=t[i[e]]);if(o)for(const e in o)Object.keys(this.extras).includes(e)&&this.extras[e]!==o[e]&&(t[this.extras[e]]=t[o[e]]);this._record=t,this.setFieldsValue(t)}}}catch(e){}this.setState({loading:!1})}})),wl(this,"todoOpen",(e=>{this.deriveParams=this.createFilters(e),this.setVisible(!0)})),wl(this,"createFilters",(e=>{const{fieldName:t}=this.props.option,{filterAliasMap:l}=this.searchHelper,a=""!==e?e:void 0,r="function"==typeof l?l():l??[],n={[t]:a};return r.forEach((e=>n[e]=a)),n})),wl(this,"getSearchHelperTableData",(e=>{const{table:t,initialValue:l={}}=this.searchHelper,{beforeFetch:a=z.XT}=t.fetch;return new Promise((async(r,n)=>{const i=(0,Nt.merge)({},t.fetch.params,{...l,...this.createFilters(e)},{currentPage:1,pageSize:500});try{if(!a(i))return n();this.setState({loading:!0});const e=await t.fetch.api(i);if((0,z.Y3)((()=>this.setState({loading:!1}))),200===e.code)return r(Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,t.fetch.dataKey)??[])}catch(e){this.setState({loading:!1})}n()}))})),wl(this,"setFieldsValue",(e=>{const{$$form:t}=this.context;for(const l in this.alias)t.SET_FIELDS_VALUE({[l]:e[this.alias[l]]});for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:e[this.extras[l]]})})),wl(this,"resetSearchHelperValue",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],l=arguments.length>1?arguments[1]:void 0;const{fieldName:a}=t.props.option,r=e.filter((e=>{var r;return null===(r=e[t.alias[a]])||void 0===r?void 0:r.toString().toLowerCase().includes(l.toLowerCase())}));if(1===r.length)return t.closeSearchHelper(r[0]);t.openSearchHelper(l)})),wl(this,"openSearchHelper",((e,t)=>{const{$$form:l}=this.context,{beforeOpen:a}=this.searchHelper,r=(a??z.XT)(l.state.formData);null!=r&&r.then?r.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==r&&(this.todoOpen(e),null==t||t())})),wl(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const a in this.alias)a!==l&&t.SET_FIELDS_VALUE({[a]:e[this.alias[a]]});for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:e[this.extras[l]]});this._record=e,this.triggerChange(e[this.alias[l]]),this.searchHelperChangeHandle(e[this.alias[l]]);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(e)),200)}))})),wl(this,"closeButNotSelect",(()=>{const{closeRemoteMatch:e,onlySelect:t=!0}=this.searchHelper;this._is_change&&(!e&&t?this.clearSearchHelperValue():this.searchHelperChangeHandle(this.props.value)),this._is_change=!1,this.setVisible(!1)})),wl(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const l in this.alias)l!==t&&e.SET_FIELDS_VALUE({[l]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange(""),this.searchHelperChangeHandle("")})),wl(this,"searchHelperChangeHandle",(e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)})),wl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e)})),wl(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),this.initialHandle()}componentDidMount(){this._prevValue=this.getItemValue(),this.getItemText()}componentDidUpdate(){const e=this.getItemValue();e!==this._prevValue&&(this._prevValue=e,this.getItemText())}render(){const{$$form:e}=this.context,{visible:l,loading:a}=this.state,{value:r}=this.props,{type:n,options:i={},searchHelper:o={},style:s={},placeholder:c=d("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h}=this.props.option,{prefix:f,suffix:g,maxLength:b}=i,y={visible:l,title:d("qm.searchHelper.text"),width:o.width??"60%",loading:!!o.name&&void 0,bodyStyle:{paddingBottom:`${Sl[e.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},v={...o,size:e.$size,initialValue:(0,Nt.merge)({},o.initialValue,this.deriveParams),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}};return t().createElement(t().Fragment,null,t().createElement(Tl,{ref:e=>this[`${n}_Ref`]=e,value:r,loading:a,placeholder:c,style:s,title:r,prefix:f,suffix:g,maxLength:b,bordered:u,allowClear:p,readOnly:m,disabled:h,onBlur:e=>{const{value:t}=e.target;var a,r;this.triggerBlur(t),this._is_change&&!l&&(t?o.closeRemoteMatch?this.searchHelperChangeHandle(t):null!==(a=o.table)&&void 0!==a&&null!==(r=a.fetch)&&void 0!==r&&r.api&&this.getSearchHelperTableData(t).then((e=>this.resetSearchHelperValue(e,t))).catch((()=>this.clearSearchHelperValue())):this.clearSearchHelperValue())},onKeyUp:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;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):this.clearSearchHelperValue())}}),t().createElement(It,y,t().createElement(eo,v)))}}wl(Il,"contextType",Pt);class Nl extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[]}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(Il,{option:this.props.option,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}wl(Nl,"contextType",Pt);const _l=Nl;function Rl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Pl extends e.Component{constructor(e){var t;super(e),t=this,Rl(this,"searchHelper",void 0),Rl(this,"alias",void 0),Rl(this,"_records",[]),Rl(this,"state",{visible:!1,loading:!1,itemList:[]}),Rl(this,"initialHandle",(()=>{const{searchHelper:e}=this.props.option;this.searchHelper=e||{};const t=this.searchHelper.fieldAliasMap;t||h("QmForm","searchHelper 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof t?t():t||{},Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||h("QmForm","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),Rl(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Rl(this,"setItemList",(e=>{this.setState({itemList:e})})),Rl(this,"setRecords",(e=>{this._records=e})),Rl(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),Rl(this,"openSearchHelper",(e=>{const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,a=(l??z.XT)(t.state.formData);null!=a&&a.then?a.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==a&&(this.setVisible(!0),null==e||e())})),Rl(this,"closeSearchHelper",(function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:a}=t.alias;t.setRecords((0,Nt.uniqBy)([...t._records.filter((e=>l.includes(e[a]))),...e],a));const r=t.recordsToDict();t.setItemList(r),t.triggerChange(r.map((e=>e.value)));const{closed:n}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>null==n?void 0:n(t._records)),200)}))})),Rl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:a}=this.alias;this.setRecords(this._records.filter((t=>e.includes(t[a])))),null==t||t(e),l(e,this.createViewText(e),this._records)})),this.initialHandle()}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:l=[]}=this.props;(0,Nt.isEqual)((0,Nt.intersection)(t,l),l)||(0,Nt.isEqual)(l,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList()}async getItemList(){const{searchHelper:e}=this.props.option,{textKey:t,valueKey:l}=this.alias,{fetchApi:a,params:r={},formatter:n=(e=>e),dataKey:i,fieldAliasMap:o}=(null==e?void 0:e.echoRequest)||(null==e?void 0:e.request)||{},s="function"==typeof o?o():o||{},{value:c}=this.props;if(a&&c){this.setState({loading:!0});try{const e=await a(n({...r,keys:c}));if(200===e.code){let a=Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,i)??[];a.forEach((e=>{null!=s&&s.valueKey&&s.valueKey!==l&&(e[l]=e[s.valueKey]),null!=s&&s.textKey&&s.textKey!==t&&(e[t]=e[s.textKey])})),a=a.filter((e=>c.includes(e[l])));const r=a.map((e=>({value:e[l],text:e[t]})));this.setRecords(a),this.setItemList(r)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){const{$$form:e}=this.context,{visible:l,loading:a,itemList:r}=this.state,{value:n}=this.props,{fieldName:i,options:o={},searchHelper:s={},style:c={},placeholder:u=d("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:m=!0,readOnly:h,disabled:f}=this.props.option,{collapseTags:g,maxTagTextLength:b}=o,y={visible:l,title:d("qm.searchHelper.text"),width:s.width??"60%",loading:!!s.name&&void 0,bodyStyle:{paddingBottom:`${Sl[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},v={...s,size:e.$size,multiple:!0,initialValue:(0,Nt.merge)({},s.initialValue),defaultSelectedKeys:n,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}};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(E.Select,{mode:"multiple",maxTagCount:g?"responsive":void 0,maxTagTextLength:b,open:!1,value:n,placeholder:u,loading:a,bordered:p,allowClear:m,disabled:f,style:{width:"100%"},title:e.getViewValue(i),onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},r.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(E.Button,{className:"ant-input-search-button",disabled:f,icon:t().createElement(re.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),t().createElement(It,y,t().createElement(eo,v)))}}Rl(Pl,"contextType",Pt);class Ol extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(Pl,{option:this.props.option,onValuesChange:(t,l,a)=>{p(t,a),e.setViewValue(n,l)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}Rl(Ol,"contextType",Pt);const Al=Ol;function kl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const{Search:Fl}=E.Input;class ql extends e.Component{constructor(e){super(e),kl(this,"searchHelper",void 0),kl(this,"alias",void 0),kl(this,"extras",void 0),kl(this,"valueKey",void 0),kl(this,"_record",void 0),kl(this,"_prevValue",void 0),kl(this,"state",{visible:!1,loading:!1}),kl(this,"initialHandle",(()=>{const{fieldName:e,searchHelper:t}=this.props.option;this.searchHelper=t||{};const{fieldAliasMap:l,extraAliasMap:a,fieldsDefine:r}=this.searchHelper;if(l||h("QmForm","searchHelper 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof l?l():l||{},this.extras="function"==typeof a?a():a||{},r){const e=["valueKey","displayKey","extraKey"];for(const t in r)e.includes(t)&&(this[t]=r[t])}Object.keys(this.alias).includes(e)||h("QmForm","fieldAliasMap 选项必须包含自身 `fieldName` 值"),this.searchHelper.echoRequest&&!this.valueKey&&h("QmForm","echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),kl(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),kl(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),kl(this,"getItemText",(async()=>{const{fetchApi:e,params:t={},formatter:l=(e=>e),dataKey:a,fieldAliasMap:r,extraAliasMap:n}=this.searchHelper.echoRequest||{},i="function"==typeof r?r():r||{},o="function"==typeof n?n():n||{},{value:s}=this.props;if(e&&!s&&this._prevValue){this.setState({loading:!0});try{const r=await e(l({...t,key:this._prevValue}));if(200===r.code){const e=Array.isArray(r.data)?r.data:(0,Nt.get)(r.data,a)??[];if(e[0]){const t=e[0];if(i)for(const e in i)Object.keys(this.alias).includes(e)&&this.alias[e]!==i[e]&&(t[this.alias[e]]=t[i[e]]);if(o)for(const e in o)Object.keys(this.extras).includes(e)&&this.extras[e]!==o[e]&&(t[this.extras[e]]=t[o[e]]);this._record=t,this.setFieldsValue(t)}}}catch(e){}this.setState({loading:!1})}})),kl(this,"setFieldsValue",(e=>{const{$$form:t}=this.context;for(const l in this.alias)t.SET_FIELDS_VALUE({[l]:e[this.alias[l]]});for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:e[this.extras[l]]})})),kl(this,"openSearchHelper",(e=>{const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,a=(l??z.XT)(t.state.formData);null!=a&&a.then?a.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==a&&(this.setVisible(!0),null==e||e())})),kl(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const a in this.alias)a!==l&&t.SET_FIELDS_VALUE({[a]:e[this.alias[a]]});for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:e[this.extras[l]]});this._record=e,this.triggerChange(e[this.alias[l]]);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(e)),200)}))})),kl(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const l in this.alias)l!==t&&e.SET_FIELDS_VALUE({[l]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")})),kl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this._record)})),kl(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),this.initialHandle()}componentDidMount(){this._prevValue=this.getItemValue(),this.getItemText()}componentDidUpdate(){const e=this.getItemValue();e!==this._prevValue&&(this._prevValue=e,this.getItemText())}render(){const{$$form:e}=this.context,{visible:l,loading:a}=this.state,{value:r=""}=this.props,{type:n,options:i={},searchHelper:o={},style:s={},placeholder:c=d("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h}=this.props.option,{prefix:f,suffix:g,maxLength:b}=i,y={visible:l,title:d("qm.searchHelper.text"),width:o.width??"65%",loading:!1,bodyStyle:{paddingBottom:`${Sl[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},v={...o,size:e.$size,initialValue:(0,Nt.merge)({},o.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}};return t().createElement(t().Fragment,null,t().createElement(Fl,{ref:e=>this[`${n}_Ref`]=e,value:r,title:r,loading:a,placeholder:c,style:s,prefix:f,suffix:g,maxLength:b,bordered:u,allowClear:p,readOnly:m,disabled:h,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(It,y,t().createElement(io,v)))}}kl(ql,"contextType",Pt);class Ll extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(ql,{option:this.props.option,onValuesChange:(t,l)=>{p(t,l),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}kl(Ll,"contextType",Pt);const Dl=Ll;function Hl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class $l extends e.Component{constructor(e){var t;super(e),t=this,Hl(this,"searchHelper",void 0),Hl(this,"alias",void 0),Hl(this,"_records",[]),Hl(this,"state",{visible:!1,loading:!1,itemList:[]}),Hl(this,"initialHandle",(()=>{const{searchHelper:e}=this.props.option;this.searchHelper=e||{};const t=this.searchHelper.fieldAliasMap;t||h("QmForm","searchHelper 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof t?t():t||{},Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||h("QmForm","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),Hl(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Hl(this,"setItemList",(e=>{this.setState({itemList:e})})),Hl(this,"setRecords",(e=>{this._records=e})),Hl(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),Hl(this,"openSearchHelper",(e=>{const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,a=(l??z.XT)(t.state.formData);null!=a&&a.then?a.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==a&&(this.setVisible(!0),null==e||e())})),Hl(this,"closeSearchHelper",(function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:a}=t.alias;t.setRecords((0,Nt.uniqBy)([...t._records.filter((e=>l.includes(e[a]))),...e],a));const r=t.recordsToDict();t.setItemList(r),t.triggerChange(r.map((e=>e.value)));const{closed:n}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>null==n?void 0:n(t._records)),200)}))})),Hl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:a}=this.alias;this.setRecords(this._records.filter((t=>e.includes(t[a])))),null==t||t(e),l(e,this.createViewText(e),this._records)})),this.initialHandle()}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:l=[]}=this.props;(0,Nt.isEqual)((0,Nt.intersection)(t,l),l)||(0,Nt.isEqual)(l,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList()}async getItemList(){const{searchHelper:e}=this.props.option,{textKey:t,valueKey:l}=this.alias,{fetchApi:a,params:r={},formatter:n=(e=>e),dataKey:i,fieldAliasMap:o}=(null==e?void 0:e.echoRequest)||(null==e?void 0:e.request)||{},s="function"==typeof o?o():o||{},{value:c}=this.props;if(a&&c){this.setState({loading:!0});try{const e=await a(n({...r,keys:c}));if(200===e.code){let a=Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,i)??[];a.forEach((e=>{null!=s&&s.valueKey&&s.valueKey!==l&&(e[l]=e[s.valueKey]),null!=s&&s.textKey&&s.textKey!==t&&(e[t]=e[s.textKey])})),a=a.filter((e=>c.includes(e[l])));const r=a.map((e=>({value:e[l],text:e[t]})));this.setRecords(a),this.setItemList(r)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){const{$$form:e}=this.context,{visible:l,loading:a,itemList:r}=this.state,{value:n}=this.props,{fieldName:i,options:o={},searchHelper:s={},style:c={},placeholder:u=d("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:m=!0,readOnly:h,disabled:f}=this.props.option,{collapseTags:g,maxTagTextLength:b}=o,y={visible:l,title:d("qm.searchHelper.text"),width:s.width??"65%",loading:!1,bodyStyle:{paddingBottom:`${Sl[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},v={...s,size:e.$size,multiple:!0,initialValue:(0,Nt.merge)({},s.initialValue),defaultSelectedKeys:n,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}};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(E.Select,{mode:"multiple",maxTagCount:g?"responsive":void 0,maxTagTextLength:b,open:!1,value:n,placeholder:u,loading:a,bordered:p,allowClear:m,disabled:f,style:{width:"100%"},title:e.getViewValue(i),onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},r.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(E.Button,{className:"ant-input-search-button",disabled:f,icon:t().createElement(re.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),t().createElement(It,y,t().createElement(io,v)))}}Hl($l,"contextType",Pt);class Ml extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement($l,{option:this.props.option,onValuesChange:(t,l,a)=>{p(t,a),e.setViewValue(n,l)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}Hl(Ml,"contextType",Pt);const Kl=Ml,Vl=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:i={},disabled:o}=e.option,{falseValue:s=Yt,trueValue:c=Gt}=n;return t().createElement(E.Checkbox,{checked:l===c,style:i,disabled:o,onChange:e=>{const{checked:t}=e.target,l=t?c:s;null==a||a(l),r(l)}})};class Ul extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:u,rules:p=[],onChange:m=z.ZT}=this.props.option,{falseValue:h=Yt,trueValue:f=Gt}=o;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(Vl,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(n,d(t===f?"am.form.trueText":"am.form.falseText"))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(Ul,"contextType",Pt);const zl=Ul;function jl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Bl extends e.Component{constructor(){super(...arguments),jl(this,"state",{results:[]})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList()}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:l={},dataKey:a,valueKey:r="value",textKey:n="text"}=e;if(t)try{const e=await t(l);if(200===e.code){const t=(Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[]).map((e=>({value:e[r],text:e[n]})));this.setState({results:t})}}catch(e){}}render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],style:p={},readOnly:m,disabled:h,onChange:f=z.ZT}=this.props.option,{itemList:g=[]}=o,b=(0,z.xb)(g)?this.state.results:g;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(E.Checkbox.Group,{style:{width:"100%",...p},disabled:h,onChange:t=>{const l=b.filter((e=>t.includes(e.value))).map((e=>e.text)).join(",");e.setViewValue(n,l),f(t)}},b.map((e=>t().createElement(E.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text)))))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}jl(Bl,"contextType",Pt);const Wl=Bl;class Gl extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],style:p={},readOnly:m,disabled:h,onChange:f=z.ZT}=this.props.option,{allowHalf:g,count:b=5,tooltips:y}=o;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(E.Rate,{count:b,allowHalf:g,tooltips:y,disabled:h,onChange:t=>{e.setViewValue(n,y?y[Math.ceil(t)-1]:t),f(t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(Gl,"contextType",Pt);const Yl=Gl;function Zl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Xl extends e.Component{constructor(){super(...arguments),Zl(this,"state",{results:[]})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList()}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:l={},dataKey:a,valueKey:r="value",textKey:n="text"}=e;if(t)try{const e=await t(l);if(200===e.code){const t=(Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[]).map((e=>({value:e[r],text:e[n]})));this.setState({results:t})}}catch(e){}}render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],style:p={},readOnly:m,disabled:h,onChange:f=z.ZT}=this.props.option,{itemList:g=[]}=o,b=(0,z.xb)(g)?this.state.results:g;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(E.Radio.Group,{style:{width:"100%",...p},disabled:h,onChange:t=>{var l;const{value:a}=t.target,r=null===(l=b.find((e=>e.value===a)))||void 0===l?void 0:l.text;e.setViewValue(n,r),f(a)}},b.map((e=>t().createElement(E.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text)))))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}Zl(Xl,"contextType",Pt);const Ql=Xl,Jl=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:i={},disabled:o}=e.option,{falseValue:s=Yt,trueValue:c=Gt}=n;return t().createElement(E.Switch,{checked:l===c,style:i,disabled:o,checkedChildren:t().createElement(re.CheckOutlined,null),unCheckedChildren:t().createElement(re.CloseOutlined,null),onChange:e=>{const t=e?c:s;null==a||a(t),r(t)}})};class ea extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:u,rules:p=[],onChange:m=z.ZT}=this.props.option,{falseValue:h=Yt,trueValue:f=Gt}=o;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(Jl,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(n,d(t===f?"am.form.trueText":"am.form.falseText"))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(ea,"contextType",Pt);const ta=ea;class la extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:u,rules:p=[],style:m={},placeholder:h=d("qm.form.inputPlaceholder"),bordered:f=!0,allowClear:g,readOnly:b,disabled:y,onChange:v=z.ZT,onBlur:x=z.ZT,onEnter:C=z.ZT}=this.props.option,{showCount:S,maxLength:w,autoSize:T}=o,I=Object.assign({},{minRows:1,maxRows:3},T);return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(E.Input.TextArea,{placeholder:h,style:m,maxLength:w,showCount:S,autoSize:I,bordered:f,allowClear:g,readOnly:b,disabled:y,onBlur:e=>{const{value:t}=e.target;x(t)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;C(t)}},onChange:t=>{const{value:l}=t.target;e.setViewValue(n,l),v(l)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(la,"contextType",Pt);const aa=la,ra=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:o={},placeholder:s=d("qm.form.datePlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:m}=e.option,{dateType:h="date",minDateTime:f,maxDateTime:g,shortCuts:b=!0}=n,y=t().createRef(),v=e=>{let t=Kt(e,Jt[h]);t&&"date"===h&&(t=t.replace(/\d{2}:\d{2}:\d{2}$/,"00:00:00")),null==a||a(t),r(t)},x=e=>{const t=i()().subtract(e,"day");v(t),y.current.blur(),y.current.focus()};return t().createElement(R,{ref:y,style:{width:"100%",...o},picker:Qt[h],bordered:c,showToday:!1,showTime:"datetime"===h,allowClear:u,disabled:m,inputReadOnly:p,disabledDate:e=>((e,t)=>{let[l,a]=t;return l&&a?e.isBefore(l,"day")||e.isAfter(a,"day"):l?e.isBefore(l,"day"):!!a&&e.isAfter(a,"day")})(e,[f,g]),renderExtraFooter:b?e=>t().createElement(t().Fragment,null,t().createElement(E.Tag,{color:"processing",onClick:()=>x(0)},d("qm.form.datePickers")[0]),t().createElement(E.Tag,{color:"processing",onClick:()=>x(1)},d("qm.form.datePickers")[1]),t().createElement(E.Tag,{color:"processing",onClick:()=>x(7)},d("qm.form.datePickers")[2]),t().createElement(E.Tag,{color:"processing",onClick:()=>x(30)},d("qm.form.datePickers")[3])):void 0,value:Mt(l,Jt[h]),onChange:(e,t)=>{v(e)}})};class na extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(ra,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(na,"contextType",Pt);const ia=na,oa=e=>[i()().subtract(e,"day"),i()()],sa={[d("qm.form.dateRangePickers")[0]]:oa(7),[d("qm.form.dateRangePickers")[1]]:oa(30),[d("qm.form.dateRangePickers")[2]]:oa(90),[d("qm.form.dateRangePickers")[3]]:oa(180)},ca=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:i={},placeholder:o=d("qm.form.daterangePlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:u,disabled:p}=e.option,{dateType:m="date",disableds:h=[!1,!1],minDateTime:f,maxDateTime:g,shortCuts:b=!0}=n;return t().createElement(R.RangePicker,{style:{width:"100%",...i},picker:Qt[m],bordered:s,showTime:"datetime"===m,allowClear:c,disabled:p?[!0,!0]:h,inputReadOnly:u,disabledDate:e=>((e,t)=>{let[l,a]=t;return l&&a?e.isBefore(l,"day")||e.isAfter(a,"day"):l?e.isBefore(l,"day"):!!a&&e.isAfter(a,"day")})(e,[f,g]),ranges:b?sa:void 0,value:(0,z.xb)(l)?null:[Mt(null==l?void 0:l[0],Jt[m]),Mt(null==l?void 0:l[1],Jt[m])],onChange:(e,t)=>{(e=>{let t=[Kt(null==e?void 0:e[0],Jt[m]),Kt(null==e?void 0:e[1],Jt[m])];"date"===m&&(t=t.map(((e,t)=>0===t?e.replace(/\d{2}:\d{2}:\d{2}$/,"00:00:00"):e.replace(/\d{2}:\d{2}:\d{2}$/,"23:59:59")))),null==a||a(t),r(t)})(e)}})};class da extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(ca,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t.join("-"))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(da,"contextType",Pt);const ua=da,pa=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:i={},placeholder:o=d("qm.form.timePlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:u,disabled:p}=e.option,{timeType:m="hour-minute-second",hourStep:h=1,minuteStep:f=1,secondStep:g=1}=n;return t().createElement(k,{style:{width:"100%",...i},bordered:s,showNow:!0,hourStep:h,minuteStep:f,secondStep:g,allowClear:c,disabled:p,inputReadOnly:u,format:el[m],value:Mt(l,el[m]),onChange:(e,t)=>{(e=>{const t=Kt(e,el[m]);null==a||a(t),r(t)})(e)}})};class ma extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(pa,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(ma,"contextType",Pt);const ha=ma,fa=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:i={},placeholder:o=d("qm.form.timerangePlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:u,disabled:p}=e.option,{timeType:m="hour-minute-second",disableds:h=[!1,!1],hourStep:f=1,minuteStep:g=1,secondStep:b=1}=n;return t().createElement(k.RangePicker,{style:{width:"100%",...i},bordered:s,showNow:!1,hourStep:f,minuteStep:g,secondStep:b,allowClear:c,disabled:p?[!0,!0]:h,inputReadOnly:u,format:el[m],value:(0,z.xb)(l)?null:[Mt(null==l?void 0:l[0],el[m]),Mt(null==l?void 0:l[1],el[m])],onChange:(e,t)=>{(e=>{const t=[Kt(null==e?void 0:e[0],el[m]),Kt(null==e?void 0:e[1],el[m])];null==a||a(t),r(t)})(e)}})};class ga extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(fa,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t.join("-"))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(ga,"contextType",Pt);const ba=ga,ya={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 va,xa=null;function Ea(e){return e||null===xa?("object"==typeof Intl&&Intl.Collator?(va=new Intl.Collator(["zh-Hans-CN","zh-CN"]),xa=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):xa=!1,xa):xa}function Ca(e){const t=ya.UNIHANS,l=ya.PINYINS,a=ya.EXCEPTIONS,r={source:e};if(e in a)return r.type=2,r.target=a[e],r;let n,i=-1;if(e.charCodeAt(0)<256)return r.type=1,r.target=e,r;if(n=va.compare(e,"阿"),n<0)return r.type=3,r.target=e,r;if(0===n)r.type=2,i=0;else{if(n=va.compare(e,"鿿"),n>0)return r.type=3,r.target=e,r;0===n&&(r.type=2,i=t.length-1)}if(r.type=2,i<0){let l=0,a=t.length-1;for(;l<=a;){i=~~((l+a)/2);const r=t[i];if(n=va.compare(e,r),0===n)break;n>0?l=i+1:a=i-1}}return n<0&&i--,r.target=l[i],r.target||(r.type=3,r.target=r.source),r}function Sa(e){return"string"==typeof e&&Ea()?e.split("").map((e=>Ca(e))):e}const wa={isSupported:Ea,parse:Sa,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(ya)})))},genToken:Ca,convertToPinyin:(e,t,l)=>Sa(e).map((e=>t&&2===e.type?e.target.toLowerCase():e.target)).join(l||"")},Ta={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}};wa.isSupported()&&Ta.shouldPatch(wa.genToken)&&wa.patchDict(Ta);const Ia=wa;function Na(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const{Option:_a}=E.Select;class Ra extends e.Component{constructor(){super(...arguments),Na(this,"state",{results:[],loading:!1})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList()}createViewText(e,t){var l;return this.props.multiple?t.filter((t=>null==e?void 0:e.includes(t.value))).map((e=>e.text)).join(","):null===(l=t.find((t=>t.value===e)))||void 0===l?void 0:l.text}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:l={},dataKey:a,valueKey:r="value",textKey:n="text"}=e;if(t){this.setState({loading:!0});try{const e=await t(l);if(200===e.code){const t=(Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[]).map((e=>({value:e[r],text:e[n]})));this.setState({results:t})}}catch(e){}this.setState({loading:!1})}}render(){const{$$form:e}=this.context,{loading:l}=this.state,{multiple:a}=this.props,{type:r,label:n,tooltip:i,fieldName:o,invisible:s,options:c={},labelWidth:u=e.props.labelWidth,extra:p,validateTrigger:m,rules:h=[],style:f={},placeholder:g=d("qm.form.selectPlaceholder"),bordered:b=!0,allowClear:y=!0,readOnly:v,disabled:x,onChange:C=z.ZT}=this.props.option,{itemList:S=[],filterable:w=!0,collapseTags:T,maxTagTextLength:I,openPyt:N=!0}=c,_=(0,z.xb)(S)?this.state.results:S;return t().createElement(E.Form.Item,{label:e.renderFormLabel(n),tooltip:i,hidden:s,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(u)},required:e.getFormItemRequired(h)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:o,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(n)}},t().createElement(E.Select,{mode:a?"multiple":void 0,placeholder:g,style:f,loading:l,bordered:b,allowClear:y,disabled:x,showSearch:w,maxTagCount:T?"responsive":void 0,maxTagTextLength:I,title:e.getViewValue(o),filterOption:(e,t)=>{const l=(null==t?void 0:t.children)||"",a=Ia.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(N?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{const l=this.createViewText(t,_);e.setViewValue(o,l),C(t,l)}},_.map((e=>t().createElement(_a,{key:e.value,value:e.value,disabled:e.disabled},e.text)))))),p&&t().createElement(E.Col,{flex:(0,z.PM)(p.labelWidth||Wt)},e.renderFormItemExtra({fieldName:o,...p}))))}}Na(Ra,"contextType",Pt);const Pa=Ra,Oa=require("rc-trigger");var Aa=__webpack_require__.n(Oa);function ka(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Fa extends e.Component{constructor(e){super(e),ka(this,"alias",void 0),ka(this,"extras",void 0),ka(this,"valueKey",void 0),ka(this,"prevValue",""),ka(this,"_record",void 0),ka(this,"_prevValue",void 0),ka(this,"searchRef",t().createRef()),ka(this,"state",{results:[],visible:!1,loading:!1,activeIndex:0}),ka(this,"initialHandle",(()=>{const{fieldName:e,options:t={}}=this.props.option,{fieldAliasMap:l,extraAliasMap:a,fieldsDefine:r}=t;if(l||h("QmForm","immediate 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof l?l():l||{},this.extras="function"==typeof a?a():a||{},r){const e=["valueKey","displayKey","extraKey"];for(const t in r)e.includes(t)&&(this[t]=r[t])}Object.keys(this.alias).includes(e)||h("QmForm","fieldAliasMap 选项必须包含自身 `fieldName` 值"),t.echoRequest&&!this.valueKey&&h("QmForm","echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),ka(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),ka(this,"getItemText",(async()=>{const{options:e={}}=this.props.option,{fetchApi:t,params:l={},formatter:a=(e=>e),dataKey:r,fieldAliasMap:n,extraAliasMap:i}=e.echoRequest||{},o="function"==typeof n?n():n||{},s="function"==typeof i?i():i||{},{value:c}=this.props;if(t&&!c&&this._prevValue){this.setState({loading:!0});try{const e=await t(a({...l,key:this._prevValue}));if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,z.U2)(e.data,r)??[];if(t[0]){const e=t[0];if(o)for(const t in o)Object.keys(this.alias).includes(t)&&this.alias[t]!==o[t]&&(e[this.alias[t]]=e[o[t]]);if(s)for(const t in s)Object.keys(this.extras).includes(t)&&this.extras[t]!==s[t]&&(e[this.extras[t]]=e[s[t]]);this._record=e,this.setFieldsValue(e)}}}catch(e){}this.setState({loading:!1})}})),ka(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const l in this.alias)t.SET_FIELDS_VALUE({[l]:e[this.alias[l]]});for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:e[this.extras[l]]});this._record=e,this.prevValue=e[this.alias[l]]??""})),ka(this,"fetchHandle",(0,z.Ds)(this.getItemList,200)),ka(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),ka(this,"triggerChange",((e,t)=>{const{onChange:l,onValuesChange:a}=this.props;null==l||l(e),t&&a(e,this._record)})),ka(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),ka(this,"clickHandle",((e,t)=>{const{$$form:l}=this.context,{fieldName:a}=this.props.option;for(const t in this.alias)t!==a&&l.SET_FIELDS_VALUE({[t]:e[this.alias[t]]});for(const t in this.extras)l.SET_FIELDS_EXTRA({[t]:e[this.extras[t]]});this.searchRef.current.focus(),this._record=e,this.prevValue=e[this.alias[a]]??"",this.triggerChange(e[this.alias[a]],!0),t&&t()})),this.initialHandle()}componentDidMount(){this._prevValue=this.getItemValue(),this.getItemText()}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList();const n=this.getItemValue();n!==this._prevValue&&(this._prevValue=n,this.getItemText())}async getItemList(e){const{fieldName:t,request:l={}}=this.props.option,{fetchApi:a,params:r={},formatter:n=(e=>e),dataKey:i}=l;if(a){this.setState({loading:!0});try{const l=await a(n({...r,[t]:e}));if(200===l.code){const e=Array.isArray(l.data)?l.data:(0,z.U2)(l.data,i)??[];this.setState({results:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}render(){const{visible:e,loading:l,results:a}=this.state,{value:n}=this.props,{options:i={},style:o={},placeholder:s=d("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:m}=this.props.option,{columns:h=[],hideHeader:f,onlySelect:g=!0}=i,b=ae("form-immediate"),y=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,v=t().createElement(E.Spin,{spinning:l},a.length?t().createElement("table",{cellSpacing:0,cellPadding:0,className:le()("table")},!f&&t().createElement("thead",null,t().createElement("tr",null,h.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,a.map(((e,l)=>t().createElement("tr",{key:l,className:this.state.activeIndex===l?"active":"",onMouseEnter:()=>{this.setState({activeIndex:l})},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},h.filter((e=>!e.hidden)).map((l=>t().createElement("td",{key:l.dataIndex},(0,z.U2)(e,l.dataIndex))))))))):t().createElement(ze,null));return t().createElement(r.Consumer,null,(l=>{const r={[b]:!0,[`${b}--lg`]:"large"===(null==l?void 0:l.size),[`${b}--sm`]:"small"===(null==l?void 0:l.size)};return t().createElement(Aa(),{action:m?[]:["click"],popupVisible:!m&&e,popup:v,popupClassName:le()(r),popupStyle:{minWidth:y,...o},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Xt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(E.Input,{ref:this.searchRef,placeholder:s,allowClear:u,bordered:c,readOnly:p,disabled:m,value:n,title:n,onFocus:()=>{!a.length&&this.fetchHandle(n)},onBlur:e=>{const{value:t}=e.target;g&&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(a[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 l=40===e.keyCode?++t%a.length:(--t+a.length)%a.length;this.setState({activeIndex:l})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),t?(this.handleVisibleChange(!0),this.triggerChange(t,!g)):this.clickHandle({})}}))}))}}ka(Fa,"contextType",Pt);class qa extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(Fa,{option:this.props.option,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",l=arguments.length>1?arguments[1]:void 0;p(t,Object.keys(l).length?l:null),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}ka(qa,"contextType",Pt);const La=qa;class Da extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,fieldName:r,style:n={},collapse:i={}}=this.props.option,{viewData:o,expand:s}=e.state,{showLimit:c,remarkItems:d=[],onCollapse:u=z.ZT}=i,p=[];if(d.length){const t=e.getBlockDerivedItems().find((e=>e[0].fieldName===r))??[],l=c??t.length-1;t.slice(l+1).forEach((e=>{const t=d.find((t=>t.fieldName===e.fieldName));if(!t)return;const l=t.showLabel?`${e.label}:`:"",a=o[e.fieldName]??"";""!==a&&p.push({...e,text:`${l}${a}`})}))}return t().createElement(E.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},t().createElement(oe,{id:r,label:a,extra:p.map((e=>e.text)).join(" | "),style:{...n},collapse:s[r],onCollapseChange:t=>{e.setState((e=>({expand:Object.assign({},e.expand,{[r]:t})}))),u(t)}}))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(Da,"contextType",Pt);const Ha=Da;function $a(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const{TreeNode:Ma}=E.TreeSelect;class Ka extends e.Component{constructor(){super(...arguments),$a(this,"state",{results:[],loading:!1})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList()}getItemText(e,t){var l;return(null===(l=zt(t,e))||void 0===l?void 0:l.text)||""}createViewText(e,t){return this.props.multiple?e.map((e=>this.getItemText(e,t))).filter((e=>!!e)).join(","):this.getItemText(e,t)}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:l={},dataKey:a,valueKey:r="value",textKey:n="text"}=e;if(t){this.setState({loading:!0});try{const e=await t(l);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[],l=Ut(t,r,n);this.setState({results:l})}}catch(e){}this.setState({loading:!1})}}createTreeNode(e){return e.map((e=>Array.isArray(e.children)?t().createElement(Ma,{key:e.value,value:e.value,title:e.text,disabled:e.disabled},this.createTreeNode(e.children)):t().createElement(Ma,{key:e.value,value:e.value,title:e.text,disabled:e.disabled})))}render(){const{$$form:e}=this.context,{loading:l}=this.state,{multiple:a}=this.props,{type:r,label:n,tooltip:i,fieldName:o,invisible:s,options:c={},labelWidth:u=e.props.labelWidth,extra:p,validateTrigger:m,rules:h=[],style:f={},placeholder:g=d("qm.form.selectPlaceholder"),bordered:b=!0,allowClear:y=!0,readOnly:v,disabled:x,onChange:C=z.ZT}=this.props.option,{itemList:S=[],filterable:w=!0,checkStrategy:T="SHOW_CHILD",collapseTags:I,openPyt:N=!0}=c,_=(0,z.xb)(S)?this.state.results:S;return t().createElement(E.Form.Item,{label:e.renderFormLabel(n),tooltip:i,hidden:s,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(u)},required:e.getFormItemRequired(h)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:o,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(n)}},t().createElement(E.TreeSelect,{multiple:a,treeCheckable:a,showCheckedStrategy:E.TreeSelect[T],placeholder:g,style:f,loading:l,bordered:b,allowClear:y,disabled:x,treeDefaultExpandAll:!0,showSearch:w,maxTagCount:I?"responsive":void 0,title:e.getViewValue(o),filterTreeNode:(e,t)=>{const l=(null==t?void 0:t.title)||"",a=Ia.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(N?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{const l=this.createViewText(t,_);e.setViewValue(o,l),C(t,l)}},this.createTreeNode(_)))),p&&t().createElement(E.Col,{flex:(0,z.PM)(p.labelWidth||Wt)},e.renderFormItemExtra({fieldName:o,...p}))))}}$a(Ka,"contextType",Pt);const Va=Ka;function Ua(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const za=e=>{const{$$form:l}=t().useContext(Pt),{value:a,multiple:r,cascaderData:n}=e,{fieldName:i,options:o={},style:s={},placeholder:c=d("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h}=e.option,{changeOnSelect:f,filterable:g=!0,openPyt:b=!0}=o,y=t=>{const{onChange:l,onValuesChange:a}=e;null==l||l(t),a(t)};return t().createElement(E.Cascader,{fieldNames:{label:"text",value:"value",children:"children"},multiple:r,maxTagCount:"responsive",value:(0,z.xb)(a)?[]:r?a.map((e=>e.split(","))):a.split(","),options:n,changeOnSelect:f,placeholder:c,style:s,bordered:u,allowClear:p,disabled:h,showSearch:g&&{filter:(e,t)=>t.some((t=>{const l=(null==t?void 0:t.text)||"",a=Ia.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(b?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0}))},title:l.getViewValue(i),onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];y(r?e.map((e=>e.join(","))):e.join(","))}})};class ja extends e.Component{constructor(){super(...arguments),Ua(this,"state",{results:[],loading:!1})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList()}createViewText(e,t){return this.props.multiple?e.map((e=>jt(t,e).map((e=>e.text)).join("/"))).join(","):jt(t,e).map((e=>e.text)).join("/")}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:l={},dataKey:a,valueKey:r="value",textKey:n="text"}=e;if(t){this.setState({loading:!0});try{const e=await t(l);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[],l=Ut(t,r,n);this.setState({results:l})}}catch(e){}this.setState({loading:!1})}}render(){const{$$form:e}=this.context,{multiple:l}=this.props,{type:a,label:r,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,extra:d,validateTrigger:u,rules:p=[],onChange:m=z.ZT}=this.props.option,{itemList:h=[]}=s,f=(0,z.xb)(h)?this.state.results:h;return t().createElement(E.Form.Item,{label:e.renderFormLabel(r),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(c)},required:e.getFormItemRequired(p)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(za,{option:this.props.option,multiple:l,cascaderData:f,onValuesChange:t=>{const l=this.createViewText(t,f);m(t),e.setViewValue(i,l)}}))),d&&t().createElement(E.Col,{flex:(0,z.PM)(d.labelWidth||Wt)},e.renderFormItemExtra({fieldName:i,...d}))))}}Ua(ja,"contextType",Pt);const Ba=ja,Wa=require("china-area-data");var Ga=__webpack_require__.n(Wa);function Ya(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const Za=["110000","120000","310000","500000"],Xa=["810000","820000"],Qa=[{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"}],Ja=[{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"}],er=e=>Ia.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),tr=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(l>2||!e[t])return;const a="86"===t?Object.keys(e[t]).filter((e=>![...Za,...Xa].includes(e))):Object.keys(e[t]);return a.map((a=>({l:er(e[t][a].slice(0,1)).toUpperCase(),n:e[t][a],c:a,p:t,children:tr(e,a,l+1)})))},lr=(e,t)=>t.map((t=>({l:er(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class ar extends e.Component{constructor(e){super(e),Ya(this,"searchRef",t().createRef()),Ya(this,"scrollRef",t().createRef()),Ya(this,"zxsAndGa",void 0),Ya(this,"provinces",void 0),Ya(this,"allCities",void 0),Ya(this,"letterCities",void 0),Ya(this,"state",{visible:!1,select_type:"0",active_key:""}),Ya(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),Ya(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(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(){this.searchRef.current.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),at()(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:lr(Ga(),Za)},{l:"Z2",n:"港澳",c:"",p:"",children:lr(Ga(),Xa)}]}createProvince(){return(tr(Ga(),"86")??[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Ja.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...Za,...Xa].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return t().createElement(E.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(E.Radio.Button,{value:"0"},d("qm.form.citySelectType.0")),t().createElement(E.Radio.Button,{value:"1"},d("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:l}=this.state;return("0"===l?Qa:Ja).map((l=>t().createElement("li",{key:l.value,className:le()({tag:!0,actived:l.value===e}),onClick:()=>this.scrollHandle(l.value.toString())},l.text)))}renderSelect(){const{value:e}=this.props;return t().createElement(E.Select,{size:"small",placeholder:d("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>((null==t?void 0:t.children)||"").toLowerCase().indexOf(e.toLowerCase())>=0,value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>t().createElement(E.Select.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:l}=this.state;return("0"===l?this.provinces:this.letterCities).map(((l,a)=>{var r;return t().createElement("div",{key:a},t().createElement("dt",{ref:e=>this[`${l.l}Ref`]=e},l.n,":"),t().createElement("dd",null,null===(r=l.children)||void 0===r?void 0:r.map((l=>t().createElement("li",{key:l.c,className:le()({actived:l.c===e}),onClick:()=>this.clickHadnle(l.c)},l.n)))))}))}render(){const{visible:e}=this.state,{value:l}=this.props,{options:a={},style:n={},placeholder:i=d("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:c,disabled:u}=this.props.option,p=ae("form-city-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=t().createElement("div",{className:"container",style:{...n}},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(l)))));return t().createElement(r.Consumer,null,(a=>{const r={[p]:!0,[`${p}--lg`]:"large"===(null==a?void 0:a.size),[`${p}--sm`]:"small"===(null==a?void 0:a.size)};return t().createElement(Aa(),{action:u?[]:["click"],popupVisible:!u&&e,popup:h,popupClassName:le()(r),popupStyle:{minWidth:m,...n},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Xt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(E.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,readOnly:c,disabled:u,value:this.createTextValue(l),onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}}))}))}}Ya(ar,"contextType",Pt);class rr extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(ar,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(n,l)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}Ya(rr,"contextType",Pt);const nr=rr;function ir(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const or=(e,t)=>{if(e[t])return Object.keys(e[t]).map((l=>({text:e[t][l],value:l,children:or(e,l)})))};class sr extends e.Component{constructor(e){super(e),ir(this,"searchRef",t().createRef()),ir(this,"prevText",void 0),ir(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),ir(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this.createTextValue(e)),this.handleVisibleChange(!1)}));const l=or(Ga(),"86")||[];this.state={results:l,visible:!1,values:[],tabs:[l.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:l}=this.props;t!==l&&this.state.values.join(",")!==(l??"")&&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(){this.searchRef.current.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var l,a;return null===(l=this.state.tabs[t])||void 0===l||null===(a=l.find((t=>t.value===e)))||void 0===a?void 0:a.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 l=this.state.tabs.slice(0,1);for(let a=0;a<t.length;a++){const r=zt(e,t[a]);if(r&&(0,z.xb)(r.children)){this.isFetch&&this.getStreetList(t[a]);break}Array.isArray(null==r?void 0:r.children)&&(l[a+1]=null==r?void 0:r.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:l})}async getStreetList(e){const{request:t={}}=this.props.option,{fetchApi:l,formatter:a=(e=>e),dataKey:r,valueKey:n="value",textKey:i="text"}=t;if(l)try{const t=await l(a({code:e}));if(200===t.code){const e=Array.isArray(t.data)?t.data:(0,z.U2)(t.data,r)??[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[i],value:e[n]})))]})))}}catch(e){}}renderTabs(){const{values:e}=this.state,l=this.state.tabs.map(((l,a)=>{var r;const n=(null===(r=l.find((t=>t.value===e[a])))||void 0===r?void 0:r.text)||`${d("qm.form.selectPlaceholder").replace("...","")}(${d("qm.form.regionSelectLabel")[a]})`;return t().createElement(E.Tabs.TabPane,{key:a.toString(),tab:n},t().createElement("div",{className:"region-box"},l.map((l=>t().createElement("span",{key:l.value,className:le()({"region-box__item":!0,actived:e.includes(l.value.toString())}),title:l.text,onClick:()=>{let{values:e}=this.state;e[a]=l.value.toString(),e=e.slice(0,a+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.leave-1:this.leave;if(a+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(a+1)}))}},l.text)))))}));return l.length?t().createElement(E.Tabs,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},l):t().createElement(ze,null)}render(){const{visible:e}=this.state,{value:l}=this.props,{options:a={},style:n={},placeholder:i=d("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:c,disabled:u}=this.props.option,p=ae("form-region-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=t().createElement("div",{className:"container",style:{...n}},this.renderTabs());let f=this.prevText;if(!e){const e=this.createTextValue(l);(""===e||e.split("/").every((e=>""!==e)))&&(f=e,this.prevText=f)}return t().createElement(r.Consumer,null,(l=>{const a={[p]:!0,[`${p}--lg`]:"large"===(null==l?void 0:l.size),[`${p}--sm`]:"small"===(null==l?void 0:l.size)};return t().createElement(Aa(),{action:u?[]:["click"],popupVisible:!u&&e,popup:h,popupClassName:le()(a),popupStyle:{minWidth:m,...n},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Xt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(E.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,readOnly:c,disabled:u,value:f,title:f,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&(0,z.Y3)((()=>this.initial()))}}))}))}}ir(sr,"contextType",Pt);class cr extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(sr,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(n,l)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}ir(cr,"contextType",Pt);const dr=cr,ur=e=>{const{$$form:l}=t().useContext(Pt),{value:a,onChange:r,onValuesChange:n}=e,{options:i={},upload:o={},style:s={},disabled:c}=e.option,{multiple:d=!0,maxCount:u=1,fileTypes:p,fileSize:m,onRemove:h}=i,{action:f,headers:g,params:b,withCredentials:y=!1,dataKey:v="",fieldAliasMap:x}=o,E="function"==typeof x?x():x||{};return t().createElement(en,{name:"file",action:f,multiple:d,headers:g,data:b,withCredentials:y,maxCount:u,fileTypes:p,fileSize:m,disabled:c||l.isOnlyShow,showUploadList:{showDownloadIcon:!0,downloadIcon:t().createElement(re.DownloadOutlined,null)},fileList:a,onChange:e=>{let{file:t,fileList:l}=e;(e=>{const t=e.map((e=>{var t,l;const a={};for(const t in E){var r,n;a[t]=(null===(r=e.response)||void 0===r||null===(n=r.data)||void 0===n?void 0:n[E[t]])||""}return{uid:e.uid,name:e.name,...a,url:e.url||(v?(0,z.U2)(null===(l=e.response)||void 0===l?void 0:l.data,v):null===(t=e.response)||void 0===t?void 0:t.data)||"",status:e.status}}));null==r||r(t),n(t.filter((e=>"done"===e.status&&e.url)))})(l)},onRemove:h})};class pr extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(ur,{option:this.props.option,onValuesChange:t=>{t.length&&(p(t),e.setViewValue(n,""))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(pr,"contextType",Pt);const mr=pr,hr=e=>{const{$$form:l}=t().useContext(Pt),{value:a,onChange:r,onValuesChange:n}=e,{options:i={},upload:o={},style:s={},disabled:c}=e.option,{multiple:d=!0,maxCount:u=1,fixedSize:p,quality:m,fileTypes:h,fileSize:f,onRemove:g}=i,{action:b,headers:y,params:v,withCredentials:x=!1,dataKey:E="",fieldAliasMap:C}=o,S="function"==typeof C?C():C||{};return t().createElement(sn,{name:"file",action:b,multiple:d,headers:y,data:v,withCredentials:x,maxCount:u,fixedSize:p,quality:m,fileTypes:h,fileSize:f,disabled:c||l.isOnlyShow,fileList:a,onChange:e=>{let{file:t,fileList:l}=e;(e=>{const t=e.map((e=>{var t,l;const a={};for(const t in S){var r,n;a[t]=(null===(r=e.response)||void 0===r||null===(n=r.data)||void 0===n?void 0:n[S[t]])||""}return{uid:e.uid,name:e.name,...a,url:e.url||(E?(0,z.U2)(null===(l=e.response)||void 0===l?void 0:l.data,E):null===(t=e.response)||void 0===t?void 0:t.data)||"",status:e.status}}));null==r||r(t),n(t.filter((e=>"done"===e.status&&e.url)))})(l)},onRemove:g})};class fr extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(hr,{option:this.props.option,onValuesChange:t=>{t.length&&(p(t),e.setViewValue(n,""))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(fr,"contextType",Pt);const gr=fr,br=e=>{const{$$form:l}=t().useContext(Pt),{value:a,onChange:r,onValuesChange:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.inputPlaceholder"),readOnly:c,disabled:u}=e.option,{tinymceHeight:p}=i;return t().createElement(jr,{height:p,style:o,disabled:c||u||l.isOnlyShow,value:a,onChange:e=>{null==r||r(e),n(e)}})};class yr extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(br,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(yr,"contextType",Pt);const vr=yr;function xr(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Er extends e.Component{constructor(e){super(e),xr(this,"provide",{$$form:this}),xr(this,"_initialValues",void 0),xr(this,"_initialOthers",void 0),xr(this,"_initialExtras",void 0),xr(this,"wrapperRef",t().createRef()),xr(this,"formRef",t().createRef()),xr(this,"state",{formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:this.props.cols??4,collapse:!1}),xr(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 l=Math.floor(t/300);l=24%l==0?l:l-1,l=l<1?1:l,l=l>8?8:l,l!==this.state.flexCols&&this.setState({flexCols:l})})),xr(this,"resizeListenerHandle",(0,z.Ds)(this.resizeObserveHandler,10)),xr(this,"getFormItems",Rt()((e=>e.filter((e=>!e.noAuth&&!e.hidden))))),xr(this,"getFlattenItems",Rt()((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{(0,z.Kn)(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t}))),xr(this,"valuesChangeHandle",((e,t)=>{var l,a;null===(l=(a=this.props).onValuesChange)||void 0===l||l.call(a,e,this._initialValues)})),xr(this,"fieldsChangeHandle",((e,t)=>{var l,a;null===(l=(a=this.props).onFieldsChange)||void 0===l||l.call(a,e,t)})),xr(this,"finishHandle",(e=>{var t,l;null===(t=(l=this.props).onFinish)||void 0===t||t.call(l,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))})),xr(this,"finishFailedHandle",(e=>{var t,l;let{values:a,errorFields:r}=e;null===(t=(l=this.props).onFinishFailed)||void 0===t||t.call(l,r)})),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.getFormAuth(),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 showDividerCollapse(){return this.dividers.some((e=>!!e.collapse))}get showFilterCollapse(){const{isCollapse:e}=this.props;return e&&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(){Ft(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){qt(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&&h("QmForm","配置项 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)),l={};for(const a in e)t.includes(a)||(l[a]=e[a]);return Object.assign({},l)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>(0,z.Kn)(e.extra))).forEach((l=>{t[l.fieldName]=e[l.fieldName]??""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>(0,z.Kn)(e.collapse))).forEach((t=>{e[t.fieldName]=t.collapse.defaultExpand??!1})),Object.assign({},e)}getInitialValue(e,t){const{type:l,options:a}=e;return t=t??void 0,Zt.includes(l)&&(t=t??[]),"CHECKBOX"!==l&&"SWITCH"!==l||(t=t??(null==a?void 0:a.falseValue)??Yt),t}createFormValue(e){const t={};return this.flattenItems.forEach((l=>{t[l.fieldName]=this.getInitialValue(l,e[l.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]:"";const{viewData:l}=this.state;t!==l[e]&&this.setState((l=>({viewData:Object.assign({},l.viewData,{[e]:t})})))}getViewValue(e){return this.state.viewData[e]??""}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:l}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!l||setTimeout((()=>{var e;return null===(e=this[`${l}_Ref`])||void 0===e?void 0:e.focus()}))}getFormItemLabel(e){var t,l;if("string"==typeof e)return e;const{fieldName:a,options:r={}}=e,{itemList:n=[]}=r;if(!n.length)return h("QmForm",`fieldName 为 ${a} 的表单项的 \`itemList\` 配置有误`),"";const i=(null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([a])[a])??this._initialValues[a]??n[0].value;return(null===(l=n.find((e=>e.value===i)))||void 0===l?void 0:l.text)||""}getBlockDerivedItems(){const e=[];for(let t=0,l=this.dividers.length;t<l;t++){const l=this.formItems.findIndex((e=>e===this.dividers[t]));let a=this.formItems.findIndex((e=>e===this.dividers[t+1]));a=a>-1?a:void 0,e.push(this.formItems.slice(l,a).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay(e){let{type:t,fieldName:l}=e;if("DIVIDER"===t)return!0;const a=this.getBlockDerivedItems();for(let e=0,t=a.length;e<t;e++){var r;const t=a[e],n=this.dividers.find((e=>e.fieldName===t[0].fieldName)),i=(null==n||null===(r=n.collapse)||void 0===r?void 0:r.showLimit)??t.length-1;for(let e=1;e<t.length;e++)if(t[e].fieldName===l&&e>i)return this.state.expand[t[0].fieldName]}return!0}formatFormValue(e){for(const t in e){const l=e[t];if(Vt(l)&&(e[t]=""),Array.isArray(l)&&l.forEach(((l,a)=>{Vt(l)&&(e[t][a]="")})),t.includes("|")&&Array.isArray(l)){const[a,r]=t.split("|");e[a]=l[0]??"",e[r]=l[1]??""}}if(this.isFilterType)for(const t in e)(0,z.xb)(e[t])&&(e[t]=void 0);return e}createFormAuth(){if(!this.props.authCode)return;const e=(0,z.Y6)(this.props.authCode);if(e){var t,l;const{fieldList:a=[]}=e,r=this.props.items.map((e=>{const{fieldName:t}=e,l=a.find((e=>e.dataIndex===t));if(l){const{visible:t=1,disabled:a,secretName:r}=l;t||(e.noAuth=!0),a&&(e.disabled=!0),r&&(e.options?e.options.secretType=r:e.options={secretType:r})}return e}));null===(t=(l=this.props).fieldsChange)||void 0===t||t.call(l,r)}}async getFormAuth(){var e;if(null===(e=this.props.authConfig)||void 0===e||!e.fetch)return;const{api:t,params:l,dataKey:a}=this.props.authConfig.fetch;try{const e=await t(l);if(200===e.code){var r,n;const t=Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[],l=!!(0,z.U2)(e.data,"reverse"),i=this.props.items.map((e=>{const{fieldName:a}=e;return(l?!t.includes(a):t.includes(a))&&(e.noAuth=!0),e}));null===(r=(n=this.props).fieldsChange)||void 0===r||r.call(n,i)}}catch(e){}}INPUT(e){return t().createElement(dl,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return t().createElement(hl,{option:e})}INPUT_NUMBER(e){return t().createElement(yl,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return t().createElement(Cl,{option:e})}SEARCH_HELPER(e){return t().createElement(_l,{option:e})}MULTIPLE_SEARCH_HELPER(e){return t().createElement(Al,{option:e})}TREE_TABLE_HELPER(e){return t().createElement(Dl,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return t().createElement(Kl,{option:e})}CHECKBOX(e){return t().createElement(zl,{option:e})}MULTIPLE_CHECKBOX(e){return t().createElement(Wl,{option:e})}RATE(e){return t().createElement(Yl,{option:e})}RADIO(e){return t().createElement(Ql,{option:e})}SWITCH(e){return t().createElement(ta,{option:e})}TEXT_AREA(e){return t().createElement(aa,{option:e})}DATE(e){return t().createElement(ia,{option:e})}RANGE_DATE(e){return t().createElement(ua,{option:e})}TIME(e){return t().createElement(ha,{option:e})}RANGE_TIME(e){return t().createElement(ba,{option:e})}SELECT(e){return t().createElement(Pa,{option:e})}MULTIPLE_SELECT(e){return t().createElement(Pa,{option:e,multiple:!0})}IMMEDIATE(e){return t().createElement(La,{option:e})}DIVIDER(e){return t().createElement(Ha,{option:e})}TREE_SELECT(e){return t().createElement(Va,{option:e})}MULTIPLE_TREE_SELECT(e){return t().createElement(Va,{option:e,multiple:!0})}CASCADER(e){return t().createElement(Ba,{option:e})}MULTIPLE_CASCADER(e){return t().createElement(Ba,{option:e,multiple:!0})}CITY_SELECT(e){return t().createElement(nr,{option:e})}REGION_SELECT(e){return t().createElement(dr,{option:e})}UPLOAD_FILE(e){return t().createElement(mr,{option:e})}UPLOAD_IMG(e){return t().createElement(gr,{option:e})}TINYMCE(e){return t().createElement(vr,{option:e})}renderFormLabel(e){if(!(0,z.Kn)(e))return e;const{type:l,fieldName:a,options:r={},disabled:n,onChange:i=z.ZT}=e,{itemList:o=[]}=r;return t().createElement(E.Form.Item,{name:a,noStyle:!0},"SELECT"===l&&t().createElement(E.Select,{placeholder:"",disabled:n,style:{width:"calc(100% - 8px)"},onChange:e=>i(e,o.find((t=>t.value===e)).text)},o.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text)))))}renderFormItemExtra(e){const{fieldName:l,isTooltip:a,style:r={}}=e,{extra:n}=this.state;return a?t().createElement(E.Tooltip,{className:le()("extra-tooltip"),title:n[l]},t().createElement(re.ExclamationCircleOutlined,null)):t().createElement("div",{className:le()("extra-text"),title:n[l],style:r},t().createElement("span",{className:"extra-overflow-cut"},n[l]))}renderFormItem(e){const{label:l,fieldName:a,labelWidth:r=this.props.labelWidth,rules:n=[],style:i={},render:o}=e;return(0,z.xb)(this.state.formData)?null:t().createElement(E.Form.Item,{label:l,name:a,rules:n,style:{width:"100%",...i},labelCol:{flex:(0,z.PM)(r)}},null==o?void 0:o(e,this))}createFormItem(e){return(0,z.mf)(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(h("QmForm",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:l,defaultRows:a,isFieldsDefine:r}=this.props,n=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:l=0}=e;for(let e=0;e<t;e++)n.push({});n.push(e);for(let e=0;e<l;e++)n.push({})}));const i=24/e,o=[],s=n.reduce(((e,t)=>{const{selfCol:l=1}=t,a=e+l;return o.push(a),a}),0),c=a>Math.ceil(s/e)?Math.ceil(s/e):a,d=[],u=n.map(((l,a)=>{let{selfCol:r=1}=l;const{type:n,fieldName:s}=l;r=r>=24||"DIVIDER"===n||"TINYMCE"===n?e:r;const u=!(!this.state.collapse&&this.showFilterCollapse)||o[a]<c*e,p=!this.showDividerCollapse||this.getFormItemDisplay(l);return u&&d.push(o[a]),t().createElement(E.Col,{key:s??a,span:r*i,style:this.isFilterType?{display:!this.showFilterCollapse||u?"block":"none"}:{display:p?"block":"none"}},n?this.createFormItem((0,Nt.cloneDeep)(l)):null)}));return r&&"default"===l&&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:l,collapse:a}=this.state,{isSearchBtn:r,isFieldsDefine:n=!0}=this.props;if(!this.isFilterType)return null;const i=24/l,o=l-e%l-1;return r?t().createElement(E.Col,{key:"-",span:i,offset:o*i,style:{textAlign:"right"}},t().createElement(E.Space,{style:{marginBottom:12}},t().createElement(G,{type:"primary",size:this.$size,icon:t().createElement(re.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},d("qm.form.search")),t().createElement(G,{size:this.$size,icon:t().createElement(re.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},d("qm.form.reset")),n?this.createFieldsDefine():null,this.showFilterCollapse&&t().createElement("a",{onClick:()=>this.setExpandHandle(!a)},a?t().createElement(re.UpOutlined,null):t().createElement(re.DownOutlined,null)," ",d(a?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:l,isSubmitBtn:a}=this.props;if(this.isFilterType)return null;const r=24/e;return a&&"default"===l?t().createElement(E.Row,{gutter:0},t().createElement(E.Col,{key:"-",span:r},t().createElement(E.Form.Item,null,t().createElement(E.Space,{style:{marginBottom:12}},t().createElement(G,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},d("qm.form.save")),t().createElement(G,{size:this.$size,onClick:()=>this.RESET_FORM()},d("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:l,fieldsChange:a}=this.props;return t().createElement(il,{uniqueKey:e,items:l,fieldsChange:a})}setExpandHandle(e){this.setState({collapse:e},(()=>{var e,t;null===(e=(t=this.props).onCollapse)||void 0===e||e.call(t,this.state.collapse)}))}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}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.formRef.current.validateFields();return[null,Object.assign({},this.get_fields_other(),this.formatFormValue(e))]}catch({errorFields:e}){return this.formRef.current.scrollToField(e[0].name),[e,null]}}SET_FIELDS_EXTRA(e){this.setState((t=>({extra:Object.assign({},t.extra,e)})))}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)}SUBMIT_FORM(){this.formRef.current.submit()}RESET_FORM(){var e,t;this.formRef.current.resetFields(),this.setState({other:this._initialOthers}),this.setState({extra:this._initialExtras}),null===(e=(t=this.props).onReset)||void 0===e||e.call(t)}render(){const{className:e,style:l,layout:a,labelWidth:r,labelAlign:n,customClass:i}=this.props,o=ae("form"),s={required:"${label}"+d("qm.form.requiredTips")},c={[o]:!0,[`${o}--lg`]:"large"===this.$size,[`${o}--sm`]:"small"===this.$size,[`${o}__only-show`]:this.isOnlyShow,[i]:!!i};return t().createElement("div",{ref:this.wrapperRef,className:le()(c,e),style:l},t().createElement(E.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:a,labelAlign:n,colon:!1,labelCol:{flex:this.verticalLayout?"initial":(0,z.PM)(r)},scrollToFirstError:!0,validateMessages:s,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},t().createElement(Pt.Provider,{value:this.provide},t().createElement(E.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}xr(Er,"contextType",r),xr(Er,"propTypes",tl),xr(Er,"defaultProps",ll);const Cr=Er,Sr={onActivate:l.func,onAddUndo:l.func,onBeforeAddUndo:l.func,onBeforeExecCommand:l.func,onBeforeGetContent:l.func,onBeforeRenderUI:l.func,onBeforeSetContent:l.func,onBeforePaste:l.func,onBlur:l.func,onChange:l.func,onClearUndos:l.func,onClick:l.func,onContextMenu:l.func,onCopy:l.func,onCut:l.func,onDblclick:l.func,onDeactivate:l.func,onDirty:l.func,onDrag:l.func,onDragDrop:l.func,onDragEnd:l.func,onDragGesture:l.func,onDragOver:l.func,onDrop:l.func,onExecCommand:l.func,onFocus:l.func,onFocusIn:l.func,onFocusOut:l.func,onGetContent:l.func,onHide:l.func,onInit:l.func,onKeyDown:l.func,onKeyPress:l.func,onKeyUp:l.func,onLoadContent:l.func,onMouseDown:l.func,onMouseEnter:l.func,onMouseLeave:l.func,onMouseMove:l.func,onMouseOut:l.func,onMouseOver:l.func,onMouseUp:l.func,onNodeChange:l.func,onObjectResizeStart:l.func,onObjectResized:l.func,onObjectSelected:l.func,onPaste:l.func,onPostProcess:l.func,onPostRender:l.func,onPreProcess:l.func,onProgressState:l.func,onRedo:l.func,onRemove:l.func,onReset:l.func,onSaveContent:l.func,onSelectionChange:l.func,onSetAttrib:l.func,onSetContent:l.func,onShow:l.func,onSubmit:l.func,onUndo:l.func,onVisualAid:l.func},wr={apiKey:l.string,id:l.string,inline:l.bool,init:l.object,initialValue:l.string,onEditorChange:l.func,outputFormat:l.oneOf(["html","text"]),value:l.string,tagName:l.string,cloudChannel:l.string,plugins:l.oneOfType([l.string,l.array]),toolbar:l.oneOfType([l.string,l.array]),disabled:l.bool,textareaName:l.string,tinymceScriptSrc:l.string,scriptLoading:l.shape({async:l.bool,defer:l.bool,delay:l.number}),...Sr},Tr=e=>"function"==typeof e,Ir=e=>e in Sr,Nr=e=>e.substr(2),_r=(e,t,l,a,r)=>((t,l,a,r,n,i,o)=>{const s=Object.keys(n).filter(Ir),c=Object.keys(i).filter(Ir),d=s.filter((e=>void 0===i[e])),u=c.filter((e=>void 0===n[e]));d.forEach((e=>{const t=Nr(e),l=o[t];a(t,l),delete o[t]})),u.forEach((a=>{const r=((t,l)=>a=>{var r;return null===(r=t(l))||void 0===r?void 0:r(a,e)})(t,a),n=Nr(a);o[n]=r,l(n,r)}))})(r,e.on.bind(e),e.off.bind(e),0,t,l,a);let Rr=0;const Pr=e=>{const t=Date.now(),l=Math.floor(1e9*Math.random());return Rr++,e+"_"+l+Rr+String(t)},Or=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),Ar=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),kr=(e,t)=>Ar(e).concat(Ar(t)),Fr=e=>{let t=e,l=e.parentNode;for(;null!=l;)t=l,l=t.parentNode;return t===e.ownerDocument},qr=()=>({listeners:[],scriptId:Pr("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),Lr=(()=>{let e=qr();return{load:(t,l,a,r,n,i)=>{const o=()=>((t,l,a,r,n,i)=>{const o=l.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.id=t,o.src=a,o.async=r,o.defer=n;const s=()=>{o.removeEventListener("load",s),e.listeners.forEach((e=>e())),e.scriptLoaded=!0};o.addEventListener("load",s),l.head&&l.head.appendChild(o)})(e.scriptId,t,l,a,r);e.scriptLoaded?i():(e.listeners.push(i),e.scriptLoading||(e.scriptLoading=!0,n>0?setTimeout(o,n):o()))},reinitialize:()=>{e=qr()}}})(),Dr=()=>{const e="undefined"!=typeof window?window:__webpack_require__.g;return e&&e.tinymce?e.tinymce:null};function Hr(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const $r=()=>{var e,t,l;return null!==(e=Dr())&&void 0!==e&&null!==(t=e.Env)&&void 0!==t&&null!==(l=t.browser)&&void 0!==l&&l.isIE()?"change keyup compositionend setcontent":"change input compositionend setcontent"},Mr=()=>window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange";class Kr extends e.Component{constructor(t){var l,a;super(t),l=this,Hr(this,"editor",void 0),Hr(this,"id",void 0),Hr(this,"elementRef",void 0),Hr(this,"inline",void 0),Hr(this,"currentContent",void 0),Hr(this,"boundHandlers",void 0),Hr(this,"rollbackTimer",void 0),Hr(this,"valueCursor",void 0),Hr(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})),Hr(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){}})),Hr(this,"handleBeforeInputSpecial",(e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)})),Hr(this,"handleEditorChange",(e=>{const t=this.editor;if(t&&t.initialized){const e=t.getContent();if(void 0!==this.props.value&&this.props.value!==e&&(this.rollbackTimer||(this.rollbackTimer=window.setTimeout(this.rollbackChange,200))),e!==this.currentContent&&(this.currentContent=e,Tr(this.props.onEditorChange))){var l,a;const r=this.props.outputFormat,n="html"===r?e:t.getContent({format:r});null===(l=(a=this.props).onEditorChange)||void 0===l||l.call(a,n,t)}}})),Hr(this,"handleEditorChangeSpecial",(e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)})),Hr(this,"initialise",(function(){var e,t;let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const r=l.elementRef.current;if(!r)return;if(!Fr(r)){if(0===a)setTimeout((()=>l.initialise(1)),1);else{if(!(a<11))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>l.initialise(a+1)),100)}return}const n=Dr();if(!n)throw new Error("tinymce should have been loaded into global scope");const i={...l.props.init,selector:void 0,target:r,readonly:l.props.disabled,inline:l.inline,plugins:kr(null===(e=l.props.init)||void 0===e?void 0:e.plugins,l.props.plugins),toolbar:l.props.toolbar??(null===(t=l.props.init)||void 0===t?void 0:t.toolbar),setup:e=>{l.editor=e,l.bindHandlers({}),l.inline&&!Or(r)&&e.once("PostRender",(t=>{e.setContent(l.getInitialValue(),{no_events:!0})})),l.props.init&&Tr(l.props.init.setup)&&l.props.init.setup(e)},init_instance_callback:e=>{const t=l.getInitialValue();l.currentContent=l.currentContent??e.getContent(),l.currentContent!==t&&(l.currentContent=t,e.setContent(t),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const a=l.props.disabled??!1;e.setMode(a?"readonly":"design"),l.props.init&&Tr(l.props.init.init_instance_callback)&&l.props.init.init_instance_callback(e)}};l.inline||(r.style.visibility=""),Or(r)&&(r.value=l.getInitialValue()),n.init(i)})),this.id=this.props.id||Pr("tiny-react"),this.elementRef=e.createRef(),this.inline=this.props.inline??(null===(a=this.props.init)||void 0===a?void 0:a.inline)??!1,this.boundHandlers={}}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 l=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const a of[t,l])if(a)try{e.selection.moveToBookmark(a),this.valueCursor=a;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=this.props.disabled??!1;this.editor.setMode(e?"readonly":"design")}}}componentDidMount(){if(null!==Dr())this.initialise();else if(this.elementRef.current&&this.elementRef.current.ownerDocument){var e,t,l;Lr.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===(l=this.props.scriptLoading)||void 0===l?void 0:l.delay)??0,this.initialise)}}componentWillUnmount(){const e=this.editor;e&&(e.off($r(),this.handleEditorChange),e.off(Mr(),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()}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){_r(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,l=t(e),a=t(this.props);!l&&a?(this.editor.on($r(),this.handleEditorChange),this.editor.on(Mr(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):l&&!a&&(this.editor.off($r(),this.handleEditorChange),this.editor.off(Mr(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}function Vr(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}var Ur;Hr(Kr,"propTypes",wr),Hr(Kr,"defaultProps",{cloudChannel:"5"}),function(e){e["zh-cn"]="zh_CN",e.en="en"}(Ur||(Ur={}));class zr extends e.Component{render(){var e;const{size:l,className:a,style:r,height:n,tinymceScriptSrc:i,plugins:o,toolbar:s,disabled:c,value:d,onChange:u=z.ZT}=this.props,p=this.context.global,m=this.context.locale,h=l||this.context.size||"",f=ae("tinymce"),g={[f]:!0,[`${f}--lg`]:"large"===h,[`${f}--sm`]:"small"===h},b={init:{height:n,plugins:o,toolbar:s,menubar:"file edit view insert format tools table help",language:Ur[m],images_upload_handler:(e,t,l)=>{(new FormData).append("file",e.blob(),e.filename()),t(`data:image/jpeg;base64,${e.base64()}`)}},value:d,disabled:c,tinymceScriptSrc:i||(null==p||null===(e=p.tinymce)||void 0===e?void 0:e.scriptSrc)||void 0,onEditorChange:(e,t)=>{u(t.getContent())}};return t().createElement("div",{className:le()(g,a),style:r},t().createElement(Kr,b))}}Vr(zr,"contextType",r),Vr(zr,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmTinymce","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},height:(e,t,l)=>{if(!(0,z.hj)(e[t])&&!f(e[t]))return m("QmTinymce","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")}}),Vr(zr,"defaultProps",{height:400,plugins:"preview importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons",toolbar:"undo redo | formatselect | bold italic underline strikethrough | fontfamily fontsize blocks | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview print | lists image media table template link unlink anchor codesample code | ltr rtl"});const jr=zr,Br=require("cropperjs");var Wr=__webpack_require__.n(Br);function Gr(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Yr extends e.Component{constructor(){super(...arguments),Gr(this,"imgRef",t().createRef()),Gr(this,"cropper",void 0)}componentDidMount(){const{className:e,style:t,src:l,alt:a,imgStyle:r,...n}=this.props,i={};for(const e in n)void 0!==this.props[e]&&(i[e]=this.props[e]);this.cropper=new(Wr())(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:l,src:a,alt:r,imgStyle:n}=this.props,i={[ae("cropper")]:!0};return t().createElement("div",{className:le()(i,e),style:l},t().createElement("img",{ref:this.imgRef,src:a,alt:r,style:{maxWidth:"100%",...n}}))}}Gr(Yr,"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 Zr=Yr;function Xr(){return Xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Xr.apply(this,arguments)}function Qr(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Jr extends e.Component{constructor(){super(...arguments),Qr(this,"state",{loading:!1}),Qr(this,"beforeUpload",((e,t)=>new Promise((async(l,a)=>{const{fileTypes:r=[],fileSize:n,beforeUpload:i}=this.props,o=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),s=!n||e.size/1024/1024<n,c=o&&s;if(o||E.message.warning(d("qm.upload.tooltip",{type:r.join(",")})),s||E.message.warning(d("qm.upload.sizeLimit",{size:n})),!c)return c||E.Upload.LIST_IGNORE;if(i){const r=i(e,t);if(!0===r)return l(e);if(!1===r)return a("not upload");if(r&&"function"==typeof r.then)try{l(await r)}catch(e){a(e)}}l(e)}))))}async downloadFile(e,t){const l=await Ge()({url:e,responseType:"blob"}),a=l.data,r=l.headers["content-disposition"],n=t||(r?r.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Ye(a,n)}render(){const{loading:e}=this.state,{disabled:l,onChange:a}=this.props,r=ae("upload-file");return t().createElement(E.Upload,Xr({className:r},this.props,{beforeUpload:this.beforeUpload,onChange:e=>{null==a||a(e),this.setState({loading:!1})},onDownload:async e=>{try{e.url&&await this.downloadFile(e.url,e.name)}catch(e){E.message.error(d("qm.download.error"))}}}),this.props.children?this.props.children:t().createElement(E.Button,{icon:t().createElement(re.UploadOutlined,null),loading:e,disabled:l},d("qm.upload.text")))}}Qr(Jr,"defaultProps",{name:"file",multiple:!0,showUploadList:{showDownloadIcon:!0,downloadIcon:t().createElement(re.DownloadOutlined,null)}});const en=Jr;function tn(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class ln extends e.Component{constructor(){super(...arguments),tn(this,"cropperRef",t().createRef()),tn(this,"beforeUploadRef",void 0),tn(this,"fileRef",void 0),tn(this,"resolveRef",void 0),tn(this,"rejectRef",void 0),tn(this,"state",{src:""}),tn(this,"confirmHandle",(async()=>{const{quality:e}=this.props,{type:t,name:l,uid:a}=this.fileRef;this.cropperRef.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===t?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((async e=>{let r=new File([e],l,{type:t});r.uid=a;const{fileTypes:n=[],fileSize:i}=this.props;if(n.length&&!n.includes(r.name.slice(r.name.lastIndexOf(".")+1).toLowerCase()))return E.message.warning(d("qm.upload.tooltip",{type:n.join(",")})),this.rejectRef("file type is error");if("function"!=typeof this.beforeUploadRef)return this.resolveRef(r);const o=this.beforeUploadRef(r,[r]);if("boolean"==typeof o||o){if(!0===o)return this.resolveRef(r);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||(r=e),this.resolveRef(r)}catch(e){this.rejectRef(e)}}else h("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}),t,e),await(0,z._v)(100),this.onClose()})),tn(this,"onOk",(()=>{this.confirmHandle()})),tn(this,"onClose",(()=>{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:l}=this.props,a=Array.isArray(e)?e[0]:e;if(!a)return null;const{beforeUpload:r,...n}=a.props;return this.beforeUploadRef=r,t().createElement(a.type,{...n,beforeUpload:(e,t)=>new Promise((async(a,r)=>{if(l&&!await l(e,t))return void r();this.fileRef=e,this.resolveRef=a,this.rejectRef=r;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(Zr,{ref:this.cropperRef,"aspect-ratio":e?e[0]/e[1]:e,src:this.state.src,"drag-mode":"move",preview:".preview"})),t().createElement("div",{className:"actions"},t().createElement(E.Space,{size:"small"},t().createElement(E.Button,{type:"primary",size:"middle",icon:t().createElement(re.ZoomInOutlined,null),onClick:()=>this.scaleHandle(.2)},d("qm.uploadCropper.zoomIn")),t().createElement(E.Button,{type:"primary",size:"middle",icon:t().createElement(re.ZoomOutOutlined,null),onClick:()=>this.scaleHandle(-.2)},d("qm.uploadCropper.zoomOut")),t().createElement(E.Button,{type:"primary",size:"middle",icon:t().createElement(re.RotateRightOutlined,null),onClick:()=>this.rotateHandle(90)},d("qm.uploadCropper.rotatePlus")),t().createElement(E.Button,{type:"primary",size:"middle",icon:t().createElement(re.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,l=ae("cropper-preview");return t().createElement(t().Fragment,null,this.renderUpload(),e&&t().createElement(E.Modal,{visible:!0,wrapClassName:le()(l),title:d("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:this.onOk,onCancel:this.onClose,maskClosable:!1,destroyOnClose:!0},this.renderCropper()))}}tn(ln,"contextType",r);const an=ln;function rn(){return rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},rn.apply(this,arguments)}function nn(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class on extends e.Component{constructor(){super(...arguments),nn(this,"state",{previewVisible:!1,previewImage:"",previewTitle:""}),nn(this,"handlePreview",(async e=>{e.url||e.preview||(e.preview=await(e=>new Promise(((t,l)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>t(a.result),a.onerror=e=>l(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:l,previewTitle:a}=this.state,{fixedSize:r,quality:n,fileTypes:i,fileSize:o,beforeCrop:s}=this.props,c=ae("upload-img"),u=t().createElement("div",null,t().createElement(re.PlusOutlined,null),t().createElement("div",{style:{marginTop:8}},d("qm.uploadCropper.dragableText")));return t().createElement(t().Fragment,null,t().createElement(an,{fixedSize:r,quality:n,fileTypes:i,fileSize:o,beforeCrop:s},t().createElement(E.Upload,rn({className:c},this.props,{onPreview:this.handlePreview}),this.showUploadButton?u:null)),t().createElement(E.Modal,{visible:e,title:a,bodyStyle:{padding:10},footer:null,onCancel:()=>{this.setState({previewVisible:!1})}},t().createElement("img",{alt:"",style:{width:"100%"},src:l})))}}nn(on,"defaultProps",{name:"file",multiple:!0,accept:"image/*",listType:"picture-card",quality:1});const sn=on,cn=(0,e.createContext)(void 0),dn={dataIndex:a().string.isRequired,title:a().string.isRequired,description:a().string,colSpan:a().number,width:a().number,fixed:a().oneOf(["left","right"]),align:a().oneOf(["left","center","right"]),printFixed:a().bool,hidden:a().bool,noAuth:a().bool,ellipsis:a().bool,className:a().string,children:a().array,sorter:a().oneOfType([a().bool,a().func]),filter:a().shape({type:a().oneOf(["text","textarea","checkbox","radio","number","date"]).isRequired,items:a().arrayOf(a().shape({text:a().string,value:a().oneOfType([a().string,a().number])}))}),precision:a().number,formatType:a().oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:a().bool,canCopy:a().bool,editRender:a().func,dictItems:a().arrayOf(a().shape({text:a().string,value:a().oneOfType([a().string,a().number])})),summation:a().shape({sumBySelection:a().bool,displayWhenNotSelect:a().bool,dataKey:a().string,unit:a().string,render:a().func}),groupSummary:a().shape({dataKey:a().string,unit:a().string,render:a().func}),headRender:a().func,render:a().func},un=(a().arrayOf(a().shape(dn)).isRequired,a().func,a().array,a().oneOfType([a().string,a().func]).isRequired,a().bool,a().bool,a().shape({api:a().func.isRequired,params:a().object.isRequired,beforeFetch:a().func,afterFetch:a().func,stopToFirst:a().bool,dataKey:a().string,callback:a().func}),a().bool,a().bool,a().string,a().string,a().string,a().bool,a().bool,a().oneOfType([a().object,a().func]),a().oneOfType([a().object,a().func]),a().array,a().func,a().bool,a().bool,a().shape({type:a().oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:a().array,selectedRowKeys:a().array,hideSelectAll:a().bool,checkStrictly:a().bool,filterable:a().bool,selectByClickRow:a().bool,selectFirstRowOnChange:a().bool,clearableAfterFetched:a().bool,selectAllOnCurrentPage:a().bool,fetchSelectedRows:a().shape({api:a().func.isRequired,params:a().object,dataKey:a().string}),fetchAllRowKeys:a().shape({api:a().func.isRequired,params:a().object,dataKey:a().string}),disabled:a().func,onChange:a().func,onSelect:a().func,onSelectAll:a().func}),a().shape({currentRowKey:a().oneOfType([a().number,a().string]),disabled:a().func,onChange:a().func}),a().shape({virtual:a().bool}),a().shape({defaultExpandAllRows:a().bool,defaultExpandedRowKeys:a().array,expandedRowKeys:a().array,hideExpandAll:a().bool,rowExpandable:a().func,expandedRowClassName:a().string,expandedRowRender:a().func,onExpand:a().func,onChange:a().func}),a().shape({groupItems:a().arrayOf(a().shape({dataIndex:a().string.isRequired,titleIndex:a().string,color:a().string,backgroundColor:a().string})),fetch:a().shape({api:a().func.isRequired,params:a().object,dataKey:a().string}),onChange:a().func}),a().func,a().bool,a().bool,a().bool,a().bool,a().shape({current:a().number,pageSize:a().number,pageSizeOptions:a().array,showSizeChanger:a().bool,showQuickJumper:a().bool}),a().shape({fileName:a().string,fetch:a().shape({api:a().func.isRequired,params:a().object}),cellStyle:a().bool}),a().shape({showLogo:a().bool}),a().shape({fetch:a().shape({api:a().func.isRequired,params:a().object,columnDataKey:a().string,exportDataKey:a().string,importDataKey:a().string,printDataKey:a().string})}),a().oneOf(["left","right"]),a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().func,a().func,a().func,a().func,a().func,a().func,a().func,a().func,a().func,10),pn="1",mn="0",hn="YYYY-MM-DD",fn="YYYY-MM-DD HH:mm:ss",gn="HH:mm:ss",bn="YYYYMMDDHHmmss",yn={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 vn;!function(e){e.left="flex-start",e.right="flex-end"}(vn||(vn={}));let xn=[];const En={getFocusInstance:function(){return xn[0]??null},getInstance:function(e){return xn.find((t=>t.id===e))??null},focus:function(e){const t=this.getInstance(e);t&&0!==xn.findIndex((e=>e===t))&&(this.deregister(e),xn=[t,...xn])},register:function(e,t){e&&t&&(null!==this.getInstance(e)&&this.deregister(e),xn=[{id:e,vm:t},...xn])},deregister:function(e){e&&(xn=xn.filter((t=>t.id!==e)))}};var Cn=__webpack_require__(353);function Sn(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const wn=class{constructor(){Sn(this,"state",{required:[],validate:[],inserted:[],updated:[],removed:[]}),Sn(this,"addToRequired",(e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)})),Sn(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)})),Sn(this,"addToValidate",(e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)})),Sn(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)})),Sn(this,"addToInserted",(e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)})),Sn(this,"removeFromInserted",(e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)})),Sn(this,"addToUpdated",(e=>{-1===this.state.updated.findIndex((t=>t===e))&&this.state.updated.push(e)})),Sn(this,"removeFromUpdated",(e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)})),Sn(this,"addToRemoved",(e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)})),Sn(this,"removeFromRemoved",(e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)})),Sn(this,"clearAllLog",(()=>{this.state.required=[],this.state.validate=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]})),Sn(this,"destroy",(()=>{for(const e in this)this[e]=null}))}},Tn={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 In;const Nn=()=>{var e;if(Ee.Z)return 0;if(void 0!==In)return In;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 l=t.offsetWidth;t.style.overflow="scroll";const a=document.createElement("div");a.style.width="100%",t.appendChild(a);const r=a.offsetWidth;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),In=l-r,In},_n=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=_n(e.children)),e))),Rn=(e,l)=>{const{fetch:a,columns:r,height:n,minHeight:i,maxHeight:o,border:s=!0,rowSelection:c,summation:u,expandable:p,webPagination:m,scrollPagination:h,dragMergeCell:f,showSuperSearch:g,showFastSearch:b,showTableImport:y,showClipboard:v,showSelectCollection:x,footRender:E}=e,{tableRef:C,tableFullData:S,tableData:w,sorter:T,filters:I,superFilters:N,pagination:_}=l,{selectionRows:R,summaries:P}=C.current,O=t().useMemo((()=>!(null==a||!a.api)),[null==a?void 0:a.api]),A=t().useMemo((()=>!O&&!!m),[O,m]),k=t().useMemo((()=>O&&!!h),[O,h]),F=t().useMemo((()=>(O||A)&&!k),[O,A,k]),q=t().useMemo((()=>!!(n||i||o)),[n,i,o]),L=t().useMemo((()=>((e,t,l)=>{const a=_n(e),r=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:Tn.selectionColumn,title:"radio"===t?d("qm.table.config.selectionText"):"",width:Tn.selectionColumnWidth,fixed:"left",type:t}})(t),n=null!=(i=l)&&i.expandedRowRender?{dataIndex:Tn.expandableColumn,title:"",width:Tn.selectionColumnWidth,fixed:"left",type:"expand"}:null;var i;return r&&a.unshift(r),n&&a.unshift(n),(0,Cn.J1)(a)})(r,c,p)),[r,c,p]),D=t().useMemo((()=>(0,Cn.HG)(L)),[L]),H=t().useMemo((()=>D.filter((e=>"function"==typeof e.editRender))),[D]),$=t().useMemo((()=>D.filter((e=>!!e.summation))),[D]),M=t().useMemo((()=>D.filter((e=>"left"===e.fixed))),[D]),K=t().useMemo((()=>D.filter((e=>"right"===e.fixed))),[D]),V=t().useMemo((()=>{const e=D.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn].includes(e.dataIndex)));return e.length?e[0].dataIndex:""}),[D]),U=t().useMemo((()=>$.length>0),[$]),z=t().useMemo((()=>!!E||U),[E,U]),j=t().useMemo((()=>(0,Cn.vo)(L).length>1),[L]),B=t().useMemo((()=>s||j),[s,j]),W=t().useMemo((()=>D.some((e=>e.sorter))),[D]),G=t().useMemo((()=>D.some((e=>e.filter))),[D]),Y=t().useMemo((()=>$.some((e=>!!e.summation.dataKey))),[$]),Z=t().useMemo((()=>!O&&!!y),[O,y]),X=t().useMemo((()=>!!v&&H.length>0),[v,H]),Q=t().useMemo((()=>!!x&&"checkbox"===(null==c?void 0:c.type)),[x,c]),J=t().useMemo((()=>!!g&&G),[g,G]),ee=t().useMemo((()=>!O&&!!b&&G),[O,b,G]),te=t().useMemo((()=>D.some((e=>!!e.groupSummary))),[D]),le=t().useMemo((()=>{var e;return!(null==u||null===(e=u.groupItems)||void 0===e||!e.length)}),[u]),ae=t().useMemo((()=>!!f&&!O&&!m),[f,O,m]),re=t().useMemo((()=>S.some((e=>Array.isArray(e.children)&&e.children.length))),[S]),ne=t().useMemo((()=>!w.length),[w]),ie=t().useMemo((()=>(()=>{const e={};return $.forEach((t=>{const{dataIndex:l,precision:a,summation:r}=t,{sumBySelection:n,displayWhenNotSelect:i,unit:o}=r,s=le?(0,Cn.SX)(S):S,c=!R.length&&!!i;let d=(!n||c?s:R).reduce(((e,t)=>{if(null!=t&&t[Tn.summaryIgnore])return e;const a=Number((0,Cn.C_)(t,l));return Number.isNaN(a)?e:e+a}),0);!Object.keys(P).includes(l)||n&&!c||(d=Number((0,Cn.C_)(P,l))),(0,Cn.dN)(e,l,d);let u=a>=0?d.toFixed(a):d.toString();u=(0,Cn.uf)(u),(0,Cn.dN)(e,`${l}_text`,o?`${u} ${o}`:u)})),[e]})()),[S,R,P]),oe=t().useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))($)),[$]),se=t().useMemo((()=>{const e=(0,Cn.W2)(T),t=((e,t)=>{const l=[];if(Object.keys(e).length)for(const t in e){const[a,r]=Tn.showFilterType?t.split("|"):[t,""],n=e[t];Object.keys(n).forEach((e=>{l.push({type:r,bracketLeft:"",fieldName:a,expression:e,value:n[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{l.push({type:Tn.showFilterType?e.fieldType:"",bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),l.length&&(l[l.length-1].logic=""),l})(I,N);return{...e?{[Tn.sorterFieldName]:e}:null,...t.length?{[Tn.filterFieldName]:t}:null,...Y?{[Tn.groupSummary.summaryFieldName]:oe,usedJH:1}:null,...(null==a?void 0:a.params)??null,[Tn.currentPageName]:_.current,[Tn.pageSizeName]:_.pageSize}}),[null==a?void 0:a.params,_.current,_.pageSize,T,I,N,oe,Y]);return{isFetch:O,isWebPagination:A,isScrollPagination:k,showPagination:F,shouldUpdateHeight:q,tableColumns:L,flattenColumns:D,editableColumns:H,summationColumns:$,leftFixedColumns:M,rightFixedColumns:K,firstDataIndex:V,showSummary:U,showFooter:z,isHeadGroup:j,bordered:B,isHeadSorter:W,isHeadFilter:G,isServiceSummation:Y,isSelectCollection:Q,isTableImport:Z,isTableClipboard:X,isSuperSearch:J,isFastSearch:ee,isGroupSummary:te,isGroupSubtotal:le,isDragMergeCell:ae,isTreeTable:re,isTableEmpty:ne,summationRows:ie,fetchParams:se}};function Pn(t){const[l,a]=e.useState({width:0,height:0});return e.useEffect((()=>{const e=t.current,l=e=>{const{inlineSize:t,blockSize:l}=e.contentBoxSize[0];a({width:t,height:l})};return e&&Ft(e,l),()=>{e&&qt(e,l)}}),[t]),l}const On=(e,l)=>{const{rowKey:a,authCode:r,dataSource:n,summation:i,fetch:o,rowSelection:s,expandable:c,treeConfig:d,authConfig:u,ignorePageIndex:p,columnsChange:m,onScrollEnd:f,onDataChange:g,onDataLoad:b,onChange:y}=e,{getRowKey:v,tableRef:x,tableElementRef:E,tableBodyRef:C,$size:S,tableColumns:w,tableFullData:T,pagination:I,layout:N,filters:_,sorter:R,superFilters:P,fetchParams:O,selectionKeys:A,rowExpandedKeys:k,highlightKey:F,summationColumns:q,shouldUpdateHeight:L,isFetch:D,isTreeTable:H,isWebPagination:$,isScrollPagination:M,isServiceSummation:K,isGroupSubtotal:V,doLayout:U,setTableData:j,setTableFullData:B,setTableOriginData:W,setAllTableData:G,setDeriveRowKeys:Y,setPagination:Z,setSpinning:X,setSorter:Q,setFilters:J,setSuperFilters:ee,setSelectionKeys:te,setRowExpandedKeys:le,setHighlightKey:ae,setScrollYLoad:re,setScrollYStore:ne,setFieldAuth:ie,setResizeState:oe,setSummaries:se,setPermission:ce,setRowKeysMap:de,resetTableScroll:ue,clearElementStore:pe,clearAllRowKeysMap:me}=l,{store:he}=x.current,fe=Pn(E),ge=t().useRef({...O}),be=t().useRef({list:[],maps:new Map});ye((()=>{U()}),[w,S,N.tableAutoHeight]),ye((()=>{ve()}),[fe]),ye((()=>{We(),Ge(),Ye(),D||($&&$e(),qe(n))}),[n,null==o?void 0:o.params]),ye((()=>{const e=Ae(O,ge.current);e||D&&(null==s?void 0:s.clearableAfterFetched)&&Ze(),e||!(O[Tn.currentPageName]>1)||null!=o&&o.stopToFirst?D&&ke():$e(),ge.current=O}),[O]),ye((()=>{$&&Ue(),M||ue(),Re()}),[I.current,I.pageSize]),ye((()=>{D||xe(T.length),U()}),[T]),ye((()=>{H&&null!=d&&d.virtual&&(Me(),Ue())}),[k]);const ve=()=>{const{scrollYLoad:e,resizeState:t}=x.current,{height:l}=t,{width:a,height:r}=fe,n=r!==l;U(),n&&L&&e&&Ue(),oe(Object.assign({},t,{width:a,height:r}))},xe=e=>{e!==I.total&&Z((t=>Object.assign({},t,{total:e})))},Ee=(0,z.Ds)((e=>{De(),null==f||f(e)})),Ce=e=>V?Se(we(e,0)):e,Se=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Se(e.children)),delete e.children,t.push(e)})),t},we=(e,t)=>{var l;const r=null===(l=i.groupItems)||void 0===l?void 0:l[t];return r?(0,Cn.v9)(e,[r.dataIndex]).map((e=>{const l={children:we(e,t+1),_group:r.dataIndex};return"function"!=typeof a&&(0,Cn.dN)(l,a.toString(),(0,Cn.wE)()),r.titleIndex&&(0,Cn.dN)(l,r.titleIndex,(0,Cn.C_)(e[0],r.titleIndex)),(0,Cn.dN)(l,r.dataIndex,(0,Cn.C_)(e[0],r.dataIndex)),q.forEach((e=>{var t;const{dataIndex:a}=e,r=null===(t=l.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[Tn.summaryIgnore])return e;const l=Number((0,Cn.C_)(t,a));return Number.isNaN(l)?e:e+l}),0);(0,Cn.dN)(l,a,r)})),l})):(e.forEach(((t,l)=>{t._rowSpan=0===l?e.length:0,t._colSpan=1})),e)},Te=e=>{const{type:t,checkStrictly:l=!0}=s||{},a=Array.isArray(e)?e:A;let r=[];return x.current.treeTable&&!l&&a.forEach((e=>{r.push(...((e,t)=>{var l;const{deriveRowKeys:a}=x.current,r=(0,Cn.CD)(a,e);let n=[];if(!r)return n;const i=Ne((null==r?void 0:r.children)||[]),o=(null===(l=(0,Cn.Qi)(a,e))||void 0===l?void 0:l.slice(0,-1).reverse())||[];return n=[...new Set([...t,...i])],o.forEach((e=>{var t;const l=(0,Cn.CD)(a,e),r=(0,Cn.bY)(n,(null==l||null===(t=l.children)||void 0===t?void 0:t.map((e=>e.rowKey)))||[]);n=r?[...n,e]:n.filter((t=>t!==e))})),n})(e,a))})),r="radio"===t?a.slice(0,1):[...new Set([...a,...r])],r},Ie=e=>{const{allRowKeys:t,deriveRowKeys:l,flattenRowKeys:a}=x.current,{defaultExpandAllRows:r,expandedRowRender:n}=c||{},i=Array.isArray(e)?e:k;if(x.current.treeTable){n&&h("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...A];F&&e.unshift(F);let o=[];return e.forEach((e=>{const t=(0,Cn.Qi)(l,e)||[];o.push(...t.length>1?t.slice(0,-1).reverse():t)})),o=r?t:[...new Set([...i,...o])],o.filter((e=>!a.includes(e)))}return c?r?t.slice(0):[...i]:[]},Ne=e=>{const t=[];for(let l=0;l<e.length;l++)Array.isArray(e[l].children)&&t.push(...Ne(e[l].children)),t.push(e[l].rowKey);return t},_e=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(..._e(e.children,t)),e.rowKey===t&&e.parentRowKey&&l.push(e.parentRowKey)})),l.length&&l.push(..._e(e,l[l.length-1])),l},Re=(0,z.Ds)((()=>{Le(),null==y||y(I,Oe(_),Pe(R),P,{currentDataSource:Ve()})})),Pe=e=>{const t={};for(const l in e)null!==e[l]&&(t[l]=e[l]);return t},Oe=e=>{const t={};for(const l in e){if(!l.includes("|"))continue;const[a,r]=l.split("|");t[Tn.showFilterType?`${a}|${r}`:a]=e[l]}return t},Ae=(e,t)=>{const l=Object.keys((0,Cn.e5)(e,t));return 1===l.length&&(l.includes(Tn.currentPageName)||l.includes(Tn.pageSizeName))},ke=async()=>{var e;if(!o)return;const{beforeFetch:t=z.XT,afterFetch:l,callback:a}=o;if(!t(O))return;const r=M&&O[Tn.currentPageName]>ge.current[Tn.currentPageName]&&Ae(O,ge.current),n=!(null==i||null===(e=i.fetch)||void 0===e||!e.api);X(!0);try{const[e,t]=n?await Promise.all([o.api(O),i.fetch.api(O)]):[await o.api(O)];if(n?200===e.code&&200===t.code:200===e.code){const n=o.dataKey??Tn.dataKey;let i=(0,Nt.get)(e.data,n)??[];i="function"==typeof l?l(i):i;const s=(0,Nt.get)(e.data,n.replace(/[^.]+$/,Tn.totalKey))||i.length||0;qe(r?x.current.tableFullData.concat(i):i),xe(s),Fe((null==t?void 0:t.data)||e.data),null==a||a(e.data)}}catch(e){}(0,Cn.RI)(o,"stopToFirst")&&(o.stopToFirst=!1),X(!1)},Fe=e=>{var t;if(!K)return;const l=(null==i||null===(t=i.fetch)||void 0===t?void 0:t.dataKey)??Tn.summationKey,a=(l?(0,Nt.get)(e,l):e)??{},r={};q.filter((e=>!!e.summation.dataKey)).forEach((e=>{(0,Cn.dN)(r,e.dataIndex,Number((0,Cn.C_)(a,e.summation.dataKey)))})),se(r)},qe=e=>{const t=e=>e.map(((e,l)=>(Array.isArray(e.children)&&e.children.length&&(e.children=t(e.children)),e.index=l,p||(e.pageIndex=(e=>{const{current:t,pageSize:l}=I;return!D||M?e:(t-1)*l+e})(l)),e))),l=Ce(t(e));ze(l),je(l),te(Te()),le(Ie()),Le(),null==b||b(l)},Le=()=>{const{type:e,selectFirstRowOnChange:t}=s||{};if("radio"===e&&t){const e=Ve();if(e.length){const t=v(e[0],e[0].index);te([t])}else te([])}},De=()=>{if(!M)return;const{current:e,pageSize:t,total:l}=I;e>=Math.ceil(l/t)||He({...I,current:e+1})},He=e=>{let{current:t,pageSize:l}=e;Z((e=>Object.assign({},e,{current:t,pageSize:l})))},$e=()=>{He(Object.assign({},I,{current:1}))},Me=()=>{if(!x.current.treeTable||null==d||!d.virtual)return;const e=Ke(x.current.deriveRowKeys,(()=>{const{allTableData:e,allRowKeys:t}=x.current,{rowExpandable:l}=c||{},a=[];return"function"==typeof l&&e.forEach(((e,r)=>!l(e)&&a.push(t[r]))),a.length?k.filter((e=>!a.includes(e))):k})());be.current.list=e,be.current.maps.clear(),e.forEach(((e,t)=>be.current.maps.set(e.rowKey,t)))},Ke=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...Ke(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)))&&l.push({rowKey:e.rowKey,level:e.level})})),l},Ve=()=>$?(()=>{const{current:e,pageSize:t}=I;return x.current.tableFullData.slice((e-1)*t,e*t)})():x.current.tableFullData,Ue=()=>{let e=Ve();x.current.treeTable&&null!=d&&d.virtual&&(e=(e=>{const{allTableData:t,allRowKeys:l}=x.current,{list:a,maps:r}=be.current,n=[];for(let e=0,i=l.length;e<i;e++){const i=l[e];r.has(i)&&(t[e]._level=a[r.get(i)].level,n.push(t[e]))}return n})()),re(e.length>Tn.virtualScrollY),(e=>{const{elementStore:t,scrollYStore:l,scrollYLoad:a}=x.current,{startIndex:r,rowHeight:n}=l;let i="",o="";a&&(i=`translateY(${Math.max(0,r*n)+"px"})`,o=e.length*n+"px"),t.$tableBody.style.transform=i,t.$tableYspace.style.height=o})(e),(e=>{const{scrollYLoad:t,scrollYStore:l}=x.current;j(t?e.slice(l.startIndex,l.endIndex):e)})(e)},ze=e=>{B(e),G(e),Y(e),Be(),Me(),Ue()},je=e=>{W(e)},Be=()=>{const{allRowKeys:e}=x.current;me(),e.forEach(((e,t)=>de(e,t)))},We=()=>{Q({})},Ge=()=>{J({})},Ye=()=>{ee([])},Ze=()=>{te([])};return{initialTable:()=>{(async()=>{if(null==u||!u.fetch)return;const{originColumns:t}=x.current,{api:l,params:a,columnDataKey:r,exportDataKey:n,importDataKey:i,printDataKey:o}=u.fetch;try{const s=await l(a);if(200===s.code){if(r){const l=(0,Nt.get)(s.data,r)??[],a=!!(0,Nt.get)(s.data,"reverse"),n=(0,Cn.y1)(e.columns,(e=>{const{dataIndex:r}=e;if(a?!l.includes(r):l.includes(r)){const l=(0,Cn.Ps)(t,r);e.noAuth=!0,l.noAuth=!0}}));null==m||m(n)}n&&ce((e=>Object.assign({},e,{export:!!(0,Nt.get)(s.data,n)}))),i&&ce((e=>Object.assign({},e,{import:!!(0,Nt.get)(s.data,i)}))),o&&ce((e=>Object.assign({},e,{print:!!(0,Nt.get)(s.data,o)})))}}catch(e){}})(),(()=>{if(!r)return;const t=(0,z.Y6)(r);if(t){const{fieldList:l=[],isExport:a=1,isImport:r=1,isPrint:n=1}=t,{originColumns:i}=x.current,o=(0,Cn.y1)(e.columns,(e=>{const{dataIndex:t}=e,a=l.find((e=>e.dataIndex===t));if(a){const{visible:l=1,disabled:r,secretName:n}=a,o=(0,Cn.Ps)(i,t);ie(t,{visible:l,disabled:r,secretName:n}),l||(e.noAuth=!0,o.noAuth=!0),n&&(e.formatType=`secret-${n}`,o.formatType=`secret-${n}`)}}));ce((e=>Object.assign({},e,{export:!!a,import:!!r,print:!!n}))),setTimeout((()=>null==m?void 0:m(o)))}})(),F&&C.current.setClickedValues([F,""]),"radio"===(null==s?void 0:s.type)&&A.length&&C.current.setClickedValues([A[0],""]),D?ke():qe(n)},createTableFullData:ze,getTableData:ke,createTableData:qe,createGroupData:Ce,createSelectionKeys:Te,createSelectionRows:e=>{const{selectionRows:t,allTableData:l,rowKeysMap:a}=x.current;if(D)return[...t.filter((t=>e.includes(v(t,t.index)))),...l.filter((l=>{const a=v(l,l.index);return e.includes(a)&&-1===t.findIndex((e=>v(e,e.index)===a))}))];const r=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];a.has(n)&&r.push(l[a.get(n)])}return r},createRowExpandedKeys:Ie,findParentRowKeys:_e,getAllChildRowKeys:Ne,doFieldValidate:(e,t,l,a)=>{if(!Array.isArray(e))return h("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(he.removeFromRequired({x:l,y:a}),he.removeFromValidate({x:l,y:a}),e.forEach((e=>{var r;e.required&&(0,z.xb)(t)&&he.addToRequired({x:l,y:a,text:e.message}),"function"!=typeof e.validator||null!==(r=e.validator)&&void 0!==r&&r.call(e,t)||he.addToValidate({x:l,y:a,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:l,updated:a,removed:r}=he.state,n=(0,Nt.intersection)(l,r),i=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:i(e),validate:i(t),inserted:l.filter((e=>!n.includes(e))),updated:a.filter((e=>![...(0,Nt.intersection)(a,l),...(0,Nt.intersection)(a,r)].includes(e))),removed:r.filter((e=>!n.includes(e)))}},dataChange:()=>{null==g||g(x.current.tableFullData)},tableChange:Re,toLastPage:()=>{const{current:e,pageSize:t,total:l}=I,a=Math.ceil(l/t);e<a&&He(Object.assign({},I,{current:a}))},pagerChangeHandle:He,triggerScrollYEvent:e=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollYStore:t}=x.current,{startIndex:l,endIndex:a,offsetSize:r,visibleSize:n,rowHeight:i}=t,o=Math.floor(e/i),s=Math.max(0,o-1-r),c=o+n+r;(o<=l||o>=a-n-1)&&(l===s&&a===c||(ne(Object.assign({},t,{startIndex:s,endIndex:c})),Ue()))}(e)},scrollBottomDebouncer:Ee,clearTableSorter:We,clearTableFilter:Ge,clearSuperFilters:Ye,clearRowSelection:Ze,clearRowHighlight:()=>{ae("")},clearTableLog:()=>{he.clearAllLog()},destroy:()=>{pe(),he.destroy(),En.deregister(x.current.uid)}}},An=(e,l)=>{const{height:a,minHeight:r,maxHeight:n,resizable:i,showHeader:o,spanMethod:s}=e,{getRowKey:c,tableRef:d,$size:u,tableColumns:p,flattenColumns:m,leftFixedColumns:h,layout:f,scrollY:g,tableData:b,showFooter:y,showPagination:v,isWebPagination:x,isFullScreen:E,setLayout:C,setScrollX:S,setScrollY:w,setElementStore:T,setScrollYStore:I,setShouldToTop:N}=l,_=t().useRef(g),R=t().useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=f,l={};return r&&Object.assign(l,{minHeight:`${(0,Cn.EJ)(r)}px`}),n&&Object.assign(l,{maxHeight:`${(0,Cn.EJ)(n)}px`}),E?{...l,maxHeight:"",minHeight:"",height:`${e}px`}:a?{...l,height:"auto"!==a?`${(0,Cn.EJ)(a)}px`:`${t}px`}:l}),[a,n,r,E,f]),P=(e,t)=>{const{elementStore:l,scrollYStore:a,allTableData:r}=d.current,n=l.$tableBody.parentNode;if(!(0,z.o8)(t)&&t>=0)n.scrollTop=t*a.rowHeight;else{const t=(x?(0,Cn.tL)(b):r).findIndex((t=>e===c(t,t.index)));n.scrollTop=(t<0?0:t)*a.rowHeight}};return{createElementStore:e=>{Object.keys(e).forEach((t=>{T(t,e[t])}))},tableStyles:R,getSpan:(e,t,l,a,r)=>{let n=1,i=1;if("function"==typeof s){const o=s({row:e,column:t,rowIndex:l,columnIndex:a,tableData:r});Array.isArray(o)?(n=o[0],i=o[1]):(0,z.Kn)(o)&&(n=o.rowSpan,i=o.colSpan)}const{mergeCells:o}=d.current;if(o.length>0){const e=o.find((e=>e.row===l&&e.col===a));e&&(n=e.rowSpan,i=e.colSpan)}return{rowSpan:n,colSpan:i}},getStickyLeft:e=>{m.findIndex((t=>t.dataIndex===e))<0&&(e=(0,Cn.t2)((0,Cn.Ps)(p,e)).dataIndex);let t=0;for(let l=0;l<m.length;l++){const a=m[l];if(a.dataIndex===e)break;t+=(0,Cn.EJ)(a.width||a.renderWidth||0)}return t},getStickyRight:e=>{m.findIndex((t=>t.dataIndex===e))<0&&(e=(0,Cn.gU)((0,Cn.Ps)(p,e)).dataIndex);let t=0;for(let l=m.length-1;l>=0;l--){const a=m[l];if(a.dataIndex===e)break;t+=(0,Cn.EJ)(a.width||a.renderWidth||0)}return t},scrollXToColumn:(e,t)=>{const{elementStore:l}=d.current,a=void 0===t?m.findIndex((t=>t.dataIndex===e)):t;if(a<0)return;const r=h.map((e=>e.width||e.renderWidth||Tn.defaultColumnWidth)).reduce(((e,t)=>e+t),0);l.$tableBody.parentNode.scrollLeft=l.$tableBody.querySelectorAll("tbody > tr > td")[a].offsetLeft-r},scrollYToRecord:P,rowInViewport:e=>{const{elementStore:t,scrollYStore:l}=d.current,{viewportHeight:a,gutterWidth:r}=f,n=e*l.rowHeight,i=t.$tableBody.parentNode;return!(n<i.scrollTop||n+l.rowHeight>i.scrollTop+(scrollX?a-r:a))},calcTableHeight:()=>{if("auto"!==a)return;const{elementStore:e,resizeState:t}=d.current,l=t.winHeight-e.$table.getBoundingClientRect().top-(v?Sl["small"!==u?"middle":u]+un:0)-un;C((e=>Object.assign({},e,{tableAutoHeight:l})))},resetTableScroll:()=>{const{shouldToTop:e}=d.current;e&&P("",0),N(!0)},doLayout:()=>{(()=>{const{elementStore:e,scrollYLoad:t,resizeState:l}=d.current;if(!e.$table.offsetParent)return;const a=e.$table.offsetHeight,r=o?e.$header.offsetHeight:f.headerHeight,n=y?e.$footer.offsetHeight:f.footerHeight,i=a-r-n,s=e.$tableBody.offsetHeight,c=t||s>i;let p=0;if(E){const t=e.$toper?e.$toper.offsetHeight+un:0,a=e.$pager?e.$pager.offsetHeight+un:0;p=l.winHeight-t-a-20}i!==f.viewportHeight&&(e=>{const{scrollYStore:t,isIE:l}=d.current,{startIndex:a,endIndex:r}=t,n=Tn.rowHeightMaps[u],i=Math.max(8,Math.ceil(e/n)+2),o=l?5:0;I(Object.assign({},t,{visibleSize:i,offsetSize:o,endIndex:Math.max(a+i+o,r),rowHeight:n}))})(i),_.current=c,w(c),C((e=>Object.assign({},e,{headerHeight:r,footerHeight:n,viewportHeight:i,tableBodyHeight:s,tableFullHeight:p})))})(),(()=>{const{elementStore:e}=d.current,t=e.$table.clientWidth,l=_.current?f.gutterWidth:0,{defaultColumnWidth:a}=Tn,r=m.filter((e=>"number"!=typeof e.width));let n=0;if(m.forEach((e=>{"number"==typeof e.width&&(e.renderWidth=null)})),r.length>0){if(m.forEach((e=>{n+=Number(e.width)||a})),n<=t-l){S(!1);const e=t-l-n;if(1===r.length&&i)r[0].renderWidth=a+e;else{const t=e/r.reduce(((e,t)=>e+a),0);let l=0;r.forEach(((e,r)=>{if(0===r)return;const n=Math.floor(a*t);l+=n,e.renderWidth=a+n})),i&&(r[0].renderWidth=a+e-l)}}else S(!0),r.forEach((e=>{e.renderWidth=a}));C((e=>Object.assign({},e,{tableBodyWidth:Math.max(n,t)})))}else m.forEach((e=>{e.renderWidth=Number(e.width)||a,n+=e.renderWidth})),S(n>t),C((e=>Object.assign({},e,{tableBodyWidth:n})));C((e=>Object.assign({},e,{tableWidth:t})))})()}}};function kn(){const[,t]=e.useReducer((e=>e+1),0);return t}const Fn=e=>{const{total:l}=e,{tableRef:a,tableProps:r,selectionKeys:n,isHeadSorter:i,isHeadFilter:o,isTreeTable:s,clearTableSorter:c,clearTableFilter:u,clearSuperFilters:p,clearRowSelection:m,clearRowHighlight:h}=t().useContext(cn),{rowSelection:f,rowHighlight:g}=r,{allTableData:b}=a.current,y=t().useMemo((()=>!!(i||o||f||g)),[i,o,f,g]),v={[`${ae("table")}__alert`]:!0};return t().createElement("div",{className:le()(v)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.InfoCircleFilled,null)),t().createElement("span",null,d("qm.table.alert.total",{total:s?b.length:l}),f?`,${d("qm.table.alert.selected",{total:n.length})}`:""),y&&t().createElement("em",{onClick:()=>{c(),u(),p(),m(),h()}},d("qm.table.alert.clear")))},qn=e=>{const{isFullScreen:l}=e,{setFullScreen:a}=t().useContext(cn),r=ae("table");return t().createElement("span",{className:`${r}-full-screen`,title:d(l?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>{a(!l)}},t().createElement("i",{className:"svgicon icon"},l?t().createElement(re.FullscreenExitOutlined,null):t().createElement(re.FullscreenOutlined,null)))},Ln=()=>{const{getTableData:e}=t().useContext(cn),l=ae("table");return t().createElement("span",{className:`${l}-reload`,title:d("qm.table.refresh.text"),onClick:()=>e()},t().createElement("i",{className:"svgicon icon"},t().createElement(re.ReloadOutlined,null)))},Dn=e=>{var l,a;const{tableColumns:n}=e,{global:i}=t().useContext(r),{tableRef:o,tableBodyRef:s,tableProps:c,flattenColumns:u,summationRows:p,showSummary:m,getSpan:h}=t().useContext(cn),{tablePrint:f,showHeader:g}=c,{isIE:b}=o.current,y=(null==i||null===(l=i.print)||void 0===l?void 0:l.leftLogo)??"",v=(null==i||null===(a=i.print)||void 0===a?void 0:a.rightLogo)??"",x=!(!y&&!v),E=t().useMemo((()=>(0,Nt.cloneDeep)((0,Cn.MY)(n,[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn]))),[n]),C=t().useMemo((()=>(0,Nt.cloneDeep)((0,Cn.MY)(u,[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn]))),[u]),S=t().useMemo((()=>(0,Nt.cloneDeep)(n.filter((e=>e.printFixed)))),[n]),w=(e,t)=>{const l=Object.assign({},(0,Cn.Ps)(t,e.parentDataIndex));return l.children=[e],l.level&&l.level>1?w(l,t):l},T=(e,t)=>(0,Nt.map)((0,Nt.groupBy)((0,Nt.flatten)(e),t),(0,Nt.spread)((function(){for(var e=arguments.length,l=new Array(e),a=0;a<e;a++)l[a]=arguments[a];return(0,Nt.mergeWith)(...l,((e,l)=>{if(Array.isArray(e))return T(e.concat(l),t)}))}))),I=()=>{const{allTableData:e}=o.current,t=(e=>{const t=[];let l=[],a=0,r=0;for(;r<e.length;){const n=e[r];a+=n.width||n.renderWidth||Tn.defaultColumnWidth,a<=Tn.printWidth?(l.push(n),r===e.length-1&&t.push(l),r++):r>0?(e.splice(0,r),S.length&&e.unshift(...S),t.push(l),l=[],a=0,r=0):(n.width=Tn.printWidth,l.push(n),t.push(l),r++)}return t})([...C]),l=((e,t)=>{const l=[];return e.forEach((e=>{let a=[];e.forEach((e=>{1===e.level?a.push(e):a.push(w(e,t))})),a=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const l=e.filter((e=>e.dataIndex===t));return l.length<=1?l[0]:T(l,"dataIndex")[0]})))(a),l.push((0,Cn.vo)(a))})),l})(t,E);let a=["<!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 r=0;r<t.length;r++)a+=N(l[r],t[r],e),a+='<div class="page-break"></div>';return a+"</body></html>"},N=(e,t,l)=>{const{showLogo:a=!0}=f;let r='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return r+=`<colgroup>${t.map((e=>{let{width:t,renderWidth:l}=e;return`<col style="width:${t||l||Tn.defaultColumnWidth}px">`})).join("")}</colgroup>`,g&&(r+=["<thead>",a&&x?`<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">',y?`<img src="${y}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',v?`<img src="${v}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${e.title}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),l.length&&(r+=`<tbody>${l.map((e=>`<tr>${t.map(((t,a)=>{const{rowSpan:r,colSpan:n}=h(e,t,e.index,a,l);return r&&n?`<td rowspan="${r}" colspan="${n}">${((e,t,l,a)=>s.current.renderCellTitle(l,e,t,a))(e,e.index,t,a)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),m&&p.length&&(r+=["<tfoot>",p.map((e=>`<tr>${t.map(((t,a)=>{const{dataIndex:r,summation:n}=t,i=null!=n&&n.render?n.render(l):(0,Cn.C_)(e,`${r}_text`);return`<td>${0===a&&""===i?d("qm.table.config.summaryText"):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),r+="</table>",r},_=ae("table");return t().createElement("span",{className:`${_}-print`,title:d("qm.table.print.text"),onClick:()=>{var e;null===(e=((e,t)=>{const{filename:l,type:a,isDownload:r}={filename:"print",type:"html",isDownload:!1},n=`${l}.${a}`;if(window.Blob){const e=new Blob([t],{type:`text/${a}`});if(!r)return Promise.resolve({type:a,content:t,blob:e});Ye(e,n)}})(0,I()))||void 0===e||e.then((e=>{let{content:t,blob:l}=e,a=document.createElement("iframe");a.setAttribute("frameborder","0"),a.setAttribute("width","100%"),a.setAttribute("height","0"),a.style.display="none",document.body.appendChild(a),b?(a.contentDocument.write(t),a.contentDocument.execCommand("print"),a.parentNode.removeChild(a),a=null):(a.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{a.parentNode.removeChild(a),a=null}))},a.src=URL.createObjectURL(l))}))}},t().createElement("i",{className:"svgicon icon"},t().createElement(re.PrinterOutlined,null)))},Hn=require("exceljs");var $n=__webpack_require__.n(Hn);const Mn="606060",Kn="thin",Vn="d4d4d4",Un=(e,t)=>{t&&(e.height=Math.floor(.75*t))},zn=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},jn=()=>({top:{style:Kn,color:{argb:Vn}},left:{style:Kn,color:{argb:Vn}},bottom:{style:Kn,color:{argb:Vn}},right:{style:Kn,color:{argb:Vn}}}),Bn=e=>{const{children:t}=e;return t&&t.length?Bn(t[0]):e},Wn=e=>{const{precision:t,formatType:l}=e,a=t>=0?t?`0.${new Array(t).fill("0").join("")}`:"0":"";return a?{numFmt:a}:"percent"===l?{numFmt:t>=0?`${a}%`:"0%"}:"finance"===l?{numFmt:t>=0?`#,##${a}`:"#,##0"}:null},Gn=()=>{const{tableRef:e,tableProps:l,getSpan:a,showSummary:r,isHeadGroup:n}=t().useContext(cn),{spanMethod:i,showHeader:o}=l,s=(e,t)=>{var l;return(null===(l=e.find((e=>e.text==t)))||void 0===l?void 0:l.value)??""};return{exportXLSX:async(t,l,s,c)=>{const{columns:u,footSummation:p}=t,{scrollYStore:{rowHeight:m}}=e.current,h=(0,Cn.HG)(u),f=(0,Cn.vo)(u),g=[],b=[],y=[],v=[];let x=0;const E={};h.forEach((e=>{const{dataIndex:t,title:l,width:a,renderWidth:r}=e;E[t]=l,y.push({key:t,width:(a||r||100)/8})})),o&&(n?f.forEach(((e,t)=>{const l={};e.forEach((e=>{const{colSpan:a,rowSpan:r}=e,n=Bn(e),i=h.findIndex((e=>{let{dataIndex:t}=e;return t===n.dataIndex}));l[n.dataIndex]=e.title,0!==a&&(a>1||r>1)&&v.push({s:{r:t,c:i},e:{r:t+r-1,c:i+a-1}})})),g.push(l)})):(h.forEach(((e,t)=>{const{colSpan:l,rowSpan:a}=e;(l>1||a>1)&&v.push({s:{r:x,c:t},e:{r:x+a-1,c:t+l-1}})})),g.push(E)),x+=g.length);const C=l.map(((e,t)=>{const r={};return h.forEach(((n,o)=>{if("function"==typeof i){const{rowSpan:r,colSpan:i}=a(e,n,t,o,l);(i>1||r>1)&&v.push({s:{r:t+x,c:o},e:{r:t+x+r-1,c:o+i-1}})}const s=["percent","finance"].includes(n.formatType);r[n.dataIndex]=s?(0,Cn.C_)(e,n.dataIndex):c(e,t,n,o)})),r}));x+=C.length,r&&p&&s(h,l).forEach(((e,t)=>{const a={};h.forEach(((t,r)=>{const{dataIndex:n,summation:i}=t,o=null!=i&&i.render?i.render(l):(0,Cn.C_)(e,n);a[n]=0===r&&""===o?d("qm.table.config.summaryText"):(0,z.l$)(o)?(0,Cn.gn)(o).join(""):o})),b.push(a)}));const{sheetName:S,useStyle:w}=t,T=new($n().Workbook),I=T.addWorksheet(S);I.columns=y,o&&I.addRows(g).forEach((e=>{w&&Un(e,m),e.eachCell((e=>{const t=I.getColumn(e.col),l=(0,Cn.Ps)(u,t.key),{align:a}=l;zn(e,a),w&&Object.assign(e,{font:{bold:!0,color:{argb:Mn}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:jn()})}))})),I.addRows(C).forEach((e=>{w&&Un(e,m),e.eachCell((e=>{const t=I.getColumn(e.col),l=(0,Cn.Ps)(u,t.key),{align:a}=l;zn(e,a),Object.assign(e,Wn(l)),w&&Object.assign(e,{font:{color:{argb:Mn}},border:jn()})}))})),r&&p&&I.addRows(b).forEach((e=>{w&&Un(e,m),e.eachCell((e=>{const t=I.getColumn(e.col),l=(0,Cn.Ps)(u,t.key),{align:a}=l;zn(e,a),Object.assign(e,Wn(l)),w&&Object.assign(e,{font:{color:{argb:Mn}},border:jn()})}))})),v.forEach((e=>{let{s:t,e:l}=e;I.mergeCells(t.r+1,t.c+1,l.r+1,l.c+1)}));const N=await T.xlsx.writeBuffer();return new Blob([N],{type:"application/octet-stream"})},exportCSV:(e,t)=>{const l=e=>{let t=e;const l=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),a=-1!==e.indexOf('"');return a&&(t=t.replace(/"/g,'""')),(l||a)&&(t='"'+t+'"'),t},a="\ufeff"+(e=>{let t,a,r,n,i="";for(t=0;t<e.rows.length;t+=1){for(r=e.rows[t],a=0;a<r.cells.length;a+=1)n=r.cells[a],i=i+(a?",":"")+l(n.textContent.trim());i+="\r\n"}return i})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var r;return((e,t,l)=>{t=t||"",l=l||512;const a=window.atob(e),r=[];let n;for(n=0;n<a.length;n+=l){const e=a.slice(n,n+l),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);r.push(o)}return new window.Blob(r,{type:t})})((r=a,window.btoa(unescape(encodeURIComponent(r)))),"application/csv")},importXLSX:(e,t)=>{const{columns:l,file:a}=e,r=(0,Cn.HG)(l),n=new FileReader;n.onerror=()=>{E.message.error(d("qm.table.import.error"))},n.onload=e=>{const l=r.map((e=>e.title)),a=new($n().Workbook),n=e.target;n?a.xlsx.load(n.result).then((e=>{const a=e.worksheets[0];if(a){const e=a.getSheetValues(),n=e.findIndex((e=>e&&e.length>0)),i=e[n],o=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(l,i);if(o){const a=e.slice(n+1).map((e=>{const t={};e.forEach(((e,l)=>{t[i[l]]=e}));const a={};return l.forEach(((e,l)=>{const{dataIndex:n,dictItems:i}=r[l];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,Cn.dN)(a,n,t[e])})),a}));null==t||t(a),E.message.success(d("qm.table.import.success",{total:a.length}))}else E.message.error(d("qm.table.import.error"))}else E.message.error(d("qm.table.import.error"))})):E.message.error(d("qm.table.import.error"))},n.readAsArrayBuffer(a)}}};let Yn,Zn;const Xn=ae("table"),Qn=e=>{const t=e.name,l=t.lastIndexOf("."),a=t.substring(l+1,t.length);return{filename:t.substring(0,l),type:a}},Jn=e=>{const{fileType:l,onChange:a}=e;return t().createElement(G,{onClick:()=>(async()=>{try{const e=await(e=>{const t=Object.assign({},e);return Yn||(Yn=document.createElement("form"),Zn=document.createElement("input"),Yn.className=`${Xn}--file-form`,Zn.name="file",Zn.type="file",Yn.appendChild(Zn),document.body.appendChild(Yn)),new Promise(((e,l)=>{const a=!t.type;Zn.multiple=!!t.multiple,Zn.accept=a?"":`.${t.type}`,Zn.onchange=r=>{const{files:n}=r.target,i=n[0];let o="";if(!a)for(let e=0;e<n.length;e++){const{type:l}=Qn(n[e]);if(t.type!==l){o=l;break}}o?(E.message.warning(d("qm.upload.notType",{type:o})),l()):e(i),document.body.removeChild(Yn),Yn=null,Zn=null},Yn.reset(),Zn.click()}))})({type:l});null==a||a(e.name,e)}catch(e){}})()},d("qm.upload.text"))},ei=e=>{const{columns:l,onClose:a}=e,{tableRef:r,createTableData:n,dataChange:i}=t().useContext(cn),{importXLSX:o}=Gn(),s=t().useRef(null),[c,u]=t().useState(!1),[p,m]=t().useState(!0),h=e=>e.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,"index","pageIndex",Tn.operationColumn].includes(e.dataIndex))),[f,g]=t().useState([{type:"INPUT",label:d("qm.table.export.fileName"),fieldName:"fileName",render:(e,l)=>{const{fileName:a}=l.GET_FIELDS_VALUE(["fileName"]);return t().createElement(t().Fragment,null,a?t().createElement("span",null,a):t().createElement(Jn,{fileType:l.state.formData.fileType,onChange:(e,t)=>{l.SET_FIELDS_VALUE({fileName:e,file:t}),t&&m(!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=>{f.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,g([...f])}},{type:"INPUT_NUMBER",label:d("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:1,max:r.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]),b=ae("table");return t().createElement("div",{className:`${b}-import__setting`},t().createElement(Cr,{ref:s,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:{posIndex:"条"},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(G,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(G,{type:"primary",loading:c,disabled:p,onClick:()=>(async()=>{const[e,t]=await s.current.GET_FORM_DATA();e||(u(!0),o({columns:h(l),file:t.file},(e=>{const{tableFullData:l,store:a}=r.current;if("fill"===t.importType&&n(e),"add"===t.importType&&n([...l,...e]),"insert"===t.importType){const{tableFullData:l}=r.current,a=t.posIndex,i=l.slice(0,a).concat(e).concat(l.slice(a));n(i)}e.forEach((e=>{a.addToInserted(e)})),i()})),await(0,z._v)(1e3),u(!1),a())})()},d("qm.table.import.text"))))},ti=e=>{const{tableColumns:l}=e,[a,r]=t().useState(!1),n={[`${ae("table")}-import`]:!0},i={visible:a,title:d("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>r(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:le()(n),title:d("qm.table.import.text"),onClick:()=>r(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.ImportOutlined,null))),t().createElement(It,i,t().createElement(ei,{columns:l,onClose:()=>r(!1)})))},li=e=>{const{columns:l,onChange:a}=e,{$size:r}=t().useContext(cn),n=t().useRef([]),[i,o]=t().useState(!1),[s,c]=t().useState(l);ye((()=>{p()}),[s]),t().useEffect((()=>{u()}),[l]);const u=()=>{const e=[];l.forEach(((t,a)=>{const r=t.colSpan;r>1&&l.slice(a+1,a+r).every((e=>{let{colSpan:t}=e;return 0===t}))&&e.push(l.slice(a,a+r))})),n.current=e},p=()=>{const e=[];s.forEach((t=>{const{colSpan:l,dataIndex:a}=t;if(0===l)return;if(1===l)return e.push(t);const r=n.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(a)));if(-1===r)return e.push(t);e.push(...n[r].map(((e,l)=>{let{dataIndex:a}=e;const r=s.find((e=>e.dataIndex===a));return l>0&&void 0!==t.hidden&&(r.hidden=t.hidden),r})))})),null==a||a(e)},m=ae("table"),h={[`${m}__popper`]:!0,"column-filter__popper":!0,[`${m}--lg`]:"large"===r,[`${m}--sm`]:"small"===r},f=[`${m}-column-filter`,{selected:i}];return t().createElement(Aa(),{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(al.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:s,setList:e=>{const t=e.map((e=>e.dataIndex)),l=s.map((e=>e.dataIndex));(0,Nt.isEqual)(t,l)||c(e)}},s.map((e=>((e,l)=>{const{colSpan:a}=e;if(0===a)return t().createElement("li",{key:e.dataIndex,style:{display:"none"}});const r=["svgicon","handle","main-handle"];return t().createElement("li",{key:e.dataIndex,className:"item"},t().createElement(E.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:l}=t.target;e.hidden=!l,c([...s])}}),t().createElement("i",{className:le()(r),title:d("qm.table.columnFilter.draggable")},t().createElement(re.HolderOutlined,null)),t().createElement("span",{className:"text",title:e.title},e.title))})(e)))))),popupClassName:le()(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{o(e)},builtinPlacements:yn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement("span",{className:le()(f),title:d("qm.table.columnFilter.text")},t().createElement("i",{className:"svgicon icon"},t().createElement(re.SettingOutlined,null)),t().createElement("span",null,d("qm.table.columnFilter.text"))))},ai=e=>{const{defaultValue:l,onClose:a,onOk:r}=e,{tableProps:n,pagination:o,showSummary:s}=t().useContext(cn),{rowSelection:c}=n,u=t().useRef(null),[p,m]=t().useState(!1),h=t().useMemo((()=>Object.assign({},{fileName:`${i()().format(bn)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},l,{columns:(0,Nt.cloneDeep)(l.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,l)=>t().createElement(li,{columns:l.state.formData.columns,onChange:e=>{l.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=ae("table");return t().createElement("div",{className:`${b}-export__setting`},t().createElement(Cr,{ref:u,initialValues:h,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(G,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(G,{type:"primary",loading:p,onClick:()=>(async()=>{const[e,t]=await u.current.GET_FORM_DATA();if(!e){m(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);r(t),await(0,z._v)(1e3),m(!1),a()}})()},d("qm.table.export.text"))))},ri=e=>{var l;const{tableColumns:a}=e,{global:n}=t().useContext(r),{tableRef:o,tableBodyRef:s,tableProps:c,flattenColumns:u,pagination:p,fetchParams:m,isFetch:h,isGroupSubtotal:f,showSummary:g,getSpan:b}=t().useContext(cn),{exportExcel:y,fetch:v,showHeader:x}=c,[E,C]=t().useState(!1),[S,w]=t().useState(!1),T=!(null==y||null===(l=y.fetch)||void 0===l||!l.api),I=t().useMemo((()=>!p.total||S),[p.total,S]),N=t().useMemo((()=>(0,Cn.MY)(a,[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn])),[a]),_=t().useMemo((()=>(0,Cn.MY)(u,[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn])),[u]),R=(e,t)=>{const{summaries:l}=o.current,a={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:r}=e;let n;n=Object.keys(l).includes(r)?Number((0,Cn.C_)(l,r)):(f?(0,Cn.SX)(t):t).reduce(((e,t)=>{if(null!=t&&t[Tn.summaryIgnore])return e;const l=Number((0,Cn.C_)(t,r));return Number.isNaN(l)?e:e+l}),0),(0,Cn.dN)(a,r,n)})),[a]},P=(e,t,l,a)=>{const{precision:r,formatType:n}=l;let i=s.current.renderCellTitle(l,e,t,a);return r>=0&&!n&&""!==i&&(i=Number(i)),i},{exportXLSX:O,exportCSV:A}=Gn(),k=e=>{var t;const l=null==n||null===(t=n.table)||void 0===t?void 0:t.recordExportLog;try{null==l||l({fileName:e})}catch(e){}},F=(e,t)=>{const{columns:l,footSummation:a}=e,r=(0,Cn.vo)(l),n=(0,Cn.HG)(l);let i='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${n.map((e=>{let{width:t,renderWidth:l}=e;return`<col style="width:${t||l||Tn.defaultColumnWidth}px">`})).join("")}</colgroup>`,x&&(i+=["<thead>",r.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${e.title}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(i+=`<tbody>${t.map((e=>`<tr>${n.map(((l,a)=>{const{rowSpan:r,colSpan:n}=b(e,l,e.index,a,t);return r&&n?`<td rowspan="${r}" colspan="${n}">${P(e,e.index,l,a)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),g&&a&&(i+=["<tfoot>",R(n,t).map((e=>`<tr>${n.map(((l,a)=>{const{dataIndex:r,summation:n}=l,i=null!=n&&n.render?n.render(t):(0,Cn.C_)(e,r);return`<td>${0===a&&""===i?d("qm.table.config.summaryText"):(0,z.l$)(i)?(0,Cn.gn)(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},q=(null==y?void 0:y.fileName)??`${i()().format(bn)}.xlsx`,L=q.slice(q.lastIndexOf(".")+1).toLowerCase(),D={[`${ae("table")}-export`]:!0,disabled:I},H={visible:E,title:d("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>C(!1)},$={fileName:q.slice(0,q.lastIndexOf(".")),fileType:L,columns:N,useStyle:null!=y&&y.cellStyle?1:0};return t().createElement(t().Fragment,null,t().createElement("span",{className:le()(D),title:d("qm.table.export.text"),onClick:()=>{I||(T?(async e=>{w(!0);try{const t=await y.fetch.api({columns:_.map((e=>{const{title:t,dataIndex:l,hidden:a}=e,{type:r}=e.filter||{};return{title:t,dataIndex:l,type:r,hidden:a}})),...m,tsortby:void 0,tsummary:void 0,tgroupby:void 0,[Tn.currentPageName]:void 0,[Tn.pageSizeName]:void 0});t.data&&(Ye(t.data,e),k(e))}catch(e){}w(!1)})(q):C(!0))}},t().createElement("i",{className:"svgicon icon"},t().createElement(re.DownloadOutlined,null))),t().createElement(It,H,t().createElement(ai,{defaultValue:$,onClose:()=>C(!1),onOk:e=>{(async e=>{const{fileName:t,fileType:l,exportType:a,startIndex:r=1,endIndex:n}=e,{allTableData:i,selectionRows:s}=o.current;let c=[];if(h){w(!0);const{api:e,dataKey:t}=v;try{const l=await e({...m,[Tn.currentPageName]:1,[Tn.pageSizeName]:p.total});200===l.code&&(c=(Array.isArray(l.data)?l.data:(0,Nt.get)(l.data,t)??[]).map(((e,t)=>{const l={...e,index:t,pageIndex:t};return _.forEach(((e,t)=>{const{dataIndex:a}=e;"index"!==a&&"pageIndex"!==a&&(0,Cn.dN)(l,a,(0,Cn.C_)(l,a))})),l})))}catch(e){}w(!1)}else c=i.slice(0);if("selected"===a&&(c=s.slice(0)),"custom"===a&&(c=c.slice(r-1,n||void 0)),"xlsx"===l){const l=await O(e,c,R,P);Ye(l,`${t}.xlsx`),k(`${t}.xlsx`)}if("csv"===l){const l=A(e,F(e,c));Ye(l,`${t}.csv`),k(`${t}.csv`)}})(Object.assign({},e,{columns:(0,Cn.J1)(e.columns)}))}})))},ni=e=>{const{columns:l,onClose:a}=e,{tableRef:r,tableBodyRef:n,dataChange:i}=t().useContext(cn),o=t().useRef(null),[s,c]=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:l.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}]}]),u=ae("table");return t().createElement("div",{className:`${u}-clipboard__setting`},t().createElement("h3",{className:"info"},d("qm.table.clipboard.supportText")),t().createElement(Cr,{ref:o,initialValues:{},initialExtras:{rowIndex:"行",dataIndex:"列"},items:s,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(G,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(G,{type:"primary",onClick:()=>(async()=>{var e;const[t,s]=await o.current.GET_FORM_DATA();if(t)return;const{tableFullData:c,store:d}=r.current,u=s.content.replace(/(\r|\n)$/,"");let p=u.replace(/"[^"]+"/g,"^");((null===(e=u.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{p=p.replace(/\^/,e)})),p.split(/\r|\n/).forEach(((e,t)=>{e.split(/\t/).forEach(((e,a)=>{const r=c[s.rowIndex-1+t],n=l[s.dataIndex+a];r&&n&&((0,Cn.dN)(r,n.dataIndex,e),d.addToUpdated(r))}))})),n.current.forceUpdate(),i(),a()})()},d("qm.table.clipboard.text"))))},ii=e=>{const{flattenColumns:l}=e,[a,r]=t().useState(!1),n=t().useMemo((()=>(e=>e.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,"index","pageIndex",Tn.operationColumn].includes(e.dataIndex))))(l)),[l]),i={[`${ae("table")}-clipboard`]:!0},o={visible:a,title:d("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>r(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:le()(i),title:d("qm.table.clipboard.text"),onClick:()=>r(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.CopyOutlined,null))),t().createElement(It,o,t().createElement(ni,{columns:n,onClose:()=>r(!1)})))},oi=e=>{const{columns:l,onClose:a}=e,{tableProps:r,tableRef:n,$size:i,selectionKeys:o,setSelectionKeys:s}=t().useContext(cn),{rowKey:c}=r,u=e=>e.map((e=>{const t={dataIndex:e.dataIndex,title:e.title,width:e.width,precision:e.precision,dictItems:e.dictItems??[],render:e.render};return Array.isArray(e.children)&&(t.children=u(e.children)),t})),[p,m]=t().useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...u(l.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,"index","pageIndex",Tn.operationColumn].includes(e.dataIndex))))]),[h]=t().useState(n.current.selectionRows.map((e=>({...e,children:void 0}))));return t().createElement(t().Fragment,null,t().createElement(Zi,{size:i,columns:p,dataSource:h,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=>m(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(G,{onClick:()=>a()},d("qm.table.selectCollection.closeButton"))))},si=e=>{const{columns:l}=e,{tableProps:a,getRowKey:r,isFetch:n,setSelectionKeys:i,setSelectionRows:o}=t().useContext(cn),{rowSelection:s}=a,[c,u]=t().useState(!1);t().useEffect((()=>{p()}),[]);const p=async()=>{const{fetchSelectedRows:e,disabled:t=(e=>!1)}=s;if(n&&e)try{const l=await e.api(e.params);if(200===l.code){let a=Array.isArray(l.data)?l.data:(0,Nt.get)(l.data,e.dataKey)??[];a=a.filter((e=>!t(e))),o(a),i(a.map(((e,t)=>r(e,t))))}}catch(e){}},m=ae("table"),h={visible:c,title:d("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>u(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:`${m}-select-collection`,title:d("qm.table.selectCollection.text"),onClick:()=>u(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.CheckSquareOutlined,null))),t().createElement(It,h,t().createElement(oi,{columns:l,onClose:()=>u(!1)})))},ci=require("localforage");var di=__webpack_require__.n(ci);const ui=e=>{const{columns:l,group:a,summary:r}=e,{tableRef:n,tableProps:o,$size:s,pagination:c,fetchParams:u,isFetch:p}=t().useContext(cn),{fetch:m}=o,h=e=>{const t=l.find((t=>t.dataIndex===e));return{title:t.title,precision:t.precision,dictItems:t.dictItems??[]}},f=a.map((e=>({dataIndex:e.group,...h(e.group)}))),g=r.map((e=>e.summary===Tn.groupSummary.total.value?{dataIndex:e.summary,title:Tn.groupSummary.total.text,formula:e.formula}:{dataIndex:e.summary,...h(e.summary),formula:e.formula})),b=t().useMemo((()=>Object.assign({},u,{[Tn.sorterFieldName]:void 0,[Tn.groupSummary.summaryFieldName]:r.map((e=>`${e.formula}|${e.summary}`)).join(","),[Tn.groupSummary.groupbyFieldName]:a.map((e=>e.group)).join(","),usedJH:2,[Tn.currentPageName]:1})),[u,a,r]),[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 a=null===(t=l.find((t=>t.dataIndex===e.dataIndex)))||void 0===t?void 0:t.groupSummary;let r=a?{summation:a}:null;return e.dataIndex===Tn.groupSummary.total.value&&(r={dataIndex:Tn.groupSummary.recordTotalIndex,summation:{render:()=>c.total}}),{...e,..."count"===e.formula||"sum"===e.formula?r:null}}))])(f,g)),[x]=t().useState(p?[]:(e=>{const t=(0,Cn.v9)(e,a.map((e=>e.group))),l=[];return t.forEach((e=>{const t={};y.forEach((l=>{const{dataIndex:a}=l;"index"!==a&&(0,Cn.dN)(t,a,(0,Cn.C_)(e[0],a))})),r.forEach((l=>{const a=l.summary!==Tn.groupSummary.total.value?l.summary:Tn.groupSummary.recordTotalIndex,r=l.formula;"count"===r&&(0,Cn.dN)(t,a,e.length),"sum"===r&&(0,Cn.dN)(t,a,(0,Nt.sumBy)(e,a)),"max"===r&&(0,Cn.dN)(t,a,(0,Nt.maxBy)(e,a)[a]),"min"===r&&(0,Cn.dN)(t,a,(0,Nt.minBy)(e,a)[a]),"avg"===r&&(0,Cn.dN)(t,a,((0,Nt.sumBy)(e,a)/e.length).toFixed(2))})),l.push(t)})),l})(n.current.tableFullData)),E={size:s,height:400,...p?{fetch:{api:m.api,params:b,dataKey:null==m?void 0:m.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(Zi,E)},pi=e=>{const{onClose:l}=e,{global:a}=t().useContext(r),{tableProps:n,$size:i,flattenColumns:o}=t().useContext(cn),{uniqueKey:s}=n,c=t().useRef(null),u=t().useRef(null),[p,m]=t().useState(!1),[f,g]=t().useState([]),[b,y]=t().useState(""),[v,x]=t().useState("");ye((()=>{if(v){const{group:e,summary:t}=f.find((e=>e.value===v)).list;_(e),A(t)}else _([]),A([])}),[v]),t().useEffect((()=>{L()}),[]);const C=t().useMemo((()=>s?`summary_${s}`:""),[s]),S=t().useMemo((()=>o.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,"index","pageIndex",Tn.operationColumn].includes(e.dataIndex)))),[o]),w=S.filter((e=>!e.groupSummary)).map((e=>({text:e.title,value:e.dataIndex}))),T=[Tn.groupSummary.total,...S.filter((e=>!!e.groupSummary)).map((e=>({text:e.title,value:e.dataIndex})))],I=[{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"}],[N,_]=t().useState([]),[R,P]=t().useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,l)=>t().createElement("div",null,t().createElement(G,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(l)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:d("qm.table.groupSummary.groupItem"),width:200,editRender:e=>({type:"select",editable:!0,items:w.map((e=>({...e,disabled:N.findIndex((t=>t.group===e.value))>-1})))})}]),[O,A]=t().useState([]),[k,F]=t().useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,l)=>t().createElement("div",null,t().createElement(G,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(l)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:d("qm.table.groupSummary.summaryColumn"),width:200,editRender:e=>({type:"select",editable:!0,items:T.map((e=>({...e,disabled:O.findIndex((t=>t.summary===e.value))>-1}))),onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:d("qm.table.groupSummary.calcFormula"),width:150,editRender:e=>({type:"select",editable:!0,items:e.summary===Tn.groupSummary.total.value?I.slice(I.length-1):I})}]),q=t().useMemo((()=>{const e=N.length&&N.every((e=>Object.values(e).every((e=>""!==e)))),t=O.length&&O.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[N,O]),L=async()=>{if(!C)return;let e=await di().getItem(C);e||(e=await D(C),Array.isArray(e)&&await di().setItem(C,e)),Array.isArray(e)&&e.length&&(g(e),x(e[0].value))},D=async e=>{const t=null==a?void 0:a.getComponentConfigApi;if(t)try{const l=await t({key:e});if(200===l.code)return l.data}catch(e){}},H=async(e,t)=>{const l=null==a?void 0:a.saveComponentConfigApi;if(l)try{await l({[e]:t})}catch(e){}},$=ae("table"),M={visible:p,title:d("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>m(!1)};return t().createElement("div",{className:`${$}-group-summary__setting`},t().createElement("div",{className:"main"},t().createElement("div",{style:{width:"30%"}},t().createElement(Zi,{ref:c,size:i,columns:R,dataSource:N,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onDataChange:e=>{_(e)}},t().createElement(G,{type:"primary",icon:t().createElement(re.PlusOutlined,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t().createElement("div",{className:"container line"},t().createElement(Zi,{ref:u,size:i,columns:k,dataSource:O,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>F(e),onDataChange:e=>{A(e)}},t().createElement(G,{type:"primary",icon:t().createElement(re.PlusOutlined,null),onClick:()=>{u.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(E.Input,{size:i,value:b,placeholder:d("qm.table.groupSummary.configText"),disabled:q,onChange:e=>{const{value:t}=e.target;y(t)}}),t().createElement(G,{type:"primary",disabled:!b||q,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!C)return h("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,Cn.wE)(),t=[...f,{text:b,value:e,list:{group:N.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))}}];g(t),x(e),y(""),await di().setItem(C,t),await H(C,t)})()},d("qm.table.groupSummary.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${Tn.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:le()({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 di().setItem(C,t),await H(C,t)})(e.value)}},t().createElement(re.CloseCircleOutlined,null))))),!f.length&&t().createElement("div",{style:{padding:un}},t().createElement(ze,null)))))),t().createElement(It,M,t().createElement(ui,{columns:S,group:N,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(G,{onClick:()=>l(),style:{marginRight:8}},d("qm.table.groupSummary.closeButton")),t().createElement(G,{type:"primary",disabled:q,onClick:()=>m(!0)},d("qm.table.groupSummary.confirmButton"))))},mi=()=>{const[e,l]=t().useState(!1),a=ae("table"),r={visible:e,title:d("qm.table.groupSummary.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>l(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:`${a}-group-summary`,title:d("qm.table.groupSummary.text"),onClick:()=>l(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.PieChartOutlined,null))),t().createElement(It,r,t().createElement(pi,{onClose:()=>l(!1)})))};var hi=__webpack_require__(762);const fi=e=>{const{onClose:l}=e,{global:a}=t().useContext(r),{tableProps:n,$size:i,flattenColumns:o,setSuperFilters:s,clearTableFilter:c}=t().useContext(cn),{uniqueKey:u}=n,p=t().useRef(null),[m,f]=t().useState([]),[g,b]=t().useState([]),[y,v]=t().useState(""),[x,C]=t().useState("");ye((()=>{f(x?g.find((e=>e.value===x)).list:[])}),[x]),t().useEffect((()=>{F()}),[]);const S=t().useMemo((()=>u?`superSearch_${u}`:""),[u]),w=t().useMemo((()=>o.filter((e=>!!e.filter))),[o]),T=(0,Cn.TQ)(m),I=t().useMemo((()=>!(T&&(0,hi.$P)(T))),[T]),N=[{value:"and",text:d("qm.table.highSearch.andText")},{value:"or",text:d("qm.table.highSearch.orText")}],_=o.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:e.title}))),R=e=>["in","nin"].includes(e),P=(e,t)=>{let l;switch(e){case"number":l="number";break;case"date":l="date";break;case"checkbox":case"radio":l=t?"select-multiple":"select";break;default:l="text"}return l},O=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},[A,k]=t().useState([{title:d("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,l)=>t().createElement("div",null,t().createElement(G,{type:"text",onClick:()=>{p.current.REMOVE_RECORDS(l)}},d("qm.table.highSearch.removeText")))},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,l)=>t().createElement("span",{style:{fontSize:"20px"}},e)},{title:d("qm.table.highSearch.fieldName"),dataIndex:"fieldName",required:!0,editRender:e=>({type:"select",editable:!0,items:_,rules:[{required:!0,message:d("qm.table.highSearch.noEmpty")}],onChange:t=>{var l,a;const r=Object.values(t)[0],n=null===(l=w.find((e=>e.dataIndex===r)))||void 0===l?void 0:l.filter.type,i=O(n);e.fieldType=n,e.expression=r?null===(a=i[0])||void 0===a?void 0:a.value:"",e.condition=R(e.expression)?[]:"",r||(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 l=null===(t=w.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:O(l),extra:{disabled:!e.fieldName,clearable:!1},onChange:()=>{e.condition=R(e.expression)?[]:""}}}},{title:d("qm.table.highSearch.condition"),dataIndex:"condition",width:160,editRender:e=>{var t;const l=w.find((t=>t.dataIndex===e.fieldName)),a=null==l?void 0:l.filter.type,r=(null==l||null===(t=l.filter)||void 0===t?void 0:t.items)??(null==l?void 0:l.dictItems)??[];return{type:P(a,R(e.expression)),editable:!0,items:r,extra:{disabled:!e.fieldName}}}},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,l)=>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:N,extra:{disabled:!e.fieldName,clearable:!1}})}]),F=async()=>{if(!S)return;let e=await di().getItem(S);e||(e=await q(S),Array.isArray(e)&&await di().setItem(S,e)),Array.isArray(e)&&e.length&&(b(e),C(e[0].value))},q=async e=>{const t=null==a?void 0:a.getComponentConfigApi;if(t)try{const l=await t({key:e});if(200===l.code)return l.data}catch(e){}},L=async(e,t)=>{const l=null==a?void 0:a.saveComponentConfigApi;if(l)try{await l({[e]:t})}catch(e){}},D=ae("table");return t().createElement("div",{className:`${D}-super-search__setting`},t().createElement("div",{className:"main"},t().createElement("div",{className:"container"},t().createElement(Zi,{ref:p,size:i,columns:A,dataSource:m,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>k(e),onRowClick:(e,t)=>{const{dataIndex:l}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(l)&&("bracketLeft"===l&&(e[l]=e[l]?"":"("),"bracketRight"===l&&(e[l]=e[l]?"":")"),f([...m]))},onDataChange:e=>{f(e)}},t().createElement(G,{type:"primary",icon:t().createElement(re.PlusOutlined,null),onClick:()=>{p.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),Tn.highSearch.showSQL&&T&&t().createElement("code",{className:"lang-js"},T)),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(E.Input,{size:i,value:y,placeholder:d("qm.table.highSearch.configText"),disabled:I,onChange:e=>{const{value:t}=e.target;v(t)}}),t().createElement(G,{type:"primary",disabled:!y||I,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!S)return h("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,Cn.wE)(),t=[...g,{text:y,value:e,list:m.filter((e=>!!e.fieldName))}];b(t),C(e),v(""),await di().setItem(S,t),await L(S,t)})()},d("qm.table.highSearch.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${Tn.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:le()({selected:e.value===x}),title:e.text,onClick:()=>(e=>{C(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&&C(""),await di().setItem(S,t),await L(S,t)})(e.value)}},t().createElement(re.CloseCircleOutlined,null))))),!g.length&&t().createElement("div",{style:{padding:un}},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(G,{onClick:()=>l(),style:{marginRight:8}},d("qm.table.highSearch.closeButton")),t().createElement(G,{type:"primary",disabled:I,onClick:()=>(c(),s(m.map((e=>U()(e,["index","pageIndex"])))),void l())},d("qm.table.highSearch.searchButton"))))},gi=()=>{const[e,l]=t().useState(!1),a=ae("table"),r={visible:e,title:d("qm.table.highSearch.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>l(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:`${a}-super-search`,title:d("qm.table.highSearch.text"),onClick:()=>l(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.FunnelPlotOutlined,null))),t().createElement(It,r,t().createElement(fi,{onClose:()=>l(!1)})))},bi=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/.test(e),yi=e=>{const{onClose:l}=e,{global:a}=t().useContext(r),{tableProps:n,tableRef:i,getRowKey:o,$size:s,flattenColumns:c,pagination:u,setPagination:p,scrollYToRecord:m,setHighlightKey:f,setShouldToTop:g,isTreeTable:b,isWebPagination:y}=t().useContext(cn),{uniqueKey:v}=n,x=t().useRef(null),C=t().useRef(null),S=t().useRef([]),w=t().useRef(""),T=t().useRef(-1),I=t().useRef("stop");ye((()=>{const{current:e,pageSize:t}=u,l=i.current.tableFullData.slice((e-1)*t,e*t),a=(0,Cn.tL)(l).findIndex((e=>o(e,e.index)===w.current));m("",a)}),[u.current]);const N=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:N(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(),[l,a]=await C.current.GET_FORM_DATA(),r=(0,Nt.omitBy)(Object.assign({},t,a),z.xb);A(r)}}))),R={case:0,fullchar:0},P=t().useMemo((()=>c.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,"index","pageIndex",Tn.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[c]),[O,A]=t().useState({}),[k,F]=t().useState(R),[q]=t().useState(_([P[0]])),[L]=t().useState(_(P.slice(1))),[D,H]=t().useState(0),$=t().useMemo((()=>!Object.keys(O).length),[O]);ye((()=>{I.current="ready"}),[O,k]);const M=e=>{F(Object.assign({},k,e))},K=(e,t,l)=>new Promise(((a,r)=>{E.Modal.confirm({title:d("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),a()},onCancel:()=>{l(),a()}})})),V=async e=>{if(!Object.keys(O).length)return E.Modal.warning({title:d("qm.button.confirmPrompt"),content:d("qm.table.fastSearch.queryCondition")});if("ready"===I.current&&(I.current="stop",S.current=(e=>{const{allTableData:t}=i.current,l=[];for(let a=0,r=t.length;a<r;a++){const r=t[a];let n=!0;for(const t in e){const{type:l}=P.find((e=>e.dataIndex===t)).filter;let a=(0,Cn.C_)(r,t),i=!0;if("text"===l||"textarea"===l?i=new RegExp(k.fullchar?`^${e[t]}$`:e[t],k.case?"":"i").test(a):(a=bi(a)?a.slice(0,10):a,i=a==e[t]),!i){n=!1;break}}n&&l.push(r)}return l})(O),H(S.current.length)),!S.current.length)return f(""),E.Modal.warning({title:d("qm.button.confirmPrompt"),content:d("qm.table.fastSearch.notMatch")});"next"===e&&(T.current=T.current<0?0:T.current+1,T.current>S.current.length-1&&await K(d("qm.table.fastSearch.toTheEnd"),(()=>T.current=0),(()=>T.current=S.current.length-1))),"prev"===e&&(T.current=T.current<0?S.current.length-1:T.current-1,T.current<0&&await K(d("qm.table.fastSearch.toStart"),(()=>T.current=S.current.length-1),(()=>T.current=0)));const t=S.current[T.current],l=o(t,t.index);let a=t.index;if(b&&y){const e=(0,Cn.Qi)(i.current.deriveRowKeys,l)[0];a=i.current.tableFullData.findIndex((t=>o(t,t.index)===e))}((e,t)=>{if(w.current=e,y){const{pageSize:e}=u,l=Math.ceil((t+1)/e);g(!1),p(Object.assign({},u,{current:l}))}else m(e)})(l,a),f(l)},j=()=>{x.current.RESET_FORM(),C.current.RESET_FORM()},B=t().useMemo((()=>v?`fastSearch_${v}`:""),[v]),[W,Y]=t().useState([]),[Z,X]=t().useState(""),[Q,J]=t().useState("");ye((()=>{if(Q){const{filters:e,config:t}=W.find((e=>e.value===Q)).list;x.current.SET_FIELDS_VALUE(U()(e,L.map((e=>e.fieldName)))),C.current.SET_FIELDS_VALUE(U()(e,q.map((e=>e.fieldName)))),A(e),F(t)}else j(),A({}),F(R)}),[Q]),t().useEffect((()=>{ee()}),[]);const ee=async()=>{if(!B)return;let e=await di().getItem(B);e||(e=await te(B),Array.isArray(e)&&await di().setItem(B,e)),Array.isArray(e)&&e.length&&(Y(e),J(e[0].value))},te=async e=>{const t=null==a?void 0:a.getComponentConfigApi;if(t)try{const l=await t({key:e});if(200===l.code)return l.data}catch(e){}},ne=async(e,t)=>{const l=null==a?void 0:a.saveComponentConfigApi;if(l)try{await l({[e]:t})}catch(e){}},ie=ae("table");return t().createElement("div",{className:`${ie}-fast-search__setting`},t().createElement("div",{className:"main"},t().createElement("div",{className:"top"},t().createElement("div",{className:"container"},t().createElement(gt,{defaultActiveKey:"1",size:"small",tabBarExtraContent:t().createElement("span",null,d("qm.table.alert.total",{total:D}))},t().createElement(gt.TabPane,{tab:d("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},t().createElement(Cr,{ref:x,items:q,cols:1,labelWidth:110})),t().createElement(gt.TabPane,{tab:d("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},t().createElement(Cr,{ref:C,items:L,cols:1,labelWidth:110})))),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(E.Input,{size:s,value:Z,placeholder:d("qm.table.highSearch.configText"),disabled:$,onChange:e=>{const{value:t}=e.target;X(t)}}),t().createElement(G,{type:"primary",disabled:!Z||$,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!B)return h("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,Cn.wE)(),t=[...W,{text:Z,value:e,list:{filters:O,config:k}}];Y(t),J(e),X(""),await di().setItem(B,t),await ne(B,t)})()},d("qm.table.highSearch.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${Tn.rowHeightMaps[s]}px`}},t().createElement("span",null,d("qm.table.fastSearch.savedSetting"))),t().createElement("ul",null,W.map((e=>t().createElement("li",{key:e.value,className:le()({selected:e.value===Q}),title:e.text,onClick:()=>(e=>{J(e!==Q?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=W.filter((t=>t.value!==e));Y(t),e===Q&&J(""),await di().setItem(B,t),await ne(B,t)})(e.value)}},t().createElement(re.CloseCircleOutlined,null))))),!W.length&&t().createElement("div",{style:{padding:un}},t().createElement(ze,null)))))),t().createElement("div",{className:"bottom"},t().createElement("div",null,t().createElement(E.Checkbox,{checked:!!k.case,onChange:e=>M({case:e.target.checked})},d("qm.table.fastSearch.matchCase")),t().createElement(E.Checkbox,{checked:!!k.fullchar,onChange:e=>M({fullchar:e.target.checked})},d("qm.table.fastSearch.matchFullchar"))),t().createElement("div",null,t().createElement(G,{onClick:()=>j()},d("qm.table.fastSearch.clear"))))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${Sl[s]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(G,{onClick:()=>l(),style:{marginRight:8}},d("qm.table.fastSearch.closeButton")),t().createElement(G,{type:"primary",style:{marginRight:8},onClick:()=>V("prev")},d("qm.table.fastSearch.queryPrev")),t().createElement(G,{type:"primary",onClick:()=>V("next")},d("qm.table.fastSearch.queryNext"))))},vi=()=>{const{tableProps:e,$size:l}=t().useContext(cn),[a,r]=t().useState(!1),n=ae("table"),i={visible:a,title:d("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${Sl[l]+20}px`},onClose:()=>r(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:`${n}-super-search`,title:d("qm.table.fastSearch.text"),onClick:()=>r(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.MonitorOutlined,null))),t().createElement(It,i,t().createElement(yi,{onClose:()=>r(!1)})))},xi=e=>{const{columns:l}=e,{global:a}=t().useContext(r),{tableProps:n,tableRef:i,$size:o}=t().useContext(cn),{uniqueKey:s,onlyShowIcon:c,columnsChange:u}=n,p=t().useRef([]),m=e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)),h=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(m(l)),[x,C]=t().useState(h(l)),[S,w]=t().useState(f(l)),T=t().useMemo((()=>s?`table_${s}`:""),[s]),I=t().useMemo((()=>[...y,...S,...x]),[y,S,x]);ye((()=>{P(l),R(l),N(l)}),[l]),t().useEffect((()=>{_()}),[]);const N=e=>{if(!T)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}})),l=JSON.parse(localStorage.getItem(T));(0,Nt.isEqual)(t,l)||(localStorage.setItem(T,JSON.stringify(t)),(async(e,t)=>{const l=null==a?void 0:a.saveComponentConfigApi;if(l)try{await l({[e]:t})}catch(e){}})(T,t))},_=()=>{const e=(()=>{if(!T)return;const e=JSON.parse(localStorage.getItem(T));return e||(async e=>{const t=null==a?void 0:a.getComponentConfigApi;if(t)try{const l=await t({key:e});if(200===l.code)return l.data}catch(e){}})(T).then((e=>{if(!e)return N(l);localStorage.setItem(T,JSON.stringify(e)),_()})).catch((()=>{})),e?(0,Nt.xor)(e.map((e=>e.dataIndex)),l.map((e=>e.dataIndex))).length>0?l.map((t=>{const{dataIndex:l}=t,a=e.find((e=>e.dataIndex===l));return a?(void 0!==a.hidden&&(t.hidden=a.hidden),void 0!==a.fixed&&(t.fixed=a.fixed),void 0!==a.width&&(t.width=a.width),void 0!==a.renderWidth&&(t.renderWidth=a.renderWidth),t):t})):e.map((e=>{const t=l.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=m(e),l=h(e),a=f(e);return v(t),C(l),w(a),[...t,...a,...l]},P=e=>{const t=[];e.filter((e=>!e.noAuth)).forEach(((l,a)=>{const r=l.colSpan;r>1&&e.slice(a+1,a+r).every((e=>{let{colSpan:t}=e;return 0===t}))&&t.push(e.slice(a,a+r))})),p.current=t},O=()=>{const e=[];I.forEach((t=>{const{colSpan:l,dataIndex:a}=t;if(0===l)return;if(1===l)return e.push(t);const r=p.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(a)));if(-1===r)return e.push(t);e.push(...p.current[r].map(((e,l)=>{let{dataIndex:a}=e;const r=I.find((e=>e.dataIndex===a));return l>0&&(void 0!==t.hidden&&(r.hidden=t.hidden),void 0!==t.fixed?r.fixed=t.fixed:r.fixed&&delete r.fixed),r})))})),l.forEach(((t,l)=>{t.noAuth&&e.findIndex((e=>e.dataIndex===t.dataIndex))<0&&e.splice(l,0,t)})),null==u||u(e)},A=(e,t)=>{t?e.fixed=t:delete e.fixed;const a=R(l);null==u||u(a)},k=(e,a)=>{const{colSpan:r}=e;if(0===r)return t().createElement("li",{key:e.dataIndex,style:{display:"none"}});const n=["svgicon","handle",`${a}-handle`];return t().createElement("li",{key:e.dataIndex,className:"item"},t().createElement(E.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:a}=t.target;e.hidden=!a,R(l),O()}}),t().createElement("i",{className:le()(n),title:d("qm.table.columnFilter.draggable")},t().createElement(re.HolderOutlined,null)),t().createElement("span",{className:"text",title:e.title},e.title),"main"===a?t().createElement("span",{className:"fixed"},t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.fixedLeft"),onClick:()=>A(e,"left")},t().createElement(re.StepBackwardOutlined,null)),t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.fixedRight"),onClick:()=>A(e,"right")},t().createElement(re.StepForwardOutlined,null))):t().createElement("span",{className:"fixed"},t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.cancelFixed"),onClick:()=>A(e)},t().createElement(re.CloseCircleOutlined,null))))},F=ae("table"),q={[`${F}__popper`]:!0,"column-filter__popper":!0,[`${F}--lg`]:"large"===o,[`${F}--sm`]:"small"===o},L=[`${F}-column-filter`,{selected:g}];return t().createElement(Aa(),{action:["click"],popupVisible:g,popup:t().createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},t().createElement("div",{className:"reset"},t().createElement(G,{type:"text",size:"small",onClick:()=>{const e=(0,Nt.cloneDeep)(i.current.originColumns);R(e),null==u||u(e)}},d("qm.table.columnFilter.reset"))),t().createElement("div",{className:"left"},t().createElement(al.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),l=y.map((e=>e.dataIndex));(0,Nt.isEqual)(t,l)||v(e)},onEnd:()=>O()},y.map((e=>k(e,"left"))))),t().createElement("div",{className:"divider"}),t().createElement("div",{className:"main"},t().createElement(al.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:S,setList:e=>{const t=e.map((e=>e.dataIndex)),l=S.map((e=>e.dataIndex));(0,Nt.isEqual)(t,l)||w(e)},onEnd:()=>O()},S.map((e=>k(e,"main"))))),t().createElement("div",{className:"divider"}),t().createElement("div",{className:"right"},t().createElement(al.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:x,setList:e=>{const t=e.map((e=>e.dataIndex)),l=x.map((e=>e.dataIndex));(0,Nt.isEqual)(t,l)||C(e)},onEnd:()=>O()},x.map((e=>k(e,"right")))))),popupClassName:le()(q),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{b(e)},builtinPlacements:yn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t().createElement("span",{className:le()(L),title:c?d("qm.table.columnFilter.text"):void 0},t().createElement("i",{className:"svgicon icon"},t().createElement(re.SettingOutlined,null)),!c&&t().createElement("span",null,d("qm.table.columnFilter.text"))))},Ei=()=>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 Ci(){return Ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Ci.apply(this,arguments)}const Si=e=>{const{column:l,filters:a}=e,{$size:r,setFilters:n,clearSuperFilters:i}=t().useContext(cn),o=t().useRef(null),s=t().useRef(null),c=t().useRef(null),[u,p]=t().useState(!1),[m,f]=t().useState({}),g=t().useMemo((()=>{const{dataIndex:e,filter:t}=l;return`${e}|${t.type}`}),[l]),b=t().useMemo((()=>{let e=!1;for(const t in a[g])if(!(0,z.xb)(a[g][t])){e=!0;break}return e}),[g,a]);t().useEffect((()=>{u&&((0,z.xb)(a[g])&&y(),setTimeout((()=>v()),50))}),[u]);const y=()=>{f({})},v=()=>{switch(l.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 l in e[t])(0,z.xb)(e[t][l])&&delete e[t][l];Object.keys(e[t]).length||delete e[t]}return e})({...a,...m,...e})),S(!1)},C={text:e=>{var l;const{title:a}=e;return t().createElement(E.Input,{ref:o,size:r,placeholder:d("qm.table.filter.searchText",{text:a}),style:{width:"180px"},value:(null===(l=m[g])||void 0===l?void 0:l.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 l;const{title:a}=e;return t().createElement(E.Input.TextArea,{ref:c,size:r,placeholder:d("qm.table.filter.searchAreaText",{text:a}),style:{width:"220px"},value:(null===(l=m[g])||void 0===l?void 0:l.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 l=e=>{var t;return{value:(null===(t=m[g])||void 0===t?void 0:t[e])??"",onChange:t=>{f((l=>Object.assign({},l,{[g]:Object.assign({},l[g],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t().createElement("ul",null,t().createElement("li",null,t().createElement("span",null,"> "),t().createElement(E.InputNumber,Ci({ref:s,size:r},l(">"),{placeholder:d("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"< "),t().createElement(E.InputNumber,Ci({size:r},l("<"),{placeholder:d("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"= "),t().createElement(E.InputNumber,Ci({size:r},l("=="),{placeholder:d("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"!="),t().createElement(E.InputNumber,Ci({size:r},l("!="),{placeholder:d("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const l=e=>{var t;return{value:(0,Cn._3)(null===(t=m[g])||void 0===t?void 0:t[e],hn),format:hn,onChange:t=>{f((l=>Object.assign({},l,{[g]:Object.assign({},l[g],{[e]:(0,Cn.p6)(t,hn)})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t().createElement("ul",null,t().createElement("li",null,t().createElement("span",null,"> "),t().createElement(R,Ci({size:r},l(">"),{placeholder:d("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"< "),t().createElement(R,Ci({size:r},l("<"),{placeholder:d("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"= "),t().createElement(R,Ci({size:r},l("=="),{placeholder:d("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"!="),t().createElement(R,Ci({size:r},l("!="),{placeholder:d("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var l;const{filter:a,dictItems:r=[]}=e,n=a.items||r;return t().createElement("ul",null,t().createElement(E.Radio.Group,{style:{width:"100%"},value:null===(l=m[g])||void 0===l?void 0:l["=="],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(E.Radio,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var l;const{filter:a,dictItems:r=[]}=e,n=a.items||r;return t().createElement("ul",null,t().createElement(E.Checkbox.Group,{style:{width:"100%"},value:null===(l=m[g])||void 0===l?void 0:l.in,onChange:e=>{f((t=>Object.assign({},t,{[g]:{in:e}})))}},n.map((e=>t().createElement("li",{key:e.value},t().createElement(E.Checkbox,{value:e.value,disabled:e.disabled},e.text))))))}},S=e=>{p(e)},w=ae("table"),T={[`${w}__popper`]:!0,[`${w}--lg`]:"large"===r,[`${w}--sm`]:"small"===r},I=["cell--filter",{selected:u,actived:b}];return t().createElement(Aa(),{action:["click"],popupVisible:u,popup:(()=>{const e=l.filter.type,a=C[e];return a?t().createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},t().createElement("div",null,a(l)),t().createElement(E.Space,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},t().createElement(G,{size:r,onClick:()=>{x({[g]:{}})}},d("qm.table.filter.reset")),t().createElement(G,{type:"primary",size:r,onClick:()=>x()},d("qm.table.filter.search")))):(h("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:le()(T),popupStyle:{minWidth:150},onPopupVisibleChange:S,builtinPlacements:yn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t().createElement("div",{className:le()(I),title:d("qm.table.filter.text"),onClick:e=>e.stopPropagation()},t().createElement("span",{className:"svgicon icon"},t().createElement(Ei,null))))},wi=e=>{const{column:l}=e,{tableProps:a,tableRef:r,bordered:n}=t().useContext(cn),{columns:i,resizable:o,columnsChange:s=z.ZT}=a,c={resizable:!0,"is--line":o&&!n};return t().createElement("div",{className:le()(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:a}=r.current,n=a.$resizableBar,o=t.offsetWidth/2,c=e.clientX,d=(0,Cn.tj)(t,a.$table).left-a.$tableBody.parentNode.scrollLeft+o;a.$table.classList.add("c--resize"),n.style.left=`${d}px`,n.style.display="block";const u=l.width||l.renderWidth;let p=u;return document.onmousemove=function(e){if("number"!=typeof u)return;const t=e.clientX-c,l=u+t;l<Tn.defaultColumnWidth||(p=Math.floor(l),n.style.left=`${t+d}px`)},document.onmouseup=function(){a.$table.classList.remove("c--resize"),n.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(l.renderWidth=p,l.width=p,s([...i]))},!1}})},Ti=e=>{const{selectionKeys:l}=e,{tableRef:a,tableProps:r,getRowKey:n,pagination:i,fetchParams:o,setSelectionKeys:s,setSpinning:c,isWebPagination:u}=t().useContext(cn),{rowSelection:p}=r,{fetchAllRowKeys:m,onSelectAll:h}=p,f=(()=>{const{allTableData:e,allRowKeys:t}=a.current,{selectAllOnCurrentPage:l,disabled:r=(e=>!1)}=p;return l?(()=>{const{tableFullData:e}=a.current,{current:t,pageSize:l}=i;return u?e.slice((t-1)*l,t*l):e})().filter((e=>!r(e))).map((e=>n(e,e.index))):t.filter(((t,l)=>!r(e[l])))})(),g=t().useMemo((()=>p.selectAllOnCurrentPage??!1),[p]),b=t().useMemo((()=>(p.filterable??!0)&&!g),[p,g]),y=t().useMemo((()=>l.length>0&&l.length<(m?i.total:f.length)),[l.length,f.length,i.total]),v=t().useMemo((()=>!y&&l.length>0),[y,l.length]),x=async()=>{const e=m;let t=[];c(!0);try{const l=await e.api(o);200===l.code&&(t=Array.isArray(l.data)?l.data:(0,z.U2)(l.data,e.dataKey)??[])}catch(e){}return c(!1),t},C=async e=>{let t=[];t=m?e?await x():[]:e?f.slice(0):[],s(t),null==h||h(e,t)};return t().createElement("div",{className:"cell--selection"},t().createElement(E.Checkbox,{checked:v,indeterminate:y,disabled:!f.length,onChange:e=>C(e.target.checked)}),b&&t().createElement(E.Dropdown,{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=m?(0,Nt.xor)(l,await x()):(0,Nt.xor)(l,f),s(e)})()},{key:3,label:d("qm.table.selection.clear"),onClick:()=>{C(!1)}}];return t().createElement(E.Menu,{items:e})})()},t().createElement(re.DownOutlined,{className:"svgicon icon"})),g&&t().createElement(E.Tooltip,{placement:"top",title:d("qm.table.selection.currentPage")},t().createElement(re.InfoCircleOutlined,{className:"info"})))},Ii=e=>{const{style:l}=e,{tableProps:a,tableRef:r,isTreeTable:n,setRowExpandedKeys:i}=t().useContext(cn),{expandable:o}=a,[s,c]=t().useState((null==o?void 0:o.defaultExpandAllRows)||!1);ye((()=>{const{allRowKeys:e,flattenRowKeys:t}=r.current;i(s?e.filter((e=>!(n&&t.includes(e)))):[])}),[s]);const d={[`${ae("expand")}--icon`]:!0,expanded:s,collapsed:!s};return t().createElement("span",{className:le()(d),title:"",onClick:e=>{e.stopPropagation(),c(!s)},style:l})},Ni=()=>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"})),_i=()=>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"})),Ri=e=>{const{tableColumns:l,flattenColumns:a,sorter:r,filters:n}=e,{getRowKey:i,tableProps:o,tableRef:s,layout:c,scrollY:u,superFilters:p,selectionKeys:m,rightFixedColumns:h,firstDataIndex:f,isFetch:g,isTreeTable:b,isGroupSubtotal:y,tableChange:v,setSorter:x,setElementStore:C,resetTableScroll:S,getStickyLeft:w,getStickyRight:T,createGroupData:I,createTableFullData:N}=t().useContext(cn),{ellipsis:_,resizable:R,multipleSort:P,rowSelection:O,expandable:A}=o,[k,F]=Tn.sortDirections,q=t().useRef(null),L=t().useMemo((()=>!g),[g]),D=t().useMemo((()=>!g),[g]),H=t().useMemo((()=>!(null!=A&&A.hideExpandAll)),[A]),$=t().useMemo((()=>g?!!(null!=O&&O.selectAllOnCurrentPage||null!=O&&O.fetchAllRowKeys):!(null!=O&&O.hideSelectAll)),[g,O]);ye((()=>{j(),v(),S()}),[r]),ye((()=>{G(),v(),S()}),[n]),ye((()=>{G(),v(),S()}),[p]),t().useEffect((()=>{M()}),[]);const M=()=>{C("$header",q.current)},K=e=>{const{dataIndex:l,type:a,sorter:n,title:i,description:o}=e;if(l===Tn.selectionColumn&&"checkbox"===a){if("checkbox"===a)return t().createElement("div",{className:"cell"},$?t().createElement(Ti,{selectionKeys:m}):d("qm.table.config.selectionText"));if("radio"===a)return t().createElement("div",{className:"cell"},i)}const s=[];return s.push(t().createElement("div",{key:0,className:"cell",title:i},b&&l===f&&H?t().createElement(Ii,null):null,l===Tn.expandableColumn&&H?t().createElement(Ii,null):i)),o&&s.push(t().createElement(E.Tooltip,{key:1,placement:"top",title:o},t().createElement(re.InfoCircleOutlined,{className:"tip"}))),n&&s.push(V(r[l])),s},V=e=>{const l=["svgicon cell--sorter__asc",{actived:e===k}],a=["svgicon cell--sorter__desc",{actived:e===F}];return t().createElement("div",{key:2,className:"cell--sorter",title:d("qm.table.sorter.text")},t().createElement("span",{className:le()(l)},t().createElement(Ni,null)),t().createElement("span",{className:le()(a)},t().createElement(_i,null)))},U=e=>t().createElement(Si,{column:e,filters:n}),z=(e,t)=>{const{sorter:l,dataIndex:a}=t;if(l){const e=r[a],t=e?e===F?null:F:k;P?(delete r[a],x(Object.assign({},r,{[a]:t}))):x(Object.assign({},{[a]:t}))}},j=()=>{L&&B()},B=e=>{const t=(0,Nt.pickBy)(r,(e=>null!==e));for(const e in t){const l=a.find((t=>t.dataIndex===e));l?W(l,t[e]):delete t[e]}e||Object.keys(t).length||W({dataIndex:"index"},k)},W=(e,t)=>{const{tableFullData:l}=s.current,{dataIndex:a,sorter:r}=e,n=(e,l)=>{const r=(0,Cn.C_)(e,a),n=(0,Cn.C_)(l,a);return Number.isNaN(r-n)?t===k?r.toString().localeCompare(n.toString()):n.toString().localeCompare(r.toString()):t===k?r-n:n-r},i=y?I((0,Cn.SX)(l).sort("function"==typeof r?r:n)):l.sort("function"==typeof r?r:n).slice(0);N(i)},G=()=>{D&&Y()},Y=()=>{const{tableOriginData:e}=s.current,t=p.length?(0,Cn.TQ)(p):(0,Cn.TQ)(n),l=""!==t?y?I((0,hi.ar)((0,Cn.SX)(e),t,b)):(0,hi.ar)(e,t,b):e;N(l),B(!0)},Z=(0,Cn.vo)(l),X=ae("table"),{tableBodyWidth:Q}=c;return t().createElement("div",{ref:q,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,a.map((e=>{const{dataIndex:l,width:a,renderWidth:r}=e;return t().createElement("col",{key:l,style:{width:`${a||r}px`,minWidth:`${a||r}px`}})})),u&&t().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t().createElement("thead",null,(e=>{const{isIE:l}=s.current,a=["gutter",{"cell-fix-right":!!h.length}],n=l?null:{right:h.length?0:""};return e.map(((e,l)=>t().createElement("tr",{key:l,className:"header--row"},e.map(((l,a)=>((e,l,a)=>{var n,i;const{isIE:o}=s.current,{gutterWidth:d}=c,{dataIndex:p,colSpan:m,rowSpan:h,fixed:f,align:g,sorter:b,filter:y,required:v,headRender:x}=e;if(0===m)return null;const E=["header--column",{"col--ellipsis":e.ellipsis??_,"col--center":"center"===g,"col--right":"right"===g,"column--required":!!v,"column-has-sorter":b,"column-has-filter":y,"column--sort":!!r[p],"cell-fix-left":!o&&"left"===f,"cell-fix-right":!o&&"right"===f,"cell-fix-left-last":!(o||"left"!==f||null!==(n=a[l+1])&&void 0!==n&&n.fixed),"cell-fix-right-first":!(o||"right"!==f||null!==(i=a[l-1])&&void 0!==i&&i.fixed)}],C=o?null:{left:"left"===f?`${w(p)}px`:"",right:"right"===f?`${T(p)+(u?d:0)}px`:""},S=R&&![Tn.expandableColumn,Tn.selectionColumn].includes(p);return t().createElement("th",{key:p,className:le()(E),colSpan:m,rowSpan:h,style:{...C},onClick:t=>z(t,e)},t().createElement("div",{className:"cell--wrapper"},x?t().createElement("div",{className:"cell--text cell"},x(e,s.current.tableFullData)):t().createElement(t().Fragment,null,t().createElement("div",{className:"cell--text"},K(e)),y?U(e):null)),S&&t().createElement(wi,{column:e}))})(l,a,e))),u&&t().createElement("th",{className:le()(a),style:{...n}}))))})(Z))))},Pi=()=>{const{tableProps:e,tableRef:l,flattenColumns:a,isDragMergeCell:r}=t().useContext(cn),{mergeCells:n=[],onMergeChange:i}=e,[o,s]=t().useState(!1),c=t().useRef(null),u=t().useRef(null),p=t().useRef({x:0,y:0,disX:0,disY:0});ye((()=>{r||b()}),[r]);const m=()=>{b(),Te(c.current,{display:"none"})},h=e=>{const t=[];for(let l=0;l<e.rowSpan;l++)for(let a=0;a<e.colSpan;a++)t.push([e.row+l,e.col+a]);return t},f=()=>{p.current={x:0,y:0,disX:0,disY:0},u.current&&!y(u.current)||(u.current=null,m()),s(!0),document.removeEventListener("mousemove",g)},g=e=>{const{pageX:t,pageY:l}=e,{x:a,y:r,disX:n,disY:i}=p.current;let o=n,s=i,d=t-a,u=l-r;return d<0&&(d=Math.abs(d),o=n-d,Te(c.current,{left:`${o}px`})),u<0&&(u=Math.abs(u),s=i-u,Te(c.current,{top:`${s}px`})),Te(c.current,{width:`${d}px`,height:`${u}px`}),x(o,s,d,u),!1},b=()=>{const{elementStore:e}=l.current,t=e.$tableBody.querySelectorAll("tbody > tr");for(let e=0;e<t.length;e++){const l=t[e].children;for(let e=0;e<l.length;e++)l[e].classList.remove("selected")}},y=e=>1===e.rowSpan&&1===e.colSpan,v=e=>e.width||e.renderWidth||0,x=(0,z.Ds)(((e,t,r,n)=>{const{allTableData:i,scrollYStore:o}=l.current;let s=-1,c=-1,d=-1,p=-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 m=0;for(let t=0;t<a.length;t++)e>m&&e<m+v(a[t])&&(d=t),e+r>m&&e+r<m+v(a[t])&&(p=t),m+=v(a[t]);const h={row:s,col:d,rowSpan:c-s+1,colSpan:p-d+1};(0,Nt.isEqual)(u,h)||(u.current=h,((e,t,a,r)=>{const{elementStore:n,scrollYStore:i}=l.current,o=n.$tableBody.querySelectorAll("tbody > tr");for(let l=0;l<o.length;l++){const n=o[l].children;for(let o=0;o<n.length;o++)if(n[o].classList.remove("selected"),(e!==t||a!==r)&&l+i.startIndex>=e&&l+i.startIndex<=t){const e=Number(n[o].getAttribute("colspan")),t=Number(n[o].getAttribute("data-index")),l=e>1?t+e-1:t;l>=a&&l<=r&&n[o].classList.add("selected")}}})(s,c,d,p))}),10);return{dragStart:e=>{const{pageX:t,pageY:a}=e,{elementStore:r}=l.current,{x:n,y:i}=(e=>{let t=0,l=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,l+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:l}})(r.$tableBody);u.current=null,p.current={x:t,y:a,disX:t-n,disY:a-i},Te(c.current,{width:0,height:0,left:t-n+"px",top:a-i+"px",display:"block"}),b(),s(!1),document.addEventListener("mousemove",g,{passive:!0}),document.addEventListener("mouseup",f,{passive:!0,once:!0})},renderDragPanel:()=>t().createElement("div",{ref:c,className:"merge-cell-bar",onMouseDown:e=>e.stopPropagation()},o&&t().createElement(t().Fragment,null,t().createElement(G,{size:"small",className:"btn cancel",onClick:()=>{if(u.current&&!y(u.current)){const e=h(u.current),t=n.findIndex((t=>{const l=h(t);return(0,Nt.intersectionWith)(l,e,Nt.isEqual).length===l.length}));-1!==t&&(null==i||i(n.filter(((e,l)=>l!==t))))}m()}},d("qm.table.mergeCell.cancel")),t().createElement(G,{size:"small",type:"primary",className:"btn confirm",onClick:()=>{if(u.current&&!y(u.current)){const e=h(u.current);let t=!1;for(let l=0;l<n.length;l++)(0,Nt.intersectionWith)(h(n[l]),e,Nt.isEqual).length&&(t=!0);t||null==i||i([...n,u.current])}m()}},d("qm.table.mergeCell.confirm")))),closeDragPanel:m}};const Oi=e=>{const{selectionKeys:l,column:a,record:r,rowKey:n}=e,{tableProps:i,tableRef:o,isTreeTable:s,getAllChildRowKeys:c}=t().useContext(cn),{rowSelection:d}=i,u=t().useMemo((()=>a.type),[a.type]),p=e=>{const t=d.checkStrictly??!0;if(!s||t)return!1;const a=(0,Cn.CD)(o.current.deriveRowKeys,e),r=c((null==a?void 0:a.children)??[]);return!(!Array.isArray(null==a?void 0:a.children)||(0,Cn.bY)(l,(null==a?void 0:a.children.map((e=>e.rowKey)))||[]))&&r.some((e=>l.includes(e)))};return"radio"===u?(()=>{const e=d.disabled,a=null==e?void 0:e(r),i=!a&&l[0]===n;return t().createElement(E.Radio,{checked:i,disabled:a})})():(()=>{const e=d.disabled,a=null==e?void 0:e(r),i=!(a||!l.includes(n));return t().createElement(E.Checkbox,{checked:i,indeterminate:p(n),disabled:a})})()},Ai=e=>{const{record:l,rowKey:a,style:r}=e,{tableProps:n,rowExpandedKeys:i,setRowExpandedKeys:o}=t().useContext(cn),{expandable:s={}}=n,[c]=t().useState("function"==typeof s.rowExpandable&&!s.rowExpandable(l)),d=t().useMemo((()=>i.includes(a)),[i,a]);ye((()=>{var e;null===(e=s.onExpand)||void 0===e||e.call(s,d,l)}),[d]);const u={[`${ae("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return t().createElement("span",{className:le()(u),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?i.filter((e=>e!==a)):[...i,a];o(t)},style:r})},ki=t().forwardRef(((e,l)=>{const{size:a,defaultValue:r,value:n,min:i,max:o,placeholder:s,maxLength:c,precision:d,readOnly:u,disabled:p}=e,m=e=>""!==e?Number(e):"",h=void 0!==n,[f,g]=t().useState((null==r?void 0:r.toString())??""),b=h?n.toString():f,y=t=>{const{onChange:l}=e;h?null==l||l(t):g(t)};return ye((()=>{const{onChange:t}=e;null==t||t(b)}),[f]),t().createElement(E.Input,{ref:l,size:a,value:b,maxLength:c,placeholder:s,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;(!Number.isNaN(t)&&/^-?\d*(\.\d*)?$/.test(t)||""===t||"-"===t)&&y(t)},onBlur:()=>{const{onBlur:t}=e,l=(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()),d>=0&&""!==t&&(t=Number(t).toFixed(d)),t})(b);Number(l)!==Number(b)&&y(l),null==t||t(m(l))},onKeyUp:t=>{const{onEnter:l}=e;13===t.keyCode&&(null==l||l(m(b)))}})}));ki.displayName="InputNumber";const Fi=ki,{Search:qi}=E.Input,Li=e=>{var l,a,r,n;const{column:i,record:o,rowKey:s,columnKey:c,clicked:u,text:p}=e,{tableRef:m,tableBodyRef:f,$size:g,flattenColumns:b,doFieldValidate:y,dataChange:v}=t().useContext(cn),x=t().useRef(null),C=t().useRef(null),S=t().useRef(null),w=t().useRef(null),T=t().useRef(!1),I=t().useRef(!1),N=t().useRef([]),_=t().useRef({}),P=kn(),O=m.current.store,A=null===(l=i.editRender)||void 0===l?void 0:l.call(i,o,i),[F,q]=t().useState(!1),[L,D]=t().useState(!1),[H,$]=t().useState(A.items||[]),M=!(null===(a=m.current.fieldAuth[c])||void 0===a||!a.disabled),K=(A.editable||(0,Nt.isEqual)(u,[s,c]))&&!A.disabled&&!M,V=`${s}|${c}`,U=2===u.length?`${u[0]}|${u[1]}`:"",j=![...O.state.required,...O.state.validate].some((e=>{let{x:t,y:l}=e;return t===s&&l===c})),B=(null===(r=O.state.required.find((e=>{let{x:t,y:l}=e;return t===s&&l===c})))||void 0===r?void 0:r.text)||"",W=(null===(n=O.state.validate.find((e=>{let{x:t,y:l}=e;return t===s&&l===c})))||void 0===n?void 0:n.text)||"",G=K||!j||F||L,Y=()=>{var e;(null===(e=A.extra)||void 0===e?void 0:e.cornerSign)&&(I.current=!0),v()};t().useEffect((()=>{G&&U===V&&(0,z.Y3)((()=>Q()))}),[U]);const Z=(e,t)=>{q(e),null==t||t()},X=e=>{N.current=e},Q=()=>{var e,t,l;const{type:a}=A;switch(a){case"text":null===(e=C.current)||void 0===e||e.focus();break;case"number":null===(t=S.current)||void 0===t||t.focus();break;case"search-helper":null===(l=w.current)||void 0===l||l.focus()}},J=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0}))},ee={text:(e,l)=>{const{dataIndex:a}=l,{type:r,extra:n={},rules:i=[],onInput:o,onChange:u,onEnter:p}=A,m=(0,Cn.C_)(e,a);return t().createElement(E.Input,{ref:C,size:g,value:m,maxLength:n.maxLength,showCount:n.showCount,placeholder:n.placeholder||d("qm.table.editable.inputPlaceholder"),readOnly:n.readOnly,disabled:n.disabled,suffix:n.suffix,onChange:t=>{const l=t.target.value??"";(0,Cn.dN)(e,a,l),y(i,l,s,c),null==o||o({[V]:l}),T.current=!0,P()},onBlur:t=>{const l=t.target.value??"";T.current&&(T.current=!1,O.addToUpdated(e),null==u||u({[V]:l},e),Y())},onKeyUp:t=>{if(13===t.keyCode){const l=t.target.value??"";null==p||p({[V]:l},e)}}})},number:(e,l)=>{const{dataIndex:a,precision:r}=l,{type:n,extra:i={},rules:o=[],onInput:u,onChange:p,onEnter:m}=A,h=(0,Cn.C_)(e,a);return t().createElement(Fi,{ref:S,size:g,value:h,min:i.min,max:i.max,precision:r,placeholder:i.placeholder||d("qm.table.editable.inputPlaceholder"),maxLength:i.maxLength,readOnly:i.readOnly,disabled:i.disabled,onChange:t=>{(0,Cn.dN)(e,a,t),y(o,t,s,c),null==u||u({[V]:t}),T.current=!0,P()},onBlur:t=>{T.current&&(T.current=!1,(0,Cn.dN)(e,a,t),O.addToUpdated(e),null==p||p({[V]:t},e),Y())},onEnter:t=>{null==m||m({[V]:t},e)}})},select:(e,l,a)=>{const{dataIndex:r,dictItems:n=[]}=l,{type:i,extra:o={},rules:u=[],items:p,onChange:m,onEnter:h}=A,f=p||n,b=(0,Cn.C_)(e,r);let v=b;return t().createElement(E.Select,{mode:a?"multiple":void 0,size:g,dropdownClassName:"table-editable__popper",value:b||void 0,placeholder:o.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,maxTagCount:o.collapseTags?"responsive":void 0,disabled:o.disabled,style:{width:"100%"},onChange:t=>{(0,Cn.dN)(e,r,t),y(u,t,s,c),O.addToUpdated(e),P(),null==m||m({[V]:t},e),Y()},onSelect:e=>{v=e},onInputKeyDown:t=>{13===t.keyCode&&(0,z.Y3)((()=>null==h?void 0:h({[V]:v},e)))}},f.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>ee.select(e,t,!0),date:(e,l,a)=>{const{dataIndex:r}=l,{type:n,extra:i={},rules:o=[],onChange:u}=A,p=a?fn:hn,m=(0,Cn.C_)(e,r);return t().createElement(R,{showTime:a,size:g,dropdownClassName:"table-editable__popper",value:(0,Cn._3)(m,p)??void 0,format:p,disabledDate:e=>{const{minDateTime:t,maxDateTime:l}=i;return t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day")},placeholder:d(a?"qm.table.editable.datetimePlaceholder":"qm.table.editable.datePlaceholder"),allowClear:i.allowClear,disabled:i.disabled,style:{width:"100%"},onChange:t=>{const l=(0,Cn.p6)(t,p);(0,Cn.dN)(e,r,l),y(o,l,s,c),O.addToUpdated(e),P(),null==u||u({[V]:l},e),Y()}})},datetime:(e,t)=>ee.date(e,t,!0),time:(e,l)=>{const{dataIndex:a}=l,{type:r,extra:n={},rules:i=[],onChange:o}=A,u=(0,Cn.C_)(e,a);return t().createElement(k,{size:g,dropdownClassName:"table-editable__popper",value:(0,Cn._3)(u,gn)??void 0,format:gn,placeholder:d("qm.table.editable.datetimePlaceholder"),allowClear:n.allowClear,disabled:n.disabled,style:{width:"100%"},onChange:t=>{const l=(0,Cn.p6)(t,gn);(0,Cn.dN)(e,a,l),y(i,l,s,c),O.addToUpdated(e),P(),null==o||o({[V]:l},e),Y()}})},checkbox:(e,l)=>{const{dataIndex:a}=l,{type:r,extra:n={},onChange:i}=A,{trueValue:o=pn,falseValue:s=mn,disabled:c}=n,d=(0,Cn.C_)(e,a);return t().createElement(E.Checkbox,{checked:d===o,disabled:c,onChange:t=>{const l=t.target.checked?o:s;(0,Cn.dN)(e,a,l),O.addToUpdated(e),P(),null==i||i({[V]:l},e),Y()}})},switch:(e,l)=>{const{dataIndex:a}=l,{type:r,extra:n={},onChange:i}=A,{trueValue:o=pn,falseValue:s=mn,disabled:c}=n,d=(0,Cn.C_)(e,a);return t().createElement(E.Switch,{checked:d===o,disabled:c,onChange:t=>{const l=t?o:s;(0,Cn.dN)(e,a,l),O.addToUpdated(e),P(),null==i||i({[V]:l},e),Y()}})},"search-helper":(e,l)=>{const{dataIndex:a,precision:r}=l,{type:n,extra:i={},rules:o=[],helper:u={},onInput:p,onChange:m,onEnter:v}=A,E=(0,Cn.C_)(e,a),C=u.fieldAliasMap;C||h("Table","helper 需要配置 `fieldAliasMap` 选项");const S="function"==typeof C?C():C||{};Object.keys(S).includes(a)||h("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值");const I=e=>{const{filterAliasMap:t}=u,l=""!==e?e:void 0,r="function"==typeof t?t():t??[],n={[a]:l};return r.forEach((e=>n[e]=l)),n},N=e=>{_.current=I(e),q(!0)},R=(t,a)=>{const{beforeOpen:r}=u,n=(r??z.XT)({[V]:E},e,l);null!=n&&n.then?n.then((()=>{N(t),null==a||a()})).catch((()=>{})):!1!==n&&(N(t),null==a||a())},k=e=>{const t={};for(const l in S){const r=S[l];l!==a&&(t[l]=e[r])}const l=S[a]?e[S[a]]:"";H(l,t);const{closed:r}=u;Z(!1,(()=>J(x.current))),null==r||r(e)},L=()=>{T.current&&(u.closeRemoteMatch?H(E):H("")),T.current=!1,Z(!1,(()=>J(x.current)))},H=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",l=arguments.length>1?arguments[1]:void 0;if((0,z.Kn)(l)&&Object.keys(l).length){for(const t in l){const a=l[t],r=b.find((e=>e.dataIndex===t));if(r){var n;(0,Cn.dN)(e,t,a,r.precision);const l=null===(n=r.editRender)||void 0===n?void 0:n.call(r,e,r);l&&Array.isArray(l.rules)&&y(l.rules,a,s,t)}else(0,Cn.dN)(e,t,a)}f.current.forceUpdate()}(0,Cn.dN)(e,a,t,r),y(o,t,s,c),O.addToUpdated(e),null==m||m({[V]:t},e),Y(),_.current={},T.current=!1},$={visible:F,title:d("qm.searchHelper.text"),width:u.width??"60%",loading:!1,bodyStyle:{paddingBottom:`${Sl[g]+20}px`},onClose:()=>{L()}},M={...u,size:g,initialValue:(0,Nt.merge)({},u.initialValue,_.current),onClose:e=>{e?k(e):L()}};return t().createElement(t().Fragment,null,t().createElement(qi,{ref:w,value:E,placeholder:i.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,readOnly:i.readOnly,disabled:i.disabled,onBlur:e=>{var t,l;const{value:r}=e.target;if(T.current&&!F)return r&&!u.closeRemoteMatch&&null!==(t=u.table)&&void 0!==t&&null!==(l=t.fetch)&&void 0!==l&&l.api?(e=>{const{table:t,initialValue:l={}}=u,{beforeFetch:a=z.XT}=t.fetch;return D(!0),new Promise((async(r,n)=>{const i=(0,Nt.merge)({},t.fetch.params,{...l,...I(e)},{currentPage:1,pageSize:500});try{if(a(i)){const e=await t.fetch.api(i);200===e.code?r(Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,t.fetch.dataKey)??[]):n()}else n()}catch(e){n()}D(!1)}))})(r).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,Cn.C_)(t,S[a]).toString().includes(e)));if(1===t.length)return k(t[0]);R(e)}(e,r))).catch((()=>H(""))):void H(r)},onChange:t=>{const{value:l}=t.target;(0,Cn.dN)(e,a,l),null==p||p({[V]:l}),T.current=!0,P()},onKeyUp:t=>{if(13===t.keyCode){const l=t.target.value??"";null==v||v({[V]:l},e)}},onDoubleClick:e=>{const{value:t}=e.target;R(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?R(e):H(""))}}),t().createElement(It,$,t().createElement(eo,M)))},"search-helper-multiple":(e,l)=>{const{dataIndex:a}=l,{type:r,items:n=[],extra:i={},rules:o=[],helper:u={},onInput:p,onChange:m,onEnter:f}=A,b=(0,Cn.C_)(e,a),v=u.fieldAliasMap;v||h("Table","helper 需要配置 `fieldAliasMap` 选项");const C="function"==typeof v?v():v||{};Object.keys(C).includes("valueKey")&&Object.keys(C).includes("textKey")||h("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`");const S=t=>{const{beforeOpen:a}=u,r=(a??z.XT)({[V]:b},e,l);null!=r&&r.then?r.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==r&&(q(!0),null==t||t())},w=()=>{Z(!1,(()=>J(x.current)))},T=t=>{(0,Cn.dN)(e,a,t),y(o,t,s,c),O.addToUpdated(e),null==m||m({[V]:t},e,N.current),Y()},I={visible:F,title:d("qm.searchHelper.text"),width:u.width??"60%",loading:!1,bodyStyle:{paddingBottom:`${Sl[g]+20}px`},onClose:()=>{w()}},_={...u,size:g,multiple:!0,initialValue:(0,Nt.merge)({},u.initialValue),defaultSelectedKeys:b,onClose:(e,t)=>{e?((e,t)=>{const{textKey:l,valueKey:a}=C;X((0,Nt.uniqBy)([...N.current.filter((e=>t.includes(e[a]))),...e],a));const r=N.current.map((e=>({text:e[l],value:e[a]}))),i=(0,Nt.uniqBy)([...r,...n],"value").filter((e=>t.includes(e.value)));$(i),T(i.map((e=>e.value)));const{closed:o}=u;Z(!1,(()=>J(x.current))),null==o||o(N.current)})(e,t):w()}};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(E.Select,{mode:"multiple",open:!1,value:b,placeholder:i.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,maxTagCount:i.collapseTags?"responsive":void 0,disabled:i.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==f||f({[V]:b},e))},onDoubleClick:()=>{S()},onChange:e=>{const{valueKey:t}=C;X(N.current.filter((l=>e.includes(l[t])))),T(e),P()}},H.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(E.Button,{className:"ant-input-search-button",disabled:i.disabled,icon:t().createElement(re.SearchOutlined,null),onClick:()=>{S()}})))),t().createElement(It,I,t().createElement(eo,_)))},"tree-helper":(e,l)=>{const{dataIndex:a,precision:r}=l,{type:n,extra:i={},rules:o=[],helper:u={},onChange:p,onEnter:m}=A,v=(0,Cn.C_)(e,a),E=u.fieldAliasMap;E||h("Table","helper 需要配置 `fieldAliasMap` 选项");const C="function"==typeof E?E():E||{};Object.keys(C).includes(a)||h("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值");const S=t=>{const{beforeOpen:a}=u,r=(a??z.XT)({[V]:v},e,l);null!=r&&r.then?r.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==r&&(q(!0),null==t||t())},w=()=>{Z(!1,(()=>J(x.current)))},T=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",l=arguments.length>1?arguments[1]:void 0;if((0,z.Kn)(l)&&Object.keys(l).length){for(const t in l){const a=l[t],r=b.find((e=>e.dataIndex===t));if(r){var n;(0,Cn.dN)(e,t,a,r.precision);const l=null===(n=r.editRender)||void 0===n?void 0:n.call(r,e,r);l&&Array.isArray(l.rules)&&y(l.rules,a,s,t)}else(0,Cn.dN)(e,t,a)}f.current.forceUpdate()}(0,Cn.dN)(e,a,t,r),y(o,t,s,c),O.addToUpdated(e),null==p||p({[V]:t},e),Y()},I={visible:F,title:d("qm.searchHelper.text"),width:u.width??"30%",loading:!1,bodyStyle:{paddingBottom:`${Sl[g]+20}px`},onClose:()=>{w()}},N={...u,defaultSelectedKeys:[v],size:g,onClose:e=>{e?(e=>{const t={};for(const l in C){const r=C[l];l!==a&&(t[l]=e[r])}const l=C[a]?e[C[a]]:"";T(l,t);const{closed:r}=u;Z(!1,(()=>J(x.current))),null==r||r(e)})(e):w()}};return t().createElement(t().Fragment,null,t().createElement(qi,{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||P()},onKeyUp:t=>{if(13===t.keyCode){const l=t.target.value??"";null==m||m({[V]:l},e)}},onDoubleClick:()=>{S()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?S():T(""))}}),t().createElement(It,I,t().createElement(go,N)))},"tree-helper-multiple":(e,l)=>{const{dataIndex:a}=l,{type:r,extra:n={},rules:i=[],helper:o={},onInput:u,onChange:p,onEnter:m}=A,f=(0,Cn.C_)(e,a),b=o.fieldAliasMap;b||h("Table","helper 需要配置 `fieldAliasMap` 选项");const v="function"==typeof b?b():b||{};Object.keys(v).includes("valueKey")&&Object.keys(v).includes("textKey")||h("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`");const C=t=>{const{beforeOpen:a}=o,r=(a??z.XT)({[V]:f},e,l);null!=r&&r.then?r.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==r&&(q(!0),null==t||t())},S=()=>{Z(!1,(()=>J(x.current)))},w=t=>{(0,Cn.dN)(e,a,t),y(i,t,s,c),O.addToUpdated(e),null==p||p({[V]:t},e,N.current),Y()},T={visible:F,title:d("qm.searchHelper.text"),width:o.width??"60%",loading:!1,bodyStyle:{paddingBottom:`${Sl[g]+20}px`},onClose:()=>{S()}},I={...o,size:g,multiple:!0,initialValue:(0,Nt.merge)({},o.initialValue),defaultSelectedKeys:f,onClose:e=>{e?(e=>{const{textKey:t,valueKey:l}=v;X(e);const a=N.current.map((e=>({text:e[t],value:e[l]})));$(a),w(a.map((e=>e.value)));const{closed:r}=o;Z(!1,(()=>J(x.current))),null==r||r(N.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(E.Select,{mode:"multiple",open:!1,value:f,placeholder:n.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:n.allowClear,maxTagCount:n.collapseTags?"responsive":void 0,disabled:n.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==m||m({[V]:f},e))},onDoubleClick:()=>{C()},onChange:e=>{const{valueKey:t}=v;X(N.current.filter((l=>e.includes(l[t])))),w(e),P()}},H.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(E.Button,{className:"ant-input-search-button",disabled:n.disabled,icon:t().createElement(re.SearchOutlined,null),onClick:()=>{C()}})))),t().createElement(It,T,t().createElement(go,I)))}};return t().createElement(t().Fragment,null,G?(()=>{const{type:e}=A,l=ee[e];if(!l)return h("Table","单元格编辑的类型 `type` 配置不正确"),null;const a=["cell--edit",{"is-error":!j}];return t().createElement("div",{ref:x,className:le()(a)},l(o,i),!j&&t().createElement("div",{className:"cell-error"},B||W))})():t().createElement(t().Fragment,null,p),I.current&&t().createElement("i",{className:"cell--sign"}))},Di=require("copy-to-clipboard");var Hi=__webpack_require__.n(Di);const $i=e=>{const{text:l,options:a,showMessage:r=!0,onCopy:n}=e;return function(e){if(!t().isValidElement(e))return null;for(var l=arguments.length,a=new Array(l>1?l-1:0),r=1;r<l;r++)a[r-1]=arguments[r];return t().cloneElement(e,...a)}(e.children,{onClick:i=>{const o=t().Children.only(e.children),s=Hi()(l,a);null==n||n(l,s),s&&r&&E.message.success(d("qm.clipboard.success")),o&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(i)}})};$i.displayName="CopyToClipboard";const Mi=$i;function Ki(){return Ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Ki.apply(this,arguments)}const Vi=t().forwardRef(((l,a)=>{const{tableData:r,flattenColumns:n}=l,{getRowKey:o,tableProps:s,tableRef:c,editableColumns:u,leftFixedColumns:p,rightFixedColumns:m,firstDataIndex:f,sorter:g,layout:b,showFooter:y,scrollX:v,scrollY:x,selectionKeys:E,rowExpandedKeys:C,highlightKey:S,isPingLeft:w,isPingRight:T,isTableEmpty:I,isTreeTable:N,isGroupSubtotal:_,isWebPagination:R,isDragMergeCell:P,setElementStore:O,createTableFullData:A,setSelectionKeys:k,setHighlightKey:F,getStickyLeft:q,getStickyRight:L,scrollXToColumn:D,scrollYToRecord:H,rowInViewport:$,dataChange:M,setPingLeft:K,setPingRight:V,setFullScreen:U,setOverlay:j,findParentRowKeys:B,getAllChildRowKeys:W,triggerScrollYEvent:G,scrollBottomDebouncer:Y}=t().useContext(cn),{height:Z,minHeight:X,maxHeight:Q,rowSelection:J,rowHighlight:ee,treeConfig:te,expandable:ne,stripe:ie,summation:oe,rowStyle:se,cellStyle:ce,spanMethod:de,ellipsis:ue,showHeader:pe,rowDraggable:me,onRowClick:he,onRowDblclick:fe,onRowContextmenu:ge,onRowEnter:be}=s,ve=t().useRef(null),xe=t().useRef(null),Te=t().useRef({prevST:0,prevSL:0}),{dragStart:Ie,renderDragPanel:Ne,closeDragPanel:_e}=Pi(),Re={dateFormat:e=>{const t=e?i()(e).format(hn):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?i()(e).format(fn):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?i()(e).format(fn.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>Number(100*e).toFixed(2)+"%",financeFormat:e=>(0,Cn.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")},Pe=t().useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:l,tableFullHeight:a,tableAutoHeight:r}=b,n={};return I&&Object.assign(n,{minHeight:"100px"}),X&&Object.assign(n,{minHeight:(0,Cn.EJ)(X)-e-l+"px"}),Q&&Object.assign(n,{maxHeight:(0,Cn.EJ)(Q)-e-l+"px"}),Z||a||r?{...n,maxHeight:"",minHeight:"",height:`${t}px`}:n}),[Z,Q,X,I,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:l}=b;return Math.floor((v?t-l:t)/e.rowHeight)}),[b,v]),[ke,Fe]=t().useState([]),qe=kn(),Le=function(t,l){const[a,r]=e.useState(!1);return e.useEffect((()=>{let e;const a=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==a?void 0:a.contains(n))||(null==a?void 0:a.contains(i)),c=a===n,d=null==l?void 0:l.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));r(!(o||s||c||u))})(t,e)};return a&&(Ce(document,"mousedown",n),Ce(document,"mouseup",i)),()=>{a&&(Se(document,"mousedown",n),Se(document,"mouseup",i))}}),[t]),a}(ve,[".table-editable__popper"]);t().useImperativeHandle(a,(()=>({renderCellTitle:Ge,setClickedValues:Me,forceUpdate:qe}))),ye((()=>{Le&&(Me([]),P&&_e())}),[Le]),ye((()=>{ke.length&&En.focus(c.current.uid)}),[ke]),t().useEffect((()=>{He(),$e()}),[]);const De=t().useCallback((e=>{var t,l;const{keyCode:a}=e;if(c.current.uid===(null===(t=En.getFocusInstance())||void 0===t?void 0:t.id)&&(27===a&&(Me([]),F(""),U(!1)),ke.length&&(((e,t)=>{if(Ee.Z||!e||!t)return!1;let l=e;for(;l;){if(l===t)return!0;l=l.parentNode}return!1})(document.activeElement,ve.current)||"INPUT"!==(null===(l=document.activeElement)||void 0===l?void 0:l.tagName)))){if(13===a&&(we(e),"radio"===(null==J?void 0:J.type)||ee)){const t=E[0]??S??null,l=r.find((e=>o(e,e.index)===t))??null;l&&(null==be||be(l,e))}if(38===a||40===a){var n,i;we(e);const{allTableData:t}=c.current,l=R?(0,Cn.tL)(r):t,s=l.length;let d=l.findIndex((e=>o(e,e.index)===ke[0]));const u=38===a?(--d+s)%s:++d%s,p=l[u],m=o(p,p.index);"radio"!==(null==J?void 0:J.type)||null!==(n=J.disabled)&&void 0!==n&&n.call(J,p)||k([m]),!ee||null!==(i=ee.disabled)&&void 0!==i&&i.call(ee,p)||F(m),$(u)||(38===a&&H(m,u),40===a&&H(m,Ae>u+1?0:u+1-Ae)),Me([m,ke[1]])}if(9===a){if(we(e),!u.length)return Me([]);const t=u.length;let l=u.findIndex((e=>e.dataIndex===ke[1]));const a=++l%t,r=u[a].dataIndex;Me([ke[0],r]),D(r)}}}),[ke,r,E,u,Ae]);t().useEffect((()=>{const e=tt()(document,"keydown",De);return()=>e.remove()}),[De]);const He=()=>{O("$tableBody",ve.current),O("$tableYspace",xe.current)},$e=()=>{j("overlay"===((e,t)=>{if(Ee.Z||!e||!t)return null;"float"===(t=(0,z._A)(t))&&(t="cssFloat");try{var l;const a=e.style[t];if(a)return a;const r=null===(l=document.defaultView)||void 0===l?void 0:l.getComputedStyle(e,"");return r?r[t]:""}catch(l){return e.style[t]}})(ve.current.parentNode,"overflowY"))},Me=e=>{(0,Nt.isEqual)(e,ke)||Fe(e)},Ke=(e,t,l)=>l?[...t,e]:t.filter((t=>t!==e)),Ve=(e,t,l)=>{var a;const{deriveRowKeys:r}=c.current,n=(0,Cn.CD)(r,e);let i=[];const o=W((null==n?void 0:n.children)||[]),s=(null===(a=(0,Cn.Qi)(r,e))||void 0===a?void 0:a.slice(0,-1).reverse())||[];return i=l?[...new Set([...t,e,...o])]:t.filter((t=>![e,...o].includes(t))),s.forEach((e=>{var t;const l=(0,Cn.CD)(r,e),a=(0,Cn.bY)(i,(null==l||null===(t=l.children)||void 0===t?void 0:t.map((e=>e.rowKey)))||[]);i=a?[...i,e]:i.filter((t=>t!==e))})),i},Ue=e=>Array.isArray(e.children)&&e.children.length>0,ze=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const a=[];return e.forEach((e=>{const r=e.index,i=o(e,e.index);if(a.push(je(e,r,i,l)),null!=ne&&ne.expandedRowRender){const{expandedRowClassName:l,rowExpandable:o=z.XT}=ne;C.includes(i)&&o(e)&&a.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:le()("cell",l)},ne.expandedRowRender(e,r)))))}if((null==te||!te.virtual)&&Ue(e)){const t="function"!=typeof(null==ne?void 0:ne.rowExpandable)||ne.rowExpandable(e);C.includes(i)&&t&&a.push(...ze(e.children,l+1))}})),a},je=function(e,l,a){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=["body--row",{"body--row-striped":ie&&l%2!=0,"body--row-selected":E.includes(a),"body--row-current":S===a,..._?Je(e._group):null}];return t().createElement("tr",{key:a,className:le()(i)},n.map(((t,n)=>Be(t,n,e,l,a,r))))},Be=(e,l,a,r,n,i)=>{const{isIE:s,isOverlay:d}=c.current,{dataIndex:u,fixed:h,align:f,className:y=""}=e,{rowSpan:v,colSpan:C}=Ze(a,e,r,l),{gutterWidth:S}=b;if(!v||!C)return null;const w=e.ellipsis??ue,T=!s&&"left"===h,I=!s&&"right"===h,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":I,"cell-fix-left-last":T&&p[p.length-1].dataIndex===u,"cell-fix-right-first":I&&m[0].dataIndex===u,[y]:!!y}],P=s?null:{left:T?`${q(u)}px`:"",right:I?`${L(u)+(d&&x?S:0)}px`:""},O=se?"function"==typeof se?se(a,r):se:null,A=ce?"function"==typeof ce?ce(a,e,r,l):ce:null,D=_?Qe(a._group):null,H=Ge(e,a,r,l);return t().createElement("td",{key:u,title:w?H:void 0,rowSpan:v>1?v:void 0,colSpan:C>1?C:void 0,"data-index":l,className:le()(R),style:{...P,...D,...O,...A},onClick:t=>((e,t,l)=>{var a,r;const{dataIndex:n}=l;if([Tn.expandableColumn,Tn.operationColumn].includes(n))return;const i=o(t,t.index);Me([i,n]);const s=null===(a=l.editRender)||void 0===a?void 0:a.call(l,t,l),c=s&&!s.disabled,{type:d,selectByClickRow:u=!0,disabled:p=z.ZT}=J||{};!d||p(t)||c||(u||n===Tn.selectionColumn)&&((e,t)=>{const{type:l,checkStrictly:a=!0,onSelect:r}=J||{};if("radio"===l&&k([e]),"checkbox"===l){const l=!E.includes(e),n=N&&!a?Ve(e,E,l):Ke(e,E,l);k(n),null==r||r(l,t,n)}})(i,t),[Tn.selectionColumn].includes(n)||(!ee||null!==(r=ee.disabled)&&void 0!==r&&r.call(ee,t)||c||F(i),null==he||he(t,l,e))})(t,a,e),onDoubleClick:t=>((e,t,l)=>{const{dataIndex:a}=l;[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn].includes(a)||null==fe||fe(t,l,e)})(t,a,e),onContextMenu:t=>((e,t,l)=>{const{dataIndex:a}=l;[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn].includes(a)||null==ge||ge(t,l,e)})(t,a,e)},t().createElement("div",{className:"cell"},We(e,a,r,l,H,n,i)),I&&d&&x&&m[m.length-1].dataIndex===u?t().createElement("i",{className:"gutter-overlay",style:{width:S,right:-1*(S+1)}}):null)},We=(e,l,a,r,n,i,o)=>{const{dataIndex:s,canCopy:c,editRender:u,render:p}=e,m=(0,Cn.C_)(l,s);if(s===Tn.expandableColumn)return t().createElement(Ai,{record:l,rowKey:i});if(s===Tn.selectionColumn)return t().createElement(Oi,{selectionKeys:E,column:e,record:l,rowKey:i});const h=Ye(m,e,l);if(u)return t().createElement(Li,{column:e,record:l,rowKey:i,columnKey:s,clicked:ke,text:h});const g=p?p(m,l,e,a,r):h;return N&&s===f?[Xe(null!=te&&te.virtual?l._level:o),t().createElement(Ai,{key:"expand",record:l,rowKey:i,style:Ue(l)?{}:{visibility:"hidden"}}),g]:c?t().createElement("div",{className:"cell--copy"},t().createElement("span",{className:"text"},g),n&&t().createElement(Mi,{text:n},t().createElement(re.CopyOutlined,{className:"icon",title:d("qm.table.config.copyText"),onClick:e=>e.stopPropagation()}))):g},Ge=(e,t,l,a)=>{const{dataIndex:r,render:n}=e;if([Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn].includes(r))return"";let i="";const o=(0,Cn.C_)(t,r);if("function"==typeof n){const r=n(o,t,e,l,a);i=(0,z.l$)(r)?(0,Cn.gn)(r).join(""):r}else i=Ye(o,e,t).toString();return i},Ye=(e,t,l)=>{var a;const{dictItems:r,precision:n,formatType:i,editRender:o}=t,s=r||(null==o||null===(a=o(l,t))||void 0===a?void 0:a.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=Re[`${(0,z._A)(i)}Format`];e?d=e(d):h("Table","字段的格式化类型 `formatType` 配置不正确")}return d},Ze=(e,t,l,a)=>{let n=1,i=1;if("function"==typeof de){const o=de({row:e,column:t,rowIndex:l,columnIndex:a,tableData:r});if(Array.isArray(o)?(n=o[0],i=o[1]):(0,z.Kn)(o)&&(n=o.rowSpan,i=o.colSpan),e===r[0]&&0===n){n=1;for(let e=1;e<r.length;e++){const{rowSpan:l}=Ze(r[e],t,r[e].index,a);if(l>0)break;n++}}}const{mergeCells:o}=c.current;if(o.length>0){const e=o.find((e=>e.row===l&&e.col===a));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*Tn.treeTable.textIndent+"px"}}):null,Qe=e=>{const{backgroundColor:t,color:l}=oe.groupItems.find((t=>t.dataIndex===e))??{};return{backgroundColor:t,color:l}},Je=e=>{const t=oe.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},et=ae("table"),lt=P?{onMouseDown:Ie}:null;return t().createElement("div",{className:`${et}--body-wrapper`,style:{...Pe},onScroll:e=>{const{elementStore:t,scrollYLoad:l}=c.current,{prevST:a,prevSL:r}=Te.current,n=x?b.gutterWidth:0,{scrollTop:i,scrollLeft:o}=e.target;if(o!==r){pe&&(t.$header.scrollLeft=o),y&&(t.$footer.scrollLeft=o);const e=o>0,l=Math.ceil(o)+b.tableWidth<b.tableBodyWidth+n;w!==e&&K(e),T!==l&&V(l)}if(l&&i!==a&&G(i),x&&i!==a){const l=t.$tableYspace.offsetHeight||t.$tableBody.offsetHeight;Math.ceil(i)+b.viewportHeight-n>=l&&Y(e)}Te.current.prevST=i,Te.current.prevSL=o}},t().createElement("div",{ref:xe,className:"body--y-space"}),t().createElement("div",{className:"body--x-space",style:{width:Oe?`${Oe}px`:""}}),t().createElement("table",Ki({ref:ve,className:`${et}--body`,tabIndex:-1,cellSpacing:"0",cellPadding:"0"},lt,{style:{width:Oe?`${Oe}px`:""}}),t().createElement("colgroup",null,n.map((e=>{const{dataIndex:l,width:a,renderWidth:r}=e;return t().createElement("col",{key:l,style:{width:`${a||r}px`,minWidth:`${a||r}px`}})}))),me?t().createElement(al.ReactSortable,{itemKey:e=>o(e,e.index),tag:"tbody",animation:200,list:r,setList:e=>{const t=e.map((e=>o(e,e.index))),l=r.map((e=>o(e,e.index)));if((0,Nt.isEqual)(t,l))return;const a=[];c.current.tableFullData.forEach((t=>{r.includes(t)?a.push(e.shift()):a.push(t)})),A(a),M()}},r.map((e=>je(e,e.index,o(e,e.index))))):t().createElement("tbody",null,ze(r))),P&&Ne())}));Vi.displayName="TableBody";const Ui=Vi,zi=e=>{const{summationRows:l,flattenColumns:a}=e,{getRowKey:r,tableProps:n,tableRef:i,sorter:o,layout:s,scrollY:c,leftFixedColumns:u,rightFixedColumns:p,setElementStore:m,getStickyLeft:h,getStickyRight:f}=t().useContext(cn),{footRender:g}=n,b=t().useRef(null);t().useEffect((()=>{y()}),[]);const y=()=>{m("$footer",b.current)},v=ae("table"),{tableBodyWidth:x}=s;return t().createElement("div",{ref:b,className:`${v}--footer-wrapper`},g?g(a,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,a.map((e=>{const{dataIndex:l,width:a,renderWidth:r}=e;return t().createElement("col",{key:l,style:{width:`${a||r}px`,minWidth:`${a||r}px`}})})),c&&t().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t().createElement("tfoot",null,(()=>{const{isIE:e}=i.current,r=["gutter",{"cell-fix-right":!!p.length}],n=e?null:{right:p.length?0:""};return l.map(((e,l)=>t().createElement("tr",{key:l,className:"footer--row"},a.map(((l,a)=>((e,l,a)=>{const{isIE:r}=i.current,{gutterWidth:n}=s,{dataIndex:m,fixed:g,align:b,summation:y}=e,v=["footer--column","col--ellipsis",{"col--center":"center"===b,"col--right":"right"===b,"column--sort":!!o[m],"cell-fix-left":!r&&"left"===g,"cell-fix-right":!r&&"right"===g,"cell-fix-left-last":!r&&"left"===g&&u[u.length-1].dataIndex===m,"cell-fix-right-first":!r&&"right"===g&&p[0].dataIndex===m}],x=r?null:{left:"left"===g?`${h(m)}px`:"",right:"right"===g?`${f(m)+(c?n:0)}px`:""},E=null!=y&&y.render?y.render(i.current.tableFullData):(0,Cn.C_)(l,`${m}_text`),C=0===a&&""===E?d("qm.table.config.summaryText"):E;return t().createElement("td",{key:m,title:C,className:le()(v),style:{...x}},t().createElement("div",{className:"cell"},C))})(l,e,a))),c&&t().createElement("td",{className:le()(r),style:{...n}}))))})())))};var ji;!function(e){e.small="small",e.middle="default",e.large="default"}(ji||(ji={}));const Bi=e=>{var l,a;const{current:n,pageSize:i,total:o,config:s,onChange:c}=e,{global:d}=t().useContext(r),{$size:u,setElementStore:p}=t().useContext(cn),m=t().useRef(null);t().useEffect((()=>{h()}),[]);const h=()=>{p("$pager",m.current)},f=(e,t)=>{c(e,t)},g=(null==s?void 0:s.showSizeChanger)||Tn.pagination.showSizeChanger,b=(null==s?void 0:s.showQuickJumper)||Tn.pagination.showQuickJumper,y=(null==s?void 0:s.pageSizeOptions)||(null==d||null===(l=d.table)||void 0===l||null===(a=l.pagination)||void 0===a?void 0:a.pageSizeOptions)||Tn.pagination.pageSizeOptions,v={[`${ae("table")}-pager`]:!0};return t().createElement("div",{ref:m,className:le()(v)},t().createElement(E.Pagination,{size:ji[u],showSizeChanger:g,showQuickJumper:b,pageSizeOptions:y,current:n,pageSize:i,total:o,onChange:f,onShowSizeChange:f}))},Wi=()=>{const{layout:e}=t().useContext(cn),l=t().useMemo((()=>{const{headerHeight:t,viewportHeight:l}=e;return{top:`${t}px`,height:`${l}px`}}),[e]),a=ae("table");return t().createElement("div",{className:`${a}--empty`,style:l},t().createElement(ze,null))};function Gi(){return Gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Gi.apply(this,arguments)}const Yi=t().forwardRef(((e,l)=>{const{rowKey:a,columns:n,loading:i,stripe:o,resizable:s,customClass:c,paginationConfig:d,tablePrint:u,exportExcel:p,showAlert:m,topSpaceAlign:f,showTableInfo:g,showFullScreen:b,showRefresh:y,showColumnDefine:v,showHeader:x}=e,{size:E}=t().useContext(r),C=t().useMemo((()=>e.size??E??""),[e.size,E]),S=t().useRef(null),w=t().useRef(null),T=t().useRef(null),I=t().useRef(null),N=kn(),_=t().useCallback(((e,t)=>{const l="function"==typeof a?a(e,t):e[a];return void 0===l?(h("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):l}),[a]),{tableRef:R,tableFullData:P,setElementStore:O,setOriginColumns:A,setTableFullData:k,setTableOriginData:F,setAllTableData:q,setDeriveRowKeys:L,setFieldAuth:D,setMergeCells:H,setScrollYStore:$,setScrollYLoad:M,setResizeState:K,setHandleState:V,setSummaries:U,setSelectionRows:j,setShouldToTop:B,setRowKeysMap:W,setOverlay:G,clearElementStore:Y,clearAllRowKeysMap:Z}=((e,l)=>{let{getRowKey:a,$size:r}=l;const n=t().useRef({uid:(0,Cn.wE)(),elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],allTableData:[],allRowKeys:[],deriveRowKeys:[],flattenRowKeys:[],fieldAuth:{},mergeCells:[],scrollYStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0,rowHeight:Tn.rowHeightMaps[r]},store:new wn,resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:!1,remove:!1},summaries:{},treeTable:!1,scrollYLoad:!1,shouldToTop:!0,selectionRows:[],rowKeysMap:new Map,isOverlay:!1,isIE:(0,z.w1)()}),i=function(e,t,l){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.map((e=>{const n=a(e,e.index),o=l?`${l}-${n}`:`${n}`,s={level:r,rowKey:n,rowKeyPath:o};return e.children&&(s.children=i(e.children,n,o,r+1)),t?Object.assign({},s,{parentRowKey:t}):s}))},o=e=>{const t=[];return e.forEach((e=>{var l;null!==(l=e.children)&&void 0!==l&&l.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,Cn.tL)(e);n.current.allTableData=t,n.current.allRowKeys=t.map((e=>a(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 l=1;l<e.colSpan;l++)for(let a=0;a<e.rowSpan;a++)t.push({row:e.row+a,col:e.col+l,rowSpan:0,colSpan:0});for(let l=1;l<e.rowSpan;l++)for(let a=0;a<e.colSpan;a++)t.push({row:e.row+l,col:e.col+a,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},setRowKeysMap:(e,t)=>{n.current.rowKeysMap.set(e,t)},setOverlay:e=>{n.current.isOverlay=e},clearElementStore:()=>{for(const e in n.current.elementStore)n.current.elementStore[e]=null},clearAllRowKeysMap:()=>{n.current.rowKeysMap.clear()}}})(0,{getRowKey:_,$size:C}),{tableData:X,setTableData:Q,filters:J,setFilters:ee,sorter:te,setSorter:re,superFilters:ne,setSuperFilters:ie,pagination:oe,setPagination:se,selectionKeys:ce,setSelectionKeys:de,rowExpandedKeys:ue,setRowExpandedKeys:pe,highlightKey:me,setHighlightKey:he,layout:fe,setLayout:ge,permission:be,setPermission:ve,spinning:xe,setSpinning:Ee,scrollX:Ce,setScrollX:Se,scrollY:we,setScrollY:Te,isPingLeft:Ie,setPingLeft:Ne,isPingRight:_e,setPingRight:Re,isFullScreen:Pe,setFullScreen:Oe}=(e=>{var l,a;const{paginationConfig:n,rowSelection:i,expandable:o,rowHighlight:s}=e,{global:c}=t().useContext(r),d={current:Tn.pagination.current,pageSize:(null==n?void 0:n.pageSize)??(null==c||null===(l=c.table)||void 0===l||null===(a=l.pagination)||void 0===a?void 0:a.pageSize)??Tn.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)??[],[m,h]=t().useState([]),[f,g]=t().useReducer(((e,t)=>(0,Nt.isEqual)(e,t)?e:t),{}),[b,y]=t().useReducer(((e,t)=>(0,Nt.isEqual)(e,t)?e:t),{}),[v,x]=t().useReducer(((e,t)=>(0,Nt.isEqual)(e,t)?e:t),[]),[E,C]=t().useState(d),[S,w]=t().useReducer(((e,t)=>(0,Nt.isEqual)(e,t)?e:t),u),[T,I]=t().useReducer(((e,t)=>(0,Nt.isEqual)(e,t)?e:t),p),[N,_]=t().useState((null==s?void 0:s.currentRowKey)??""),[R,P]=t().useState({gutterWidth:Nn(),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,F]=t().useState(!1),[q,L]=t().useState(!1),[D,H]=t().useState(!1),[$,M]=t().useState(!1),[K,V]=t().useState(!1),[U,z]=t().useState(!1);return{tableData:m,setTableData:h,filters:f,setFilters:g,sorter:b,setSorter:y,superFilters:v,setSuperFilters:x,pagination:E,setPagination:C,selectionKeys:S,setSelectionKeys:w,rowExpandedKeys:T,setRowExpandedKeys:I,highlightKey:N,setHighlightKey:_,layout:R,permission:O,setPermission:A,setLayout:P,spinning:k,setSpinning:F,scrollX:q,setScrollX:L,scrollY:D,setScrollY:H,isPingLeft:$,setPingLeft:M,isPingRight:K,setPingRight:V,isFullScreen:U,setFullScreen:z}})(e),{isFetch:Ae,isWebPagination:ke,isScrollPagination:Fe,showPagination:qe,shouldUpdateHeight:Le,tableColumns:De,flattenColumns:He,editableColumns:$e,summationColumns:Me,leftFixedColumns:Ke,rightFixedColumns:Ve,firstDataIndex:Ue,showSummary:ze,showFooter:je,isHeadGroup:We,bordered:Ge,isHeadSorter:Ye,isHeadFilter:Ze,isServiceSummation:Xe,isSelectCollection:Qe,isTableImport:Je,isTableClipboard:et,isSuperSearch:tt,isFastSearch:lt,isGroupSummary:at,isGroupSubtotal:rt,isDragMergeCell:nt,isTreeTable:it,isTableEmpty:ot,summationRows:st,fetchParams:ct}=Rn(e,{getRowKey:_,tableRef:R,tableFullData:P,tableData:X,sorter:te,filters:J,superFilters:ne,pagination:oe}),{createElementStore:dt,tableStyles:ut,getSpan:pt,getStickyLeft:mt,getStickyRight:ht,scrollXToColumn:ft,scrollYToRecord:gt,rowInViewport:bt,calcTableHeight:yt,resetTableScroll:vt,doLayout:xt}=An(e,{getRowKey:_,tableRef:R,$size:C,tableColumns:De,flattenColumns:He,leftFixedColumns:Ke,layout:fe,scrollY:we,tableData:X,showFooter:je,showPagination:qe,isWebPagination:ke,isFullScreen:Pe,setLayout:ge,setScrollX:Se,setScrollY:Te,setElementStore:O,setScrollYStore:$,setShouldToTop:B}),{initialTable:Et,createTableFullData:Ct,getTableData:St,createTableData:wt,createGroupData:Tt,createSelectionKeys:It,createSelectionRows:_t,createRowExpandedKeys:Rt,findParentRowKeys:Pt,getAllChildRowKeys:Ot,doFieldValidate:At,getTableLog:kt,dataChange:Ft,tableChange:qt,toLastPage:Lt,pagerChangeHandle:Dt,triggerScrollYEvent:Ht,scrollBottomDebouncer:$t,clearTableSorter:Mt,clearTableFilter:Kt,clearSuperFilters:Vt,clearRowSelection:Ut,clearRowHighlight:zt,clearTableLog:jt,destroy:Bt}=On(e,{getRowKey:_,tableRef:R,tableElementRef:w,tableBodyRef:T,$size:C,tableColumns:De,tableFullData:P,pagination:oe,layout:fe,filters:J,sorter:te,superFilters:ne,fetchParams:ct,selectionKeys:ce,rowExpandedKeys:ue,highlightKey:me,summationColumns:Me,shouldUpdateHeight:Le,isFetch:Ae,isTreeTable:it,isWebPagination:ke,isScrollPagination:Fe,isServiceSummation:Xe,isGroupSubtotal:rt,doLayout:xt,setTableData:Q,setTableFullData:k,setTableOriginData:F,setAllTableData:q,setDeriveRowKeys:L,setPagination:se,setSpinning:Ee,setSorter:re,setFilters:ee,setSuperFilters:ie,setSelectionKeys:de,setRowExpandedKeys:pe,setHighlightKey:he,setScrollYLoad:M,setScrollYStore:$,setFieldAuth:D,setResizeState:K,setSummaries:U,setPermission:ve,setRowKeysMap:W,resetTableScroll:vt,clearElementStore:Y,clearAllRowKeysMap:Z});((e,l)=>{const{columns:a,summation:r,rowSelection:n,expandable:i,rowHighlight:o,mergeCells:s=[]}=e,{tableRef:c,topElementRef:d,tableElementRef:u,tableBodyRef:p,resizableBarRef:m,scrollX:f,pagination:g,selectionKeys:b,rowExpandedKeys:y,highlightKey:v,summationRows:x,showSummary:E,isWebPagination:C,isScrollPagination:S,isTreeTable:w,toLastPage:T,setHandleState:I,scrollYToRecord:N,setSelectionKeys:_,setOriginColumns:R,setSelectionRows:P,setRowExpandedKeys:O,setHighlightKey:A,setResizeState:k,setMergeCells:F,setPingRight:q,calcTableHeight:L,createSelectionKeys:D,createSelectionRows:H,createRowExpandedKeys:$,createElementStore:M,triggerScrollYEvent:K,forceUpdate:V,initialTable:U,destroy:z}=l,{elementStore:j,handleState:B,scrollYLoad:W}=c.current,G=t().useRef(x);ye((()=>{if(!n)return;const{onChange:e}=n;"radio"===n.type&&p.current.setClickedValues(b.length?[b[0],""]:[]),P(H(b)),null==e||e(b,c.current.selectionRows),E&&V()}),[b]),ye((()=>{if(!i)return;const{allTableData:e,allRowKeys:t}=c.current,{onChange:l}=i;null==l||l(y,y.map((l=>e[t.findIndex((e=>e===l))])))}),[y]),ye((()=>{const{allTableData:e,allRowKeys:t}=c.current;var l;w&&O($()),o&&(p.current.setClickedValues(v?[v,""]:[]),null===(l=o.onChange)||void 0===l||l.call(o,v,e[t.findIndex((e=>e===v))]??null))}),[v]),ye((()=>{var e;(0,Nt.isEqual)(x,G.current)||(G.current=x,E&&r&&(null===(e=r.onChange)||void 0===e||e.call(r,x)))}),[x]),ye((()=>{const e=D(n.selectedRowKeys);(0,Nt.isEqual)(e,b)||(_(e),w&&O($()))}),[null==n?void 0:n.selectedRowKeys]),ye((()=>{const e=$(i.expandedRowKeys);(0,Nt.isEqual)(e,y)||O(e)}),[null==i?void 0:i.expandedRowKeys]),ye((()=>{const{currentRowKey:e}=o;e!==v&&A(e??"")}),[null==o?void 0:o.currentRowKey]),ye((()=>{const{insert:e,remove:t}=B;e&&(C&&T(),N("",1e5)),(e||t)&&I({insert:!1,remove:!1})}),[g.total]),ye((()=>{W&&K(j.$tableBody.parentNode.scrollTop)}),[W]),ye((()=>{q(f)}),[f]),ye((()=>{F(s),p.current.forceUpdate()}),[s]),ye((()=>{W&&(e.height||e.maxHeight||h("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||h("Table","必须设置组件参数 `ellipsis`")),S&&(e.height||e.maxHeight||h("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[W,S]);const Y=()=>{const{resizeState:e}=c.current,{winHeight:t}=e,l=window.innerHeight;l!==t&&(k(Object.assign({},e,{winHeight:l})),L())};t().useEffect((()=>(M({$toper:d.current,$table:u.current,$resizableBar:m.current}),R((0,Nt.cloneDeep)(a)),U(),F(s),window.addEventListener("resize",Y,!1),L(),()=>{z(),window.removeEventListener("resize",Y)})),[])})(e,{tableRef:R,topElementRef:S,tableElementRef:w,tableBodyRef:T,resizableBarRef:I,scrollX:Ce,pagination:oe,selectionKeys:ce,rowExpandedKeys:ue,highlightKey:me,showSummary:ze,summationRows:st,isWebPagination:ke,isScrollPagination:Fe,isTreeTable:it,toLastPage:Lt,setHandleState:V,scrollYToRecord:gt,setOriginColumns:A,setSelectionKeys:de,setSelectionRows:j,setRowExpandedKeys:pe,setHighlightKey:he,setResizeState:K,setMergeCells:H,setPingRight:Re,calcTableHeight:yt,createSelectionKeys:It,createSelectionRows:_t,createRowExpandedKeys:Rt,createElementStore:dt,triggerScrollYEvent:Ht,forceUpdate:N,initialTable:Et,destroy:Bt});const Wt=t().useMemo((()=>({getRowKey:_,tableProps:e,tableRef:R,tableBodyRef:T,$size:C,flattenColumns:He,editableColumns:$e,leftFixedColumns:Ke,rightFixedColumns:Ve,firstDataIndex:Ue,sorter:te,filters:J,superFilters:ne,layout:fe,bordered:Ge,showFooter:je,showSummary:ze,summationRows:st,scrollX:Ce,scrollY:we,pagination:oe,fetchParams:ct,selectionKeys:ce,rowExpandedKeys:ue,highlightKey:me,isFetch:Ae,isPingLeft:Ie,isPingRight:_e,isHeadSorter:Ye,isHeadFilter:Ze,isFullScreen:Pe,isTableEmpty:ot,isHeadGroup:We,isTreeTable:it,isGroupSubtotal:rt,isWebPagination:ke,isDragMergeCell:nt,dataChange:Ft,tableChange:qt,getTableData:St,setElementStore:O,createTableFullData:Ct,setSorter:re,setFilters:ee,setSuperFilters:ie,setSelectionKeys:de,setHighlightKey:he,setRowExpandedKeys:pe,setSelectionRows:j,getSpan:pt,getStickyLeft:mt,getStickyRight:ht,scrollXToColumn:ft,scrollYToRecord:gt,rowInViewport:bt,setPagination:se,setPingLeft:Ne,setPingRight:Re,setSpinning:Ee,setFullScreen:Oe,setShouldToTop:B,setOverlay:G,doFieldValidate:At,createTableData:wt,createGroupData:Tt,findParentRowKeys:Pt,getAllChildRowKeys:Ot,triggerScrollYEvent:Ht,scrollBottomDebouncer:$t,resetTableScroll:vt,clearTableSorter:Mt,clearTableFilter:Kt,clearSuperFilters:Vt,clearRowSelection:Ut,clearRowHighlight:zt})),[e,C,He,$e,Ke,Ve,Ue,te,J,ne,fe,Ge,je,ze,st,Ce,we,oe,ct,ce,ue,me,Ae,Ie,_e,Ye,Ze,Pe,ot,We,it,rt,ke,nt]);((e,l)=>{const{getRowKey:a,tableRef:r,flattenColumns:n,editableColumns:i,pagination:o,fetchParams:s,selectionKeys:c,rowExpandedKeys:d,highlightKey:u,isFetch:p,dataChange:m,getTableData:h,createTableData:f,calcTableHeight:g,scrollXToColumn:b,scrollYToRecord:y,doFieldValidate:v,setHandleState:x,setSelectionKeys:E,setRowExpandedKeys:C,setHighlightKey:S,setSelectionRows:w,forceUpdate:T,getTableLog:I,clearRowSelection:N,clearRowHighlight:_,clearTableSorter:R,clearTableFilter:P,clearSuperFilters:O,clearTableLog:A}=l,k=(e,t,l)=>{for(let r=0;r<e.length;r++){const n=e[r],i=a(n,n.index);Array.isArray(n.children)&&k(n.children,t,l),t.includes(i)&&(null==l||l(n,i),e.splice(r,1),r-=1)}};t().useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{g()},DO_REFRESH:async e=>{p&&(await h(),null==e||e())},GET_LOG:()=>I(),GET_FETCH_PARAMS:()=>{const e={};for(const t in s)Object.keys(o).includes(t)||(e[t]=s[t]);return e},CLEAR_TABLE_DATA:()=>{p||(N(),_(),R(),P(),O(),A(),f([]))},CLEAR_LOG:()=>{A()},FORCE_UPDATE:()=>{T()},SCROLL_TO_RECORD:e=>{y(e)},SCROLL_TO_COLUMN:e=>{b(e)},SET_SELECTION(e){E(e)},SET_HIGHLIGHT(e){S(e)},SET_EXPANDABLE(e){C(e)},SET_SELECTION_ROWS(e){w(e)},INSERT_RECORDS:e=>{const{store:t,tableFullData:l}=r.current,a=(Array.isArray(e)?e:[e]).filter((e=>(0,z.Kn)(e)));a.length&&(a.forEach((e=>{n.forEach((t=>{const{dataIndex:l}=t;[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn].includes(l)||(0,Cn.dN)(e,l,(0,Cn.C_)(e,l))})),t.addToInserted(e)})),f(l.concat(a)),x(Object.assign({},r.current.handleState,{insert:!0})),m())},REMOVE_RECORDS:e=>{const{store:t,tableFullData:l}=r.current,n=(Array.isArray(e)?e:[e]).map((e=>(0,z.Kn)(e)?a(e,e.index):e));if(!n.length)return;let o=!1;k(l,n,((e,l)=>{t.addToRemoved(e),i.forEach((a=>{const{dataIndex:r,editRender:n}=a,i=null==n?void 0:n(e,a);if(!i)return;const{rules:o=[],disabled:s}=i;!s&&o.length&&(t.removeFromRequired({x:l,y:r}),t.removeFromValidate({x:l,y:r}))})),c.includes(l)&&E(c.filter((e=>e!==l))),l===u&&_(),d.includes(l)&&C(d.filter((e=>e!==l))),o=!0})),o&&(f(l),x(Object.assign({},r.current.handleState,{remove:!0})),m())},VALIDATE_FIELDS:()=>{r.current.allTableData.forEach((e=>{i.forEach((t=>{const{dataIndex:l,editRender:r}=t,n=null==r?void 0:r(e,t);if(!n)return;const{rules:i=[],disabled:o}=n;!o&&i.length&&v(i,(0,Cn.C_)(e,l),a(e,e.index),l)}))}));const{required:e,validate:t}=I(),l=[...e,...t];return l.length&&(y(l[0].rowKey),T()),{required:e,validate:t}}})))})(l,{getRowKey:_,tableRef:R,flattenColumns:He,editableColumns:$e,pagination:oe,fetchParams:ct,selectionKeys:ce,rowExpandedKeys:ue,highlightKey:me,isFetch:Ae,dataChange:Ft,getTableData:St,createTableData:wt,calcTableHeight:yt,scrollXToColumn:ft,scrollYToRecord:gt,doFieldValidate:At,setHandleState:V,setSelectionKeys:de,setRowExpandedKeys:pe,setHighlightKey:he,setSelectionRows:j,forceUpdate:N,getTableLog:kt,clearRowSelection:Ut,clearRowHighlight:zt,clearTableSorter:Mt,clearTableFilter:Kt,clearSuperFilters:Vt,clearTableLog:jt}),t().useEffect((()=>{En.register(R.current.uid,l??{current:null})}),[]);const Gt=ae("table"),Yt={[`${Gt}--wrapper`]:!0,[`${Gt}--lg`]:"large"===C,[`${Gt}--sm`]:"small"===C,[`${Gt}--maximize`]:Pe,[c]:!!c},Zt={[Gt]:!0,"is--border":Ge,"is--striped":o,"is--fixed":Ke.length||Ve.length,"is--sortable":Ye,"is--filterable":Ze,"is--merge-cell":nt,"is--empty":ot,"show--head":x,"show--foot":je,"ping--left":Ie,"ping--right":_e,"scroll--x":Ce,"scroll--y":we};return t().createElement(cn.Provider,{value:Wt},t().createElement("div",{className:le()(Yt)},g&&t().createElement("div",{ref:S,className:`${Gt}-top`},t().createElement("div",{className:`${Gt}-top__space`},m&&t().createElement(Fn,{total:oe.total}),t().createElement("div",{className:`${Gt}-top__space-slot`,style:{justifyContent:vn[f]}},e.children)),t().createElement("div",{className:`${Gt}-top__actions`},b&&t().createElement(qn,{isFullScreen:Pe}),y&&Ae&&t().createElement(Ln,null),be.print&&u&&t().createElement(Dn,{tableColumns:De}),be.import&&Je&&t().createElement(ti,{tableColumns:De}),be.export&&p&&t().createElement(ri,{tableColumns:De}),et&&t().createElement(ii,{flattenColumns:He}),Qe&&t().createElement(si,{columns:De}),lt&&t().createElement(vi,null),at&&t().createElement(mi,null),tt&&t().createElement(gi,null),v&&t().createElement(xi,{columns:n}))),t().createElement(Be,{spinning:i??xe},t().createElement("div",{ref:w,className:le()(Zt),style:ut},t().createElement("div",{className:`${Gt}--main-wrapper`},x&&t().createElement(Ri,{tableColumns:De,flattenColumns:He,sorter:te,filters:J}),t().createElement(Ui,{ref:T,tableData:X,flattenColumns:He}),je&&t().createElement(zi,{summationRows:st,flattenColumns:He})),Ge&&t().createElement("div",{className:`${Gt}--border-line`}),ot&&t().createElement(Wi,null),s&&t().createElement("div",{ref:I,className:`${Gt}--resizable-bar`}))),qe&&t().createElement(Bi,Gi({},oe,{config:d,onChange:(e,t)=>Dt({current:e,pageSize:t})}))))}));Yi.defaultProps={columns:[],dataSource:[],rowKey:"id",border:!0,resizable:!0,showHeader:!0,ellipsis:!0,multipleSort:!0,topSpaceAlign:"right",showAlert:!0,showFullScreen:!0,showRefresh:!0,showClipboard:!0,showSelectCollection:!0,showSuperSearch:!0,showFastSearch:!0,showGroupSummary:!0,showColumnDefine:!0,showTableInfo:!0},Yi.displayName="Table";const Zi=Yi,Xi=Zi;function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Qi.apply(this,arguments)}const Ji=e=>{var l;const{uniqueKey:a,multiple:n,initialValue:i,selectionRows:o,defaultSelectedKeys:s=[],filters:c=[],table:u={},name:p,getServerConfig:m,createTableFetch:f,onClose:g}=e,{size:b}=t().useContext(r),y=t().useMemo((()=>e.size??b??""),[e.size,b]),v=t().useRef(null),x=t().useRef(null),E=t().useRef(null),C=Pn(v),S=e=>[{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t().createElement("span",null,e+1)},...e||u.columns||[]],[w,T]=t().useState(u),[I,N]=t().useState(),[_,R]=t().useState(s),[P,O]=t().useState(!1),[A,k]=t().useState(300),[F,q]=t().useState(c),[L,D]=t().useState(S()),[H,$]=t().useState((0,Nt.merge)({},null===(l=u.fetch)||void 0===l?void 0:l.params,i)),[M,K]=t().useState([]),V=()=>{const e=v.current.parentNode.children[0],t=e.querySelector(".form-wrap");k(e.offsetHeight-t.offsetHeight-2*Sl[y]-30)},U=(0,z.Ds)(V,5);ye((()=>{U()}),[C.width]),t().useEffect((()=>{B()}),[H]),t().useEffect((()=>{o&&E.current.SET_SELECTION_ROWS(o)}),[o]),t().useEffect((()=>{j()}),[]);const j=async()=>{if(p){if(!m||!f)return h("searchHelper","从服务端获取配置信息的时候,`getServerConfig` 和 `createTableFetch` 为必选参数");try{const e=await m({searchHelperId:p});if(200===e.code){const{filters:t=[],columns:l=[],rowKey:a,webPagination:r,fetchUrl:n,fetchParams:i={}}=e.data||{};q(t),D(S(l)),T({fetch:{api:f(n),dataKey:"records"},rowKey:a||w.rowKey,webPagination:r||w.webPagination||!1}),Y(i)}}catch(e){}}},B=async()=>{const{webPagination:e,fetch:t}=w;if(!e||null==t||!t.api)return;const{api:l,dataKey:a,beforeFetch:r=z.XT}=t;if(r(H)){O(!0);try{const e=await l(H);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,a)??[];R([]),await(0,z._v)(0),K(t)}}catch(e){}O(!1)}},W=e=>{n||(N(e),g(e))},Y=e=>{$(Object.assign({},H,e))},Z=ae("search-helper"),X=w.webPagination?{dataSource:M,loading:P,webPagination:!0}:{fetch:{...w.fetch,params:H}};return t().createElement("div",{ref:v,className:`${Z}--wrapper`},t().createElement("div",{className:"form-wrap"},t().createElement(Cr,{ref:x,items:F,initialValues:i,uniqueKey:a?`helper_${a}`:a,formType:"search",isAutoFocus:!1,fieldsChange:e=>q(e),onCollapse:()=>V(),onFinish:e=>Y(e),onReset:async()=>{const[e,t]=await x.current.GET_FORM_DATA();e||Y(t)}})),t().createElement("div",null,t().createElement(Xi,Qi({ref:E,height:A,columns:L,rowKey:w.rowKey||"pageIndex"},X,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectedRowKeys:_,onChange:(e,t)=>{R(e),N(n?t:t[0])}},columnsChange:e=>D(e),onRowDblclick:W,onRowEnter:W}))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Sl[y]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(G,{onClick:()=>g(null),style:{marginRight:8}},d("qm.dialog.close")),t().createElement(G,{type:"primary",disabled:!I,onClick:()=>g(I,n?_:void 0)},d("qm.dialog.confirm"))))};Ji.displayName="SearchHelper";const eo=Ji;function to(){return to=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},to.apply(this,arguments)}const lo=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...lo(e.children)),e.children&&t.push(e.value)})),t},ao=(e,t)=>{let l=null;for(let a=0;a<e.length;a++){if(Array.isArray(e[a].children)&&(l=ao(e[a].children,t)),l)return l;if(t(e[a]))return e[a]}return l},ro=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&ro(e.children,t),t(e)||e.children&&e.children.length))),no=e=>{var l;const{uniqueKey:a,multiple:n,initialValue:i,selectionRows:o,defaultSelectedKeys:s=[],filters:c=[],table:u={},tree:p={},name:m,getServerConfig:f,createTableFetch:g,onClose:b}=e,{size:y}=t().useContext(r),v=t().useMemo((()=>e.size??y??""),[e.size,y]),x=t().useRef(null),C=t().useRef(null),S=t().useRef(null),w=Pn(x),T=e=>[{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t().createElement("span",null,e+1)},...e||u.columns||[]],[I,N]=t().useState(u),[_,R]=t().useState(),[P,O]=t().useState(s),[A,k]=t().useState(!1),[F,q]=t().useState(300),[L,D]=t().useState(300),[H,$]=t().useState(c),[M,K]=t().useState(T()),[V,U]=t().useState((0,Nt.merge)({},null===(l=u.fetch)||void 0===l?void 0:l.params,i)),[j,B]=t().useState([]),W=()=>{const e=x.current.parentNode.children[0],t=e.querySelector(".form-wrap"),l=e.querySelector(".input-wrap");q(e.offsetHeight-l.offsetHeight-10),D(e.offsetHeight-t.offsetHeight-2*Sl[v]-30)},Y=(0,z.Ds)(W,5);ye((()=>{Y()}),[w.width]),t().useEffect((()=>{X()}),[V]),t().useEffect((()=>{o&&S.current.SET_SELECTION_ROWS(o)}),[o]),t().useEffect((()=>{Z(),ce()}),[]);const Z=async()=>{if(m){if(!f||!g)return h("searchHelper","从服务端获取配置信息的时候,`getServerConfig` 和 `createTableFetch` 为必选参数");try{const e=await f({searchHelperId:m});if(200===e.code){const{filters:t=[],columns:l=[],rowKey:a,webPagination:r,fetchUrl:n,fetchParams:i={}}=e.data||{};$(t),K(T(l)),N({fetch:{api:g(n),dataKey:"records"},rowKey:a||I.rowKey,webPagination:r||I.webPagination||!1}),J(i)}}catch(e){}}},X=async()=>{const{webPagination:e,fetch:t}=I;if(!e||null==t||!t.api)return;const{api:l,dataKey:a,beforeFetch:r=z.XT}=t;if(r(V)){k(!0);try{const e=await l(V);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,a)??[];O([]),await(0,z._v)(0),B(t)}}catch(e){}k(!1)}},Q=e=>{n||(R(e),b(e))},J=e=>{U(Object.assign({},V,e))},[ee,te]=t().useState([]),[le,re]=t().useState([]),[ne,ie]=t().useState(""),oe=t().useRef(ee),se=t().useRef([]),ce=async()=>{if(!p.fetch)return;const{api:e,params:t,dataKey:l,valueKey:a="value",textKey:r="text"}=p.fetch;try{const n=await e(t);if(200===n.code){const e=Array.isArray(n.data)?n.data:(0,Nt.get)(n.data,l)??[],t=Ut(e,a,r);te(t),oe.current=t,se.current=e}}catch(e){}};ye((()=>{re(lo(ee))}),[ee]);const de=ae("tree-table"),ue=I.webPagination?{dataSource:j,loading:A,webPagination:!0}:{fetch:{...I.fetch,params:V}};return t().createElement("div",{ref:x,className:`${de}--wrapper`},t().createElement(Fe,{defaultValue:200,style:{height:"100%"}},t().createElement(Fe.Pane,{min:100,style:{overflowY:"auto"}},t().createElement(E.Input.Search,{className:"input-wrap",value:ne,style:{marginBottom:8},placeholder:d("qm.form.inputPlaceholder"),onChange:e=>(e=>{const t=ro(oe.current,(t=>!e||-1!==t.text.indexOf(e)));ie(e),te(t)})(e.target.value)}),t().createElement(E.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:F,defaultExpandAll:!0,expandedKeys:le,treeData:ee,filterTreeNode:e=>!!ne&&-1!==e.text.indexOf(ne),onExpand:e=>{re(e)},onSelect:e=>{if(!p.fetch)return;const{valueKey:t="value"}=p.fetch;(e=>{if(!p.tableParamsMap)return h("QmTreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof p.tableParamsMap?p.tableParamsMap():p.tableParamsMap,l={};for(const a in t)l[a]=(0,Nt.get)(e,t[a]);J(l)})(ao(se.current,(l=>(0,Nt.get)(l,t)===e[0]))||{})}})),t().createElement(Fe.Pane,{className:"split-pane"},t().createElement("div",{className:"form-wrap"},t().createElement(Cr,{ref:C,items:H,initialValues:i,uniqueKey:a?`helper_${a}`:a,formType:"search",isAutoFocus:!1,fieldsChange:e=>$(e),onCollapse:()=>W(),onFinish:e=>J(e),onReset:async()=>{const[e,t]=await C.current.GET_FORM_DATA();e||J(t)}})),t().createElement("div",null,t().createElement(Xi,to({ref:S,height:L,columns:M,rowKey:I.rowKey||"pageIndex"},ue,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectedRowKeys:P,onChange:(e,t)=>{O(e),R(n?t:t[0])}},columnsChange:e=>K(e),onRowDblclick:Q,onRowEnter:Q}))))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Sl[v]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(G,{onClick:()=>b(null),style:{marginRight:8}},d("qm.dialog.close")),t().createElement(G,{type:"primary",disabled:!_,onClick:()=>b(_,n?P:void 0)},d("qm.dialog.confirm"))))};no.displayName="TreeTableHelper";const io=no,oo=(e,t,l)=>{let a;for(let r=0;r<e.length;r++){const n=e[r];if(n.children)if(n.children.some((e=>e[l]===t)))a=n[l];else{const e=oo(n.children,t,l);e&&(a=e)}}return a},so=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...so(e.children,t)),Array.isArray(e.children)&&e.children.length&&l.push(e[t])})),l},co=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...co(e.children,t)),t(e)&&l.push(e)})),l},uo=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&uo(e.children,t),t(e)||e.children&&e.children.length))),po=(e,t,l,a)=>e.map((e=>e[l]===t?{...e,children:a}:e.children?{...e,children:po(e.children,t,l,a)}:e)),mo=(e,t,l)=>{for(let a=0;a<e.length;a++){if(e[a][l]===t)return[t];if(Array.isArray(e[a].children)){const r=mo(e[a].children,t,l);if(r)return[e[a][l],r].flat()}}},ho=(e,t)=>{var l;const a=(null===(l=e.children)||void 0===l?void 0:l.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>a.push(...ho(e,t)))),a},fo=e=>{const{multiple:l,defaultSelectedKeys:a=[],tree:n={},onClose:i}=e,{size:o}=t().useContext(r),s=t().useMemo((()=>e.size??o??""),[e.size,o]),c=t().useRef(null),u=Pn(c),[p,m]=t().useState(),[h,f]=t().useState(300),[g,b]=t().useState(!1),y=(0,z.Ds)((()=>{const e=c.current.parentNode.children[0],t=e.querySelector(".input-wrap");f(e.offsetHeight-t.offsetHeight-10)}),5);ye((()=>{y()}),[u.width]);const[v,x]=t().useState([]),[C,S]=t().useState([]),[w,T]=t().useState([]),[I,N]=t().useState(""),[_,R]=t().useState(!1),P=t().useRef(v),O=t().useRef([]),A=t().useRef([]),k=(e,t)=>{x(e),P.current=e,O.current=t,A.current=so(e,"value")},F=e=>{var t;return(null===(t=mo(v,e,"value"))||void 0===t?void 0:t.slice(0,-1))||[]};ye((()=>{const{defaultExpandAll:e=!0,checkStrategy:t="SHOW_CHILD"}=n,a=[];C.forEach((e=>{if(l){if("SHOW_ALL"===t&&!A.current.includes(e)&&a.push(...F(e)),"SHOW_CHILD"===t&&a.push(...F(e)),"SHOW_PARENT"===t){const t=zt(v,e);if(t){const l=F(e),r=ho(t,"value");a.push(...l,...[e,...r].filter((e=>A.current.includes(e))))}}}else a.push(...F(e))})),T(e?A.current:[...new Set(a)])}),[_]),t().useEffect((()=>{(async()=>{if(!n.fetch)return;const{api:e,params:t,dataKey:r,valueKey:i="value",textKey:o="text"}=n.fetch;try{b(!0);const n=await e(t);if(200===n.code){const e=Array.isArray(n.data)?n.data:(0,Nt.get)(n.data,r)??[],t=Ut(e,i,o);k(t,e),S((e=>{if(l)return a;const t=co(e,(e=>a.includes(e.text)));return 1===t.length?[t[0].value]:[]})(t)),R(!0)}}catch(e){}b(!1)})()}),[]);const q=ae("tree-helper");return t().createElement("div",{ref:c,className:`${q}--wrapper`},t().createElement(E.Input.Search,{value:I,className:"input-wrap",style:{marginBottom:8},placeholder:d("qm.form.inputPlaceholder"),onChange:e=>(e=>{const{defaultExpandAll:t=!0}=n,l=uo(P.current,(t=>{if(!e)return!0;const l=t.text||"";return-1!==`${l}|${Ia.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.indexOf(e)}));N(e),x(l),t||T(e?A.current:[])})(e.target.value)}),t().createElement(Be,{spinning:g},t().createElement(E.Tree,{fieldNames:{title:"text",key:"value",children:"children"},multiple:l,checkable:l,selectable:!l,height:h,checkStrictly:!!n.checkStrictly,selectedKeys:C,checkedKeys:C,expandedKeys:w,treeData:v,loadData:n.asyncLoad?async e=>{let{key:t,children:l}=e;if(!n.fetch||l)return;const{api:a,params:r,dataKey:i,valueKey:o="value",textKey:s="text"}=n.fetch;try{const e=await a({...r,[o]:t});if(200===e.code){const l=Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,i)??[],a=po(v,t,"value",Ut(l,o,s));k(a,po(O.current,t,o,l))}}catch(e){}}:void 0,filterTreeNode:e=>!!I&&-1!==e.text.indexOf(I),onExpand:e=>{T(e)},onSelect:e=>{const{valueKey:t="value"}=n.fetch||{};S(e);const a=co(O.current,(l=>e.includes((0,Nt.get)(l,t))));m(l?a:a[0])},onCheck:e=>{const{valueKey:t="value"}=n.fetch||{},{checkStrictly:a,checkStrategy:r="SHOW_CHILD"}=n;a&&(e=e.checked),S(e),"SHOW_CHILD"===r&&(e=e.filter((e=>!A.current.includes(e)))),"SHOW_PARENT"===r&&(e=e.filter(((e,t,l)=>!l.includes(oo(v,e,"value")))));const i=co(O.current,(l=>e.includes((0,Nt.get)(l,t))));m(l?i:i[0])}})),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Sl[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(G,{onClick:()=>i(null),style:{marginRight:8}},d("qm.dialog.close")),t().createElement(G,{type:"primary",disabled:!p,onClick:()=>i(p)},d("qm.dialog.confirm"))))};fo.displayName="TreeHelper";const go=fo,bo={previewWidth:1100,defaultDistance:.45,logoHeight:60},yo=(0,e.createContext)(void 0);var vo=null;function xo(){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),l=e.match(/MSIE\D?\d+/i),a=e.match(/OPR\D?\d+/i),r=e.match(/Firefox\D?\d+/i),n=e.match(/x64/i);if(!t&&!l&&n)return!0;if(r){if((r=r[0].match(/\d+/))[0]>=41||n)return!0}else if(a){if((a=a[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!l){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 Eo(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];var a,r="打印控件未安装!点击这里<a href='/static/cLodop/install_lodop32.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。",n="打印控件需要升级!点击这里<a href='/static/cLodop/install_lodop32.exe' target='_self'>执行升级</a>,升级后请重新进入。",i="打印控件未安装!点击这里<a href='/static/cLodop/install_lodop64.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。",o="打印控件需要升级!点击这里<a href='/static/cLodop/install_lodop64.exe' target='_self'>执行升级</a>,升级后请重新进入。",s="(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)",c="(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)",d="Web打印服务CLodop未安装启动,点击这里<a href='/static/cLodop/CLodop_Setup_for_Win32NT.exe' target='_self'>下载执行安装</a>,",u='成功后请 <a href="javascript:;" onclick="javascript:window.history.go(0)">刷新本页面</a> 。',p="Web打印服务CLodop需升级!点击这里<a href='/static/cLodop/CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>,升级后请刷新页面。";try{var m=navigator.userAgent,h=!!m.match(/MSIE/i)||!!m.match(/Trident/i);if(xo()){try{a=getCLodop()}catch(e){}if(!a&&"complete"!==document.readyState)return void E.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!a)return void E.notification.warning({message:"CLodop 信息",duration:null,description:d+""+u});CLODOP.CVERSION<"3.0.8.3"&&E.notification.warning({message:"CLodop 信息",description:p}),t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{var f=h&&!!m.match(/x64/i);if(e||t?a=h?e:t:vo?a=vo:((a=document.createElement("object")).setAttribute("width",0),a.setAttribute("height",0),a.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),h?a.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):a.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(a),vo=a),!a||!a.VERSION)return m.indexOf("Chrome")>=0&&E.notification.warning({message:"CLodop 信息",duration:null,description:c}),m.indexOf("Firefox")>=0&&E.notification.warning({message:"CLodop 信息",duration:null,description:s}),E.notification.warning({message:"CLodop 信息",duration:null,description:f?i:r}),a}return a.VERSION<"6.2.2.6"&&(xo()||E.notification.warning({message:"CLodop 信息",description:f?o:n})),(null==l?void 0:l.length)>=2&&l.every((e=>Array.isArray(e)))&&(a.SET_LICENSES(...l[0]),a.SET_LICENSES(...l[1])),a}catch(e){E.message.error("getLodop 出错:"+e)}}xo();const Co=e=>{const t=e/25.4*(()=>{const e=[],{deviceXDPI:t,deviceYDPI:l}=window.screen;if(t&&l)e[0]=t,e[1]=l;else{var a;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===(a=t.parentNode)||void 0===a||a.removeChild(t),t=null}return e})()[0];return Math.ceil(t)},So=t().forwardRef(((e,l)=>{const{templateRender:a,directPrint:n}=e,{global:i}=t().useContext(r),{$$preview:o}=t().useContext(yo),{state:s,isWindowsPrinter:c,pageSize:d}=o,u=t().useRef(null),p=t().useRef({}),m=t().useRef([]),f=t().useRef([]),g=t().useRef([]),[b,y]=t().useState(!0);t().useImperativeHandle(l,(()=>({createPreviewDom:O,createExportHtml:k,createPrintHtml:A,SHOW_PREVIEW:F,DIRECT_PRINT:q}))),ye((()=>{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*bo.defaultDistance+10*bo.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*bo.defaultDistance+10*bo.defaultDistance:0;return("vertical"===e?d[1]:d[0])-t}),[s,c,d]),E=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return Co(v-10*(e.left-bo.defaultDistance)-10*(e.right-bo.defaultDistance))}),[s,v]),C=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return Co(x-10*(e.top-bo.defaultDistance)-10*(e.bottom-bo.defaultDistance))}),[s,x]),S=s.form.scale,w=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return{left:Co(10*e.left),right:Co(10*e.right),top:Co(10*e.top),bottom:Co(10*e.bottom)}}),[s]),T=t().useMemo((()=>{const{form:{printerType:e}}=s,{left:t,right:l,top:a,bottom:r}=w,n=E+t+l,i=bo.previewWidth-n<=0?0:(bo.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>bo.previewWidth?0:i>0?o:(bo.previewWidth-(n-2*o))/2),{width:`${E}px`,height:"stylus"===e?"auto":C+"px",paddingLeft:`${t}px`,paddingRight:`${l}px`,paddingTop:`${a}px`,paddingBottom:`${r}px`,transform:`translateX(${c}px) scale(${S})`,opacity:b?0:1}}),[s,b,w,S,C,E]),I=(m.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e))),()=>{var e,t;const l=(null==i||null===(e=i.print)||void 0===e?void 0:e.leftLogo)??"",a=(null==i||null===(t=i.print)||void 0===t?void 0:t.rightLogo)??"";return[`<tr style="height: ${bo.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',l?`<img src="${l}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',a?`<img src="${a}" border="0" height="46" />`:"","</td>","</tr>"].join("")}),N=()=>{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,l;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=N().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(l=p.current.templateEl).children[0]?l.insertBefore(t,l.children[0]):l.appendChild(t),e=null},R=()=>{const e=p.current.templateEl.children,t=[],l=[];for(let a=0;a<e.length;a++){if("template-cols"===e[a].getAttribute("type"))continue;const r=e[a].clientHeight;e[a].style.height=r+"px",l.push(r),t.push(e[a].outerHTML)}f.current=l,m.current=t},P=()=>{if(!m.current.length)return;const{form:{setting:e,printerType:t}}=s;if(n)return g.current.push([N(),I(),...m.current]);const l=e.fixedLogo?C-bo.logoHeight:C;let a=[];if(g.current=[],"stylus"===t)g.current.push([N(),...e.fixedLogo?[I()]:[],...m.current]);else{let t=0;for(let r=0,n=f.current.length;r<n;r++){const i=m.current[r],o=f.current[r];e.fixedLogo||0!==r||(t+=bo.logoHeight),t+=o,t<=l?a.push(i):(g.current.push([N(),...e.fixedLogo?[I()]:[],...a]),a=[],t=0,r-=1),r===n-1&&a.length&&g.current.push([N(),...e.fixedLogo?[I()]:[],...a])}}var r;e.fixedLogo||null===(r=g.current[0])||void 0===r||r.splice(1,0,I());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 l=`<table cellspacing="0" cellpadding="0" border="0" class="${p.current.templateEl.className}">`;l+=(null===(e=g.current[t-1])||void 0===e?void 0:e.join(""))??"",l+="</table>",p.current.previewEl.innerHTML=l,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<m.current.length;t++)e[t]=m.current[t].replace(/[\r\n]/g,"").replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+I()+N()+e.join("")+"</table>"},F=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,z._v)(0),R(),P(),y(!1))},q=async()=>{var e;if("TABLE"!==(null===(e=p.current.templateEl)||void 0===e?void 0:e.tagName))return L();_(),await(0,z._v)(0),R(),P(),y(!1),o.doPrint(A()),await(0,z._v)(0),o.doClose()},L=()=>{h("QmPrint","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},D={[ae("print-container")]:!0,"no-visible":n};return t().createElement("div",{ref:u,className:le()(D)},t().createElement(Be,{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==a?void 0:a()),t().createElement("div",{className:"workspace",style:T}))))}));So.displayName="Container";const wo=So;function To(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Io extends e.Component{constructor(){super(...arguments),To(this,"formRef",t().createRef()),To(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:bo.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:bo.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:bo.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:bo.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:d("qm.print.setPanel.noEmpty")}]}])),To(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})})),To(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")}))),To(this,"state",{formList:this.createFormList()}),To(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())})),To(this,"cancelHandle",(()=>{this.props.onClose()}))}render(){const{formList:e}=this.state;return t().createElement(t().Fragment,null,t().createElement(Cr,{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(G,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},d("qm.dialog.close")),t().createElement(G,{type:"primary",onClick:()=>this.confirmHandle()},d("qm.dialog.confirm"))))}}To(Io,"contextType",r);const No=Io;function _o(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Ro extends e.Component{constructor(){var e,l,a;super(...arguments),_o(this,"provide",{$$preview:this}),_o(this,"containRef",t().createRef()),_o(this,"state",{visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(l=this.props.defaultConfig)||void 0===l?void 0:l.copies)||1,scale:1,setting:{distance:{left:bo.defaultDistance,right:bo.defaultDistance,top:bo.defaultDistance,bottom:bo.defaultDistance},pageSize:"210*297",direction:(null===(a=this.props.defaultConfig)||void 0===a?void 0:a.direction)||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0}),_o(this,"pageChangeHandle",(e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))})),_o(this,"exportClickHandle",(()=>{this.doExport(this.containRef.current.createExportHtml())})),_o(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 di().setItem(this.printerKey,e),await this.savePrintConfig(this.printerKey,e)}catch(e){}})),_o(this,"doClose",(()=>{var e,t;null===(e=(t=this.props).onClose)||void 0===e||e.call(t)})),_o(this,"getPrintConfig",(async e=>{const t=this.context.global,l=null==t?void 0:t.getComponentConfigApi;if(l)try{const t=await l({key:e});if(200===t.code)return t.data}catch(e){}})),_o(this,"savePrintConfig",(async(e,t)=>{const l=this.context.global,a=null==l?void 0:l.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}})),_o(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 ')),_o(this,"doPrint",(e=>{const t=Eo();if(!t)return;const{uniqueKey:l,closeOnPrinted:a}=this.props,{form:{setting:r,printerName:n,printerType:i,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:c}=bo,{left:u,right:p,top:m,bottom:h}=r.distance;t.PRINT_INIT(l??Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(n),t.SET_PRINT_COPIES(o),r.doubleSide&&("auto"===r.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"===r.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===r.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===i&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*h*2,""),t.ADD_PRINT_TABLE(10*(m-c)+"mm",10*(u-c)+"mm",`RightMargin: ${10*(p-c)}mm`,`BottomMargin: ${"stylus"!==i?10*(h-c):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?a&&this.doClose():E.message.error(d("qm.print.printError"))},t.PRINT()})),_o(this,"doExport",(e=>{const t=Eo();if(!t)return;const{uniqueKey:l,closeOnPrinted:a}=this.props,{form:{setting:r}}=this.state;t.PRINT_INIT(l??Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?a&&this.doClose():E.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"===r.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=Eo(),t=[{text:d("qm.print.defaultPrinter"),value:-1}];try{const l=e.GET_PRINTER_COUNT();for(let a=0;a<l;a++)t.push({text:e.GET_PRINTER_NAME(a),value:a})}catch(e){h("qm-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 di().getItem(this.printerKey);var e;t||(t=await this.getPrintConfig(this.printerKey),(0,z.Kn)(t)&&await di().setItem(this.printerKey,t)),(0,z.Kn)(t)&&Object.keys(t).length&&(0,Nt.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:l}=this.props,{visible:a,form:r,currentPage:n,totalPage:i,printPage:o}=this.state,s=ae("print-preview"),c={visible:a,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:le()(u)},t().createElement("div",{className:"outer"},t().createElement("div",{className:"header"},t().createElement("span",null,d("qm.print.printer"),":",t().createElement(E.Select,{value:r.printerName,onChange:e=>{this.setState((t=>(0,Nt.merge)({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",null,d("qm.print.type"),":",t().createElement(E.Select,{value:r.printerType,onChange:e=>{this.setState((t=>(0,Nt.merge)({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",null,d("qm.print.copies"),":",t().createElement(E.InputNumber,{value:r.copies,min:1,precision:0,onChange:e=>{this.setState((t=>(0,Nt.merge)({},t,{form:{copies:e??1}})))},style:{width:"50px"}})),t().createElement("span",null,d("qm.print.printPage.0"),t().createElement(E.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(E.Pagination,{size:"small",current:n,pageSize:1,total:i,onChange:this.pageChangeHandle})),t().createElement("span",null,t().createElement(G,{type:"text",icon:t().createElement(re.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},d("qm.print.setting"))),t().createElement("span",null,t().createElement(G,{type:"text",icon:t().createElement(re.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},d("qm.print.export"))),t().createElement("span",null,t().createElement(G,{icon:t().createElement(re.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},d("qm.print.print")))),t().createElement("div",{className:"main"},t().createElement(yo.Provider,{value:this.provide},t().createElement(wo,{ref:this.containRef,templateRender:l,directPrint:!1}))),t().createElement("div",{className:"footer"},t().createElement("span",null,d("qm.print.scale"),":",t().createElement(E.Slider,{value:r.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>(0,Nt.merge)({},t,{form:{scale:e}})))}}),t().createElement("em",{className:"scale-text"},`${Math.floor(100*r.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(It,c,t().createElement(No,{setting:r.setting,onChange:e=>{this.setState((t=>(0,Nt.merge)({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):t().createElement(yo.Provider,{value:this.provide},t().createElement(wo,{ref:this.containRef,templateRender:l,directPrint:!0}))}}_o(Ro,"contextType",r);const Po=Ro;function Oo(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Ao extends e.Component{constructor(){super(...arguments),Oo(this,"previewRef",t().createRef()),Oo(this,"state",{visible:!1,loading:!1}),Oo(this,"clickHandle",(async()=>{this.setState({loading:!0});try{var e,t;const l=await(null===(e=(t=this.props).click)||void 0===e?void 0:e.call(t));if(this.setState({loading:!1}),"boolean"==typeof l&&!l)return;await this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),Oo(this,"createRender",(()=>{const{visible:e}=this.state,{templateRender:l,uniqueKey:a,defaultConfig:r,preview:n,closeOnPrinted:i}=this.props,o={visible:e,title:d("qm.print.preview"),width:`${bo.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},s={ref:this.previewRef,templateRender:l,uniqueKey:a,defaultConfig:r,preview:n,closeOnPrinted:i,onClose:()=>{this.setState({visible:!1})}};return n?t().createElement(It,o,t().createElement(Po,s)):e?t().createElement(Po,s):null})),Oo(this,"DO_PRINT",(async()=>{const{preview:e}=this.props;await(0,z._v)(0),this.setState({visible:!0}),await(0,z._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:l,icon:a,type:r,disabled:n,shape:i}=this.props,o={size:l||this.context.size||"",type:r,shape:i,icon:a,loading:e,disabled:n,click:this.clickHandle};return t().createElement(t().Fragment,null,this.props.children&&t().createElement(G,o,this.props.children),this.createRender())}}Oo(Ao,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmAnchor","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},templateRender:a().elementType}),Oo(Ao,"defaultProps",{preview:!0,type:"primary",icon:t().createElement(re.PrinterOutlined,null)}),Oo(Ao,"contextType",r);const ko=Ao,Fo=JSON.parse('{"i8":"1.2.0-beta.21"}').i8})(),__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,l)=>{l.d(t,{Z:()=>a});const a="undefined"==typeof window},542:(e,t,l)=>{l.d(t,{Ds:()=>n.debounce,HD:()=>n.isString,Kn:()=>n.isPlainObject,M2:()=>c,P2:()=>n.throttle,PM:()=>b,RI:()=>p,U2:()=>n.get,XT:()=>u,Y3:()=>h,Y6:()=>y,ZT:()=>d,_A:()=>f,_v:()=>m,hj:()=>n.isNumber,l$:()=>s,mf:()=>n.isFunction,o8:()=>n.isUndefined,w1:()=>o,xb:()=>g});var a=l(787),r=l.n(a),n=l(517),i=l(386);const o=()=>!i.Z&&/MSIE|Trident/.test(navigator.userAgent),s=e=>r().isValidElement(e),c=e=>s(e)&&e.type===r().Fragment,d=()=>{},u=()=>!0,p=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m=async e=>new Promise((t=>setTimeout(t,e))),h=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),b=e=>(0,n.isNumber)(e)?`${e}px`:e.toString(),y=e=>{try{const t=JSON.parse(window.parent.localStorage.getItem("auths")||"{}");return(0,n.get)(t,e)}catch(e){}}},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,l)=>{l.d(t,{Z:()=>r});const a=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"],r={operations:function(e){const t=e.split(" "),l=[];let r=0;l[r]=[];for(let e=0;e<t.length;e++)a.includes(t[e])?(l[r]=l[r].join(" "),r++,l[r]=[]):l[r].push(t[e]);return l[r]=l[r].join(" "),l},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 l=0,a=(e=Array.isArray(e)?e:[e]).length;l<a;l++)t+="number"==typeof e[l]?e[l]:"'"+e[l]+"'",l<a-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,l){return e.split(t).join(l)},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,l)=>{l.d(t,{D:()=>s});const a=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,r=["string","number","boolean","symbol"],n=e=>r.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(a,"\\$1"),"i"),s=(e,t,l)=>{e=e??"";let a=!0;switch(t){case"like":a=null!==e.toString().match(o(l));break;case"likes":a=l.split(/,|,/).some((t=>null!==e.toString().match(o(t))));break;case"in":n(l)&&(l=[l]),Array.isArray(l)&&(a=Array.isArray(e)?l.every((t=>e.includes(t))):l.includes(e));break;case"nin":n(l)&&(l=[l]),Array.isArray(l)&&(a=!(Array.isArray(e)?l.some((t=>e.includes(t))):l.includes(e)));break;case"!=":case"<>":a=(i(e)?e.slice(0,10):e)!=l;break;case"<":a=(i(e)?e.slice(0,10):e)<l;break;case"<=":a=(i(e)?e.slice(0,10):e)<=l;break;case">":a=(i(e)?e.slice(0,10):e)>l;break;case">=":a=(i(e)?e.slice(0,10):e)>=l;break;default:a=(i(e)?e.slice(0,10):e)==l}return a}},704:(e,t,l)=>{l.d(t,{Z:()=>r});const a=["==","<",">","<=",">=","!=","like","likes","in","nin"],r={isBracketBalance:function(e){let t=0;const l=e.length;for(let a=0;a<l;a++){const l=e.charAt(a);"("===l&&t++,")"===l&&t--}return 0===t},replace_variables:function(e,t){let l="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?l+=" "+e[t]+" ":l+=e[t];const r=l.split(" ").filter((e=>""!==e));for(let e=0;e<r.length;e++)a.includes(r[e])&&("this"!=r[e-1]?r[e-1]=t+"."+r[e-1]:r[e-1]=t),a.includes(r[e])&&(r.splice(e-1,3,`__query__(${r[e-1]}, '${r[e]}', ${r[e+1]})`),e-=2);return r.join(" ")}}},353:(e,t,l)=>{l.d(t,{CD:()=>g,C_:()=>S,EJ:()=>x,HG:()=>s,J1:()=>c,MY:()=>f,Nl:()=>q,Ps:()=>p,Qi:()=>F,RI:()=>i.RI,SX:()=>P,TQ:()=>A,W2:()=>O,_3:()=>I,bY:()=>C,dN:()=>w,e5:()=>E,gU:()=>h,gn:()=>R,p6:()=>N,t2:()=>m,tL:()=>b,tj:()=>v,uf:()=>T,v9:()=>k,vo:()=>y,wE:()=>_,y1:()=>u});var a=l(517),r=l(635),n=l.n(r),i=l(542),o=l(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 l=null;for(let a=0;a<e.length;a++){if(e[a].children&&(l=p(e[a].children,t)),l)return l;if(e[a].dataIndex===t)return e[a]}return l},m=e=>{const t=e.children;return t?t[0].children?m(t[0]):t[0]:e},h=e=>{const t=e.children;return t?t[t.length-1].children?h(t[t.length-1]):t[t.length-1]:e},f=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),g=(e,t)=>{let l=null;for(let a=0;a<e.length;a++){if(e[a].children&&(l=g(e[a].children,t)),l)return l;if(e[a].rowKey===t)return e[a]}return l},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 l=(e,a)=>{if(a&&(e.level=a.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((a=>{e.fixed?a.fixed=e.fixed:delete a.fixed,l(a,e),t+=a.colSpan})),e.colSpan=t}else e.colSpan=e.colSpan??1};e.forEach((e=>{e.level=1,l(e,null)}));const a=[];for(let e=0;e<t;e++)a.push([]);return d(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,a[e.level-1].push(e)})),a},v=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){const a=e.parentNode;if(l.top+=e.offsetTop,l.left+=e.offsetLeft,a&&a!==document.documentElement&&a!==document.body&&(l.top-=a.scrollTop,l.left-=a.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return v(e.offsetParent,t,l)}return l},x=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,E=(e,t)=>(0,a.transform)(e,((e,l,r)=>{(0,a.isEqual)(l,t[r])||(e[r]=(0,i.Kn)(l)&&(0,i.Kn)(t[r])?E(l,t[r]):l)})),C=(e,t)=>(0,a.intersection)(e,t).length===t.length,S=(e,t)=>(0,a.get)(e,t)??"",w=(e,t,l,r)=>{l=l??"",r>=0&&""!==l&&(l=Number(l).toFixed(r)),(0,a.set)(e,t,l)},T=e=>{const t=(e=e.toString()).split("."),l="-"===t[0].charAt(0)?"-":"";let a=l?t[0].slice(1):t[0],r="";for(;a.length>3;)r=`,${a.slice(-3)}${r}`,a=a.slice(0,a.length-3);return a&&(r=a+r),`${l}${r}${t[1]?`.${t[1]}`:""}`},I=(e,t)=>e?n()(e,t):null,N=(e,t)=>e?n()(e).format(t):"",_=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},R=e=>{const t=[];if((0,i.l$)(e)){const{children:l}=e.props;Array.isArray(l)?l.forEach((e=>t.push(...R(e)))):l&&t.push(...R(l))}else t.push(e);return t},P=e=>e.filter((e=>!e._group)),O=e=>{const t=[];return Object.keys(e).forEach((l=>{null!==e[l]&&t.push(`${l}|${e[l]}`)})),t.join(",")},A=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l="";if(Array.isArray(e)){let a=0;for(let r=0,n=e.length;r<n;r++){const n=e[r];if(!n.fieldName)continue;const i=Array.isArray(n.condition)?(0,o.A_)(n.condition):(0,o.Pz)(n.condition,"^");l+=`${n.bracketLeft} ${t?`${n.fieldName}|${n.fieldType}`:n.fieldName} ${n.expression} ${i} ${n.bracketRight} ${n.logic} `,a=n.logic.length}l=l.slice(0,-1*a-2)}else{const a=5;for(const a in e){const[r,n]=a.includes("|")?a.split("|"):[a,""],i=e[a];for(const e in i){const a=Array.isArray(i[e])?(0,o.A_)(i[e]):(0,o.Pz)(i[e],"^");"''"!==a&&"[]"!==a&&(l+=`${t?`${r}|${n}`:r} ${e} ${a} and `)}}l=l.slice(0,-1*a)}return l.replace(/\s+/g," ").trim()},k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const l=e=>{const l=[];return t.forEach((t=>l.push(S(e,t)))),l},a={};return e.forEach((e=>{const t=JSON.stringify(l(e));a[t]=a[t]||[],a[t].push(e)})),Object.keys(a).map((e=>a[e]))},F=(e,t)=>{for(let l=0;l<e.length;l++){if(e[l].rowKey===t)return[t];if(Array.isArray(e[l].children)){const a=F(e[l].children,t);if(a)return[e[l].rowKey,a].flat()}}},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 l=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](l,l.exports,__webpack_require__),l.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 l in t)__webpack_require__.o(t,l)&&!__webpack_require__.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__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:()=>E.Affix,Alert:()=>E.Alert,Anchor:()=>E.Anchor,AutoComplete:()=>E.AutoComplete,Avatar:()=>E.Avatar,BackTop:()=>E.BackTop,Badge:()=>E.Badge,Breadcrumb:()=>E.Breadcrumb,Button:()=>E.Button,Calendar:()=>I,Card:()=>E.Card,Carousel:()=>E.Carousel,Cascader:()=>E.Cascader,Checkbox:()=>E.Checkbox,Col:()=>E.Col,Collapse:()=>E.Collapse,Comment:()=>E.Comment,ConfigProvider:()=>E.ConfigProvider,DatePicker:()=>R,Descriptions:()=>E.Descriptions,Divider:()=>E.Divider,Drawer:()=>E.Drawer,Dropdown:()=>E.Dropdown,Empty:()=>E.Empty,Form:()=>E.Form,Grid:()=>E.Grid,Image:()=>E.Image,Input:()=>E.Input,InputNumber:()=>E.InputNumber,Layout:()=>E.Layout,List:()=>E.List,Mentions:()=>E.Mentions,Menu:()=>E.Menu,Modal:()=>E.Modal,PageHeader:()=>E.PageHeader,Pagination:()=>E.Pagination,Popconfirm:()=>E.Popconfirm,Popover:()=>E.Popover,Progress:()=>E.Progress,QmAnchor:()=>dt,QmButton:()=>G,QmCollapse:()=>ge,QmConfigProvider:()=>K,QmCopyToClipboard:()=>Mi,QmCountup:()=>Me,QmCropper:()=>Zr,QmDivider:()=>oe,QmDownload:()=>Je,QmDrawer:()=>xt,QmEmpty:()=>ze,QmForm:()=>Cr,QmModal:()=>It,QmPrint:()=>ko,QmSearchHelper:()=>eo,QmSpace:()=>ee,QmSpin:()=>Be,QmSplit:()=>Fe,QmTable:()=>Xi,QmTabs:()=>gt,QmTinymce:()=>jr,QmTreeHelper:()=>go,QmTreeTableHelper:()=>io,QmUploadFile:()=>en,QmUploadImg:()=>sn,Radio:()=>E.Radio,Rate:()=>E.Rate,Result:()=>E.Result,Row:()=>E.Row,Select:()=>E.Select,Skeleton:()=>E.Skeleton,Slider:()=>E.Slider,Space:()=>E.Space,Spin:()=>E.Spin,Statistic:()=>E.Statistic,Steps:()=>E.Steps,Switch:()=>E.Switch,Tabs:()=>E.Tabs,Tag:()=>E.Tag,TimePicker:()=>k,Timeline:()=>E.Timeline,Tooltip:()=>E.Tooltip,Transfer:()=>E.Transfer,Tree:()=>E.Tree,TreeSelect:()=>E.TreeSelect,Typography:()=>E.Typography,Upload:()=>E.Upload,message:()=>E.message,notification:()=>E.notification,pinyin:()=>Ia,version:()=>Fo});var e=__webpack_require__(787),t=__webpack_require__.n(e);const l=require("prop-types");var a=__webpack_require__.n(l);const r=(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:"确 定"},form:{search:"搜 索",reset:"重 置",save:"保 存",spread:"展开",collect:"收起",trueText:"是",falseText:"否",draggable:"拖动排序",requiredTips:"不能为空",inputPlaceholder:"请输入...",selectPlaceholder:"请选择...",treePlaceholder:"树节点过滤",rangeInputNumberPlaceholder:["开始值","结束值"],datePlaceholder:"选择日期",timePlaceholder:"选择时间",weekPlaceholder:"选择周",monthPlaceholder:"选择月",yearPlaceholder:"选择年",daterangePlaceholder:["开始日期","结束日期"],timerangePlaceholder:["开始时间","结束时间"],monthrangePlaceholder:["开始月份","结束月份"],yearrangePlaceholder:["开始年份","结束年份"],datePickers:["今天","昨天","一周前","一个月前"],dateRangePickers:["最近一周","最近一个月","最近三个月","最近六个月"],citySelectType:["按省份","按城市"],regionSelectLabel:["省","市","区","街道"]},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:"序号"},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:"导 入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式"},clipboard:{text:"粘 贴",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},mergeCell:{cancel:"恢复",confirm:"合并"},print:{text:"打印"},refresh:{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,l)=>t[l])):e}const d=function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];const[a,r]=t;let n;const i=a.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,r);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 m(e,t){throw new p(`[${e}] ${t}`)}function h(e,t){console.warn(new p(`[${e}] ${t}`))}const f=e=>"number"==typeof e||void 0===e||["px","rem","em","vw","vh","%"].some((t=>e.endsWith(t)))||e.startsWith("calc"),g=e=>["","small","middle","large"].includes(e),b=require("dayjs/plugin/weekday");var y=__webpack_require__.n(b);const v=require("dayjs/plugin/localeData");var x=__webpack_require__.n(v);i().extend(y()),i().extend(x());const E=require("antd"),C=require("rc-picker/es/generate/dayjs");var S=__webpack_require__.n(C);const w=require("antd/es/calendar/generateCalendar");var T=__webpack_require__.n(w);require("antd/es/calendar/style");const I=T()(S()),N=require("antd/es/date-picker/generatePicker");var _=__webpack_require__.n(N);require("antd/es/date-picker/style/index");const R=_()(S());function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},P.apply(this,arguments)}const O=e.forwardRef(((t,l)=>e.createElement(R,P({},t,{picker:"time",mode:void 0,ref:l}))));O.displayName="TimePicker";const A=e.forwardRef(((t,l)=>e.createElement(R.RangePicker,P({},t,{picker:"time",mode:void 0,ref:l}))));A.displayName="RangePicker",O.RangePicker=A;const k=O,F={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"},form:{search:"Search",reset:"Reset",save:"Save",spread:"Expand",collect:"Collapse",trueText:"Yes",falseText:"No",draggable:"Drag and sort",requiredTips:" is required",inputPlaceholder:"Please enter...",selectPlaceholder:"Please select...",treePlaceholder:"Tree node filter",rangeInputNumberPlaceholder:["Start value","End value"],datePlaceholder:"Select date",timePlaceholder:"Select time",weekPlaceholder:"Select week",monthPlaceholder:"Select month",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"]},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"},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",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",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style"},clipboard:{text:"Paste",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"},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"}}}},q=require("antd/lib/locale/zh_CN");var L=__webpack_require__.n(q);const D=require("antd/lib/locale/en_GB");function H(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const $={[F.name]:{qm:F,antd:__webpack_require__.n(D)()},[o.name]:{qm:o,antd:L()}};class M extends e.Component{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},u($[e.locale].qm)}static getDerivedStateFromProps(e,t){const{locale:l,size:a}=t.value,{locale:r,size:n}=e;return r!==l&&u($[r].qm),r!==l||n!==a?{value:Object.assign({},t.value,{locale:r,size:n})}:null}render(){const{global:e}=this.props,{value:l}=this.state;return t().createElement(r.Provider,{value:l},t().createElement(E.ConfigProvider,{locale:$[l.locale].antd,componentSize:l.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}H(M,"propTypes",{locale:a().string,size:(e,t,l)=>{if(!g(e[t]||""))return m("QmDivider","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},theme:a().string,global:a().object}),H(M,"defaultProps",{locale:"zh-cn",size:"middle",global:{}});const K=M,V=require("omit.js");var U=__webpack_require__.n(V),z=__webpack_require__(542);function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},j.apply(this,arguments)}function B(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class W extends e.Component{constructor(){super(...arguments),B(this,"state",{isLoading:!1}),B(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){h("QmButton","`click`方法执行出错")}this.setState({isLoading:!1})}))}render(){const{size:e,loading:l,authCode:a,click:r,confirm:n}=this.props,{isLoading:i}=this.state,o=e||this.context.size||"",s=(0,z.mf)(r)?{onClick:this.clickHandle}:null,c={...U()(this.props,["authCode","click","confirm"]),size:o,loading:i||l||!1,...s};if(a){const e=(0,z.Y6)(a);if(e){const{visible:t=1,disabled:l}=e;if(!t)return null;l&&(c.disabled=!0)}}return n?t().createElement(E.Popconfirm,{title:n.title||d("qm.button.confirmTitle"),disabled:c.disabled,onConfirm:e=>{var t,l;null===(t=n.onConfirm)||void 0===t||t.call(n),null===(l=c.onClick)||void 0===l||l.call(c,e)},onCancel:e=>{var t;null===(t=n.onCancel)||void 0===t||t.call(n,e)}},t().createElement(E.Button,j({},c,{onClick:z.ZT}),this.props.children)):t().createElement(E.Button,c,this.props.children)}}B(W,"propTypes",{click:a().func,confirm:a().shape({title:a().string,onConfirm:a().func,onCancel:a().func})}),B(W,"contextType",r);const G=W;var Y,Z,X,Q;!function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(Y||(Y={}));class J extends e.Component{render(){const{size:e}=this.props,l=e||this.context.size||"",a=(0,z.hj)(e)?e:Y[e||l||"default"],r={...this.props,size:a};return t().createElement(E.Space,r,this.props.children)}}Q=r,(X="contextType")in(Z=J)?Object.defineProperty(Z,X,{value:Q,enumerable:!0,configurable:!0,writable:!0}):Z[X]=Q;const ee=J,te=require("classnames");var le=__webpack_require__.n(te);const ae=e=>`qm-${e}`,re=require("@ant-design/icons");function ne(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class ie extends e.Component{constructor(){super(...arguments),ne(this,"clickHandle",(()=>{const{collapse:e,onCollapseChange:t=z.ZT}=this.props;t(!e)}))}render(){const{size:e,label:l,extra:a,collapse:r,disabled:n,className:i,style:o,id:s}=this.props,c=e||this.context.size||"",u=ae("divider"),p={[u]:!0,[`${u}--lg`]:"large"===c,[`${u}--sm`]:"small"===c};return t().createElement("div",{id:s,className:le()(p,i),style:o},t().createElement("span",{className:le()(`${u}__title`)},l),t().createElement("div",{className:le()(`${u}__extra`)},a),!(0,z.o8)(r)&&t().createElement(E.Button,{type:"link",className:le()(`${u}__collapse`),disabled:n,onClick:this.clickHandle},d(r?"qm.divider.collect":"qm.divider.spread"),r?t().createElement(re.UpOutlined,null):t().createElement(re.DownOutlined,null)))}}ne(ie,"propTypes",{label:a().string,size:(e,t,l)=>{if(!g(e[t]||""))return m("QmDivider","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},extra:a().oneOfType([a().element,a().string]),collapse:a().bool}),ne(ie,"contextType",r);const oe=ie,se=()=>({height:0,opacity:0}),ce=(e,t)=>"height"===t.propertyName,de={motionName:"rc-collapse-motion",onEnterStart:se,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:se,onEnterEnd:ce,onLeaveEnd:ce,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"},ue=require("rc-motion");var pe=__webpack_require__.n(ue);const me=t().forwardRef(((e,l)=>{const{forceRender:a,className:r,style:n,boxStyle:i,isActive:o}=e,[s,c]=t().useState(o||a);if(t().useEffect((()=>{(a||o)&&c(!0)}),[a,o]),!s)return null;const d=ae("collapse");return t().createElement("div",{ref:l,className:le()(`${d}-content`,{[`${d}-content-active`]:o,[`${d}-content-inactive`]:!o},r),style:n},t().createElement("div",{className:`${d}-content-box`,style:i},e.children))}));me.displayName="PanelContent";const he=me;function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},fe.apply(this,arguments)}const ge=e=>{const{defaultActive:l,label:a,className:r,style:n,containerStyle:i,disabled:o,forceRender:s,destroyOnClose:c=!1}=e,[d,u]=t().useState(!!l),p=ae("collapse"),m=le()({[`${p}`]:!0,[`${p}-active`]:d,[`${p}-disabled`]:o},r);return t().createElement("div",{className:m,style:n},t().createElement(oe,{label:a,collapse:d,disabled:o,onCollapseChange:e=>{u(e)}}),t().createElement(pe(),fe({visible:d},de,{leavedClassName:`${p}-content-hidden`,forceRender:s,removeOnLeave:c}),((l,a)=>{let{className:r,style:n}=l;return t().createElement(he,{ref:a,prefixCls:p,className:r,style:n,boxStyle:i,isActive:d,forceRender:s},e.children)})))},be=t().createContext(void 0);function ye(t,l){const a=e.useRef(!1);e.useEffect((()=>{a.current?t():a.current=!0}),l)}const ve=require("react-draggable");var xe=__webpack_require__.n(ve),Ee=__webpack_require__(386);const Ce=(e,t,l)=>{e&&t&&l&&e.addEventListener(t,l,!1)},Se=(e,t,l)=>{e&&t&&l&&e.removeEventListener(t,l,!1)},we=e=>e.preventDefault(),Te=(e,t,l)=>{!Ee.Z&&e&&t&&((0,z.Kn)(t)?Object.keys(t).forEach((l=>{Te(e,l,t[l])})):(t=(0,z._A)(t),e.style[t]=l))},Ie=e=>{let t=0,l=e;for(;l;)t+=l.offsetTop,l=l.offsetParent;return t},Ne=(e,t)=>{let l=e;for(;l;){var a;if(null!==(a=l.classList)&&void 0!==a&&a.contains(t))return l;l=l.parentNode}return null},_e=e=>{const{minValues:l,onDragChange:a,onDragging:r}=e,{splitRef:n,direction:i}=t().useContext(be),[o,s]=t().useState(),[c,u]=t().useState(0),p="vertical"===i?"y":"x",m={[`${ae("split")}__resize-bar`]:!0,vertical:"vertical"===i,horizontal:"horizontal"===i};return t().createElement(xe(),{bounds:o,axis:p,position:{x:0,y:0},positionOffset:{[p]:-1*c},onStart:()=>{a(!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[l[0],("vertical"===i?t:e)-l[1]]})(),a=e.offsetWidth,r=e.offsetHeight;s({left:t[0]-a,right:t[1]-a,top:t[0]-r,bottom:t[1]-r})})()},onDrag:(e,t)=>{u(t[p]),r(t[p])},onStop:()=>a(!1)},t().createElement("div",{className:le()(m),title:d("qm.split.resize")}))};_e.displayName="ResizeBar";const Re=_e,Pe=t().forwardRef(((e,l)=>{const{offset:a,className:r,style:n}=e,{direction:i,dragging:o}=t().useContext(be),s="vertical"===i?"height":"width",c={[ae("split-pane")]:!0,isLocked:o,horizontal:"horizontal"===i,vertical:"vertical"===i,[r]:!!r},d=void 0!==a?{[s]:(0,z.PM)(a)}:{flex:1,[s]:0};return t().createElement("div",{ref:l,className:le()(c),style:{...d,...n}},e.children)}));Pe.displayName="QmSplitPane";const Oe=Pe;function Ae(){return Ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Ae.apply(this,arguments)}const ke=e=>{const{direction:l="horizontal",defaultValue:a="50%",uniqueKey:n,className:i,style:o,onDragStart:s,onDrag:c=z.ZT,onDragEnd:d}=e,{global:u}=t().useContext(r),p=t().useRef(null),m=t().useRef(null),h=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 l=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return l>=0?l:0},b=t().useMemo((()=>n?`split_${n}`:""),[n]),[y,v]=t().useState(!1),[x,E]=t().useState(h(a)),C=t().useRef(0);ye((()=>{y?(C.current="vertical"===l?m.current.offsetHeight:m.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(h(e)):w(b).then((e=>{localStorage.setItem(b,h(e||a)),S()})).catch((()=>{}))},w=async e=>{const t=null==u?void 0:u.getComponentConfigApi;if(t)try{const l=await t({key:e});if(200===l.code)return l.data}catch(e){}},T=async(e,t)=>{const l=null==u?void 0:u.saveComponentConfigApi;if(l)try{await l({[e]:t})}catch(e){}},I=t().useMemo((()=>({splitRef:p,direction:l,dragging:y})),[l,y]),N=[];t().Children.map(e.children,(e=>{var t;(0,z.l$)(e)&&!(0,z.M2)(e)&&"QmSplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&N.push(e)}));const[_,R]=N,P=t().useMemo((()=>[g(_),g(R)]),[_,R]),O={[ae("split")]:!0,vertical:"vertical"===l};return t().createElement(be.Provider,{value:I},t().createElement("div",{ref:p,className:le()(O,i),style:o},t().createElement(Oe,Ae({},_.props,{ref:m,offset:x})),t().createElement(Re,{minValues:P,onDragChange:e=>v(e),onDragging:e=>{const t=C.current+e;E(`${t}px`),c(t)}}),t().createElement(Oe,R.props)))};ke.Pane=Oe,ke.displayName="QmSplit";const Fe=ke,qe=require("react-countup");var Le=__webpack_require__.n(qe);function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},De.apply(this,arguments)}function He(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class $e extends e.Component{render(){const{size:e,className:l,style:a}=this.props,r=e||this.context.size||"",n=ae("countup"),i={[n]:!0,[`${n}--lg`]:"large"===r,[`${n}--sm`]:"small"===r};return t().createElement(Le(),De({},this.props,{className:le()(i,l),style:a}),this.props.children)}}He($e,"defaultProps",{duration:2}),He($e,"contextType",r);const Me=$e;function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Ke.apply(this,arguments)}function Ve(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Ue extends e.Component{render(){const{size:e,className:l}=this.props,a=e||this.context.size||"",r=ae("empty"),n={...this.props,image:E.Empty.PRESENTED_IMAGE_SIMPLE},i={[r]:!0,[`${r}--lg`]:"large"===a,[`${r}--sm`]:"small"===a};return t().createElement(E.Empty,Ke({},n,{className:le()(i,l)}))}}Ve(Ue,"contextType",r),Ve(Ue,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmAnchor","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")}});const ze=Ue;class je extends e.Component{render(){const e={...this.props,style:{...this.props.style,maxHeight:"none"}};return t().createElement(E.Spin,e,this.props.children)}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(je,"defaultProps",{tip:"Loading..."});const Be=je,We=require("axios");var Ge=__webpack_require__.n(We);const Ye=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const l=window.URL.createObjectURL(e);let a=document.createElement("a");a.href=l,a.download=decodeURI(t),a.click(),a=null}};function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Ze.apply(this,arguments)}function Xe(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Qe extends e.Component{constructor(){super(...arguments),Xe(this,"state",{loading:!1}),Xe(this,"downloadHandle",(async()=>{this.setState({loading:!0});try{var e,t;const{action:l,beforeDownload:a=(()=>!0)}=this.props,r=(0,z.HD)(l)?l:await this.getActionUrl();if(!r)return h("QmDownload","参数 `action` 有误!");if(!a(r))return;await this.downloadFile(r),await(0,z._v)(100),null===(e=(t=this.props).onSuccess)||void 0===e||e.call(t),E.message.success(d("qm.download.success"))}catch(e){var l,a;null===(l=(a=this.props).onError)||void 0===l||l.call(a,e),E.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:l,params:a,withCredentials:r}=this.props,n=await Ge()({url:e,params:a,headers:l,withCredentials:r,responseType:"blob"}),i=n.data,o=n.headers["content-disposition"],s=t||(o?o.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Ye(i,s)}render(){const{size:e}=this.props,{loading:l}=this.state,a=e||this.context.size||"",r=U()(this.props,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return t().createElement(E.Button,Ze({},r,{size:a,loading:l,onClick:this.downloadHandle}),this.props.children)}}Xe(Qe,"propTypes",{action:a().oneOfType([a().string,a().shape({api:a().func.isRequired,params:a().object})]),size:(e,t,l)=>{if(!g(e[t]||""))return m("QmAnchor","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},fileName:a().string,headers:a().object,withCredentials:a().bool,params:a().object,beforeDownload:a().func,onSuccess:a().func,onError:a().func}),Xe(Qe,"defaultProps",{icon:t().createElement(re.DownloadOutlined,null),children:d("qm.download.text"),withCredentials:!1}),Xe(Qe,"contextType",r);const Je=Qe,et=require("add-dom-event-listener");var tt=__webpack_require__.n(et);const lt=require("scroll-into-view-if-needed");var at=__webpack_require__.n(lt);class rt extends e.Component{renderLabel(e){const{activeKey:l,labels:a,onTabClick:r}=this.props;return a.map(((a,n)=>{const i={[`${e}__item`]:!0,actived:n===l};return t().createElement("div",{key:n,className:le()(i),onClick:e=>r(n,e)},t().createElement("span",null,a))}))}render(){const e=ae("anchor-nav"),l={[e]:!0};return t().createElement("div",{className:le()(l)},this.renderLabel(e))}}const nt=rt;class it extends e.Component{render(){const{label:e,showDivider:l,className:a,style:r}=this.props,n={[ae("anchor-item")]:!0};return t().createElement("div",{className:le()(n,a),style:r},l&&t().createElement(oe,{label:e,style:{marginBottom:"10px"}}),this.props.children)}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(it,"displayName","QmAnchorItem");const ot=it;function st(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class ct extends e.Component{constructor(){super(...arguments),st(this,"currentState","ready"),st(this,"itemsTotal",void 0),st(this,"timer",void 0),st(this,"scrollEvent",void 0),st(this,"scrollRef",(0,e.createRef)()),st(this,"state",{activeKey:0}),st(this,"onScrollHandle",(e=>{if("ready"!==this.currentState)return;const t=this.findCurrentIndex(e.target.scrollTop);-1!==t&&this.setState({activeKey:t})})),st(this,"onTabClickHandle",(e=>{const{labelList:t=[]}=this.props,l=this.__is_conf?document.getElementById(t[e].id):this.scrollRef.current.children[e];l&&(this.setState({activeKey:e}),this.currentState="stop",this.timer&&clearTimeout(this.timer),at()(l,{block:"start",behavior:"smooth",boundary:this.scrollRef.current}),this.timer=setTimeout((()=>this.currentState="ready"),500))})),st(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=tt()(this.scrollRef.current,"scroll",(0,z.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(Ie(e)-Ie(t)))(e,this.scrollRef.current)))}findCurrentIndex(e){const t=Math.abs(e),l=this.createDistances();let a=-1;for(let e=0;e<l.length;e++){const r=l[e],n=l[e+1]||1e4;t>=r-1&&t<n&&(a=e)}return a}render(){const{activeKey:e}=this.state,{size:l,labelWidth:a,labelList:r=[],className:n,style:i}=this.props,o=l||this.context.size||"",s=ae("anchor"),c={[s]:!0,[`${s}--lg`]:"large"===o,[`${s}--sm`]:"small"===o},d=[];t().Children.map(this.props.children,(e=>{var t;(0,z.l$)(e)&&!(0,z.M2)(e)&&"QmAnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&d.push(e)}));const u=this.__is_conf?r.map((e=>e.label)):d.map((e=>e.props.label));return this.itemsTotal=u.length,t().createElement("div",{className:le()(c,n),style:i},t().createElement("div",{className:le()(`${s}__label`),style:{width:(0,z.PM)(a)}},t().createElement(nt,{activeKey:e,labels:u,onTabClick:this.onTabClickHandle})),t().createElement("div",{ref:this.scrollRef,className:le()(`${s}__container`)},this.__is_conf?this.props.children:d))}}st(ct,"Item",ot),st(ct,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmAnchor","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},labelWidth:(e,t,l)=>{if(!f(e[t]))return m("QmAnchor","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},labelList:a().arrayOf(a().shape({id:a().string,label:a().string}))}),st(ct,"defaultProps",{labelWidth:80}),st(ct,"contextType",r);const dt=ct;class ut extends e.Component{render(){return t().createElement(E.Tabs.TabPane,this.props,this.props.children)}}const pt=ut;function mt(){return mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},mt.apply(this,arguments)}function ht(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class ft extends e.Component{render(){const{size:e,className:l}=this.props,a=e||this.context.size||"",r=ae("tabs"),n={[r]:!0,[`${r}--lg`]:"large"===a,[`${r}--sm`]:"small"===a};return t().createElement(E.Tabs,mt({},this.props,{className:le()(n,l)}),this.props.children)}}ht(ft,"TabPane",pt),ht(ft,"contextType",r),ht(ft,"defaultProps",{tabBarGutter:10});const gt=ft;function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},bt.apply(this,arguments)}function yt(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class vt extends e.Component{constructor(){super(...arguments),yt(this,"titleRef",t().createRef()),yt(this,"$drawer",null),yt(this,"opened",!1),yt(this,"state",{fullscreen:!1,spinning:!1,sloading:!1}),yt(this,"afterVisibleChange",(e=>{const{loading:t}=this.props;var l,a;e?(this.opened=!0,(0,z.o8)(t)&&setTimeout((()=>this.setState({spinning:!1})),100)):(null===(l=(a=this.props).onClosed)||void 0===l||l.call(a),this.setState({fullscreen:!1}))})),yt(this,"toggleHandle",(()=>{this.$drawer||(this.$drawer=Ne(this.titleRef.current,"ant-drawer-content-wrapper")),this.setState((e=>({fullscreen:!e.fullscreen})))})),yt(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),yt(this,"STOP_LOADING",(()=>{this.setState({sloading:!1})}))}componentWillUnmount(){this.$drawer=null}componentDidUpdate(e,t){const{visible:l,loading:a,destroyOnClose:r}=this.props,{fullscreen:n}=this.state;l&&l!==e.visible&&(!r&&this.opened||(0,z.o8)(a)&&this.setState({spinning:!0})),this.$drawer&&n!==t.fullscreen&&Te(this.$drawer,n?{width:"100%"}:{width:(0,z.PM)(this.props.width||"72%")})}renderTitle(){const{fullscreen:e}=this.state,{showFullScreen:l}=this.props;return t().createElement(t().Fragment,null,t().createElement("span",{ref:this.titleRef,className:le()("text")},this.props.title),l&&t().createElement("span",{className:le()("full-screen"),onClick:this.toggleHandle},t().createElement(e?re.FullscreenExitOutlined:re.FullscreenOutlined)))}render(){const{spinning:e,sloading:l}=this.state,{size:a,className:r,loading:n,maskClosable:i,onClose:o}=this.props,s=this.context.global,c=a||this.context.size||"",d=ae("drawer"),u={[d]:!0,[`${d}--lg`]:"large"===c,[`${d}--sm`]:"small"===c};return t().createElement(E.Drawer,bt({},U()(this.props,["size","showFullScreen","loading","maskClosable","onClosed"]),{maskClosable:i??(null==s?void 0:s.maskClosable)??!1,className:le()(u,r),title:this.renderTitle(),footer:null,onClose:o,afterVisibleChange:this.afterVisibleChange}),this.props.children,(n||l||e)&&t().createElement(Be,{spinning:!0,className:le()(`${d}-spin`)}))}}yt(vt,"contextType",r),yt(vt,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmDrawer","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},spinning:a().bool}),yt(vt,"defaultProps",{width:"72%",showFullScreen:!0,destroyOnClose:!0,footer:null});const xt=vt;function Et(){return Et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Et.apply(this,arguments)}function Ct(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const St="10vh";var wt;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small"}(wt||(wt={}));class Tt extends e.Component{constructor(){super(...arguments),Ct(this,"draggleRef",t().createRef()),Ct(this,"opened",!1),Ct(this,"state",{fullscreen:!1,spinning:!1,sloading:!1,disabled:!0,bounds:{left:0,top:0,bottom:0,right:0},position:void 0}),Ct(this,"onStart",((e,t)=>{const{clientWidth:l,clientHeight:a}=window.document.documentElement,r=this.draggleRef.current.getBoundingClientRect();r&&this.setState({bounds:{left:-r.left+t.x,right:l-(r.right-t.x)-1,top:-r.top+t.y,bottom:a-(r.bottom-t.y)-1}})})),Ct(this,"toggleHandle",(e=>{const t=Ne(e.target,"ant-modal");if(!t)return;const l=t.querySelector(".ant-modal-body"),{height:a}=this.props,{fullscreen:r}=this.state;r?(Te(t,{width:(0,z.PM)(this.props.width||"60%"),height:"auto",top:St}),Te(l,{height:a?(0,z.PM)(a):this.defaultHeight,maxHeight:"auto"===a?this.defaultHeight:""})):(Te(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Te(l,{height:`calc(100vh - ${wt[this.$size]}px)`,maxHeight:""})),this.setState((e=>({fullscreen:!e.fullscreen})))})),Ct(this,"afterVisibleChange",(()=>{const{onClosed:e}=this.props;null==e||e(),this.setState({fullscreen:!1})})),Ct(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),Ct(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 - ${wt[this.$size]}px)`}componentDidUpdate(e,t){const{visible:l,loading:a,destroyOnClose:r}=this.props,{fullscreen:n}=this.state;if(l&&l!==e.visible){if(!r&&this.opened||(0,z.o8)(a)&&this.setState({spinning:!0}),!r&&this.opened)return;setTimeout((()=>{this.opened=!0,(0,z.o8)(a)&&this.setState({spinning:!1})}),400)}n!==t.fullscreen&&(n?this.setState({position:{x:0,y:0}}):this.setState({position:void 0}))}renderTitle(){const{fullscreen:e,disabled:l}=this.state,{showFullScreen:a}=this.props;return t().createElement("div",{onMouseOver:()=>{l&&this.setState({disabled:!1})},onMouseOut:()=>{this.setState({disabled:!0})}},t().createElement("span",{className:le()("text")},this.props.title),a&&t().createElement("span",{className:le()("full-screen"),onClick:this.toggleHandle},t().createElement(e?re.FullscreenExitOutlined:re.FullscreenOutlined)))}render(){const{spinning:e,sloading:l,fullscreen:a,disabled:r,bounds:n,position:i}=this.state,{height:o,className:s,loading:c,draggable:d,maskClosable:u,bodyStyle:p,onClose:m}=this.props,h=this.context.global,f=ae("modal"),g={height:o?(0,z.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(E.Modal,Et({},U()(this.props,["showFullScreen","loading","maskClosable","onClose","onClosed"]),{maskClosable:u??(null==h?void 0:h.maskClosable)??!1,className:le()(b,s),title:this.renderTitle(),footer:null,bodyStyle:Object.assign({},g,p),onCancel:m,afterClose:this.afterVisibleChange,modalRender:e=>t().createElement(xe(),{disabled:!d||r||a,bounds:n,position:i,onStart:(e,t)=>this.onStart(e,t)},t().createElement("div",{ref:this.draggleRef},e))}),this.props.children,(c||l||e)&&t().createElement(Be,{spinning:!0,className:le()(`${f}-spin`)}))}}Ct(Tt,"contextType",r),Ct(Tt,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmModal","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},spinning:a().bool}),Ct(Tt,"defaultProps",{width:"60%",showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:St}});const It=Tt;var Nt=__webpack_require__(517);const _t=require("memoize-one");var Rt=__webpack_require__.n(_t);const Pt=(0,e.createContext)(void 0),Ot=require("resize-observer-polyfill");var At=__webpack_require__.n(Ot);const kt=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];e.length&&e.forEach((e=>e(t)))}},Ft=function(e,t){!Ee.Z&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new(At())(kt),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},qt=function(e,t){var l;e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||null===(l=e.__ro__)||void 0===l||l.disconnect())},Lt=require("dayjs/plugin/advancedFormat");var Dt=__webpack_require__.n(Lt);const Ht=require("dayjs/plugin/customParseFormat");var $t=__webpack_require__.n(Ht);i().extend(Dt()),i().extend($t());const Mt=(e,t)=>e?i()(e,t):null,Kt=(e,t)=>e?i()(e).format(t):"",Vt=e=>""===e||null==e,Ut=(e,t,l)=>e.map((e=>{const a={value:e[t],text:e[l]};return e.disabled&&(a.disabled=!0),Array.isArray(e.children)&&(a.children=Ut(e.children,t,l)),a})),zt=(e,t)=>{let l=null;for(let a=0;a<e.length;a++){if(Array.isArray(e[a].children)&&(l=zt(e[a].children,t)),l)return l;if(e[a].value===t)return e[a]}return l},jt=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const a=[];return e.forEach((e=>{e.value==t.split(",")[l]&&a.push(e),Array.isArray(e.children)&&a.push(...jt(e.children,t,l+1))})),a},Bt=e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),Wt=80,Gt="1",Yt="0",Zt=["RANGE_INPUT","RANGE_INPUT_NUMBER","MULTIPLE_CHECKBOX","MULTIPLE_SELECT","RANGE_DATE","RANGE_TIME","MULTIPLE_TREE_SELECT","MULTIPLE_SEARCH_HELPER","MULTIPLE_CASCADER","UPLOAD_FILE"],Xt={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};let Qt,Jt,el;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(Qt||(Qt={})),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"}(Jt||(Jt={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(el||(el={}));const tl={items:a().arrayOf(a().shape({type:a().string.isRequired,fieldName:a().string.isRequired})),initialValues:a().object,initialExtras:a().object,layout:a().oneOf(["horizontal","vertical"]),size:(e,t,l)=>{if(!g(e[t]||""))return m("QmForm","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},cols:a().number,customClass:a().string,labelWidth:a().oneOfType([a().number,a().string]),labelAlign:a().oneOf(["left","right"]),formType:a().oneOf(["default","search","onlyShow"]),uniqueKey:a().string,authCode:a().string,defaultRows:a().number,authConfig:a().shape({fetch:a().shape({api:a().func.isRequired,params:a().object,dataKey:a().string})}),isAutoFocus:a().bool,isCollapse:a().bool,isFieldsDefine:a().bool,isSearchBtn:a().bool,isSubmitBtn:a().bool,fieldsChange:a().func,onValuesChange:a().func,onFieldsChange:a().func,onFinish:a().func,onFinishFailed:a().func,onReset:a().func,onCollapse:a().func},ll={layout:"horizontal",labelWidth:Wt,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:z.ZT,onFieldsChange:z.ZT,onFinish:z.ZT,onFinishFailed:z.ZT,onReset:z.ZT,onCollapse:z.ZT,onFormItemsChange:z.ZT},al=require("react-sortablejs");function rl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class nl extends e.Component{constructor(){super(...arguments),rl(this,"linkRef",t().createRef()),rl(this,"state",{visible:!1})}get formUniqueKey(){return this.props.uniqueKey?`form_${this.props.uniqueKey}`:""}componentDidMount(){this.initLocalfields()}async getTableFieldsConfig(e){const t=this.context.global,l=null==t?void 0:t.getComponentConfigApi;if(l)try{const t=await l({key:e});if(200===t.code)return t.data}catch(e){}}async saveTableColumnsConfig(e,t){const l=this.context.global,a=null==l?void 0:l.saveComponentConfigApi;if(a)try{await a({[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,Nt.xor)(e.map((e=>e.fieldName)),this.props.items.map((e=>e.fieldName))).length>0?this.props.items.map((t=>{const{fieldName:l}=t,a=e.find((e=>e.fieldName===l));return a?((0,z.o8)(a.hidden)||(t.hidden=a.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,z.o8)(e.hidden)||(t.hidden=e.hidden),{fieldName:e.fieldName,...t}})),l=JSON.parse(localStorage.getItem(this.formUniqueKey));(0,Nt.isEqual)(t,l)||(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,l=e.filter((e=>!e.noAuth));return t().createElement(Pt.Consumer,null,(e=>{const a=e.$$form;return t().createElement("div",{className:le()("ant-dropdown-menu","fields-list")},t().createElement(al.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:l,setList:e=>{const t=e.map((e=>e.fieldName)),r=l.map((e=>e.fieldName));(0,Nt.isEqual)(t,r)||(a.setExpandHandle(!0),this.changeHandle(e),this.setLocalFields(e))}},l.map((e=>{var r;return t().createElement("li",{key:e.fieldName,className:"item"},t().createElement(E.Checkbox,{disabled:(null===(r=e.rules)||void 0===r?void 0:r.findIndex((e=>e.required)))>-1,checked:!e.hidden,onChange:t=>{const{checked:a}=t.target;e.hidden=!a,this.changeHandle(l),this.setLocalFields(l)}}),t().createElement(re.HolderOutlined,{className:"handle",title:d("qm.form.draggable")}),t().createElement("span",{className:"title"},a.getFormItemLabel(e.label)))}))))}))}render(){const{visible:e}=this.state,l=ae("form-fields-filter");return t().createElement(Pt.Consumer,null,(a=>{const{$size:r}=a.$$form,n={[l]:!0,[`${l}--lg`]:"large"===r,[`${l}--sm`]:"small"===r};return t().createElement(E.Dropdown,{overlayClassName:le()(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(re.UnorderedListOutlined,null)))}))}}rl(nl,"contextType",r);const il=nl;function ol(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class sl extends e.Component{constructor(){super(...arguments),ol(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e)})),ol(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)}))}render(){const{$$form:e}=this.context,{value:l}=this.props,{type:a,options:r={},style:n={},placeholder:i=d("qm.form.inputPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:c,disabled:u,onBlur:p=z.ZT,onEnter:m=z.ZT}=this.props.option,{prefix:h,suffix:f,password:g,maxLength:b,pattern:y,toUpper:v,toTrim:x,secretType:C}=r,S=C&&(c||u),w=g?E.Input.Password:E.Input,T=S?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return e+="","finance"===t&&(e=Bt(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,C):l;return t().createElement(w,{ref:e=>this[a]=e,value:T,placeholder:i,style:n,title:T,prefix:h,suffix:f,maxLength:b,bordered:o,allowClear:s,readOnly:c,disabled:u,onBlur:e=>{let t=e.target.value??"";if(x){const e=t.trim();t!==e&&(t=e,this.triggerChange(t))}this.triggerBlur(t),p(t)},onKeyUp:t=>{if(13===t.keyCode){const{value:l}=t.target;m(l),e.isFilterType&&e.SUBMIT_FORM()}},onChange:e=>{let t=e.target.value;(0,Nt.isRegExp)(y)&&(t=y.test(t)?t:l??""),v&&(t=t.toUpperCase()),this.triggerChange(t)}})}}ol(sl,"contextType",Pt);class cl extends e.Component{constructor(){super(...arguments),ol(this,"inputRef",t().createRef()),ol(this,"focus",(()=>{const{type:e}=this.props.option;this.inputRef.current[e].focus()}))}render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(sl,{ref:this.inputRef,option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}ol(cl,"contextType",Pt);const dl=cl;function ul(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class pl extends e.Component{constructor(){super(...arguments),ul(this,"triggerChange",(e=>{const{onChange:t=z.ZT,onValuesChange:l}=this.props;t(e=e.every((e=>!e))?[]:e),l(e)}))}render(){const{value:e=[]}=this.props,{options:l={},placeholder:a=d("qm.form.rangeInputNumberPlaceholder"),bordered:r=!0,allowClear:n,readOnly:i,disabled:o}=this.props.option,{prefix:s,suffix:c,maxLength:u}=l;return t().createElement(E.Input.Group,{compact:!0},t().createElement(E.Input,{value:e[0],className:"site-input-left",style:{width:"calc(50% - 10px)"},placeholder:a[0],prefix:s,suffix:c,maxLength:u,allowClear:n,bordered:r,readOnly:i,disabled:o,onChange:t=>{const{value:l}=t.target;this.triggerChange([l,e[1]])}}),t().createElement(E.Input,{className:"site-input-split",style:{width:20,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:r,disabled:o,readOnly:!0}),t().createElement(E.Input,{value:e[1],className:"site-input-right",style:{width:"calc(50% - 10px)"},placeholder:a[1],prefix:s,suffix:c,maxLength:u,bordered:r,allowClear:n,readOnly:i,disabled:o,onChange:t=>{const{value:l}=t.target;this.triggerChange([e[0],l])}}))}}ul(pl,"contextType",Pt);class ml extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,labelWidth:o=e.props.labelWidth,extra:s,validateTrigger:c,rules:d=[],onChange:u=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(o)},required:e.getFormItemRequired(d)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:d,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(pl,{option:this.props.option,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];u(t),e.setViewValue(n,t.join("-"))}}))),s&&t().createElement(E.Col,{flex:(0,z.PM)(s.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...s}))))}}ul(ml,"contextType",Pt);const hl=ml;function fl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const gl=e=>{const t=Number(e);return Number.isNaN(t)?e:t};class bl extends e.Component{constructor(){super(...arguments),fl(this,"focus",(()=>{const{type:e}=this.props.option;this[e].focus()}))}render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:u,rules:p=[],style:m={},placeholder:h=d("qm.form.inputPlaceholder"),bordered:f=!0,allowClear:g,readOnly:b,disabled:y,onChange:v=z.ZT,onBlur:x=z.ZT,onEnter:C=z.ZT}=this.props.option,{step:S=1,min:w=0,max:T,controls:I,precision:N,formatter:_,parser:R}=o;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(E.InputNumber,{ref:e=>this[l]=e,placeholder:h,style:{width:"100%",...m},step:S,min:w,max:T,controls:I,precision:N,formatter:_,parser:R,bordered:f,readOnly:b,disabled:y,onBlur:e=>{(0,z.Y3)((()=>{const{value:t}=e.target;x(gl((null==R?void 0:R(t))??t))}))},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;C(gl((null==R?void 0:R(t))??t))}},onChange:t=>{e.setViewValue(n,(null==t?void 0:t.toString())??""),v(t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}fl(bl,"contextType",Pt);const yl=bl;function vl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class xl extends e.Component{constructor(){super(...arguments),vl(this,"validateValues",(e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),this.triggerChange(e)})),vl(this,"triggerChange",(e=>{const{onChange:t=z.ZT,onValuesChange:l}=this.props,a=e.every((e=>null===e))?[]:[...e];t(a),l(a)}))}render(){const{value:e=[]}=this.props,{options:l={},placeholder:a=d("qm.form.rangeInputNumberPlaceholder"),bordered:r=!0,allowClear:n,readOnly:i,disabled:o}=this.props.option,{step:s=1,min:c=0,max:u,controls:p,precision:m,formatter:h,parser:f}=l;return t().createElement(E.Input.Group,{compact:!0},t().createElement(E.InputNumber,{value:e[0],className:"site-input-left",style:{width:"calc(50% - 10px)"},placeholder:a[0],step:s,min:c,max:u,controls:p,precision:m,formatter:h,parser:f,bordered:r,readOnly:i,disabled:o,onChange:t=>{this.triggerChange([t,e[1]])},onBlur:()=>{this.validateValues(e)}}),t().createElement(E.Input,{className:"site-input-split",style:{width:20,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:r,disabled:o,readOnly:!0}),t().createElement(E.InputNumber,{value:e[1],className:"site-input-right",style:{width:"calc(50% - 10px)"},placeholder:a[1],step:s,min:c,max:u,controls:p,precision:m,formatter:h,parser:f,bordered:r,readOnly:i,disabled:o,onChange:t=>{this.triggerChange([e[0],t])},onBlur:()=>{this.validateValues(e)}}))}}vl(xl,"contextType",Pt);class El extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,labelWidth:o=e.props.labelWidth,extra:s,validateTrigger:c,rules:d=[],onChange:u=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(o)},required:e.getFormItemRequired(d)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:d,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(xl,{option:this.props.option,onValuesChange:t=>{u(t),e.setViewValue(n,t.join("-"))}}))),s&&t().createElement(E.Col,{flex:(0,z.PM)(s.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...s}))))}}vl(El,"contextType",Pt);const Cl=El;let Sl;function wl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}!function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(Sl||(Sl={}));const{Search:Tl}=E.Input;class Il extends e.Component{constructor(e){var t;super(e),t=this,wl(this,"searchHelper",void 0),wl(this,"alias",void 0),wl(this,"extras",void 0),wl(this,"deriveParams",void 0),wl(this,"valueKey",void 0),wl(this,"_is_change",!1),wl(this,"_record",void 0),wl(this,"_prevValue",void 0),wl(this,"state",{visible:!1,loading:!1}),wl(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),wl(this,"initialHandle",(()=>{const{fieldName:e,searchHelper:t}=this.props.option;this.searchHelper=t||{};const{fieldAliasMap:l,extraAliasMap:a,fieldsDefine:r}=this.searchHelper;if(l||h("QmForm","searchHelper 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof l?l():l||{},this.extras="function"==typeof a?a():a||{},r){const e=["valueKey","displayKey","extraKey"];for(const t in r)e.includes(t)&&(this[t]=r[t])}Object.keys(this.alias).includes(e)||h("QmForm","fieldAliasMap 选项必须包含自身 `fieldName` 值"),this.searchHelper.echoRequest&&!this.valueKey&&h("QmForm","echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),wl(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),wl(this,"getItemText",(async()=>{const{fetchApi:e,params:t={},formatter:l=(e=>e),dataKey:a,fieldAliasMap:r,extraAliasMap:n}=this.searchHelper.echoRequest||{},i="function"==typeof r?r():r||{},o="function"==typeof n?n():n||{},{value:s}=this.props;if(e&&!s&&this._prevValue){this.setState({loading:!0});try{const r=await e(l({...t,key:this._prevValue}));if(200===r.code){const e=Array.isArray(r.data)?r.data:(0,Nt.get)(r.data,a)??[];if(e[0]){const t=e[0];if(i)for(const e in i)Object.keys(this.alias).includes(e)&&this.alias[e]!==i[e]&&(t[this.alias[e]]=t[i[e]]);if(o)for(const e in o)Object.keys(this.extras).includes(e)&&this.extras[e]!==o[e]&&(t[this.extras[e]]=t[o[e]]);this._record=t,this.setFieldsValue(t)}}}catch(e){}this.setState({loading:!1})}})),wl(this,"todoOpen",(e=>{this.deriveParams=this.createFilters(e),this.setVisible(!0)})),wl(this,"createFilters",(e=>{const{fieldName:t}=this.props.option,{filterAliasMap:l}=this.searchHelper,a=""!==e?e:void 0,r="function"==typeof l?l():l??[],n={[t]:a};return r.forEach((e=>n[e]=a)),n})),wl(this,"getSearchHelperTableData",(e=>{const{table:t,initialValue:l={}}=this.searchHelper,{beforeFetch:a=z.XT}=t.fetch;return new Promise((async(r,n)=>{const i=(0,Nt.merge)({},t.fetch.params,{...l,...this.createFilters(e)},{currentPage:1,pageSize:500});try{if(!a(i))return n();this.setState({loading:!0});const e=await t.fetch.api(i);if((0,z.Y3)((()=>this.setState({loading:!1}))),200===e.code)return r(Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,t.fetch.dataKey)??[])}catch(e){this.setState({loading:!1})}n()}))})),wl(this,"setFieldsValue",(e=>{const{$$form:t}=this.context;for(const l in this.alias)t.SET_FIELDS_VALUE({[l]:e[this.alias[l]]});for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:e[this.extras[l]]})})),wl(this,"resetSearchHelperValue",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],l=arguments.length>1?arguments[1]:void 0;const{fieldName:a}=t.props.option,r=e.filter((e=>{var r;return null===(r=e[t.alias[a]])||void 0===r?void 0:r.toString().toLowerCase().includes(l.toLowerCase())}));if(1===r.length)return t.closeSearchHelper(r[0]);t.openSearchHelper(l)})),wl(this,"openSearchHelper",((e,t)=>{const{$$form:l}=this.context,{beforeOpen:a}=this.searchHelper,r=(a??z.XT)(l.state.formData);null!=r&&r.then?r.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==r&&(this.todoOpen(e),null==t||t())})),wl(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const a in this.alias)a!==l&&t.SET_FIELDS_VALUE({[a]:e[this.alias[a]]});for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:e[this.extras[l]]});this._record=e,this.triggerChange(e[this.alias[l]]),this.searchHelperChangeHandle(e[this.alias[l]]);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(e)),200)}))})),wl(this,"closeButNotSelect",(()=>{const{closeRemoteMatch:e,onlySelect:t=!0}=this.searchHelper;this._is_change&&(!e&&t?this.clearSearchHelperValue():this.searchHelperChangeHandle(this.props.value)),this._is_change=!1,this.setVisible(!1)})),wl(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const l in this.alias)l!==t&&e.SET_FIELDS_VALUE({[l]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange(""),this.searchHelperChangeHandle("")})),wl(this,"searchHelperChangeHandle",(e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)})),wl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e)})),wl(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),this.initialHandle()}componentDidMount(){this._prevValue=this.getItemValue(),this.getItemText()}componentDidUpdate(){const e=this.getItemValue();e!==this._prevValue&&(this._prevValue=e,this.getItemText())}render(){const{$$form:e}=this.context,{visible:l,loading:a}=this.state,{value:r}=this.props,{type:n,options:i={},searchHelper:o={},style:s={},placeholder:c=d("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h}=this.props.option,{prefix:f,suffix:g,maxLength:b}=i,y={visible:l,title:d("qm.searchHelper.text"),width:o.width??"60%",loading:!!o.name&&void 0,bodyStyle:{paddingBottom:`${Sl[e.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},v={...o,size:e.$size,initialValue:(0,Nt.merge)({},o.initialValue,this.deriveParams),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}};return t().createElement(t().Fragment,null,t().createElement(Tl,{ref:e=>this[`${n}_Ref`]=e,value:r,loading:a,placeholder:c,style:s,title:r,prefix:f,suffix:g,maxLength:b,bordered:u,allowClear:p,readOnly:m,disabled:h,onBlur:e=>{const{value:t}=e.target;var a,r;this.triggerBlur(t),this._is_change&&!l&&(t?o.closeRemoteMatch?this.searchHelperChangeHandle(t):null!==(a=o.table)&&void 0!==a&&null!==(r=a.fetch)&&void 0!==r&&r.api&&this.getSearchHelperTableData(t).then((e=>this.resetSearchHelperValue(e,t))).catch((()=>this.clearSearchHelperValue())):this.clearSearchHelperValue())},onKeyUp:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;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):this.clearSearchHelperValue())}}),t().createElement(It,y,t().createElement(eo,v)))}}wl(Il,"contextType",Pt);class Nl extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[]}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(Il,{option:this.props.option,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}wl(Nl,"contextType",Pt);const _l=Nl;function Rl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Pl extends e.Component{constructor(e){var t;super(e),t=this,Rl(this,"searchHelper",void 0),Rl(this,"alias",void 0),Rl(this,"_records",[]),Rl(this,"state",{visible:!1,loading:!1,itemList:[]}),Rl(this,"initialHandle",(()=>{const{searchHelper:e}=this.props.option;this.searchHelper=e||{};const t=this.searchHelper.fieldAliasMap;t||h("QmForm","searchHelper 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof t?t():t||{},Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||h("QmForm","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),Rl(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Rl(this,"setItemList",(e=>{this.setState({itemList:e})})),Rl(this,"setRecords",(e=>{this._records=e})),Rl(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),Rl(this,"openSearchHelper",(e=>{const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,a=(l??z.XT)(t.state.formData);null!=a&&a.then?a.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==a&&(this.setVisible(!0),null==e||e())})),Rl(this,"closeSearchHelper",(function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:a}=t.alias;t.setRecords((0,Nt.uniqBy)([...t._records.filter((e=>l.includes(e[a]))),...e],a));const r=t.recordsToDict();t.setItemList(r),t.triggerChange(r.map((e=>e.value)));const{closed:n}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>null==n?void 0:n(t._records)),200)}))})),Rl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:a}=this.alias;this.setRecords(this._records.filter((t=>e.includes(t[a])))),null==t||t(e),l(e,this.createViewText(e),this._records)})),this.initialHandle()}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:l=[]}=this.props;(0,Nt.isEqual)((0,Nt.intersection)(t,l),l)||(0,Nt.isEqual)(l,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList()}async getItemList(){const{searchHelper:e}=this.props.option,{textKey:t,valueKey:l}=this.alias,{fetchApi:a,params:r={},formatter:n=(e=>e),dataKey:i,fieldAliasMap:o}=(null==e?void 0:e.echoRequest)||(null==e?void 0:e.request)||{},s="function"==typeof o?o():o||{},{value:c}=this.props;if(a&&c){this.setState({loading:!0});try{const e=await a(n({...r,keys:c}));if(200===e.code){let a=Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,i)??[];a.forEach((e=>{null!=s&&s.valueKey&&s.valueKey!==l&&(e[l]=e[s.valueKey]),null!=s&&s.textKey&&s.textKey!==t&&(e[t]=e[s.textKey])})),a=a.filter((e=>c.includes(e[l])));const r=a.map((e=>({value:e[l],text:e[t]})));this.setRecords(a),this.setItemList(r)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){const{$$form:e}=this.context,{visible:l,loading:a,itemList:r}=this.state,{value:n}=this.props,{fieldName:i,options:o={},searchHelper:s={},style:c={},placeholder:u=d("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:m=!0,readOnly:h,disabled:f}=this.props.option,{collapseTags:g,maxTagTextLength:b}=o,y={visible:l,title:d("qm.searchHelper.text"),width:s.width??"60%",loading:!!s.name&&void 0,bodyStyle:{paddingBottom:`${Sl[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},v={...s,size:e.$size,multiple:!0,initialValue:(0,Nt.merge)({},s.initialValue),defaultSelectedKeys:n,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}};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(E.Select,{mode:"multiple",maxTagCount:g?"responsive":void 0,maxTagTextLength:b,open:!1,value:n,placeholder:u,loading:a,bordered:p,allowClear:m,disabled:f,style:{width:"100%"},title:e.getViewValue(i),onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},r.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(E.Button,{className:"ant-input-search-button",disabled:f,icon:t().createElement(re.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),t().createElement(It,y,t().createElement(eo,v)))}}Rl(Pl,"contextType",Pt);class Ol extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(Pl,{option:this.props.option,onValuesChange:(t,l,a)=>{p(t,a),e.setViewValue(n,l)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}Rl(Ol,"contextType",Pt);const Al=Ol;function kl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const{Search:Fl}=E.Input;class ql extends e.Component{constructor(e){super(e),kl(this,"searchHelper",void 0),kl(this,"alias",void 0),kl(this,"extras",void 0),kl(this,"valueKey",void 0),kl(this,"_record",void 0),kl(this,"_prevValue",void 0),kl(this,"state",{visible:!1,loading:!1}),kl(this,"initialHandle",(()=>{const{fieldName:e,searchHelper:t}=this.props.option;this.searchHelper=t||{};const{fieldAliasMap:l,extraAliasMap:a,fieldsDefine:r}=this.searchHelper;if(l||h("QmForm","searchHelper 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof l?l():l||{},this.extras="function"==typeof a?a():a||{},r){const e=["valueKey","displayKey","extraKey"];for(const t in r)e.includes(t)&&(this[t]=r[t])}Object.keys(this.alias).includes(e)||h("QmForm","fieldAliasMap 选项必须包含自身 `fieldName` 值"),this.searchHelper.echoRequest&&!this.valueKey&&h("QmForm","echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),kl(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),kl(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),kl(this,"getItemText",(async()=>{const{fetchApi:e,params:t={},formatter:l=(e=>e),dataKey:a,fieldAliasMap:r,extraAliasMap:n}=this.searchHelper.echoRequest||{},i="function"==typeof r?r():r||{},o="function"==typeof n?n():n||{},{value:s}=this.props;if(e&&!s&&this._prevValue){this.setState({loading:!0});try{const r=await e(l({...t,key:this._prevValue}));if(200===r.code){const e=Array.isArray(r.data)?r.data:(0,Nt.get)(r.data,a)??[];if(e[0]){const t=e[0];if(i)for(const e in i)Object.keys(this.alias).includes(e)&&this.alias[e]!==i[e]&&(t[this.alias[e]]=t[i[e]]);if(o)for(const e in o)Object.keys(this.extras).includes(e)&&this.extras[e]!==o[e]&&(t[this.extras[e]]=t[o[e]]);this._record=t,this.setFieldsValue(t)}}}catch(e){}this.setState({loading:!1})}})),kl(this,"setFieldsValue",(e=>{const{$$form:t}=this.context;for(const l in this.alias)t.SET_FIELDS_VALUE({[l]:e[this.alias[l]]});for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:e[this.extras[l]]})})),kl(this,"openSearchHelper",(e=>{const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,a=(l??z.XT)(t.state.formData);null!=a&&a.then?a.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==a&&(this.setVisible(!0),null==e||e())})),kl(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const a in this.alias)a!==l&&t.SET_FIELDS_VALUE({[a]:e[this.alias[a]]});for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:e[this.extras[l]]});this._record=e,this.triggerChange(e[this.alias[l]]);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(e)),200)}))})),kl(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const l in this.alias)l!==t&&e.SET_FIELDS_VALUE({[l]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")})),kl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this._record)})),kl(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),this.initialHandle()}componentDidMount(){this._prevValue=this.getItemValue(),this.getItemText()}componentDidUpdate(){const e=this.getItemValue();e!==this._prevValue&&(this._prevValue=e,this.getItemText())}render(){const{$$form:e}=this.context,{visible:l,loading:a}=this.state,{value:r=""}=this.props,{type:n,options:i={},searchHelper:o={},style:s={},placeholder:c=d("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h}=this.props.option,{prefix:f,suffix:g,maxLength:b}=i,y={visible:l,title:d("qm.searchHelper.text"),width:o.width??"65%",loading:!1,bodyStyle:{paddingBottom:`${Sl[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},v={...o,size:e.$size,initialValue:(0,Nt.merge)({},o.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}};return t().createElement(t().Fragment,null,t().createElement(Fl,{ref:e=>this[`${n}_Ref`]=e,value:r,title:r,loading:a,placeholder:c,style:s,prefix:f,suffix:g,maxLength:b,bordered:u,allowClear:p,readOnly:m,disabled:h,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(It,y,t().createElement(io,v)))}}kl(ql,"contextType",Pt);class Ll extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(ql,{option:this.props.option,onValuesChange:(t,l)=>{p(t,l),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}kl(Ll,"contextType",Pt);const Dl=Ll;function Hl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class $l extends e.Component{constructor(e){var t;super(e),t=this,Hl(this,"searchHelper",void 0),Hl(this,"alias",void 0),Hl(this,"_records",[]),Hl(this,"state",{visible:!1,loading:!1,itemList:[]}),Hl(this,"initialHandle",(()=>{const{searchHelper:e}=this.props.option;this.searchHelper=e||{};const t=this.searchHelper.fieldAliasMap;t||h("QmForm","searchHelper 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof t?t():t||{},Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||h("QmForm","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),Hl(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Hl(this,"setItemList",(e=>{this.setState({itemList:e})})),Hl(this,"setRecords",(e=>{this._records=e})),Hl(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),Hl(this,"openSearchHelper",(e=>{const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,a=(l??z.XT)(t.state.formData);null!=a&&a.then?a.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==a&&(this.setVisible(!0),null==e||e())})),Hl(this,"closeSearchHelper",(function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:a}=t.alias;t.setRecords((0,Nt.uniqBy)([...t._records.filter((e=>l.includes(e[a]))),...e],a));const r=t.recordsToDict();t.setItemList(r),t.triggerChange(r.map((e=>e.value)));const{closed:n}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>null==n?void 0:n(t._records)),200)}))})),Hl(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:a}=this.alias;this.setRecords(this._records.filter((t=>e.includes(t[a])))),null==t||t(e),l(e,this.createViewText(e),this._records)})),this.initialHandle()}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:l=[]}=this.props;(0,Nt.isEqual)((0,Nt.intersection)(t,l),l)||(0,Nt.isEqual)(l,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList()}async getItemList(){const{searchHelper:e}=this.props.option,{textKey:t,valueKey:l}=this.alias,{fetchApi:a,params:r={},formatter:n=(e=>e),dataKey:i,fieldAliasMap:o}=(null==e?void 0:e.echoRequest)||(null==e?void 0:e.request)||{},s="function"==typeof o?o():o||{},{value:c}=this.props;if(a&&c){this.setState({loading:!0});try{const e=await a(n({...r,keys:c}));if(200===e.code){let a=Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,i)??[];a.forEach((e=>{null!=s&&s.valueKey&&s.valueKey!==l&&(e[l]=e[s.valueKey]),null!=s&&s.textKey&&s.textKey!==t&&(e[t]=e[s.textKey])})),a=a.filter((e=>c.includes(e[l])));const r=a.map((e=>({value:e[l],text:e[t]})));this.setRecords(a),this.setItemList(r)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){const{$$form:e}=this.context,{visible:l,loading:a,itemList:r}=this.state,{value:n}=this.props,{fieldName:i,options:o={},searchHelper:s={},style:c={},placeholder:u=d("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:m=!0,readOnly:h,disabled:f}=this.props.option,{collapseTags:g,maxTagTextLength:b}=o,y={visible:l,title:d("qm.searchHelper.text"),width:s.width??"65%",loading:!1,bodyStyle:{paddingBottom:`${Sl[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},v={...s,size:e.$size,multiple:!0,initialValue:(0,Nt.merge)({},s.initialValue),defaultSelectedKeys:n,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}};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(E.Select,{mode:"multiple",maxTagCount:g?"responsive":void 0,maxTagTextLength:b,open:!1,value:n,placeholder:u,loading:a,bordered:p,allowClear:m,disabled:f,style:{width:"100%"},title:e.getViewValue(i),onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},r.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(E.Button,{className:"ant-input-search-button",disabled:f,icon:t().createElement(re.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),t().createElement(It,y,t().createElement(io,v)))}}Hl($l,"contextType",Pt);class Ml extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement($l,{option:this.props.option,onValuesChange:(t,l,a)=>{p(t,a),e.setViewValue(n,l)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}Hl(Ml,"contextType",Pt);const Kl=Ml,Vl=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:i={},disabled:o}=e.option,{falseValue:s=Yt,trueValue:c=Gt}=n;return t().createElement(E.Checkbox,{checked:l===c,style:i,disabled:o,onChange:e=>{const{checked:t}=e.target,l=t?c:s;null==a||a(l),r(l)}})};class Ul extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:u,rules:p=[],onChange:m=z.ZT}=this.props.option,{falseValue:h=Yt,trueValue:f=Gt}=o;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(Vl,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(n,d(t===f?"am.form.trueText":"am.form.falseText"))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(Ul,"contextType",Pt);const zl=Ul;function jl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Bl extends e.Component{constructor(){super(...arguments),jl(this,"state",{results:[]})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList()}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:l={},dataKey:a,valueKey:r="value",textKey:n="text"}=e;if(t)try{const e=await t(l);if(200===e.code){const t=(Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[]).map((e=>({value:e[r],text:e[n]})));this.setState({results:t})}}catch(e){}}render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],style:p={},readOnly:m,disabled:h,onChange:f=z.ZT}=this.props.option,{itemList:g=[]}=o,b=(0,z.xb)(g)?this.state.results:g;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(E.Checkbox.Group,{style:{width:"100%",...p},disabled:h,onChange:t=>{const l=b.filter((e=>t.includes(e.value))).map((e=>e.text)).join(",");e.setViewValue(n,l),f(t)}},b.map((e=>t().createElement(E.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text)))))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}jl(Bl,"contextType",Pt);const Wl=Bl;class Gl extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],style:p={},readOnly:m,disabled:h,onChange:f=z.ZT}=this.props.option,{allowHalf:g,count:b=5,tooltips:y}=o;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(E.Rate,{count:b,allowHalf:g,tooltips:y,disabled:h,onChange:t=>{e.setViewValue(n,y?y[Math.ceil(t)-1]:t),f(t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(Gl,"contextType",Pt);const Yl=Gl;function Zl(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Xl extends e.Component{constructor(){super(...arguments),Zl(this,"state",{results:[]})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList()}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:l={},dataKey:a,valueKey:r="value",textKey:n="text"}=e;if(t)try{const e=await t(l);if(200===e.code){const t=(Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[]).map((e=>({value:e[r],text:e[n]})));this.setState({results:t})}}catch(e){}}render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],style:p={},readOnly:m,disabled:h,onChange:f=z.ZT}=this.props.option,{itemList:g=[]}=o,b=(0,z.xb)(g)?this.state.results:g;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(E.Radio.Group,{style:{width:"100%",...p},disabled:h,onChange:t=>{var l;const{value:a}=t.target,r=null===(l=b.find((e=>e.value===a)))||void 0===l?void 0:l.text;e.setViewValue(n,r),f(a)}},b.map((e=>t().createElement(E.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text)))))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}Zl(Xl,"contextType",Pt);const Ql=Xl,Jl=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:i={},disabled:o}=e.option,{falseValue:s=Yt,trueValue:c=Gt}=n;return t().createElement(E.Switch,{checked:l===c,style:i,disabled:o,checkedChildren:t().createElement(re.CheckOutlined,null),unCheckedChildren:t().createElement(re.CloseOutlined,null),onChange:e=>{const t=e?c:s;null==a||a(t),r(t)}})};class ea extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:u,rules:p=[],onChange:m=z.ZT}=this.props.option,{falseValue:h=Yt,trueValue:f=Gt}=o;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(Jl,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(n,d(t===f?"am.form.trueText":"am.form.falseText"))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(ea,"contextType",Pt);const ta=ea;class la extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:u,rules:p=[],style:m={},placeholder:h=d("qm.form.inputPlaceholder"),bordered:f=!0,allowClear:g,readOnly:b,disabled:y,onChange:v=z.ZT,onBlur:x=z.ZT,onEnter:C=z.ZT}=this.props.option,{showCount:S,maxLength:w,autoSize:T}=o,I=Object.assign({},{minRows:1,maxRows:3},T);return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(p)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(E.Input.TextArea,{placeholder:h,style:m,maxLength:w,showCount:S,autoSize:I,bordered:f,allowClear:g,readOnly:b,disabled:y,onBlur:e=>{const{value:t}=e.target;x(t)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;C(t)}},onChange:t=>{const{value:l}=t.target;e.setViewValue(n,l),v(l)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(la,"contextType",Pt);const aa=la,ra=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:o={},placeholder:s=d("qm.form.datePlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:m}=e.option,{dateType:h="date",minDateTime:f,maxDateTime:g,shortCuts:b=!0}=n,y=t().createRef(),v=e=>{let t=Kt(e,Jt[h]);t&&"date"===h&&(t=t.replace(/\d{2}:\d{2}:\d{2}$/,"00:00:00")),null==a||a(t),r(t)},x=e=>{const t=i()().subtract(e,"day");v(t),y.current.blur(),y.current.focus()};return t().createElement(R,{ref:y,style:{width:"100%",...o},picker:Qt[h],bordered:c,showToday:!1,showTime:"datetime"===h,allowClear:u,disabled:m,inputReadOnly:p,disabledDate:e=>((e,t)=>{let[l,a]=t;return l&&a?e.isBefore(l,"day")||e.isAfter(a,"day"):l?e.isBefore(l,"day"):!!a&&e.isAfter(a,"day")})(e,[f,g]),renderExtraFooter:b?e=>t().createElement(t().Fragment,null,t().createElement(E.Tag,{color:"processing",onClick:()=>x(0)},d("qm.form.datePickers")[0]),t().createElement(E.Tag,{color:"processing",onClick:()=>x(1)},d("qm.form.datePickers")[1]),t().createElement(E.Tag,{color:"processing",onClick:()=>x(7)},d("qm.form.datePickers")[2]),t().createElement(E.Tag,{color:"processing",onClick:()=>x(30)},d("qm.form.datePickers")[3])):void 0,value:Mt(l,Jt[h]),onChange:(e,t)=>{v(e)}})};class na extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(ra,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(na,"contextType",Pt);const ia=na,oa=e=>[i()().subtract(e,"day"),i()()],sa={[d("qm.form.dateRangePickers")[0]]:oa(7),[d("qm.form.dateRangePickers")[1]]:oa(30),[d("qm.form.dateRangePickers")[2]]:oa(90),[d("qm.form.dateRangePickers")[3]]:oa(180)},ca=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:i={},placeholder:o=d("qm.form.daterangePlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:u,disabled:p}=e.option,{dateType:m="date",disableds:h=[!1,!1],minDateTime:f,maxDateTime:g,shortCuts:b=!0}=n;return t().createElement(R.RangePicker,{style:{width:"100%",...i},picker:Qt[m],bordered:s,showTime:"datetime"===m,allowClear:c,disabled:p?[!0,!0]:h,inputReadOnly:u,disabledDate:e=>((e,t)=>{let[l,a]=t;return l&&a?e.isBefore(l,"day")||e.isAfter(a,"day"):l?e.isBefore(l,"day"):!!a&&e.isAfter(a,"day")})(e,[f,g]),ranges:b?sa:void 0,value:(0,z.xb)(l)?null:[Mt(null==l?void 0:l[0],Jt[m]),Mt(null==l?void 0:l[1],Jt[m])],onChange:(e,t)=>{(e=>{let t=[Kt(null==e?void 0:e[0],Jt[m]),Kt(null==e?void 0:e[1],Jt[m])];"date"===m&&(t=t.map(((e,t)=>0===t?e.replace(/\d{2}:\d{2}:\d{2}$/,"00:00:00"):e.replace(/\d{2}:\d{2}:\d{2}$/,"23:59:59")))),null==a||a(t),r(t)})(e)}})};class da extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(ca,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t.join("-"))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(da,"contextType",Pt);const ua=da,pa=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:i={},placeholder:o=d("qm.form.timePlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:u,disabled:p}=e.option,{timeType:m="hour-minute-second",hourStep:h=1,minuteStep:f=1,secondStep:g=1}=n;return t().createElement(k,{style:{width:"100%",...i},bordered:s,showNow:!0,hourStep:h,minuteStep:f,secondStep:g,allowClear:c,disabled:p,inputReadOnly:u,format:el[m],value:Mt(l,el[m]),onChange:(e,t)=>{(e=>{const t=Kt(e,el[m]);null==a||a(t),r(t)})(e)}})};class ma extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(pa,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(ma,"contextType",Pt);const ha=ma,fa=e=>{const{value:l,onChange:a,onValuesChange:r}=e,{options:n={},style:i={},placeholder:o=d("qm.form.timerangePlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:u,disabled:p}=e.option,{timeType:m="hour-minute-second",disableds:h=[!1,!1],hourStep:f=1,minuteStep:g=1,secondStep:b=1}=n;return t().createElement(k.RangePicker,{style:{width:"100%",...i},bordered:s,showNow:!1,hourStep:f,minuteStep:g,secondStep:b,allowClear:c,disabled:p?[!0,!0]:h,inputReadOnly:u,format:el[m],value:(0,z.xb)(l)?null:[Mt(null==l?void 0:l[0],el[m]),Mt(null==l?void 0:l[1],el[m])],onChange:(e,t)=>{(e=>{const t=[Kt(null==e?void 0:e[0],el[m]),Kt(null==e?void 0:e[1],el[m])];null==a||a(t),r(t)})(e)}})};class ga extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(fa,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t.join("-"))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(ga,"contextType",Pt);const ba=ga,ya={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 va,xa=null;function Ea(e){return e||null===xa?("object"==typeof Intl&&Intl.Collator?(va=new Intl.Collator(["zh-Hans-CN","zh-CN"]),xa=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):xa=!1,xa):xa}function Ca(e){const t=ya.UNIHANS,l=ya.PINYINS,a=ya.EXCEPTIONS,r={source:e};if(e in a)return r.type=2,r.target=a[e],r;let n,i=-1;if(e.charCodeAt(0)<256)return r.type=1,r.target=e,r;if(n=va.compare(e,"阿"),n<0)return r.type=3,r.target=e,r;if(0===n)r.type=2,i=0;else{if(n=va.compare(e,"鿿"),n>0)return r.type=3,r.target=e,r;0===n&&(r.type=2,i=t.length-1)}if(r.type=2,i<0){let l=0,a=t.length-1;for(;l<=a;){i=~~((l+a)/2);const r=t[i];if(n=va.compare(e,r),0===n)break;n>0?l=i+1:a=i-1}}return n<0&&i--,r.target=l[i],r.target||(r.type=3,r.target=r.source),r}function Sa(e){return"string"==typeof e&&Ea()?e.split("").map((e=>Ca(e))):e}const wa={isSupported:Ea,parse:Sa,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(ya)})))},genToken:Ca,convertToPinyin:(e,t,l)=>Sa(e).map((e=>t&&2===e.type?e.target.toLowerCase():e.target)).join(l||"")},Ta={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}};wa.isSupported()&&Ta.shouldPatch(wa.genToken)&&wa.patchDict(Ta);const Ia=wa;function Na(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const{Option:_a}=E.Select;class Ra extends e.Component{constructor(){super(...arguments),Na(this,"state",{results:[],loading:!1})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList()}createViewText(e,t){var l;return this.props.multiple?t.filter((t=>null==e?void 0:e.includes(t.value))).map((e=>e.text)).join(","):null===(l=t.find((t=>t.value===e)))||void 0===l?void 0:l.text}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:l={},dataKey:a,valueKey:r="value",textKey:n="text"}=e;if(t){this.setState({loading:!0});try{const e=await t(l);if(200===e.code){const t=(Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[]).map((e=>({value:e[r],text:e[n]})));this.setState({results:t})}}catch(e){}this.setState({loading:!1})}}render(){const{$$form:e}=this.context,{loading:l}=this.state,{multiple:a}=this.props,{type:r,label:n,tooltip:i,fieldName:o,invisible:s,options:c={},labelWidth:u=e.props.labelWidth,extra:p,validateTrigger:m,rules:h=[],style:f={},placeholder:g=d("qm.form.selectPlaceholder"),bordered:b=!0,allowClear:y=!0,readOnly:v,disabled:x,onChange:C=z.ZT}=this.props.option,{itemList:S=[],filterable:w=!0,collapseTags:T,maxTagTextLength:I,openPyt:N=!0}=c,_=(0,z.xb)(S)?this.state.results:S;return t().createElement(E.Form.Item,{label:e.renderFormLabel(n),tooltip:i,hidden:s,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(u)},required:e.getFormItemRequired(h)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:o,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(n)}},t().createElement(E.Select,{mode:a?"multiple":void 0,placeholder:g,style:f,loading:l,bordered:b,allowClear:y,disabled:x,showSearch:w,maxTagCount:T?"responsive":void 0,maxTagTextLength:I,title:e.getViewValue(o),filterOption:(e,t)=>{const l=(null==t?void 0:t.children)||"",a=Ia.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(N?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{const l=this.createViewText(t,_);e.setViewValue(o,l),C(t,l)}},_.map((e=>t().createElement(_a,{key:e.value,value:e.value,disabled:e.disabled},e.text)))))),p&&t().createElement(E.Col,{flex:(0,z.PM)(p.labelWidth||Wt)},e.renderFormItemExtra({fieldName:o,...p}))))}}Na(Ra,"contextType",Pt);const Pa=Ra,Oa=require("rc-trigger");var Aa=__webpack_require__.n(Oa);function ka(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Fa extends e.Component{constructor(e){super(e),ka(this,"alias",void 0),ka(this,"extras",void 0),ka(this,"valueKey",void 0),ka(this,"prevValue",""),ka(this,"_record",void 0),ka(this,"_prevValue",void 0),ka(this,"searchRef",t().createRef()),ka(this,"state",{results:[],visible:!1,loading:!1,activeIndex:0}),ka(this,"initialHandle",(()=>{const{fieldName:e,options:t={}}=this.props.option,{fieldAliasMap:l,extraAliasMap:a,fieldsDefine:r}=t;if(l||h("QmForm","immediate 需要配置 `fieldAliasMap` 选项"),this.alias="function"==typeof l?l():l||{},this.extras="function"==typeof a?a():a||{},r){const e=["valueKey","displayKey","extraKey"];for(const t in r)e.includes(t)&&(this[t]=r[t])}Object.keys(this.alias).includes(e)||h("QmForm","fieldAliasMap 选项必须包含自身 `fieldName` 值"),t.echoRequest&&!this.valueKey&&h("QmForm","echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),ka(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]})),ka(this,"getItemText",(async()=>{const{options:e={}}=this.props.option,{fetchApi:t,params:l={},formatter:a=(e=>e),dataKey:r,fieldAliasMap:n,extraAliasMap:i}=e.echoRequest||{},o="function"==typeof n?n():n||{},s="function"==typeof i?i():i||{},{value:c}=this.props;if(t&&!c&&this._prevValue){this.setState({loading:!0});try{const e=await t(a({...l,key:this._prevValue}));if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,z.U2)(e.data,r)??[];if(t[0]){const e=t[0];if(o)for(const t in o)Object.keys(this.alias).includes(t)&&this.alias[t]!==o[t]&&(e[this.alias[t]]=e[o[t]]);if(s)for(const t in s)Object.keys(this.extras).includes(t)&&this.extras[t]!==s[t]&&(e[this.extras[t]]=e[s[t]]);this._record=e,this.setFieldsValue(e)}}}catch(e){}this.setState({loading:!1})}})),ka(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const l in this.alias)t.SET_FIELDS_VALUE({[l]:e[this.alias[l]]});for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:e[this.extras[l]]});this._record=e,this.prevValue=e[this.alias[l]]??""})),ka(this,"fetchHandle",(0,z.Ds)(this.getItemList,200)),ka(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),ka(this,"triggerChange",((e,t)=>{const{onChange:l,onValuesChange:a}=this.props;null==l||l(e),t&&a(e,this._record)})),ka(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;null==t||t(e)})),ka(this,"clickHandle",((e,t)=>{const{$$form:l}=this.context,{fieldName:a}=this.props.option;for(const t in this.alias)t!==a&&l.SET_FIELDS_VALUE({[t]:e[this.alias[t]]});for(const t in this.extras)l.SET_FIELDS_EXTRA({[t]:e[this.extras[t]]});this.searchRef.current.focus(),this._record=e,this.prevValue=e[this.alias[a]]??"",this.triggerChange(e[this.alias[a]],!0),t&&t()})),this.initialHandle()}componentDidMount(){this._prevValue=this.getItemValue(),this.getItemText()}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList();const n=this.getItemValue();n!==this._prevValue&&(this._prevValue=n,this.getItemText())}async getItemList(e){const{fieldName:t,request:l={}}=this.props.option,{fetchApi:a,params:r={},formatter:n=(e=>e),dataKey:i}=l;if(a){this.setState({loading:!0});try{const l=await a(n({...r,[t]:e}));if(200===l.code){const e=Array.isArray(l.data)?l.data:(0,z.U2)(l.data,i)??[];this.setState({results:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}render(){const{visible:e,loading:l,results:a}=this.state,{value:n}=this.props,{options:i={},style:o={},placeholder:s=d("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:u=!0,readOnly:p,disabled:m}=this.props.option,{columns:h=[],hideHeader:f,onlySelect:g=!0}=i,b=ae("form-immediate"),y=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,v=t().createElement(E.Spin,{spinning:l},a.length?t().createElement("table",{cellSpacing:0,cellPadding:0,className:le()("table")},!f&&t().createElement("thead",null,t().createElement("tr",null,h.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,a.map(((e,l)=>t().createElement("tr",{key:l,className:this.state.activeIndex===l?"active":"",onMouseEnter:()=>{this.setState({activeIndex:l})},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},h.filter((e=>!e.hidden)).map((l=>t().createElement("td",{key:l.dataIndex},(0,z.U2)(e,l.dataIndex))))))))):t().createElement(ze,null));return t().createElement(r.Consumer,null,(l=>{const r={[b]:!0,[`${b}--lg`]:"large"===(null==l?void 0:l.size),[`${b}--sm`]:"small"===(null==l?void 0:l.size)};return t().createElement(Aa(),{action:m?[]:["click"],popupVisible:!m&&e,popup:v,popupClassName:le()(r),popupStyle:{minWidth:y,...o},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Xt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(E.Input,{ref:this.searchRef,placeholder:s,allowClear:u,bordered:c,readOnly:p,disabled:m,value:n,title:n,onFocus:()=>{!a.length&&this.fetchHandle(n)},onBlur:e=>{const{value:t}=e.target;g&&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(a[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 l=40===e.keyCode?++t%a.length:(--t+a.length)%a.length;this.setState({activeIndex:l})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),t?(this.handleVisibleChange(!0),this.triggerChange(t,!g)):this.clickHandle({})}}))}))}}ka(Fa,"contextType",Pt);class qa extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(Fa,{option:this.props.option,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",l=arguments.length>1?arguments[1]:void 0;p(t,Object.keys(l).length?l:null),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}ka(qa,"contextType",Pt);const La=qa;class Da extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,fieldName:r,style:n={},collapse:i={}}=this.props.option,{viewData:o,expand:s}=e.state,{showLimit:c,remarkItems:d=[],onCollapse:u=z.ZT}=i,p=[];if(d.length){const t=e.getBlockDerivedItems().find((e=>e[0].fieldName===r))??[],l=c??t.length-1;t.slice(l+1).forEach((e=>{const t=d.find((t=>t.fieldName===e.fieldName));if(!t)return;const l=t.showLabel?`${e.label}:`:"",a=o[e.fieldName]??"";""!==a&&p.push({...e,text:`${l}${a}`})}))}return t().createElement(E.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},t().createElement(oe,{id:r,label:a,extra:p.map((e=>e.text)).join(" | "),style:{...n},collapse:s[r],onCollapseChange:t=>{e.setState((e=>({expand:Object.assign({},e.expand,{[r]:t})}))),u(t)}}))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(Da,"contextType",Pt);const Ha=Da;function $a(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const{TreeNode:Ma}=E.TreeSelect;class Ka extends e.Component{constructor(){super(...arguments),$a(this,"state",{results:[],loading:!1})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList()}getItemText(e,t){var l;return(null===(l=zt(t,e))||void 0===l?void 0:l.text)||""}createViewText(e,t){return this.props.multiple?e.map((e=>this.getItemText(e,t))).filter((e=>!!e)).join(","):this.getItemText(e,t)}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:l={},dataKey:a,valueKey:r="value",textKey:n="text"}=e;if(t){this.setState({loading:!0});try{const e=await t(l);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[],l=Ut(t,r,n);this.setState({results:l})}}catch(e){}this.setState({loading:!1})}}createTreeNode(e){return e.map((e=>Array.isArray(e.children)?t().createElement(Ma,{key:e.value,value:e.value,title:e.text,disabled:e.disabled},this.createTreeNode(e.children)):t().createElement(Ma,{key:e.value,value:e.value,title:e.text,disabled:e.disabled})))}render(){const{$$form:e}=this.context,{loading:l}=this.state,{multiple:a}=this.props,{type:r,label:n,tooltip:i,fieldName:o,invisible:s,options:c={},labelWidth:u=e.props.labelWidth,extra:p,validateTrigger:m,rules:h=[],style:f={},placeholder:g=d("qm.form.selectPlaceholder"),bordered:b=!0,allowClear:y=!0,readOnly:v,disabled:x,onChange:C=z.ZT}=this.props.option,{itemList:S=[],filterable:w=!0,checkStrategy:T="SHOW_CHILD",collapseTags:I,openPyt:N=!0}=c,_=(0,z.xb)(S)?this.state.results:S;return t().createElement(E.Form.Item,{label:e.renderFormLabel(n),tooltip:i,hidden:s,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(u)},required:e.getFormItemRequired(h)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:o,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(n)}},t().createElement(E.TreeSelect,{multiple:a,treeCheckable:a,showCheckedStrategy:E.TreeSelect[T],placeholder:g,style:f,loading:l,bordered:b,allowClear:y,disabled:x,treeDefaultExpandAll:!0,showSearch:w,maxTagCount:I?"responsive":void 0,title:e.getViewValue(o),filterTreeNode:(e,t)=>{const l=(null==t?void 0:t.title)||"",a=Ia.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(N?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{const l=this.createViewText(t,_);e.setViewValue(o,l),C(t,l)}},this.createTreeNode(_)))),p&&t().createElement(E.Col,{flex:(0,z.PM)(p.labelWidth||Wt)},e.renderFormItemExtra({fieldName:o,...p}))))}}$a(Ka,"contextType",Pt);const Va=Ka;function Ua(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const za=e=>{const{$$form:l}=t().useContext(Pt),{value:a,multiple:r,cascaderData:n}=e,{fieldName:i,options:o={},style:s={},placeholder:c=d("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h}=e.option,{changeOnSelect:f,filterable:g=!0,openPyt:b=!0}=o,y=t=>{const{onChange:l,onValuesChange:a}=e;null==l||l(t),a(t)};return t().createElement(E.Cascader,{fieldNames:{label:"text",value:"value",children:"children"},multiple:r,maxTagCount:"responsive",value:(0,z.xb)(a)?[]:r?a.map((e=>e.split(","))):a.split(","),options:n,changeOnSelect:f,placeholder:c,style:s,bordered:u,allowClear:p,disabled:h,showSearch:g&&{filter:(e,t)=>t.some((t=>{const l=(null==t?void 0:t.text)||"",a=Ia.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(b?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0}))},title:l.getViewValue(i),onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];y(r?e.map((e=>e.join(","))):e.join(","))}})};class ja extends e.Component{constructor(){super(...arguments),Ua(this,"state",{results:[],loading:!1})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const a=null===(t=e.option.request)||void 0===t?void 0:t.params,r=null===(l=this.props.option.request)||void 0===l?void 0:l.params;(0,Nt.isEqual)(a,r)||this.getItemList()}createViewText(e,t){return this.props.multiple?e.map((e=>jt(t,e).map((e=>e.text)).join("/"))).join(","):jt(t,e).map((e=>e.text)).join("/")}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:l={},dataKey:a,valueKey:r="value",textKey:n="text"}=e;if(t){this.setState({loading:!0});try{const e=await t(l);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[],l=Ut(t,r,n);this.setState({results:l})}}catch(e){}this.setState({loading:!1})}}render(){const{$$form:e}=this.context,{multiple:l}=this.props,{type:a,label:r,tooltip:n,fieldName:i,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,extra:d,validateTrigger:u,rules:p=[],onChange:m=z.ZT}=this.props.option,{itemList:h=[]}=s,f=(0,z.xb)(h)?this.state.results:h;return t().createElement(E.Form.Item,{label:e.renderFormLabel(r),tooltip:n,hidden:o,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(c)},required:e.getFormItemRequired(p)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t().createElement(za,{option:this.props.option,multiple:l,cascaderData:f,onValuesChange:t=>{const l=this.createViewText(t,f);m(t),e.setViewValue(i,l)}}))),d&&t().createElement(E.Col,{flex:(0,z.PM)(d.labelWidth||Wt)},e.renderFormItemExtra({fieldName:i,...d}))))}}Ua(ja,"contextType",Pt);const Ba=ja,Wa=require("china-area-data");var Ga=__webpack_require__.n(Wa);function Ya(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const Za=["110000","120000","310000","500000"],Xa=["810000","820000"],Qa=[{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"}],Ja=[{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"}],er=e=>Ia.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),tr=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(l>2||!e[t])return;const a="86"===t?Object.keys(e[t]).filter((e=>![...Za,...Xa].includes(e))):Object.keys(e[t]);return a.map((a=>({l:er(e[t][a].slice(0,1)).toUpperCase(),n:e[t][a],c:a,p:t,children:tr(e,a,l+1)})))},lr=(e,t)=>t.map((t=>({l:er(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class ar extends e.Component{constructor(e){super(e),Ya(this,"searchRef",t().createRef()),Ya(this,"scrollRef",t().createRef()),Ya(this,"zxsAndGa",void 0),Ya(this,"provinces",void 0),Ya(this,"allCities",void 0),Ya(this,"letterCities",void 0),Ya(this,"state",{visible:!1,select_type:"0",active_key:""}),Ya(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),Ya(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(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(){this.searchRef.current.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),at()(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:lr(Ga(),Za)},{l:"Z2",n:"港澳",c:"",p:"",children:lr(Ga(),Xa)}]}createProvince(){return(tr(Ga(),"86")??[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Ja.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...Za,...Xa].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return t().createElement(E.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(E.Radio.Button,{value:"0"},d("qm.form.citySelectType.0")),t().createElement(E.Radio.Button,{value:"1"},d("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:l}=this.state;return("0"===l?Qa:Ja).map((l=>t().createElement("li",{key:l.value,className:le()({tag:!0,actived:l.value===e}),onClick:()=>this.scrollHandle(l.value.toString())},l.text)))}renderSelect(){const{value:e}=this.props;return t().createElement(E.Select,{size:"small",placeholder:d("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>((null==t?void 0:t.children)||"").toLowerCase().indexOf(e.toLowerCase())>=0,value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>t().createElement(E.Select.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:l}=this.state;return("0"===l?this.provinces:this.letterCities).map(((l,a)=>{var r;return t().createElement("div",{key:a},t().createElement("dt",{ref:e=>this[`${l.l}Ref`]=e},l.n,":"),t().createElement("dd",null,null===(r=l.children)||void 0===r?void 0:r.map((l=>t().createElement("li",{key:l.c,className:le()({actived:l.c===e}),onClick:()=>this.clickHadnle(l.c)},l.n)))))}))}render(){const{visible:e}=this.state,{value:l}=this.props,{options:a={},style:n={},placeholder:i=d("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:c,disabled:u}=this.props.option,p=ae("form-city-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=t().createElement("div",{className:"container",style:{...n}},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(l)))));return t().createElement(r.Consumer,null,(a=>{const r={[p]:!0,[`${p}--lg`]:"large"===(null==a?void 0:a.size),[`${p}--sm`]:"small"===(null==a?void 0:a.size)};return t().createElement(Aa(),{action:u?[]:["click"],popupVisible:!u&&e,popup:h,popupClassName:le()(r),popupStyle:{minWidth:m,...n},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Xt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(E.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,readOnly:c,disabled:u,value:this.createTextValue(l),onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}}))}))}}Ya(ar,"contextType",Pt);class rr extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(ar,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(n,l)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}Ya(rr,"contextType",Pt);const nr=rr;function ir(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const or=(e,t)=>{if(e[t])return Object.keys(e[t]).map((l=>({text:e[t][l],value:l,children:or(e,l)})))};class sr extends e.Component{constructor(e){super(e),ir(this,"searchRef",t().createRef()),ir(this,"prevText",void 0),ir(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),ir(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this.createTextValue(e)),this.handleVisibleChange(!1)}));const l=or(Ga(),"86")||[];this.state={results:l,visible:!1,values:[],tabs:[l.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:l}=this.props;t!==l&&this.state.values.join(",")!==(l??"")&&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(){this.searchRef.current.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var l,a;return null===(l=this.state.tabs[t])||void 0===l||null===(a=l.find((t=>t.value===e)))||void 0===a?void 0:a.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 l=this.state.tabs.slice(0,1);for(let a=0;a<t.length;a++){const r=zt(e,t[a]);if(r&&(0,z.xb)(r.children)){this.isFetch&&this.getStreetList(t[a]);break}Array.isArray(null==r?void 0:r.children)&&(l[a+1]=null==r?void 0:r.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:l})}async getStreetList(e){const{request:t={}}=this.props.option,{fetchApi:l,formatter:a=(e=>e),dataKey:r,valueKey:n="value",textKey:i="text"}=t;if(l)try{const t=await l(a({code:e}));if(200===t.code){const e=Array.isArray(t.data)?t.data:(0,z.U2)(t.data,r)??[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[i],value:e[n]})))]})))}}catch(e){}}renderTabs(){const{values:e}=this.state,l=this.state.tabs.map(((l,a)=>{var r;const n=(null===(r=l.find((t=>t.value===e[a])))||void 0===r?void 0:r.text)||`${d("qm.form.selectPlaceholder").replace("...","")}(${d("qm.form.regionSelectLabel")[a]})`;return t().createElement(E.Tabs.TabPane,{key:a.toString(),tab:n},t().createElement("div",{className:"region-box"},l.map((l=>t().createElement("span",{key:l.value,className:le()({"region-box__item":!0,actived:e.includes(l.value.toString())}),title:l.text,onClick:()=>{let{values:e}=this.state;e[a]=l.value.toString(),e=e.slice(0,a+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.leave-1:this.leave;if(a+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(a+1)}))}},l.text)))))}));return l.length?t().createElement(E.Tabs,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},l):t().createElement(ze,null)}render(){const{visible:e}=this.state,{value:l}=this.props,{options:a={},style:n={},placeholder:i=d("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:c,disabled:u}=this.props.option,p=ae("form-region-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=t().createElement("div",{className:"container",style:{...n}},this.renderTabs());let f=this.prevText;if(!e){const e=this.createTextValue(l);(""===e||e.split("/").every((e=>""!==e)))&&(f=e,this.prevText=f)}return t().createElement(r.Consumer,null,(l=>{const a={[p]:!0,[`${p}--lg`]:"large"===(null==l?void 0:l.size),[`${p}--sm`]:"small"===(null==l?void 0:l.size)};return t().createElement(Aa(),{action:u?[]:["click"],popupVisible:!u&&e,popup:h,popupClassName:le()(a),popupStyle:{minWidth:m,...n},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Xt,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement(E.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,readOnly:c,disabled:u,value:f,title:f,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&(0,z.Y3)((()=>this.initial()))}}))}))}}ir(sr,"contextType",Pt);class cr extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(sr,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(n,l)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}ir(cr,"contextType",Pt);const dr=cr,ur=e=>{const{$$form:l}=t().useContext(Pt),{value:a,onChange:r,onValuesChange:n}=e,{options:i={},upload:o={},style:s={},disabled:c}=e.option,{multiple:d=!0,maxCount:u=1,fileTypes:p,fileSize:m,onRemove:h}=i,{action:f,headers:g,params:b,withCredentials:y=!1,dataKey:v="",fieldAliasMap:x}=o,E="function"==typeof x?x():x||{};return t().createElement(en,{name:"file",action:f,multiple:d,headers:g,data:b,withCredentials:y,maxCount:u,fileTypes:p,fileSize:m,disabled:c||l.isOnlyShow,showUploadList:{showDownloadIcon:!0,downloadIcon:t().createElement(re.DownloadOutlined,null)},fileList:a,onChange:e=>{let{file:t,fileList:l}=e;(e=>{const t=e.map((e=>{var t,l;const a={};for(const t in E){var r,n;a[t]=(null===(r=e.response)||void 0===r||null===(n=r.data)||void 0===n?void 0:n[E[t]])||""}return{uid:e.uid,name:e.name,...a,url:e.url||(v?(0,z.U2)(null===(l=e.response)||void 0===l?void 0:l.data,v):null===(t=e.response)||void 0===t?void 0:t.data)||"",status:e.status}}));null==r||r(t),n(t.filter((e=>"done"===e.status&&e.url)))})(l)},onRemove:h})};class pr extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(ur,{option:this.props.option,onValuesChange:t=>{t.length&&(p(t),e.setViewValue(n,""))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(pr,"contextType",Pt);const mr=pr,hr=e=>{const{$$form:l}=t().useContext(Pt),{value:a,onChange:r,onValuesChange:n}=e,{options:i={},upload:o={},style:s={},disabled:c}=e.option,{multiple:d=!0,maxCount:u=1,fixedSize:p,quality:m,fileTypes:h,fileSize:f,onRemove:g}=i,{action:b,headers:y,params:v,withCredentials:x=!1,dataKey:E="",fieldAliasMap:C}=o,S="function"==typeof C?C():C||{};return t().createElement(sn,{name:"file",action:b,multiple:d,headers:y,data:v,withCredentials:x,maxCount:u,fixedSize:p,quality:m,fileTypes:h,fileSize:f,disabled:c||l.isOnlyShow,fileList:a,onChange:e=>{let{file:t,fileList:l}=e;(e=>{const t=e.map((e=>{var t,l;const a={};for(const t in S){var r,n;a[t]=(null===(r=e.response)||void 0===r||null===(n=r.data)||void 0===n?void 0:n[S[t]])||""}return{uid:e.uid,name:e.name,...a,url:e.url||(E?(0,z.U2)(null===(l=e.response)||void 0===l?void 0:l.data,E):null===(t=e.response)||void 0===t?void 0:t.data)||"",status:e.status}}));null==r||r(t),n(t.filter((e=>"done"===e.status&&e.url)))})(l)},onRemove:g})};class fr extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(hr,{option:this.props.option,onValuesChange:t=>{t.length&&(p(t),e.setViewValue(n,""))}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(fr,"contextType",Pt);const gr=fr,br=e=>{const{$$form:l}=t().useContext(Pt),{value:a,onChange:r,onValuesChange:n}=e,{options:i={},style:o={},placeholder:s=d("qm.form.inputPlaceholder"),readOnly:c,disabled:u}=e.option,{tinymceHeight:p}=i;return t().createElement(jr,{height:p,style:o,disabled:c||u||l.isOnlyShow,value:a,onChange:e=>{null==r||r(e),n(e)}})};class yr extends e.Component{render(){const{$$form:e}=this.context,{type:l,label:a,tooltip:r,fieldName:n,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,extra:c,validateTrigger:d,rules:u=[],onChange:p=z.ZT}=this.props.option;return t().createElement(E.Form.Item,{label:e.renderFormLabel(a),tooltip:r,hidden:i,labelCol:{flex:e.verticalLayout?"initial":(0,z.PM)(s)},required:e.getFormItemRequired(u)},t().createElement(E.Row,{wrap:!1,gutter:8},t().createElement(E.Col,{flex:"auto"},t().createElement(E.Form.Item,{name:n,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(a)}},t().createElement(br,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(n,t)}}))),c&&t().createElement(E.Col,{flex:(0,z.PM)(c.labelWidth||Wt)},e.renderFormItemExtra({fieldName:n,...c}))))}}!function(e,t,l){t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l}(yr,"contextType",Pt);const vr=yr;function xr(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Er extends e.Component{constructor(e){super(e),xr(this,"provide",{$$form:this}),xr(this,"_initialValues",void 0),xr(this,"_initialOthers",void 0),xr(this,"_initialExtras",void 0),xr(this,"wrapperRef",t().createRef()),xr(this,"formRef",t().createRef()),xr(this,"state",{formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:this.props.cols??4,collapse:!1}),xr(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 l=Math.floor(t/300);l=24%l==0?l:l-1,l=l<1?1:l,l=l>8?8:l,l!==this.state.flexCols&&this.setState({flexCols:l})})),xr(this,"resizeListenerHandle",(0,z.Ds)(this.resizeObserveHandler,10)),xr(this,"getFormItems",Rt()((e=>e.filter((e=>!e.noAuth&&!e.hidden))))),xr(this,"getFlattenItems",Rt()((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{(0,z.Kn)(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t}))),xr(this,"valuesChangeHandle",((e,t)=>{var l,a;null===(l=(a=this.props).onValuesChange)||void 0===l||l.call(a,e,this._initialValues)})),xr(this,"fieldsChangeHandle",((e,t)=>{var l,a;null===(l=(a=this.props).onFieldsChange)||void 0===l||l.call(a,e,t)})),xr(this,"finishHandle",(e=>{var t,l;null===(t=(l=this.props).onFinish)||void 0===t||t.call(l,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))})),xr(this,"finishFailedHandle",(e=>{var t,l;let{values:a,errorFields:r}=e;null===(t=(l=this.props).onFinishFailed)||void 0===t||t.call(l,r)})),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.getFormAuth(),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 showDividerCollapse(){return this.dividers.some((e=>!!e.collapse))}get showFilterCollapse(){const{isCollapse:e}=this.props;return e&&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(){Ft(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){qt(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&&h("QmForm","配置项 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)),l={};for(const a in e)t.includes(a)||(l[a]=e[a]);return Object.assign({},l)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>(0,z.Kn)(e.extra))).forEach((l=>{t[l.fieldName]=e[l.fieldName]??""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>(0,z.Kn)(e.collapse))).forEach((t=>{e[t.fieldName]=t.collapse.defaultExpand??!1})),Object.assign({},e)}getInitialValue(e,t){const{type:l,options:a}=e;return t=t??void 0,Zt.includes(l)&&(t=t??[]),"CHECKBOX"!==l&&"SWITCH"!==l||(t=t??(null==a?void 0:a.falseValue)??Yt),t}createFormValue(e){const t={};return this.flattenItems.forEach((l=>{t[l.fieldName]=this.getInitialValue(l,e[l.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]:"";const{viewData:l}=this.state;t!==l[e]&&this.setState((l=>({viewData:Object.assign({},l.viewData,{[e]:t})})))}getViewValue(e){return this.state.viewData[e]??""}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:l}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!l||setTimeout((()=>{var e;return null===(e=this[`${l}_Ref`])||void 0===e?void 0:e.focus()}))}getFormItemLabel(e){var t,l;if("string"==typeof e)return e;const{fieldName:a,options:r={}}=e,{itemList:n=[]}=r;if(!n.length)return h("QmForm",`fieldName 为 ${a} 的表单项的 \`itemList\` 配置有误`),"";const i=(null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([a])[a])??this._initialValues[a]??n[0].value;return(null===(l=n.find((e=>e.value===i)))||void 0===l?void 0:l.text)||""}getBlockDerivedItems(){const e=[];for(let t=0,l=this.dividers.length;t<l;t++){const l=this.formItems.findIndex((e=>e===this.dividers[t]));let a=this.formItems.findIndex((e=>e===this.dividers[t+1]));a=a>-1?a:void 0,e.push(this.formItems.slice(l,a).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay(e){let{type:t,fieldName:l}=e;if("DIVIDER"===t)return!0;const a=this.getBlockDerivedItems();for(let e=0,t=a.length;e<t;e++){var r;const t=a[e],n=this.dividers.find((e=>e.fieldName===t[0].fieldName)),i=(null==n||null===(r=n.collapse)||void 0===r?void 0:r.showLimit)??t.length-1;for(let e=1;e<t.length;e++)if(t[e].fieldName===l&&e>i)return this.state.expand[t[0].fieldName]}return!0}formatFormValue(e){for(const t in e){const l=e[t];if(Vt(l)&&(e[t]=""),Array.isArray(l)&&l.forEach(((l,a)=>{Vt(l)&&(e[t][a]="")})),t.includes("|")&&Array.isArray(l)){const[a,r]=t.split("|");e[a]=l[0]??"",e[r]=l[1]??""}}if(this.isFilterType)for(const t in e)(0,z.xb)(e[t])&&(e[t]=void 0);return e}createFormAuth(){if(!this.props.authCode)return;const e=(0,z.Y6)(this.props.authCode);if(e){var t,l;const{fieldList:a=[]}=e,r=this.props.items.map((e=>{const{fieldName:t}=e,l=a.find((e=>e.dataIndex===t));if(l){const{visible:t=1,disabled:a,secretName:r}=l;t||(e.noAuth=!0),a&&(e.disabled=!0),r&&(e.options?e.options.secretType=r:e.options={secretType:r})}return e}));null===(t=(l=this.props).fieldsChange)||void 0===t||t.call(l,r)}}async getFormAuth(){var e;if(null===(e=this.props.authConfig)||void 0===e||!e.fetch)return;const{api:t,params:l,dataKey:a}=this.props.authConfig.fetch;try{const e=await t(l);if(200===e.code){var r,n;const t=Array.isArray(e.data)?e.data:(0,z.U2)(e.data,a)??[],l=!!(0,z.U2)(e.data,"reverse"),i=this.props.items.map((e=>{const{fieldName:a}=e;return(l?!t.includes(a):t.includes(a))&&(e.noAuth=!0),e}));null===(r=(n=this.props).fieldsChange)||void 0===r||r.call(n,i)}}catch(e){}}INPUT(e){return t().createElement(dl,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return t().createElement(hl,{option:e})}INPUT_NUMBER(e){return t().createElement(yl,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return t().createElement(Cl,{option:e})}SEARCH_HELPER(e){return t().createElement(_l,{option:e})}MULTIPLE_SEARCH_HELPER(e){return t().createElement(Al,{option:e})}TREE_TABLE_HELPER(e){return t().createElement(Dl,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return t().createElement(Kl,{option:e})}CHECKBOX(e){return t().createElement(zl,{option:e})}MULTIPLE_CHECKBOX(e){return t().createElement(Wl,{option:e})}RATE(e){return t().createElement(Yl,{option:e})}RADIO(e){return t().createElement(Ql,{option:e})}SWITCH(e){return t().createElement(ta,{option:e})}TEXT_AREA(e){return t().createElement(aa,{option:e})}DATE(e){return t().createElement(ia,{option:e})}RANGE_DATE(e){return t().createElement(ua,{option:e})}TIME(e){return t().createElement(ha,{option:e})}RANGE_TIME(e){return t().createElement(ba,{option:e})}SELECT(e){return t().createElement(Pa,{option:e})}MULTIPLE_SELECT(e){return t().createElement(Pa,{option:e,multiple:!0})}IMMEDIATE(e){return t().createElement(La,{option:e})}DIVIDER(e){return t().createElement(Ha,{option:e})}TREE_SELECT(e){return t().createElement(Va,{option:e})}MULTIPLE_TREE_SELECT(e){return t().createElement(Va,{option:e,multiple:!0})}CASCADER(e){return t().createElement(Ba,{option:e})}MULTIPLE_CASCADER(e){return t().createElement(Ba,{option:e,multiple:!0})}CITY_SELECT(e){return t().createElement(nr,{option:e})}REGION_SELECT(e){return t().createElement(dr,{option:e})}UPLOAD_FILE(e){return t().createElement(mr,{option:e})}UPLOAD_IMG(e){return t().createElement(gr,{option:e})}TINYMCE(e){return t().createElement(vr,{option:e})}renderFormLabel(e){if(!(0,z.Kn)(e))return e;const{type:l,fieldName:a,options:r={},disabled:n,onChange:i=z.ZT}=e,{itemList:o=[]}=r;return t().createElement(E.Form.Item,{name:a,noStyle:!0},"SELECT"===l&&t().createElement(E.Select,{placeholder:"",disabled:n,style:{width:"calc(100% - 8px)"},onChange:e=>i(e,o.find((t=>t.value===e)).text)},o.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text)))))}renderFormItemExtra(e){const{fieldName:l,isTooltip:a,style:r={}}=e,{extra:n}=this.state;return a?t().createElement(E.Tooltip,{className:le()("extra-tooltip"),title:n[l]},t().createElement(re.ExclamationCircleOutlined,null)):t().createElement("div",{className:le()("extra-text"),title:n[l],style:r},t().createElement("span",{className:"extra-overflow-cut"},n[l]))}renderFormItem(e){const{label:l,fieldName:a,labelWidth:r=this.props.labelWidth,rules:n=[],style:i={},render:o}=e;return(0,z.xb)(this.state.formData)?null:t().createElement(E.Form.Item,{label:l,name:a,rules:n,style:{width:"100%",...i},labelCol:{flex:(0,z.PM)(r)}},null==o?void 0:o(e,this))}createFormItem(e){return(0,z.mf)(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(h("QmForm",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:l,defaultRows:a,isFieldsDefine:r}=this.props,n=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:l=0}=e;for(let e=0;e<t;e++)n.push({});n.push(e);for(let e=0;e<l;e++)n.push({})}));const i=24/e,o=[],s=n.reduce(((e,t)=>{const{selfCol:l=1}=t,a=e+l;return o.push(a),a}),0),c=a>Math.ceil(s/e)?Math.ceil(s/e):a,d=[],u=n.map(((l,a)=>{let{selfCol:r=1}=l;const{type:n,fieldName:s}=l;r=r>=24||"DIVIDER"===n||"TINYMCE"===n?e:r;const u=!(!this.state.collapse&&this.showFilterCollapse)||o[a]<c*e,p=!this.showDividerCollapse||this.getFormItemDisplay(l);return u&&d.push(o[a]),t().createElement(E.Col,{key:s??a,span:r*i,style:this.isFilterType?{display:!this.showFilterCollapse||u?"block":"none"}:{display:p?"block":"none"}},n?this.createFormItem((0,Nt.cloneDeep)(l)):null)}));return r&&"default"===l&&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:l,collapse:a}=this.state,{isSearchBtn:r,isFieldsDefine:n=!0}=this.props;if(!this.isFilterType)return null;const i=24/l,o=l-e%l-1;return r?t().createElement(E.Col,{key:"-",span:i,offset:o*i,style:{textAlign:"right"}},t().createElement(E.Space,{style:{marginBottom:12}},t().createElement(G,{type:"primary",size:this.$size,icon:t().createElement(re.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},d("qm.form.search")),t().createElement(G,{size:this.$size,icon:t().createElement(re.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},d("qm.form.reset")),n?this.createFieldsDefine():null,this.showFilterCollapse&&t().createElement("a",{onClick:()=>this.setExpandHandle(!a)},a?t().createElement(re.UpOutlined,null):t().createElement(re.DownOutlined,null)," ",d(a?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:l,isSubmitBtn:a}=this.props;if(this.isFilterType)return null;const r=24/e;return a&&"default"===l?t().createElement(E.Row,{gutter:0},t().createElement(E.Col,{key:"-",span:r},t().createElement(E.Form.Item,null,t().createElement(E.Space,{style:{marginBottom:12}},t().createElement(G,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},d("qm.form.save")),t().createElement(G,{size:this.$size,onClick:()=>this.RESET_FORM()},d("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:l,fieldsChange:a}=this.props;return t().createElement(il,{uniqueKey:e,items:l,fieldsChange:a})}setExpandHandle(e){this.setState({collapse:e},(()=>{var e,t;null===(e=(t=this.props).onCollapse)||void 0===e||e.call(t,this.state.collapse)}))}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}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.formRef.current.validateFields();return[null,Object.assign({},this.get_fields_other(),this.formatFormValue(e))]}catch({errorFields:e}){return this.formRef.current.scrollToField(e[0].name),[e,null]}}SET_FIELDS_EXTRA(e){this.setState((t=>({extra:Object.assign({},t.extra,e)})))}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)}SUBMIT_FORM(){this.formRef.current.submit()}RESET_FORM(){var e,t;this.formRef.current.resetFields(),this.setState({other:this._initialOthers}),this.setState({extra:this._initialExtras}),null===(e=(t=this.props).onReset)||void 0===e||e.call(t)}render(){const{className:e,style:l,layout:a,labelWidth:r,labelAlign:n,customClass:i}=this.props,o=ae("form"),s={required:"${label}"+d("qm.form.requiredTips")},c={[o]:!0,[`${o}--lg`]:"large"===this.$size,[`${o}--sm`]:"small"===this.$size,[`${o}__only-show`]:this.isOnlyShow,[i]:!!i};return t().createElement("div",{ref:this.wrapperRef,className:le()(c,e),style:l},t().createElement(E.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:a,labelAlign:n,colon:!1,labelCol:{flex:this.verticalLayout?"initial":(0,z.PM)(r)},scrollToFirstError:!0,validateMessages:s,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},t().createElement(Pt.Provider,{value:this.provide},t().createElement(E.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}xr(Er,"contextType",r),xr(Er,"propTypes",tl),xr(Er,"defaultProps",ll);const Cr=Er,Sr={onActivate:l.func,onAddUndo:l.func,onBeforeAddUndo:l.func,onBeforeExecCommand:l.func,onBeforeGetContent:l.func,onBeforeRenderUI:l.func,onBeforeSetContent:l.func,onBeforePaste:l.func,onBlur:l.func,onChange:l.func,onClearUndos:l.func,onClick:l.func,onContextMenu:l.func,onCopy:l.func,onCut:l.func,onDblclick:l.func,onDeactivate:l.func,onDirty:l.func,onDrag:l.func,onDragDrop:l.func,onDragEnd:l.func,onDragGesture:l.func,onDragOver:l.func,onDrop:l.func,onExecCommand:l.func,onFocus:l.func,onFocusIn:l.func,onFocusOut:l.func,onGetContent:l.func,onHide:l.func,onInit:l.func,onKeyDown:l.func,onKeyPress:l.func,onKeyUp:l.func,onLoadContent:l.func,onMouseDown:l.func,onMouseEnter:l.func,onMouseLeave:l.func,onMouseMove:l.func,onMouseOut:l.func,onMouseOver:l.func,onMouseUp:l.func,onNodeChange:l.func,onObjectResizeStart:l.func,onObjectResized:l.func,onObjectSelected:l.func,onPaste:l.func,onPostProcess:l.func,onPostRender:l.func,onPreProcess:l.func,onProgressState:l.func,onRedo:l.func,onRemove:l.func,onReset:l.func,onSaveContent:l.func,onSelectionChange:l.func,onSetAttrib:l.func,onSetContent:l.func,onShow:l.func,onSubmit:l.func,onUndo:l.func,onVisualAid:l.func},wr={apiKey:l.string,id:l.string,inline:l.bool,init:l.object,initialValue:l.string,onEditorChange:l.func,outputFormat:l.oneOf(["html","text"]),value:l.string,tagName:l.string,cloudChannel:l.string,plugins:l.oneOfType([l.string,l.array]),toolbar:l.oneOfType([l.string,l.array]),disabled:l.bool,textareaName:l.string,tinymceScriptSrc:l.string,scriptLoading:l.shape({async:l.bool,defer:l.bool,delay:l.number}),...Sr},Tr=e=>"function"==typeof e,Ir=e=>e in Sr,Nr=e=>e.substr(2),_r=(e,t,l,a,r)=>((t,l,a,r,n,i,o)=>{const s=Object.keys(n).filter(Ir),c=Object.keys(i).filter(Ir),d=s.filter((e=>void 0===i[e])),u=c.filter((e=>void 0===n[e]));d.forEach((e=>{const t=Nr(e),l=o[t];a(t,l),delete o[t]})),u.forEach((a=>{const r=((t,l)=>a=>{var r;return null===(r=t(l))||void 0===r?void 0:r(a,e)})(t,a),n=Nr(a);o[n]=r,l(n,r)}))})(r,e.on.bind(e),e.off.bind(e),0,t,l,a);let Rr=0;const Pr=e=>{const t=Date.now(),l=Math.floor(1e9*Math.random());return Rr++,e+"_"+l+Rr+String(t)},Or=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),Ar=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),kr=(e,t)=>Ar(e).concat(Ar(t)),Fr=e=>{let t=e,l=e.parentNode;for(;null!=l;)t=l,l=t.parentNode;return t===e.ownerDocument},qr=()=>({listeners:[],scriptId:Pr("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),Lr=(()=>{let e=qr();return{load:(t,l,a,r,n,i)=>{const o=()=>((t,l,a,r,n,i)=>{const o=l.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.id=t,o.src=a,o.async=r,o.defer=n;const s=()=>{o.removeEventListener("load",s),e.listeners.forEach((e=>e())),e.scriptLoaded=!0};o.addEventListener("load",s),l.head&&l.head.appendChild(o)})(e.scriptId,t,l,a,r);e.scriptLoaded?i():(e.listeners.push(i),e.scriptLoading||(e.scriptLoading=!0,n>0?setTimeout(o,n):o()))},reinitialize:()=>{e=qr()}}})(),Dr=()=>{const e="undefined"!=typeof window?window:__webpack_require__.g;return e&&e.tinymce?e.tinymce:null};function Hr(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const $r=()=>{var e,t,l;return null!==(e=Dr())&&void 0!==e&&null!==(t=e.Env)&&void 0!==t&&null!==(l=t.browser)&&void 0!==l&&l.isIE()?"change keyup compositionend setcontent":"change input compositionend setcontent"},Mr=()=>window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange";class Kr extends e.Component{constructor(t){var l,a;super(t),l=this,Hr(this,"editor",void 0),Hr(this,"id",void 0),Hr(this,"elementRef",void 0),Hr(this,"inline",void 0),Hr(this,"currentContent",void 0),Hr(this,"boundHandlers",void 0),Hr(this,"rollbackTimer",void 0),Hr(this,"valueCursor",void 0),Hr(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})),Hr(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){}})),Hr(this,"handleBeforeInputSpecial",(e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)})),Hr(this,"handleEditorChange",(e=>{const t=this.editor;if(t&&t.initialized){const e=t.getContent();if(void 0!==this.props.value&&this.props.value!==e&&(this.rollbackTimer||(this.rollbackTimer=window.setTimeout(this.rollbackChange,200))),e!==this.currentContent&&(this.currentContent=e,Tr(this.props.onEditorChange))){var l,a;const r=this.props.outputFormat,n="html"===r?e:t.getContent({format:r});null===(l=(a=this.props).onEditorChange)||void 0===l||l.call(a,n,t)}}})),Hr(this,"handleEditorChangeSpecial",(e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)})),Hr(this,"initialise",(function(){var e,t;let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const r=l.elementRef.current;if(!r)return;if(!Fr(r)){if(0===a)setTimeout((()=>l.initialise(1)),1);else{if(!(a<11))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>l.initialise(a+1)),100)}return}const n=Dr();if(!n)throw new Error("tinymce should have been loaded into global scope");const i={...l.props.init,selector:void 0,target:r,readonly:l.props.disabled,inline:l.inline,plugins:kr(null===(e=l.props.init)||void 0===e?void 0:e.plugins,l.props.plugins),toolbar:l.props.toolbar??(null===(t=l.props.init)||void 0===t?void 0:t.toolbar),setup:e=>{l.editor=e,l.bindHandlers({}),l.inline&&!Or(r)&&e.once("PostRender",(t=>{e.setContent(l.getInitialValue(),{no_events:!0})})),l.props.init&&Tr(l.props.init.setup)&&l.props.init.setup(e)},init_instance_callback:e=>{const t=l.getInitialValue();l.currentContent=l.currentContent??e.getContent(),l.currentContent!==t&&(l.currentContent=t,e.setContent(t),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const a=l.props.disabled??!1;e.setMode(a?"readonly":"design"),l.props.init&&Tr(l.props.init.init_instance_callback)&&l.props.init.init_instance_callback(e)}};l.inline||(r.style.visibility=""),Or(r)&&(r.value=l.getInitialValue()),n.init(i)})),this.id=this.props.id||Pr("tiny-react"),this.elementRef=e.createRef(),this.inline=this.props.inline??(null===(a=this.props.init)||void 0===a?void 0:a.inline)??!1,this.boundHandlers={}}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 l=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const a of[t,l])if(a)try{e.selection.moveToBookmark(a),this.valueCursor=a;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=this.props.disabled??!1;this.editor.setMode(e?"readonly":"design")}}}componentDidMount(){if(null!==Dr())this.initialise();else if(this.elementRef.current&&this.elementRef.current.ownerDocument){var e,t,l;Lr.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===(l=this.props.scriptLoading)||void 0===l?void 0:l.delay)??0,this.initialise)}}componentWillUnmount(){const e=this.editor;e&&(e.off($r(),this.handleEditorChange),e.off(Mr(),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()}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){_r(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,l=t(e),a=t(this.props);!l&&a?(this.editor.on($r(),this.handleEditorChange),this.editor.on(Mr(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):l&&!a&&(this.editor.off($r(),this.handleEditorChange),this.editor.off(Mr(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}function Vr(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}var Ur;Hr(Kr,"propTypes",wr),Hr(Kr,"defaultProps",{cloudChannel:"5"}),function(e){e["zh-cn"]="zh_CN",e.en="en"}(Ur||(Ur={}));class zr extends e.Component{render(){var e;const{size:l,className:a,style:r,height:n,tinymceScriptSrc:i,plugins:o,toolbar:s,disabled:c,value:d,onChange:u=z.ZT}=this.props,p=this.context.global,m=this.context.locale,h=l||this.context.size||"",f=ae("tinymce"),g={[f]:!0,[`${f}--lg`]:"large"===h,[`${f}--sm`]:"small"===h},b={init:{height:n,plugins:o,toolbar:s,menubar:"file edit view insert format tools table help",language:Ur[m],images_upload_handler:(e,t,l)=>{(new FormData).append("file",e.blob(),e.filename()),t(`data:image/jpeg;base64,${e.base64()}`)}},value:d,disabled:c,tinymceScriptSrc:i||(null==p||null===(e=p.tinymce)||void 0===e?void 0:e.scriptSrc)||void 0,onEditorChange:(e,t)=>{u(t.getContent())}};return t().createElement("div",{className:le()(g,a),style:r},t().createElement(Kr,b))}}Vr(zr,"contextType",r),Vr(zr,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmTinymce","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},height:(e,t,l)=>{if(!(0,z.hj)(e[t])&&!f(e[t]))return m("QmTinymce","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")}}),Vr(zr,"defaultProps",{height:400,plugins:"preview importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons",toolbar:"undo redo | formatselect | bold italic underline strikethrough | fontfamily fontsize blocks | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview print | lists image media table template link unlink anchor codesample code | ltr rtl"});const jr=zr,Br=require("cropperjs");var Wr=__webpack_require__.n(Br);function Gr(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Yr extends e.Component{constructor(){super(...arguments),Gr(this,"imgRef",t().createRef()),Gr(this,"cropper",void 0)}componentDidMount(){const{className:e,style:t,src:l,alt:a,imgStyle:r,...n}=this.props,i={};for(const e in n)void 0!==this.props[e]&&(i[e]=this.props[e]);this.cropper=new(Wr())(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:l,src:a,alt:r,imgStyle:n}=this.props,i={[ae("cropper")]:!0};return t().createElement("div",{className:le()(i,e),style:l},t().createElement("img",{ref:this.imgRef,src:a,alt:r,style:{maxWidth:"100%",...n}}))}}Gr(Yr,"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 Zr=Yr;function Xr(){return Xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Xr.apply(this,arguments)}function Qr(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Jr extends e.Component{constructor(){super(...arguments),Qr(this,"state",{loading:!1}),Qr(this,"beforeUpload",((e,t)=>new Promise((async(l,a)=>{const{fileTypes:r=[],fileSize:n,beforeUpload:i}=this.props,o=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),s=!n||e.size/1024/1024<n,c=o&&s;if(o||E.message.warning(d("qm.upload.tooltip",{type:r.join(",")})),s||E.message.warning(d("qm.upload.sizeLimit",{size:n})),!c)return c||E.Upload.LIST_IGNORE;if(i){const r=i(e,t);if(!0===r)return l(e);if(!1===r)return a("not upload");if(r&&"function"==typeof r.then)try{l(await r)}catch(e){a(e)}}l(e)}))))}async downloadFile(e,t){const l=await Ge()({url:e,responseType:"blob"}),a=l.data,r=l.headers["content-disposition"],n=t||(r?r.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Ye(a,n)}render(){const{loading:e}=this.state,{disabled:l,onChange:a}=this.props,r=ae("upload-file");return t().createElement(E.Upload,Xr({className:r},this.props,{beforeUpload:this.beforeUpload,onChange:e=>{null==a||a(e),this.setState({loading:!1})},onDownload:async e=>{try{e.url&&await this.downloadFile(e.url,e.name)}catch(e){E.message.error(d("qm.download.error"))}}}),this.props.children?this.props.children:t().createElement(E.Button,{icon:t().createElement(re.UploadOutlined,null),loading:e,disabled:l},d("qm.upload.text")))}}Qr(Jr,"defaultProps",{name:"file",multiple:!0,showUploadList:{showDownloadIcon:!0,downloadIcon:t().createElement(re.DownloadOutlined,null)}});const en=Jr;function tn(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class ln extends e.Component{constructor(){super(...arguments),tn(this,"cropperRef",t().createRef()),tn(this,"beforeUploadRef",void 0),tn(this,"fileRef",void 0),tn(this,"resolveRef",void 0),tn(this,"rejectRef",void 0),tn(this,"state",{src:""}),tn(this,"confirmHandle",(async()=>{const{quality:e}=this.props,{type:t,name:l,uid:a}=this.fileRef;this.cropperRef.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===t?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((async e=>{let r=new File([e],l,{type:t});r.uid=a;const{fileTypes:n=[],fileSize:i}=this.props;if(n.length&&!n.includes(r.name.slice(r.name.lastIndexOf(".")+1).toLowerCase()))return E.message.warning(d("qm.upload.tooltip",{type:n.join(",")})),this.rejectRef("file type is error");if("function"!=typeof this.beforeUploadRef)return this.resolveRef(r);const o=this.beforeUploadRef(r,[r]);if("boolean"==typeof o||o){if(!0===o)return this.resolveRef(r);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||(r=e),this.resolveRef(r)}catch(e){this.rejectRef(e)}}else h("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}),t,e),await(0,z._v)(100),this.onClose()})),tn(this,"onOk",(()=>{this.confirmHandle()})),tn(this,"onClose",(()=>{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:l}=this.props,a=Array.isArray(e)?e[0]:e;if(!a)return null;const{beforeUpload:r,...n}=a.props;return this.beforeUploadRef=r,t().createElement(a.type,{...n,beforeUpload:(e,t)=>new Promise((async(a,r)=>{if(l&&!await l(e,t))return void r();this.fileRef=e,this.resolveRef=a,this.rejectRef=r;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(Zr,{ref:this.cropperRef,"aspect-ratio":e?e[0]/e[1]:e,src:this.state.src,"drag-mode":"move",preview:".preview"})),t().createElement("div",{className:"actions"},t().createElement(E.Space,{size:"small"},t().createElement(E.Button,{type:"primary",size:"middle",icon:t().createElement(re.ZoomInOutlined,null),onClick:()=>this.scaleHandle(.2)},d("qm.uploadCropper.zoomIn")),t().createElement(E.Button,{type:"primary",size:"middle",icon:t().createElement(re.ZoomOutOutlined,null),onClick:()=>this.scaleHandle(-.2)},d("qm.uploadCropper.zoomOut")),t().createElement(E.Button,{type:"primary",size:"middle",icon:t().createElement(re.RotateRightOutlined,null),onClick:()=>this.rotateHandle(90)},d("qm.uploadCropper.rotatePlus")),t().createElement(E.Button,{type:"primary",size:"middle",icon:t().createElement(re.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,l=ae("cropper-preview");return t().createElement(t().Fragment,null,this.renderUpload(),e&&t().createElement(E.Modal,{visible:!0,wrapClassName:le()(l),title:d("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:this.onOk,onCancel:this.onClose,maskClosable:!1,destroyOnClose:!0},this.renderCropper()))}}tn(ln,"contextType",r);const an=ln;function rn(){return rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},rn.apply(this,arguments)}function nn(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class on extends e.Component{constructor(){super(...arguments),nn(this,"state",{previewVisible:!1,previewImage:"",previewTitle:""}),nn(this,"handlePreview",(async e=>{e.url||e.preview||(e.preview=await(e=>new Promise(((t,l)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>t(a.result),a.onerror=e=>l(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:l,previewTitle:a}=this.state,{fixedSize:r,quality:n,fileTypes:i,fileSize:o,beforeCrop:s}=this.props,c=ae("upload-img"),u=t().createElement("div",null,t().createElement(re.PlusOutlined,null),t().createElement("div",{style:{marginTop:8}},d("qm.uploadCropper.dragableText")));return t().createElement(t().Fragment,null,t().createElement(an,{fixedSize:r,quality:n,fileTypes:i,fileSize:o,beforeCrop:s},t().createElement(E.Upload,rn({className:c},this.props,{onPreview:this.handlePreview}),this.showUploadButton?u:null)),t().createElement(E.Modal,{visible:e,title:a,bodyStyle:{padding:10},footer:null,onCancel:()=>{this.setState({previewVisible:!1})}},t().createElement("img",{alt:"",style:{width:"100%"},src:l})))}}nn(on,"defaultProps",{name:"file",multiple:!0,accept:"image/*",listType:"picture-card",quality:1});const sn=on,cn=(0,e.createContext)(void 0),dn={dataIndex:a().string.isRequired,title:a().string.isRequired,description:a().string,colSpan:a().number,width:a().number,fixed:a().oneOf(["left","right"]),align:a().oneOf(["left","center","right"]),printFixed:a().bool,hidden:a().bool,noAuth:a().bool,ellipsis:a().bool,className:a().string,children:a().array,sorter:a().oneOfType([a().bool,a().func]),filter:a().shape({type:a().oneOf(["text","textarea","checkbox","radio","number","date"]).isRequired,items:a().arrayOf(a().shape({text:a().string,value:a().oneOfType([a().string,a().number])}))}),precision:a().number,formatType:a().oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:a().bool,canCopy:a().bool,editRender:a().func,dictItems:a().arrayOf(a().shape({text:a().string,value:a().oneOfType([a().string,a().number])})),summation:a().shape({sumBySelection:a().bool,displayWhenNotSelect:a().bool,dataKey:a().string,unit:a().string,render:a().func}),groupSummary:a().shape({dataKey:a().string,unit:a().string,render:a().func}),headRender:a().func,render:a().func},un=(a().arrayOf(a().shape(dn)).isRequired,a().func,a().array,a().oneOfType([a().string,a().func]).isRequired,a().bool,a().bool,a().shape({api:a().func.isRequired,params:a().object.isRequired,beforeFetch:a().func,afterFetch:a().func,stopToFirst:a().bool,dataKey:a().string,callback:a().func}),a().bool,a().bool,a().string,a().string,a().string,a().bool,a().bool,a().oneOfType([a().object,a().func]),a().oneOfType([a().object,a().func]),a().array,a().func,a().bool,a().bool,a().shape({type:a().oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:a().array,selectedRowKeys:a().array,hideSelectAll:a().bool,checkStrictly:a().bool,filterable:a().bool,selectByClickRow:a().bool,selectFirstRowOnChange:a().bool,clearableAfterFetched:a().bool,selectAllOnCurrentPage:a().bool,fetchSelectedRows:a().shape({api:a().func.isRequired,params:a().object,dataKey:a().string}),fetchAllRowKeys:a().shape({api:a().func.isRequired,params:a().object,dataKey:a().string}),disabled:a().func,onChange:a().func,onSelect:a().func,onSelectAll:a().func}),a().shape({currentRowKey:a().oneOfType([a().number,a().string]),disabled:a().func,onChange:a().func}),a().shape({virtual:a().bool}),a().shape({defaultExpandAllRows:a().bool,defaultExpandedRowKeys:a().array,expandedRowKeys:a().array,hideExpandAll:a().bool,rowExpandable:a().func,expandedRowClassName:a().string,expandedRowRender:a().func,onExpand:a().func,onChange:a().func}),a().shape({groupItems:a().arrayOf(a().shape({dataIndex:a().string.isRequired,titleIndex:a().string,color:a().string,backgroundColor:a().string})),fetch:a().shape({api:a().func.isRequired,params:a().object,dataKey:a().string}),onChange:a().func}),a().func,a().bool,a().bool,a().bool,a().bool,a().shape({current:a().number,pageSize:a().number,pageSizeOptions:a().array,showSizeChanger:a().bool,showQuickJumper:a().bool}),a().shape({fileName:a().string,fetch:a().shape({api:a().func.isRequired,params:a().object}),cellStyle:a().bool}),a().shape({showLogo:a().bool}),a().shape({fetch:a().shape({api:a().func.isRequired,params:a().object,columnDataKey:a().string,exportDataKey:a().string,importDataKey:a().string,printDataKey:a().string})}),a().oneOf(["left","right"]),a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().bool,a().func,a().func,a().func,a().func,a().func,a().func,a().func,a().func,a().func,10),pn="1",mn="0",hn="YYYY-MM-DD",fn="YYYY-MM-DD HH:mm:ss",gn="HH:mm:ss",bn="YYYYMMDDHHmmss",yn={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 vn;!function(e){e.left="flex-start",e.right="flex-end"}(vn||(vn={}));let xn=[];const En={getFocusInstance:function(){return xn[0]??null},getInstance:function(e){return xn.find((t=>t.id===e))??null},focus:function(e){const t=this.getInstance(e);t&&0!==xn.findIndex((e=>e===t))&&(this.deregister(e),xn=[t,...xn])},register:function(e,t){e&&t&&(null!==this.getInstance(e)&&this.deregister(e),xn=[{id:e,vm:t},...xn])},deregister:function(e){e&&(xn=xn.filter((t=>t.id!==e)))}};var Cn=__webpack_require__(353);function Sn(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}const wn=class{constructor(){Sn(this,"state",{required:[],validate:[],inserted:[],updated:[],removed:[]}),Sn(this,"addToRequired",(e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)})),Sn(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)})),Sn(this,"addToValidate",(e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)})),Sn(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)})),Sn(this,"addToInserted",(e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)})),Sn(this,"removeFromInserted",(e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)})),Sn(this,"addToUpdated",(e=>{-1===this.state.updated.findIndex((t=>t===e))&&this.state.updated.push(e)})),Sn(this,"removeFromUpdated",(e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)})),Sn(this,"addToRemoved",(e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)})),Sn(this,"removeFromRemoved",(e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)})),Sn(this,"clearAllLog",(()=>{this.state.required=[],this.state.validate=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]})),Sn(this,"destroy",(()=>{for(const e in this)this[e]=null}))}},Tn={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 In;const Nn=()=>{var e;if(Ee.Z)return 0;if(void 0!==In)return In;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 l=t.offsetWidth;t.style.overflow="scroll";const a=document.createElement("div");a.style.width="100%",t.appendChild(a);const r=a.offsetWidth;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),In=l-r,In},_n=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=_n(e.children)),e))),Rn=(e,l)=>{const{fetch:a,columns:r,height:n,minHeight:i,maxHeight:o,border:s=!0,rowSelection:c,summation:u,expandable:p,webPagination:m,scrollPagination:h,dragMergeCell:f,showSuperSearch:g,showFastSearch:b,showTableImport:y,showClipboard:v,showSelectCollection:x,footRender:E}=e,{tableRef:C,tableFullData:S,tableData:w,sorter:T,filters:I,superFilters:N,pagination:_}=l,{selectionRows:R,summaries:P}=C.current,O=t().useMemo((()=>!(null==a||!a.api)),[null==a?void 0:a.api]),A=t().useMemo((()=>!O&&!!m),[O,m]),k=t().useMemo((()=>O&&!!h),[O,h]),F=t().useMemo((()=>(O||A)&&!k),[O,A,k]),q=t().useMemo((()=>!!(n||i||o)),[n,i,o]),L=t().useMemo((()=>((e,t,l)=>{const a=_n(e),r=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:Tn.selectionColumn,title:"radio"===t?d("qm.table.config.selectionText"):"",width:Tn.selectionColumnWidth,fixed:"left",type:t}})(t),n=null!=(i=l)&&i.expandedRowRender?{dataIndex:Tn.expandableColumn,title:"",width:Tn.selectionColumnWidth,fixed:"left",type:"expand"}:null;var i;return r&&a.unshift(r),n&&a.unshift(n),(0,Cn.J1)(a)})(r,c,p)),[r,c,p]),D=t().useMemo((()=>(0,Cn.HG)(L)),[L]),H=t().useMemo((()=>D.filter((e=>"function"==typeof e.editRender))),[D]),$=t().useMemo((()=>D.filter((e=>!!e.summation))),[D]),M=t().useMemo((()=>D.filter((e=>"left"===e.fixed))),[D]),K=t().useMemo((()=>D.filter((e=>"right"===e.fixed))),[D]),V=t().useMemo((()=>{const e=D.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn].includes(e.dataIndex)));return e.length?e[0].dataIndex:""}),[D]),U=t().useMemo((()=>$.length>0),[$]),z=t().useMemo((()=>!!E||U),[E,U]),j=t().useMemo((()=>(0,Cn.vo)(L).length>1),[L]),B=t().useMemo((()=>s||j),[s,j]),W=t().useMemo((()=>D.some((e=>e.sorter))),[D]),G=t().useMemo((()=>D.some((e=>e.filter))),[D]),Y=t().useMemo((()=>$.some((e=>!!e.summation.dataKey))),[$]),Z=t().useMemo((()=>!O&&!!y),[O,y]),X=t().useMemo((()=>!!v&&H.length>0),[v,H]),Q=t().useMemo((()=>!!x&&"checkbox"===(null==c?void 0:c.type)),[x,c]),J=t().useMemo((()=>!!g&&G),[g,G]),ee=t().useMemo((()=>!O&&!!b&&G),[O,b,G]),te=t().useMemo((()=>D.some((e=>!!e.groupSummary))),[D]),le=t().useMemo((()=>{var e;return!(null==u||null===(e=u.groupItems)||void 0===e||!e.length)}),[u]),ae=t().useMemo((()=>!!f&&!O&&!m),[f,O,m]),re=t().useMemo((()=>S.some((e=>Array.isArray(e.children)&&e.children.length))),[S]),ne=t().useMemo((()=>!w.length),[w]),ie=t().useMemo((()=>(()=>{const e={};return $.forEach((t=>{const{dataIndex:l,precision:a,summation:r}=t,{sumBySelection:n,displayWhenNotSelect:i,unit:o}=r,s=le?(0,Cn.SX)(S):S,c=!R.length&&!!i;let d=(!n||c?s:R).reduce(((e,t)=>{if(null!=t&&t[Tn.summaryIgnore])return e;const a=Number((0,Cn.C_)(t,l));return Number.isNaN(a)?e:e+a}),0);!Object.keys(P).includes(l)||n&&!c||(d=Number((0,Cn.C_)(P,l))),(0,Cn.dN)(e,l,d);let u=a>=0?d.toFixed(a):d.toString();u=(0,Cn.uf)(u),(0,Cn.dN)(e,`${l}_text`,o?`${u} ${o}`:u)})),[e]})()),[S,R,P]),oe=t().useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))($)),[$]),se=t().useMemo((()=>{const e=(0,Cn.W2)(T),t=((e,t)=>{const l=[];if(Object.keys(e).length)for(const t in e){const[a,r]=Tn.showFilterType?t.split("|"):[t,""],n=e[t];Object.keys(n).forEach((e=>{l.push({type:r,bracketLeft:"",fieldName:a,expression:e,value:n[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{l.push({type:Tn.showFilterType?e.fieldType:"",bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),l.length&&(l[l.length-1].logic=""),l})(I,N);return{...e?{[Tn.sorterFieldName]:e}:null,...t.length?{[Tn.filterFieldName]:t}:null,...Y?{[Tn.groupSummary.summaryFieldName]:oe,usedJH:1}:null,...(null==a?void 0:a.params)??null,[Tn.currentPageName]:_.current,[Tn.pageSizeName]:_.pageSize}}),[null==a?void 0:a.params,_.current,_.pageSize,T,I,N,oe,Y]);return{isFetch:O,isWebPagination:A,isScrollPagination:k,showPagination:F,shouldUpdateHeight:q,tableColumns:L,flattenColumns:D,editableColumns:H,summationColumns:$,leftFixedColumns:M,rightFixedColumns:K,firstDataIndex:V,showSummary:U,showFooter:z,isHeadGroup:j,bordered:B,isHeadSorter:W,isHeadFilter:G,isServiceSummation:Y,isSelectCollection:Q,isTableImport:Z,isTableClipboard:X,isSuperSearch:J,isFastSearch:ee,isGroupSummary:te,isGroupSubtotal:le,isDragMergeCell:ae,isTreeTable:re,isTableEmpty:ne,summationRows:ie,fetchParams:se}};function Pn(t){const[l,a]=e.useState({width:0,height:0});return e.useEffect((()=>{const e=t.current,l=e=>{const{inlineSize:t,blockSize:l}=e.contentBoxSize[0];a({width:t,height:l})};return e&&Ft(e,l),()=>{e&&qt(e,l)}}),[t]),l}const On=(e,l)=>{const{rowKey:a,authCode:r,dataSource:n,summation:i,fetch:o,rowSelection:s,expandable:c,treeConfig:d,authConfig:u,ignorePageIndex:p,columnsChange:m,onScrollEnd:f,onDataChange:g,onDataLoad:b,onChange:y}=e,{getRowKey:v,tableRef:x,tableElementRef:E,tableBodyRef:C,$size:S,tableColumns:w,tableFullData:T,pagination:I,layout:N,filters:_,sorter:R,superFilters:P,fetchParams:O,selectionKeys:A,rowExpandedKeys:k,highlightKey:F,summationColumns:q,shouldUpdateHeight:L,isFetch:D,isTreeTable:H,isWebPagination:$,isScrollPagination:M,isServiceSummation:K,isGroupSubtotal:V,doLayout:U,setTableData:j,setTableFullData:B,setTableOriginData:W,setAllTableData:G,setDeriveRowKeys:Y,setPagination:Z,setSpinning:X,setSorter:Q,setFilters:J,setSuperFilters:ee,setSelectionKeys:te,setRowExpandedKeys:le,setHighlightKey:ae,setScrollYLoad:re,setScrollYStore:ne,setFieldAuth:ie,setResizeState:oe,setSummaries:se,setPermission:ce,setRowKeysMap:de,resetTableScroll:ue,clearElementStore:pe,clearAllRowKeysMap:me}=l,{store:he}=x.current,fe=Pn(E),ge=t().useRef({...O}),be=t().useRef({list:[],maps:new Map});ye((()=>{U()}),[w,S,N.tableAutoHeight]),ye((()=>{ve()}),[fe]),ye((()=>{We(),Ge(),Ye(),D||($&&$e(),qe(n))}),[n,null==o?void 0:o.params]),ye((()=>{const e=Ae(O,ge.current);e||D&&(null==s?void 0:s.clearableAfterFetched)&&Ze(),e||!(O[Tn.currentPageName]>1)||null!=o&&o.stopToFirst?D&&ke():$e(),ge.current=O}),[O]),ye((()=>{$&&Ue(),M||ue(),Re()}),[I.current,I.pageSize]),ye((()=>{D||xe(T.length),U()}),[T]),ye((()=>{H&&null!=d&&d.virtual&&(Me(),Ue())}),[k]);const ve=()=>{const{scrollYLoad:e,resizeState:t}=x.current,{height:l}=t,{width:a,height:r}=fe,n=r!==l;U(),n&&L&&e&&Ue(),oe(Object.assign({},t,{width:a,height:r}))},xe=e=>{e!==I.total&&Z((t=>Object.assign({},t,{total:e})))},Ee=(0,z.Ds)((e=>{De(),null==f||f(e)})),Ce=e=>V?Se(we(e,0)):e,Se=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Se(e.children)),delete e.children,t.push(e)})),t},we=(e,t)=>{var l;const r=null===(l=i.groupItems)||void 0===l?void 0:l[t];return r?(0,Cn.v9)(e,[r.dataIndex]).map((e=>{const l={children:we(e,t+1),_group:r.dataIndex};return"function"!=typeof a&&(0,Cn.dN)(l,a.toString(),(0,Cn.wE)()),r.titleIndex&&(0,Cn.dN)(l,r.titleIndex,(0,Cn.C_)(e[0],r.titleIndex)),(0,Cn.dN)(l,r.dataIndex,(0,Cn.C_)(e[0],r.dataIndex)),q.forEach((e=>{var t;const{dataIndex:a}=e,r=null===(t=l.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[Tn.summaryIgnore])return e;const l=Number((0,Cn.C_)(t,a));return Number.isNaN(l)?e:e+l}),0);(0,Cn.dN)(l,a,r)})),l})):(e.forEach(((t,l)=>{t._rowSpan=0===l?e.length:0,t._colSpan=1})),e)},Te=e=>{const{type:t,checkStrictly:l=!0}=s||{},a=Array.isArray(e)?e:A;let r=[];return x.current.treeTable&&!l&&a.forEach((e=>{r.push(...((e,t)=>{var l;const{deriveRowKeys:a}=x.current,r=(0,Cn.CD)(a,e);let n=[];if(!r)return n;const i=Ne((null==r?void 0:r.children)||[]),o=(null===(l=(0,Cn.Qi)(a,e))||void 0===l?void 0:l.slice(0,-1).reverse())||[];return n=[...new Set([...t,...i])],o.forEach((e=>{var t;const l=(0,Cn.CD)(a,e),r=(0,Cn.bY)(n,(null==l||null===(t=l.children)||void 0===t?void 0:t.map((e=>e.rowKey)))||[]);n=r?[...n,e]:n.filter((t=>t!==e))})),n})(e,a))})),r="radio"===t?a.slice(0,1):[...new Set([...a,...r])],r},Ie=e=>{const{allRowKeys:t,deriveRowKeys:l,flattenRowKeys:a}=x.current,{defaultExpandAllRows:r,expandedRowRender:n}=c||{},i=Array.isArray(e)?e:k;if(x.current.treeTable){n&&h("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...A];F&&e.unshift(F);let o=[];return e.forEach((e=>{const t=(0,Cn.Qi)(l,e)||[];o.push(...t.length>1?t.slice(0,-1).reverse():t)})),o=r?t:[...new Set([...i,...o])],o.filter((e=>!a.includes(e)))}return c?r?t.slice(0):[...i]:[]},Ne=e=>{const t=[];for(let l=0;l<e.length;l++)Array.isArray(e[l].children)&&t.push(...Ne(e[l].children)),t.push(e[l].rowKey);return t},_e=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(..._e(e.children,t)),e.rowKey===t&&e.parentRowKey&&l.push(e.parentRowKey)})),l.length&&l.push(..._e(e,l[l.length-1])),l},Re=(0,z.Ds)((()=>{Le(),null==y||y(I,Oe(_),Pe(R),P,{currentDataSource:Ve()})})),Pe=e=>{const t={};for(const l in e)null!==e[l]&&(t[l]=e[l]);return t},Oe=e=>{const t={};for(const l in e){if(!l.includes("|"))continue;const[a,r]=l.split("|");t[Tn.showFilterType?`${a}|${r}`:a]=e[l]}return t},Ae=(e,t)=>{const l=Object.keys((0,Cn.e5)(e,t));return 1===l.length&&(l.includes(Tn.currentPageName)||l.includes(Tn.pageSizeName))},ke=async()=>{var e;if(!o)return;const{beforeFetch:t=z.XT,afterFetch:l,callback:a}=o;if(!t(O))return;const r=M&&O[Tn.currentPageName]>ge.current[Tn.currentPageName]&&Ae(O,ge.current),n=!(null==i||null===(e=i.fetch)||void 0===e||!e.api);X(!0);try{const[e,t]=n?await Promise.all([o.api(O),i.fetch.api(O)]):[await o.api(O)];if(n?200===e.code&&200===t.code:200===e.code){const n=o.dataKey??Tn.dataKey;let i=(0,Nt.get)(e.data,n)??[];i="function"==typeof l?l(i):i;const s=(0,Nt.get)(e.data,n.replace(/[^.]+$/,Tn.totalKey))||i.length||0;qe(r?x.current.tableFullData.concat(i):i),xe(s),Fe((null==t?void 0:t.data)||e.data),null==a||a(e.data)}}catch(e){}(0,Cn.RI)(o,"stopToFirst")&&(o.stopToFirst=!1),X(!1)},Fe=e=>{var t;if(!K)return;const l=(null==i||null===(t=i.fetch)||void 0===t?void 0:t.dataKey)??Tn.summationKey,a=(l?(0,Nt.get)(e,l):e)??{},r={};q.filter((e=>!!e.summation.dataKey)).forEach((e=>{(0,Cn.dN)(r,e.dataIndex,Number((0,Cn.C_)(a,e.summation.dataKey)))})),se(r)},qe=e=>{const t=e=>e.map(((e,l)=>(Array.isArray(e.children)&&e.children.length&&(e.children=t(e.children)),e.index=l,p||(e.pageIndex=(e=>{const{current:t,pageSize:l}=I;return!D||M?e:(t-1)*l+e})(l)),e))),l=Ce(t(e));ze(l),je(l),te(Te()),le(Ie()),Le(),null==b||b(l)},Le=()=>{const{type:e,selectFirstRowOnChange:t}=s||{};if("radio"===e&&t){const e=Ve();if(e.length){const t=v(e[0],e[0].index);te([t])}else te([])}},De=()=>{if(!M)return;const{current:e,pageSize:t,total:l}=I;e>=Math.ceil(l/t)||He({...I,current:e+1})},He=e=>{let{current:t,pageSize:l}=e;Z((e=>Object.assign({},e,{current:t,pageSize:l})))},$e=()=>{He(Object.assign({},I,{current:1}))},Me=()=>{if(!x.current.treeTable||null==d||!d.virtual)return;const e=Ke(x.current.deriveRowKeys,(()=>{const{allTableData:e,allRowKeys:t}=x.current,{rowExpandable:l}=c||{},a=[];return"function"==typeof l&&e.forEach(((e,r)=>!l(e)&&a.push(t[r]))),a.length?k.filter((e=>!a.includes(e))):k})());be.current.list=e,be.current.maps.clear(),e.forEach(((e,t)=>be.current.maps.set(e.rowKey,t)))},Ke=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...Ke(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)))&&l.push({rowKey:e.rowKey,level:e.level})})),l},Ve=()=>$?(()=>{const{current:e,pageSize:t}=I;return x.current.tableFullData.slice((e-1)*t,e*t)})():x.current.tableFullData,Ue=()=>{let e=Ve();x.current.treeTable&&null!=d&&d.virtual&&(e=(e=>{const{allTableData:t,allRowKeys:l}=x.current,{list:a,maps:r}=be.current,n=[];for(let e=0,i=l.length;e<i;e++){const i=l[e];r.has(i)&&(t[e]._level=a[r.get(i)].level,n.push(t[e]))}return n})()),re(e.length>Tn.virtualScrollY),(e=>{const{elementStore:t,scrollYStore:l,scrollYLoad:a}=x.current,{startIndex:r,rowHeight:n}=l;let i="",o="";a&&(i=`translateY(${Math.max(0,r*n)+"px"})`,o=e.length*n+"px"),t.$tableBody.style.transform=i,t.$tableYspace.style.height=o})(e),(e=>{const{scrollYLoad:t,scrollYStore:l}=x.current;j(t?e.slice(l.startIndex,l.endIndex):e)})(e)},ze=e=>{B(e),G(e),Y(e),Be(),Me(),Ue()},je=e=>{W(e)},Be=()=>{const{allRowKeys:e}=x.current;me(),e.forEach(((e,t)=>de(e,t)))},We=()=>{Q({})},Ge=()=>{J({})},Ye=()=>{ee([])},Ze=()=>{te([])};return{initialTable:()=>{(async()=>{if(null==u||!u.fetch)return;const{originColumns:t}=x.current,{api:l,params:a,columnDataKey:r,exportDataKey:n,importDataKey:i,printDataKey:o}=u.fetch;try{const s=await l(a);if(200===s.code){if(r){const l=(0,Nt.get)(s.data,r)??[],a=!!(0,Nt.get)(s.data,"reverse"),n=(0,Cn.y1)(e.columns,(e=>{const{dataIndex:r}=e;if(a?!l.includes(r):l.includes(r)){const l=(0,Cn.Ps)(t,r);e.noAuth=!0,l.noAuth=!0}}));null==m||m(n)}n&&ce((e=>Object.assign({},e,{export:!!(0,Nt.get)(s.data,n)}))),i&&ce((e=>Object.assign({},e,{import:!!(0,Nt.get)(s.data,i)}))),o&&ce((e=>Object.assign({},e,{print:!!(0,Nt.get)(s.data,o)})))}}catch(e){}})(),(()=>{if(!r)return;const t=(0,z.Y6)(r);if(t){const{fieldList:l=[],isExport:a=1,isImport:r=1,isPrint:n=1}=t,{originColumns:i}=x.current,o=(0,Cn.y1)(e.columns,(e=>{const{dataIndex:t}=e,a=l.find((e=>e.dataIndex===t));if(a){const{visible:l=1,disabled:r,secretName:n}=a,o=(0,Cn.Ps)(i,t);ie(t,{visible:l,disabled:r,secretName:n}),l||(e.noAuth=!0,o.noAuth=!0),n&&(e.formatType=`secret-${n}`,o.formatType=`secret-${n}`)}}));ce((e=>Object.assign({},e,{export:!!a,import:!!r,print:!!n}))),setTimeout((()=>null==m?void 0:m(o)))}})(),F&&C.current.setClickedValues([F,""]),"radio"===(null==s?void 0:s.type)&&A.length&&C.current.setClickedValues([A[0],""]),D?ke():qe(n)},createTableFullData:ze,getTableData:ke,createTableData:qe,createGroupData:Ce,createSelectionKeys:Te,createSelectionRows:e=>{const{selectionRows:t,allTableData:l,rowKeysMap:a}=x.current;if(D)return[...t.filter((t=>e.includes(v(t,t.index)))),...l.filter((l=>{const a=v(l,l.index);return e.includes(a)&&-1===t.findIndex((e=>v(e,e.index)===a))}))];const r=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];a.has(n)&&r.push(l[a.get(n)])}return r},createRowExpandedKeys:Ie,findParentRowKeys:_e,getAllChildRowKeys:Ne,doFieldValidate:(e,t,l,a)=>{if(!Array.isArray(e))return h("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(he.removeFromRequired({x:l,y:a}),he.removeFromValidate({x:l,y:a}),e.forEach((e=>{var r;e.required&&(0,z.xb)(t)&&he.addToRequired({x:l,y:a,text:e.message}),"function"!=typeof e.validator||null!==(r=e.validator)&&void 0!==r&&r.call(e,t)||he.addToValidate({x:l,y:a,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:l,updated:a,removed:r}=he.state,n=(0,Nt.intersection)(l,r),i=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:i(e),validate:i(t),inserted:l.filter((e=>!n.includes(e))),updated:a.filter((e=>![...(0,Nt.intersection)(a,l),...(0,Nt.intersection)(a,r)].includes(e))),removed:r.filter((e=>!n.includes(e)))}},dataChange:()=>{null==g||g(x.current.tableFullData)},tableChange:Re,toLastPage:()=>{const{current:e,pageSize:t,total:l}=I,a=Math.ceil(l/t);e<a&&He(Object.assign({},I,{current:a}))},pagerChangeHandle:He,triggerScrollYEvent:e=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollYStore:t}=x.current,{startIndex:l,endIndex:a,offsetSize:r,visibleSize:n,rowHeight:i}=t,o=Math.floor(e/i),s=Math.max(0,o-1-r),c=o+n+r;(o<=l||o>=a-n-1)&&(l===s&&a===c||(ne(Object.assign({},t,{startIndex:s,endIndex:c})),Ue()))}(e)},scrollBottomDebouncer:Ee,clearTableSorter:We,clearTableFilter:Ge,clearSuperFilters:Ye,clearRowSelection:Ze,clearRowHighlight:()=>{ae("")},clearTableLog:()=>{he.clearAllLog()},destroy:()=>{pe(),he.destroy(),En.deregister(x.current.uid)}}},An=(e,l)=>{const{height:a,minHeight:r,maxHeight:n,resizable:i,showHeader:o,spanMethod:s}=e,{getRowKey:c,tableRef:d,$size:u,tableColumns:p,flattenColumns:m,leftFixedColumns:h,layout:f,scrollY:g,tableData:b,showFooter:y,showPagination:v,isWebPagination:x,isFullScreen:E,setLayout:C,setScrollX:S,setScrollY:w,setElementStore:T,setScrollYStore:I,setShouldToTop:N}=l,_=t().useRef(g),R=t().useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=f,l={};return r&&Object.assign(l,{minHeight:`${(0,Cn.EJ)(r)}px`}),n&&Object.assign(l,{maxHeight:`${(0,Cn.EJ)(n)}px`}),E?{...l,maxHeight:"",minHeight:"",height:`${e}px`}:a?{...l,height:"auto"!==a?`${(0,Cn.EJ)(a)}px`:`${t}px`}:l}),[a,n,r,E,f]),P=(e,t)=>{const{elementStore:l,scrollYStore:a,allTableData:r}=d.current,n=l.$tableBody.parentNode;if(!(0,z.o8)(t)&&t>=0)n.scrollTop=t*a.rowHeight;else{const t=(x?(0,Cn.tL)(b):r).findIndex((t=>e===c(t,t.index)));n.scrollTop=(t<0?0:t)*a.rowHeight}};return{createElementStore:e=>{Object.keys(e).forEach((t=>{T(t,e[t])}))},tableStyles:R,getSpan:(e,t,l,a,r)=>{let n=1,i=1;if("function"==typeof s){const o=s({row:e,column:t,rowIndex:l,columnIndex:a,tableData:r});Array.isArray(o)?(n=o[0],i=o[1]):(0,z.Kn)(o)&&(n=o.rowSpan,i=o.colSpan)}const{mergeCells:o}=d.current;if(o.length>0){const e=o.find((e=>e.row===l&&e.col===a));e&&(n=e.rowSpan,i=e.colSpan)}return{rowSpan:n,colSpan:i}},getStickyLeft:e=>{m.findIndex((t=>t.dataIndex===e))<0&&(e=(0,Cn.t2)((0,Cn.Ps)(p,e)).dataIndex);let t=0;for(let l=0;l<m.length;l++){const a=m[l];if(a.dataIndex===e)break;t+=(0,Cn.EJ)(a.width||a.renderWidth||0)}return t},getStickyRight:e=>{m.findIndex((t=>t.dataIndex===e))<0&&(e=(0,Cn.gU)((0,Cn.Ps)(p,e)).dataIndex);let t=0;for(let l=m.length-1;l>=0;l--){const a=m[l];if(a.dataIndex===e)break;t+=(0,Cn.EJ)(a.width||a.renderWidth||0)}return t},scrollXToColumn:(e,t)=>{const{elementStore:l}=d.current,a=void 0===t?m.findIndex((t=>t.dataIndex===e)):t;if(a<0)return;const r=h.map((e=>e.width||e.renderWidth||Tn.defaultColumnWidth)).reduce(((e,t)=>e+t),0);l.$tableBody.parentNode.scrollLeft=l.$tableBody.querySelectorAll("tbody > tr > td")[a].offsetLeft-r},scrollYToRecord:P,rowInViewport:e=>{const{elementStore:t,scrollYStore:l}=d.current,{viewportHeight:a,gutterWidth:r}=f,n=e*l.rowHeight,i=t.$tableBody.parentNode;return!(n<i.scrollTop||n+l.rowHeight>i.scrollTop+(scrollX?a-r:a))},calcTableHeight:()=>{if("auto"!==a)return;const{elementStore:e,resizeState:t}=d.current,l=t.winHeight-e.$table.getBoundingClientRect().top-(v?Sl["small"!==u?"middle":u]+un:0)-un;C((e=>Object.assign({},e,{tableAutoHeight:l})))},resetTableScroll:()=>{const{shouldToTop:e}=d.current;e&&P("",0),N(!0)},doLayout:()=>{(()=>{const{elementStore:e,scrollYLoad:t,resizeState:l}=d.current;if(!e.$table.offsetParent)return;const a=e.$table.offsetHeight,r=o?e.$header.offsetHeight:f.headerHeight,n=y?e.$footer.offsetHeight:f.footerHeight,i=a-r-n,s=e.$tableBody.offsetHeight,c=t||s>i;let p=0;if(E){const t=e.$toper?e.$toper.offsetHeight+un:0,a=e.$pager?e.$pager.offsetHeight+un:0;p=l.winHeight-t-a-20}i!==f.viewportHeight&&(e=>{const{scrollYStore:t,isIE:l}=d.current,{startIndex:a,endIndex:r}=t,n=Tn.rowHeightMaps[u],i=Math.max(8,Math.ceil(e/n)+2),o=l?5:0;I(Object.assign({},t,{visibleSize:i,offsetSize:o,endIndex:Math.max(a+i+o,r),rowHeight:n}))})(i),_.current=c,w(c),C((e=>Object.assign({},e,{headerHeight:r,footerHeight:n,viewportHeight:i,tableBodyHeight:s,tableFullHeight:p})))})(),(()=>{const{elementStore:e}=d.current,t=e.$table.clientWidth,l=_.current?f.gutterWidth:0,{defaultColumnWidth:a}=Tn,r=m.filter((e=>"number"!=typeof e.width));let n=0;if(m.forEach((e=>{"number"==typeof e.width&&(e.renderWidth=null)})),r.length>0){if(m.forEach((e=>{n+=Number(e.width)||a})),n<=t-l){S(!1);const e=t-l-n;if(1===r.length&&i)r[0].renderWidth=a+e;else{const t=e/r.reduce(((e,t)=>e+a),0);let l=0;r.forEach(((e,r)=>{if(0===r)return;const n=Math.floor(a*t);l+=n,e.renderWidth=a+n})),i&&(r[0].renderWidth=a+e-l)}}else S(!0),r.forEach((e=>{e.renderWidth=a}));C((e=>Object.assign({},e,{tableBodyWidth:Math.max(n,t)})))}else m.forEach((e=>{e.renderWidth=Number(e.width)||a,n+=e.renderWidth})),S(n>t),C((e=>Object.assign({},e,{tableBodyWidth:n})));C((e=>Object.assign({},e,{tableWidth:t})))})()}}};function kn(){const[,t]=e.useReducer((e=>e+1),0);return t}const Fn=e=>{const{total:l}=e,{tableRef:a,tableProps:r,selectionKeys:n,isHeadSorter:i,isHeadFilter:o,isTreeTable:s,clearTableSorter:c,clearTableFilter:u,clearSuperFilters:p,clearRowSelection:m,clearRowHighlight:h}=t().useContext(cn),{rowSelection:f,rowHighlight:g}=r,{allTableData:b}=a.current,y=t().useMemo((()=>!!(i||o||f||g)),[i,o,f,g]),v={[`${ae("table")}__alert`]:!0};return t().createElement("div",{className:le()(v)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.InfoCircleFilled,null)),t().createElement("span",null,d("qm.table.alert.total",{total:s?b.length:l}),f?`,${d("qm.table.alert.selected",{total:n.length})}`:""),y&&t().createElement("em",{onClick:()=>{c(),u(),p(),m(),h()}},d("qm.table.alert.clear")))},qn=e=>{const{isFullScreen:l}=e,{setFullScreen:a}=t().useContext(cn),r=ae("table");return t().createElement("span",{className:`${r}-full-screen`,title:d(l?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>{a(!l)}},t().createElement("i",{className:"svgicon icon"},l?t().createElement(re.FullscreenExitOutlined,null):t().createElement(re.FullscreenOutlined,null)))},Ln=()=>{const{getTableData:e}=t().useContext(cn),l=ae("table");return t().createElement("span",{className:`${l}-reload`,title:d("qm.table.refresh.text"),onClick:()=>e()},t().createElement("i",{className:"svgicon icon"},t().createElement(re.ReloadOutlined,null)))},Dn=e=>{var l,a;const{tableColumns:n}=e,{global:i}=t().useContext(r),{tableRef:o,tableBodyRef:s,tableProps:c,flattenColumns:u,summationRows:p,showSummary:m,getSpan:h}=t().useContext(cn),{tablePrint:f,showHeader:g}=c,{isIE:b}=o.current,y=(null==i||null===(l=i.print)||void 0===l?void 0:l.leftLogo)??"",v=(null==i||null===(a=i.print)||void 0===a?void 0:a.rightLogo)??"",x=!(!y&&!v),E=t().useMemo((()=>(0,Nt.cloneDeep)((0,Cn.MY)(n,[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn]))),[n]),C=t().useMemo((()=>(0,Nt.cloneDeep)((0,Cn.MY)(u,[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn]))),[u]),S=t().useMemo((()=>(0,Nt.cloneDeep)(n.filter((e=>e.printFixed)))),[n]),w=(e,t)=>{const l=Object.assign({},(0,Cn.Ps)(t,e.parentDataIndex));return l.children=[e],l.level&&l.level>1?w(l,t):l},T=(e,t)=>(0,Nt.map)((0,Nt.groupBy)((0,Nt.flatten)(e),t),(0,Nt.spread)((function(){for(var e=arguments.length,l=new Array(e),a=0;a<e;a++)l[a]=arguments[a];return(0,Nt.mergeWith)(...l,((e,l)=>{if(Array.isArray(e))return T(e.concat(l),t)}))}))),I=()=>{const{allTableData:e}=o.current,t=(e=>{const t=[];let l=[],a=0,r=0;for(;r<e.length;){const n=e[r];a+=n.width||n.renderWidth||Tn.defaultColumnWidth,a<=Tn.printWidth?(l.push(n),r===e.length-1&&t.push(l),r++):r>0?(e.splice(0,r),S.length&&e.unshift(...S),t.push(l),l=[],a=0,r=0):(n.width=Tn.printWidth,l.push(n),t.push(l),r++)}return t})([...C]),l=((e,t)=>{const l=[];return e.forEach((e=>{let a=[];e.forEach((e=>{1===e.level?a.push(e):a.push(w(e,t))})),a=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const l=e.filter((e=>e.dataIndex===t));return l.length<=1?l[0]:T(l,"dataIndex")[0]})))(a),l.push((0,Cn.vo)(a))})),l})(t,E);let a=["<!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 r=0;r<t.length;r++)a+=N(l[r],t[r],e),a+='<div class="page-break"></div>';return a+"</body></html>"},N=(e,t,l)=>{const{showLogo:a=!0}=f;let r='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return r+=`<colgroup>${t.map((e=>{let{width:t,renderWidth:l}=e;return`<col style="width:${t||l||Tn.defaultColumnWidth}px">`})).join("")}</colgroup>`,g&&(r+=["<thead>",a&&x?`<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">',y?`<img src="${y}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',v?`<img src="${v}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${e.title}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),l.length&&(r+=`<tbody>${l.map((e=>`<tr>${t.map(((t,a)=>{const{rowSpan:r,colSpan:n}=h(e,t,e.index,a,l);return r&&n?`<td rowspan="${r}" colspan="${n}">${((e,t,l,a)=>s.current.renderCellTitle(l,e,t,a))(e,e.index,t,a)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),m&&p.length&&(r+=["<tfoot>",p.map((e=>`<tr>${t.map(((t,a)=>{const{dataIndex:r,summation:n}=t,i=null!=n&&n.render?n.render(l):(0,Cn.C_)(e,`${r}_text`);return`<td>${0===a&&""===i?d("qm.table.config.summaryText"):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),r+="</table>",r},_=ae("table");return t().createElement("span",{className:`${_}-print`,title:d("qm.table.print.text"),onClick:()=>{var e;null===(e=((e,t)=>{const{filename:l,type:a,isDownload:r}={filename:"print",type:"html",isDownload:!1},n=`${l}.${a}`;if(window.Blob){const e=new Blob([t],{type:`text/${a}`});if(!r)return Promise.resolve({type:a,content:t,blob:e});Ye(e,n)}})(0,I()))||void 0===e||e.then((e=>{let{content:t,blob:l}=e,a=document.createElement("iframe");a.setAttribute("frameborder","0"),a.setAttribute("width","100%"),a.setAttribute("height","0"),a.style.display="none",document.body.appendChild(a),b?(a.contentDocument.write(t),a.contentDocument.execCommand("print"),a.parentNode.removeChild(a),a=null):(a.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{a.parentNode.removeChild(a),a=null}))},a.src=URL.createObjectURL(l))}))}},t().createElement("i",{className:"svgicon icon"},t().createElement(re.PrinterOutlined,null)))},Hn=require("exceljs");var $n=__webpack_require__.n(Hn);const Mn="606060",Kn="thin",Vn="d4d4d4",Un=(e,t)=>{t&&(e.height=Math.floor(.75*t))},zn=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},jn=()=>({top:{style:Kn,color:{argb:Vn}},left:{style:Kn,color:{argb:Vn}},bottom:{style:Kn,color:{argb:Vn}},right:{style:Kn,color:{argb:Vn}}}),Bn=e=>{const{children:t}=e;return t&&t.length?Bn(t[0]):e},Wn=e=>{const{precision:t,formatType:l}=e,a=t>=0?t?`0.${new Array(t).fill("0").join("")}`:"0":"";return a?{numFmt:a}:"percent"===l?{numFmt:t>=0?`${a}%`:"0%"}:"finance"===l?{numFmt:t>=0?`#,##${a}`:"#,##0"}:null},Gn=()=>{const{tableRef:e,tableProps:l,getSpan:a,showSummary:r,isHeadGroup:n}=t().useContext(cn),{spanMethod:i,showHeader:o}=l,s=(e,t)=>{var l;return(null===(l=e.find((e=>e.text==t)))||void 0===l?void 0:l.value)??""};return{exportXLSX:async(t,l,s,c)=>{const{columns:u,footSummation:p}=t,{scrollYStore:{rowHeight:m}}=e.current,h=(0,Cn.HG)(u),f=(0,Cn.vo)(u),g=[],b=[],y=[],v=[];let x=0;const E={};h.forEach((e=>{const{dataIndex:t,title:l,width:a,renderWidth:r}=e;E[t]=l,y.push({key:t,width:(a||r||100)/8})})),o&&(n?f.forEach(((e,t)=>{const l={};e.forEach((e=>{const{colSpan:a,rowSpan:r}=e,n=Bn(e),i=h.findIndex((e=>{let{dataIndex:t}=e;return t===n.dataIndex}));l[n.dataIndex]=e.title,0!==a&&(a>1||r>1)&&v.push({s:{r:t,c:i},e:{r:t+r-1,c:i+a-1}})})),g.push(l)})):(h.forEach(((e,t)=>{const{colSpan:l,rowSpan:a}=e;(l>1||a>1)&&v.push({s:{r:x,c:t},e:{r:x+a-1,c:t+l-1}})})),g.push(E)),x+=g.length);const C=l.map(((e,t)=>{const r={};return h.forEach(((n,o)=>{if("function"==typeof i){const{rowSpan:r,colSpan:i}=a(e,n,t,o,l);(i>1||r>1)&&v.push({s:{r:t+x,c:o},e:{r:t+x+r-1,c:o+i-1}})}const s=["percent","finance"].includes(n.formatType);r[n.dataIndex]=s?(0,Cn.C_)(e,n.dataIndex):c(e,t,n,o)})),r}));x+=C.length,r&&p&&s(h,l).forEach(((e,t)=>{const a={};h.forEach(((t,r)=>{const{dataIndex:n,summation:i}=t,o=null!=i&&i.render?i.render(l):(0,Cn.C_)(e,n);a[n]=0===r&&""===o?d("qm.table.config.summaryText"):(0,z.l$)(o)?(0,Cn.gn)(o).join(""):o})),b.push(a)}));const{sheetName:S,useStyle:w}=t,T=new($n().Workbook),I=T.addWorksheet(S);I.columns=y,o&&I.addRows(g).forEach((e=>{w&&Un(e,m),e.eachCell((e=>{const t=I.getColumn(e.col),l=(0,Cn.Ps)(u,t.key),{align:a}=l;zn(e,a),w&&Object.assign(e,{font:{bold:!0,color:{argb:Mn}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:jn()})}))})),I.addRows(C).forEach((e=>{w&&Un(e,m),e.eachCell((e=>{const t=I.getColumn(e.col),l=(0,Cn.Ps)(u,t.key),{align:a}=l;zn(e,a),Object.assign(e,Wn(l)),w&&Object.assign(e,{font:{color:{argb:Mn}},border:jn()})}))})),r&&p&&I.addRows(b).forEach((e=>{w&&Un(e,m),e.eachCell((e=>{const t=I.getColumn(e.col),l=(0,Cn.Ps)(u,t.key),{align:a}=l;zn(e,a),Object.assign(e,Wn(l)),w&&Object.assign(e,{font:{color:{argb:Mn}},border:jn()})}))})),v.forEach((e=>{let{s:t,e:l}=e;I.mergeCells(t.r+1,t.c+1,l.r+1,l.c+1)}));const N=await T.xlsx.writeBuffer();return new Blob([N],{type:"application/octet-stream"})},exportCSV:(e,t)=>{const l=e=>{let t=e;const l=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),a=-1!==e.indexOf('"');return a&&(t=t.replace(/"/g,'""')),(l||a)&&(t='"'+t+'"'),t},a="\ufeff"+(e=>{let t,a,r,n,i="";for(t=0;t<e.rows.length;t+=1){for(r=e.rows[t],a=0;a<r.cells.length;a+=1)n=r.cells[a],i=i+(a?",":"")+l(n.textContent.trim());i+="\r\n"}return i})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var r;return((e,t,l)=>{t=t||"",l=l||512;const a=window.atob(e),r=[];let n;for(n=0;n<a.length;n+=l){const e=a.slice(n,n+l),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);r.push(o)}return new window.Blob(r,{type:t})})((r=a,window.btoa(unescape(encodeURIComponent(r)))),"application/csv")},importXLSX:(e,t)=>{const{columns:l,file:a}=e,r=(0,Cn.HG)(l),n=new FileReader;n.onerror=()=>{E.message.error(d("qm.table.import.error"))},n.onload=e=>{const l=r.map((e=>e.title)),a=new($n().Workbook),n=e.target;n?a.xlsx.load(n.result).then((e=>{const a=e.worksheets[0];if(a){const e=a.getSheetValues(),n=e.findIndex((e=>e&&e.length>0)),i=e[n],o=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(l,i);if(o){const a=e.slice(n+1).map((e=>{const t={};e.forEach(((e,l)=>{t[i[l]]=e}));const a={};return l.forEach(((e,l)=>{const{dataIndex:n,dictItems:i}=r[l];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,Cn.dN)(a,n,t[e])})),a}));null==t||t(a),E.message.success(d("qm.table.import.success",{total:a.length}))}else E.message.error(d("qm.table.import.error"))}else E.message.error(d("qm.table.import.error"))})):E.message.error(d("qm.table.import.error"))},n.readAsArrayBuffer(a)}}};let Yn,Zn;const Xn=ae("table"),Qn=e=>{const t=e.name,l=t.lastIndexOf("."),a=t.substring(l+1,t.length);return{filename:t.substring(0,l),type:a}},Jn=e=>{const{fileType:l,onChange:a}=e;return t().createElement(G,{onClick:()=>(async()=>{try{const e=await(e=>{const t=Object.assign({},e);return Yn||(Yn=document.createElement("form"),Zn=document.createElement("input"),Yn.className=`${Xn}--file-form`,Zn.name="file",Zn.type="file",Yn.appendChild(Zn),document.body.appendChild(Yn)),new Promise(((e,l)=>{const a=!t.type;Zn.multiple=!!t.multiple,Zn.accept=a?"":`.${t.type}`,Zn.onchange=r=>{const{files:n}=r.target,i=n[0];let o="";if(!a)for(let e=0;e<n.length;e++){const{type:l}=Qn(n[e]);if(t.type!==l){o=l;break}}o?(E.message.warning(d("qm.upload.notType",{type:o})),l()):e(i),document.body.removeChild(Yn),Yn=null,Zn=null},Yn.reset(),Zn.click()}))})({type:l});null==a||a(e.name,e)}catch(e){}})()},d("qm.upload.text"))},ei=e=>{const{columns:l,onClose:a}=e,{tableRef:r,createTableData:n,dataChange:i}=t().useContext(cn),{importXLSX:o}=Gn(),s=t().useRef(null),[c,u]=t().useState(!1),[p,m]=t().useState(!0),h=e=>e.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,"index","pageIndex",Tn.operationColumn].includes(e.dataIndex))),[f,g]=t().useState([{type:"INPUT",label:d("qm.table.export.fileName"),fieldName:"fileName",render:(e,l)=>{const{fileName:a}=l.GET_FIELDS_VALUE(["fileName"]);return t().createElement(t().Fragment,null,a?t().createElement("span",null,a):t().createElement(Jn,{fileType:l.state.formData.fileType,onChange:(e,t)=>{l.SET_FIELDS_VALUE({fileName:e,file:t}),t&&m(!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=>{f.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,g([...f])}},{type:"INPUT_NUMBER",label:d("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:1,max:r.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]),b=ae("table");return t().createElement("div",{className:`${b}-import__setting`},t().createElement(Cr,{ref:s,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:{posIndex:"条"},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(G,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(G,{type:"primary",loading:c,disabled:p,onClick:()=>(async()=>{const[e,t]=await s.current.GET_FORM_DATA();e||(u(!0),o({columns:h(l),file:t.file},(e=>{const{tableFullData:l,store:a}=r.current;if("fill"===t.importType&&n(e),"add"===t.importType&&n([...l,...e]),"insert"===t.importType){const{tableFullData:l}=r.current,a=t.posIndex,i=l.slice(0,a).concat(e).concat(l.slice(a));n(i)}e.forEach((e=>{a.addToInserted(e)})),i()})),await(0,z._v)(1e3),u(!1),a())})()},d("qm.table.import.text"))))},ti=e=>{const{tableColumns:l}=e,[a,r]=t().useState(!1),n={[`${ae("table")}-import`]:!0},i={visible:a,title:d("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>r(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:le()(n),title:d("qm.table.import.text"),onClick:()=>r(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.ImportOutlined,null))),t().createElement(It,i,t().createElement(ei,{columns:l,onClose:()=>r(!1)})))},li=e=>{const{columns:l,onChange:a}=e,{$size:r}=t().useContext(cn),n=t().useRef([]),[i,o]=t().useState(!1),[s,c]=t().useState(l);ye((()=>{p()}),[s]),t().useEffect((()=>{u()}),[l]);const u=()=>{const e=[];l.forEach(((t,a)=>{const r=t.colSpan;r>1&&l.slice(a+1,a+r).every((e=>{let{colSpan:t}=e;return 0===t}))&&e.push(l.slice(a,a+r))})),n.current=e},p=()=>{const e=[];s.forEach((t=>{const{colSpan:l,dataIndex:a}=t;if(0===l)return;if(1===l)return e.push(t);const r=n.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(a)));if(-1===r)return e.push(t);e.push(...n[r].map(((e,l)=>{let{dataIndex:a}=e;const r=s.find((e=>e.dataIndex===a));return l>0&&void 0!==t.hidden&&(r.hidden=t.hidden),r})))})),null==a||a(e)},m=ae("table"),h={[`${m}__popper`]:!0,"column-filter__popper":!0,[`${m}--lg`]:"large"===r,[`${m}--sm`]:"small"===r},f=[`${m}-column-filter`,{selected:i}];return t().createElement(Aa(),{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(al.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:s,setList:e=>{const t=e.map((e=>e.dataIndex)),l=s.map((e=>e.dataIndex));(0,Nt.isEqual)(t,l)||c(e)}},s.map((e=>((e,l)=>{const{colSpan:a}=e;if(0===a)return t().createElement("li",{key:e.dataIndex,style:{display:"none"}});const r=["svgicon","handle","main-handle"];return t().createElement("li",{key:e.dataIndex,className:"item"},t().createElement(E.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:l}=t.target;e.hidden=!l,c([...s])}}),t().createElement("i",{className:le()(r),title:d("qm.table.columnFilter.draggable")},t().createElement(re.HolderOutlined,null)),t().createElement("span",{className:"text",title:e.title},e.title))})(e)))))),popupClassName:le()(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{o(e)},builtinPlacements:yn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t().createElement("span",{className:le()(f),title:d("qm.table.columnFilter.text")},t().createElement("i",{className:"svgicon icon"},t().createElement(re.SettingOutlined,null)),t().createElement("span",null,d("qm.table.columnFilter.text"))))},ai=e=>{const{defaultValue:l,onClose:a,onOk:r}=e,{tableProps:n,pagination:o,showSummary:s}=t().useContext(cn),{rowSelection:c}=n,u=t().useRef(null),[p,m]=t().useState(!1),h=t().useMemo((()=>Object.assign({},{fileName:`${i()().format(bn)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},l,{columns:(0,Nt.cloneDeep)(l.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,l)=>t().createElement(li,{columns:l.state.formData.columns,onChange:e=>{l.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=ae("table");return t().createElement("div",{className:`${b}-export__setting`},t().createElement(Cr,{ref:u,initialValues:h,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(G,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(G,{type:"primary",loading:p,onClick:()=>(async()=>{const[e,t]=await u.current.GET_FORM_DATA();if(!e){m(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);r(t),await(0,z._v)(1e3),m(!1),a()}})()},d("qm.table.export.text"))))},ri=e=>{var l;const{tableColumns:a}=e,{global:n}=t().useContext(r),{tableRef:o,tableBodyRef:s,tableProps:c,flattenColumns:u,pagination:p,fetchParams:m,isFetch:h,isGroupSubtotal:f,showSummary:g,getSpan:b}=t().useContext(cn),{exportExcel:y,fetch:v,showHeader:x}=c,[E,C]=t().useState(!1),[S,w]=t().useState(!1),T=!(null==y||null===(l=y.fetch)||void 0===l||!l.api),I=t().useMemo((()=>!p.total||S),[p.total,S]),N=t().useMemo((()=>(0,Cn.MY)(a,[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn])),[a]),_=t().useMemo((()=>(0,Cn.MY)(u,[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn])),[u]),R=(e,t)=>{const{summaries:l}=o.current,a={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:r}=e;let n;n=Object.keys(l).includes(r)?Number((0,Cn.C_)(l,r)):(f?(0,Cn.SX)(t):t).reduce(((e,t)=>{if(null!=t&&t[Tn.summaryIgnore])return e;const l=Number((0,Cn.C_)(t,r));return Number.isNaN(l)?e:e+l}),0),(0,Cn.dN)(a,r,n)})),[a]},P=(e,t,l,a)=>{const{precision:r,formatType:n}=l;let i=s.current.renderCellTitle(l,e,t,a);return r>=0&&!n&&""!==i&&(i=Number(i)),i},{exportXLSX:O,exportCSV:A}=Gn(),k=e=>{var t;const l=null==n||null===(t=n.table)||void 0===t?void 0:t.recordExportLog;try{null==l||l({fileName:e})}catch(e){}},F=(e,t)=>{const{columns:l,footSummation:a}=e,r=(0,Cn.vo)(l),n=(0,Cn.HG)(l);let i='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${n.map((e=>{let{width:t,renderWidth:l}=e;return`<col style="width:${t||l||Tn.defaultColumnWidth}px">`})).join("")}</colgroup>`,x&&(i+=["<thead>",r.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${e.title}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(i+=`<tbody>${t.map((e=>`<tr>${n.map(((l,a)=>{const{rowSpan:r,colSpan:n}=b(e,l,e.index,a,t);return r&&n?`<td rowspan="${r}" colspan="${n}">${P(e,e.index,l,a)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),g&&a&&(i+=["<tfoot>",R(n,t).map((e=>`<tr>${n.map(((l,a)=>{const{dataIndex:r,summation:n}=l,i=null!=n&&n.render?n.render(t):(0,Cn.C_)(e,r);return`<td>${0===a&&""===i?d("qm.table.config.summaryText"):(0,z.l$)(i)?(0,Cn.gn)(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},q=(null==y?void 0:y.fileName)??`${i()().format(bn)}.xlsx`,L=q.slice(q.lastIndexOf(".")+1).toLowerCase(),D={[`${ae("table")}-export`]:!0,disabled:I},H={visible:E,title:d("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>C(!1)},$={fileName:q.slice(0,q.lastIndexOf(".")),fileType:L,columns:N,useStyle:null!=y&&y.cellStyle?1:0};return t().createElement(t().Fragment,null,t().createElement("span",{className:le()(D),title:d("qm.table.export.text"),onClick:()=>{I||(T?(async e=>{w(!0);try{const t=await y.fetch.api({columns:_.map((e=>{const{title:t,dataIndex:l,hidden:a}=e,{type:r}=e.filter||{};return{title:t,dataIndex:l,type:r,hidden:a}})),...m,tsortby:void 0,tsummary:void 0,tgroupby:void 0,[Tn.currentPageName]:void 0,[Tn.pageSizeName]:void 0});t.data&&(Ye(t.data,e),k(e))}catch(e){}w(!1)})(q):C(!0))}},t().createElement("i",{className:"svgicon icon"},t().createElement(re.DownloadOutlined,null))),t().createElement(It,H,t().createElement(ai,{defaultValue:$,onClose:()=>C(!1),onOk:e=>{(async e=>{const{fileName:t,fileType:l,exportType:a,startIndex:r=1,endIndex:n}=e,{allTableData:i,selectionRows:s}=o.current;let c=[];if(h){w(!0);const{api:e,dataKey:t}=v;try{const l=await e({...m,[Tn.currentPageName]:1,[Tn.pageSizeName]:p.total});200===l.code&&(c=(Array.isArray(l.data)?l.data:(0,Nt.get)(l.data,t)??[]).map(((e,t)=>{const l={...e,index:t,pageIndex:t};return _.forEach(((e,t)=>{const{dataIndex:a}=e;"index"!==a&&"pageIndex"!==a&&(0,Cn.dN)(l,a,(0,Cn.C_)(l,a))})),l})))}catch(e){}w(!1)}else c=i.slice(0);if("selected"===a&&(c=s.slice(0)),"custom"===a&&(c=c.slice(r-1,n||void 0)),"xlsx"===l){const l=await O(e,c,R,P);Ye(l,`${t}.xlsx`),k(`${t}.xlsx`)}if("csv"===l){const l=A(e,F(e,c));Ye(l,`${t}.csv`),k(`${t}.csv`)}})(Object.assign({},e,{columns:(0,Cn.J1)(e.columns)}))}})))},ni=e=>{const{columns:l,onClose:a}=e,{tableRef:r,tableBodyRef:n,dataChange:i}=t().useContext(cn),o=t().useRef(null),[s,c]=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:l.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}]}]),u=ae("table");return t().createElement("div",{className:`${u}-clipboard__setting`},t().createElement("h3",{className:"info"},d("qm.table.clipboard.supportText")),t().createElement(Cr,{ref:o,initialValues:{},initialExtras:{rowIndex:"行",dataIndex:"列"},items:s,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(G,{onClick:()=>a(),style:{marginRight:8}},d("qm.table.export.closeButton")),t().createElement(G,{type:"primary",onClick:()=>(async()=>{var e;const[t,s]=await o.current.GET_FORM_DATA();if(t)return;const{tableFullData:c,store:d}=r.current,u=s.content.replace(/(\r|\n)$/,"");let p=u.replace(/"[^"]+"/g,"^");((null===(e=u.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{p=p.replace(/\^/,e)})),p.split(/\r|\n/).forEach(((e,t)=>{e.split(/\t/).forEach(((e,a)=>{const r=c[s.rowIndex-1+t],n=l[s.dataIndex+a];r&&n&&((0,Cn.dN)(r,n.dataIndex,e),d.addToUpdated(r))}))})),n.current.forceUpdate(),i(),a()})()},d("qm.table.clipboard.text"))))},ii=e=>{const{flattenColumns:l}=e,[a,r]=t().useState(!1),n=t().useMemo((()=>(e=>e.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,"index","pageIndex",Tn.operationColumn].includes(e.dataIndex))))(l)),[l]),i={[`${ae("table")}-clipboard`]:!0},o={visible:a,title:d("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>r(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:le()(i),title:d("qm.table.clipboard.text"),onClick:()=>r(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.CopyOutlined,null))),t().createElement(It,o,t().createElement(ni,{columns:n,onClose:()=>r(!1)})))},oi=e=>{const{columns:l,onClose:a}=e,{tableProps:r,tableRef:n,$size:i,selectionKeys:o,setSelectionKeys:s}=t().useContext(cn),{rowKey:c}=r,u=e=>e.map((e=>{const t={dataIndex:e.dataIndex,title:e.title,width:e.width,precision:e.precision,dictItems:e.dictItems??[],render:e.render};return Array.isArray(e.children)&&(t.children=u(e.children)),t})),[p,m]=t().useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...u(l.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,"index","pageIndex",Tn.operationColumn].includes(e.dataIndex))))]),[h]=t().useState(n.current.selectionRows.map((e=>({...e,children:void 0}))));return t().createElement(t().Fragment,null,t().createElement(Zi,{size:i,columns:p,dataSource:h,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=>m(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(G,{onClick:()=>a()},d("qm.table.selectCollection.closeButton"))))},si=e=>{const{columns:l}=e,{tableProps:a,getRowKey:r,isFetch:n,setSelectionKeys:i,setSelectionRows:o}=t().useContext(cn),{rowSelection:s}=a,[c,u]=t().useState(!1);t().useEffect((()=>{p()}),[]);const p=async()=>{const{fetchSelectedRows:e,disabled:t=(e=>!1)}=s;if(n&&e)try{const l=await e.api(e.params);if(200===l.code){let a=Array.isArray(l.data)?l.data:(0,Nt.get)(l.data,e.dataKey)??[];a=a.filter((e=>!t(e))),o(a),i(a.map(((e,t)=>r(e,t))))}}catch(e){}},m=ae("table"),h={visible:c,title:d("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>u(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:`${m}-select-collection`,title:d("qm.table.selectCollection.text"),onClick:()=>u(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.CheckSquareOutlined,null))),t().createElement(It,h,t().createElement(oi,{columns:l,onClose:()=>u(!1)})))},ci=require("localforage");var di=__webpack_require__.n(ci);const ui=e=>{const{columns:l,group:a,summary:r}=e,{tableRef:n,tableProps:o,$size:s,pagination:c,fetchParams:u,isFetch:p}=t().useContext(cn),{fetch:m}=o,h=e=>{const t=l.find((t=>t.dataIndex===e));return{title:t.title,precision:t.precision,dictItems:t.dictItems??[]}},f=a.map((e=>({dataIndex:e.group,...h(e.group)}))),g=r.map((e=>e.summary===Tn.groupSummary.total.value?{dataIndex:e.summary,title:Tn.groupSummary.total.text,formula:e.formula}:{dataIndex:e.summary,...h(e.summary),formula:e.formula})),b=t().useMemo((()=>Object.assign({},u,{[Tn.sorterFieldName]:void 0,[Tn.groupSummary.summaryFieldName]:r.map((e=>`${e.formula}|${e.summary}`)).join(","),[Tn.groupSummary.groupbyFieldName]:a.map((e=>e.group)).join(","),usedJH:2,[Tn.currentPageName]:1})),[u,a,r]),[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 a=null===(t=l.find((t=>t.dataIndex===e.dataIndex)))||void 0===t?void 0:t.groupSummary;let r=a?{summation:a}:null;return e.dataIndex===Tn.groupSummary.total.value&&(r={dataIndex:Tn.groupSummary.recordTotalIndex,summation:{render:()=>c.total}}),{...e,..."count"===e.formula||"sum"===e.formula?r:null}}))])(f,g)),[x]=t().useState(p?[]:(e=>{const t=(0,Cn.v9)(e,a.map((e=>e.group))),l=[];return t.forEach((e=>{const t={};y.forEach((l=>{const{dataIndex:a}=l;"index"!==a&&(0,Cn.dN)(t,a,(0,Cn.C_)(e[0],a))})),r.forEach((l=>{const a=l.summary!==Tn.groupSummary.total.value?l.summary:Tn.groupSummary.recordTotalIndex,r=l.formula;"count"===r&&(0,Cn.dN)(t,a,e.length),"sum"===r&&(0,Cn.dN)(t,a,(0,Nt.sumBy)(e,a)),"max"===r&&(0,Cn.dN)(t,a,(0,Nt.maxBy)(e,a)[a]),"min"===r&&(0,Cn.dN)(t,a,(0,Nt.minBy)(e,a)[a]),"avg"===r&&(0,Cn.dN)(t,a,((0,Nt.sumBy)(e,a)/e.length).toFixed(2))})),l.push(t)})),l})(n.current.tableFullData)),E={size:s,height:400,...p?{fetch:{api:m.api,params:b,dataKey:null==m?void 0:m.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(Zi,E)},pi=e=>{const{onClose:l}=e,{global:a}=t().useContext(r),{tableProps:n,$size:i,flattenColumns:o}=t().useContext(cn),{uniqueKey:s}=n,c=t().useRef(null),u=t().useRef(null),[p,m]=t().useState(!1),[f,g]=t().useState([]),[b,y]=t().useState(""),[v,x]=t().useState("");ye((()=>{if(v){const{group:e,summary:t}=f.find((e=>e.value===v)).list;_(e),A(t)}else _([]),A([])}),[v]),t().useEffect((()=>{L()}),[]);const C=t().useMemo((()=>s?`summary_${s}`:""),[s]),S=t().useMemo((()=>o.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,"index","pageIndex",Tn.operationColumn].includes(e.dataIndex)))),[o]),w=S.filter((e=>!e.groupSummary)).map((e=>({text:e.title,value:e.dataIndex}))),T=[Tn.groupSummary.total,...S.filter((e=>!!e.groupSummary)).map((e=>({text:e.title,value:e.dataIndex})))],I=[{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"}],[N,_]=t().useState([]),[R,P]=t().useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,l)=>t().createElement("div",null,t().createElement(G,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(l)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:d("qm.table.groupSummary.groupItem"),width:200,editRender:e=>({type:"select",editable:!0,items:w.map((e=>({...e,disabled:N.findIndex((t=>t.group===e.value))>-1})))})}]),[O,A]=t().useState([]),[k,F]=t().useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,l)=>t().createElement("div",null,t().createElement(G,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(l)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:d("qm.table.groupSummary.summaryColumn"),width:200,editRender:e=>({type:"select",editable:!0,items:T.map((e=>({...e,disabled:O.findIndex((t=>t.summary===e.value))>-1}))),onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:d("qm.table.groupSummary.calcFormula"),width:150,editRender:e=>({type:"select",editable:!0,items:e.summary===Tn.groupSummary.total.value?I.slice(I.length-1):I})}]),q=t().useMemo((()=>{const e=N.length&&N.every((e=>Object.values(e).every((e=>""!==e)))),t=O.length&&O.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[N,O]),L=async()=>{if(!C)return;let e=await di().getItem(C);e||(e=await D(C),Array.isArray(e)&&await di().setItem(C,e)),Array.isArray(e)&&e.length&&(g(e),x(e[0].value))},D=async e=>{const t=null==a?void 0:a.getComponentConfigApi;if(t)try{const l=await t({key:e});if(200===l.code)return l.data}catch(e){}},H=async(e,t)=>{const l=null==a?void 0:a.saveComponentConfigApi;if(l)try{await l({[e]:t})}catch(e){}},$=ae("table"),M={visible:p,title:d("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>m(!1)};return t().createElement("div",{className:`${$}-group-summary__setting`},t().createElement("div",{className:"main"},t().createElement("div",{style:{width:"30%"}},t().createElement(Zi,{ref:c,size:i,columns:R,dataSource:N,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onDataChange:e=>{_(e)}},t().createElement(G,{type:"primary",icon:t().createElement(re.PlusOutlined,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t().createElement("div",{className:"container line"},t().createElement(Zi,{ref:u,size:i,columns:k,dataSource:O,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>F(e),onDataChange:e=>{A(e)}},t().createElement(G,{type:"primary",icon:t().createElement(re.PlusOutlined,null),onClick:()=>{u.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(E.Input,{size:i,value:b,placeholder:d("qm.table.groupSummary.configText"),disabled:q,onChange:e=>{const{value:t}=e.target;y(t)}}),t().createElement(G,{type:"primary",disabled:!b||q,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!C)return h("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,Cn.wE)(),t=[...f,{text:b,value:e,list:{group:N.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))}}];g(t),x(e),y(""),await di().setItem(C,t),await H(C,t)})()},d("qm.table.groupSummary.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${Tn.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:le()({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 di().setItem(C,t),await H(C,t)})(e.value)}},t().createElement(re.CloseCircleOutlined,null))))),!f.length&&t().createElement("div",{style:{padding:un}},t().createElement(ze,null)))))),t().createElement(It,M,t().createElement(ui,{columns:S,group:N,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(G,{onClick:()=>l(),style:{marginRight:8}},d("qm.table.groupSummary.closeButton")),t().createElement(G,{type:"primary",disabled:q,onClick:()=>m(!0)},d("qm.table.groupSummary.confirmButton"))))},mi=()=>{const[e,l]=t().useState(!1),a=ae("table"),r={visible:e,title:d("qm.table.groupSummary.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>l(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:`${a}-group-summary`,title:d("qm.table.groupSummary.text"),onClick:()=>l(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.PieChartOutlined,null))),t().createElement(It,r,t().createElement(pi,{onClose:()=>l(!1)})))};var hi=__webpack_require__(762);const fi=e=>{const{onClose:l}=e,{global:a}=t().useContext(r),{tableProps:n,$size:i,flattenColumns:o,setSuperFilters:s,clearTableFilter:c}=t().useContext(cn),{uniqueKey:u}=n,p=t().useRef(null),[m,f]=t().useState([]),[g,b]=t().useState([]),[y,v]=t().useState(""),[x,C]=t().useState("");ye((()=>{f(x?g.find((e=>e.value===x)).list:[])}),[x]),t().useEffect((()=>{F()}),[]);const S=t().useMemo((()=>u?`superSearch_${u}`:""),[u]),w=t().useMemo((()=>o.filter((e=>!!e.filter))),[o]),T=(0,Cn.TQ)(m),I=t().useMemo((()=>!(T&&(0,hi.$P)(T))),[T]),N=[{value:"and",text:d("qm.table.highSearch.andText")},{value:"or",text:d("qm.table.highSearch.orText")}],_=o.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:e.title}))),R=e=>["in","nin"].includes(e),P=(e,t)=>{let l;switch(e){case"number":l="number";break;case"date":l="date";break;case"checkbox":case"radio":l=t?"select-multiple":"select";break;default:l="text"}return l},O=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},[A,k]=t().useState([{title:d("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,l)=>t().createElement("div",null,t().createElement(G,{type:"text",onClick:()=>{p.current.REMOVE_RECORDS(l)}},d("qm.table.highSearch.removeText")))},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,l)=>t().createElement("span",{style:{fontSize:"20px"}},e)},{title:d("qm.table.highSearch.fieldName"),dataIndex:"fieldName",required:!0,editRender:e=>({type:"select",editable:!0,items:_,rules:[{required:!0,message:d("qm.table.highSearch.noEmpty")}],onChange:t=>{var l,a;const r=Object.values(t)[0],n=null===(l=w.find((e=>e.dataIndex===r)))||void 0===l?void 0:l.filter.type,i=O(n);e.fieldType=n,e.expression=r?null===(a=i[0])||void 0===a?void 0:a.value:"",e.condition=R(e.expression)?[]:"",r||(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 l=null===(t=w.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:O(l),extra:{disabled:!e.fieldName,clearable:!1},onChange:()=>{e.condition=R(e.expression)?[]:""}}}},{title:d("qm.table.highSearch.condition"),dataIndex:"condition",width:160,editRender:e=>{var t;const l=w.find((t=>t.dataIndex===e.fieldName)),a=null==l?void 0:l.filter.type,r=(null==l||null===(t=l.filter)||void 0===t?void 0:t.items)??(null==l?void 0:l.dictItems)??[];return{type:P(a,R(e.expression)),editable:!0,items:r,extra:{disabled:!e.fieldName}}}},{title:d("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,l)=>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:N,extra:{disabled:!e.fieldName,clearable:!1}})}]),F=async()=>{if(!S)return;let e=await di().getItem(S);e||(e=await q(S),Array.isArray(e)&&await di().setItem(S,e)),Array.isArray(e)&&e.length&&(b(e),C(e[0].value))},q=async e=>{const t=null==a?void 0:a.getComponentConfigApi;if(t)try{const l=await t({key:e});if(200===l.code)return l.data}catch(e){}},L=async(e,t)=>{const l=null==a?void 0:a.saveComponentConfigApi;if(l)try{await l({[e]:t})}catch(e){}},D=ae("table");return t().createElement("div",{className:`${D}-super-search__setting`},t().createElement("div",{className:"main"},t().createElement("div",{className:"container"},t().createElement(Zi,{ref:p,size:i,columns:A,dataSource:m,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>k(e),onRowClick:(e,t)=>{const{dataIndex:l}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(l)&&("bracketLeft"===l&&(e[l]=e[l]?"":"("),"bracketRight"===l&&(e[l]=e[l]?"":")"),f([...m]))},onDataChange:e=>{f(e)}},t().createElement(G,{type:"primary",icon:t().createElement(re.PlusOutlined,null),onClick:()=>{p.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),Tn.highSearch.showSQL&&T&&t().createElement("code",{className:"lang-js"},T)),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(E.Input,{size:i,value:y,placeholder:d("qm.table.highSearch.configText"),disabled:I,onChange:e=>{const{value:t}=e.target;v(t)}}),t().createElement(G,{type:"primary",disabled:!y||I,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!S)return h("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,Cn.wE)(),t=[...g,{text:y,value:e,list:m.filter((e=>!!e.fieldName))}];b(t),C(e),v(""),await di().setItem(S,t),await L(S,t)})()},d("qm.table.highSearch.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${Tn.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:le()({selected:e.value===x}),title:e.text,onClick:()=>(e=>{C(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&&C(""),await di().setItem(S,t),await L(S,t)})(e.value)}},t().createElement(re.CloseCircleOutlined,null))))),!g.length&&t().createElement("div",{style:{padding:un}},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(G,{onClick:()=>l(),style:{marginRight:8}},d("qm.table.highSearch.closeButton")),t().createElement(G,{type:"primary",disabled:I,onClick:()=>(c(),s(m.map((e=>U()(e,["index","pageIndex"])))),void l())},d("qm.table.highSearch.searchButton"))))},gi=()=>{const[e,l]=t().useState(!1),a=ae("table"),r={visible:e,title:d("qm.table.highSearch.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>l(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:`${a}-super-search`,title:d("qm.table.highSearch.text"),onClick:()=>l(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.FunnelPlotOutlined,null))),t().createElement(It,r,t().createElement(fi,{onClose:()=>l(!1)})))},bi=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/.test(e),yi=e=>{const{onClose:l}=e,{global:a}=t().useContext(r),{tableProps:n,tableRef:i,getRowKey:o,$size:s,flattenColumns:c,pagination:u,setPagination:p,scrollYToRecord:m,setHighlightKey:f,setShouldToTop:g,isTreeTable:b,isWebPagination:y}=t().useContext(cn),{uniqueKey:v}=n,x=t().useRef(null),C=t().useRef(null),S=t().useRef([]),w=t().useRef(""),T=t().useRef(-1),I=t().useRef("stop");ye((()=>{const{current:e,pageSize:t}=u,l=i.current.tableFullData.slice((e-1)*t,e*t),a=(0,Cn.tL)(l).findIndex((e=>o(e,e.index)===w.current));m("",a)}),[u.current]);const N=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:N(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(),[l,a]=await C.current.GET_FORM_DATA(),r=(0,Nt.omitBy)(Object.assign({},t,a),z.xb);A(r)}}))),R={case:0,fullchar:0},P=t().useMemo((()=>c.filter((e=>![Tn.expandableColumn,Tn.selectionColumn,"index","pageIndex",Tn.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[c]),[O,A]=t().useState({}),[k,F]=t().useState(R),[q]=t().useState(_([P[0]])),[L]=t().useState(_(P.slice(1))),[D,H]=t().useState(0),$=t().useMemo((()=>!Object.keys(O).length),[O]);ye((()=>{I.current="ready"}),[O,k]);const M=e=>{F(Object.assign({},k,e))},K=(e,t,l)=>new Promise(((a,r)=>{E.Modal.confirm({title:d("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),a()},onCancel:()=>{l(),a()}})})),V=async e=>{if(!Object.keys(O).length)return E.Modal.warning({title:d("qm.button.confirmPrompt"),content:d("qm.table.fastSearch.queryCondition")});if("ready"===I.current&&(I.current="stop",S.current=(e=>{const{allTableData:t}=i.current,l=[];for(let a=0,r=t.length;a<r;a++){const r=t[a];let n=!0;for(const t in e){const{type:l}=P.find((e=>e.dataIndex===t)).filter;let a=(0,Cn.C_)(r,t),i=!0;if("text"===l||"textarea"===l?i=new RegExp(k.fullchar?`^${e[t]}$`:e[t],k.case?"":"i").test(a):(a=bi(a)?a.slice(0,10):a,i=a==e[t]),!i){n=!1;break}}n&&l.push(r)}return l})(O),H(S.current.length)),!S.current.length)return f(""),E.Modal.warning({title:d("qm.button.confirmPrompt"),content:d("qm.table.fastSearch.notMatch")});"next"===e&&(T.current=T.current<0?0:T.current+1,T.current>S.current.length-1&&await K(d("qm.table.fastSearch.toTheEnd"),(()=>T.current=0),(()=>T.current=S.current.length-1))),"prev"===e&&(T.current=T.current<0?S.current.length-1:T.current-1,T.current<0&&await K(d("qm.table.fastSearch.toStart"),(()=>T.current=S.current.length-1),(()=>T.current=0)));const t=S.current[T.current],l=o(t,t.index);let a=t.index;if(b&&y){const e=(0,Cn.Qi)(i.current.deriveRowKeys,l)[0];a=i.current.tableFullData.findIndex((t=>o(t,t.index)===e))}((e,t)=>{if(w.current=e,y){const{pageSize:e}=u,l=Math.ceil((t+1)/e);g(!1),p(Object.assign({},u,{current:l}))}else m(e)})(l,a),f(l)},j=()=>{x.current.RESET_FORM(),C.current.RESET_FORM()},B=t().useMemo((()=>v?`fastSearch_${v}`:""),[v]),[W,Y]=t().useState([]),[Z,X]=t().useState(""),[Q,J]=t().useState("");ye((()=>{if(Q){const{filters:e,config:t}=W.find((e=>e.value===Q)).list;x.current.SET_FIELDS_VALUE(U()(e,L.map((e=>e.fieldName)))),C.current.SET_FIELDS_VALUE(U()(e,q.map((e=>e.fieldName)))),A(e),F(t)}else j(),A({}),F(R)}),[Q]),t().useEffect((()=>{ee()}),[]);const ee=async()=>{if(!B)return;let e=await di().getItem(B);e||(e=await te(B),Array.isArray(e)&&await di().setItem(B,e)),Array.isArray(e)&&e.length&&(Y(e),J(e[0].value))},te=async e=>{const t=null==a?void 0:a.getComponentConfigApi;if(t)try{const l=await t({key:e});if(200===l.code)return l.data}catch(e){}},ne=async(e,t)=>{const l=null==a?void 0:a.saveComponentConfigApi;if(l)try{await l({[e]:t})}catch(e){}},ie=ae("table");return t().createElement("div",{className:`${ie}-fast-search__setting`},t().createElement("div",{className:"main"},t().createElement("div",{className:"top"},t().createElement("div",{className:"container"},t().createElement(gt,{defaultActiveKey:"1",size:"small",tabBarExtraContent:t().createElement("span",null,d("qm.table.alert.total",{total:D}))},t().createElement(gt.TabPane,{tab:d("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},t().createElement(Cr,{ref:x,items:q,cols:1,labelWidth:110})),t().createElement(gt.TabPane,{tab:d("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},t().createElement(Cr,{ref:C,items:L,cols:1,labelWidth:110})))),t().createElement("div",{className:"saved line"},t().createElement("div",{className:"form-wrap"},t().createElement(E.Input,{size:s,value:Z,placeholder:d("qm.table.highSearch.configText"),disabled:$,onChange:e=>{const{value:t}=e.target;X(t)}}),t().createElement(G,{type:"primary",disabled:!Z||$,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!B)return h("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=(0,Cn.wE)(),t=[...W,{text:Z,value:e,list:{filters:O,config:k}}];Y(t),J(e),X(""),await di().setItem(B,t),await ne(B,t)})()},d("qm.table.highSearch.saveButton"))),t().createElement("div",{className:"card-wrap"},t().createElement("h5",{style:{height:`${Tn.rowHeightMaps[s]}px`}},t().createElement("span",null,d("qm.table.fastSearch.savedSetting"))),t().createElement("ul",null,W.map((e=>t().createElement("li",{key:e.value,className:le()({selected:e.value===Q}),title:e.text,onClick:()=>(e=>{J(e!==Q?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=W.filter((t=>t.value!==e));Y(t),e===Q&&J(""),await di().setItem(B,t),await ne(B,t)})(e.value)}},t().createElement(re.CloseCircleOutlined,null))))),!W.length&&t().createElement("div",{style:{padding:un}},t().createElement(ze,null)))))),t().createElement("div",{className:"bottom"},t().createElement("div",null,t().createElement(E.Checkbox,{checked:!!k.case,onChange:e=>M({case:e.target.checked})},d("qm.table.fastSearch.matchCase")),t().createElement(E.Checkbox,{checked:!!k.fullchar,onChange:e=>M({fullchar:e.target.checked})},d("qm.table.fastSearch.matchFullchar"))),t().createElement("div",null,t().createElement(G,{onClick:()=>j()},d("qm.table.fastSearch.clear"))))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${Sl[s]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(G,{onClick:()=>l(),style:{marginRight:8}},d("qm.table.fastSearch.closeButton")),t().createElement(G,{type:"primary",style:{marginRight:8},onClick:()=>V("prev")},d("qm.table.fastSearch.queryPrev")),t().createElement(G,{type:"primary",onClick:()=>V("next")},d("qm.table.fastSearch.queryNext"))))},vi=()=>{const{tableProps:e,$size:l}=t().useContext(cn),[a,r]=t().useState(!1),n=ae("table"),i={visible:a,title:d("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${Sl[l]+20}px`},onClose:()=>r(!1)};return t().createElement(t().Fragment,null,t().createElement("span",{className:`${n}-super-search`,title:d("qm.table.fastSearch.text"),onClick:()=>r(!0)},t().createElement("i",{className:"svgicon icon"},t().createElement(re.MonitorOutlined,null))),t().createElement(It,i,t().createElement(yi,{onClose:()=>r(!1)})))},xi=e=>{const{columns:l}=e,{global:a}=t().useContext(r),{tableProps:n,tableRef:i,$size:o}=t().useContext(cn),{uniqueKey:s,onlyShowIcon:c,columnsChange:u}=n,p=t().useRef([]),m=e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)),h=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(m(l)),[x,C]=t().useState(h(l)),[S,w]=t().useState(f(l)),T=t().useMemo((()=>s?`table_${s}`:""),[s]),I=t().useMemo((()=>[...y,...S,...x]),[y,S,x]);ye((()=>{P(l),R(l),N(l)}),[l]),t().useEffect((()=>{_()}),[]);const N=e=>{if(!T)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}})),l=JSON.parse(localStorage.getItem(T));(0,Nt.isEqual)(t,l)||(localStorage.setItem(T,JSON.stringify(t)),(async(e,t)=>{const l=null==a?void 0:a.saveComponentConfigApi;if(l)try{await l({[e]:t})}catch(e){}})(T,t))},_=()=>{const e=(()=>{if(!T)return;const e=JSON.parse(localStorage.getItem(T));return e||(async e=>{const t=null==a?void 0:a.getComponentConfigApi;if(t)try{const l=await t({key:e});if(200===l.code)return l.data}catch(e){}})(T).then((e=>{if(!e)return N(l);localStorage.setItem(T,JSON.stringify(e)),_()})).catch((()=>{})),e?(0,Nt.xor)(e.map((e=>e.dataIndex)),l.map((e=>e.dataIndex))).length>0?l.map((t=>{const{dataIndex:l}=t,a=e.find((e=>e.dataIndex===l));return a?(void 0!==a.hidden&&(t.hidden=a.hidden),void 0!==a.fixed&&(t.fixed=a.fixed),void 0!==a.width&&(t.width=a.width),void 0!==a.renderWidth&&(t.renderWidth=a.renderWidth),t):t})):e.map((e=>{const t=l.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=m(e),l=h(e),a=f(e);return v(t),C(l),w(a),[...t,...a,...l]},P=e=>{const t=[];e.filter((e=>!e.noAuth)).forEach(((l,a)=>{const r=l.colSpan;r>1&&e.slice(a+1,a+r).every((e=>{let{colSpan:t}=e;return 0===t}))&&t.push(e.slice(a,a+r))})),p.current=t},O=()=>{const e=[];I.forEach((t=>{const{colSpan:l,dataIndex:a}=t;if(0===l)return;if(1===l)return e.push(t);const r=p.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(a)));if(-1===r)return e.push(t);e.push(...p.current[r].map(((e,l)=>{let{dataIndex:a}=e;const r=I.find((e=>e.dataIndex===a));return l>0&&(void 0!==t.hidden&&(r.hidden=t.hidden),void 0!==t.fixed?r.fixed=t.fixed:r.fixed&&delete r.fixed),r})))})),l.forEach(((t,l)=>{t.noAuth&&e.findIndex((e=>e.dataIndex===t.dataIndex))<0&&e.splice(l,0,t)})),null==u||u(e)},A=(e,t)=>{t?e.fixed=t:delete e.fixed;const a=R(l);null==u||u(a)},k=(e,a)=>{const{colSpan:r}=e;if(0===r)return t().createElement("li",{key:e.dataIndex,style:{display:"none"}});const n=["svgicon","handle",`${a}-handle`];return t().createElement("li",{key:e.dataIndex,className:"item"},t().createElement(E.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:a}=t.target;e.hidden=!a,R(l),O()}}),t().createElement("i",{className:le()(n),title:d("qm.table.columnFilter.draggable")},t().createElement(re.HolderOutlined,null)),t().createElement("span",{className:"text",title:e.title},e.title),"main"===a?t().createElement("span",{className:"fixed"},t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.fixedLeft"),onClick:()=>A(e,"left")},t().createElement(re.StepBackwardOutlined,null)),t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.fixedRight"),onClick:()=>A(e,"right")},t().createElement(re.StepForwardOutlined,null))):t().createElement("span",{className:"fixed"},t().createElement("i",{className:"svgicon",title:d("qm.table.columnFilter.cancelFixed"),onClick:()=>A(e)},t().createElement(re.CloseCircleOutlined,null))))},F=ae("table"),q={[`${F}__popper`]:!0,"column-filter__popper":!0,[`${F}--lg`]:"large"===o,[`${F}--sm`]:"small"===o},L=[`${F}-column-filter`,{selected:g}];return t().createElement(Aa(),{action:["click"],popupVisible:g,popup:t().createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},t().createElement("div",{className:"reset"},t().createElement(G,{type:"text",size:"small",onClick:()=>{const e=(0,Nt.cloneDeep)(i.current.originColumns);R(e),null==u||u(e)}},d("qm.table.columnFilter.reset"))),t().createElement("div",{className:"left"},t().createElement(al.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),l=y.map((e=>e.dataIndex));(0,Nt.isEqual)(t,l)||v(e)},onEnd:()=>O()},y.map((e=>k(e,"left"))))),t().createElement("div",{className:"divider"}),t().createElement("div",{className:"main"},t().createElement(al.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:S,setList:e=>{const t=e.map((e=>e.dataIndex)),l=S.map((e=>e.dataIndex));(0,Nt.isEqual)(t,l)||w(e)},onEnd:()=>O()},S.map((e=>k(e,"main"))))),t().createElement("div",{className:"divider"}),t().createElement("div",{className:"right"},t().createElement(al.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:x,setList:e=>{const t=e.map((e=>e.dataIndex)),l=x.map((e=>e.dataIndex));(0,Nt.isEqual)(t,l)||C(e)},onEnd:()=>O()},x.map((e=>k(e,"right")))))),popupClassName:le()(q),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{b(e)},builtinPlacements:yn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t().createElement("span",{className:le()(L),title:c?d("qm.table.columnFilter.text"):void 0},t().createElement("i",{className:"svgicon icon"},t().createElement(re.SettingOutlined,null)),!c&&t().createElement("span",null,d("qm.table.columnFilter.text"))))},Ei=()=>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 Ci(){return Ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Ci.apply(this,arguments)}const Si=e=>{const{column:l,filters:a}=e,{$size:r,setFilters:n,clearSuperFilters:i}=t().useContext(cn),o=t().useRef(null),s=t().useRef(null),c=t().useRef(null),[u,p]=t().useState(!1),[m,f]=t().useState({}),g=t().useMemo((()=>{const{dataIndex:e,filter:t}=l;return`${e}|${t.type}`}),[l]),b=t().useMemo((()=>{let e=!1;for(const t in a[g])if(!(0,z.xb)(a[g][t])){e=!0;break}return e}),[g,a]);t().useEffect((()=>{u&&((0,z.xb)(a[g])&&y(),setTimeout((()=>v()),50))}),[u]);const y=()=>{f({})},v=()=>{switch(l.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 l in e[t])(0,z.xb)(e[t][l])&&delete e[t][l];Object.keys(e[t]).length||delete e[t]}return e})({...a,...m,...e})),S(!1)},C={text:e=>{var l;const{title:a}=e;return t().createElement(E.Input,{ref:o,size:r,placeholder:d("qm.table.filter.searchText",{text:a}),style:{width:"180px"},value:(null===(l=m[g])||void 0===l?void 0:l.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 l;const{title:a}=e;return t().createElement(E.Input.TextArea,{ref:c,size:r,placeholder:d("qm.table.filter.searchAreaText",{text:a}),style:{width:"220px"},value:(null===(l=m[g])||void 0===l?void 0:l.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 l=e=>{var t;return{value:(null===(t=m[g])||void 0===t?void 0:t[e])??"",onChange:t=>{f((l=>Object.assign({},l,{[g]:Object.assign({},l[g],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t().createElement("ul",null,t().createElement("li",null,t().createElement("span",null,"> "),t().createElement(E.InputNumber,Ci({ref:s,size:r},l(">"),{placeholder:d("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"< "),t().createElement(E.InputNumber,Ci({size:r},l("<"),{placeholder:d("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"= "),t().createElement(E.InputNumber,Ci({size:r},l("=="),{placeholder:d("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"!="),t().createElement(E.InputNumber,Ci({size:r},l("!="),{placeholder:d("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const l=e=>{var t;return{value:(0,Cn._3)(null===(t=m[g])||void 0===t?void 0:t[e],hn),format:hn,onChange:t=>{f((l=>Object.assign({},l,{[g]:Object.assign({},l[g],{[e]:(0,Cn.p6)(t,hn)})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return t().createElement("ul",null,t().createElement("li",null,t().createElement("span",null,"> "),t().createElement(R,Ci({size:r},l(">"),{placeholder:d("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"< "),t().createElement(R,Ci({size:r},l("<"),{placeholder:d("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"= "),t().createElement(R,Ci({size:r},l("=="),{placeholder:d("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t().createElement("li",null,t().createElement("span",null,"!="),t().createElement(R,Ci({size:r},l("!="),{placeholder:d("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var l;const{filter:a,dictItems:r=[]}=e,n=a.items||r;return t().createElement("ul",null,t().createElement(E.Radio.Group,{style:{width:"100%"},value:null===(l=m[g])||void 0===l?void 0:l["=="],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(E.Radio,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var l;const{filter:a,dictItems:r=[]}=e,n=a.items||r;return t().createElement("ul",null,t().createElement(E.Checkbox.Group,{style:{width:"100%"},value:null===(l=m[g])||void 0===l?void 0:l.in,onChange:e=>{f((t=>Object.assign({},t,{[g]:{in:e}})))}},n.map((e=>t().createElement("li",{key:e.value},t().createElement(E.Checkbox,{value:e.value,disabled:e.disabled},e.text))))))}},S=e=>{p(e)},w=ae("table"),T={[`${w}__popper`]:!0,[`${w}--lg`]:"large"===r,[`${w}--sm`]:"small"===r},I=["cell--filter",{selected:u,actived:b}];return t().createElement(Aa(),{action:["click"],popupVisible:u,popup:(()=>{const e=l.filter.type,a=C[e];return a?t().createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},t().createElement("div",null,a(l)),t().createElement(E.Space,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},t().createElement(G,{size:r,onClick:()=>{x({[g]:{}})}},d("qm.table.filter.reset")),t().createElement(G,{type:"primary",size:r,onClick:()=>x()},d("qm.table.filter.search")))):(h("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:le()(T),popupStyle:{minWidth:150},onPopupVisibleChange:S,builtinPlacements:yn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t().createElement("div",{className:le()(I),title:d("qm.table.filter.text"),onClick:e=>e.stopPropagation()},t().createElement("span",{className:"svgicon icon"},t().createElement(Ei,null))))},wi=e=>{const{column:l}=e,{tableProps:a,tableRef:r,bordered:n}=t().useContext(cn),{columns:i,resizable:o,columnsChange:s=z.ZT}=a,c={resizable:!0,"is--line":o&&!n};return t().createElement("div",{className:le()(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:a}=r.current,n=a.$resizableBar,o=t.offsetWidth/2,c=e.clientX,d=(0,Cn.tj)(t,a.$table).left-a.$tableBody.parentNode.scrollLeft+o;a.$table.classList.add("c--resize"),n.style.left=`${d}px`,n.style.display="block";const u=l.width||l.renderWidth;let p=u;return document.onmousemove=function(e){if("number"!=typeof u)return;const t=e.clientX-c,l=u+t;l<Tn.defaultColumnWidth||(p=Math.floor(l),n.style.left=`${t+d}px`)},document.onmouseup=function(){a.$table.classList.remove("c--resize"),n.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(l.renderWidth=p,l.width=p,s([...i]))},!1}})},Ti=e=>{const{selectionKeys:l}=e,{tableRef:a,tableProps:r,getRowKey:n,pagination:i,fetchParams:o,setSelectionKeys:s,setSpinning:c,isWebPagination:u}=t().useContext(cn),{rowSelection:p}=r,{fetchAllRowKeys:m,onSelectAll:h}=p,f=(()=>{const{allTableData:e,allRowKeys:t}=a.current,{selectAllOnCurrentPage:l,disabled:r=(e=>!1)}=p;return l?(()=>{const{tableFullData:e}=a.current,{current:t,pageSize:l}=i;return u?e.slice((t-1)*l,t*l):e})().filter((e=>!r(e))).map((e=>n(e,e.index))):t.filter(((t,l)=>!r(e[l])))})(),g=t().useMemo((()=>p.selectAllOnCurrentPage??!1),[p]),b=t().useMemo((()=>(p.filterable??!0)&&!g),[p,g]),y=t().useMemo((()=>l.length>0&&l.length<(m?i.total:f.length)),[l.length,f.length,i.total]),v=t().useMemo((()=>!y&&l.length>0),[y,l.length]),x=async()=>{const e=m;let t=[];c(!0);try{const l=await e.api(o);200===l.code&&(t=Array.isArray(l.data)?l.data:(0,z.U2)(l.data,e.dataKey)??[])}catch(e){}return c(!1),t},C=async e=>{let t=[];t=m?e?await x():[]:e?f.slice(0):[],s(t),null==h||h(e,t)};return t().createElement("div",{className:"cell--selection"},t().createElement(E.Checkbox,{checked:v,indeterminate:y,disabled:!f.length,onChange:e=>C(e.target.checked)}),b&&t().createElement(E.Dropdown,{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=m?(0,Nt.xor)(l,await x()):(0,Nt.xor)(l,f),s(e)})()},{key:3,label:d("qm.table.selection.clear"),onClick:()=>{C(!1)}}];return t().createElement(E.Menu,{items:e})})()},t().createElement(re.DownOutlined,{className:"svgicon icon"})),g&&t().createElement(E.Tooltip,{placement:"top",title:d("qm.table.selection.currentPage")},t().createElement(re.InfoCircleOutlined,{className:"info"})))},Ii=e=>{const{style:l}=e,{tableProps:a,tableRef:r,isTreeTable:n,setRowExpandedKeys:i}=t().useContext(cn),{expandable:o}=a,[s,c]=t().useState((null==o?void 0:o.defaultExpandAllRows)||!1);ye((()=>{const{allRowKeys:e,flattenRowKeys:t}=r.current;i(s?e.filter((e=>!(n&&t.includes(e)))):[])}),[s]);const d={[`${ae("expand")}--icon`]:!0,expanded:s,collapsed:!s};return t().createElement("span",{className:le()(d),title:"",onClick:e=>{e.stopPropagation(),c(!s)},style:l})},Ni=()=>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"})),_i=()=>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"})),Ri=e=>{const{tableColumns:l,flattenColumns:a,sorter:r,filters:n}=e,{getRowKey:i,tableProps:o,tableRef:s,layout:c,scrollY:u,superFilters:p,selectionKeys:m,rightFixedColumns:h,firstDataIndex:f,isFetch:g,isTreeTable:b,isGroupSubtotal:y,tableChange:v,setSorter:x,setElementStore:C,resetTableScroll:S,getStickyLeft:w,getStickyRight:T,createGroupData:I,createTableFullData:N}=t().useContext(cn),{ellipsis:_,resizable:R,multipleSort:P,rowSelection:O,expandable:A}=o,[k,F]=Tn.sortDirections,q=t().useRef(null),L=t().useMemo((()=>!g),[g]),D=t().useMemo((()=>!g),[g]),H=t().useMemo((()=>!(null!=A&&A.hideExpandAll)),[A]),$=t().useMemo((()=>g?!!(null!=O&&O.selectAllOnCurrentPage||null!=O&&O.fetchAllRowKeys):!(null!=O&&O.hideSelectAll)),[g,O]);ye((()=>{j(),v(),S()}),[r]),ye((()=>{G(),v(),S()}),[n]),ye((()=>{G(),v(),S()}),[p]),t().useEffect((()=>{M()}),[]);const M=()=>{C("$header",q.current)},K=e=>{const{dataIndex:l,type:a,sorter:n,title:i,description:o}=e;if(l===Tn.selectionColumn&&"checkbox"===a){if("checkbox"===a)return t().createElement("div",{className:"cell"},$?t().createElement(Ti,{selectionKeys:m}):d("qm.table.config.selectionText"));if("radio"===a)return t().createElement("div",{className:"cell"},i)}const s=[];return s.push(t().createElement("div",{key:0,className:"cell",title:i},b&&l===f&&H?t().createElement(Ii,null):null,l===Tn.expandableColumn&&H?t().createElement(Ii,null):i)),o&&s.push(t().createElement(E.Tooltip,{key:1,placement:"top",title:o},t().createElement(re.InfoCircleOutlined,{className:"tip"}))),n&&s.push(V(r[l])),s},V=e=>{const l=["svgicon cell--sorter__asc",{actived:e===k}],a=["svgicon cell--sorter__desc",{actived:e===F}];return t().createElement("div",{key:2,className:"cell--sorter",title:d("qm.table.sorter.text")},t().createElement("span",{className:le()(l)},t().createElement(Ni,null)),t().createElement("span",{className:le()(a)},t().createElement(_i,null)))},U=e=>t().createElement(Si,{column:e,filters:n}),z=(e,t)=>{const{sorter:l,dataIndex:a}=t;if(l){const e=r[a],t=e?e===F?null:F:k;P?(delete r[a],x(Object.assign({},r,{[a]:t}))):x(Object.assign({},{[a]:t}))}},j=()=>{L&&B()},B=e=>{const t=(0,Nt.pickBy)(r,(e=>null!==e));for(const e in t){const l=a.find((t=>t.dataIndex===e));l?W(l,t[e]):delete t[e]}e||Object.keys(t).length||W({dataIndex:"index"},k)},W=(e,t)=>{const{tableFullData:l}=s.current,{dataIndex:a,sorter:r}=e,n=(e,l)=>{const r=(0,Cn.C_)(e,a),n=(0,Cn.C_)(l,a);return Number.isNaN(r-n)?t===k?r.toString().localeCompare(n.toString()):n.toString().localeCompare(r.toString()):t===k?r-n:n-r},i=y?I((0,Cn.SX)(l).sort("function"==typeof r?r:n)):l.sort("function"==typeof r?r:n).slice(0);N(i)},G=()=>{D&&Y()},Y=()=>{const{tableOriginData:e}=s.current,t=p.length?(0,Cn.TQ)(p):(0,Cn.TQ)(n),l=""!==t?y?I((0,hi.ar)((0,Cn.SX)(e),t,b)):(0,hi.ar)(e,t,b):e;N(l),B(!0)},Z=(0,Cn.vo)(l),X=ae("table"),{tableBodyWidth:Q}=c;return t().createElement("div",{ref:q,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,a.map((e=>{const{dataIndex:l,width:a,renderWidth:r}=e;return t().createElement("col",{key:l,style:{width:`${a||r}px`,minWidth:`${a||r}px`}})})),u&&t().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t().createElement("thead",null,(e=>{const{isIE:l}=s.current,a=["gutter",{"cell-fix-right":!!h.length}],n=l?null:{right:h.length?0:""};return e.map(((e,l)=>t().createElement("tr",{key:l,className:"header--row"},e.map(((l,a)=>((e,l,a)=>{var n,i;const{isIE:o}=s.current,{gutterWidth:d}=c,{dataIndex:p,colSpan:m,rowSpan:h,fixed:f,align:g,sorter:b,filter:y,required:v,headRender:x}=e;if(0===m)return null;const E=["header--column",{"col--ellipsis":e.ellipsis??_,"col--center":"center"===g,"col--right":"right"===g,"column--required":!!v,"column-has-sorter":b,"column-has-filter":y,"column--sort":!!r[p],"cell-fix-left":!o&&"left"===f,"cell-fix-right":!o&&"right"===f,"cell-fix-left-last":!(o||"left"!==f||null!==(n=a[l+1])&&void 0!==n&&n.fixed),"cell-fix-right-first":!(o||"right"!==f||null!==(i=a[l-1])&&void 0!==i&&i.fixed)}],C=o?null:{left:"left"===f?`${w(p)}px`:"",right:"right"===f?`${T(p)+(u?d:0)}px`:""},S=R&&![Tn.expandableColumn,Tn.selectionColumn].includes(p);return t().createElement("th",{key:p,className:le()(E),colSpan:m,rowSpan:h,style:{...C},onClick:t=>z(t,e)},t().createElement("div",{className:"cell--wrapper"},x?t().createElement("div",{className:"cell--text cell"},x(e,s.current.tableFullData)):t().createElement(t().Fragment,null,t().createElement("div",{className:"cell--text"},K(e)),y?U(e):null)),S&&t().createElement(wi,{column:e}))})(l,a,e))),u&&t().createElement("th",{className:le()(a),style:{...n}}))))})(Z))))},Pi=()=>{const{tableProps:e,tableRef:l,flattenColumns:a,isDragMergeCell:r}=t().useContext(cn),{mergeCells:n=[],onMergeChange:i}=e,[o,s]=t().useState(!1),c=t().useRef(null),u=t().useRef(null),p=t().useRef({x:0,y:0,disX:0,disY:0});ye((()=>{r||b()}),[r]);const m=()=>{b(),Te(c.current,{display:"none"})},h=e=>{const t=[];for(let l=0;l<e.rowSpan;l++)for(let a=0;a<e.colSpan;a++)t.push([e.row+l,e.col+a]);return t},f=()=>{p.current={x:0,y:0,disX:0,disY:0},u.current&&!y(u.current)||(u.current=null,m()),s(!0),document.removeEventListener("mousemove",g)},g=e=>{const{pageX:t,pageY:l}=e,{x:a,y:r,disX:n,disY:i}=p.current;let o=n,s=i,d=t-a,u=l-r;return d<0&&(d=Math.abs(d),o=n-d,Te(c.current,{left:`${o}px`})),u<0&&(u=Math.abs(u),s=i-u,Te(c.current,{top:`${s}px`})),Te(c.current,{width:`${d}px`,height:`${u}px`}),x(o,s,d,u),!1},b=()=>{const{elementStore:e}=l.current,t=e.$tableBody.querySelectorAll("tbody > tr");for(let e=0;e<t.length;e++){const l=t[e].children;for(let e=0;e<l.length;e++)l[e].classList.remove("selected")}},y=e=>1===e.rowSpan&&1===e.colSpan,v=e=>e.width||e.renderWidth||0,x=(0,z.Ds)(((e,t,r,n)=>{const{allTableData:i,scrollYStore:o}=l.current;let s=-1,c=-1,d=-1,p=-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 m=0;for(let t=0;t<a.length;t++)e>m&&e<m+v(a[t])&&(d=t),e+r>m&&e+r<m+v(a[t])&&(p=t),m+=v(a[t]);const h={row:s,col:d,rowSpan:c-s+1,colSpan:p-d+1};(0,Nt.isEqual)(u,h)||(u.current=h,((e,t,a,r)=>{const{elementStore:n,scrollYStore:i}=l.current,o=n.$tableBody.querySelectorAll("tbody > tr");for(let l=0;l<o.length;l++){const n=o[l].children;for(let o=0;o<n.length;o++)if(n[o].classList.remove("selected"),(e!==t||a!==r)&&l+i.startIndex>=e&&l+i.startIndex<=t){const e=Number(n[o].getAttribute("colspan")),t=Number(n[o].getAttribute("data-index")),l=e>1?t+e-1:t;l>=a&&l<=r&&n[o].classList.add("selected")}}})(s,c,d,p))}),10);return{dragStart:e=>{const{pageX:t,pageY:a}=e,{elementStore:r}=l.current,{x:n,y:i}=(e=>{let t=0,l=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,l+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:l}})(r.$tableBody);u.current=null,p.current={x:t,y:a,disX:t-n,disY:a-i},Te(c.current,{width:0,height:0,left:t-n+"px",top:a-i+"px",display:"block"}),b(),s(!1),document.addEventListener("mousemove",g,{passive:!0}),document.addEventListener("mouseup",f,{passive:!0,once:!0})},renderDragPanel:()=>t().createElement("div",{ref:c,className:"merge-cell-bar",onMouseDown:e=>e.stopPropagation()},o&&t().createElement(t().Fragment,null,t().createElement(G,{size:"small",className:"btn cancel",onClick:()=>{if(u.current&&!y(u.current)){const e=h(u.current),t=n.findIndex((t=>{const l=h(t);return(0,Nt.intersectionWith)(l,e,Nt.isEqual).length===l.length}));-1!==t&&(null==i||i(n.filter(((e,l)=>l!==t))))}m()}},d("qm.table.mergeCell.cancel")),t().createElement(G,{size:"small",type:"primary",className:"btn confirm",onClick:()=>{if(u.current&&!y(u.current)){const e=h(u.current);let t=!1;for(let l=0;l<n.length;l++)(0,Nt.intersectionWith)(h(n[l]),e,Nt.isEqual).length&&(t=!0);t||null==i||i([...n,u.current])}m()}},d("qm.table.mergeCell.confirm")))),closeDragPanel:m}};const Oi=e=>{const{selectionKeys:l,column:a,record:r,rowKey:n}=e,{tableProps:i,tableRef:o,isTreeTable:s,getAllChildRowKeys:c}=t().useContext(cn),{rowSelection:d}=i,u=t().useMemo((()=>a.type),[a.type]),p=e=>{const t=d.checkStrictly??!0;if(!s||t)return!1;const a=(0,Cn.CD)(o.current.deriveRowKeys,e),r=c((null==a?void 0:a.children)??[]);return!(!Array.isArray(null==a?void 0:a.children)||(0,Cn.bY)(l,(null==a?void 0:a.children.map((e=>e.rowKey)))||[]))&&r.some((e=>l.includes(e)))};return"radio"===u?(()=>{const e=d.disabled,a=null==e?void 0:e(r),i=!a&&l[0]===n;return t().createElement(E.Radio,{checked:i,disabled:a})})():(()=>{const e=d.disabled,a=null==e?void 0:e(r),i=!(a||!l.includes(n));return t().createElement(E.Checkbox,{checked:i,indeterminate:p(n),disabled:a})})()},Ai=e=>{const{record:l,rowKey:a,style:r}=e,{tableProps:n,rowExpandedKeys:i,setRowExpandedKeys:o}=t().useContext(cn),{expandable:s={}}=n,[c]=t().useState("function"==typeof s.rowExpandable&&!s.rowExpandable(l)),d=t().useMemo((()=>i.includes(a)),[i,a]);ye((()=>{var e;null===(e=s.onExpand)||void 0===e||e.call(s,d,l)}),[d]);const u={[`${ae("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return t().createElement("span",{className:le()(u),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?i.filter((e=>e!==a)):[...i,a];o(t)},style:r})},ki=t().forwardRef(((e,l)=>{const{size:a,defaultValue:r,value:n,min:i,max:o,placeholder:s,maxLength:c,precision:d,readOnly:u,disabled:p}=e,m=e=>""!==e?Number(e):"",h=void 0!==n,[f,g]=t().useState((null==r?void 0:r.toString())??""),b=h?n.toString():f,y=t=>{const{onChange:l}=e;h?null==l||l(t):g(t)};return ye((()=>{const{onChange:t}=e;null==t||t(b)}),[f]),t().createElement(E.Input,{ref:l,size:a,value:b,maxLength:c,placeholder:s,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;(!Number.isNaN(t)&&/^-?\d*(\.\d*)?$/.test(t)||""===t||"-"===t)&&y(t)},onBlur:()=>{const{onBlur:t}=e,l=(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()),d>=0&&""!==t&&(t=Number(t).toFixed(d)),t})(b);Number(l)!==Number(b)&&y(l),null==t||t(m(l))},onKeyUp:t=>{const{onEnter:l}=e;13===t.keyCode&&(null==l||l(m(b)))}})}));ki.displayName="InputNumber";const Fi=ki,{Search:qi}=E.Input,Li=e=>{var l,a,r,n;const{column:i,record:o,rowKey:s,columnKey:c,clicked:u,text:p}=e,{tableRef:m,tableBodyRef:f,$size:g,flattenColumns:b,doFieldValidate:y,dataChange:v}=t().useContext(cn),x=t().useRef(null),C=t().useRef(null),S=t().useRef(null),w=t().useRef(null),T=t().useRef(!1),I=t().useRef(!1),N=t().useRef([]),_=t().useRef({}),P=kn(),O=m.current.store,A=null===(l=i.editRender)||void 0===l?void 0:l.call(i,o,i),[F,q]=t().useState(!1),[L,D]=t().useState(!1),[H,$]=t().useState(A.items||[]),M=!(null===(a=m.current.fieldAuth[c])||void 0===a||!a.disabled),K=(A.editable||(0,Nt.isEqual)(u,[s,c]))&&!A.disabled&&!M,V=`${s}|${c}`,U=2===u.length?`${u[0]}|${u[1]}`:"",j=![...O.state.required,...O.state.validate].some((e=>{let{x:t,y:l}=e;return t===s&&l===c})),B=(null===(r=O.state.required.find((e=>{let{x:t,y:l}=e;return t===s&&l===c})))||void 0===r?void 0:r.text)||"",W=(null===(n=O.state.validate.find((e=>{let{x:t,y:l}=e;return t===s&&l===c})))||void 0===n?void 0:n.text)||"",G=K||!j||F||L,Y=()=>{var e;(null===(e=A.extra)||void 0===e?void 0:e.cornerSign)&&(I.current=!0),v()};t().useEffect((()=>{G&&U===V&&(0,z.Y3)((()=>Q()))}),[U]);const Z=(e,t)=>{q(e),null==t||t()},X=e=>{N.current=e},Q=()=>{var e,t,l;const{type:a}=A;switch(a){case"text":null===(e=C.current)||void 0===e||e.focus();break;case"number":null===(t=S.current)||void 0===t||t.focus();break;case"search-helper":null===(l=w.current)||void 0===l||l.focus()}},J=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0}))},ee={text:(e,l)=>{const{dataIndex:a}=l,{type:r,extra:n={},rules:i=[],onInput:o,onChange:u,onEnter:p}=A,m=(0,Cn.C_)(e,a);return t().createElement(E.Input,{ref:C,size:g,value:m,maxLength:n.maxLength,showCount:n.showCount,placeholder:n.placeholder||d("qm.table.editable.inputPlaceholder"),readOnly:n.readOnly,disabled:n.disabled,suffix:n.suffix,onChange:t=>{const l=t.target.value??"";(0,Cn.dN)(e,a,l),y(i,l,s,c),null==o||o({[V]:l}),T.current=!0,P()},onBlur:t=>{const l=t.target.value??"";T.current&&(T.current=!1,O.addToUpdated(e),null==u||u({[V]:l},e),Y())},onKeyUp:t=>{if(13===t.keyCode){const l=t.target.value??"";null==p||p({[V]:l},e)}}})},number:(e,l)=>{const{dataIndex:a,precision:r}=l,{type:n,extra:i={},rules:o=[],onInput:u,onChange:p,onEnter:m}=A,h=(0,Cn.C_)(e,a);return t().createElement(Fi,{ref:S,size:g,value:h,min:i.min,max:i.max,precision:r,placeholder:i.placeholder||d("qm.table.editable.inputPlaceholder"),maxLength:i.maxLength,readOnly:i.readOnly,disabled:i.disabled,onChange:t=>{(0,Cn.dN)(e,a,t),y(o,t,s,c),null==u||u({[V]:t}),T.current=!0,P()},onBlur:t=>{T.current&&(T.current=!1,(0,Cn.dN)(e,a,t),O.addToUpdated(e),null==p||p({[V]:t},e),Y())},onEnter:t=>{null==m||m({[V]:t},e)}})},select:(e,l,a)=>{const{dataIndex:r,dictItems:n=[]}=l,{type:i,extra:o={},rules:u=[],items:p,onChange:h,onEnter:f}=A,{elementStore:b}=m.current,v=p||n,x=(0,Cn.C_)(e,r);let C=x;return t().createElement(E.Select,{mode:a?"multiple":void 0,size:g,dropdownClassName:"table-editable__popper",value:x||void 0,placeholder:o.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,maxTagCount:o.collapseTags?"responsive":void 0,getPopupContainer:()=>b.$tableBody.parentNode,disabled:o.disabled,style:{width:"100%"},onChange:t=>{(0,Cn.dN)(e,r,t),y(u,t,s,c),O.addToUpdated(e),P(),null==h||h({[V]:t},e),Y()},onSelect:e=>{C=e},onInputKeyDown:t=>{13===t.keyCode&&(0,z.Y3)((()=>null==f?void 0:f({[V]:C},e)))}},v.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>ee.select(e,t,!0),date:(e,l,a)=>{const{dataIndex:r}=l,{type:n,extra:i={},rules:o=[],onChange:u}=A,p=a?fn:hn,m=(0,Cn.C_)(e,r);return t().createElement(R,{showTime:a,size:g,dropdownClassName:"table-editable__popper",value:(0,Cn._3)(m,p)??void 0,format:p,disabledDate:e=>{const{minDateTime:t,maxDateTime:l}=i;return t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day")},placeholder:d(a?"qm.table.editable.datetimePlaceholder":"qm.table.editable.datePlaceholder"),allowClear:i.allowClear,disabled:i.disabled,style:{width:"100%"},onChange:t=>{const l=(0,Cn.p6)(t,p);(0,Cn.dN)(e,r,l),y(o,l,s,c),O.addToUpdated(e),P(),null==u||u({[V]:l},e),Y()}})},datetime:(e,t)=>ee.date(e,t,!0),time:(e,l)=>{const{dataIndex:a}=l,{type:r,extra:n={},rules:i=[],onChange:o}=A,u=(0,Cn.C_)(e,a);return t().createElement(k,{size:g,dropdownClassName:"table-editable__popper",value:(0,Cn._3)(u,gn)??void 0,format:gn,placeholder:d("qm.table.editable.datetimePlaceholder"),allowClear:n.allowClear,disabled:n.disabled,style:{width:"100%"},onChange:t=>{const l=(0,Cn.p6)(t,gn);(0,Cn.dN)(e,a,l),y(i,l,s,c),O.addToUpdated(e),P(),null==o||o({[V]:l},e),Y()}})},checkbox:(e,l)=>{const{dataIndex:a}=l,{type:r,extra:n={},onChange:i}=A,{trueValue:o=pn,falseValue:s=mn,disabled:c}=n,d=(0,Cn.C_)(e,a);return t().createElement(E.Checkbox,{checked:d===o,disabled:c,onChange:t=>{const l=t.target.checked?o:s;(0,Cn.dN)(e,a,l),O.addToUpdated(e),P(),null==i||i({[V]:l},e),Y()}})},switch:(e,l)=>{const{dataIndex:a}=l,{type:r,extra:n={},onChange:i}=A,{trueValue:o=pn,falseValue:s=mn,disabled:c}=n,d=(0,Cn.C_)(e,a);return t().createElement(E.Switch,{checked:d===o,disabled:c,onChange:t=>{const l=t?o:s;(0,Cn.dN)(e,a,l),O.addToUpdated(e),P(),null==i||i({[V]:l},e),Y()}})},"search-helper":(e,l)=>{const{dataIndex:a,precision:r}=l,{type:n,extra:i={},rules:o=[],helper:u={},onInput:p,onChange:m,onEnter:v}=A,E=(0,Cn.C_)(e,a),C=u.fieldAliasMap;C||h("Table","helper 需要配置 `fieldAliasMap` 选项");const S="function"==typeof C?C():C||{};Object.keys(S).includes(a)||h("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值");const I=e=>{const{filterAliasMap:t}=u,l=""!==e?e:void 0,r="function"==typeof t?t():t??[],n={[a]:l};return r.forEach((e=>n[e]=l)),n},N=e=>{_.current=I(e),q(!0)},R=(t,a)=>{const{beforeOpen:r}=u,n=(r??z.XT)({[V]:E},e,l);null!=n&&n.then?n.then((()=>{N(t),null==a||a()})).catch((()=>{})):!1!==n&&(N(t),null==a||a())},k=e=>{const t={};for(const l in S){const r=S[l];l!==a&&(t[l]=e[r])}const l=S[a]?e[S[a]]:"";H(l,t);const{closed:r}=u;Z(!1,(()=>J(x.current))),null==r||r(e)},L=()=>{T.current&&(u.closeRemoteMatch?H(E):H("")),T.current=!1,Z(!1,(()=>J(x.current)))},H=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",l=arguments.length>1?arguments[1]:void 0;if((0,z.Kn)(l)&&Object.keys(l).length){for(const t in l){const a=l[t],r=b.find((e=>e.dataIndex===t));if(r){var n;(0,Cn.dN)(e,t,a,r.precision);const l=null===(n=r.editRender)||void 0===n?void 0:n.call(r,e,r);l&&Array.isArray(l.rules)&&y(l.rules,a,s,t)}else(0,Cn.dN)(e,t,a)}f.current.forceUpdate()}(0,Cn.dN)(e,a,t,r),y(o,t,s,c),O.addToUpdated(e),null==m||m({[V]:t},e),Y(),_.current={},T.current=!1},$={visible:F,title:d("qm.searchHelper.text"),width:u.width??"60%",loading:!1,bodyStyle:{paddingBottom:`${Sl[g]+20}px`},onClose:()=>{L()}},M={...u,size:g,initialValue:(0,Nt.merge)({},u.initialValue,_.current),onClose:e=>{e?k(e):L()}};return t().createElement(t().Fragment,null,t().createElement(qi,{ref:w,value:E,placeholder:i.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,readOnly:i.readOnly,disabled:i.disabled,onBlur:e=>{var t,l;const{value:r}=e.target;if(T.current&&!F)return r&&!u.closeRemoteMatch&&null!==(t=u.table)&&void 0!==t&&null!==(l=t.fetch)&&void 0!==l&&l.api?(e=>{const{table:t,initialValue:l={}}=u,{beforeFetch:a=z.XT}=t.fetch;return D(!0),new Promise((async(r,n)=>{const i=(0,Nt.merge)({},t.fetch.params,{...l,...I(e)},{currentPage:1,pageSize:500});try{if(a(i)){const e=await t.fetch.api(i);200===e.code?r(Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,t.fetch.dataKey)??[]):n()}else n()}catch(e){n()}D(!1)}))})(r).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,Cn.C_)(t,S[a]).toString().includes(e)));if(1===t.length)return k(t[0]);R(e)}(e,r))).catch((()=>H(""))):void H(r)},onChange:t=>{const{value:l}=t.target;(0,Cn.dN)(e,a,l),null==p||p({[V]:l}),T.current=!0,P()},onKeyUp:t=>{if(13===t.keyCode){const l=t.target.value??"";null==v||v({[V]:l},e)}},onDoubleClick:e=>{const{value:t}=e.target;R(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?R(e):H(""))}}),t().createElement(It,$,t().createElement(eo,M)))},"search-helper-multiple":(e,l)=>{const{dataIndex:a}=l,{type:r,items:n=[],extra:i={},rules:o=[],helper:u={},onInput:p,onChange:m,onEnter:f}=A,b=(0,Cn.C_)(e,a),v=u.fieldAliasMap;v||h("Table","helper 需要配置 `fieldAliasMap` 选项");const C="function"==typeof v?v():v||{};Object.keys(C).includes("valueKey")&&Object.keys(C).includes("textKey")||h("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`");const S=t=>{const{beforeOpen:a}=u,r=(a??z.XT)({[V]:b},e,l);null!=r&&r.then?r.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==r&&(q(!0),null==t||t())},w=()=>{Z(!1,(()=>J(x.current)))},T=t=>{(0,Cn.dN)(e,a,t),y(o,t,s,c),O.addToUpdated(e),null==m||m({[V]:t},e,N.current),Y()},I={visible:F,title:d("qm.searchHelper.text"),width:u.width??"60%",loading:!1,bodyStyle:{paddingBottom:`${Sl[g]+20}px`},onClose:()=>{w()}},_={...u,size:g,multiple:!0,initialValue:(0,Nt.merge)({},u.initialValue),defaultSelectedKeys:b,onClose:(e,t)=>{e?((e,t)=>{const{textKey:l,valueKey:a}=C;X((0,Nt.uniqBy)([...N.current.filter((e=>t.includes(e[a]))),...e],a));const r=N.current.map((e=>({text:e[l],value:e[a]}))),i=(0,Nt.uniqBy)([...r,...n],"value").filter((e=>t.includes(e.value)));$(i),T(i.map((e=>e.value)));const{closed:o}=u;Z(!1,(()=>J(x.current))),null==o||o(N.current)})(e,t):w()}};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(E.Select,{mode:"multiple",open:!1,value:b,placeholder:i.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,maxTagCount:i.collapseTags?"responsive":void 0,disabled:i.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==f||f({[V]:b},e))},onDoubleClick:()=>{S()},onChange:e=>{const{valueKey:t}=C;X(N.current.filter((l=>e.includes(l[t])))),T(e),P()}},H.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(E.Button,{className:"ant-input-search-button",disabled:i.disabled,icon:t().createElement(re.SearchOutlined,null),onClick:()=>{S()}})))),t().createElement(It,I,t().createElement(eo,_)))},"tree-helper":(e,l)=>{const{dataIndex:a,precision:r}=l,{type:n,extra:i={},rules:o=[],helper:u={},onChange:p,onEnter:m}=A,v=(0,Cn.C_)(e,a),E=u.fieldAliasMap;E||h("Table","helper 需要配置 `fieldAliasMap` 选项");const C="function"==typeof E?E():E||{};Object.keys(C).includes(a)||h("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值");const S=t=>{const{beforeOpen:a}=u,r=(a??z.XT)({[V]:v},e,l);null!=r&&r.then?r.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==r&&(q(!0),null==t||t())},w=()=>{Z(!1,(()=>J(x.current)))},T=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",l=arguments.length>1?arguments[1]:void 0;if((0,z.Kn)(l)&&Object.keys(l).length){for(const t in l){const a=l[t],r=b.find((e=>e.dataIndex===t));if(r){var n;(0,Cn.dN)(e,t,a,r.precision);const l=null===(n=r.editRender)||void 0===n?void 0:n.call(r,e,r);l&&Array.isArray(l.rules)&&y(l.rules,a,s,t)}else(0,Cn.dN)(e,t,a)}f.current.forceUpdate()}(0,Cn.dN)(e,a,t,r),y(o,t,s,c),O.addToUpdated(e),null==p||p({[V]:t},e),Y()},I={visible:F,title:d("qm.searchHelper.text"),width:u.width??"30%",loading:!1,bodyStyle:{paddingBottom:`${Sl[g]+20}px`},onClose:()=>{w()}},N={...u,defaultSelectedKeys:[v],size:g,onClose:e=>{e?(e=>{const t={};for(const l in C){const r=C[l];l!==a&&(t[l]=e[r])}const l=C[a]?e[C[a]]:"";T(l,t);const{closed:r}=u;Z(!1,(()=>J(x.current))),null==r||r(e)})(e):w()}};return t().createElement(t().Fragment,null,t().createElement(qi,{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||P()},onKeyUp:t=>{if(13===t.keyCode){const l=t.target.value??"";null==m||m({[V]:l},e)}},onDoubleClick:()=>{S()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?S():T(""))}}),t().createElement(It,I,t().createElement(go,N)))},"tree-helper-multiple":(e,l)=>{const{dataIndex:a}=l,{type:r,extra:n={},rules:i=[],helper:o={},onInput:u,onChange:p,onEnter:m}=A,f=(0,Cn.C_)(e,a),b=o.fieldAliasMap;b||h("Table","helper 需要配置 `fieldAliasMap` 选项");const v="function"==typeof b?b():b||{};Object.keys(v).includes("valueKey")&&Object.keys(v).includes("textKey")||h("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`");const C=t=>{const{beforeOpen:a}=o,r=(a??z.XT)({[V]:f},e,l);null!=r&&r.then?r.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==r&&(q(!0),null==t||t())},S=()=>{Z(!1,(()=>J(x.current)))},w=t=>{(0,Cn.dN)(e,a,t),y(i,t,s,c),O.addToUpdated(e),null==p||p({[V]:t},e,N.current),Y()},T={visible:F,title:d("qm.searchHelper.text"),width:o.width??"60%",loading:!1,bodyStyle:{paddingBottom:`${Sl[g]+20}px`},onClose:()=>{S()}},I={...o,size:g,multiple:!0,initialValue:(0,Nt.merge)({},o.initialValue),defaultSelectedKeys:f,onClose:e=>{e?(e=>{const{textKey:t,valueKey:l}=v;X(e);const a=N.current.map((e=>({text:e[t],value:e[l]})));$(a),w(a.map((e=>e.value)));const{closed:r}=o;Z(!1,(()=>J(x.current))),null==r||r(N.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(E.Select,{mode:"multiple",open:!1,value:f,placeholder:n.placeholder||d("qm.table.editable.selectPlaceholder"),allowClear:n.allowClear,maxTagCount:n.collapseTags?"responsive":void 0,disabled:n.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==m||m({[V]:f},e))},onDoubleClick:()=>{C()},onChange:e=>{const{valueKey:t}=v;X(N.current.filter((l=>e.includes(l[t])))),w(e),P()}},H.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text)))),t().createElement("span",{className:"ant-input-group-addon"},t().createElement(E.Button,{className:"ant-input-search-button",disabled:n.disabled,icon:t().createElement(re.SearchOutlined,null),onClick:()=>{C()}})))),t().createElement(It,T,t().createElement(go,I)))}};return t().createElement(t().Fragment,null,G?(()=>{const{type:e}=A,l=ee[e];if(!l)return h("Table","单元格编辑的类型 `type` 配置不正确"),null;const a=["cell--edit",{"is-error":!j}];return t().createElement("div",{ref:x,className:le()(a)},l(o,i),!j&&t().createElement("div",{className:"cell-error"},B||W))})():t().createElement(t().Fragment,null,p),I.current&&t().createElement("i",{className:"cell--sign"}))},Di=require("copy-to-clipboard");var Hi=__webpack_require__.n(Di);const $i=e=>{const{text:l,options:a,showMessage:r=!0,onCopy:n}=e;return function(e){if(!t().isValidElement(e))return null;for(var l=arguments.length,a=new Array(l>1?l-1:0),r=1;r<l;r++)a[r-1]=arguments[r];return t().cloneElement(e,...a)}(e.children,{onClick:i=>{const o=t().Children.only(e.children),s=Hi()(l,a);null==n||n(l,s),s&&r&&E.message.success(d("qm.clipboard.success")),o&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(i)}})};$i.displayName="CopyToClipboard";const Mi=$i;function Ki(){return Ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Ki.apply(this,arguments)}const Vi=t().forwardRef(((l,a)=>{const{tableData:r,flattenColumns:n}=l,{getRowKey:o,tableProps:s,tableRef:c,editableColumns:u,leftFixedColumns:p,rightFixedColumns:m,firstDataIndex:f,sorter:g,layout:b,showFooter:y,scrollX:v,scrollY:x,selectionKeys:E,rowExpandedKeys:C,highlightKey:S,isPingLeft:w,isPingRight:T,isTableEmpty:I,isTreeTable:N,isGroupSubtotal:_,isWebPagination:R,isDragMergeCell:P,setElementStore:O,createTableFullData:A,setSelectionKeys:k,setHighlightKey:F,getStickyLeft:q,getStickyRight:L,scrollXToColumn:D,scrollYToRecord:H,rowInViewport:$,dataChange:M,setPingLeft:K,setPingRight:V,setFullScreen:U,setOverlay:j,findParentRowKeys:B,getAllChildRowKeys:W,triggerScrollYEvent:G,scrollBottomDebouncer:Y}=t().useContext(cn),{height:Z,minHeight:X,maxHeight:Q,rowSelection:J,rowHighlight:ee,treeConfig:te,expandable:ne,stripe:ie,summation:oe,rowStyle:se,cellStyle:ce,spanMethod:de,ellipsis:ue,showHeader:pe,rowDraggable:me,onRowClick:he,onRowDblclick:fe,onRowContextmenu:ge,onRowEnter:be}=s,ve=t().useRef(null),xe=t().useRef(null),Te=t().useRef({prevST:0,prevSL:0}),{dragStart:Ie,renderDragPanel:Ne,closeDragPanel:_e}=Pi(),Re={dateFormat:e=>{const t=e?i()(e).format(hn):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?i()(e).format(fn):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?i()(e).format(fn.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>Number(100*e).toFixed(2)+"%",financeFormat:e=>(0,Cn.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")},Pe=t().useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:l,tableFullHeight:a,tableAutoHeight:r}=b,n={};return I&&Object.assign(n,{minHeight:"100px"}),X&&Object.assign(n,{minHeight:(0,Cn.EJ)(X)-e-l+"px"}),Q&&Object.assign(n,{maxHeight:(0,Cn.EJ)(Q)-e-l+"px"}),Z||a||r?{...n,maxHeight:"",minHeight:"",height:`${t}px`}:n}),[Z,Q,X,I,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:l}=b;return Math.floor((v?t-l:t)/e.rowHeight)}),[b,v]),[ke,Fe]=t().useState([]),qe=kn(),Le=function(t,l){const[a,r]=e.useState(!1);return e.useEffect((()=>{let e;const a=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==a?void 0:a.contains(n))||(null==a?void 0:a.contains(i)),c=a===n,d=null==l?void 0:l.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));r(!(o||s||c||u))})(t,e)};return a&&(Ce(document,"mousedown",n),Ce(document,"mouseup",i)),()=>{a&&(Se(document,"mousedown",n),Se(document,"mouseup",i))}}),[t]),a}(ve,[".table-editable__popper"]);t().useImperativeHandle(a,(()=>({renderCellTitle:Ge,setClickedValues:Me,forceUpdate:qe}))),ye((()=>{Le&&(Me([]),P&&_e())}),[Le]),ye((()=>{ke.length&&En.focus(c.current.uid)}),[ke]),t().useEffect((()=>{He(),$e()}),[]);const De=t().useCallback((e=>{var t,l;const{keyCode:a}=e;if(c.current.uid===(null===(t=En.getFocusInstance())||void 0===t?void 0:t.id)&&(27===a&&(Me([]),F(""),U(!1)),ke.length&&(((e,t)=>{if(Ee.Z||!e||!t)return!1;let l=e;for(;l;){if(l===t)return!0;l=l.parentNode}return!1})(document.activeElement,ve.current)||"INPUT"!==(null===(l=document.activeElement)||void 0===l?void 0:l.tagName)))){if(13===a&&(we(e),"radio"===(null==J?void 0:J.type)||ee)){const t=E[0]??S??null,l=r.find((e=>o(e,e.index)===t))??null;l&&(null==be||be(l,e))}if(38===a||40===a){var n,i;we(e);const{allTableData:t}=c.current,l=R?(0,Cn.tL)(r):t,s=l.length;let d=l.findIndex((e=>o(e,e.index)===ke[0]));const u=38===a?(--d+s)%s:++d%s,p=l[u],m=o(p,p.index);"radio"!==(null==J?void 0:J.type)||null!==(n=J.disabled)&&void 0!==n&&n.call(J,p)||k([m]),!ee||null!==(i=ee.disabled)&&void 0!==i&&i.call(ee,p)||F(m),$(u)||(38===a&&H(m,u),40===a&&H(m,Ae>u+1?0:u+1-Ae)),Me([m,ke[1]])}if(9===a){if(we(e),!u.length)return Me([]);const t=u.length;let l=u.findIndex((e=>e.dataIndex===ke[1]));const a=++l%t,r=u[a].dataIndex;Me([ke[0],r]),D(r)}}}),[ke,r,E,u,Ae]);t().useEffect((()=>{const e=tt()(document,"keydown",De);return()=>e.remove()}),[De]);const He=()=>{O("$tableBody",ve.current),O("$tableYspace",xe.current)},$e=()=>{j("overlay"===((e,t)=>{if(Ee.Z||!e||!t)return null;"float"===(t=(0,z._A)(t))&&(t="cssFloat");try{var l;const a=e.style[t];if(a)return a;const r=null===(l=document.defaultView)||void 0===l?void 0:l.getComputedStyle(e,"");return r?r[t]:""}catch(l){return e.style[t]}})(ve.current.parentNode,"overflowY"))},Me=e=>{(0,Nt.isEqual)(e,ke)||Fe(e)},Ke=(e,t,l)=>l?[...t,e]:t.filter((t=>t!==e)),Ve=(e,t,l)=>{var a;const{deriveRowKeys:r}=c.current,n=(0,Cn.CD)(r,e);let i=[];const o=W((null==n?void 0:n.children)||[]),s=(null===(a=(0,Cn.Qi)(r,e))||void 0===a?void 0:a.slice(0,-1).reverse())||[];return i=l?[...new Set([...t,e,...o])]:t.filter((t=>![e,...o].includes(t))),s.forEach((e=>{var t;const l=(0,Cn.CD)(r,e),a=(0,Cn.bY)(i,(null==l||null===(t=l.children)||void 0===t?void 0:t.map((e=>e.rowKey)))||[]);i=a?[...i,e]:i.filter((t=>t!==e))})),i},Ue=e=>Array.isArray(e.children)&&e.children.length>0,ze=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const a=[];return e.forEach((e=>{const r=e.index,i=o(e,e.index);if(a.push(je(e,r,i,l)),null!=ne&&ne.expandedRowRender){const{expandedRowClassName:l,rowExpandable:o=z.XT}=ne;C.includes(i)&&o(e)&&a.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:le()("cell",l)},ne.expandedRowRender(e,r)))))}if((null==te||!te.virtual)&&Ue(e)){const t="function"!=typeof(null==ne?void 0:ne.rowExpandable)||ne.rowExpandable(e);C.includes(i)&&t&&a.push(...ze(e.children,l+1))}})),a},je=function(e,l,a){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=["body--row",{"body--row-striped":ie&&l%2!=0,"body--row-selected":E.includes(a),"body--row-current":S===a,..._?Je(e._group):null}];return t().createElement("tr",{key:a,className:le()(i)},n.map(((t,n)=>Be(t,n,e,l,a,r))))},Be=(e,l,a,r,n,i)=>{const{isIE:s,isOverlay:d}=c.current,{dataIndex:u,fixed:h,align:f,className:y=""}=e,{rowSpan:v,colSpan:C}=Ze(a,e,r,l),{gutterWidth:S}=b;if(!v||!C)return null;const w=e.ellipsis??ue,T=!s&&"left"===h,I=!s&&"right"===h,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":I,"cell-fix-left-last":T&&p[p.length-1].dataIndex===u,"cell-fix-right-first":I&&m[0].dataIndex===u,[y]:!!y}],P=s?null:{left:T?`${q(u)}px`:"",right:I?`${L(u)+(d&&x?S:0)}px`:""},O=se?"function"==typeof se?se(a,r):se:null,A=ce?"function"==typeof ce?ce(a,e,r,l):ce:null,D=_?Qe(a._group):null,H=Ge(e,a,r,l);return t().createElement("td",{key:u,title:w?H:void 0,rowSpan:v>1?v:void 0,colSpan:C>1?C:void 0,"data-index":l,className:le()(R),style:{...P,...D,...O,...A},onClick:t=>((e,t,l)=>{var a,r;const{dataIndex:n}=l;if([Tn.expandableColumn,Tn.operationColumn].includes(n))return;const i=o(t,t.index);Me([i,n]);const s=null===(a=l.editRender)||void 0===a?void 0:a.call(l,t,l),c=s&&!s.disabled,{type:d,selectByClickRow:u=!0,disabled:p=z.ZT}=J||{};!d||p(t)||c||(u||n===Tn.selectionColumn)&&((e,t)=>{const{type:l,checkStrictly:a=!0,onSelect:r}=J||{};if("radio"===l&&k([e]),"checkbox"===l){const l=!E.includes(e),n=N&&!a?Ve(e,E,l):Ke(e,E,l);k(n),null==r||r(l,t,n)}})(i,t),[Tn.selectionColumn].includes(n)||(!ee||null!==(r=ee.disabled)&&void 0!==r&&r.call(ee,t)||c||F(i),null==he||he(t,l,e))})(t,a,e),onDoubleClick:t=>((e,t,l)=>{const{dataIndex:a}=l;[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn].includes(a)||null==fe||fe(t,l,e)})(t,a,e),onContextMenu:t=>((e,t,l)=>{const{dataIndex:a}=l;[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn].includes(a)||null==ge||ge(t,l,e)})(t,a,e)},t().createElement("div",{className:"cell"},We(e,a,r,l,H,n,i)),I&&d&&x&&m[m.length-1].dataIndex===u?t().createElement("i",{className:"gutter-overlay",style:{width:S,right:-1*(S+1)}}):null)},We=(e,l,a,r,n,i,o)=>{const{dataIndex:s,canCopy:c,editRender:u,render:p}=e,m=(0,Cn.C_)(l,s);if(s===Tn.expandableColumn)return t().createElement(Ai,{record:l,rowKey:i});if(s===Tn.selectionColumn)return t().createElement(Oi,{selectionKeys:E,column:e,record:l,rowKey:i});const h=Ye(m,e,l);if(u)return t().createElement(Li,{column:e,record:l,rowKey:i,columnKey:s,clicked:ke,text:h});const g=p?p(m,l,e,a,r):h;return N&&s===f?[Xe(null!=te&&te.virtual?l._level:o),t().createElement(Ai,{key:"expand",record:l,rowKey:i,style:Ue(l)?{}:{visibility:"hidden"}}),g]:c?t().createElement("div",{className:"cell--copy"},t().createElement("span",{className:"text"},g),n&&t().createElement(Mi,{text:n},t().createElement(re.CopyOutlined,{className:"icon",title:d("qm.table.config.copyText"),onClick:e=>e.stopPropagation()}))):g},Ge=(e,t,l,a)=>{const{dataIndex:r,render:n}=e;if([Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn].includes(r))return"";let i="";const o=(0,Cn.C_)(t,r);if("function"==typeof n){const r=n(o,t,e,l,a);i=(0,z.l$)(r)?(0,Cn.gn)(r).join(""):r}else i=Ye(o,e,t).toString();return i},Ye=(e,t,l)=>{var a;const{dictItems:r,precision:n,formatType:i,editRender:o}=t,s=r||(null==o||null===(a=o(l,t))||void 0===a?void 0:a.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=Re[`${(0,z._A)(i)}Format`];e?d=e(d):h("Table","字段的格式化类型 `formatType` 配置不正确")}return d},Ze=(e,t,l,a)=>{let n=1,i=1;if("function"==typeof de){const o=de({row:e,column:t,rowIndex:l,columnIndex:a,tableData:r});if(Array.isArray(o)?(n=o[0],i=o[1]):(0,z.Kn)(o)&&(n=o.rowSpan,i=o.colSpan),e===r[0]&&0===n){n=1;for(let e=1;e<r.length;e++){const{rowSpan:l}=Ze(r[e],t,r[e].index,a);if(l>0)break;n++}}}const{mergeCells:o}=c.current;if(o.length>0){const e=o.find((e=>e.row===l&&e.col===a));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*Tn.treeTable.textIndent+"px"}}):null,Qe=e=>{const{backgroundColor:t,color:l}=oe.groupItems.find((t=>t.dataIndex===e))??{};return{backgroundColor:t,color:l}},Je=e=>{const t=oe.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},et=ae("table"),lt=P?{onMouseDown:Ie}:null;return t().createElement("div",{className:`${et}--body-wrapper`,style:{...Pe},onScroll:e=>{const{elementStore:t,scrollYLoad:l}=c.current,{prevST:a,prevSL:r}=Te.current,n=x?b.gutterWidth:0,{scrollTop:i,scrollLeft:o}=e.target;if(o!==r){pe&&(t.$header.scrollLeft=o),y&&(t.$footer.scrollLeft=o);const e=o>0,l=Math.ceil(o)+b.tableWidth<b.tableBodyWidth+n;w!==e&&K(e),T!==l&&V(l)}if(l&&i!==a&&G(i),x&&i!==a){const l=t.$tableYspace.offsetHeight||t.$tableBody.offsetHeight;Math.ceil(i)+b.viewportHeight-n>=l&&Y(e)}Te.current.prevST=i,Te.current.prevSL=o}},t().createElement("div",{ref:xe,className:"body--y-space"}),t().createElement("div",{className:"body--x-space",style:{width:Oe?`${Oe}px`:""}}),t().createElement("table",Ki({ref:ve,className:`${et}--body`,tabIndex:-1,cellSpacing:"0",cellPadding:"0"},lt,{style:{width:Oe?`${Oe}px`:""}}),t().createElement("colgroup",null,n.map((e=>{const{dataIndex:l,width:a,renderWidth:r}=e;return t().createElement("col",{key:l,style:{width:`${a||r}px`,minWidth:`${a||r}px`}})}))),me?t().createElement(al.ReactSortable,{itemKey:e=>o(e,e.index),tag:"tbody",animation:200,list:r,setList:e=>{const t=e.map((e=>o(e,e.index))),l=r.map((e=>o(e,e.index)));if((0,Nt.isEqual)(t,l))return;const a=[];c.current.tableFullData.forEach((t=>{r.includes(t)?a.push(e.shift()):a.push(t)})),A(a),M()}},r.map((e=>je(e,e.index,o(e,e.index))))):t().createElement("tbody",null,ze(r))),P&&Ne())}));Vi.displayName="TableBody";const Ui=Vi,zi=e=>{const{summationRows:l,flattenColumns:a}=e,{getRowKey:r,tableProps:n,tableRef:i,sorter:o,layout:s,scrollY:c,leftFixedColumns:u,rightFixedColumns:p,setElementStore:m,getStickyLeft:h,getStickyRight:f}=t().useContext(cn),{footRender:g}=n,b=t().useRef(null);t().useEffect((()=>{y()}),[]);const y=()=>{m("$footer",b.current)},v=ae("table"),{tableBodyWidth:x}=s;return t().createElement("div",{ref:b,className:`${v}--footer-wrapper`},g?g(a,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,a.map((e=>{const{dataIndex:l,width:a,renderWidth:r}=e;return t().createElement("col",{key:l,style:{width:`${a||r}px`,minWidth:`${a||r}px`}})})),c&&t().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),t().createElement("tfoot",null,(()=>{const{isIE:e}=i.current,r=["gutter",{"cell-fix-right":!!p.length}],n=e?null:{right:p.length?0:""};return l.map(((e,l)=>t().createElement("tr",{key:l,className:"footer--row"},a.map(((l,a)=>((e,l,a)=>{const{isIE:r}=i.current,{gutterWidth:n}=s,{dataIndex:m,fixed:g,align:b,summation:y}=e,v=["footer--column","col--ellipsis",{"col--center":"center"===b,"col--right":"right"===b,"column--sort":!!o[m],"cell-fix-left":!r&&"left"===g,"cell-fix-right":!r&&"right"===g,"cell-fix-left-last":!r&&"left"===g&&u[u.length-1].dataIndex===m,"cell-fix-right-first":!r&&"right"===g&&p[0].dataIndex===m}],x=r?null:{left:"left"===g?`${h(m)}px`:"",right:"right"===g?`${f(m)+(c?n:0)}px`:""},E=null!=y&&y.render?y.render(i.current.tableFullData):(0,Cn.C_)(l,`${m}_text`),C=0===a&&""===E?d("qm.table.config.summaryText"):E;return t().createElement("td",{key:m,title:C,className:le()(v),style:{...x}},t().createElement("div",{className:"cell"},C))})(l,e,a))),c&&t().createElement("td",{className:le()(r),style:{...n}}))))})())))};var ji;!function(e){e.small="small",e.middle="default",e.large="default"}(ji||(ji={}));const Bi=e=>{var l,a;const{current:n,pageSize:i,total:o,config:s,onChange:c}=e,{global:d}=t().useContext(r),{$size:u,setElementStore:p}=t().useContext(cn),m=t().useRef(null);t().useEffect((()=>{h()}),[]);const h=()=>{p("$pager",m.current)},f=(e,t)=>{c(e,t)},g=(null==s?void 0:s.showSizeChanger)||Tn.pagination.showSizeChanger,b=(null==s?void 0:s.showQuickJumper)||Tn.pagination.showQuickJumper,y=(null==s?void 0:s.pageSizeOptions)||(null==d||null===(l=d.table)||void 0===l||null===(a=l.pagination)||void 0===a?void 0:a.pageSizeOptions)||Tn.pagination.pageSizeOptions,v={[`${ae("table")}-pager`]:!0};return t().createElement("div",{ref:m,className:le()(v)},t().createElement(E.Pagination,{size:ji[u],showSizeChanger:g,showQuickJumper:b,pageSizeOptions:y,current:n,pageSize:i,total:o,onChange:f,onShowSizeChange:f}))},Wi=()=>{const{layout:e}=t().useContext(cn),l=t().useMemo((()=>{const{headerHeight:t,viewportHeight:l}=e;return{top:`${t}px`,height:`${l}px`}}),[e]),a=ae("table");return t().createElement("div",{className:`${a}--empty`,style:l},t().createElement(ze,null))};function Gi(){return Gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Gi.apply(this,arguments)}const Yi=t().forwardRef(((e,l)=>{const{rowKey:a,columns:n,loading:i,stripe:o,resizable:s,customClass:c,paginationConfig:d,tablePrint:u,exportExcel:p,showAlert:m,topSpaceAlign:f,showTableInfo:g,showFullScreen:b,showRefresh:y,showColumnDefine:v,showHeader:x}=e,{size:E}=t().useContext(r),C=t().useMemo((()=>e.size??E??""),[e.size,E]),S=t().useRef(null),w=t().useRef(null),T=t().useRef(null),I=t().useRef(null),N=kn(),_=t().useCallback(((e,t)=>{const l="function"==typeof a?a(e,t):e[a];return void 0===l?(h("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):l}),[a]),{tableRef:R,tableFullData:P,setElementStore:O,setOriginColumns:A,setTableFullData:k,setTableOriginData:F,setAllTableData:q,setDeriveRowKeys:L,setFieldAuth:D,setMergeCells:H,setScrollYStore:$,setScrollYLoad:M,setResizeState:K,setHandleState:V,setSummaries:U,setSelectionRows:j,setShouldToTop:B,setRowKeysMap:W,setOverlay:G,clearElementStore:Y,clearAllRowKeysMap:Z}=((e,l)=>{let{getRowKey:a,$size:r}=l;const n=t().useRef({uid:(0,Cn.wE)(),elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],allTableData:[],allRowKeys:[],deriveRowKeys:[],flattenRowKeys:[],fieldAuth:{},mergeCells:[],scrollYStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0,rowHeight:Tn.rowHeightMaps[r]},store:new wn,resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:!1,remove:!1},summaries:{},treeTable:!1,scrollYLoad:!1,shouldToTop:!0,selectionRows:[],rowKeysMap:new Map,isOverlay:!1,isIE:(0,z.w1)()}),i=function(e,t,l){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.map((e=>{const n=a(e,e.index),o=l?`${l}-${n}`:`${n}`,s={level:r,rowKey:n,rowKeyPath:o};return e.children&&(s.children=i(e.children,n,o,r+1)),t?Object.assign({},s,{parentRowKey:t}):s}))},o=e=>{const t=[];return e.forEach((e=>{var l;null!==(l=e.children)&&void 0!==l&&l.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,Cn.tL)(e);n.current.allTableData=t,n.current.allRowKeys=t.map((e=>a(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 l=1;l<e.colSpan;l++)for(let a=0;a<e.rowSpan;a++)t.push({row:e.row+a,col:e.col+l,rowSpan:0,colSpan:0});for(let l=1;l<e.rowSpan;l++)for(let a=0;a<e.colSpan;a++)t.push({row:e.row+l,col:e.col+a,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},setRowKeysMap:(e,t)=>{n.current.rowKeysMap.set(e,t)},setOverlay:e=>{n.current.isOverlay=e},clearElementStore:()=>{for(const e in n.current.elementStore)n.current.elementStore[e]=null},clearAllRowKeysMap:()=>{n.current.rowKeysMap.clear()}}})(0,{getRowKey:_,$size:C}),{tableData:X,setTableData:Q,filters:J,setFilters:ee,sorter:te,setSorter:re,superFilters:ne,setSuperFilters:ie,pagination:oe,setPagination:se,selectionKeys:ce,setSelectionKeys:de,rowExpandedKeys:ue,setRowExpandedKeys:pe,highlightKey:me,setHighlightKey:he,layout:fe,setLayout:ge,permission:be,setPermission:ve,spinning:xe,setSpinning:Ee,scrollX:Ce,setScrollX:Se,scrollY:we,setScrollY:Te,isPingLeft:Ie,setPingLeft:Ne,isPingRight:_e,setPingRight:Re,isFullScreen:Pe,setFullScreen:Oe}=(e=>{var l,a;const{paginationConfig:n,rowSelection:i,expandable:o,rowHighlight:s}=e,{global:c}=t().useContext(r),d={current:Tn.pagination.current,pageSize:(null==n?void 0:n.pageSize)??(null==c||null===(l=c.table)||void 0===l||null===(a=l.pagination)||void 0===a?void 0:a.pageSize)??Tn.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)??[],[m,h]=t().useState([]),[f,g]=t().useReducer(((e,t)=>(0,Nt.isEqual)(e,t)?e:t),{}),[b,y]=t().useReducer(((e,t)=>(0,Nt.isEqual)(e,t)?e:t),{}),[v,x]=t().useReducer(((e,t)=>(0,Nt.isEqual)(e,t)?e:t),[]),[E,C]=t().useState(d),[S,w]=t().useReducer(((e,t)=>(0,Nt.isEqual)(e,t)?e:t),u),[T,I]=t().useReducer(((e,t)=>(0,Nt.isEqual)(e,t)?e:t),p),[N,_]=t().useState((null==s?void 0:s.currentRowKey)??""),[R,P]=t().useState({gutterWidth:Nn(),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,F]=t().useState(!1),[q,L]=t().useState(!1),[D,H]=t().useState(!1),[$,M]=t().useState(!1),[K,V]=t().useState(!1),[U,z]=t().useState(!1);return{tableData:m,setTableData:h,filters:f,setFilters:g,sorter:b,setSorter:y,superFilters:v,setSuperFilters:x,pagination:E,setPagination:C,selectionKeys:S,setSelectionKeys:w,rowExpandedKeys:T,setRowExpandedKeys:I,highlightKey:N,setHighlightKey:_,layout:R,permission:O,setPermission:A,setLayout:P,spinning:k,setSpinning:F,scrollX:q,setScrollX:L,scrollY:D,setScrollY:H,isPingLeft:$,setPingLeft:M,isPingRight:K,setPingRight:V,isFullScreen:U,setFullScreen:z}})(e),{isFetch:Ae,isWebPagination:ke,isScrollPagination:Fe,showPagination:qe,shouldUpdateHeight:Le,tableColumns:De,flattenColumns:He,editableColumns:$e,summationColumns:Me,leftFixedColumns:Ke,rightFixedColumns:Ve,firstDataIndex:Ue,showSummary:ze,showFooter:je,isHeadGroup:We,bordered:Ge,isHeadSorter:Ye,isHeadFilter:Ze,isServiceSummation:Xe,isSelectCollection:Qe,isTableImport:Je,isTableClipboard:et,isSuperSearch:tt,isFastSearch:lt,isGroupSummary:at,isGroupSubtotal:rt,isDragMergeCell:nt,isTreeTable:it,isTableEmpty:ot,summationRows:st,fetchParams:ct}=Rn(e,{getRowKey:_,tableRef:R,tableFullData:P,tableData:X,sorter:te,filters:J,superFilters:ne,pagination:oe}),{createElementStore:dt,tableStyles:ut,getSpan:pt,getStickyLeft:mt,getStickyRight:ht,scrollXToColumn:ft,scrollYToRecord:gt,rowInViewport:bt,calcTableHeight:yt,resetTableScroll:vt,doLayout:xt}=An(e,{getRowKey:_,tableRef:R,$size:C,tableColumns:De,flattenColumns:He,leftFixedColumns:Ke,layout:fe,scrollY:we,tableData:X,showFooter:je,showPagination:qe,isWebPagination:ke,isFullScreen:Pe,setLayout:ge,setScrollX:Se,setScrollY:Te,setElementStore:O,setScrollYStore:$,setShouldToTop:B}),{initialTable:Et,createTableFullData:Ct,getTableData:St,createTableData:wt,createGroupData:Tt,createSelectionKeys:It,createSelectionRows:_t,createRowExpandedKeys:Rt,findParentRowKeys:Pt,getAllChildRowKeys:Ot,doFieldValidate:At,getTableLog:kt,dataChange:Ft,tableChange:qt,toLastPage:Lt,pagerChangeHandle:Dt,triggerScrollYEvent:Ht,scrollBottomDebouncer:$t,clearTableSorter:Mt,clearTableFilter:Kt,clearSuperFilters:Vt,clearRowSelection:Ut,clearRowHighlight:zt,clearTableLog:jt,destroy:Bt}=On(e,{getRowKey:_,tableRef:R,tableElementRef:w,tableBodyRef:T,$size:C,tableColumns:De,tableFullData:P,pagination:oe,layout:fe,filters:J,sorter:te,superFilters:ne,fetchParams:ct,selectionKeys:ce,rowExpandedKeys:ue,highlightKey:me,summationColumns:Me,shouldUpdateHeight:Le,isFetch:Ae,isTreeTable:it,isWebPagination:ke,isScrollPagination:Fe,isServiceSummation:Xe,isGroupSubtotal:rt,doLayout:xt,setTableData:Q,setTableFullData:k,setTableOriginData:F,setAllTableData:q,setDeriveRowKeys:L,setPagination:se,setSpinning:Ee,setSorter:re,setFilters:ee,setSuperFilters:ie,setSelectionKeys:de,setRowExpandedKeys:pe,setHighlightKey:he,setScrollYLoad:M,setScrollYStore:$,setFieldAuth:D,setResizeState:K,setSummaries:U,setPermission:ve,setRowKeysMap:W,resetTableScroll:vt,clearElementStore:Y,clearAllRowKeysMap:Z});((e,l)=>{const{columns:a,summation:r,rowSelection:n,expandable:i,rowHighlight:o,mergeCells:s=[]}=e,{tableRef:c,topElementRef:d,tableElementRef:u,tableBodyRef:p,resizableBarRef:m,scrollX:f,pagination:g,selectionKeys:b,rowExpandedKeys:y,highlightKey:v,summationRows:x,showSummary:E,isWebPagination:C,isScrollPagination:S,isTreeTable:w,toLastPage:T,setHandleState:I,scrollYToRecord:N,setSelectionKeys:_,setOriginColumns:R,setSelectionRows:P,setRowExpandedKeys:O,setHighlightKey:A,setResizeState:k,setMergeCells:F,setPingRight:q,calcTableHeight:L,createSelectionKeys:D,createSelectionRows:H,createRowExpandedKeys:$,createElementStore:M,triggerScrollYEvent:K,forceUpdate:V,initialTable:U,destroy:z}=l,{elementStore:j,handleState:B,scrollYLoad:W}=c.current,G=t().useRef(x);ye((()=>{if(!n)return;const{onChange:e}=n;"radio"===n.type&&p.current.setClickedValues(b.length?[b[0],""]:[]),P(H(b)),null==e||e(b,c.current.selectionRows),E&&V()}),[b]),ye((()=>{if(!i)return;const{allTableData:e,allRowKeys:t}=c.current,{onChange:l}=i;null==l||l(y,y.map((l=>e[t.findIndex((e=>e===l))])))}),[y]),ye((()=>{const{allTableData:e,allRowKeys:t}=c.current;var l;w&&O($()),o&&(p.current.setClickedValues(v?[v,""]:[]),null===(l=o.onChange)||void 0===l||l.call(o,v,e[t.findIndex((e=>e===v))]??null))}),[v]),ye((()=>{var e;(0,Nt.isEqual)(x,G.current)||(G.current=x,E&&r&&(null===(e=r.onChange)||void 0===e||e.call(r,x)))}),[x]),ye((()=>{const e=D(n.selectedRowKeys);(0,Nt.isEqual)(e,b)||(_(e),w&&O($()))}),[null==n?void 0:n.selectedRowKeys]),ye((()=>{const e=$(i.expandedRowKeys);(0,Nt.isEqual)(e,y)||O(e)}),[null==i?void 0:i.expandedRowKeys]),ye((()=>{const{currentRowKey:e}=o;e!==v&&A(e??"")}),[null==o?void 0:o.currentRowKey]),ye((()=>{const{insert:e,remove:t}=B;e&&(C&&T(),N("",1e5)),(e||t)&&I({insert:!1,remove:!1})}),[g.total]),ye((()=>{W&&K(j.$tableBody.parentNode.scrollTop)}),[W]),ye((()=>{q(f)}),[f]),ye((()=>{F(s),p.current.forceUpdate()}),[s]),ye((()=>{W&&(e.height||e.maxHeight||h("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||h("Table","必须设置组件参数 `ellipsis`")),S&&(e.height||e.maxHeight||h("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[W,S]);const Y=()=>{const{resizeState:e}=c.current,{winHeight:t}=e,l=window.innerHeight;l!==t&&(k(Object.assign({},e,{winHeight:l})),L())};t().useEffect((()=>(M({$toper:d.current,$table:u.current,$resizableBar:m.current}),R((0,Nt.cloneDeep)(a)),U(),F(s),window.addEventListener("resize",Y,!1),L(),()=>{z(),window.removeEventListener("resize",Y)})),[])})(e,{tableRef:R,topElementRef:S,tableElementRef:w,tableBodyRef:T,resizableBarRef:I,scrollX:Ce,pagination:oe,selectionKeys:ce,rowExpandedKeys:ue,highlightKey:me,showSummary:ze,summationRows:st,isWebPagination:ke,isScrollPagination:Fe,isTreeTable:it,toLastPage:Lt,setHandleState:V,scrollYToRecord:gt,setOriginColumns:A,setSelectionKeys:de,setSelectionRows:j,setRowExpandedKeys:pe,setHighlightKey:he,setResizeState:K,setMergeCells:H,setPingRight:Re,calcTableHeight:yt,createSelectionKeys:It,createSelectionRows:_t,createRowExpandedKeys:Rt,createElementStore:dt,triggerScrollYEvent:Ht,forceUpdate:N,initialTable:Et,destroy:Bt});const Wt=t().useMemo((()=>({getRowKey:_,tableProps:e,tableRef:R,tableBodyRef:T,$size:C,flattenColumns:He,editableColumns:$e,leftFixedColumns:Ke,rightFixedColumns:Ve,firstDataIndex:Ue,sorter:te,filters:J,superFilters:ne,layout:fe,bordered:Ge,showFooter:je,showSummary:ze,summationRows:st,scrollX:Ce,scrollY:we,pagination:oe,fetchParams:ct,selectionKeys:ce,rowExpandedKeys:ue,highlightKey:me,isFetch:Ae,isPingLeft:Ie,isPingRight:_e,isHeadSorter:Ye,isHeadFilter:Ze,isFullScreen:Pe,isTableEmpty:ot,isHeadGroup:We,isTreeTable:it,isGroupSubtotal:rt,isWebPagination:ke,isDragMergeCell:nt,dataChange:Ft,tableChange:qt,getTableData:St,setElementStore:O,createTableFullData:Ct,setSorter:re,setFilters:ee,setSuperFilters:ie,setSelectionKeys:de,setHighlightKey:he,setRowExpandedKeys:pe,setSelectionRows:j,getSpan:pt,getStickyLeft:mt,getStickyRight:ht,scrollXToColumn:ft,scrollYToRecord:gt,rowInViewport:bt,setPagination:se,setPingLeft:Ne,setPingRight:Re,setSpinning:Ee,setFullScreen:Oe,setShouldToTop:B,setOverlay:G,doFieldValidate:At,createTableData:wt,createGroupData:Tt,findParentRowKeys:Pt,getAllChildRowKeys:Ot,triggerScrollYEvent:Ht,scrollBottomDebouncer:$t,resetTableScroll:vt,clearTableSorter:Mt,clearTableFilter:Kt,clearSuperFilters:Vt,clearRowSelection:Ut,clearRowHighlight:zt})),[e,C,He,$e,Ke,Ve,Ue,te,J,ne,fe,Ge,je,ze,st,Ce,we,oe,ct,ce,ue,me,Ae,Ie,_e,Ye,Ze,Pe,ot,We,it,rt,ke,nt]);((e,l)=>{const{getRowKey:a,tableRef:r,flattenColumns:n,editableColumns:i,pagination:o,fetchParams:s,selectionKeys:c,rowExpandedKeys:d,highlightKey:u,isFetch:p,dataChange:m,getTableData:h,createTableData:f,calcTableHeight:g,scrollXToColumn:b,scrollYToRecord:y,doFieldValidate:v,setHandleState:x,setSelectionKeys:E,setRowExpandedKeys:C,setHighlightKey:S,setSelectionRows:w,forceUpdate:T,getTableLog:I,clearRowSelection:N,clearRowHighlight:_,clearTableSorter:R,clearTableFilter:P,clearSuperFilters:O,clearTableLog:A}=l,k=(e,t,l)=>{for(let r=0;r<e.length;r++){const n=e[r],i=a(n,n.index);Array.isArray(n.children)&&k(n.children,t,l),t.includes(i)&&(null==l||l(n,i),e.splice(r,1),r-=1)}};t().useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{g()},DO_REFRESH:async e=>{p&&(await h(),null==e||e())},GET_LOG:()=>I(),GET_FETCH_PARAMS:()=>{const e={};for(const t in s)Object.keys(o).includes(t)||(e[t]=s[t]);return e},CLEAR_TABLE_DATA:()=>{p||(N(),_(),R(),P(),O(),A(),f([]))},CLEAR_LOG:()=>{A()},FORCE_UPDATE:()=>{T()},SCROLL_TO_RECORD:e=>{y(e)},SCROLL_TO_COLUMN:e=>{b(e)},SET_SELECTION(e){E(e)},SET_HIGHLIGHT(e){S(e)},SET_EXPANDABLE(e){C(e)},SET_SELECTION_ROWS(e){w(e)},INSERT_RECORDS:e=>{const{store:t,tableFullData:l}=r.current,a=(Array.isArray(e)?e:[e]).filter((e=>(0,z.Kn)(e)));a.length&&(a.forEach((e=>{n.forEach((t=>{const{dataIndex:l}=t;[Tn.expandableColumn,Tn.selectionColumn,Tn.operationColumn].includes(l)||(0,Cn.dN)(e,l,(0,Cn.C_)(e,l))})),t.addToInserted(e)})),f(l.concat(a)),x(Object.assign({},r.current.handleState,{insert:!0})),m())},REMOVE_RECORDS:e=>{const{store:t,tableFullData:l}=r.current,n=(Array.isArray(e)?e:[e]).map((e=>(0,z.Kn)(e)?a(e,e.index):e));if(!n.length)return;let o=!1;k(l,n,((e,l)=>{t.addToRemoved(e),i.forEach((a=>{const{dataIndex:r,editRender:n}=a,i=null==n?void 0:n(e,a);if(!i)return;const{rules:o=[],disabled:s}=i;!s&&o.length&&(t.removeFromRequired({x:l,y:r}),t.removeFromValidate({x:l,y:r}))})),c.includes(l)&&E(c.filter((e=>e!==l))),l===u&&_(),d.includes(l)&&C(d.filter((e=>e!==l))),o=!0})),o&&(f(l),x(Object.assign({},r.current.handleState,{remove:!0})),m())},VALIDATE_FIELDS:()=>{r.current.allTableData.forEach((e=>{i.forEach((t=>{const{dataIndex:l,editRender:r}=t,n=null==r?void 0:r(e,t);if(!n)return;const{rules:i=[],disabled:o}=n;!o&&i.length&&v(i,(0,Cn.C_)(e,l),a(e,e.index),l)}))}));const{required:e,validate:t}=I(),l=[...e,...t];return l.length&&(y(l[0].rowKey),T()),{required:e,validate:t}}})))})(l,{getRowKey:_,tableRef:R,flattenColumns:He,editableColumns:$e,pagination:oe,fetchParams:ct,selectionKeys:ce,rowExpandedKeys:ue,highlightKey:me,isFetch:Ae,dataChange:Ft,getTableData:St,createTableData:wt,calcTableHeight:yt,scrollXToColumn:ft,scrollYToRecord:gt,doFieldValidate:At,setHandleState:V,setSelectionKeys:de,setRowExpandedKeys:pe,setHighlightKey:he,setSelectionRows:j,forceUpdate:N,getTableLog:kt,clearRowSelection:Ut,clearRowHighlight:zt,clearTableSorter:Mt,clearTableFilter:Kt,clearSuperFilters:Vt,clearTableLog:jt}),t().useEffect((()=>{En.register(R.current.uid,l??{current:null})}),[]);const Gt=ae("table"),Yt={[`${Gt}--wrapper`]:!0,[`${Gt}--lg`]:"large"===C,[`${Gt}--sm`]:"small"===C,[`${Gt}--maximize`]:Pe,[c]:!!c},Zt={[Gt]:!0,"is--border":Ge,"is--striped":o,"is--fixed":Ke.length||Ve.length,"is--sortable":Ye,"is--filterable":Ze,"is--merge-cell":nt,"is--empty":ot,"show--head":x,"show--foot":je,"ping--left":Ie,"ping--right":_e,"scroll--x":Ce,"scroll--y":we};return t().createElement(cn.Provider,{value:Wt},t().createElement("div",{className:le()(Yt)},g&&t().createElement("div",{ref:S,className:`${Gt}-top`},t().createElement("div",{className:`${Gt}-top__space`},m&&t().createElement(Fn,{total:oe.total}),t().createElement("div",{className:`${Gt}-top__space-slot`,style:{justifyContent:vn[f]}},e.children)),t().createElement("div",{className:`${Gt}-top__actions`},b&&t().createElement(qn,{isFullScreen:Pe}),y&&Ae&&t().createElement(Ln,null),be.print&&u&&t().createElement(Dn,{tableColumns:De}),be.import&&Je&&t().createElement(ti,{tableColumns:De}),be.export&&p&&t().createElement(ri,{tableColumns:De}),et&&t().createElement(ii,{flattenColumns:He}),Qe&&t().createElement(si,{columns:De}),lt&&t().createElement(vi,null),at&&t().createElement(mi,null),tt&&t().createElement(gi,null),v&&t().createElement(xi,{columns:n}))),t().createElement(Be,{spinning:i??xe},t().createElement("div",{ref:w,className:le()(Zt),style:ut},t().createElement("div",{className:`${Gt}--main-wrapper`},x&&t().createElement(Ri,{tableColumns:De,flattenColumns:He,sorter:te,filters:J}),t().createElement(Ui,{ref:T,tableData:X,flattenColumns:He}),je&&t().createElement(zi,{summationRows:st,flattenColumns:He})),Ge&&t().createElement("div",{className:`${Gt}--border-line`}),ot&&t().createElement(Wi,null),s&&t().createElement("div",{ref:I,className:`${Gt}--resizable-bar`}))),qe&&t().createElement(Bi,Gi({},oe,{config:d,onChange:(e,t)=>Dt({current:e,pageSize:t})}))))}));Yi.defaultProps={columns:[],dataSource:[],rowKey:"id",border:!0,resizable:!0,showHeader:!0,ellipsis:!0,multipleSort:!0,topSpaceAlign:"right",showAlert:!0,showFullScreen:!0,showRefresh:!0,showClipboard:!0,showSelectCollection:!0,showSuperSearch:!0,showFastSearch:!0,showGroupSummary:!0,showColumnDefine:!0,showTableInfo:!0},Yi.displayName="Table";const Zi=Yi,Xi=Zi;function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},Qi.apply(this,arguments)}const Ji=e=>{var l;const{uniqueKey:a,multiple:n,initialValue:i,selectionRows:o,defaultSelectedKeys:s=[],filters:c=[],table:u={},name:p,getServerConfig:m,createTableFetch:f,onClose:g}=e,{size:b}=t().useContext(r),y=t().useMemo((()=>e.size??b??""),[e.size,b]),v=t().useRef(null),x=t().useRef(null),E=t().useRef(null),C=Pn(v),S=e=>[{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t().createElement("span",null,e+1)},...e||u.columns||[]],[w,T]=t().useState(u),[I,N]=t().useState(),[_,R]=t().useState(s),[P,O]=t().useState(!1),[A,k]=t().useState(300),[F,q]=t().useState(c),[L,D]=t().useState(S()),[H,$]=t().useState((0,Nt.merge)({},null===(l=u.fetch)||void 0===l?void 0:l.params,i)),[M,K]=t().useState([]),V=()=>{const e=v.current.parentNode.children[0],t=e.querySelector(".form-wrap");k(e.offsetHeight-t.offsetHeight-2*Sl[y]-30)},U=(0,z.Ds)(V,5);ye((()=>{U()}),[C.width]),t().useEffect((()=>{B()}),[H]),t().useEffect((()=>{o&&E.current.SET_SELECTION_ROWS(o)}),[o]),t().useEffect((()=>{j()}),[]);const j=async()=>{if(p){if(!m||!f)return h("searchHelper","从服务端获取配置信息的时候,`getServerConfig` 和 `createTableFetch` 为必选参数");try{const e=await m({searchHelperId:p});if(200===e.code){const{filters:t=[],columns:l=[],rowKey:a,webPagination:r,fetchUrl:n,fetchParams:i={}}=e.data||{};q(t),D(S(l)),T({fetch:{api:f(n),dataKey:"records"},rowKey:a||w.rowKey,webPagination:r||w.webPagination||!1}),Y(i)}}catch(e){}}},B=async()=>{const{webPagination:e,fetch:t}=w;if(!e||null==t||!t.api)return;const{api:l,dataKey:a,beforeFetch:r=z.XT}=t;if(r(H)){O(!0);try{const e=await l(H);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,a)??[];R([]),await(0,z._v)(0),K(t)}}catch(e){}O(!1)}},W=e=>{n||(N(e),g(e))},Y=e=>{$(Object.assign({},H,e))},Z=ae("search-helper"),X=w.webPagination?{dataSource:M,loading:P,webPagination:!0}:{fetch:{...w.fetch,params:H}};return t().createElement("div",{ref:v,className:`${Z}--wrapper`},t().createElement("div",{className:"form-wrap"},t().createElement(Cr,{ref:x,items:F,initialValues:i,uniqueKey:a?`helper_${a}`:a,formType:"search",isAutoFocus:!1,fieldsChange:e=>q(e),onCollapse:()=>V(),onFinish:e=>Y(e),onReset:async()=>{const[e,t]=await x.current.GET_FORM_DATA();e||Y(t)}})),t().createElement("div",null,t().createElement(Xi,Qi({ref:E,height:A,columns:L,rowKey:w.rowKey||"pageIndex"},X,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectedRowKeys:_,onChange:(e,t)=>{R(e),N(n?t:t[0])}},columnsChange:e=>D(e),onRowDblclick:W,onRowEnter:W}))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Sl[y]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(G,{onClick:()=>g(null),style:{marginRight:8}},d("qm.dialog.close")),t().createElement(G,{type:"primary",disabled:!I,onClick:()=>g(I,n?_:void 0)},d("qm.dialog.confirm"))))};Ji.displayName="SearchHelper";const eo=Ji;function to(){return to=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},to.apply(this,arguments)}const lo=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...lo(e.children)),e.children&&t.push(e.value)})),t},ao=(e,t)=>{let l=null;for(let a=0;a<e.length;a++){if(Array.isArray(e[a].children)&&(l=ao(e[a].children,t)),l)return l;if(t(e[a]))return e[a]}return l},ro=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&ro(e.children,t),t(e)||e.children&&e.children.length))),no=e=>{var l;const{uniqueKey:a,multiple:n,initialValue:i,selectionRows:o,defaultSelectedKeys:s=[],filters:c=[],table:u={},tree:p={},name:m,getServerConfig:f,createTableFetch:g,onClose:b}=e,{size:y}=t().useContext(r),v=t().useMemo((()=>e.size??y??""),[e.size,y]),x=t().useRef(null),C=t().useRef(null),S=t().useRef(null),w=Pn(x),T=e=>[{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t().createElement("span",null,e+1)},...e||u.columns||[]],[I,N]=t().useState(u),[_,R]=t().useState(),[P,O]=t().useState(s),[A,k]=t().useState(!1),[F,q]=t().useState(300),[L,D]=t().useState(300),[H,$]=t().useState(c),[M,K]=t().useState(T()),[V,U]=t().useState((0,Nt.merge)({},null===(l=u.fetch)||void 0===l?void 0:l.params,i)),[j,B]=t().useState([]),W=()=>{const e=x.current.parentNode.children[0],t=e.querySelector(".form-wrap"),l=e.querySelector(".input-wrap");q(e.offsetHeight-l.offsetHeight-10),D(e.offsetHeight-t.offsetHeight-2*Sl[v]-30)},Y=(0,z.Ds)(W,5);ye((()=>{Y()}),[w.width]),t().useEffect((()=>{X()}),[V]),t().useEffect((()=>{o&&S.current.SET_SELECTION_ROWS(o)}),[o]),t().useEffect((()=>{Z(),ce()}),[]);const Z=async()=>{if(m){if(!f||!g)return h("searchHelper","从服务端获取配置信息的时候,`getServerConfig` 和 `createTableFetch` 为必选参数");try{const e=await f({searchHelperId:m});if(200===e.code){const{filters:t=[],columns:l=[],rowKey:a,webPagination:r,fetchUrl:n,fetchParams:i={}}=e.data||{};$(t),K(T(l)),N({fetch:{api:g(n),dataKey:"records"},rowKey:a||I.rowKey,webPagination:r||I.webPagination||!1}),J(i)}}catch(e){}}},X=async()=>{const{webPagination:e,fetch:t}=I;if(!e||null==t||!t.api)return;const{api:l,dataKey:a,beforeFetch:r=z.XT}=t;if(r(V)){k(!0);try{const e=await l(V);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,a)??[];O([]),await(0,z._v)(0),B(t)}}catch(e){}k(!1)}},Q=e=>{n||(R(e),b(e))},J=e=>{U(Object.assign({},V,e))},[ee,te]=t().useState([]),[le,re]=t().useState([]),[ne,ie]=t().useState(""),oe=t().useRef(ee),se=t().useRef([]),ce=async()=>{if(!p.fetch)return;const{api:e,params:t,dataKey:l,valueKey:a="value",textKey:r="text"}=p.fetch;try{const n=await e(t);if(200===n.code){const e=Array.isArray(n.data)?n.data:(0,Nt.get)(n.data,l)??[],t=Ut(e,a,r);te(t),oe.current=t,se.current=e}}catch(e){}};ye((()=>{re(lo(ee))}),[ee]);const de=ae("tree-table"),ue=I.webPagination?{dataSource:j,loading:A,webPagination:!0}:{fetch:{...I.fetch,params:V}};return t().createElement("div",{ref:x,className:`${de}--wrapper`},t().createElement(Fe,{defaultValue:200,style:{height:"100%"}},t().createElement(Fe.Pane,{min:100,style:{overflowY:"auto"}},t().createElement(E.Input.Search,{className:"input-wrap",value:ne,style:{marginBottom:8},placeholder:d("qm.form.inputPlaceholder"),onChange:e=>(e=>{const t=ro(oe.current,(t=>!e||-1!==t.text.indexOf(e)));ie(e),te(t)})(e.target.value)}),t().createElement(E.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:F,defaultExpandAll:!0,expandedKeys:le,treeData:ee,filterTreeNode:e=>!!ne&&-1!==e.text.indexOf(ne),onExpand:e=>{re(e)},onSelect:e=>{if(!p.fetch)return;const{valueKey:t="value"}=p.fetch;(e=>{if(!p.tableParamsMap)return h("QmTreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof p.tableParamsMap?p.tableParamsMap():p.tableParamsMap,l={};for(const a in t)l[a]=(0,Nt.get)(e,t[a]);J(l)})(ao(se.current,(l=>(0,Nt.get)(l,t)===e[0]))||{})}})),t().createElement(Fe.Pane,{className:"split-pane"},t().createElement("div",{className:"form-wrap"},t().createElement(Cr,{ref:C,items:H,initialValues:i,uniqueKey:a?`helper_${a}`:a,formType:"search",isAutoFocus:!1,fieldsChange:e=>$(e),onCollapse:()=>W(),onFinish:e=>J(e),onReset:async()=>{const[e,t]=await C.current.GET_FORM_DATA();e||J(t)}})),t().createElement("div",null,t().createElement(Xi,to({ref:S,height:L,columns:M,rowKey:I.rowKey||"pageIndex"},ue,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectedRowKeys:P,onChange:(e,t)=>{O(e),R(n?t:t[0])}},columnsChange:e=>K(e),onRowDblclick:Q,onRowEnter:Q}))))),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Sl[v]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(G,{onClick:()=>b(null),style:{marginRight:8}},d("qm.dialog.close")),t().createElement(G,{type:"primary",disabled:!_,onClick:()=>b(_,n?P:void 0)},d("qm.dialog.confirm"))))};no.displayName="TreeTableHelper";const io=no,oo=(e,t,l)=>{let a;for(let r=0;r<e.length;r++){const n=e[r];if(n.children)if(n.children.some((e=>e[l]===t)))a=n[l];else{const e=oo(n.children,t,l);e&&(a=e)}}return a},so=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...so(e.children,t)),Array.isArray(e.children)&&e.children.length&&l.push(e[t])})),l},co=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...co(e.children,t)),t(e)&&l.push(e)})),l},uo=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&uo(e.children,t),t(e)||e.children&&e.children.length))),po=(e,t,l,a)=>e.map((e=>e[l]===t?{...e,children:a}:e.children?{...e,children:po(e.children,t,l,a)}:e)),mo=(e,t,l)=>{for(let a=0;a<e.length;a++){if(e[a][l]===t)return[t];if(Array.isArray(e[a].children)){const r=mo(e[a].children,t,l);if(r)return[e[a][l],r].flat()}}},ho=(e,t)=>{var l;const a=(null===(l=e.children)||void 0===l?void 0:l.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>a.push(...ho(e,t)))),a},fo=e=>{const{multiple:l,defaultSelectedKeys:a=[],tree:n={},onClose:i}=e,{size:o}=t().useContext(r),s=t().useMemo((()=>e.size??o??""),[e.size,o]),c=t().useRef(null),u=Pn(c),[p,m]=t().useState(),[h,f]=t().useState(300),[g,b]=t().useState(!1),y=(0,z.Ds)((()=>{const e=c.current.parentNode.children[0],t=e.querySelector(".input-wrap");f(e.offsetHeight-t.offsetHeight-10)}),5);ye((()=>{y()}),[u.width]);const[v,x]=t().useState([]),[C,S]=t().useState([]),[w,T]=t().useState([]),[I,N]=t().useState(""),[_,R]=t().useState(!1),P=t().useRef(v),O=t().useRef([]),A=t().useRef([]),k=(e,t)=>{x(e),P.current=e,O.current=t,A.current=so(e,"value")},F=e=>{var t;return(null===(t=mo(v,e,"value"))||void 0===t?void 0:t.slice(0,-1))||[]};ye((()=>{const{defaultExpandAll:e=!0,checkStrategy:t="SHOW_CHILD"}=n,a=[];C.forEach((e=>{if(l){if("SHOW_ALL"===t&&!A.current.includes(e)&&a.push(...F(e)),"SHOW_CHILD"===t&&a.push(...F(e)),"SHOW_PARENT"===t){const t=zt(v,e);if(t){const l=F(e),r=ho(t,"value");a.push(...l,...[e,...r].filter((e=>A.current.includes(e))))}}}else a.push(...F(e))})),T(e?A.current:[...new Set(a)])}),[_]),t().useEffect((()=>{(async()=>{if(!n.fetch)return;const{api:e,params:t,dataKey:r,valueKey:i="value",textKey:o="text"}=n.fetch;try{b(!0);const n=await e(t);if(200===n.code){const e=Array.isArray(n.data)?n.data:(0,Nt.get)(n.data,r)??[],t=Ut(e,i,o);k(t,e),S((e=>{if(l)return a;const t=co(e,(e=>a.includes(e.text)));return 1===t.length?[t[0].value]:[]})(t)),R(!0)}}catch(e){}b(!1)})()}),[]);const q=ae("tree-helper");return t().createElement("div",{ref:c,className:`${q}--wrapper`},t().createElement(E.Input.Search,{value:I,className:"input-wrap",style:{marginBottom:8},placeholder:d("qm.form.inputPlaceholder"),onChange:e=>(e=>{const{defaultExpandAll:t=!0}=n,l=uo(P.current,(t=>{if(!e)return!0;const l=t.text||"";return-1!==`${l}|${Ia.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.indexOf(e)}));N(e),x(l),t||T(e?A.current:[])})(e.target.value)}),t().createElement(Be,{spinning:g},t().createElement(E.Tree,{fieldNames:{title:"text",key:"value",children:"children"},multiple:l,checkable:l,selectable:!l,height:h,checkStrictly:!!n.checkStrictly,selectedKeys:C,checkedKeys:C,expandedKeys:w,treeData:v,loadData:n.asyncLoad?async e=>{let{key:t,children:l}=e;if(!n.fetch||l)return;const{api:a,params:r,dataKey:i,valueKey:o="value",textKey:s="text"}=n.fetch;try{const e=await a({...r,[o]:t});if(200===e.code){const l=Array.isArray(e.data)?e.data:(0,Nt.get)(e.data,i)??[],a=po(v,t,"value",Ut(l,o,s));k(a,po(O.current,t,o,l))}}catch(e){}}:void 0,filterTreeNode:e=>!!I&&-1!==e.text.indexOf(I),onExpand:e=>{T(e)},onSelect:e=>{const{valueKey:t="value"}=n.fetch||{};S(e);const a=co(O.current,(l=>e.includes((0,Nt.get)(l,t))));m(l?a:a[0])},onCheck:e=>{const{valueKey:t="value"}=n.fetch||{},{checkStrictly:a,checkStrategy:r="SHOW_CHILD"}=n;a&&(e=e.checked),S(e),"SHOW_CHILD"===r&&(e=e.filter((e=>!A.current.includes(e)))),"SHOW_PARENT"===r&&(e=e.filter(((e,t,l)=>!l.includes(oo(v,e,"value")))));const i=co(O.current,(l=>e.includes((0,Nt.get)(l,t))));m(l?i:i[0])}})),t().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Sl[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t().createElement(G,{onClick:()=>i(null),style:{marginRight:8}},d("qm.dialog.close")),t().createElement(G,{type:"primary",disabled:!p,onClick:()=>i(p)},d("qm.dialog.confirm"))))};fo.displayName="TreeHelper";const go=fo,bo={previewWidth:1100,defaultDistance:.45,logoHeight:60},yo=(0,e.createContext)(void 0);var vo=null;function xo(){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),l=e.match(/MSIE\D?\d+/i),a=e.match(/OPR\D?\d+/i),r=e.match(/Firefox\D?\d+/i),n=e.match(/x64/i);if(!t&&!l&&n)return!0;if(r){if((r=r[0].match(/\d+/))[0]>=41||n)return!0}else if(a){if((a=a[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!l){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 Eo(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];var a,r="打印控件未安装!点击这里<a href='/static/cLodop/install_lodop32.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。",n="打印控件需要升级!点击这里<a href='/static/cLodop/install_lodop32.exe' target='_self'>执行升级</a>,升级后请重新进入。",i="打印控件未安装!点击这里<a href='/static/cLodop/install_lodop64.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。",o="打印控件需要升级!点击这里<a href='/static/cLodop/install_lodop64.exe' target='_self'>执行升级</a>,升级后请重新进入。",s="(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)",c="(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)",d="Web打印服务CLodop未安装启动,点击这里<a href='/static/cLodop/CLodop_Setup_for_Win32NT.exe' target='_self'>下载执行安装</a>,",u='成功后请 <a href="javascript:;" onclick="javascript:window.history.go(0)">刷新本页面</a> 。',p="Web打印服务CLodop需升级!点击这里<a href='/static/cLodop/CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>,升级后请刷新页面。";try{var m=navigator.userAgent,h=!!m.match(/MSIE/i)||!!m.match(/Trident/i);if(xo()){try{a=getCLodop()}catch(e){}if(!a&&"complete"!==document.readyState)return void E.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!a)return void E.notification.warning({message:"CLodop 信息",duration:null,description:d+""+u});CLODOP.CVERSION<"3.0.8.3"&&E.notification.warning({message:"CLodop 信息",description:p}),t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{var f=h&&!!m.match(/x64/i);if(e||t?a=h?e:t:vo?a=vo:((a=document.createElement("object")).setAttribute("width",0),a.setAttribute("height",0),a.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),h?a.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):a.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(a),vo=a),!a||!a.VERSION)return m.indexOf("Chrome")>=0&&E.notification.warning({message:"CLodop 信息",duration:null,description:c}),m.indexOf("Firefox")>=0&&E.notification.warning({message:"CLodop 信息",duration:null,description:s}),E.notification.warning({message:"CLodop 信息",duration:null,description:f?i:r}),a}return a.VERSION<"6.2.2.6"&&(xo()||E.notification.warning({message:"CLodop 信息",description:f?o:n})),(null==l?void 0:l.length)>=2&&l.every((e=>Array.isArray(e)))&&(a.SET_LICENSES(...l[0]),a.SET_LICENSES(...l[1])),a}catch(e){E.message.error("getLodop 出错:"+e)}}xo();const Co=e=>{const t=e/25.4*(()=>{const e=[],{deviceXDPI:t,deviceYDPI:l}=window.screen;if(t&&l)e[0]=t,e[1]=l;else{var a;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===(a=t.parentNode)||void 0===a||a.removeChild(t),t=null}return e})()[0];return Math.ceil(t)},So=t().forwardRef(((e,l)=>{const{templateRender:a,directPrint:n}=e,{global:i}=t().useContext(r),{$$preview:o}=t().useContext(yo),{state:s,isWindowsPrinter:c,pageSize:d}=o,u=t().useRef(null),p=t().useRef({}),m=t().useRef([]),f=t().useRef([]),g=t().useRef([]),[b,y]=t().useState(!0);t().useImperativeHandle(l,(()=>({createPreviewDom:O,createExportHtml:k,createPrintHtml:A,SHOW_PREVIEW:F,DIRECT_PRINT:q}))),ye((()=>{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*bo.defaultDistance+10*bo.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*bo.defaultDistance+10*bo.defaultDistance:0;return("vertical"===e?d[1]:d[0])-t}),[s,c,d]),E=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return Co(v-10*(e.left-bo.defaultDistance)-10*(e.right-bo.defaultDistance))}),[s,v]),C=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return Co(x-10*(e.top-bo.defaultDistance)-10*(e.bottom-bo.defaultDistance))}),[s,x]),S=s.form.scale,w=t().useMemo((()=>{const{form:{setting:{distance:e}}}=s;return{left:Co(10*e.left),right:Co(10*e.right),top:Co(10*e.top),bottom:Co(10*e.bottom)}}),[s]),T=t().useMemo((()=>{const{form:{printerType:e}}=s,{left:t,right:l,top:a,bottom:r}=w,n=E+t+l,i=bo.previewWidth-n<=0?0:(bo.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>bo.previewWidth?0:i>0?o:(bo.previewWidth-(n-2*o))/2),{width:`${E}px`,height:"stylus"===e?"auto":C+"px",paddingLeft:`${t}px`,paddingRight:`${l}px`,paddingTop:`${a}px`,paddingBottom:`${r}px`,transform:`translateX(${c}px) scale(${S})`,opacity:b?0:1}}),[s,b,w,S,C,E]),I=(m.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e))),()=>{var e,t;const l=(null==i||null===(e=i.print)||void 0===e?void 0:e.leftLogo)??"",a=(null==i||null===(t=i.print)||void 0===t?void 0:t.rightLogo)??"";return[`<tr style="height: ${bo.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',l?`<img src="${l}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',a?`<img src="${a}" border="0" height="46" />`:"","</td>","</tr>"].join("")}),N=()=>{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,l;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=N().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(l=p.current.templateEl).children[0]?l.insertBefore(t,l.children[0]):l.appendChild(t),e=null},R=()=>{const e=p.current.templateEl.children,t=[],l=[];for(let a=0;a<e.length;a++){if("template-cols"===e[a].getAttribute("type"))continue;const r=e[a].clientHeight;e[a].style.height=r+"px",l.push(r),t.push(e[a].outerHTML)}f.current=l,m.current=t},P=()=>{if(!m.current.length)return;const{form:{setting:e,printerType:t}}=s;if(n)return g.current.push([N(),I(),...m.current]);const l=e.fixedLogo?C-bo.logoHeight:C;let a=[];if(g.current=[],"stylus"===t)g.current.push([N(),...e.fixedLogo?[I()]:[],...m.current]);else{let t=0;for(let r=0,n=f.current.length;r<n;r++){const i=m.current[r],o=f.current[r];e.fixedLogo||0!==r||(t+=bo.logoHeight),t+=o,t<=l?a.push(i):(g.current.push([N(),...e.fixedLogo?[I()]:[],...a]),a=[],t=0,r-=1),r===n-1&&a.length&&g.current.push([N(),...e.fixedLogo?[I()]:[],...a])}}var r;e.fixedLogo||null===(r=g.current[0])||void 0===r||r.splice(1,0,I());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 l=`<table cellspacing="0" cellpadding="0" border="0" class="${p.current.templateEl.className}">`;l+=(null===(e=g.current[t-1])||void 0===e?void 0:e.join(""))??"",l+="</table>",p.current.previewEl.innerHTML=l,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<m.current.length;t++)e[t]=m.current[t].replace(/[\r\n]/g,"").replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+I()+N()+e.join("")+"</table>"},F=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,z._v)(0),R(),P(),y(!1))},q=async()=>{var e;if("TABLE"!==(null===(e=p.current.templateEl)||void 0===e?void 0:e.tagName))return L();_(),await(0,z._v)(0),R(),P(),y(!1),o.doPrint(A()),await(0,z._v)(0),o.doClose()},L=()=>{h("QmPrint","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},D={[ae("print-container")]:!0,"no-visible":n};return t().createElement("div",{ref:u,className:le()(D)},t().createElement(Be,{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==a?void 0:a()),t().createElement("div",{className:"workspace",style:T}))))}));So.displayName="Container";const wo=So;function To(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Io extends e.Component{constructor(){super(...arguments),To(this,"formRef",t().createRef()),To(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:bo.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:bo.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:bo.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:bo.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:d("qm.print.setPanel.noEmpty")}]}])),To(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})})),To(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")}))),To(this,"state",{formList:this.createFormList()}),To(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())})),To(this,"cancelHandle",(()=>{this.props.onClose()}))}render(){const{formList:e}=this.state;return t().createElement(t().Fragment,null,t().createElement(Cr,{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(G,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},d("qm.dialog.close")),t().createElement(G,{type:"primary",onClick:()=>this.confirmHandle()},d("qm.dialog.confirm"))))}}To(Io,"contextType",r);const No=Io;function _o(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Ro extends e.Component{constructor(){var e,l,a;super(...arguments),_o(this,"provide",{$$preview:this}),_o(this,"containRef",t().createRef()),_o(this,"state",{visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(l=this.props.defaultConfig)||void 0===l?void 0:l.copies)||1,scale:1,setting:{distance:{left:bo.defaultDistance,right:bo.defaultDistance,top:bo.defaultDistance,bottom:bo.defaultDistance},pageSize:"210*297",direction:(null===(a=this.props.defaultConfig)||void 0===a?void 0:a.direction)||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0}),_o(this,"pageChangeHandle",(e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))})),_o(this,"exportClickHandle",(()=>{this.doExport(this.containRef.current.createExportHtml())})),_o(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 di().setItem(this.printerKey,e),await this.savePrintConfig(this.printerKey,e)}catch(e){}})),_o(this,"doClose",(()=>{var e,t;null===(e=(t=this.props).onClose)||void 0===e||e.call(t)})),_o(this,"getPrintConfig",(async e=>{const t=this.context.global,l=null==t?void 0:t.getComponentConfigApi;if(l)try{const t=await l({key:e});if(200===t.code)return t.data}catch(e){}})),_o(this,"savePrintConfig",(async(e,t)=>{const l=this.context.global,a=null==l?void 0:l.saveComponentConfigApi;if(a)try{await a({[e]:t})}catch(e){}})),_o(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 ')),_o(this,"doPrint",(e=>{const t=Eo();if(!t)return;const{uniqueKey:l,closeOnPrinted:a}=this.props,{form:{setting:r,printerName:n,printerType:i,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:c}=bo,{left:u,right:p,top:m,bottom:h}=r.distance;t.PRINT_INIT(l??Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(n),t.SET_PRINT_COPIES(o),r.doubleSide&&("auto"===r.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"===r.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===r.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===i&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*h*2,""),t.ADD_PRINT_TABLE(10*(m-c)+"mm",10*(u-c)+"mm",`RightMargin: ${10*(p-c)}mm`,`BottomMargin: ${"stylus"!==i?10*(h-c):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?a&&this.doClose():E.message.error(d("qm.print.printError"))},t.PRINT()})),_o(this,"doExport",(e=>{const t=Eo();if(!t)return;const{uniqueKey:l,closeOnPrinted:a}=this.props,{form:{setting:r}}=this.state;t.PRINT_INIT(l??Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?a&&this.doClose():E.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"===r.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=Eo(),t=[{text:d("qm.print.defaultPrinter"),value:-1}];try{const l=e.GET_PRINTER_COUNT();for(let a=0;a<l;a++)t.push({text:e.GET_PRINTER_NAME(a),value:a})}catch(e){h("qm-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 di().getItem(this.printerKey);var e;t||(t=await this.getPrintConfig(this.printerKey),(0,z.Kn)(t)&&await di().setItem(this.printerKey,t)),(0,z.Kn)(t)&&Object.keys(t).length&&(0,Nt.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:l}=this.props,{visible:a,form:r,currentPage:n,totalPage:i,printPage:o}=this.state,s=ae("print-preview"),c={visible:a,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:le()(u)},t().createElement("div",{className:"outer"},t().createElement("div",{className:"header"},t().createElement("span",null,d("qm.print.printer"),":",t().createElement(E.Select,{value:r.printerName,onChange:e=>{this.setState((t=>(0,Nt.merge)({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",null,d("qm.print.type"),":",t().createElement(E.Select,{value:r.printerType,onChange:e=>{this.setState((t=>(0,Nt.merge)({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>t().createElement(E.Select.Option,{key:e.value,value:e.value},e.text))))),t().createElement("span",null,d("qm.print.copies"),":",t().createElement(E.InputNumber,{value:r.copies,min:1,precision:0,onChange:e=>{this.setState((t=>(0,Nt.merge)({},t,{form:{copies:e??1}})))},style:{width:"50px"}})),t().createElement("span",null,d("qm.print.printPage.0"),t().createElement(E.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(E.Pagination,{size:"small",current:n,pageSize:1,total:i,onChange:this.pageChangeHandle})),t().createElement("span",null,t().createElement(G,{type:"text",icon:t().createElement(re.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},d("qm.print.setting"))),t().createElement("span",null,t().createElement(G,{type:"text",icon:t().createElement(re.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},d("qm.print.export"))),t().createElement("span",null,t().createElement(G,{icon:t().createElement(re.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},d("qm.print.print")))),t().createElement("div",{className:"main"},t().createElement(yo.Provider,{value:this.provide},t().createElement(wo,{ref:this.containRef,templateRender:l,directPrint:!1}))),t().createElement("div",{className:"footer"},t().createElement("span",null,d("qm.print.scale"),":",t().createElement(E.Slider,{value:r.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>(0,Nt.merge)({},t,{form:{scale:e}})))}}),t().createElement("em",{className:"scale-text"},`${Math.floor(100*r.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(It,c,t().createElement(No,{setting:r.setting,onChange:e=>{this.setState((t=>(0,Nt.merge)({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):t().createElement(yo.Provider,{value:this.provide},t().createElement(wo,{ref:this.containRef,templateRender:l,directPrint:!0}))}}_o(Ro,"contextType",r);const Po=Ro;function Oo(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}class Ao extends e.Component{constructor(){super(...arguments),Oo(this,"previewRef",t().createRef()),Oo(this,"state",{visible:!1,loading:!1}),Oo(this,"clickHandle",(async()=>{this.setState({loading:!0});try{var e,t;const l=await(null===(e=(t=this.props).click)||void 0===e?void 0:e.call(t));if(this.setState({loading:!1}),"boolean"==typeof l&&!l)return;await this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),Oo(this,"createRender",(()=>{const{visible:e}=this.state,{templateRender:l,uniqueKey:a,defaultConfig:r,preview:n,closeOnPrinted:i}=this.props,o={visible:e,title:d("qm.print.preview"),width:`${bo.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},s={ref:this.previewRef,templateRender:l,uniqueKey:a,defaultConfig:r,preview:n,closeOnPrinted:i,onClose:()=>{this.setState({visible:!1})}};return n?t().createElement(It,o,t().createElement(Po,s)):e?t().createElement(Po,s):null})),Oo(this,"DO_PRINT",(async()=>{const{preview:e}=this.props;await(0,z._v)(0),this.setState({visible:!0}),await(0,z._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:l,icon:a,type:r,disabled:n,shape:i}=this.props,o={size:l||this.context.size||"",type:r,shape:i,icon:a,loading:e,disabled:n,click:this.clickHandle};return t().createElement(t().Fragment,null,this.props.children&&t().createElement(G,o,this.props.children),this.createRender())}}Oo(Ao,"propTypes",{size:(e,t,l)=>{if(!g(e[t]||""))return m("QmAnchor","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},templateRender:a().elementType}),Oo(Ao,"defaultProps",{preview:!0,type:"primary",icon:t().createElement(re.PrinterOutlined,null)}),Oo(Ao,"contextType",r);const ko=Ao,Fo=JSON.parse('{"i8":"1.2.0-beta.22"}').i8})(),__webpack_exports__})()));