command-center-v3-common 0.0.25 → 0.0.27
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.
@@ -41945,6 +41945,7 @@ const HZ = { class: "rounded gap-x-0 flex flex-col w-full h-full" }, zZ = { clas
|
|
41945
41945
|
searchKey: {},
|
41946
41946
|
selectKey: { default: "id" },
|
41947
41947
|
paginationLayout: { default: "sizes, prev, pager, next, jumper" },
|
41948
|
+
pagerCount: { default: 7 },
|
41948
41949
|
treeProps: { default: () => ({}) }
|
41949
41950
|
},
|
41950
41951
|
emits: ["getTotal", "selectionChange", "onRowcClick"],
|
@@ -42230,13 +42231,14 @@ const HZ = { class: "rounded gap-x-0 flex flex-col w-full h-full" }, zZ = { clas
|
|
42230
42231
|
"page-size": i(r).size,
|
42231
42232
|
"onUpdate:pageSize": N[5] || (N[5] = (x) => i(r).size = x),
|
42232
42233
|
class: "h-[50px]",
|
42234
|
+
"pager-count": C.pagerCount,
|
42233
42235
|
"hide-on-single-page": !0,
|
42234
42236
|
"page-sizes": [15, 30, 50, 100],
|
42235
42237
|
layout: C.paginationLayout,
|
42236
42238
|
total: i(l).totalElements,
|
42237
42239
|
onSizeChange: g,
|
42238
42240
|
onCurrentChange: y
|
42239
|
-
}, null, 8, ["current-page", "page-size", "layout", "total"])
|
42241
|
+
}, null, 8, ["current-page", "page-size", "pager-count", "layout", "total"])
|
42240
42242
|
])
|
42241
42243
|
])) : ee("", !0)
|
42242
42244
|
]);
|
@@ -102,7 +102,7 @@ Use slot props instead:
|
|
102
102
|
</router-view>`)}}function as(t,n){const o=at({},t,{matched:t.matched.map(r=>MX(r,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:t.fullPath,tooltip:n,value:o}}}function fc(t){return{_custom:{display:t}}}let NX=0;function TX(t,n,o){if(n.__hasDevtools)return;n.__hasDevtools=!0;const r=NX++;Uk({id:"org.vuejs.router"+(r?"."+r:""),label:"Vue Router",packageName:"vue-router",homepage:"https://router.vuejs.org",logo:"https://router.vuejs.org/logo.png",componentStateTypes:["Routing"],app:t},a=>{typeof a.now!="function"&&console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),a.on.inspectComponent((u,f)=>{u.instanceData&&u.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:as(n.currentRoute.value,"Current Route")})}),a.on.visitComponentTree(({treeNode:u,componentInstance:f})=>{if(f.__vrv_devtools){const p=f.__vrv_devtools;u.tags.push({label:(p.name?`${p.name.toString()}: `:"")+p.path,textColor:0,tooltip:"This component is rendered by <router-view>",backgroundColor:w1})}bn(f.__vrl_devtools)&&(f.__devtoolsApi=a,f.__vrl_devtools.forEach(p=>{let m=S1,g="";p.isExactActive?(m=E1,g="This is exactly active"):p.isActive&&(m=k1,g="This link is active"),u.tags.push({label:p.route.path,textColor:0,tooltip:g,backgroundColor:m})}))}),e.watch(n.currentRoute,()=>{c(),a.notifyComponentUpdate(),a.sendInspectorTree(i),a.sendInspectorState(i)});const l="router:navigations:"+r;a.addTimelineLayer({id:l,label:`Router${r?" "+r:""} Navigations`,color:4237508}),n.onError((u,f)=>{a.addTimelineEvent({layerId:l,event:{title:"Error during Navigation",subtitle:f.fullPath,logType:"error",time:a.now(),data:{error:u},groupId:f.meta.__navigationId}})});let s=0;n.beforeEach((u,f)=>{const p={guard:fc("beforeEach"),from:as(f,"Current Location during this navigation"),to:as(u,"Target location")};Object.defineProperty(u.meta,"__navigationId",{value:s++}),a.addTimelineEvent({layerId:l,event:{time:a.now(),title:"Start of navigation",subtitle:u.fullPath,data:p,groupId:u.meta.__navigationId}})}),n.afterEach((u,f,p)=>{const m={guard:fc("afterEach")};p?(m.failure={_custom:{type:Error,readOnly:!0,display:p?p.message:"",tooltip:"Navigation Failure",value:p}},m.status=fc("❌")):m.status=fc("✅"),m.from=as(f,"Current Location during this navigation"),m.to=as(u,"Target location"),a.addTimelineEvent({layerId:l,event:{title:"End of navigation",subtitle:u.fullPath,time:a.now(),data:m,logType:p?"warning":"default",groupId:u.meta.__navigationId}})});const i="router-inspector:"+r;a.addInspector({id:i,label:"Routes"+(r?" "+r:""),icon:"book",treeFilterPlaceholder:"Search routes"});function c(){if(!d)return;const u=d;let f=o.getRoutes().filter(p=>!p.parent||!p.parent.record.components);f.forEach(T1),u.filter&&(f=f.filter(p=>$p(p,u.filter.toLowerCase()))),f.forEach(p=>N1(p,n.currentRoute.value)),u.rootNodes=f.map(_1)}let d;a.on.getInspectorTree(u=>{d=u,u.app===t&&u.inspectorId===i&&c()}),a.on.getInspectorState(u=>{if(u.app===t&&u.inspectorId===i){const p=o.getRoutes().find(m=>m.record.__vd_id===u.nodeId);p&&(u.state={options:OX(p)})}}),a.sendInspectorTree(i),a.sendInspectorState(i)})}function BX(t){return t.optional?t.repeatable?"*":"?":t.repeatable?"+":""}function OX(t){const{record:n}=t,o=[{editable:!1,key:"path",value:n.path}];return n.name!=null&&o.push({editable:!1,key:"name",value:n.name}),o.push({editable:!1,key:"regexp",value:t.re}),t.keys.length&&o.push({editable:!1,key:"keys",value:{_custom:{type:null,readOnly:!0,display:t.keys.map(r=>`${r.name}${BX(r)}`).join(" "),tooltip:"Param keys",value:t.keys}}}),n.redirect!=null&&o.push({editable:!1,key:"redirect",value:n.redirect}),t.alias.length&&o.push({editable:!1,key:"aliases",value:t.alias.map(r=>r.record.path)}),Object.keys(t.record.meta).length&&o.push({editable:!1,key:"meta",value:t.record.meta}),o.push({key:"score",editable:!1,value:{_custom:{type:null,readOnly:!0,display:t.score.map(r=>r.join(", ")).join(" | "),tooltip:"Score used to sort routes",value:t.score}}}),o}const w1=15485081,k1=2450411,E1=8702998,$X=2282478,S1=16486972,xX=6710886;function _1(t){const n=[],{record:o}=t;o.name!=null&&n.push({label:String(o.name),textColor:0,backgroundColor:$X}),o.aliasOf&&n.push({label:"alias",textColor:0,backgroundColor:S1}),t.__vd_match&&n.push({label:"matches",textColor:0,backgroundColor:w1}),t.__vd_exactActive&&n.push({label:"exact",textColor:0,backgroundColor:E1}),t.__vd_active&&n.push({label:"active",textColor:0,backgroundColor:k1}),o.redirect&&n.push({label:typeof o.redirect=="string"?`redirect: ${o.redirect}`:"redirects",textColor:16777215,backgroundColor:xX});let r=o.__vd_id;return r==null&&(r=String(VX++),o.__vd_id=r),{id:r,label:o.path,tags:n,children:t.children.map(_1)}}let VX=0;const IX=/^\/(.*)\/([a-z]*)$/;function N1(t,n){const o=n.matched.length&&er(n.matched[n.matched.length-1],t.record);t.__vd_exactActive=t.__vd_active=o,o||(t.__vd_active=n.matched.some(r=>er(r,t.record))),t.children.forEach(r=>N1(r,n))}function T1(t){t.__vd_match=!1,t.children.forEach(T1)}function $p(t,n){const o=String(t.re).match(IX);if(t.__vd_match=!1,!o||o.length<3)return!1;if(new RegExp(o[1].replace(/\$$/,""),o[2]).test(n))return t.children.forEach(s=>$p(s,n)),t.record.path!=="/"||n==="/"?(t.__vd_match=t.re.test(n),!0):!1;const a=t.record.path.toLowerCase(),l=va(a);return!n.startsWith("/")&&(l.includes(n)||a.includes(n))||l.startsWith(n)||a.startsWith(n)||t.record.name&&String(t.record.name).includes(n)?!0:t.children.some(s=>$p(s,n))}function MX(t,n){const o={};for(const r in t)n.includes(r)||(o[r]=t[r]);return o}function RX(t){const n=sX(t.routes,t),o=t.parseQuery||mX,r=t.stringifyQuery||p1,a=t.history;if(process.env.NODE_ENV!=="production"&&!a)throw new Error('Provide the "history" option when calling "createRouter()": https://next.router.vuejs.org/api/#history.');const l=rs(),s=rs(),i=rs(),c=e.shallowRef(tr);let d=tr;To&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Cp.bind(null,A=>""+A),f=Cp.bind(null,VG),p=Cp.bind(null,va);function m(A,F){let X,q;return a1(A)?(X=n.getRecordMatcher(A),q=F):q=A,n.addRoute(q,X)}function g(A){const F=n.getRecordMatcher(A);F?n.removeRoute(F):process.env.NODE_ENV!=="production"&&et(`Cannot remove non-existent route "${String(A)}"`)}function h(){return n.getRoutes().map(A=>A.record)}function b(A){return!!n.getRecordMatcher(A)}function y(A,F){if(F=at({},F||c.value),typeof A=="string"){const ee=Ep(o,A,F.path),ye=n.resolve({path:ee.path},F),Ve=a.createHref(ee.fullPath);return process.env.NODE_ENV!=="production"&&(Ve.startsWith("//")?et(`Location "${A}" resolved to "${Ve}". A resolved location cannot start with multiple slashes.`):ye.matched.length||et(`No match found for location with path "${A}"`)),at(ee,ye,{params:p(ye.params),hash:va(ee.hash),redirectedFrom:void 0,href:Ve})}let X;if(A.path!=null)process.env.NODE_ENV!=="production"&&"params"in A&&!("name"in A)&&Object.keys(A.params).length&&et(`Path "${A.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),X=at({},A,{path:Ep(o,A.path,F.path).path});else{const ee=at({},A.params);for(const ye in ee)ee[ye]==null&&delete ee[ye];X=at({},A,{params:f(ee)}),F.params=f(F.params)}const q=n.resolve(X,F),Q=A.hash||"";process.env.NODE_ENV!=="production"&&Q&&!Q.startsWith("#")&&et(`A \`hash\` should always start with the character "#". Replace "${Q}" with "#${Q}".`),q.params=u(p(q.params));const se=RG(r,at({},A,{hash:OG(Q),path:q.path})),ue=a.createHref(se);return process.env.NODE_ENV!=="production"&&(ue.startsWith("//")?et(`Location "${A}" resolved to "${ue}". A resolved location cannot start with multiple slashes.`):q.matched.length||et(`No match found for location with path "${A.path!=null?A.path:A}"`)),at({fullPath:se,hash:Q,query:r===p1?hX(A.query):A.query||{}},q,{redirectedFrom:void 0,href:ue})}function w(A){return typeof A=="string"?Ep(o,A,c.value.path):at({},A)}function C(A,F){if(d!==A)return Aa(8,{from:F,to:A})}function k(A){return E(A)}function _(A){return k(at(w(A),{replace:!0}))}function S(A){const F=A.matched[A.matched.length-1];if(F&&F.redirect){const{redirect:X}=F;let q=typeof X=="function"?X(A):X;if(typeof q=="string"&&(q=q.includes("?")||q.includes("#")?q=w(q):{path:q},q.params={}),process.env.NODE_ENV!=="production"&&q.path==null&&!("name"in q))throw et(`Invalid redirect found:
|
103
103
|
${JSON.stringify(q,null,2)}
|
104
104
|
when navigating to "${A.fullPath}". A redirect must contain a name or path. This will break in production.`),new Error("Invalid redirect");return at({query:A.query,hash:A.hash,params:q.path!=null?{}:A.params},q)}}function E(A,F){const X=d=y(A),q=c.value,Q=A.state,se=A.force,ue=A.replace===!0,ee=S(X);if(ee)return E(at(w(ee),{state:typeof ee=="object"?at({},Q,ee.state):Q,force:se,replace:ue}),F||X);const ye=X;ye.redirectedFrom=F;let Ve;return!se&&Qk(r,q,X)&&(Ve=Aa(16,{to:ye,from:q}),v(q,q,!0,!1)),(Ve?Promise.resolve(Ve):x(ye,q)).catch(he=>Bo(he)?Bo(he,2)?he:R(he):D(he,ye,q)).then(he=>{if(he){if(Bo(he,2))return process.env.NODE_ENV!=="production"&&Qk(r,y(he.to),ye)&&F&&(F._count=F._count?F._count+1:1)>30?(et(`Detected a possibly infinite redirection in a navigation guard when going from "${q.fullPath}" to "${ye.fullPath}". Aborting to avoid a Stack Overflow.
|
105
|
-
Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):E(at({replace:ue},w(he.to),{state:typeof he.to=="object"?at({},Q,he.to.state):Q,force:se}),F||ye)}else he=M(ye,q,!0,ue,Q);return $(ye,q,he),he})}function N(A,F){const X=C(A,F);return X?Promise.reject(X):Promise.resolve()}function T(A){const F=J.values().next().value;return F&&typeof F.runWithContext=="function"?F.runWithContext(A):A()}function x(A,F){let X;const[q,Q,se]=DX(A,F);X=Op(q.reverse(),"beforeRouteLeave",A,F);for(const ee of q)ee.leaveGuards.forEach(ye=>{X.push(nr(ye,A,F))});const ue=N.bind(null,A,F);return X.push(ue),U(X).then(()=>{X=[];for(const ee of l.list())X.push(nr(ee,A,F));return X.push(ue),U(X)}).then(()=>{X=Op(Q,"beforeRouteUpdate",A,F);for(const ee of Q)ee.updateGuards.forEach(ye=>{X.push(nr(ye,A,F))});return X.push(ue),U(X)}).then(()=>{X=[];for(const ee of se)if(ee.beforeEnter)if(bn(ee.beforeEnter))for(const ye of ee.beforeEnter)X.push(nr(ye,A,F));else X.push(nr(ee.beforeEnter,A,F));return X.push(ue),U(X)}).then(()=>(A.matched.forEach(ee=>ee.enterCallbacks={}),X=Op(se,"beforeRouteEnter",A,F,T),X.push(ue),U(X))).then(()=>{X=[];for(const ee of s.list())X.push(nr(ee,A,F));return X.push(ue),U(X)}).catch(ee=>Bo(ee,8)?ee:Promise.reject(ee))}function $(A,F,X){i.list().forEach(q=>T(()=>q(A,F,X)))}function M(A,F,X,q,Q){const se=C(A,F);if(se)return se;const ue=F===tr,ee=To?history.state:{};X&&(q||ue?a.replace(A.fullPath,at({scroll:ue&&ee&&ee.scroll},Q)):a.push(A.fullPath,Q)),c.value=A,v(A,F,X,ue),R()}let L;function P(){L||(L=a.listen((A,F,X)=>{const q=y(A),Q=S(q);if(Q){E(at(Q,{replace:!0}),q).catch(ts);return}d=q;const se=c.value;To&&HG(n1(se.fullPath,X.delta),dc()),x(q,se).catch(ue=>Bo(ue,12)?ue:Bo(ue,2)?(E(ue.to,q).then(ee=>{Bo(ee,20)&&!X.delta&&X.type===ns.pop&&a.go(-1,!1)}).catch(ts),Promise.reject()):(X.delta&&a.go(-X.delta,!1),D(ue,q,se))).then(ue=>{ue=ue||M(q,se,!1),ue&&(X.delta&&!Bo(ue,8)?a.go(-X.delta,!1):X.type===ns.pop&&Bo(ue,20)&&a.go(-1,!1)),$(q,se,ue)}).catch(ts)}))}let I=rs(),V=rs(),B;function D(A,F,X){R(A);const q=V.list();return q.length?q.forEach(Q=>Q(A,F,X)):(process.env.NODE_ENV!=="production"&&et("uncaught error during route navigation:"),console.error(A)),Promise.reject(A)}function O(){return B&&c.value!==tr?Promise.resolve():new Promise((A,F)=>{I.add([A,F])})}function R(A){return B||(B=!A,P(),I.list().forEach(([F,X])=>A?X(A):F()),I.reset()),A}function v(A,F,X,q){const{scrollBehavior:Q}=t;if(!To||!Q)return Promise.resolve();const se=!X&&WG(n1(A.fullPath,0))||(q||!X)&&history.state&&history.state.scroll||null;return e.nextTick().then(()=>Q(A,F,se)).then(ue=>ue&&FG(ue)).catch(ue=>D(ue,A,F))}const z=A=>a.go(A);let K;const J=new Set,ae={currentRoute:c,listening:!0,addRoute:m,removeRoute:g,hasRoute:b,getRoutes:h,resolve:y,options:t,push:k,replace:_,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:l.add,beforeResolve:s.add,afterEach:i.add,onError:V.add,isReady:O,install(A){const F=this;A.component("RouterLink",CX),A.component("RouterView",SX),A.config.globalProperties.$router=F,Object.defineProperty(A.config.globalProperties,"$route",{enumerable:!0,get:()=>e.unref(c)}),To&&!K&&c.value===tr&&(K=!0,k(a.location).catch(Q=>{process.env.NODE_ENV!=="production"&&et("Unexpected error when starting the router:",Q)}));const X={};for(const Q in tr)Object.defineProperty(X,Q,{get:()=>c.value[Q],enumerable:!0});A.provide(Tp,F),A.provide(h1,e.shallowReactive(X)),A.provide(Bp,c);const q=A.unmount;J.add(A),A.unmount=function(){J.delete(A),J.size<1&&(d=tr,L&&L(),L=null,c.value=tr,K=!1,B=!1),q()},process.env.NODE_ENV!=="production"&&To&&TX(A,F,n)}};function U(A){return A.reduce((F,X)=>F.then(()=>T(X)),Promise.resolve())}return ae}function DX(t,n){const o=[],r=[],a=[],l=Math.max(n.matched.length,t.matched.length);for(let s=0;s<l;s++){const i=n.matched[s];i&&(t.matched.find(d=>er(d,i))?r.push(i):o.push(i));const c=t.matched[s];c&&(n.matched.find(d=>er(d,c))||a.push(c))}return[o,r,a]}const PX=RX({history:YG("/"),routes:[{path:"/hy-table-demo",name:"hy-table-demo",component:()=>Promise.resolve().then(()=>tne)}]}),xp=!0;class LX{constructor(n){ps(this,"instance");ps(this,"loading");ps(this,"showLoading");var o,r,a,l;this.instance=Ht.create(n),this.showLoading=n.showLoading??xp,this.instance.interceptors.request.use(s=>(this.showLoading&&(this.loading=fk.service({lock:!0,text:"正在请求数据....",background:"rgba(0, 0, 0, 0.5)"})),s),s=>{var i;return(i=this.loading)==null||i.close(),s}),this.instance.interceptors.response.use(s=>{var u;(u=this.loading)==null||u.close();const{data:i}=s,{code:c,msg:d}=i;return c===200?s:(c===99&&PX.push({path:"/account-failure",replace:!0}),d&&Qi({title:"提示",message:d,type:"error"}),Promise.resolve(s))},s=>{var c;(c=this.loading)==null||c.close();const{data:i}=s.response;return i.msg&&Qi({title:"提示",message:i.msg,type:"error"}),s.code==="ECONNABORTED"&&Qi({title:"提示",message:"请求超时",type:"error"}),Promise.reject(s)}),this.instance.interceptors.request.use((o=n.interceptors)==null?void 0:o.requestSuccessFn,(r=n.interceptors)==null?void 0:r.requestFailureFn),this.instance.interceptors.response.use((a=n.interceptors)==null?void 0:a.responseSuccessFn,(l=n.interceptors)==null?void 0:l.responseFailureFn)}request(n){var o;return(o=n.interceptors)!=null&&o.requestSuccessFn&&(n=n.interceptors.requestSuccessFn(n)),n.showLoading===!1&&(this.showLoading=n.showLoading),new Promise((r,a)=>{this.instance.request(n).then(l=>{var s;(s=n.interceptors)!=null&&s.responseSuccessFn&&(l=n.interceptors.responseSuccessFn(l)),this.showLoading=xp,r(l)}).catch(l=>{this.showLoading=xp,a(l)})})}get(n){return this.request({...n,method:"GET"})}post(n){return this.request({...n,method:"POST"})}delete(n){return this.request({...n,method:"DELETE"})}patch(n){return this.request({...n,method:"PATCH"})}put(n){return this.request({...n,method:"PUT"})}}const vX=1e4;var ls=(t=>(t.JSON="application/json;charset=UTF-8",t.FORM_DATA="multipart/form-data;charset=UTF-8",t.FORM_URLENCODED="application/x-www-form-urlencoded;charset=UTF-8",t))(ls||{});class B1{constructor(n){ps(this,"storage");this.storage=n===0?localStorage:sessionStorage}setCache(n,o){o&&this.storage.setItem(n,JSON.stringify(o))}getCache(n){const o=this.storage.getItem(n);if(o)return JSON.parse(o)}removeCache(n){this.storage.removeItem(n)}clear(){this.storage.clear()}}const AX=new B1(0),zX=new B1(1),za=new LX({baseURL:"/api/admin",timeout:vX,headers:{"Content-Type":ls.JSON},interceptors:{requestSuccessFn:t=>{const n=zX.getCache("userInfo");return t.headers&&(n!=null&&n.token)?t.headers.token=n==null?void 0:n.token:t.headers.token="eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNzI0NjQyMTgyMDI3LCJpZCI6MTU0MjYsInR5cGUiOjEsImV4cCI6MTcyNzIzNDE4MiwiYWNjb3VudCI6Inh4eCJ9.8nWZuwfVCExzetiWTpOApb8aOp3PIpo4omHFpFHbQxWgudfG7XLa_bXenQBdjBR_20MOK4X16R-iktHa2y8BCg",t.headers&&t.isJson?t.headers["Content-Type"]=ls.JSON:t.headers&&t.isFormData?t.headers["Content-Type"]=ls.FORM_DATA:t.headers&&t.isFormUrlEncode&&(t.responseType="blob",t.headers["Content-Type"]=ls.FORM_URLENCODED),t.headers&&t.xAmzAcl&&(t.headers={"Content-Type":t.fileType,"x-amz-acl":"public-read"}),t},requestFailureFn:t=>t,responseSuccessFn:t=>t.data,responseFailureFn:t=>t}});function Vp(t,n){return za.post({url:t,data:n,isFormData:!0})}const FX={class:"rounded gap-x-0 flex flex-col w-full h-full"},HX={class:"flex items-center justify-between box-border"},WX={class:"flex-grow w-0 flex items-center mr-2"},KX={class:"flex items-center"},jX={class:"text-hy-text-main"},UX=e.createElementVNode("span",null,null,-1),YX={key:0},qX={key:1,class:"text-hy-text-secondary"},GX={class:"flex justify-between text-xs text-hy-text-main h-[34px] items-center px-2"},XX={key:0},JX={class:"text-hy-main"},ZX={key:0},QX={class:"text-hy-main"},eJ={key:0,class:"flex justify-center"},O1=e.defineComponent({__name:"index",props:{height:{default:500},columnList:{default:()=>[]},searchArr:{default:()=>[]},showIndexColumn:{type:Boolean,default:!1},defaultGetData:{type:Boolean,default:!0},selectColumnType:{default:Rn.NULL},childrenProps:{default:()=>({})},showFooter:{type:Boolean,default:!0},reqUrl:{default:"/api/data"},customUrl:{default:null},showHeader:{type:Boolean,default:()=>!0},cellStyle:{type:Function,default:()=>({})},headerCellStyle:{type:Function,default:()=>({})},disableIds:{default:()=>[]},searchForm:{default:()=>({})},searchKey:{},selectKey:{default:"id"},paginationLayout:{default:"sizes, prev, pager, next, jumper"},treeProps:{default:()=>({})}},emits:["getTotal","selectionChange","onRowcClick"],setup(t,{expose:n,emit:o}){const r=t,a=o,l=e.ref(),s=e.ref({query:null,size:10,page:0}),i=e.ref({totalElements:0,number:0,totalPages:0,size:0,content:null}),c=e.ref([]);function d(){return r.selectKey}const u=e.computed(()=>{let E="";return r.searchArr.forEach(N=>{E+=`${N.label},`}),r.columnList.forEach(N=>{N.isSearch&&(E+=`${N.label},`)}),E.length===0?null:E.substring(0,E.length-1)}),f=e.computed(()=>({row:E})=>{const N=E[r.selectKey];return typeof c.value!="object"?c.value===N?"selected":"":c.value.findIndex(x=>x[r.selectKey]===E[r.selectKey])!==-1?"selected":""});async function p(E){const N={...r==null?void 0:r.searchForm,...s.value,...E,page:s.value.page!==0?s.value.page-1:0};for(const M in N)(N[M]===void 0||N[M]===null||N[M]==="")&&delete N[M];if(r.customUrl){const{data:M}=await Vp(r.customUrl,N);i.value={content:M};return}const x=r.reqUrl.replace(/^\.\/(.*)\.\w+$/,"$1").split("/"),$=x[x.length-1];if($==="findAll"){const{data:M}=await Vp(r.reqUrl,N);i.value=M;return}if($==="page"){const{data:M,code:L}=await Vp(r.reqUrl,N);if(L!==200)return;i.value=M,a("getTotal",i.value.totalElements)}}function m(E){if(r.selectColumnType===Rn.CHECKBOX)c.value=E,a("selectionChange",c.value);else if(r.selectColumnType===Rn.RADIO){const N=E[r.selectKey];c.value=c.value===N?"":N,c.value?a("selectionChange",E):a("selectionChange",null)}}function g(E){var N;(N=l.value)==null||N.clearSelection(),console.log(r.selectColumnType,Rn.RADIO,E),r.selectColumnType===Rn.RADIO?E.length?(c.value=E[0][r.selectKey],a("selectionChange",E[0])):(c.value="",a("selectionChange",null)):(c.value=E||[],E.forEach(T=>{var M,L;let x=null;const $=T[r.selectKey];$&&(x=i.value.content.find(P=>P[r.selectKey]===$)),x?(M=l.value)==null||M.toggleRowSelection(x,!0):(L=l.value)==null||L.toggleRowSelection(T,!0)})),console.log("selectedData",c.value)}function h(){var E;(E=l.value)==null||E.clearSelection()}function b(E){s.value.page=E,p()}function y(){p()}function w(E){i.value=E}function C(E){var N;r.selectColumnType===Rn.CHECKBOX?(N=l.value)==null||N.toggleRowSelection(E):r.selectColumnType===Rn.RADIO&&m(E),a("onRowcClick",E)}function k(){return{...r==null?void 0:r.searchForm,...s.value}}function _(){return i.value}function S(){return i.value.totalElements}return e.onMounted(()=>{r.selectColumnType===Rn.CHECKBOX?c.value=[]:r.selectColumnType===Rn.RADIO&&(c.value=""),r.defaultGetData&&p()}),n({getTableData:p,setSelectedData:g,clearSelection:h,selectedData:c,setTableData:w,handleCurrentChange:b,getSearchForm:k,getTableList:_,getTotalElements:S}),(E,N)=>{var V;const T=e.resolveComponent("svg-icon"),x=e.resolveComponent("el-button"),$=e.resolveComponent("el-input"),M=e.resolveComponent("el-radio"),L=e.resolveComponent("el-table-column"),P=e.resolveComponent("el-table"),I=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",FX,[e.createElementVNode("div",HX,[e.createElementVNode("div",WX,[e.renderSlot(E.$slots,"tableLeft")]),e.createElementVNode("div",KX,[e.renderSlot(E.$slots,"tableRight"),((V=e.unref(u))==null?void 0:V.length)>0?(e.openBlock(),e.createBlock($,{key:0,modelValue:e.unref(s).query,"onUpdate:modelValue":N[1]||(N[1]=B=>e.unref(s).query=B),placeholder:`输入 ${e.unref(u)} 搜索`,size:"small",clearable:"",class:"my-2 table-search-main w-[260px]",onClear:N[2]||(N[2]=B=>b(0)),onKeyup:N[3]||(N[3]=e.withKeys(B=>b(0),["enter"]))},{append:e.withCtx(()=>[e.createElementVNode("div",jX,[e.createVNode(x,{class:"!m-0 h-[28px] w-[36px] !p-[6px_0px]",onClick:N[0]||(N[0]=B=>b(0))},{default:e.withCtx(()=>[e.createVNode(T,{name:"sys-button-search",width:"14",height:"14"})]),_:1})])]),_:1},8,["modelValue","placeholder"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["flex-grow h-0",{noData:!e.unref(i).content||e.unref(i).content.length===0}])},[e.renderSlot(E.$slots,"customContent",{tableData:e.unref(i).content}),e.useSlots().customContent?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(P,e.mergeProps({key:0,ref_key:"tableRef",ref:l,style:{width:"100%"},"empty-text":"暂 无 数 据"},E.childrenProps,{"highlight-current-row":"",height:E.height,"show-header":E.showHeader,data:e.unref(i).content,"cell-style":()=>E.cellStyle,"header-cell-style":()=>E.headerCellStyle,"row-key":d(),"tree-props":E.treeProps,"row-class-name":e.unref(f),onRowClick:C,onSelectionChange:m}),{empty:e.withCtx(()=>[e.renderSlot(E.$slots,"empty")]),default:e.withCtx(()=>[E.selectColumnType===e.unref(Rn).RADIO?(e.openBlock(),e.createBlock(L,{key:0,align:"center",width:"60",label:"选择"},{default:e.withCtx(({row:B})=>[e.createVNode(M,{"model-value":e.unref(c),class:"radio",label:B[r.selectKey]},{default:e.withCtx(()=>[UX]),_:2},1032,["model-value","label"])]),_:1})):e.createCommentVNode("",!0),E.selectColumnType===e.unref(Rn).CHECKBOX?(e.openBlock(),e.createBlock(L,{key:1,type:"selection",align:"center",width:"60","reserve-selection":!0,selectable:B=>!E.disableIds.includes(B[E.selectKey])},null,8,["selectable"])):e.createCommentVNode("",!0),E.showIndexColumn?(e.openBlock(),e.createBlock(L,{key:2,type:"index",label:"序号",align:"center",width:"80"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columnList,B=>(e.openBlock(),e.createBlock(L,e.mergeProps(B,{key:B.prop,label:B.label,"header-align":B.headerAlign,align:B.align,width:B.width,"show-overflow-tooltip":""}),e.createSlots({default:e.withCtx(D=>[e.renderSlot(E.$slots,B.slotName,e.normalizeProps(e.guardReactiveProps({...D,propItem:B})),()=>[D.row[B.prop]?(e.openBlock(),e.createElementBlock("span",YX,e.toDisplayString(D.row[B.prop]),1)):(e.openBlock(),e.createElementBlock("span",qX,"--"))])]),_:2},[B.headerSlotName?{name:"header",fn:e.withCtx(D=>[e.renderSlot(E.$slots,B.headerSlotName,e.normalizeProps(e.guardReactiveProps(D)))]),key:"0"}:void 0]),1040,["label","header-align","align","width"]))),128))]),_:3},16,["height","show-header","data","cell-style","header-cell-style","row-key","tree-props","row-class-name"]))],2),e.createElementVNode("div",GX,[e.createElementVNode("div",null,[e.unref(i).content?(e.openBlock(),e.createElementBlock("div",XX,[e.createTextVNode(" 本页共有 "),e.createElementVNode("span",JX,e.toDisplayString(e.unref(i).content.length),1),e.createTextVNode(" 条数据 "),e.unref(c)&&e.unref(c).length?(e.openBlock(),e.createElementBlock("span",ZX,[e.createTextVNode(" 已选中 "),e.createElementVNode("span",QX,e.toDisplayString(e.unref(c).length),1),e.createTextVNode(" 条 ")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(E.$slots,"statisticalQuantityLeft")]),e.createElementVNode("div",null,[e.renderSlot(E.$slots,"statisticalQuantityRight")])]),E.showFooter?(e.openBlock(),e.createElementBlock("div",eJ,[e.renderSlot(E.$slots,"footer",{},()=>[e.createVNode(I,{"current-page":e.unref(s).page,"onUpdate:currentPage":N[4]||(N[4]=B=>e.unref(s).page=B),"page-size":e.unref(s).size,"onUpdate:pageSize":N[5]||(N[5]=B=>e.unref(s).size=B),class:"h-[50px]","hide-on-single-page":!0,"page-sizes":[15,30,50,100],layout:E.paginationLayout,total:e.unref(i).totalElements,onSizeChange:y,onCurrentChange:b},null,8,["current-page","page-size","layout","total"])])])):e.createCommentVNode("",!0)])}}}),$1={};$1.getData=t=>new Promise((n,o)=>{let r={};tJ(t).then(a=>{r.arrayBuffer=a;try{r.orientation=aJ(a)}catch{r.orientation=-1}n(r)}).catch(a=>{o(a)})});function tJ(t){let n=null;return new Promise((o,r)=>{if(t.src)if(/^data\:/i.test(t.src))n=oJ(t.src),o(n);else if(/^blob\:/i.test(t.src)){var a=new FileReader;a.onload=function(s){n=s.target.result,o(n)},nJ(t.src,function(s){a.readAsArrayBuffer(s)})}else{var l=new XMLHttpRequest;l.onload=function(){if(this.status==200||this.status===0)n=l.response,o(n);else throw"Could not load image";l=null},l.open("GET",t.src,!0),l.responseType="arraybuffer",l.send(null)}else r("img error")})}function nJ(t,n){var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(r){(this.status==200||this.status===0)&&n(this.response)},o.send()}function oJ(t,n){n=n||t.match(/^data\:([^\;]+)\;base64,/mi)[1]||"",t=t.replace(/^data\:([^\;]+)\;base64,/gmi,"");for(var o=atob(t),r=o.length%2==0?o.length:o.length+1,a=new ArrayBuffer(r),l=new Uint16Array(a),s=0;s<r;s++)l[s]=o.charCodeAt(s);return a}function rJ(t,n,o){var r="",a;for(a=n,o+=n;a<o;a++)r+=String.fromCharCode(t.getUint8(a));return r}function aJ(t){var n=new DataView(t),o=n.byteLength,r,a,l,s,i,c,d,u,f,p;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(f=2;f<o;){if(n.getUint8(f)===255&&n.getUint8(f+1)===225){d=f;break}f++}if(d&&(a=d+4,l=d+10,rJ(n,a,4)==="Exif"&&(c=n.getUint16(l),i=c===18761,(i||c===19789)&&n.getUint16(l+2,i)===42&&(s=n.getUint32(l+4,i),s>=8&&(u=l+s)))),u){for(o=n.getUint16(u,i),p=0;p<o;p++)if(f=u+p*12+2,n.getUint16(f,i)===274){f+=8,r=n.getUint16(f,i);break}}return r}const lJ=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},sJ=e.defineComponent({data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:()=>[1,1]},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:()=>10,validator:function(t){return Array.isArray(t)?Number(t[0])>=0&&Number(t[1])>=0:Number(t)>=0}},fillColor:{type:String,default:""}},computed:{cropInfo(){let t={};if(t.top=this.cropOffsertY>21?"-21px":"0px",t.width=this.cropW>0?this.cropW:0,t.height=this.cropH>0?this.cropH:0,this.infoTrue){let n=1;this.high&&!this.full&&(n=window.devicePixelRatio),this.enlarge!==1&!this.full&&(n=Math.abs(Number(this.enlarge))),t.width=t.width*n,t.height=t.height*n,this.full&&(t.width=t.width/this.scale,t.height=t.height/this.scale)}return t.width=t.width.toFixed(0),t.height=t.height.toFixed(0),t},isIE(){return!!window.ActiveXObject||"ActiveXObject"in window},passive(){return this.isIE?null:{passive:!1}}},watch:{img(){this.checkedImg()},imgs(t){t!==""&&this.reload()},cropW(){this.showPreview()},cropH(){this.showPreview()},cropOffsertX(){this.showPreview()},cropOffsertY(){this.showPreview()},scale(t,n){this.showPreview()},x(){this.showPreview()},y(){this.showPreview()},autoCrop(t){t&&this.goAutoCrop()},autoCropWidth(){this.autoCrop&&this.goAutoCrop()},autoCropHeight(){this.autoCrop&&this.goAutoCrop()},mode(){this.checkedImg()},rotate(){this.showPreview(),this.autoCrop?this.goAutoCrop(this.cropW,this.cropH):(this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion(t){var n=navigator.userAgent.split(" "),o="";let r=0;const a=new RegExp(t,"i");for(var l=0;l<n.length;l++)a.test(n[l])&&(o=n[l]);return o?r=o.split("/")[1].split("."):r=["0","0","0"],r},checkOrientationImage(t,n,o,r){if(this.getVersion("chrome")[0]>=81)n=-1;else if(this.getVersion("safari")[0]>=605){const s=this.getVersion("version");s[0]>13&&s[1]>1&&(n=-1)}else{const s=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(s){let i=s[1];i=i.split("_"),(i[0]>13||i[0]>=13&&i[1]>=4)&&(n=-1)}}let a=document.createElement("canvas"),l=a.getContext("2d");switch(l.save(),n){case 2:a.width=o,a.height=r,l.translate(o,0),l.scale(-1,1);break;case 3:a.width=o,a.height=r,l.translate(o/2,r/2),l.rotate(180*Math.PI/180),l.translate(-o/2,-r/2);break;case 4:a.width=o,a.height=r,l.translate(0,r),l.scale(1,-1);break;case 5:a.height=o,a.width=r,l.rotate(.5*Math.PI),l.scale(1,-1);break;case 6:a.width=r,a.height=o,l.translate(r/2,o/2),l.rotate(90*Math.PI/180),l.translate(-o/2,-r/2);break;case 7:a.height=o,a.width=r,l.rotate(.5*Math.PI),l.translate(o,-r),l.scale(-1,1);break;case 8:a.height=o,a.width=r,l.translate(r/2,o/2),l.rotate(-90*Math.PI/180),l.translate(-o/2,-r/2);break;default:a.width=o,a.height=r}l.drawImage(t,0,0,o,r),l.restore(),a.toBlob(s=>{let i=URL.createObjectURL(s);URL.revokeObjectURL(this.imgs),this.imgs=i},"image/"+this.outputType,1)},checkedImg(){if(this.img===null||this.img===""){this.imgs="",this.clearCrop();return}this.loading=!0,this.scale=1,this.rotate=0,this.clearCrop();let t=new Image;if(t.onload=()=>{if(this.img==="")return this.$emit("img-load",new Error("图片不能为空")),!1;let o=t.width,r=t.height;$1.getData(t).then(a=>{this.orientation=a.orientation||1;let l=Number(this.maxImgSize);if(!this.orientation&&o<l&r<l){this.imgs=this.img;return}o>l&&(r=r/o*l,o=l),r>l&&(o=o/r*l,r=l),this.checkOrientationImage(t,this.orientation,o,r)}).catch(a=>{this.$emit("img-load","error"),this.$emit("img-load-error",a)})},t.onerror=o=>{this.$emit("img-load","error"),this.$emit("img-load-error",o)},this.img.substr(0,4)!=="data"&&(t.crossOrigin=""),this.isIE){var n=new XMLHttpRequest;n.onload=function(){var o=URL.createObjectURL(this.response);t.src=o},n.open("GET",this.img,!0),n.responseType="blob",n.send()}else t.src=this.img},startMove(t){if(t.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in t?t.clientX:t.touches[0].clientX)-this.x,this.moveY=("clientY"in t?t.clientY:t.touches[0].clientY)-this.y,t.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),t.touches.length==2&&(this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=t.offsetX?t.offsetX:t.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=t.offsetY?t.offsetY:t.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in t?t.clientX:t.touches[0].clientX,this.cropY="clientY"in t?t.clientY:t.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale(t){t.preventDefault();let n=this.scale;var o={x:this.touches[0].clientX,y:this.touches[0].clientY},r={x:t.touches[0].clientX,y:t.touches[0].clientY},a={x:this.touches[1].clientX,y:this.touches[1].clientY},l={x:t.touches[1].clientX,y:t.touches[1].clientY},s=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),i=Math.sqrt(Math.pow(r.x-l.x,2)+Math.pow(r.y-l.y,2)),c=i-s,d=1;d=d/this.trueWidth>d/this.trueHeight?d/this.trueHeight:d/this.trueWidth,d=d>.1?.1:d;var u=d*c;if(!this.touchNow){if(this.touchNow=!0,c>0?n+=Math.abs(u):c<0&&n>Math.abs(u)&&(n-=Math.abs(u)),this.touches=t.touches,setTimeout(()=>{this.touchNow=!1},8),!this.checkoutImgAxis(this.x,this.y,n))return!1;this.scale=n}},cancelTouchScale(t){window.removeEventListener("touchmove",this.touchScale)},moveImg(t){if(t.preventDefault(),t.touches&&t.touches.length===2)return this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;let n="clientX"in t?t.clientX:t.touches[0].clientX,o="clientY"in t?t.clientY:t.touches[0].clientY,r,a;r=n-this.moveX,a=o-this.moveY,this.$nextTick(()=>{if(this.centerBox){let l=this.getImgAxis(r,a,this.scale),s=this.getCropAxis(),i=this.trueHeight*this.scale,c=this.trueWidth*this.scale,d,u,f,p;switch(this.rotate){case 1:case-1:case 3:case-3:d=this.cropOffsertX-this.trueWidth*(1-this.scale)/2+(i-c)/2,u=this.cropOffsertY-this.trueHeight*(1-this.scale)/2+(c-i)/2,f=d-i+this.cropW,p=u-c+this.cropH;break;default:d=this.cropOffsertX-this.trueWidth*(1-this.scale)/2,u=this.cropOffsertY-this.trueHeight*(1-this.scale)/2,f=d-c+this.cropW,p=u-i+this.cropH;break}l.x1>=s.x1&&(r=d),l.y1>=s.y1&&(a=u),l.x2<=s.x2&&(r=f),l.y2<=s.y2&&(a=p)}this.x=r,this.y=a,this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})})},leaveImg(t){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize(t){t.preventDefault();let n=this.scale;var o=t.deltaY||t.wheelDelta,r=navigator.userAgent.indexOf("Firefox");o=r>0?o*30:o,this.isIE&&(o=-o);var a=this.coe;a=a/this.trueWidth>a/this.trueHeight?a/this.trueHeight:a/this.trueWidth;var l=a*o;l<0?n+=Math.abs(l):n>Math.abs(l)&&(n-=Math.abs(l));let s=l<0?"add":"reduce";if(s!==this.coeStatus&&(this.coeStatus=s,this.coe=.2),this.scaling||(this.scalingSet=setTimeout(()=>{this.scaling=!1,this.coe=this.coe+=.01},50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,n))return!1;this.scale=n},changeScale(t){let n=this.scale;t=t||1;var o=20;if(o=o/this.trueWidth>o/this.trueHeight?o/this.trueHeight:o/this.trueWidth,t=t*o,t>0?n+=Math.abs(t):n>Math.abs(t)&&(n-=Math.abs(t)),!this.checkoutImgAxis(this.x,this.y,n))return!1;this.scale=n},createCrop(t){t.preventDefault();var n="clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0,o="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0;this.$nextTick(()=>{var r=n-this.cropX,a=o-this.cropY;if(r>0?(this.cropW=r+this.cropChangeX>this.w?this.w-this.cropChangeX:r,this.cropOffsertX=this.cropChangeX):(this.cropW=this.w-this.cropChangeX+Math.abs(r)>this.w?this.cropChangeX:Math.abs(r),this.cropOffsertX=this.cropChangeX+r>0?this.cropChangeX+r:0),!this.fixed)a>0?(this.cropH=a+this.cropChangeY>this.h?this.h-this.cropChangeY:a,this.cropOffsertY=this.cropChangeY):(this.cropH=this.h-this.cropChangeY+Math.abs(a)>this.h?this.cropChangeY:Math.abs(a),this.cropOffsertY=this.cropChangeY+a>0?this.cropChangeY+a:0);else{var l=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];l+this.cropOffsertY>this.h?(this.cropH=this.h-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],r>0?this.cropOffsertX=this.cropChangeX:this.cropOffsertX=this.cropChangeX-this.cropW):this.cropH=l,this.cropOffsertY=this.cropOffsertY}})},changeCropSize(t,n,o,r,a){t.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=n,this.canChangeY=o,this.changeCropTypeX=r,this.changeCropTypeY=a,this.cropX="clientX"in t?t.clientX:t.touches[0].clientX,this.cropY="clientY"in t?t.clientY:t.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow(t){t.preventDefault();var n="clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0,o="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0;let r=this.w,a=this.h,l=0,s=0;if(this.centerBox){let d=this.getImgAxis(),u=d.x2,f=d.y2;l=d.x1>0?d.x1:0,s=d.y1>0?d.y1:0,r>u&&(r=u),a>f&&(a=f)}const[i,c]=this.checkCropLimitSize();this.$nextTick(()=>{var d=n-this.cropX,u=o-this.cropY;if(this.canChangeX&&(this.changeCropTypeX===1?this.cropOldW-d<i?(this.cropW=i,this.cropOffsertX=this.cropOldW+this.cropChangeX-l-i):this.cropOldW-d>0?(this.cropW=r-this.cropChangeX-d<=r-l?this.cropOldW-d:this.cropOldW+this.cropChangeX-l,this.cropOffsertX=r-this.cropChangeX-d<=r-l?this.cropChangeX+d:l):(this.cropW=Math.abs(d)+this.cropChangeX<=r?Math.abs(d)-this.cropOldW:r-this.cropOldW-this.cropChangeX,this.cropOffsertX=this.cropChangeX+this.cropOldW):this.changeCropTypeX===2&&(this.cropOldW+d<i?this.cropW=i:this.cropOldW+d>0?(this.cropW=this.cropOldW+d+this.cropOffsertX<=r?this.cropOldW+d:r-this.cropOffsertX,this.cropOffsertX=this.cropChangeX):(this.cropW=r-this.cropChangeX+Math.abs(d+this.cropOldW)<=r-l?Math.abs(d+this.cropOldW):this.cropChangeX-l,this.cropOffsertX=r-this.cropChangeX+Math.abs(d+this.cropOldW)<=r-l?this.cropChangeX-Math.abs(d+this.cropOldW):l))),this.canChangeY&&(this.changeCropTypeY===1?this.cropOldH-u<c?(this.cropH=c,this.cropOffsertY=this.cropOldH+this.cropChangeY-s-c):this.cropOldH-u>0?(this.cropH=a-this.cropChangeY-u<=a-s?this.cropOldH-u:this.cropOldH+this.cropChangeY-s,this.cropOffsertY=a-this.cropChangeY-u<=a-s?this.cropChangeY+u:s):(this.cropH=Math.abs(u)+this.cropChangeY<=a?Math.abs(u)-this.cropOldH:a-this.cropOldH-this.cropChangeY,this.cropOffsertY=this.cropChangeY+this.cropOldH):this.changeCropTypeY===2&&(this.cropOldH+u<c?this.cropH=c:this.cropOldH+u>0?(this.cropH=this.cropOldH+u+this.cropOffsertY<=a?this.cropOldH+u:a-this.cropOffsertY,this.cropOffsertY=this.cropChangeY):(this.cropH=a-this.cropChangeY+Math.abs(u+this.cropOldH)<=a-s?Math.abs(u+this.cropOldH):this.cropChangeY-s,this.cropOffsertY=a-this.cropChangeY+Math.abs(u+this.cropOldH)<=a-s?this.cropChangeY-Math.abs(u+this.cropOldH):s))),this.canChangeX&&this.fixed){var f=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];f<c?(this.cropH=c,this.cropW=this.fixedNumber[0]*c/this.fixedNumber[1],this.changeCropTypeX===1&&(this.cropOffsertX=this.cropChangeX+(this.cropOldW-this.cropW))):f+this.cropOffsertY>a?(this.cropH=a-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],this.changeCropTypeX===1&&(this.cropOffsertX=this.cropChangeX+(this.cropOldW-this.cropW))):this.cropH=f}if(this.canChangeY&&this.fixed){var p=this.cropH/this.fixedNumber[1]*this.fixedNumber[0];p<i?(this.cropW=i,this.cropH=this.fixedNumber[1]*i/this.fixedNumber[0],this.cropOffsertY=this.cropOldH+this.cropChangeY-this.cropH):p+this.cropOffsertX>r?(this.cropW=r-this.cropOffsertX,this.cropH=this.cropW/this.fixedNumber[0]*this.fixedNumber[1]):this.cropW=p}})},checkCropLimitSize(){let{cropW:t,cropH:n,limitMinSize:o}=this,r=new Array;return Array.isArray(o)?r=o:r=[o,o],t=parseFloat(r[0]),n=parseFloat(r[1]),[t,n]},changeCropEnd(t){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},calculateSize(t,n,o,r,a,l){const s=t/n;let i=a,c=l;return i<o&&(i=o,c=Math.ceil(i/s)),c<r&&(c=r,i=Math.ceil(c*s),i<o&&(i=o,c=Math.ceil(i/s))),i<a&&(i=a,c=Math.ceil(i/s)),c<l&&(c=l,i=Math.ceil(c*s)),{width:i,height:c}},endCrop(){this.cropW===0&&this.cropH===0&&(this.cropping=!1);let[t,n]=this.checkCropLimitSize();const{width:o,height:r}=this.fixed?this.calculateSize(this.fixedNumber[0],this.fixedNumber[1],t,n,this.cropW,this.cropH):{width:t,height:n};o>this.cropW&&(this.cropW=o,this.cropOffsertX+o>this.w&&(this.cropOffsertX=this.w-o)),r>this.cropH&&(this.cropH=r,this.cropOffsertY+r>this.h&&(this.cropOffsertY=this.h-r)),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop(){this.crop=!0},stopCrop(){this.crop=!1},clearCrop(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove(t){if(t.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(t),!1;if(t.touches&&t.touches.length===2)return this.crop=!1,this.startMove(t),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);let n="clientX"in t?t.clientX:t.touches[0].clientX,o="clientY"in t?t.clientY:t.touches[0].clientY,r,a;r=n-this.cropOffsertX,a=o-this.cropOffsertY,this.cropX=r,this.cropY=a,this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop(t,n){let o=0,r=0;t&&(t.preventDefault(),o="clientX"in t?t.clientX:t.touches[0].clientX,r="clientY"in t?t.clientY:t.touches[0].clientY),this.$nextTick(()=>{let a,l,s=o-this.cropX,i=r-this.cropY;if(n&&(s=this.cropOffsertX,i=this.cropOffsertY),s<=0?a=0:s+this.cropW>this.w?a=this.w-this.cropW:a=s,i<=0?l=0:i+this.cropH>this.h?l=this.h-this.cropH:l=i,this.centerBox){let c=this.getImgAxis();a<=c.x1&&(a=c.x1),a+this.cropW>c.x2&&(a=c.x2-this.cropW),l<=c.y1&&(l=c.y1),l+this.cropH>c.y2&&(l=c.y2-this.cropH)}this.cropOffsertX=a,this.cropOffsertY=l,this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})})},getImgAxis(t,n,o){t=t||this.x,n=n||this.y,o=o||this.scale;let r={x1:0,x2:0,y1:0,y2:0},a=this.trueWidth*o,l=this.trueHeight*o;switch(this.rotate){case 0:r.x1=t+this.trueWidth*(1-o)/2,r.x2=r.x1+this.trueWidth*o,r.y1=n+this.trueHeight*(1-o)/2,r.y2=r.y1+this.trueHeight*o;break;case 1:case-1:case 3:case-3:r.x1=t+this.trueWidth*(1-o)/2+(a-l)/2,r.x2=r.x1+this.trueHeight*o,r.y1=n+this.trueHeight*(1-o)/2+(l-a)/2,r.y2=r.y1+this.trueWidth*o;break;default:r.x1=t+this.trueWidth*(1-o)/2,r.x2=r.x1+this.trueWidth*o,r.y1=n+this.trueHeight*(1-o)/2,r.y2=r.y1+this.trueHeight*o;break}return r},getCropAxis(){let t={x1:0,x2:0,y1:0,y2:0};return t.x1=this.cropOffsertX,t.x2=t.x1+this.cropW,t.y1=this.cropOffsertY,t.y2=t.y1+this.cropH,t},leaveCrop(t){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked(t){let n=document.createElement("canvas"),o=new Image,r=this.rotate,a=this.trueWidth,l=this.trueHeight,s=this.cropOffsertX,i=this.cropOffsertY;o.onload=()=>{if(this.cropW!==0){let u=n.getContext("2d"),f=1;this.high&!this.full&&(f=window.devicePixelRatio),this.enlarge!==1&!this.full&&(f=Math.abs(Number(this.enlarge)));let p=this.cropW*f,m=this.cropH*f,g=a*this.scale*f,h=l*this.scale*f,b=(this.x-s+this.trueWidth*(1-this.scale)/2)*f,y=(this.y-i+this.trueHeight*(1-this.scale)/2)*f;switch(d(p,m),u.save(),this.fillColor&&(u.fillStyle=this.fillColor,u.fillRect(0,0,n.width,n.height)),r){case 0:this.full?(d(p/this.scale,m/this.scale),u.drawImage(o,b/this.scale,y/this.scale,g/this.scale,h/this.scale)):u.drawImage(o,b,y,g,h);break;case 1:case-3:this.full?(d(p/this.scale,m/this.scale),b=b/this.scale+(g/this.scale-h/this.scale)/2,y=y/this.scale+(h/this.scale-g/this.scale)/2,u.rotate(r*90*Math.PI/180),u.drawImage(o,y,-b-h/this.scale,g/this.scale,h/this.scale)):(b=b+(g-h)/2,y=y+(h-g)/2,u.rotate(r*90*Math.PI/180),u.drawImage(o,y,-b-h,g,h));break;case 2:case-2:this.full?(d(p/this.scale,m/this.scale),u.rotate(r*90*Math.PI/180),b=b/this.scale,y=y/this.scale,u.drawImage(o,-b-g/this.scale,-y-h/this.scale,g/this.scale,h/this.scale)):(u.rotate(r*90*Math.PI/180),u.drawImage(o,-b-g,-y-h,g,h));break;case 3:case-1:this.full?(d(p/this.scale,m/this.scale),b=b/this.scale+(g/this.scale-h/this.scale)/2,y=y/this.scale+(h/this.scale-g/this.scale)/2,u.rotate(r*90*Math.PI/180),u.drawImage(o,-y-g/this.scale,b,g/this.scale,h/this.scale)):(b=b+(g-h)/2,y=y+(h-g)/2,u.rotate(r*90*Math.PI/180),u.drawImage(o,-y-g,b,g,h));break;default:this.full?(d(p/this.scale,m/this.scale),u.drawImage(o,b/this.scale,y/this.scale,g/this.scale,h/this.scale)):u.drawImage(o,b,y,g,h)}u.restore()}else{let u=a*this.scale,f=l*this.scale,p=n.getContext("2d");switch(p.save(),this.fillColor&&(p.fillStyle=this.fillColor,p.fillRect(0,0,n.width,n.height)),r){case 0:d(u,f),p.drawImage(o,0,0,u,f);break;case 1:case-3:d(f,u),p.rotate(r*90*Math.PI/180),p.drawImage(o,0,-f,u,f);break;case 2:case-2:d(u,f),p.rotate(r*90*Math.PI/180),p.drawImage(o,-u,-f,u,f);break;case 3:case-1:d(f,u),p.rotate(r*90*Math.PI/180),p.drawImage(o,-u,0,u,f);break;default:d(u,f),p.drawImage(o,0,0,u,f)}p.restore()}t(n)};var c=this.img.substr(0,4);c!=="data"&&(o.crossOrigin="Anonymous"),o.src=this.imgs;function d(u,f){n.width=Math.round(u),n.height=Math.round(f)}},getCropData(t){this.getCropChecked(n=>{t(n.toDataURL("image/"+this.outputType,this.outputSize))})},getCropBlob(t){this.getCropChecked(n=>{n.toBlob(o=>t(o),"image/"+this.outputType,this.outputSize)})},showPreview(){if(this.isCanShow)this.isCanShow=!1,setTimeout(()=>{this.isCanShow=!0},16);else return!1;let t=this.cropW,n=this.cropH,o=this.scale;var r={};r.div={width:`${t}px`,height:`${n}px`};let a=(this.x-this.cropOffsertX)/o,l=(this.y-this.cropOffsertY)/o,s=0;r.w=t,r.h=n,r.url=this.imgs,r.img={width:`${this.trueWidth}px`,height:`${this.trueHeight}px`,transform:`scale(${o})translate3d(${a}px, ${l}px, ${s}px)rotateZ(${this.rotate*90}deg)`},r.html=`
|
105
|
+
Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):E(at({replace:ue},w(he.to),{state:typeof he.to=="object"?at({},Q,he.to.state):Q,force:se}),F||ye)}else he=M(ye,q,!0,ue,Q);return $(ye,q,he),he})}function N(A,F){const X=C(A,F);return X?Promise.reject(X):Promise.resolve()}function T(A){const F=J.values().next().value;return F&&typeof F.runWithContext=="function"?F.runWithContext(A):A()}function x(A,F){let X;const[q,Q,se]=DX(A,F);X=Op(q.reverse(),"beforeRouteLeave",A,F);for(const ee of q)ee.leaveGuards.forEach(ye=>{X.push(nr(ye,A,F))});const ue=N.bind(null,A,F);return X.push(ue),U(X).then(()=>{X=[];for(const ee of l.list())X.push(nr(ee,A,F));return X.push(ue),U(X)}).then(()=>{X=Op(Q,"beforeRouteUpdate",A,F);for(const ee of Q)ee.updateGuards.forEach(ye=>{X.push(nr(ye,A,F))});return X.push(ue),U(X)}).then(()=>{X=[];for(const ee of se)if(ee.beforeEnter)if(bn(ee.beforeEnter))for(const ye of ee.beforeEnter)X.push(nr(ye,A,F));else X.push(nr(ee.beforeEnter,A,F));return X.push(ue),U(X)}).then(()=>(A.matched.forEach(ee=>ee.enterCallbacks={}),X=Op(se,"beforeRouteEnter",A,F,T),X.push(ue),U(X))).then(()=>{X=[];for(const ee of s.list())X.push(nr(ee,A,F));return X.push(ue),U(X)}).catch(ee=>Bo(ee,8)?ee:Promise.reject(ee))}function $(A,F,X){i.list().forEach(q=>T(()=>q(A,F,X)))}function M(A,F,X,q,Q){const se=C(A,F);if(se)return se;const ue=F===tr,ee=To?history.state:{};X&&(q||ue?a.replace(A.fullPath,at({scroll:ue&&ee&&ee.scroll},Q)):a.push(A.fullPath,Q)),c.value=A,v(A,F,X,ue),R()}let L;function P(){L||(L=a.listen((A,F,X)=>{const q=y(A),Q=S(q);if(Q){E(at(Q,{replace:!0}),q).catch(ts);return}d=q;const se=c.value;To&&HG(n1(se.fullPath,X.delta),dc()),x(q,se).catch(ue=>Bo(ue,12)?ue:Bo(ue,2)?(E(ue.to,q).then(ee=>{Bo(ee,20)&&!X.delta&&X.type===ns.pop&&a.go(-1,!1)}).catch(ts),Promise.reject()):(X.delta&&a.go(-X.delta,!1),D(ue,q,se))).then(ue=>{ue=ue||M(q,se,!1),ue&&(X.delta&&!Bo(ue,8)?a.go(-X.delta,!1):X.type===ns.pop&&Bo(ue,20)&&a.go(-1,!1)),$(q,se,ue)}).catch(ts)}))}let I=rs(),V=rs(),B;function D(A,F,X){R(A);const q=V.list();return q.length?q.forEach(Q=>Q(A,F,X)):(process.env.NODE_ENV!=="production"&&et("uncaught error during route navigation:"),console.error(A)),Promise.reject(A)}function O(){return B&&c.value!==tr?Promise.resolve():new Promise((A,F)=>{I.add([A,F])})}function R(A){return B||(B=!A,P(),I.list().forEach(([F,X])=>A?X(A):F()),I.reset()),A}function v(A,F,X,q){const{scrollBehavior:Q}=t;if(!To||!Q)return Promise.resolve();const se=!X&&WG(n1(A.fullPath,0))||(q||!X)&&history.state&&history.state.scroll||null;return e.nextTick().then(()=>Q(A,F,se)).then(ue=>ue&&FG(ue)).catch(ue=>D(ue,A,F))}const z=A=>a.go(A);let K;const J=new Set,ae={currentRoute:c,listening:!0,addRoute:m,removeRoute:g,hasRoute:b,getRoutes:h,resolve:y,options:t,push:k,replace:_,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:l.add,beforeResolve:s.add,afterEach:i.add,onError:V.add,isReady:O,install(A){const F=this;A.component("RouterLink",CX),A.component("RouterView",SX),A.config.globalProperties.$router=F,Object.defineProperty(A.config.globalProperties,"$route",{enumerable:!0,get:()=>e.unref(c)}),To&&!K&&c.value===tr&&(K=!0,k(a.location).catch(Q=>{process.env.NODE_ENV!=="production"&&et("Unexpected error when starting the router:",Q)}));const X={};for(const Q in tr)Object.defineProperty(X,Q,{get:()=>c.value[Q],enumerable:!0});A.provide(Tp,F),A.provide(h1,e.shallowReactive(X)),A.provide(Bp,c);const q=A.unmount;J.add(A),A.unmount=function(){J.delete(A),J.size<1&&(d=tr,L&&L(),L=null,c.value=tr,K=!1,B=!1),q()},process.env.NODE_ENV!=="production"&&To&&TX(A,F,n)}};function U(A){return A.reduce((F,X)=>F.then(()=>T(X)),Promise.resolve())}return ae}function DX(t,n){const o=[],r=[],a=[],l=Math.max(n.matched.length,t.matched.length);for(let s=0;s<l;s++){const i=n.matched[s];i&&(t.matched.find(d=>er(d,i))?r.push(i):o.push(i));const c=t.matched[s];c&&(n.matched.find(d=>er(d,c))||a.push(c))}return[o,r,a]}const PX=RX({history:YG("/"),routes:[{path:"/hy-table-demo",name:"hy-table-demo",component:()=>Promise.resolve().then(()=>tne)}]}),xp=!0;class LX{constructor(n){ps(this,"instance");ps(this,"loading");ps(this,"showLoading");var o,r,a,l;this.instance=Ht.create(n),this.showLoading=n.showLoading??xp,this.instance.interceptors.request.use(s=>(this.showLoading&&(this.loading=fk.service({lock:!0,text:"正在请求数据....",background:"rgba(0, 0, 0, 0.5)"})),s),s=>{var i;return(i=this.loading)==null||i.close(),s}),this.instance.interceptors.response.use(s=>{var u;(u=this.loading)==null||u.close();const{data:i}=s,{code:c,msg:d}=i;return c===200?s:(c===99&&PX.push({path:"/account-failure",replace:!0}),d&&Qi({title:"提示",message:d,type:"error"}),Promise.resolve(s))},s=>{var c;(c=this.loading)==null||c.close();const{data:i}=s.response;return i.msg&&Qi({title:"提示",message:i.msg,type:"error"}),s.code==="ECONNABORTED"&&Qi({title:"提示",message:"请求超时",type:"error"}),Promise.reject(s)}),this.instance.interceptors.request.use((o=n.interceptors)==null?void 0:o.requestSuccessFn,(r=n.interceptors)==null?void 0:r.requestFailureFn),this.instance.interceptors.response.use((a=n.interceptors)==null?void 0:a.responseSuccessFn,(l=n.interceptors)==null?void 0:l.responseFailureFn)}request(n){var o;return(o=n.interceptors)!=null&&o.requestSuccessFn&&(n=n.interceptors.requestSuccessFn(n)),n.showLoading===!1&&(this.showLoading=n.showLoading),new Promise((r,a)=>{this.instance.request(n).then(l=>{var s;(s=n.interceptors)!=null&&s.responseSuccessFn&&(l=n.interceptors.responseSuccessFn(l)),this.showLoading=xp,r(l)}).catch(l=>{this.showLoading=xp,a(l)})})}get(n){return this.request({...n,method:"GET"})}post(n){return this.request({...n,method:"POST"})}delete(n){return this.request({...n,method:"DELETE"})}patch(n){return this.request({...n,method:"PATCH"})}put(n){return this.request({...n,method:"PUT"})}}const vX=1e4;var ls=(t=>(t.JSON="application/json;charset=UTF-8",t.FORM_DATA="multipart/form-data;charset=UTF-8",t.FORM_URLENCODED="application/x-www-form-urlencoded;charset=UTF-8",t))(ls||{});class B1{constructor(n){ps(this,"storage");this.storage=n===0?localStorage:sessionStorage}setCache(n,o){o&&this.storage.setItem(n,JSON.stringify(o))}getCache(n){const o=this.storage.getItem(n);if(o)return JSON.parse(o)}removeCache(n){this.storage.removeItem(n)}clear(){this.storage.clear()}}const AX=new B1(0),zX=new B1(1),za=new LX({baseURL:"/api/admin",timeout:vX,headers:{"Content-Type":ls.JSON},interceptors:{requestSuccessFn:t=>{const n=zX.getCache("userInfo");return t.headers&&(n!=null&&n.token)?t.headers.token=n==null?void 0:n.token:t.headers.token="eyJhbGciOiJIUzUxMiJ9.eyJjcmVhdGVkIjoxNzI0NjQyMTgyMDI3LCJpZCI6MTU0MjYsInR5cGUiOjEsImV4cCI6MTcyNzIzNDE4MiwiYWNjb3VudCI6Inh4eCJ9.8nWZuwfVCExzetiWTpOApb8aOp3PIpo4omHFpFHbQxWgudfG7XLa_bXenQBdjBR_20MOK4X16R-iktHa2y8BCg",t.headers&&t.isJson?t.headers["Content-Type"]=ls.JSON:t.headers&&t.isFormData?t.headers["Content-Type"]=ls.FORM_DATA:t.headers&&t.isFormUrlEncode&&(t.responseType="blob",t.headers["Content-Type"]=ls.FORM_URLENCODED),t.headers&&t.xAmzAcl&&(t.headers={"Content-Type":t.fileType,"x-amz-acl":"public-read"}),t},requestFailureFn:t=>t,responseSuccessFn:t=>t.data,responseFailureFn:t=>t}});function Vp(t,n){return za.post({url:t,data:n,isFormData:!0})}const FX={class:"rounded gap-x-0 flex flex-col w-full h-full"},HX={class:"flex items-center justify-between box-border"},WX={class:"flex-grow w-0 flex items-center mr-2"},KX={class:"flex items-center"},jX={class:"text-hy-text-main"},UX=e.createElementVNode("span",null,null,-1),YX={key:0},qX={key:1,class:"text-hy-text-secondary"},GX={class:"flex justify-between text-xs text-hy-text-main h-[34px] items-center px-2"},XX={key:0},JX={class:"text-hy-main"},ZX={key:0},QX={class:"text-hy-main"},eJ={key:0,class:"flex justify-center"},O1=e.defineComponent({__name:"index",props:{height:{default:500},columnList:{default:()=>[]},searchArr:{default:()=>[]},showIndexColumn:{type:Boolean,default:!1},defaultGetData:{type:Boolean,default:!0},selectColumnType:{default:Rn.NULL},childrenProps:{default:()=>({})},showFooter:{type:Boolean,default:!0},reqUrl:{default:"/api/data"},customUrl:{default:null},showHeader:{type:Boolean,default:()=>!0},cellStyle:{type:Function,default:()=>({})},headerCellStyle:{type:Function,default:()=>({})},disableIds:{default:()=>[]},searchForm:{default:()=>({})},searchKey:{},selectKey:{default:"id"},paginationLayout:{default:"sizes, prev, pager, next, jumper"},pagerCount:{default:7},treeProps:{default:()=>({})}},emits:["getTotal","selectionChange","onRowcClick"],setup(t,{expose:n,emit:o}){const r=t,a=o,l=e.ref(),s=e.ref({query:null,size:10,page:0}),i=e.ref({totalElements:0,number:0,totalPages:0,size:0,content:null}),c=e.ref([]);function d(){return r.selectKey}const u=e.computed(()=>{let E="";return r.searchArr.forEach(N=>{E+=`${N.label},`}),r.columnList.forEach(N=>{N.isSearch&&(E+=`${N.label},`)}),E.length===0?null:E.substring(0,E.length-1)}),f=e.computed(()=>({row:E})=>{const N=E[r.selectKey];return typeof c.value!="object"?c.value===N?"selected":"":c.value.findIndex(x=>x[r.selectKey]===E[r.selectKey])!==-1?"selected":""});async function p(E){const N={...r==null?void 0:r.searchForm,...s.value,...E,page:s.value.page!==0?s.value.page-1:0};for(const M in N)(N[M]===void 0||N[M]===null||N[M]==="")&&delete N[M];if(r.customUrl){const{data:M}=await Vp(r.customUrl,N);i.value={content:M};return}const x=r.reqUrl.replace(/^\.\/(.*)\.\w+$/,"$1").split("/"),$=x[x.length-1];if($==="findAll"){const{data:M}=await Vp(r.reqUrl,N);i.value=M;return}if($==="page"){const{data:M,code:L}=await Vp(r.reqUrl,N);if(L!==200)return;i.value=M,a("getTotal",i.value.totalElements)}}function m(E){if(r.selectColumnType===Rn.CHECKBOX)c.value=E,a("selectionChange",c.value);else if(r.selectColumnType===Rn.RADIO){const N=E[r.selectKey];c.value=c.value===N?"":N,c.value?a("selectionChange",E):a("selectionChange",null)}}function g(E){var N;(N=l.value)==null||N.clearSelection(),console.log(r.selectColumnType,Rn.RADIO,E),r.selectColumnType===Rn.RADIO?E.length?(c.value=E[0][r.selectKey],a("selectionChange",E[0])):(c.value="",a("selectionChange",null)):(c.value=E||[],E.forEach(T=>{var M,L;let x=null;const $=T[r.selectKey];$&&(x=i.value.content.find(P=>P[r.selectKey]===$)),x?(M=l.value)==null||M.toggleRowSelection(x,!0):(L=l.value)==null||L.toggleRowSelection(T,!0)})),console.log("selectedData",c.value)}function h(){var E;(E=l.value)==null||E.clearSelection()}function b(E){s.value.page=E,p()}function y(){p()}function w(E){i.value=E}function C(E){var N;r.selectColumnType===Rn.CHECKBOX?(N=l.value)==null||N.toggleRowSelection(E):r.selectColumnType===Rn.RADIO&&m(E),a("onRowcClick",E)}function k(){return{...r==null?void 0:r.searchForm,...s.value}}function _(){return i.value}function S(){return i.value.totalElements}return e.onMounted(()=>{r.selectColumnType===Rn.CHECKBOX?c.value=[]:r.selectColumnType===Rn.RADIO&&(c.value=""),r.defaultGetData&&p()}),n({getTableData:p,setSelectedData:g,clearSelection:h,selectedData:c,setTableData:w,handleCurrentChange:b,getSearchForm:k,getTableList:_,getTotalElements:S}),(E,N)=>{var V;const T=e.resolveComponent("svg-icon"),x=e.resolveComponent("el-button"),$=e.resolveComponent("el-input"),M=e.resolveComponent("el-radio"),L=e.resolveComponent("el-table-column"),P=e.resolveComponent("el-table"),I=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",FX,[e.createElementVNode("div",HX,[e.createElementVNode("div",WX,[e.renderSlot(E.$slots,"tableLeft")]),e.createElementVNode("div",KX,[e.renderSlot(E.$slots,"tableRight"),((V=e.unref(u))==null?void 0:V.length)>0?(e.openBlock(),e.createBlock($,{key:0,modelValue:e.unref(s).query,"onUpdate:modelValue":N[1]||(N[1]=B=>e.unref(s).query=B),placeholder:`输入 ${e.unref(u)} 搜索`,size:"small",clearable:"",class:"my-2 table-search-main w-[260px]",onClear:N[2]||(N[2]=B=>b(0)),onKeyup:N[3]||(N[3]=e.withKeys(B=>b(0),["enter"]))},{append:e.withCtx(()=>[e.createElementVNode("div",jX,[e.createVNode(x,{class:"!m-0 h-[28px] w-[36px] !p-[6px_0px]",onClick:N[0]||(N[0]=B=>b(0))},{default:e.withCtx(()=>[e.createVNode(T,{name:"sys-button-search",width:"14",height:"14"})]),_:1})])]),_:1},8,["modelValue","placeholder"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["flex-grow h-0",{noData:!e.unref(i).content||e.unref(i).content.length===0}])},[e.renderSlot(E.$slots,"customContent",{tableData:e.unref(i).content}),e.useSlots().customContent?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(P,e.mergeProps({key:0,ref_key:"tableRef",ref:l,style:{width:"100%"},"empty-text":"暂 无 数 据"},E.childrenProps,{"highlight-current-row":"",height:E.height,"show-header":E.showHeader,data:e.unref(i).content,"cell-style":()=>E.cellStyle,"header-cell-style":()=>E.headerCellStyle,"row-key":d(),"tree-props":E.treeProps,"row-class-name":e.unref(f),onRowClick:C,onSelectionChange:m}),{empty:e.withCtx(()=>[e.renderSlot(E.$slots,"empty")]),default:e.withCtx(()=>[E.selectColumnType===e.unref(Rn).RADIO?(e.openBlock(),e.createBlock(L,{key:0,align:"center",width:"60",label:"选择"},{default:e.withCtx(({row:B})=>[e.createVNode(M,{"model-value":e.unref(c),class:"radio",label:B[r.selectKey]},{default:e.withCtx(()=>[UX]),_:2},1032,["model-value","label"])]),_:1})):e.createCommentVNode("",!0),E.selectColumnType===e.unref(Rn).CHECKBOX?(e.openBlock(),e.createBlock(L,{key:1,type:"selection",align:"center",width:"60","reserve-selection":!0,selectable:B=>!E.disableIds.includes(B[E.selectKey])},null,8,["selectable"])):e.createCommentVNode("",!0),E.showIndexColumn?(e.openBlock(),e.createBlock(L,{key:2,type:"index",label:"序号",align:"center",width:"80"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columnList,B=>(e.openBlock(),e.createBlock(L,e.mergeProps(B,{key:B.prop,label:B.label,"header-align":B.headerAlign,align:B.align,width:B.width,"show-overflow-tooltip":""}),e.createSlots({default:e.withCtx(D=>[e.renderSlot(E.$slots,B.slotName,e.normalizeProps(e.guardReactiveProps({...D,propItem:B})),()=>[D.row[B.prop]?(e.openBlock(),e.createElementBlock("span",YX,e.toDisplayString(D.row[B.prop]),1)):(e.openBlock(),e.createElementBlock("span",qX,"--"))])]),_:2},[B.headerSlotName?{name:"header",fn:e.withCtx(D=>[e.renderSlot(E.$slots,B.headerSlotName,e.normalizeProps(e.guardReactiveProps(D)))]),key:"0"}:void 0]),1040,["label","header-align","align","width"]))),128))]),_:3},16,["height","show-header","data","cell-style","header-cell-style","row-key","tree-props","row-class-name"]))],2),e.createElementVNode("div",GX,[e.createElementVNode("div",null,[e.unref(i).content?(e.openBlock(),e.createElementBlock("div",XX,[e.createTextVNode(" 本页共有 "),e.createElementVNode("span",JX,e.toDisplayString(e.unref(i).content.length),1),e.createTextVNode(" 条数据 "),e.unref(c)&&e.unref(c).length?(e.openBlock(),e.createElementBlock("span",ZX,[e.createTextVNode(" 已选中 "),e.createElementVNode("span",QX,e.toDisplayString(e.unref(c).length),1),e.createTextVNode(" 条 ")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(E.$slots,"statisticalQuantityLeft")]),e.createElementVNode("div",null,[e.renderSlot(E.$slots,"statisticalQuantityRight")])]),E.showFooter?(e.openBlock(),e.createElementBlock("div",eJ,[e.renderSlot(E.$slots,"footer",{},()=>[e.createVNode(I,{"current-page":e.unref(s).page,"onUpdate:currentPage":N[4]||(N[4]=B=>e.unref(s).page=B),"page-size":e.unref(s).size,"onUpdate:pageSize":N[5]||(N[5]=B=>e.unref(s).size=B),class:"h-[50px]","pager-count":E.pagerCount,"hide-on-single-page":!0,"page-sizes":[15,30,50,100],layout:E.paginationLayout,total:e.unref(i).totalElements,onSizeChange:y,onCurrentChange:b},null,8,["current-page","page-size","pager-count","layout","total"])])])):e.createCommentVNode("",!0)])}}}),$1={};$1.getData=t=>new Promise((n,o)=>{let r={};tJ(t).then(a=>{r.arrayBuffer=a;try{r.orientation=aJ(a)}catch{r.orientation=-1}n(r)}).catch(a=>{o(a)})});function tJ(t){let n=null;return new Promise((o,r)=>{if(t.src)if(/^data\:/i.test(t.src))n=oJ(t.src),o(n);else if(/^blob\:/i.test(t.src)){var a=new FileReader;a.onload=function(s){n=s.target.result,o(n)},nJ(t.src,function(s){a.readAsArrayBuffer(s)})}else{var l=new XMLHttpRequest;l.onload=function(){if(this.status==200||this.status===0)n=l.response,o(n);else throw"Could not load image";l=null},l.open("GET",t.src,!0),l.responseType="arraybuffer",l.send(null)}else r("img error")})}function nJ(t,n){var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(r){(this.status==200||this.status===0)&&n(this.response)},o.send()}function oJ(t,n){n=n||t.match(/^data\:([^\;]+)\;base64,/mi)[1]||"",t=t.replace(/^data\:([^\;]+)\;base64,/gmi,"");for(var o=atob(t),r=o.length%2==0?o.length:o.length+1,a=new ArrayBuffer(r),l=new Uint16Array(a),s=0;s<r;s++)l[s]=o.charCodeAt(s);return a}function rJ(t,n,o){var r="",a;for(a=n,o+=n;a<o;a++)r+=String.fromCharCode(t.getUint8(a));return r}function aJ(t){var n=new DataView(t),o=n.byteLength,r,a,l,s,i,c,d,u,f,p;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(f=2;f<o;){if(n.getUint8(f)===255&&n.getUint8(f+1)===225){d=f;break}f++}if(d&&(a=d+4,l=d+10,rJ(n,a,4)==="Exif"&&(c=n.getUint16(l),i=c===18761,(i||c===19789)&&n.getUint16(l+2,i)===42&&(s=n.getUint32(l+4,i),s>=8&&(u=l+s)))),u){for(o=n.getUint16(u,i),p=0;p<o;p++)if(f=u+p*12+2,n.getUint16(f,i)===274){f+=8,r=n.getUint16(f,i);break}}return r}const lJ=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},sJ=e.defineComponent({data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:()=>[1,1]},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:()=>10,validator:function(t){return Array.isArray(t)?Number(t[0])>=0&&Number(t[1])>=0:Number(t)>=0}},fillColor:{type:String,default:""}},computed:{cropInfo(){let t={};if(t.top=this.cropOffsertY>21?"-21px":"0px",t.width=this.cropW>0?this.cropW:0,t.height=this.cropH>0?this.cropH:0,this.infoTrue){let n=1;this.high&&!this.full&&(n=window.devicePixelRatio),this.enlarge!==1&!this.full&&(n=Math.abs(Number(this.enlarge))),t.width=t.width*n,t.height=t.height*n,this.full&&(t.width=t.width/this.scale,t.height=t.height/this.scale)}return t.width=t.width.toFixed(0),t.height=t.height.toFixed(0),t},isIE(){return!!window.ActiveXObject||"ActiveXObject"in window},passive(){return this.isIE?null:{passive:!1}}},watch:{img(){this.checkedImg()},imgs(t){t!==""&&this.reload()},cropW(){this.showPreview()},cropH(){this.showPreview()},cropOffsertX(){this.showPreview()},cropOffsertY(){this.showPreview()},scale(t,n){this.showPreview()},x(){this.showPreview()},y(){this.showPreview()},autoCrop(t){t&&this.goAutoCrop()},autoCropWidth(){this.autoCrop&&this.goAutoCrop()},autoCropHeight(){this.autoCrop&&this.goAutoCrop()},mode(){this.checkedImg()},rotate(){this.showPreview(),this.autoCrop?this.goAutoCrop(this.cropW,this.cropH):(this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion(t){var n=navigator.userAgent.split(" "),o="";let r=0;const a=new RegExp(t,"i");for(var l=0;l<n.length;l++)a.test(n[l])&&(o=n[l]);return o?r=o.split("/")[1].split("."):r=["0","0","0"],r},checkOrientationImage(t,n,o,r){if(this.getVersion("chrome")[0]>=81)n=-1;else if(this.getVersion("safari")[0]>=605){const s=this.getVersion("version");s[0]>13&&s[1]>1&&(n=-1)}else{const s=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(s){let i=s[1];i=i.split("_"),(i[0]>13||i[0]>=13&&i[1]>=4)&&(n=-1)}}let a=document.createElement("canvas"),l=a.getContext("2d");switch(l.save(),n){case 2:a.width=o,a.height=r,l.translate(o,0),l.scale(-1,1);break;case 3:a.width=o,a.height=r,l.translate(o/2,r/2),l.rotate(180*Math.PI/180),l.translate(-o/2,-r/2);break;case 4:a.width=o,a.height=r,l.translate(0,r),l.scale(1,-1);break;case 5:a.height=o,a.width=r,l.rotate(.5*Math.PI),l.scale(1,-1);break;case 6:a.width=r,a.height=o,l.translate(r/2,o/2),l.rotate(90*Math.PI/180),l.translate(-o/2,-r/2);break;case 7:a.height=o,a.width=r,l.rotate(.5*Math.PI),l.translate(o,-r),l.scale(-1,1);break;case 8:a.height=o,a.width=r,l.translate(r/2,o/2),l.rotate(-90*Math.PI/180),l.translate(-o/2,-r/2);break;default:a.width=o,a.height=r}l.drawImage(t,0,0,o,r),l.restore(),a.toBlob(s=>{let i=URL.createObjectURL(s);URL.revokeObjectURL(this.imgs),this.imgs=i},"image/"+this.outputType,1)},checkedImg(){if(this.img===null||this.img===""){this.imgs="",this.clearCrop();return}this.loading=!0,this.scale=1,this.rotate=0,this.clearCrop();let t=new Image;if(t.onload=()=>{if(this.img==="")return this.$emit("img-load",new Error("图片不能为空")),!1;let o=t.width,r=t.height;$1.getData(t).then(a=>{this.orientation=a.orientation||1;let l=Number(this.maxImgSize);if(!this.orientation&&o<l&r<l){this.imgs=this.img;return}o>l&&(r=r/o*l,o=l),r>l&&(o=o/r*l,r=l),this.checkOrientationImage(t,this.orientation,o,r)}).catch(a=>{this.$emit("img-load","error"),this.$emit("img-load-error",a)})},t.onerror=o=>{this.$emit("img-load","error"),this.$emit("img-load-error",o)},this.img.substr(0,4)!=="data"&&(t.crossOrigin=""),this.isIE){var n=new XMLHttpRequest;n.onload=function(){var o=URL.createObjectURL(this.response);t.src=o},n.open("GET",this.img,!0),n.responseType="blob",n.send()}else t.src=this.img},startMove(t){if(t.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in t?t.clientX:t.touches[0].clientX)-this.x,this.moveY=("clientY"in t?t.clientY:t.touches[0].clientY)-this.y,t.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),t.touches.length==2&&(this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=t.offsetX?t.offsetX:t.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=t.offsetY?t.offsetY:t.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in t?t.clientX:t.touches[0].clientX,this.cropY="clientY"in t?t.clientY:t.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale(t){t.preventDefault();let n=this.scale;var o={x:this.touches[0].clientX,y:this.touches[0].clientY},r={x:t.touches[0].clientX,y:t.touches[0].clientY},a={x:this.touches[1].clientX,y:this.touches[1].clientY},l={x:t.touches[1].clientX,y:t.touches[1].clientY},s=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),i=Math.sqrt(Math.pow(r.x-l.x,2)+Math.pow(r.y-l.y,2)),c=i-s,d=1;d=d/this.trueWidth>d/this.trueHeight?d/this.trueHeight:d/this.trueWidth,d=d>.1?.1:d;var u=d*c;if(!this.touchNow){if(this.touchNow=!0,c>0?n+=Math.abs(u):c<0&&n>Math.abs(u)&&(n-=Math.abs(u)),this.touches=t.touches,setTimeout(()=>{this.touchNow=!1},8),!this.checkoutImgAxis(this.x,this.y,n))return!1;this.scale=n}},cancelTouchScale(t){window.removeEventListener("touchmove",this.touchScale)},moveImg(t){if(t.preventDefault(),t.touches&&t.touches.length===2)return this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;let n="clientX"in t?t.clientX:t.touches[0].clientX,o="clientY"in t?t.clientY:t.touches[0].clientY,r,a;r=n-this.moveX,a=o-this.moveY,this.$nextTick(()=>{if(this.centerBox){let l=this.getImgAxis(r,a,this.scale),s=this.getCropAxis(),i=this.trueHeight*this.scale,c=this.trueWidth*this.scale,d,u,f,p;switch(this.rotate){case 1:case-1:case 3:case-3:d=this.cropOffsertX-this.trueWidth*(1-this.scale)/2+(i-c)/2,u=this.cropOffsertY-this.trueHeight*(1-this.scale)/2+(c-i)/2,f=d-i+this.cropW,p=u-c+this.cropH;break;default:d=this.cropOffsertX-this.trueWidth*(1-this.scale)/2,u=this.cropOffsertY-this.trueHeight*(1-this.scale)/2,f=d-c+this.cropW,p=u-i+this.cropH;break}l.x1>=s.x1&&(r=d),l.y1>=s.y1&&(a=u),l.x2<=s.x2&&(r=f),l.y2<=s.y2&&(a=p)}this.x=r,this.y=a,this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})})},leaveImg(t){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize(t){t.preventDefault();let n=this.scale;var o=t.deltaY||t.wheelDelta,r=navigator.userAgent.indexOf("Firefox");o=r>0?o*30:o,this.isIE&&(o=-o);var a=this.coe;a=a/this.trueWidth>a/this.trueHeight?a/this.trueHeight:a/this.trueWidth;var l=a*o;l<0?n+=Math.abs(l):n>Math.abs(l)&&(n-=Math.abs(l));let s=l<0?"add":"reduce";if(s!==this.coeStatus&&(this.coeStatus=s,this.coe=.2),this.scaling||(this.scalingSet=setTimeout(()=>{this.scaling=!1,this.coe=this.coe+=.01},50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,n))return!1;this.scale=n},changeScale(t){let n=this.scale;t=t||1;var o=20;if(o=o/this.trueWidth>o/this.trueHeight?o/this.trueHeight:o/this.trueWidth,t=t*o,t>0?n+=Math.abs(t):n>Math.abs(t)&&(n-=Math.abs(t)),!this.checkoutImgAxis(this.x,this.y,n))return!1;this.scale=n},createCrop(t){t.preventDefault();var n="clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0,o="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0;this.$nextTick(()=>{var r=n-this.cropX,a=o-this.cropY;if(r>0?(this.cropW=r+this.cropChangeX>this.w?this.w-this.cropChangeX:r,this.cropOffsertX=this.cropChangeX):(this.cropW=this.w-this.cropChangeX+Math.abs(r)>this.w?this.cropChangeX:Math.abs(r),this.cropOffsertX=this.cropChangeX+r>0?this.cropChangeX+r:0),!this.fixed)a>0?(this.cropH=a+this.cropChangeY>this.h?this.h-this.cropChangeY:a,this.cropOffsertY=this.cropChangeY):(this.cropH=this.h-this.cropChangeY+Math.abs(a)>this.h?this.cropChangeY:Math.abs(a),this.cropOffsertY=this.cropChangeY+a>0?this.cropChangeY+a:0);else{var l=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];l+this.cropOffsertY>this.h?(this.cropH=this.h-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],r>0?this.cropOffsertX=this.cropChangeX:this.cropOffsertX=this.cropChangeX-this.cropW):this.cropH=l,this.cropOffsertY=this.cropOffsertY}})},changeCropSize(t,n,o,r,a){t.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=n,this.canChangeY=o,this.changeCropTypeX=r,this.changeCropTypeY=a,this.cropX="clientX"in t?t.clientX:t.touches[0].clientX,this.cropY="clientY"in t?t.clientY:t.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow(t){t.preventDefault();var n="clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0,o="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0;let r=this.w,a=this.h,l=0,s=0;if(this.centerBox){let d=this.getImgAxis(),u=d.x2,f=d.y2;l=d.x1>0?d.x1:0,s=d.y1>0?d.y1:0,r>u&&(r=u),a>f&&(a=f)}const[i,c]=this.checkCropLimitSize();this.$nextTick(()=>{var d=n-this.cropX,u=o-this.cropY;if(this.canChangeX&&(this.changeCropTypeX===1?this.cropOldW-d<i?(this.cropW=i,this.cropOffsertX=this.cropOldW+this.cropChangeX-l-i):this.cropOldW-d>0?(this.cropW=r-this.cropChangeX-d<=r-l?this.cropOldW-d:this.cropOldW+this.cropChangeX-l,this.cropOffsertX=r-this.cropChangeX-d<=r-l?this.cropChangeX+d:l):(this.cropW=Math.abs(d)+this.cropChangeX<=r?Math.abs(d)-this.cropOldW:r-this.cropOldW-this.cropChangeX,this.cropOffsertX=this.cropChangeX+this.cropOldW):this.changeCropTypeX===2&&(this.cropOldW+d<i?this.cropW=i:this.cropOldW+d>0?(this.cropW=this.cropOldW+d+this.cropOffsertX<=r?this.cropOldW+d:r-this.cropOffsertX,this.cropOffsertX=this.cropChangeX):(this.cropW=r-this.cropChangeX+Math.abs(d+this.cropOldW)<=r-l?Math.abs(d+this.cropOldW):this.cropChangeX-l,this.cropOffsertX=r-this.cropChangeX+Math.abs(d+this.cropOldW)<=r-l?this.cropChangeX-Math.abs(d+this.cropOldW):l))),this.canChangeY&&(this.changeCropTypeY===1?this.cropOldH-u<c?(this.cropH=c,this.cropOffsertY=this.cropOldH+this.cropChangeY-s-c):this.cropOldH-u>0?(this.cropH=a-this.cropChangeY-u<=a-s?this.cropOldH-u:this.cropOldH+this.cropChangeY-s,this.cropOffsertY=a-this.cropChangeY-u<=a-s?this.cropChangeY+u:s):(this.cropH=Math.abs(u)+this.cropChangeY<=a?Math.abs(u)-this.cropOldH:a-this.cropOldH-this.cropChangeY,this.cropOffsertY=this.cropChangeY+this.cropOldH):this.changeCropTypeY===2&&(this.cropOldH+u<c?this.cropH=c:this.cropOldH+u>0?(this.cropH=this.cropOldH+u+this.cropOffsertY<=a?this.cropOldH+u:a-this.cropOffsertY,this.cropOffsertY=this.cropChangeY):(this.cropH=a-this.cropChangeY+Math.abs(u+this.cropOldH)<=a-s?Math.abs(u+this.cropOldH):this.cropChangeY-s,this.cropOffsertY=a-this.cropChangeY+Math.abs(u+this.cropOldH)<=a-s?this.cropChangeY-Math.abs(u+this.cropOldH):s))),this.canChangeX&&this.fixed){var f=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];f<c?(this.cropH=c,this.cropW=this.fixedNumber[0]*c/this.fixedNumber[1],this.changeCropTypeX===1&&(this.cropOffsertX=this.cropChangeX+(this.cropOldW-this.cropW))):f+this.cropOffsertY>a?(this.cropH=a-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],this.changeCropTypeX===1&&(this.cropOffsertX=this.cropChangeX+(this.cropOldW-this.cropW))):this.cropH=f}if(this.canChangeY&&this.fixed){var p=this.cropH/this.fixedNumber[1]*this.fixedNumber[0];p<i?(this.cropW=i,this.cropH=this.fixedNumber[1]*i/this.fixedNumber[0],this.cropOffsertY=this.cropOldH+this.cropChangeY-this.cropH):p+this.cropOffsertX>r?(this.cropW=r-this.cropOffsertX,this.cropH=this.cropW/this.fixedNumber[0]*this.fixedNumber[1]):this.cropW=p}})},checkCropLimitSize(){let{cropW:t,cropH:n,limitMinSize:o}=this,r=new Array;return Array.isArray(o)?r=o:r=[o,o],t=parseFloat(r[0]),n=parseFloat(r[1]),[t,n]},changeCropEnd(t){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},calculateSize(t,n,o,r,a,l){const s=t/n;let i=a,c=l;return i<o&&(i=o,c=Math.ceil(i/s)),c<r&&(c=r,i=Math.ceil(c*s),i<o&&(i=o,c=Math.ceil(i/s))),i<a&&(i=a,c=Math.ceil(i/s)),c<l&&(c=l,i=Math.ceil(c*s)),{width:i,height:c}},endCrop(){this.cropW===0&&this.cropH===0&&(this.cropping=!1);let[t,n]=this.checkCropLimitSize();const{width:o,height:r}=this.fixed?this.calculateSize(this.fixedNumber[0],this.fixedNumber[1],t,n,this.cropW,this.cropH):{width:t,height:n};o>this.cropW&&(this.cropW=o,this.cropOffsertX+o>this.w&&(this.cropOffsertX=this.w-o)),r>this.cropH&&(this.cropH=r,this.cropOffsertY+r>this.h&&(this.cropOffsertY=this.h-r)),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop(){this.crop=!0},stopCrop(){this.crop=!1},clearCrop(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove(t){if(t.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(t),!1;if(t.touches&&t.touches.length===2)return this.crop=!1,this.startMove(t),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);let n="clientX"in t?t.clientX:t.touches[0].clientX,o="clientY"in t?t.clientY:t.touches[0].clientY,r,a;r=n-this.cropOffsertX,a=o-this.cropOffsertY,this.cropX=r,this.cropY=a,this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop(t,n){let o=0,r=0;t&&(t.preventDefault(),o="clientX"in t?t.clientX:t.touches[0].clientX,r="clientY"in t?t.clientY:t.touches[0].clientY),this.$nextTick(()=>{let a,l,s=o-this.cropX,i=r-this.cropY;if(n&&(s=this.cropOffsertX,i=this.cropOffsertY),s<=0?a=0:s+this.cropW>this.w?a=this.w-this.cropW:a=s,i<=0?l=0:i+this.cropH>this.h?l=this.h-this.cropH:l=i,this.centerBox){let c=this.getImgAxis();a<=c.x1&&(a=c.x1),a+this.cropW>c.x2&&(a=c.x2-this.cropW),l<=c.y1&&(l=c.y1),l+this.cropH>c.y2&&(l=c.y2-this.cropH)}this.cropOffsertX=a,this.cropOffsertY=l,this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})})},getImgAxis(t,n,o){t=t||this.x,n=n||this.y,o=o||this.scale;let r={x1:0,x2:0,y1:0,y2:0},a=this.trueWidth*o,l=this.trueHeight*o;switch(this.rotate){case 0:r.x1=t+this.trueWidth*(1-o)/2,r.x2=r.x1+this.trueWidth*o,r.y1=n+this.trueHeight*(1-o)/2,r.y2=r.y1+this.trueHeight*o;break;case 1:case-1:case 3:case-3:r.x1=t+this.trueWidth*(1-o)/2+(a-l)/2,r.x2=r.x1+this.trueHeight*o,r.y1=n+this.trueHeight*(1-o)/2+(l-a)/2,r.y2=r.y1+this.trueWidth*o;break;default:r.x1=t+this.trueWidth*(1-o)/2,r.x2=r.x1+this.trueWidth*o,r.y1=n+this.trueHeight*(1-o)/2,r.y2=r.y1+this.trueHeight*o;break}return r},getCropAxis(){let t={x1:0,x2:0,y1:0,y2:0};return t.x1=this.cropOffsertX,t.x2=t.x1+this.cropW,t.y1=this.cropOffsertY,t.y2=t.y1+this.cropH,t},leaveCrop(t){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked(t){let n=document.createElement("canvas"),o=new Image,r=this.rotate,a=this.trueWidth,l=this.trueHeight,s=this.cropOffsertX,i=this.cropOffsertY;o.onload=()=>{if(this.cropW!==0){let u=n.getContext("2d"),f=1;this.high&!this.full&&(f=window.devicePixelRatio),this.enlarge!==1&!this.full&&(f=Math.abs(Number(this.enlarge)));let p=this.cropW*f,m=this.cropH*f,g=a*this.scale*f,h=l*this.scale*f,b=(this.x-s+this.trueWidth*(1-this.scale)/2)*f,y=(this.y-i+this.trueHeight*(1-this.scale)/2)*f;switch(d(p,m),u.save(),this.fillColor&&(u.fillStyle=this.fillColor,u.fillRect(0,0,n.width,n.height)),r){case 0:this.full?(d(p/this.scale,m/this.scale),u.drawImage(o,b/this.scale,y/this.scale,g/this.scale,h/this.scale)):u.drawImage(o,b,y,g,h);break;case 1:case-3:this.full?(d(p/this.scale,m/this.scale),b=b/this.scale+(g/this.scale-h/this.scale)/2,y=y/this.scale+(h/this.scale-g/this.scale)/2,u.rotate(r*90*Math.PI/180),u.drawImage(o,y,-b-h/this.scale,g/this.scale,h/this.scale)):(b=b+(g-h)/2,y=y+(h-g)/2,u.rotate(r*90*Math.PI/180),u.drawImage(o,y,-b-h,g,h));break;case 2:case-2:this.full?(d(p/this.scale,m/this.scale),u.rotate(r*90*Math.PI/180),b=b/this.scale,y=y/this.scale,u.drawImage(o,-b-g/this.scale,-y-h/this.scale,g/this.scale,h/this.scale)):(u.rotate(r*90*Math.PI/180),u.drawImage(o,-b-g,-y-h,g,h));break;case 3:case-1:this.full?(d(p/this.scale,m/this.scale),b=b/this.scale+(g/this.scale-h/this.scale)/2,y=y/this.scale+(h/this.scale-g/this.scale)/2,u.rotate(r*90*Math.PI/180),u.drawImage(o,-y-g/this.scale,b,g/this.scale,h/this.scale)):(b=b+(g-h)/2,y=y+(h-g)/2,u.rotate(r*90*Math.PI/180),u.drawImage(o,-y-g,b,g,h));break;default:this.full?(d(p/this.scale,m/this.scale),u.drawImage(o,b/this.scale,y/this.scale,g/this.scale,h/this.scale)):u.drawImage(o,b,y,g,h)}u.restore()}else{let u=a*this.scale,f=l*this.scale,p=n.getContext("2d");switch(p.save(),this.fillColor&&(p.fillStyle=this.fillColor,p.fillRect(0,0,n.width,n.height)),r){case 0:d(u,f),p.drawImage(o,0,0,u,f);break;case 1:case-3:d(f,u),p.rotate(r*90*Math.PI/180),p.drawImage(o,0,-f,u,f);break;case 2:case-2:d(u,f),p.rotate(r*90*Math.PI/180),p.drawImage(o,-u,-f,u,f);break;case 3:case-1:d(f,u),p.rotate(r*90*Math.PI/180),p.drawImage(o,-u,0,u,f);break;default:d(u,f),p.drawImage(o,0,0,u,f)}p.restore()}t(n)};var c=this.img.substr(0,4);c!=="data"&&(o.crossOrigin="Anonymous"),o.src=this.imgs;function d(u,f){n.width=Math.round(u),n.height=Math.round(f)}},getCropData(t){this.getCropChecked(n=>{t(n.toDataURL("image/"+this.outputType,this.outputSize))})},getCropBlob(t){this.getCropChecked(n=>{n.toBlob(o=>t(o),"image/"+this.outputType,this.outputSize)})},showPreview(){if(this.isCanShow)this.isCanShow=!1,setTimeout(()=>{this.isCanShow=!0},16);else return!1;let t=this.cropW,n=this.cropH,o=this.scale;var r={};r.div={width:`${t}px`,height:`${n}px`};let a=(this.x-this.cropOffsertX)/o,l=(this.y-this.cropOffsertY)/o,s=0;r.w=t,r.h=n,r.url=this.imgs,r.img={width:`${this.trueWidth}px`,height:`${this.trueHeight}px`,transform:`scale(${o})translate3d(${a}px, ${l}px, ${s}px)rotateZ(${this.rotate*90}deg)`},r.html=`
|
106
106
|
<div class="show-preview" style="width: ${r.w}px; height: ${r.h}px,; overflow: hidden">
|
107
107
|
<div style="width: ${t}px; height: ${n}px">
|
108
108
|
<img src=${r.url} style="width: ${this.trueWidth}px; height: ${this.trueHeight}px; transform:
|
package/dist/index.d.ts
CHANGED
@@ -1007,6 +1007,7 @@ disableIds: () => any[];
|
|
1007
1007
|
searchForm: () => {};
|
1008
1008
|
selectKey: string;
|
1009
1009
|
paginationLayout: string;
|
1010
|
+
pagerCount: number;
|
1010
1011
|
treeProps: () => {};
|
1011
1012
|
}>, {
|
1012
1013
|
getTableData: typeof getTableData;
|
@@ -1040,6 +1041,7 @@ disableIds: () => any[];
|
|
1040
1041
|
searchForm: () => {};
|
1041
1042
|
selectKey: string;
|
1042
1043
|
paginationLayout: string;
|
1044
|
+
pagerCount: number;
|
1043
1045
|
treeProps: () => {};
|
1044
1046
|
}>>> & {
|
1045
1047
|
onGetTotal?: (...args: any[]) => any;
|
@@ -1278,6 +1280,7 @@ declare interface TableProps {
|
|
1278
1280
|
searchKey?: string;
|
1279
1281
|
selectKey?: string;
|
1280
1282
|
paginationLayout?: string;
|
1283
|
+
pagerCount?: number;
|
1281
1284
|
treeProps?: {
|
1282
1285
|
hasChildren?: string;
|
1283
1286
|
children?: string;
|