UNPKG

@zhangqingcq/plug-r-qw

Version:

A JS lib base on Vue and View-design, you can achieve some complex functions with simple code after install this lib.

1 lines 194 kB
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("@wangeditor/editor"),require("@wangeditor/editor-for-vue"),require("@zhangqingcq/view-design-r"),require("ar-cascader"),require("axios"),require("deepmerge"),require("echarts"),require("lodash"),require("moment"),require("popper.js"),require("sweetalert"),require("vue"),require("vue-amap"),require("vue-json-viewer"),require("wangeditor"),require("xss")):"function"===typeof define&&define.amd?define(["@wangeditor/editor","@wangeditor/editor-for-vue","@zhangqingcq/view-design-r","ar-cascader","axios","deepmerge","echarts","lodash","moment","popper.js","sweetalert","vue","vue-amap","vue-json-viewer","wangeditor","xss"],t):"object"===typeof exports?exports["plugRQw"]=t(require("@wangeditor/editor"),require("@wangeditor/editor-for-vue"),require("@zhangqingcq/view-design-r"),require("ar-cascader"),require("axios"),require("deepmerge"),require("echarts"),require("lodash"),require("moment"),require("popper.js"),require("sweetalert"),require("vue"),require("vue-amap"),require("vue-json-viewer"),require("wangeditor"),require("xss")):e["plugRQw"]=t(e["@wangeditor/editor"],e["@wangeditor/editor-for-vue"],e["@zhangqingcq/view-design-r"],e["ar-cascader"],e["axios"],e["deepmerge"],e["echarts"],e["lodash"],e["moment"],e["popper.js"],e["sweetalert"],e["vue"],e["vue-amap"],e["vue-json-viewer"],e["wangeditor"],e["xss"])})("undefined"!==typeof self?self:this,(function(e,i,a,l,s,o,r,n,d,c,h,u,p,m,f,y){return function(){"use strict";var g={934:function(t){t.exports=e},365:function(e){e.exports=i},513:function(e){e.exports=a},354:function(e){e.exports=l},742:function(e){e.exports=s},714:function(e){e.exports=o},190:function(e){e.exports=r},773:function(e){e.exports=n},416:function(e){e.exports=d},871:function(e){e.exports=c},286:function(e){e.exports=h},380:function(e){e.exports=u},612:function(e){e.exports=p},230:function(e){e.exports=m},90:function(e){e.exports=f},210:function(e){e.exports=y}},v={};function b(e){var t=v[e];if(void 0!==t)return t.exports;var i=v[e]={exports:{}};return g[e](i,i.exports,b),i.exports}!function(){b.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return b.d(t,{a:t}),t}}(),function(){b.d=function(e,t){for(var i in t)b.o(t,i)&&!b.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}}(),function(){b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){b.p=""}();var w={};if(b.d(w,{default:function(){return Eo}}),"undefined"!==typeof window){var k=window.document.currentScript,S=k&&k.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);S&&(b.p=S[1])}var x=function(){var e=this,t=e._self._c;return t("span",[e._v("Greetings from Ricky.")])},C=[],T={name:"Hello"},L=T;function _(e,t,i,a,l,s,o,r){var n,d="function"===typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=i,d._compiled=!0),a&&(d.functional=!0),s&&(d._scopeId="data-v-"+s),o?(n=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),l&&l.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},d._ssrRegister=n):l&&(n=r?function(){l.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:l),n)if(d.functional){d._injectStyles=n;var c=d.render;d.render=function(e,t){return n.call(t),c(e,t)}}else{var h=d.beforeCreate;d.beforeCreate=h?[].concat(h,n):[n]}return{exports:e,options:d}}var I=_(L,x,C,!1,null,null,null),B=I.exports,K=function(){var e=this,t=e._self._c;return t("div",{ref:"tableBox",staticClass:"btTablePage fullHeight flexColumnBox"},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.showTopRow,expression:"showTopRow"}],staticClass:"topBtn"},[e._t("tableSetting"),e._t("topMsg"),e._t("topBtnGroup")],2),t("div",{staticClass:"tableContainer growFlexItem"},[t("div",{staticClass:"fullHeight relativeBox"},[t("div",{ref:"tableContainerLOI",staticClass:"fullFlowContent"},[t("Table",e._g(e._b({ref:"TableXXX",class:{noBorderTable:e.noBorderTable,fullHeightTable:!e.fixedTable,lightHeadO:e.lightHead},attrs:{height:e.fixedTable&&e.tableContainerHeight||null,columns:e.columnsT,data:e.dataS,"highlight-row":e.radio||e.highlightRow},on:{"on-select":e.onSelect,"on-selection-change":e.selectionHandle,"on-sort-change":e.onSortChange,"on-row-click":e.onRowClick}},"Table",e.$attrs,!1),e.$listeners))],1)])]),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.noPage,expression:"!noPage"}],staticClass:"pageContainer"},[e.usePagePro?t("page-pro",{attrs:{modelValue:e.current,total:e.total,showTotal:e.showTotal,pageSize:e.pageSizeT,showSizer:e.showSizer,pageSizeOpts:e.pageSizes,size:e.pageComponentSize},on:{"on-change":e.changePage,"on-page-size-change":e.pageSizeChange}}):t("Page",{attrs:{current:e.current,total:e.total,pageSize:e.pageSizeT,pageSizeOpts:e.pageSizes,showSizer:e.showSizer,showTotal:e.showTotal,showElevator:!e.noElevator,size:e.pageComponentSize},on:{"update:current":function(t){e.current=t},"on-change":e.changePage,"on-page-size-change":e.pageSizeChange}})],1)])},D=[],$=b(773),A=b.n($),R=b(286),O=b.n(R),N={r:{locale:"zh-CN",testMsg:"测试国际化",confirm:"确定",save:"保存",cancel:"取消",clear:"清空",info:{title:"提示",text:"确定执行该操作?"},http:{403:"登录状态失效,请重新登录!",409:"该账号已在其他地方登录,点击确定退出。"},pSelect:"请选择",pInput:"请输入",selectDate:"选择日期",selectTime:"选择时间",search:"搜索",level:{1:"一级",2:"二级",3:"三级"},unknown:"未知",title:"标题",required:"该项为必填",back:"返回",button:"按钮",check:"查询",adSearch:"高级查询",all:"全选",tabSetting:" 列表显示设置",delete:"删除",fView:"全屏预览",download:"点击下载",file:"文件",selectFile:"选择文件",notImg:"文件不是图片,不可预览",wrongFileType:"文件类型不被允许",supportType:"支持类型:",none:"无",fileIsBig:"文件过大",supportSize:"支持最大:",uploadError:"上传出错",uploadFail:"上传失败",closePreview:"关闭预览",fullImg:"该文件不支持图片形式预览",preview:"预览",searchFor:"当前搜索:",noMore:"没有更多数据了",optionLabel:"选项",getDataError:"拉取数据出错",add:"添加",remove:"移除",addAll:"全部添加",removeAll:"全部移除",added:"已添加",notAdded:"未添加",success:"成功",failed:"失败",error:"出错",pageNotFound:"页面没找到",notFoundMsg:"您访问的页面不存在,点击下面按钮返回上一个页面。",hideMenu:"收起菜单",showMenu:"展开菜单",print:"打印",close:"关闭",help:"帮助",printGuide:{1:"鼠标停留在表头列右边框,出现拖动图标,按下鼠标拖动可设置列宽。",2:"点击“列表显示设置”,可选择需要打印的列,选择完需点击“确定”按钮。",3:"页面有A4灰色参考线,将打印内容右边缘调至参考线区间,打印机默认设置时可将表格内容铺满A4纸,表格越宽字体将越小。",4:"将此页面地址复制到浏览器地址栏,打开的页面将不可用。",5:"未到此线内容将无法铺满纸张",6:"超过此线打印内容将不完整",7:"A4 纵向参考线",8:"A4 横向参考线",9:"复制的页面无法使用该打印功能。",10:"鼠标停留在打印内容顶部矩形条右边框,出现拖动图标,按下鼠标拖动可设置打印内容宽度。"},page:"条/页",total:"共",items:"条",notSave:"您未保存,是否保存?",last:"上一张",next:"下一张"}},M=b(380),P=b.n(M),V=b(714),G=b.n(V);const F=/(%|)\{([0-9a-zA-Z_]+)\}/g;function z(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function E(e,...t){return 1===t.length&&"object"===typeof t[0]&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(F,((i,a,l,s)=>{let o;return"{"===e[s-1]&&"}"===e[s+i.length]?l:(o=z(t,l)?t[l]:null,null===o||void 0===o?"":o)}))}let X=N,H=!1,j=function(){const e=Object.getPrototypeOf(this||P()).$t;if("function"===typeof e&&P().locale)return H||(H=!0,P().locale(P().config.lang,G()(X,P().locale(P().config.lang)||{},{clone:!0}))),e.apply(this,arguments)};const W=function(e,t){let i=j.apply(this,arguments);if(null!==i&&void 0!==i)return i;const a=e.split(".");let l=X;for(let s=0,o=a.length;s<o;s++){const e=a[s];if(i=l[e],s===o-1)return E(i,t);if(!i)return"";l=i}return""},U=function(e){X=e||X},q=function(e){j=e||j};var J={use:U,t:W,i18n:q};function Y(e,t,i,a=!0){const l=(...e)=>W.apply(this,e);return new Promise(((s,o)=>{switch(Q(e)){case"Object":let r=l("r.confirm"),n=l("r.cancel"),d=!1,c="swalConfirmBt",h="swalCancelBt";const u=/^HTML.*Element$/;e.type&&(e.icon=e.type)&&delete e.type,e.className=e.className||"swalBoxX",e.text&&u.test(Q(e.text))&&(e.content=e.text,delete e.text),e.content&&"String"===Q(e.content)&&(e.text=e.content,delete e.content),!1!==e.button&&(e.buttons&&"Object"===Q(e.buttons)?e.buttons.cancel&&(e.buttons.cancel.text&&(n=e.buttons.cancel.text)&&(d=!0),e.buttons.cancel.className&&(h=e.buttons.cancel.className),e.buttons.confirm.text&&(r=e.buttons.confirm.text),e.buttons.confirm.className&&(c=e.buttons.confirm.className)):e.buttons&&"Array"===Q(e.buttons)&&(e.buttons[0]&&(!0!==e.buttons[0]&&(n=e.buttons[0]),d=!0),e.buttons[1]&&!0!==e.buttons[1]&&(r=e.buttons[1])),e.buttons={confirm:{text:r,value:!0,visible:!0,className:c},cancel:{text:n,value:null,visible:d,className:h}}),e.closeOnClickOutside=e.closeOnClickOutside??!0,O()(e).then((t=>{t&&"Function"===Q(e.onOk)&&e.onOk(),s(t)})).catch((e=>{o(e)}));break;case"String":let p={title:e,buttons:{confirm:{text:l("r.confirm"),value:!0,visible:!0,className:"swalConfirmBt",closeModal:!0}},className:"swalBoxX",closeOnClickOutside:a};if(t)switch(Q(t)){case"String":p.text=t;break;case"HTMLElement":p.content=t;break}i&&(p.icon=i),O()(p).then((e=>{s(e)})).catch((e=>{o(e)}));break;case"Boolean":!1===e&&O().close();break;default:throw new TypeError("swal第一个参数类型有误,仅支持Object/String/false")}}))}function Q(e){let t=Object.prototype.toString.call(e);return t.replace(/\[object |]/g,"")}function Z(e){return e.replace(/_(\w)/g,(function(e,t){return t.toUpperCase()}))}function ee(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function te(e){let t=Q(e);if("Object"===t){for(let i in e)if(e.hasOwnProperty(i)){let t=Q(e[i]);"String"===t?e[i]=e[i].trim():"Object"!==t&&"Array"!==t||te(e[i])}}else if("Array"===t)for(let i=0,a=e.length;i<a;i++){let t=Q(e[i]);"String"===t?e[i]=e[i].trim():"Array"!==t&&"Object"!==t||te(e[i])}return e}function ie(e,t=[]){if("Array"===Q(e))return e.forEach(((t,i)=>{switch(Q(t)){case"Array":case"Object":ie(t);break;default:e[i]=null}})),e;if("Object"===Q(e)){for(let i in e)if(e.hasOwnProperty(i)){let a=!0;for(let e of t)if(e===i){a=!1;break}if(a)switch(Q(e[i])){case"Array":case"Object":ie(e[i]);break;default:e[i]=null}}return e}return e}function ae(e){let t=document.createElement("div");void 0!==t.textContent?t.textContent=e:t.innerText=e;let i=t.innerHTML;return t=null,i}function le(e){let t=document.createElement("div");t.innerHTML=e;let i=t.innerText||t.textContent;return t=null,i}function se(e){return new Promise((t=>{let i=new FileReader;i.readAsDataURL(e),i.onloadend=()=>{t(i.result)}}))}function oe(e){return e?.split(".").pop().toLocaleLowerCase()||""}function re(e){return"String"===Q(e)&&e.indexOf("image")>-1}function ne(e){const t=oe(e);let i="ios-document-outline";return["gif","jpg","jpeg","png","bmp","webp"].indexOf(t)>-1?i="ios-image":["mp4","m3u8","rmvb","avi","swf","3gp","mkv","flv"].indexOf(t)>-1?i="ios-film":["mp3","wav","wma","ogg","aac","flac"].indexOf(t)>-1?i="ios-musical-notes":["doc","txt","docx","pages","epub","pdf"].indexOf(t)>-1?i="md-document":["numbers","csv","xls","xlsx"].indexOf(t)>-1?i="ios-stats":["keynote","ppt","pptx"].indexOf(t)>-1&&(i="ios-videocam"),i}function de(e,t){let i=document.createElement("a");i.href=t,i.download=e,ce(i)}function ce(e){let t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}const he={headers:{"Content-Type":"multipart/form-data"}};function ue(e){let t=new FormData;for(let i in e)e.hasOwnProperty(i)&&null!==e[i]&&t.append(i,e[i]);return t}function pe({group:e,condition:t,pathKey:i,childKey:a="children",path:l=[]}){if(e&&A().isObject(e))if(A().isFunction(t)){if(A().isPlainObject(e)){let s=e,o=A().cloneDeep(l);if(t(s))return i&&s[i]&&o.push(s[i]),o;if(s[a]&&!A().isEmpty(s[a])){i&&s[i]&&o.push(s[i]);let e=pe({group:s[a],condition:t,pathKey:i,childKey:a,path:o});if(!A().isEmpty(e))return e}}else if(Array.isArray(e))for(let s of e){let o=A().cloneDeep(l);if(t(s))return i&&s[i]?o.push(s[i]):o.push(e.indexOf(s)),o;if(s[a]&&s[a].length>0){i&&s[i]?o.push(s[i]):o.push(e.indexOf(s));let l=pe({group:s[a],condition:t,pathKey:i,childKey:a,path:o});if(!A().isEmpty(l))return l}}}else if(Array.isArray(e))for(let s of e){let i=A().cloneDeep(l);if(s===t)return i.push(e.indexOf(s)),i}return[]}function me(e,t,i=!1){if(!e||!t)return!1;const a="Function"===Q(t);let l,s="notFoundC",o=function(e,t){if("Array"===Q(e)){if(a&&t(e))return s=e,[];for(let i of e){if("notFoundC"!==s)break;if(a&&t(i)||i===t)return s=i,[e.indexOf(i)];if("Array"===Q(i)||"Object"===Q(i)){let a=o(i,t);if(void 0!==a)return[e.indexOf(i),...a]}}}else if("Object"===Q(e)){if(a&&t(e))return s=e,[];for(let i in e){if("notFoundC"!==s)break;if(e.hasOwnProperty(i)){if(a&&t(i)||e[i]===t)return s=e[i],[i];if("Object"===Q(e[i])||"Array"===Q(e[i])){let a=o(e[i],t);if(void 0!==a)return[i,...a]}}}}};return l=o(e,t),i?l||!1:"notFoundC"!==s&&s}function fe(e,t){for(let i=0,a=t.length;i<a;i++)if(e===t[i])return!0;return!1}function ye(e,t=2){let i=new RegExp(`(^-?\\d+\\.\\d{${t}})(\\d+$)`),a=e&&String(e)||"";return i.test(a)?Number(a.replace(i,"$1")):e}function ge(e,t={},i="get"){let a=document.createElement("form"),l=document.getElementsByTagName("body")[0];l.appendChild(a),a.setAttribute("style","display:none"),a.setAttribute("target",""),a.setAttribute("method",i);let s=e;if(window?.g){let t=Object.keys(window.g).filter((e=>e?.indexOf("URL")>-1)).map((e=>e?.replace("URL","")));for(let i of t){let t=new RegExp("^/"+i+"(?=/.*$)","i");if(t.test(e)&&window.g[i+"URL"]){s=window.g[i+"URL"]+e.replace(t,"");break}}}if(a.setAttribute("action",s),A().isPlainObject(t)){for(let i in t)if(t.hasOwnProperty(i)&&(t[i]||0===t[i]||!1===t[i]||""===t[i])){let e=document.createElement("input");e.setAttribute("type","hidden"),e.setAttribute("name",i),e.setAttribute("value",t[i]),a.appendChild(e)}a.submit();let e=setTimeout((()=>{l.removeChild(a),clearTimeout(e),e=null}),8e3)}else console.error("请求数据格式有误,无法下载文件")}function ve(e,t={},i="get"){!t.hasOwnProperty("columns")||""!==t["columns"]&&null!==t["columns"]&&void 0!==t["columns"]?ge(e,t,i):Y.call(this,{title:"需要导出的列不能为空",type:"warning"})}function be(e,t,i=!1){let a;if(e&&"Array"===Q(t)){let i=localStorage.getItem(e);i?(i=JSON.parse(decodeURI(i)),a=t.filter((e=>e?.key&&-1!==i.indexOf(e?.title))).map((e=>e?.key))):a=t.map((e=>e?.key))}else a=[];return i||(a=String(a)),a}function we(e){return void 0!==e&&null!==e&&""!==e}function ke(e){const t=/^-?\d+(.\d+)?$/;return t.test(e)}function Se(e,t=!1,i=""){return function(a,l){let s;if("Array"===Q(e)){let t=[];for(let i of e)we(l.row[i])&&t.push(l.row[i]);s=t.join(i)}else s="Function"===Q(e)?e(l):l.row[e];return a("tableTooltip",{props:{content:t?""===s?"--":s??"--":s}})}}function xe(e,t=12){if("String"===Q(e)&&e.length>0){let i=document.createElement("span");i.style.fontSize=t+"px",i.style.fontFamily="inherit",i.innerHTML=e,i.style.opacity="0",i.style.position="fixed",i.style.top="3000px",document.body.append(i);const a=i.clientWidth;return document.body.removeChild(i),a}return 0}function Ce(e){if(A().isPlainObject(e)){for(let t in e)if(e.hasOwnProperty(t)&&we(e[t]))return!1;return!0}if(Array.isArray(e)){for(let t of e)if(we(t))return!1;return!0}return!we(e)}function Te(e){return"String"===Q(e)?e.replace(/[^\x00-\xff]/g,"01").length:"Number"===Q(e)?(e+="",e.replace(/[^\x00-\xff]/g,"01").length):0}function Le({group:e,condition:t,key:i,val:a,childKey:l="children"}){if("Array"!==Q(e)||"Function"!==Q(t)||"String"!==Q(i)||"String"!==Q(l))return!1;e.forEach((e=>{t(e)&&("Function"===Q(a)?e[i]=a(e[i]):e[i]=a),"Array"===Q(e[l])&&e[l].length>0&&Le({group:e[l],condition:t,key:i,val:a,childKey:l})}))}function _e(e){let t=sessionStorage.getItem("btnPermissions");return!!t&&t.split(",").indexOf(e)>-1}function Ie(e){return""===e?null:e}function Be(e){return"Number"===Q(e)&&"NaN"===String(e)}function Ke(e,t,i){if("Object"!==Q(e))return e;let a=Object.assign(e,{}),l="";for(let s in a)if(a.hasOwnProperty(s)){let e=a[s];void 0===e||""===e||"String"===Q(e)&&""===e.trim()||null===e||Be(e)?i?t?l+=s+"=&":a[s]="":delete a[s]:t&&(l+=s+"="+e+"&")}return t?l.length>0?l.substr(0,l.length-1):"":a}function De(e){e=e||window.Event,e?.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function $e(e){let t;if(Array.isArray(e)){t=[];for(let i of e)Array.isArray(i)||A().isPlainObject(i)?t.push($e(i)):we(i)&&t.push(i)}else if(A().isPlainObject(e)){t={};for(let i in e)e.hasOwnProperty(i)&&(Array.isArray(e[i]||A().isPlainObject(e[i]))?t[i]=$e(e[i]):we(e[i])&&(t[i]=e[i]))}return t}function Ae(e){const t=window.open();t.document.write(e);const i=setTimeout((()=>{t.print(),window.clearTimeout(i)}),10)}function Re(e){let t=[],i=e;while(e=e.previousSibling)1===e.nodeType&&t.push(e);while(i=i.nextSibling)1===i.nodeType&&t.push(i);return t}var Oe=b(742),Ne=b.n(Oe),Me=b(513);let Pe=!1;function Ve({height:e,width:t=416,title:i,content:a,onOk:l,onCancel:s,onClose:o,okText:r,cancelText:n,noWarnIcon:d,footerAlign:c,cancelBt:h}){const u=(...e)=>W.apply(this,e),p=e&&Number(e)-90>100?Number(e)-90+"px":0,m=p||"100px";a=a||u("r.info.text");const f="String"===Q(a),y="Function"===Q(a);Me.Modal.warning({width:t,render:e=>e("div",{class:"customMessageBox",style:{height:m}},[e("div",{class:"containerN"},[e("div",{class:"titleN"},[e("span",i||u("r.info.title")),e("Button",{class:"fr closeN ivu-btn ivu-btn-text",props:{type:"text"},on:{click(){Me.Modal.remove(),o&&"Function"===Q(o)&&o()}}},[e("i",{class:"ivu-icon ivu-icon-ios-close",style:{fontSize:"30px"}})])]),e("div",{class:"contentN",style:{textAlign:f?"center":"left"}},[e("i",{class:f&&!0!==d?"ivu-icon ivu-icon-ios-alert-outline":"hide",style:{fontSize:"60px",color:"#f8bb86"}}),e("div",{class:"msgBoxConO"},y?[a(e)]:a)]),e("div",{class:"footerN",style:{textAlign:c||"center"}},[e("Button",{class:"okBtN ivu-btn ivu-btn-default",on:{click(e){if(l&&"function"===typeof l){const t=l();if(t&&"Promise"===Q(t)){Pe=!0;const i=e?.currentTarget||e?.target;if(i){i.classList.add("ivu-btn-loading"),i.nextSibling.setAttribute("disabled","disabled");const e=i.parentElement?.parentElement.querySelector(".titleN .closeN");e.classList.add("disabled")}Promise.resolve(t).then((()=>{Pe=!1,Me.Modal.remove()})).catch((()=>{Pe=!1,Me.Modal.remove()}))}else Me.Modal.remove()}}}},[e("i",{class:"ivu-load-loop ivu-icon ivu-icon-ios-loading"}),e("span",r||u("r.confirm"))]),e("Button",{class:["cancelBtN ivu-btn ivu-btn-default",!1===h&&"hide"],on:{click(){Me.Modal.remove(),"Function"===Q(s)&&s()}}},n||u("r.cancel"))])])])})}let Ge=0,Fe=document.createElement("div");function ze(e){e?Fe.classList.add("show"):Fe.classList.remove("show")}function Ee(e){let t=Ge;e?Ge++:Ge>0&&Ge--,t!==Ge&&(0===Ge?ze(!1):0===t&&ze(!0))}Fe.setAttribute("class","spinModal"),Fe.innerHTML='<div class="loader"><svg class="circular" viewBox="25 25 50 50"><circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10" /></svg></div>',window.onload=function(){document.getElementsByTagName("body")[0].append(Fe)};const Xe=window.location.origin;let He=Ne().create({baseURL:Xe,withCredentials:!0});function je(){console.info("store为空,请在安装插件时传入store实例,vuex:Vue.use(plugRQw,{store}),Pinia:Vue.use(plugRQw,{useStore})")}function We(){if(He.store)if("function"===typeof He.store){const e=He.store();e.logout&&e.logout()}else He.store.dispatch("logout");else je()}function Ue(e,t,i,a){a?.spin&&Ee(!1);let l=!0,s=e?.data;if(s){i=i||[];for(let e of i)s=s[e],l=l&&s;return l?s:(t&&console.warn(t),!1)}return t&&console.warn(t),!1}function qe(e,t,i,a,l,s,o){return new Promise(((r,n)=>{switch(e){case"get":He.get(t,{params:i}).then((e=>{let t=Ue(e,a,l,s);t?r(t):n(e)})).catch((e=>{Ue({},a,l,s),n(e)}));break;case"delete":let e=o?"params":"data";He.delete(t,{[e]:i}).then((e=>{let t=Ue(e,a,l,s);t?r(t):n(e)})).catch((e=>{Ue({},a,l,s),n(e)}));break;case"post":He.post(t,i,s).then((e=>{let t=Ue(e,a,l,s);t?r(t):n(e)})).catch((e=>{Ue({},a,l,s),n(e)}));break;case"put":He.put(t,i,s).then((e=>{let t=Ue(e,a,l,s);t?r(t):n(e)})).catch((e=>{Ue({},a,l,s),n(e)}));break;default:}}))}function Je(e,t,i,a,l,s={},o){return new Promise(((r,n)=>{if(t){s?.spin&&Ee(!0);let d,c=t;if(window?.g){let e=Object.keys(window.g).filter((e=>e?.indexOf?.("URL")>-1)).map((e=>e?.replace?.("URL","")));for(let i of e){let e=new RegExp("^/"+i+"(?=/.*$)","i");if(e.test(t)&&window.g[i+"URL"]){c=window.g[i+"URL"]+t.replace(e,"");break}}}if("multipart/form-data"===s?.headers?.["Content-Type"])d=i;else if(d=Array.isArray(i)?[]:{},i&&!A().isEmpty(i))if(Array.isArray(i))for(let e of i)(e||0===e||!1===e||""===e&&!s.noEmptyStr)&&d.push(e);else for(let e in i)i.hasOwnProperty(e)&&(i[e]||0===i[e]||!1===i[e]||""===i[e]&&!s.noEmptyStr)&&(d[e]=i[e]);let h=e.toLowerCase();qe(h,c,d,a,l,s,o).then((e=>{r(e)})).catch((e=>{n(e)}))}else console.error("没有请求地址:url"),n("没有请求地址:url")}))}He.interceptors.request.use((e=>e),(e=>Promise.reject(e))),He.interceptors.response.use((e=>(403!==e?.data?.code&&409!==e?.data?.code||Ve({content:W("r.http."+e.data.code),onOk:We}),e)),(e=>(403!==e?.response?.status&&409!==e?.response?.status||Ve({content:W("r.http."+e.response.status),onOk:We}),console.warn("请求出错:",e),Promise.reject(e))));var Ye={init(e){He.store=e},post(e,t={},i,a,l){return new Promise(((s,o)=>{Je("post",e,t,i,a,l).then((e=>{s(e)})).catch((e=>{o(e)}))}))},put(e,t={},i,a,l){return new Promise(((s,o)=>{Je("put",e,t,i,a,l).then((e=>{s(e)})).catch((e=>{o(e)}))}))},get(e,t={},i,a,l){return new Promise(((s,o)=>{Je("get",e,t,i,a,l).then((e=>{s(e)})).catch((e=>{o(e)}))}))},delete(e,t={},i,a,l,s=!0){return new Promise(((o,r)=>{Je("delete",e,t,i,a,l,s).then((e=>{o(e)})).catch((e=>{r(e)}))}))},all:Ne().all,spread:Ne().spread,config:He};let Qe=[],Ze=[];const et=function(e){e?.beforeEach?e.beforeEach(((e,t,i)=>{Qe.map((e=>{window.clearTimeout(e)})),Ze.map((e=>{window.clearInterval(e)})),Qe.length=0,Ze.length=0,i()})):console.warn("安装库plug-r-qw时未传入router,调用该库的定时器方法产生的定时器将不能自动销毁,请传入router:Vue.use(plugRQw,{router,...})")},tt=function(e,t){let i=window.setTimeout(e,t);return Qe.push(i),i},it=function(e,t){let i=window.setInterval(e,t);return Ze.push(i),i};var at={init:et,setTimeout:tt,setInterval:it},lt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pagePro",class:{pageProDefault:"default"===e.size}},[e.showTotal?t("span",{staticClass:"pageTotal"},[e._v(e._s(e.t("r.total")+" ")+e._s(e.total)+e._s(" "+e.t("r.items")))]):e._e(),t("Page",{ref:"pageRef",attrs:{current:e.current,"page-size":e.pageSizeT,total:e.total,size:e.size,"page-size-opts":e.pageSizeOpts,disabled:e.disabled,simple:""},on:{"update:current":function(t){e.current=t}}}),e.showSizer?t("div",{staticClass:"pageProSize"},[t("Select",{attrs:{size:e.size,transfer:e.transfer,disabled:e.disabled},model:{value:e.pageSizeT,callback:function(t){e.pageSizeT=t},expression:"pageSizeT"}},e._l(e.pageSizeOpts,(function(i){return t("Option",{key:i,staticStyle:{"text-align":"center"},attrs:{value:i}},[e._v(e._s(i)+" "+e._s(e.t("r.page")))])})),1)],1):e._e()],1)},st=[],ot={methods:{t(...e){return W.apply(this,e)}}},rt={name:"pagePro",model:{prop:"modelValue",event:"on-change"},mixins:[ot],props:{modelValue:{type:Number,default:""},total:{type:Number,default:0},pageSize:{type:Number,default:10},size:{type:String,validator:e=>fe(String(e),["small","default"]),default:"default"},pageSizeOpts:{type:Array,default(){return this.pageSizes||[10,20,30,40]}},showTotal:{type:Boolean,default(){return this.pageShowTotal}},showSizer:{type:Boolean,default(){return this.pageShowSizer}},transfer:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},data(){return{currentPadding:16}},computed:{current:{get(){return this.modelValue},set(e){this.$emit("on-change",e)}},pageSizeT:{get(){return this.pageSize},set(e){this.$emit("on-page-size-change",e),1!==this.current&&this.$nextTick((function(){this.current=1}))}},currentSize(){const e=xe(String(this.total||0),this.fontSizeBase||14)+this.currentPadding+2;return e<32?32:e}},watch:{currentSize:{handler(e){this.$nextTick((function(){this.changeCurrentSize(e)}))},immediate:!0}},mounted(){this.currentPadding=this.getPadding()},methods:{getPadding(){const e=this.$refs.pageRef?.$el?.querySelector?.("input");if(!e)return 16;const t=window.getComputedStyle(e),i=t?.paddingLeft,a=t?.paddingRight;return i&&a?Number(i.replace("px",""))+Number(a.replace("px","")):16},changeCurrentSize(e){const t=this.$refs.pageRef?.$el?.querySelector?.("input");t?.style&&(t.style.width=`${e}px`)}}},nt=rt,dt=_(nt,lt,st,!1,null,null,null),ct=dt.exports,ht={name:"btTablePage",components:{pagePro:ct},props:{url:{type:String,default:""},method:{type:String,default:"get"},searchData:{type:Object,default(){return{}}},columns:{type:Array,default(){return[]}},dataHandler:{type:Function},selection:{type:Boolean,default:!1},radio:{type:Boolean,default:!1},selectionFixed:{validator:e=>fe(e,["left","right",!1]),default:!1},rowClickSelect:{type:Boolean,default:!0},data:{type:Array,default(){return[]}},pageSize:{type:Number,default:10},sortable:{validator:e=>fe(e,["custom",""]),default:""},initData:{type:Boolean,default:!0},highlightRow:{type:Boolean,default:!1},rowClickNum:{type:Number,default:-1},tableEmptyTdHandle:{type:Boolean,default:!1},noBorderTable:{type:Boolean,default:!1},noPage:{type:Boolean,default:!1},orderDefault:{type:String,default:"desc"},orderKey:{type:String,default:"id"},orderKeyFormat:{validator:e=>fe(e,["underline","camelcase"]),default:"underline"},getDataLoading:{type:Boolean,default:!1},showTopRow:{type:Boolean,default:!1},lightHead:{type:Boolean,default:!1},pageComponentSize:{type:String,default:"default"},noElevator:{type:Boolean,default:!1},usePagePro:{type:Boolean,default(){return this.btTablePageUsePagePro}},showTotal:{type:Boolean,default(){return this.pageShowTotal}},showSizer:{type:Boolean,default(){return this.pageShowSizer}}},data(){return{pageSizes:this.pageSizes||[10,20,30,40],dataT:this.data,pageSizeT:localStorage.getItem("btPageSize")&&Number(localStorage.getItem("btPageSize"))||this.pageSize,current:1,total:0,selected:[],currentKey:null,currentIndex:null,key:this.orderKey,order:this.orderDefault,tableContainerHeight:300}},computed:{columnsFixed(){for(let e of this.columns)if(e?.fixed)return!0;return!1},fixedTable(){return this.selectionFixed||this.columnsFixed},queryData(){let e={...this.searchData,current:this.current,size:this.pageSizeT};return"custom"===this.sortable&&("underline"===this.orderKeyFormat?e[this.order]=ee(this.key):"camelcase"===this.orderKeyFormat&&(e[this.order]=Z(this.key))),e},columnsT(){let e=this.columns.filter((e=>"selection"!==e.type));if(this.selection||this.radio){let t;t=this.radio?{title:" ",width:65,render:(e,t)=>e("Radio",{props:{value:t.row.btChecked}})}:{type:"selection",width:60},this.selectionFixed&&(t.fixed=this.selectionFixed),e.unshift(t)}return e.forEach((e=>{"custom"===this.sortable?e?.key&&!0!==e.sortable&&!1!==e.sortable&&(e.sortable="custom"):e.sortable=!1,e?.align||(e.align=this.btTablePageAlign||"center")})),e.forEach((e=>{e?.key&&void 0===e.render&&(e.tooltip?e.render=Se(e.key,this.tableEmptyTdHandle,""):e.render=(t,i)=>{let a=i.row[e.key];return this.tableEmptyTdHandle?t("span",""===a?"--":a??"--"):t("span",a)})})),e},dataS:{get(){return this.dataT.map(((e,t)=>Object.assign({},e,{btKey:"bt-"+t,btChecked:Boolean(e.btChecked)})))},set(e){this.dataT=e}},selectedIds(){return this.selected.map((e=>e?.id))},selectedKeys(){return this.selected.map((e=>e?.btKey))}},created(){this.initTable()},watch:{searchData:{handler(){this.search()},deep:!0},orderKey(e){this.key=e},orderDefault(e){this.order=e}},methods:{initTable(){this.initData&&this.getDataAndClickRow()},addRow(e){this.dataT.unshift(A().cloneDeep(e)),tt((()=>{this.$refs.TableXXX.clickCurrentRow(0)}),100)},setRowData(e,t,i){let a=null;if(A().isBoolean(t)&&t?a=this.currentIndex:A().isNumber(t)&&(a=t),null!==a){let t=this.dataT[a];for(let i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);i&&tt((()=>{this.$refs.TableXXX.clickCurrentRow(a)}),10)}},deleteRow(e){this.dataT.splice(e,1),tt((()=>{this.$refs.TableXXX.clickCurrentRow(0)}),100)},selectRow(e){const t=e;if(A().isNumber(t))this.clearSelect(),this.currentIndex=t,this.currentKey=this.dataS[t].btKey,this.$refs.TableXXX.clickCurrentRow(t);else if(A().isArray(t)){if(this.radio||!this.selection)return;this.clearSelect();for(let e of t)this.$refs.TableXXX.clickCurrentRow(e)}else if(A().isFunction(t))for(let i=0;i<this.dataS.length;i++){const e=this.dataS[i];t(e)&&this.$refs.TableXXX.clickCurrentRow(i)}},clearSelect(){if(this.radio){if(this.selectedKeys.length>0&&this.dataS.length>0){let e=this.selectedKeys[0].split("-")[1];this.$set(this.dataS[e],"btChecked",!1)}}else this.$refs.TableXXX.selectAll(!1);this.selected.length>0&&(this.selected=[],this.$emit("on-selection-change",[])),this.currentKey=null,this.currentIndex=null},clearTableData(){this.$set(this,"dataT",[]),this.clearSelect(),this.current=1,this.total=0},search(){this.current=1,this.getDataAndClickRow()},getDataAndClickRow(e,t,i){this.radio&&(e||-1!==this.rowClickNum)?this.getTableData(t,i,e).then((()=>{this.dataT.length>0&&tt((()=>{e?this.$refs.TableXXX.clickCurrentRow(this.currentIndex||0):this.$refs.TableXXX.clickCurrentRow(this.rowClickNum)}),10)})):this.getTableData()},onRowClick(e,t){e.btChecked&&this.radio||(this.selection||this.radio)&&this.rowClickSelect&&this.$refs.TableXXX.toggleSelect(t)},onSelect(e,t){this.currentKey=t.btKey,this.currentIndex=Number(t.btKey.split("-")[1]),this.radio&&this.$set(this.dataT[this.currentIndex],"btChecked",!0)},selectionHandle(e){if(this.radio)for(let t of this.dataS)t?.btKey&&t.btKey!==this.currentKey&&this.$set(this.dataT[Number(t.btKey.split("-")[1])],"btChecked",!1);this.selected=e},getSelected(){return A().cloneDeep(this.selected)},changePage(e){this.current=e,this.getDataAndClickRow()},pageSizeChange(e){this.pageSizeT=e,localStorage.setItem("btPageSize",e),1===this.current&&this.getDataAndClickRow()},onSortChange({key:e,order:t}){"normal"===t?(this.key=this.orderKey,this.order=this.orderDefault):(this.key=e,this.order=t),this.current=1,this.getTableData()},getTableData(e,t,i){return new Promise((a=>{e&&(this.order=e),t&&(this.key=t),this.url&&""!==this.url?Ye[this.method](this.url,this.queryData,null,[],{spin:this.getDataLoading}).then((l=>{let s;i||this.clearSelect(),s="Function"===Q(this.dataHandler)?this.dataHandler(l):l,s?.data?(s.data?.records||null===s.data?.records?this.dataT=s.data.records||[]:s.data?.page?(s.data.page?.records||null===s.data.page?.records)&&(this.dataT=s.data.page.records||[]):s.data?.data?(s.data.data?.records||null===s.data.data?.records)&&(this.dataT=s.data.data.records||[]):this.dataT=s.data,this.total=s.data?.page?.total||s.data?.data?.total||s.data?.total||s.total||0,0===this.total&&this.current>1&&0===this.dataT?.length?this.current=1:this.current>1&&this.total<=(this.current-1)*this.pageSizeT&&(this.current--,this.$nextTick((function(){this.getTableData(e,t)}))),this.$emit("on-data-change",s),a(s)):(console.warn("请求返回数据有误,无法使用"),this.clearTableData(),this.$emit("on-data-change",s))})).catch((e=>{console.warn(e),this.clearSelect(),this.clearTableData(),this.$emit("on-data-change",e)})):console.warn("没有有效的请求地址,无法获取表格数据")}))}}},ut=ht,pt=_(ut,K,D,!1,null,null,null),mt=pt.exports,ft=function(){var e=this,t=e._self._c;return t("div",{style:e.wellStyle},[t("div",{class:["wellCardR",{flexColumnBox:!e.fitToContent}]},[t("div",{class:["panelHeader",{notGrow:!e.fitToContent}]},[t("div",{staticClass:"fl",staticStyle:{"font-weight":"bold"}},[e._v(" "+e._s(e.title||e.t("r.title"))+" ")]),t("div",{staticClass:"btsF"},[e._t("bts")],2)]),e.fitToContent?t("div",[e._t("default")],2):t("div",{staticClass:"growFlexItem relativeBox"},[t("div",{staticClass:"fullFlowContent"},[e._t("default")],2)])])])},yt=[],gt={name:"wellCard",mixins:[ot],props:{title:{type:String},fitToContent:{type:Boolean,default:!1},width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"100%"},inline:{type:Boolean,default:!1}},computed:{wellStyle(){let e={};this.inline&&(e.display="inline-block");let t=["width","height"];for(let i of t)"String"===Q(this[i])?e[i]=this.fitToContent?"fit-content":this[i]:"Number"===Q(this[i])&&this[i]>0&&(e[i]=this.fitToContent?"fit-content":this[i]+"px");return e}}},vt=gt,bt=_(vt,ft,yt,!1,null,null,null),wt=bt.exports,kt=function(){var e=this,t=e._self._c;return t("Table",{key:e.updateDomKey,ref:"tabXY",class:{tableTreeKM:!0,lightHeadO:e.lightHead},attrs:{columns:e.columnsX,data:e.dataX,"highlight-row":e.highlightRow}})},St=[],xt={name:"tableTree",props:{columns:{type:Array,default(){return[]}},data:{type:Array,default(){return[]}},highlightRow:{type:Boolean,default:!1},radio:{type:Boolean,default:!1},lightHead:{type:Boolean,default:!1}},data(){return{dataX:[],noKey:1,updateDomKey:Math.floor(1e8*Math.random()+1e4)}},computed:{columnsX(){let e=this.columns.filter((e=>"selection"!==e?.type));if(e[0]){let t=e[0].key;e[0].renderHeader=(e,t)=>e("div",{style:{paddingLeft:"20px"}},t.column.title),e[0].render=(e,i)=>e("div",{class:"tableTxtBt",style:{paddingLeft:20*(i.row.parentNoKey.length+1)+"px",textAlign:"left"}},[e("Checkbox",{props:{value:i.row.checkBox},directives:[{name:"show",value:this.radio}],on:{"on-change":e=>{!0===e?(this.setCollectionVal(this.dataX,{checkBox:!1}),this.setCollectionVal(this.dataX,{checkBox:e,ownKey:this.dataX[i.index].ownKey}),this.$emit("on-select",i.row)):this.setCollectionVal(this.dataX,{checkBox:e,ownKey:this.dataX[i.index].ownKey})},click:e=>{e?.preventDefault?.()}}}),e("Icon",{props:{type:i.row._hideChild?"ios-arrow-forward":!1===i.row._hideChild?"ios-arrow-down":""},style:{cursor:"pointer"},on:{click:()=>{this.showHideClick(i.index)}}}),e("span",{style:{cursor:"pointer"},on:{click:()=>{this.showHideClick(i.index)}}}," "+i.row[t])])}return e}},mounted(){this.updateTab()},watch:{data(){this.updateTab()}},methods:{setCollectionVal(e,t){if(t&&we(t.checkBox)&&"Array"===Q(e))if(t.ownKey)for(let i of e)i?.ownKey===t.ownKey&&(i.checkBox=t.checkBox),"Array"===Q(i?.childrenXK)&&i?.childrenXK.length>0&&this.setCollectionValB(i?.childrenXK,t);else for(let i of e)i.checkBox=t.checkBox,"Array"===Q(i?.childrenXK)&&i?.childrenXK.length>0&&this.setCollectionValB(i?.childrenXK,t)},setCollectionValB(e,t){if(t&&we(t.checkBox)&&"Array"===Q(e))if(t.ownKey)for(let i of e)i?.ownKey===t.ownKey&&(i.checkBox=t.checkBox),"Array"===Q(i?.childrenXK)&&i?.childrenXK.length>0&&this.setCollectionVal(i?.childrenXK,t);else for(let i of e)i.checkBox=t.checkBox,"Array"===Q(i?.childrenXK)&&i?.childrenXK.length>0&&this.setCollectionVal(i?.childrenXK,t)},handleResize(){this.$refs.tabXY.handleResize()},updateTab(){let e=A().cloneDeep(this.data);this.addHideChildAttr(e),this.dataX=A().cloneDeep(e),this.showDefault()},showDefault(){for(let e=0,t=this.dataX.length;e<t;e++){let t=this.dataX[e];if(!1===t?.hideChild&&!0===t?._hideChild){this.showHideClick(e);break}}},showHideClick(e){if(this.dataX[e]._hideChild){this.dataX[e]._hideChild=!1;let t=A().cloneDeep(this.dataX[e].childrenXK);this.dataX.splice(e+1,0,...t),this.showDefault()}else!1===this.dataX[e]._hideChild&&this.hideChildNode(e)},addHideChildAttr(e,t){for(let i of e)i.ownKey=this.noKey,this.noKey++,i.parentNoKey=i.parentNoKey||[],void 0!==t&&i.parentNoKey.push(...t),i?.children&&(i.childrenXK=i.children,delete i.children),"Array"===this.myTypeof(i?.childrenXK)&&i?.childrenXK.length>0&&(!1!==i._hideChild&&(i._hideChild=!0),this.addHideChildAttrB(i.childrenXK,[i.ownKey,...i.parentNoKey]))},addHideChildAttrB(e,t){for(let i of e)i.ownKey=this.noKey,this.noKey++,i.parentNoKey=i.parentNoKey||[],void 0!==t&&i.parentNoKey.push(...t),i?.children&&(i.childrenXK=i.children,delete i.children),"Array"===this.myTypeof(i?.childrenXK)&&i?.childrenXK?.length>0&&(!1!==i._hideChild&&(i._hideChild=!0),this.addHideChildAttr(i.childrenXK,[i.ownKey,...i.parentNoKey]))},hideChildNode(e){let t=this.getChildCount(this.dataX[e].ownKey);t&&this.dataX.splice(e+1,t),Le({group:[this.dataX[e]],condition:e=>!1===e?._hideChild,key:"_hideChild",val:!0,childKey:"childrenXK"})},addLocalNode(e,t){return new Promise(((i,a)=>{!A().isInteger(e)||e<0?a("索引序号index必须是正整数或0!"):e>this.dataX.length-1&&a("无效的索引序号index!"),A().isPlainObject(t)&&!A().isEmpty(t)||a("节点数据异常,无法添加节点!");let l=this.dataX[e];!1!==l._hideChild&&(l._hideChild=!1);let s=[l.ownKey,...l.parentNoKey],o={...t,ownKey:++this.noKey,parentNoKey:s};for(let e of this.dataX){let t=s.indexOf(e?.ownKey);if(t>-1){void 0===e?.childrenXK&&(e.childrenXK=[]);let i=e?.childrenXK,a=e;for(let l=0;l<t+1;l++){if(l===t){i.push(A().cloneDeep(o)),void 0===e?._hideChild&&(e._hideChild=!0);break}a=A().find(a.childrenXK,(e=>-1!==s.indexOf(e?.ownKey))),void 0===a._hideChild&&(a._hideChild=!0),void 0===a.childrenXK&&(a.childrenXK=[]),i=a.childrenXK}}}this.dataX.splice(e+1+this.getChildCount(l.ownKey),0,A().cloneDeep(o)),this.updateDomKey=Math.floor(1e8*Math.random()+1e4),i(A().cloneDeep(o))}))},editLocalNode(e,t){return new Promise(((i,a)=>{!A().isInteger(e)||e<0?a("索引序号index必须是正整数或0!"):e>this.dataX.length-1&&a("无效的索引序号index!"),A().isPlainObject(t)&&!A().isEmpty(t)||a("节点数据异常,无法添加节点!");let l=this.dataX[e],s=Object.assign(l,t);this.dataX[e]=s;for(let e of this.dataX){let t=s.parentNoKey.indexOf(e?.ownKey);if(t>-1){let i=e?.childrenXK;for(let e=0;e<t+1;e++){if(e===t){let e=A().findIndex(i,(e=>e?.ownKey===s?.ownKey));e>-1&&(i[e]=A().cloneDeep(s));break}{let e=A().find(i,(e=>-1!==s.parentNoKey.indexOf(e?.ownKey)));i=e.childrenXK}}}}this.updateDomKey=Math.floor(1e8*Math.random()+1e4),i(A().cloneDeep(s))}))},deleteLocalNode(e){return new Promise(((t,i)=>{!A().isInteger(e)||e<0?i("索引序号index必须是正整数或0!"):e>this.dataX.length-1&&i("无效的索引序号index!");let a=this.dataX[e];this.dataX.splice(e,1),this.deleteLocalChildNode(a.ownKey,e);for(let e of this.dataX){let t=a.parentNoKey.indexOf(e?.ownKey);if(t>-1){let i=e?.childrenXK,l=e;for(let e=0;e<t+1;e++){if(e===t){let e=A().findIndex(i,(e=>e?.ownKey===a?.ownKey));e>-1&&(i.splice(e,1),0===i.length&&(l._hideChild=null));break}l=A().find(i,(e=>-1!==a.parentNoKey.indexOf(e?.ownKey))),i=l.childrenXK}}}this.updateDomKey=Math.floor(1e8*Math.random()+1e4),t(A().cloneDeep(this.dataX))}))},deleteLocalChildNode(e,t){let i=this.getChildCount(e);i&&this.dataX.splice(t,i)},getChildCount(e){let t=0;for(let i of this.dataX)-1!==i?.parentNoKey?.indexOf?.(e)&&t++;return t}}},Ct=xt,Tt=_(Ct,kt,St,!1,null,null,null),Lt=Tt.exports,_t=function(){var e=this,t=e._self._c;return t("div",[t("Upload",{attrs:{name:"files",action:e.urlT,"before-upload":e.handelManualUpload,"on-error":e.uploadError,"on-success":e.uploadSuccess,"on-exceeded-size":e.overSize,"on-preview":e.onPreview,"on-remove":e.onRemove,"on-format-error":e.onFormatError,data:e.data,"max-size":e.maxSize,"show-upload-list":!1,"with-credentials":e.withCredentials,format:e.format,multiple:e.multiple||!1,disabled:e.length>0&&e.fileList.length>=e.length||Boolean(e.disabled)}},[t("Button",{class:{disabledR:e.length>0&&e.fileList.length>=e.length||Boolean(e.disabled)},attrs:{icon:"md-cloud-upload"}},[e._v(e._s(e.t("r.selectFile")))])],1),"img"===e.previewType&&e.fileDefaultList.length>0?t("div",{staticClass:"previewBoxM"},e._l(e.fileDefaultList,(function(i,a){return e.manualUpload||null===i?.id?e._e():t("div",{key:i?.id,staticClass:"previewImg",class:{previewLoading:"loading"===i?.mimeType}},[t("div",{directives:[{name:"show",rawName:"v-show",value:"loading"===i?.mimeType,expression:"item?.mimeType === 'loading'"}],staticClass:"imgLoading"},[t("div",{staticClass:"loader-div",attrs:{"data-loader":"circle-side"}})]),t("img",{directives:[{name:"show",rawName:"v-show",value:"loading"!==i?.mimeType,expression:"item?.mimeType !== 'loading'"}],attrs:{src:e.url+"/"+i?.id+"/download?preview=true",alt:i?.name}}),t("div",{directives:[{name:"show",rawName:"v-show",value:"loading"!==i?.mimeType,expression:"item?.mimeType !== 'loading'"}],staticClass:"deleteModal"},[t("Icon",{staticClass:"previewExpand",attrs:{type:"ios-expand",size:"40",title:e.t("r.fView")},on:{click:function(t){return e.fullScreenImgByDom(e.fileImgSrcList,a)}}}),t("Icon",{staticClass:"previewDelete",attrs:{type:"ios-trash-outline",size:"40",title:e.t("r.delete")},on:{click:function(t){return e.deleteById(t,i?.id)}}})],1)])})),0):e._e(),"localImg"===e.previewType&&e.fileSrcList.length>0?t("div",{staticClass:"previewBoxM"},e._l(e.fileSrcList,(function(i,a){return e.manualUpload&&null!==i?t("div",{key:"manualImg"+a,staticClass:"previewImg"},[t("img",{attrs:{src:i,alt:"manualImg"+a}}),t("div",{staticClass:"deleteModal"},[t("Icon",{staticClass:"previewExpand",attrs:{type:"ios-expand",size:"40",title:e.t("r.fView")},on:{click:function(t){return e.listExpand(a)}}}),t("Icon",{staticClass:"previewDelete",attrs:{type:"ios-trash-outline",size:"40",title:e.t("r.delete")},on:{click:function(t){return e.clearManualItem(a)}}})],1)]):e._e()})),0):e._e(),"localList"===e.previewType&&e.fileList.length>0?t("div",{staticClass:"customFileListM"},e._l(e.fileList,(function(i,a){return e.manualUpload&&null!==i?t("p",{key:"manualItem"+a,staticClass:"customFileListItem"},[i?.name?t("Icon",{staticClass:"fileTypeIco",attrs:{type:e.getFileTypeIconByName(i?.name),size:"20"}}):e._e(),t("span",{staticClass:"upNameT",attrs:{title:e.t("r.download")},on:{click:function(t){return e.downloadManualFile(i)}}},[e._v(e._s(e.getName(i)))]),t("span",{staticClass:"btBoxJ"},[e.showPreview(i)?t("Icon",{staticClass:"listBtH",attrs:{type:"md-qr-scanner",size:"22",title:e.t("r.fView")},on:{click:function(t){return e.listExpand(i)}}}):e._e(),t("Icon",{staticClass:"listBtH",attrs:{type:"md-close",size:"22",title:e.t("r.delete")},on:{click:function(t){return e.clearManualItem(a)}}})],1)],1):e._e()})),0):e._e(),"list"===e.previewType&&e.fileDefaultList.length>0?t("div",{staticClass:"customFileListM"},e._l(e.fileDefaultList,(function(i,a){return e.manualUpload||null===i?e._e():t("div",{key:"defaultItem"+a,staticClass:"customFileListItem"},[t("div",{directives:[{name:"show",rawName:"v-show",value:"loading"===i?.mimeType,expression:"item?.mimeType === 'loading'"}],staticClass:"listLoading"},[t("div",{staticClass:"loader-div",attrs:{"data-loader":"circle-side"}})]),t("Icon",{directives:[{name:"show",rawName:"v-show",value:"loading"!==i?.mimeType,expression:"item?.mimeType !== 'loading'"}],staticClass:"fileTypeIco",attrs:{type:e.getFileTypeIconByName(i?.name),size:"20"}}),t("span",{directives:[{name:"show",rawName:"v-show",value:"loading"!==i?.mimeType,expression:"item?.mimeType !== 'loading'"}],staticClass:"upNameT",attrs:{title:e.t("r.download")},on:{click:function(t){return e.downloadDefaultFile(i)}}},[e._v(e._s(i?.name||e.t("r.file")+(a+1)))]),t("span",{directives:[{name:"show",rawName:"v-show",value:"loading"!==i?.mimeType,expression:"item?.mimeType !== 'loading'"}],staticClass:"btBoxJ"},[e.showPreview(i)?t("Icon",{staticClass:"listBtH",attrs:{type:"md-qr-scanner",size:"22",title:e.t("r.fView")},on:{click:function(t){return e.listExpand(i)}}}):e._e(),t("Icon",{staticClass:"listBtH",attrs:{type:"md-close",size:"22",title:e.t("r.delete")},on:{click:function(t){return e.clearManualItem(a)}}})],1)],1)})),0):e._e()],1)},It=[];let Bt=0;function Kt(e,t,i,a){a&&(a.innerHTML=e[t]?.name??"",e[t]?.name?a.classList.contains("hide")&&a.classList.remove("hide"):a.classList.contains("hide")||a.classList.add("hide")),i&&(i.src=e[t]?.src??e[t],Bt=t)}function Dt(e,t,i,a){if(e){let e;e=Bt-1<0?t.length-1:Bt-1,Kt(t,e,i,a)}}function $t(e,t,i,a){if(e){let e;e=Bt+1>t.length-1?0:Bt+1,Kt(t,e,i,a)}}function At(e,t=0){const i=(...e)=>W.apply(this,e),a=i("r.closePreview"),l=i("r.fullImg"),s=i("r.last"),o=i("r.next");let r,n,d;Bt=t;const c=Array.isArray(e);c?(n=e[Bt]?.src??e[Bt],d=e[Bt]?.name):n=e,r=c&&e.length>1?`${s} : ←, ↑, A, W | ${o} : →, ↓, D, S | ${a} : Esc`:`${a} : Esc`;let h=A().first(document.getElementsByTagName("body")),u=document.createElement("div");function p(){let e=A().first(document.getElementsByTagName("body"));e&&e.removeChild(u),document.removeEventListener("keyup",y)}u.setAttribute("class","fullScreenImgByDom"),u.innerHTML=`<div class="previewInner"><div class="pageFBt left${c&&e.length>1?"":" hide"}"><i class="ivu-icon ivu-icon-ios-arrow-back" title="${s}" ></i></div><img src="${n}" alt="${l}" ><div class="pageFBt right${c&&e.length>1?"":" hide"}"><i class="ivu-icon ivu-icon-ios-arrow-forward" title="${o}" ></i></div><i class="ivu-icon ivu-icon-md-close" title="${a}" ></i></div><p class="pNotice cannotSelect">${r}</p><p class="pName ${d?"":"hide"}">${d}</p>`,u.querySelector(".ivu-icon-md-close").addEventListener("click",p);const m=u.querySelector("img"),f=u.querySelector(".pName");function y(t){37===t.keyCode||38===t.keyCode||87===t.keyCode||65===t.keyCode?Dt(c,e,m,f):39===t.keyCode||40===t.keyCode||83===t.keyCode||68===t.keyCode?$t(c,e,m,f):27===t.keyCode&&p()}u.querySelector(".pageFBt.left").addEventListener("click",(function(){Dt(c,e,m,f)})),u.querySelector(".pageFBt.right").addEventListener("click",(function(){$t(c,e,m,f)})),document.addEventListener("keyup",y),h.appendChild(u),u.focus({preventScroll:!0})}var Rt={name:"uploadGroup",mixins:[ot],model:{prop:"fileIdListProp",event:"on-file-id-change"},props:{fileIdListProp:{type:[Array,Number,String,File],default(){return[]}},url:{type:String,default(){return window.g?.mgrURL?window.g.mgrURL+"/web/v1/fsc/file":""}},data:{type:Object,default(){return{appId:0,moduleId:0,typeId:0}}},manualUpload:{type:Boolean,default:!1},maxSize:{type:Number,default:0},length:{type:Number,default:0},showUploadList:{type:Boolean,default:!0},withCredentials:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},format:{type:Array,default(){return[]}},showImg:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},data(){return{getFileTypeIconByName:ne,fullScreenImgByDom:At,fileSrcList:[],fileDefaultList:[],localImgSrcList:[],tempStorage:{}}},computed:{previewType(){return!this.manualUpload&&this.showImg&&this.fileListItemIsIMG?"img":this.manualUpload&&this.showImg&&this.fileListItemIsIMG?"localImg":!this.manualUpload||!this.showUploadList||this.showImg&&this.fileListItemIsIMG?this.manualUpload||!this.showUploadList||this.showImg&&this.fileListItemIsIMG?void 0:"list":"localList"},urlT(){return this.manualUpload?"//jsonplaceholder.typicode.com/posts/":this.url},fileList:{get(){return this.manualUpload?this.fileIdList:this.fileIdList.map((e=>({id:e})))},set(e){this.manualUpload?this.fileIdList=e:this.fileIdList=e.map((e=>e?.id))}},fileIdList:{get(){switch(Q(this.fileIdListProp)){case"Number":return[this.fileIdListProp];case"String":return-1!==this.fileIdListProp.indexOf("--")?[]:/^\d*$/.test(this.fileIdListProp)?[Number(this.fileIdListProp)]:[this.fileIdListProp];case"Array":return this.fileIdListProp.filter((e=>"--"!==e));case"File":return[this.fileIdListProp];default:return[]}},set(e){if(1===this.length){let t=A().first(e);this.$emit("on-file-id-change",t||0===t?t:null)}else this.$emit("on-file-id-change",A().cloneDeep(e))}},fileListItemIsIMG(){let e;e=this.manualUpload?this.fileList:this.fileDefaultList;for(let t of e){let e;if(e=this.manualUpload?t?.type:t?.mimeType,!e||e&&!re(e)&&"loading"!==e)return!1}return!0},fileDefaultImgList(){return this.fileDefaultList.filter((e=>re(e?.mimeType)))},fileImgSrcList(){return this.fileDefaultImgList.map((e=>({src:this.url+"/"+e?.id+"/download?preview=true",name:e?.name})))},localImgList(){return this.fileList.filter((e=>re(e?.type)))}},watch:{localImgList:{async handler(e){this.localImgSrcList=await this.getFileSrcList(e)}},fileList:{async handler(e){if("localImg"===this.previewType)this.fileSrcList=e?.length>0?await this.getFileSrcList(e):[];else if(e?.length>0&&"localList"!==this.previewType){let t=A().cloneDeep(e);const i=A().cloneDeep(this.fileDefaultList);for(let e of t)if(void 0===e?.name)if(e.id){const a=A().find(i,(t=>t?.id===e.id));a?(e.name=a.name,e.mimeType=a.mimeType):this.tempStorage.hasOwnProperty(e.id)?(e.name=this.tempStorage[e.id].name,e.mimeType=this.tempStorage[e.id].mimeType):(e.mimeType="loading",Ye.get(this.url+"/"+e.id).then((i=>{e.name=i?.data?.returnValue?.[0]?.name||this.t("r.file")+A().indexOf(t,e),this.$set(e,"mimeType",i?.data?.returnValue?.[0]?.mimeType||"unknown")})).catch((()=>{e.name=this.t("r.file")+A().indexOf(t,e)})))}else e.name=this.t("r.unknown");this.fileDefaultList=t}else this.fileDefaultList=[]},immediate:!0,deep:!0}},methods:{clear(){this.fileList=[]},getName(e){return e?.name||e?.split&&A().last(e.split("/"))||e},async getFileSrcList(e){let t=[];for(let i of e){let e=await se(i);t.push(e)}return t},clearManualItem(e){if(!this.disabled){let t=this.fileList;t.splice(e,1),this.fileList=t}},downloadDefaultFile(e){e?.id&&window.open(this.url+"/"+e.id+"/download")},showPreview(e){return this.manualUpload?e?.type&&re(e.type):e?.id&&e.mimeType&&re(e.mimeType)},async listExpand(e){if(this.manualUpload){let t,i;"number"===typeof e?(t=e,i=this.fileSrcList):e&&(t=A().findIndex(this.localImgList,(t=>t.size===e.size&&t.lastModified===e.lastModified)),i=this.localImgSrcList),At(i.map(((e,t)=>({src:e,name:this.localImgList[t]?.name}))),t)}else if(e?.id){const t=A().findIndex(this.fileDefaultImgList,(t=>t.id===e.id));At(this.fileImgSrcList,t)}},downloadManualFile(e){"String"===Q(e)&&e.indexOf("http")>-1?window.open(e):"File"===Q(e)&&se(e).then((t=>{de(e.name,t)}))},handelManualUpload(e){if(this.manualUpload){if(e){let t=oe(e.name);if(this.format.length>0&&this.format.indexOf(t)<0)return Y(this.t("r.wrongFileType"),this.t("r.supportType")+(this.format.length>0&&String(this.format)||this.t("r.none")),"warning"),!1;if(this.maxSize&&e.size>1024*this.maxSize)return Y(this.t("r.fileIsBig"),this.t("r.supportSize")+this.maxSize+"kb","warning"),!1;let i=this.fileList;i.push(e),this.fileList=i}return!1}return!0},uploadError(e){console.warn(e),Y(this.t("r.uploadError"),"","error")},uploadSuccess(e,t){if(0===e?.code){let i=this.fileList;t.id=e.data?.[0]?.id,t.name=e.data?.[0]?.name,t.mimeType=e.data?.[0]?.mimeType,this.tempStorage[t.id]={name:t.name,mimeType:t.mimeType},i.push(t),this.fileList=i}else Y(this.t("r.uploadFail"),e?.message||"","error")},overSize(){Y(this.t("r.fileIsBig"),this.t("r.supportSize")+this.maxSize+" kb","warning")},onFormatError(){Y(this.t("r.wrongFileType"),this.t("r.supportType")+(this.format.length>0&&String(this.format)||this.t("r.none")),"warning"