rhjy-ui 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/dist/data-center/RhDataCenter.vue.d.ts +5 -0
- package/dist/data-center/RhDataCenterPanel.vue.d.ts +5 -0
- package/dist/data-center/RhDataCenterTip.vue.d.ts +1 -1
- package/dist/data-center/constants.d.ts +1 -0
- package/dist/data-center/index.cjs +1 -1
- package/dist/data-center/index.js +233 -218
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,16 +76,19 @@ const handleTaskAction = ({ action, task }) => {
|
|
|
76
76
|
</script>
|
|
77
77
|
|
|
78
78
|
<template>
|
|
79
|
-
<RhDataCenter
|
|
80
|
-
:categories="categories"
|
|
81
|
-
:load-tasks="loadTasks"
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
<RhDataCenter
|
|
80
|
+
:categories="categories"
|
|
81
|
+
:load-tasks="loadTasks"
|
|
82
|
+
sidebar-width="160px"
|
|
83
|
+
@task-action="handleTaskAction"
|
|
84
|
+
/>
|
|
84
85
|
</template>
|
|
85
86
|
```
|
|
86
87
|
|
|
87
88
|
The “全部任务” rule is application-owned. It may omit `taskType`, pass a fixed value, or combine multiple requests without changing the component.
|
|
88
89
|
|
|
90
|
+
Use `sidebar-width` with a number or CSS size string to adjust the data type panel width. Its default value is `124px`.
|
|
91
|
+
|
|
89
92
|
Category counts are optional and application-owned. Set `show-category-count` to `false` to hide every category count, or pass `category-counts` to display values before individual categories are loaded:
|
|
90
93
|
|
|
91
94
|
```vue
|
|
@@ -34,6 +34,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
34
34
|
label?: string;
|
|
35
35
|
width?: string | number;
|
|
36
36
|
panelHeight?: string | number;
|
|
37
|
+
sidebarWidth?: string | number;
|
|
37
38
|
panelRight?: string | number;
|
|
38
39
|
pollInterval?: number;
|
|
39
40
|
refreshOnOpen?: boolean;
|
|
@@ -47,6 +48,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
47
48
|
label: string;
|
|
48
49
|
width: number;
|
|
49
50
|
panelHeight: number;
|
|
51
|
+
sidebarWidth: number;
|
|
50
52
|
panelRight: number;
|
|
51
53
|
pollInterval: number;
|
|
52
54
|
refreshOnOpen: boolean;
|
|
@@ -68,6 +70,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
68
70
|
label?: string;
|
|
69
71
|
width?: string | number;
|
|
70
72
|
panelHeight?: string | number;
|
|
73
|
+
sidebarWidth?: string | number;
|
|
71
74
|
panelRight?: string | number;
|
|
72
75
|
pollInterval?: number;
|
|
73
76
|
refreshOnOpen?: boolean;
|
|
@@ -81,6 +84,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
81
84
|
label: string;
|
|
82
85
|
width: number;
|
|
83
86
|
panelHeight: number;
|
|
87
|
+
sidebarWidth: number;
|
|
84
88
|
panelRight: number;
|
|
85
89
|
pollInterval: number;
|
|
86
90
|
refreshOnOpen: boolean;
|
|
@@ -98,6 +102,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
98
102
|
}>, {
|
|
99
103
|
label: string;
|
|
100
104
|
width: string | number;
|
|
105
|
+
sidebarWidth: string | number;
|
|
101
106
|
showCategoryCount: boolean;
|
|
102
107
|
modelValue: boolean;
|
|
103
108
|
panelHeight: string | number;
|
|
@@ -25,6 +25,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
25
25
|
categories: RhDataCenterCategory[];
|
|
26
26
|
loadTasks: RhDataCenterLoadTasks;
|
|
27
27
|
activeCategoryKey?: string | number;
|
|
28
|
+
sidebarWidth?: string | number;
|
|
28
29
|
closeable?: boolean;
|
|
29
30
|
showTotal?: boolean;
|
|
30
31
|
showCategoryCount?: boolean;
|
|
@@ -32,6 +33,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
32
33
|
recentDaysText?: string;
|
|
33
34
|
}>, {
|
|
34
35
|
activeCategoryKey: any;
|
|
36
|
+
sidebarWidth: number;
|
|
35
37
|
closeable: boolean;
|
|
36
38
|
showTotal: boolean;
|
|
37
39
|
showCategoryCount: boolean;
|
|
@@ -47,6 +49,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
47
49
|
categories: RhDataCenterCategory[];
|
|
48
50
|
loadTasks: RhDataCenterLoadTasks;
|
|
49
51
|
activeCategoryKey?: string | number;
|
|
52
|
+
sidebarWidth?: string | number;
|
|
50
53
|
closeable?: boolean;
|
|
51
54
|
showTotal?: boolean;
|
|
52
55
|
showCategoryCount?: boolean;
|
|
@@ -54,6 +57,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
54
57
|
recentDaysText?: string;
|
|
55
58
|
}>, {
|
|
56
59
|
activeCategoryKey: any;
|
|
60
|
+
sidebarWidth: number;
|
|
57
61
|
closeable: boolean;
|
|
58
62
|
showTotal: boolean;
|
|
59
63
|
showCategoryCount: boolean;
|
|
@@ -65,6 +69,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
65
69
|
onError?: (error: unknown, category: RhDataCenterCategory) => any;
|
|
66
70
|
}>, {
|
|
67
71
|
activeCategoryKey: string | number;
|
|
72
|
+
sidebarWidth: string | number;
|
|
68
73
|
closeable: boolean;
|
|
69
74
|
showTotal: boolean;
|
|
70
75
|
showCategoryCount: boolean;
|
|
@@ -43,9 +43,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
43
43
|
type: string | number;
|
|
44
44
|
title: string;
|
|
45
45
|
width: string | number;
|
|
46
|
+
content: string;
|
|
46
47
|
modelValue: boolean;
|
|
47
48
|
minutes: number;
|
|
48
|
-
content: string;
|
|
49
49
|
showGuideAnimation: boolean;
|
|
50
50
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
51
51
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
@@ -7,5 +7,6 @@ export declare const RH_DATA_CENTER_TASK_STATUS: {
|
|
|
7
7
|
export declare const RH_DATA_CENTER_DEFAULT_LABEL = "\u6570\u636E\u5904\u7406\u4E2D\u5FC3";
|
|
8
8
|
export declare const RH_DATA_CENTER_DEFAULT_WIDTH = 606;
|
|
9
9
|
export declare const RH_DATA_CENTER_DEFAULT_HEIGHT = 500;
|
|
10
|
+
export declare const RH_DATA_CENTER_DEFAULT_SIDEBAR_WIDTH = 124;
|
|
10
11
|
export declare const RH_DATA_CENTER_DEFAULT_POLL_INTERVAL = 1000;
|
|
11
12
|
export declare const RH_DATA_CENTER_RECENT_DAYS_TEXT = "-\u6B64\u5904\u4EC5\u5C55\u793A\u8FD115\u5929\u5185\u7684\u6570\u636E-";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),I=require("../_plugin-vue_export-helper-f246444f.cjs");const H={class:"rh-data-center-panel__state"},S=e.defineComponent({__name:"RhDataCenterState",props:{text:{},retryable:{type:Boolean,default:!1}},emits:["retry"],setup(t,{emit:p}){const o=p;return(s,d)=>(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("span",null,e.toDisplayString(t.text),1),t.retryable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rh-data-center-panel__retry",onClick:d[0]||(d[0]=c=>o("retry"))}," 重新加载 ")):e.createCommentVNode("",!0)]))}}),M={class:"rh-data-center-panel__task"},O={class:"rh-data-center-panel__taskMain"},F={class:"rh-data-center-panel__taskTitle"},U={key:0,class:"rh-data-center-panel__taskTag"},K={key:0,class:"rh-data-center-panel__progress"},q={class:"rh-data-center-panel__meta"},G={key:0,class:"rh-data-center-panel__actions"},W=["disabled","onClick"],j=e.defineComponent({__name:"RhDataCenterTaskItem",props:{task:{}},emits:["action"],setup(t,{emit:p}){const o=t,s=p,d=e.computed(()=>{const c=Number(o.task.progress||0);return Math.min(100,Math.max(0,c))});return(c,k)=>{var f;return e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",O,[e.createElementVNode("div",F,[e.createElementVNode("span",null,e.toDisplayString(t.task.title),1),t.task.tag?(e.openBlock(),e.createElementBlock("span",U,e.toDisplayString(t.task.tag),1)):e.createCommentVNode("",!0)]),t.task.status!=="success"?(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",{class:e.normalizeClass(["rh-data-center-panel__progressBar",{"is-failed":t.task.status==="failed"}]),style:e.normalizeStyle({width:`${d.value}%`})},null,6)])):e.createCommentVNode("",!0),e.createElementVNode("div",q,e.toDisplayString(t.task.createdAt),1),t.task.message?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["rh-data-center-panel__message",{"is-failed":t.task.status==="failed"}])},e.toDisplayString(t.task.message),3)):e.createCommentVNode("",!0)]),(f=t.task.actions)!=null&&f.length?(e.openBlock(),e.createElementBlock("div",G,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.task.actions,y=>(e.openBlock(),e.createElementBlock("button",{key:y.key,type:"button",class:"rh-data-center-panel__action",disabled:y.disabled,onClick:g=>s("action",y.key)},e.toDisplayString(y.label),9,W))),128))])):e.createCommentVNode("",!0)])}}}),X="数据处理中心",Y=606,J=500,Q=1e3,Z="-此处仅展示近15天内的数据-",ee={class:"rh-data-center-panel"},te={class:"rh-data-center-panel__sidebar"},oe=["onClick"],ne={key:0,class:"rh-data-center-panel__categoryCount"},ae={class:"rh-data-center-panel__main"},re={class:"rh-data-center-panel__title"},le={class:"rh-data-center-panel__scroll"},se={key:0,class:"rh-data-center-panel__footer"},L=e.defineComponent({__name:"RhDataCenterPanel",props:{categories:{},loadTasks:{},activeCategoryKey:{default:void 0},closeable:{type:Boolean,default:!0},showTotal:{type:Boolean,default:!0},showCategoryCount:{type:Boolean,default:!0},categoryCounts:{},recentDaysText:{default:Z}},emits:["close","refresh","task-action","error"],setup(t,{expose:p,emit:o}){const s=t,d=o,c=e.ref(s.activeCategoryKey),k=e.ref({}),f=e.ref({}),y=e.ref({}),g=e.ref({}),_=e.ref({}),u=e.computed(()=>s.categories.find(l=>l.key===c.value)||s.categories[0]),E=e.computed(()=>{var l;return String(((l=u.value)==null?void 0:l.key)??"")}),C=e.computed(()=>k.value[E.value]),R=e.computed(()=>f.value[E.value]===!0),B=e.computed(()=>y.value[E.value]),D=l=>{var n,h,T;if(!s.showCategoryCount)return;const i=String(l.key),a=(n=s.categoryCounts)==null?void 0:n[i];if(a!==void 0)return a;for(const r of Object.values(k.value)){const v=(h=r.counts)==null?void 0:h[i];if(v!==void 0)return v}return(T=k.value[i])==null?void 0:T.total},V=async(l=!1)=>{const i=u.value;if(!i)return;const a=String(i.key);if(_.value[a]&&!l)return;_.value[a]=!0,f.value[a]=!0,y.value[a]=void 0;const n=(g.value[a]||0)+1;g.value[a]=n,d("refresh",i);try{const h=await s.loadTasks({category:i});if(g.value[a]!==n||E.value!==a)return;k.value[a]=h}catch(h){if(g.value[a]!==n||E.value!==a)return;y.value[a]=h,d("error",h,i)}finally{g.value[a]===n&&(f.value[a]=!1,_.value[a]=!1)}},w=async l=>{c.value!==l.key&&(c.value=l.key,await V())},N=(l,i)=>{const a=u.value;a&&d("task-action",{action:l,task:i,category:a})};return e.onMounted(()=>{var l;c.value===void 0&&(c.value=(l=s.categories[0])==null?void 0:l.key)}),p({refresh:V}),(l,i)=>{var a;return e.openBlock(),e.createElementBlock("div",ee,[e.createElementVNode("aside",te,[i[1]||(i[1]=e.createElementVNode("div",{class:"rh-data-center-panel__title"},"数据类型",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,n=>(e.openBlock(),e.createElementBlock("button",{key:n.key,type:"button",class:e.normalizeClass(["rh-data-center-panel__category",{"is-active":c.value===n.key}]),onClick:h=>w(n)},[e.createElementVNode("span",null,e.toDisplayString(n.label),1),D(n)!==void 0?(e.openBlock(),e.createElementBlock("span",ne,e.toDisplayString(D(n)),1)):e.createCommentVNode("",!0)],10,oe))),128))]),e.createElementVNode("section",ae,[e.createElementVNode("div",re,[e.renderSlot(l.$slots,"header",{category:u.value},()=>[i[2]||(i[2]=e.createTextVNode("数据处理进度",-1))]),t.closeable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rh-data-center-panel__action",onClick:i[0]||(i[0]=n=>d("close"))},"关闭")):e.createCommentVNode("",!0)]),e.createElementVNode("div",le,[R.value&&!C.value?(e.openBlock(),e.createBlock(S,{key:0,text:"加载中..."})):B.value&&!C.value?e.renderSlot(l.$slots,"error",{key:1,error:B.value,retry:V},()=>[e.createVNode(S,{text:"任务加载失败",retryable:!0,onRetry:V})]):(a=C.value)!=null&&a.items.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(C.value.items,n=>e.renderSlot(l.$slots,"task",{key:n.id,task:n,category:u.value,action:N},()=>[e.createVNode(j,{task:n,onAction:h=>N(h,n)},null,8,["task","onAction"])])),128)):e.renderSlot(l.$slots,"empty",{key:3,category:u.value},()=>[e.createVNode(S,{text:"暂无任务"})])]),e.renderSlot(l.$slots,"footer",{result:C.value,category:u.value},()=>{var n;return[t.showTotal?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("span",null,e.toDisplayString(((n=C.value)==null?void 0:n.total)||0)+"条记录",1),e.createElementVNode("span",null,e.toDisplayString(t.recentDaysText),1)])):e.createCommentVNode("",!0)]})])])}}}),ie=t=>typeof t=="function"?t():t.value,ce=(t,p)=>{const o=s=>{const d=s.target;if(!d)return;t.some(k=>{var f;return(f=ie(k))==null?void 0:f.contains(d)})||p()};e.onMounted(()=>document.addEventListener("click",o,!0)),e.onBeforeUnmount(()=>document.removeEventListener("click",o,!0))},de=["src"],ue=e.defineComponent({__name:"RhDataCenter",props:{modelValue:{type:Boolean,default:void 0},categories:{},loadTasks:{},label:{default:X},width:{default:Y},panelHeight:{default:J},panelRight:{default:0},pollInterval:{default:Q},refreshOnOpen:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0},showCategoryCount:{type:Boolean,default:!0},categoryCounts:{},icon:{default:""},activeIcon:{default:""}},emits:["update:modelValue","open","close","refresh","task-action","error"],setup(t,{emit:p}){const o=t,s=p,d=e.ref(!1),c=e.ref(null),k=e.ref(null),f=e.ref(null),y=e.ref({}),g=e.ref(),_=e.ref(!1),u=e.computed(()=>o.modelValue===void 0?d.value:o.modelValue),E=e.computed(()=>u.value?o.activeIcon||o.icon:o.icon||o.activeIcon),C=r=>typeof r=="number"?`${r}px`:r,R=r=>typeof r=="number"?r:Number.parseFloat(r)||0,B=()=>{const r=c.value,v=k.value;if(!r||!v)return;const m=r.getBoundingClientRect(),$=v.offsetWidth||R(o.width),x=R(o.panelRight),b=8,A=m.right-$-x,P=Math.min(Math.max(b,A),Math.max(b,window.innerWidth-$-b)),z=Math.min(m.bottom+8,Math.max(b,window.innerHeight-v.offsetHeight-b));y.value={top:`${z}px`,left:`${P}px`,width:C(o.width),"--rh-ui-data-center-panel-height":C(o.panelHeight)}},D=()=>{_.value||(_.value=!0,window.addEventListener("resize",B),window.addEventListener("scroll",B,!0))},V=()=>{_.value&&(_.value=!1,window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0))},w=()=>{g.value!==void 0&&(window.clearInterval(g.value),g.value=void 0)},N=()=>{var r;(r=f.value)==null||r.refresh()},l=()=>{w(),!(!u.value||o.pollInterval<=0)&&(g.value=window.setInterval(N,o.pollInterval))},i=r=>{o.modelValue===void 0&&(d.value=r),s("update:modelValue",r)},a=()=>{u.value||(i(!0),s("open"))},n=()=>{u.value&&(i(!1),s("close"))},h=()=>u.value?n():a(),T=()=>{if(document.visibilityState==="hidden"){w();return}l(),N()};return e.watch(u,async r=>{if(w(),V(),!r){document.removeEventListener("visibilitychange",T);return}await e.nextTick(),B(),D(),document.addEventListener("visibilitychange",T),o.refreshOnOpen&&N(),l()},{immediate:!0}),ce([c,k],()=>{o.closeOnClickOutside&&u.value&&n()}),e.onBeforeUnmount(()=>{w(),V(),document.removeEventListener("visibilitychange",T)}),(r,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"triggerRef",ref:c,class:"rh-data-center",onClick:e.withModifiers(h,["stop"])},[e.renderSlot(r.$slots,"trigger",{visible:u.value,open:a,close:n,toggle:h},()=>[e.createElementVNode("span",{class:e.normalizeClass(["rh-data-center__trigger",{"is-active":u.value}])},[E.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:E.value,class:"rh-data-center__icon",alt:""},null,8,de)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],2)],!0)],512),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[u.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contentRef",ref:k,class:"rh-data-center__popover",style:e.normalizeStyle(y.value),onClick:v[3]||(v[3]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(L,{ref_key:"panelRef",ref:f,categories:t.categories,"load-tasks":t.loadTasks,closeable:!0,"show-category-count":t.showCategoryCount,"category-counts":t.categoryCounts,onClose:n,onRefresh:v[0]||(v[0]=m=>s("refresh",m)),onTaskAction:v[1]||(v[1]=m=>s("task-action",m)),onError:v[2]||(v[2]=(m,$)=>s("error",m,$))},{header:e.withCtx(m=>[e.renderSlot(r.$slots,"header",e.normalizeProps(e.guardReactiveProps(m)),()=>[v[4]||(v[4]=e.createTextVNode("数据处理进度",-1))],!0)]),task:e.withCtx(m=>[e.renderSlot(r.$slots,"task",e.normalizeProps(e.guardReactiveProps(m)),void 0,!0)]),empty:e.withCtx(m=>[e.renderSlot(r.$slots,"empty",e.normalizeProps(e.guardReactiveProps(m)),void 0,!0)]),error:e.withCtx(m=>[e.renderSlot(r.$slots,"error",e.normalizeProps(e.guardReactiveProps(m)),void 0,!0)]),footer:e.withCtx(m=>[e.renderSlot(r.$slots,"footer",e.normalizeProps(e.guardReactiveProps(m)),void 0,!0)]),_:3},8,["categories","load-tasks","show-category-count","category-counts"])],4)):e.createCommentVNode("",!0)]))],64))}});const me=I._export_sfc(ue,[["__scopeId","data-v-a3a35657"]]),ve={key:0,class:"rh-data-center-tip__guide"},pe={class:"rh-data-center-tip__content"},fe={key:0,class:"rh-data-center-tip__minutes"},ke={key:1,class:"rh-data-center-tip__description"},ye=e.defineComponent({__name:"RhDataCenterTip",props:{modelValue:{type:Boolean,default:!1},minutes:{default:void 0},type:{default:void 0},title:{default:""},content:{default:""},width:{default:"540px"},showGuideAnimation:{type:Boolean,default:!0}},emits:["update:modelValue","close"],setup(t,{emit:p}){const o=p,s=()=>{o("update:modelValue",!1),o("close")};return(d,c)=>{const k=e.resolveComponent("el-button"),f=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(f,{"model-value":t.modelValue,title:t.title||"提示",width:t.width,"append-to-body":"","onUpdate:modelValue":c[0]||(c[0]=y=>o("update:modelValue",y)),onClose:s},{footer:e.withCtx(()=>[e.createVNode(k,{type:"primary",onClick:s},{default:e.withCtx(()=>[...c[1]||(c[1]=[e.createTextVNode("关闭弹框",-1)])]),_:1})]),default:e.withCtx(()=>[t.showGuideAnimation?(e.openBlock(),e.createElementBlock("div",ve)):e.createCommentVNode("",!0),e.createElementVNode("div",pe,[t.minutes!==void 0?(e.openBlock(),e.createElementBlock("span",fe,e.toDisplayString((t.title||"任务处理中,大概需要")+t.minutes+"分钟"),1)):e.createCommentVNode("",!0),t.content?(e.openBlock(),e.createElementBlock("div",ke,e.toDisplayString(t.content),1)):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"extra")])]),_:3},8,["model-value","title","width"])}}}),he=()=>{const t=e.ref(!1),p=e.ref({});return{tipVisible:t,tipConfig:p,showTip:d=>{p.value={...d},t.value=!0},closeTip:()=>{t.value=!1}}};exports.RhDataCenter=me;exports.RhDataCenterPanel=L;exports.RhDataCenterTip=ye;exports.useRhDataCenter=he;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),H=require("../_plugin-vue_export-helper-f246444f.cjs");const M={class:"rh-data-center-panel__state"},$=e.defineComponent({__name:"RhDataCenterState",props:{text:{},retryable:{type:Boolean,default:!1}},emits:["retry"],setup(t,{emit:p}){const a=p;return(s,u)=>(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("span",null,e.toDisplayString(t.text),1),t.retryable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rh-data-center-panel__retry",onClick:u[0]||(u[0]=c=>a("retry"))}," 重新加载 ")):e.createCommentVNode("",!0)]))}}),O={class:"rh-data-center-panel__task"},F={class:"rh-data-center-panel__taskMain"},K={class:"rh-data-center-panel__taskTitle"},W={key:0,class:"rh-data-center-panel__taskTag"},U={key:0,class:"rh-data-center-panel__progress"},q={class:"rh-data-center-panel__meta"},G={key:0,class:"rh-data-center-panel__actions"},j=["disabled","onClick"],X=e.defineComponent({__name:"RhDataCenterTaskItem",props:{task:{}},emits:["action"],setup(t,{emit:p}){const a=t,s=p,u=e.computed(()=>{const c=Number(a.task.progress||0);return Math.min(100,Math.max(0,c))});return(c,y)=>{var f;return e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",F,[e.createElementVNode("div",K,[e.createElementVNode("span",null,e.toDisplayString(t.task.title),1),t.task.tag?(e.openBlock(),e.createElementBlock("span",W,e.toDisplayString(t.task.tag),1)):e.createCommentVNode("",!0)]),t.task.status!=="success"?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",{class:e.normalizeClass(["rh-data-center-panel__progressBar",{"is-failed":t.task.status==="failed"}]),style:e.normalizeStyle({width:`${u.value}%`})},null,6)])):e.createCommentVNode("",!0),e.createElementVNode("div",q,e.toDisplayString(t.task.createdAt),1),t.task.message?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["rh-data-center-panel__message",{"is-failed":t.task.status==="failed"}])},e.toDisplayString(t.task.message),3)):e.createCommentVNode("",!0)]),(f=t.task.actions)!=null&&f.length?(e.openBlock(),e.createElementBlock("div",G,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.task.actions,k=>(e.openBlock(),e.createElementBlock("button",{key:k.key,type:"button",class:"rh-data-center-panel__action",disabled:k.disabled,onClick:h=>s("action",k.key)},e.toDisplayString(k.label),9,j))),128))])):e.createCommentVNode("",!0)])}}}),Y="数据处理中心",J=606,Q=500,A=124,Z=1e3,ee="-此处仅展示近15天内的数据-",te={class:"rh-data-center-panel"},oe=["aria-pressed","onClick","onKeydown"],ne={key:0,class:"rh-data-center-panel__categoryCount"},ae={class:"rh-data-center-panel__main"},re={class:"rh-data-center-panel__title"},le={class:"rh-data-center-panel__scroll"},se={key:0,class:"rh-data-center-panel__footer"},x=e.defineComponent({__name:"RhDataCenterPanel",props:{categories:{},loadTasks:{},activeCategoryKey:{default:void 0},sidebarWidth:{default:A},closeable:{type:Boolean,default:!0},showTotal:{type:Boolean,default:!0},showCategoryCount:{type:Boolean,default:!0},categoryCounts:{},recentDaysText:{default:ee}},emits:["close","refresh","task-action","error"],setup(t,{expose:p,emit:a}){const s=t,u=a,c=e.ref(s.activeCategoryKey),y=e.ref({}),f=e.ref({}),k=e.ref({}),h=e.ref({}),C=e.ref({}),m=e.computed(()=>s.categories.find(r=>r.key===c.value)||s.categories[0]),_=e.computed(()=>{var r;return String(((r=m.value)==null?void 0:r.key)??"")}),g=e.computed(()=>y.value[_.value]),R=e.computed(()=>f.value[_.value]===!0),E=e.computed(()=>k.value[_.value]),D=r=>typeof r=="number"?`${r}px`:r,S=e.computed(()=>({width:D(s.sidebarWidth),flexBasis:D(s.sidebarWidth)})),w=r=>{var n,o,v;if(!s.showCategoryCount)return;const i=String(r.key),l=(n=s.categoryCounts)==null?void 0:n[i];if(l!==void 0)return l;for(const d of Object.values(y.value)){const b=(o=d.counts)==null?void 0:o[i];if(b!==void 0)return b}return(v=y.value[i])==null?void 0:v.total},B=async(r=!1)=>{const i=m.value;if(!i)return;const l=String(i.key);if(C.value[l]&&!r)return;C.value[l]=!0,f.value[l]=!0,k.value[l]=void 0;const n=(h.value[l]||0)+1;h.value[l]=n,u("refresh",i);try{const o=await s.loadTasks({category:i});if(h.value[l]!==n||_.value!==l)return;y.value[l]=o}catch(o){if(h.value[l]!==n||_.value!==l)return;k.value[l]=o,u("error",o,i)}finally{h.value[l]===n&&(f.value[l]=!1,C.value[l]=!1)}},V=async r=>{c.value!==r.key&&(c.value=r.key,await B())},N=(r,i)=>{const l=m.value;l&&u("task-action",{action:r,task:i,category:l})};return e.onMounted(()=>{var r;c.value===void 0&&(c.value=(r=s.categories[0])==null?void 0:r.key)}),p({refresh:B}),(r,i)=>{var l;return e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("aside",{class:"rh-data-center-panel__sidebar",style:e.normalizeStyle(S.value)},[i[1]||(i[1]=e.createElementVNode("div",{class:"rh-data-center-panel__title"},"数据类型",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,n=>(e.openBlock(),e.createElementBlock("div",{key:n.key,role:"button",tabindex:"0",class:e.normalizeClass(["rh-data-center-panel__category",{"is-active":c.value===n.key}]),"aria-pressed":c.value===n.key,onClick:o=>V(n),onKeydown:[e.withKeys(o=>V(n),["enter"]),e.withKeys(e.withModifiers(o=>V(n),["prevent"]),["space"])]},[e.createElementVNode("span",null,e.toDisplayString(n.label),1),w(n)!==void 0?(e.openBlock(),e.createElementBlock("span",ne,e.toDisplayString(w(n)),1)):e.createCommentVNode("",!0)],42,oe))),128))],4),e.createElementVNode("section",ae,[e.createElementVNode("div",re,[e.renderSlot(r.$slots,"header",{category:m.value},()=>[i[2]||(i[2]=e.createTextVNode("数据处理进度",-1))]),t.closeable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rh-data-center-panel__action",onClick:i[0]||(i[0]=n=>u("close"))},"关闭")):e.createCommentVNode("",!0)]),e.createElementVNode("div",le,[R.value&&!g.value?(e.openBlock(),e.createBlock($,{key:0,text:"加载中..."})):E.value&&!g.value?e.renderSlot(r.$slots,"error",{key:1,error:E.value,retry:B},()=>[e.createVNode($,{text:"任务加载失败",retryable:!0,onRetry:B})]):(l=g.value)!=null&&l.items.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(g.value.items,n=>e.renderSlot(r.$slots,"task",{key:n.id,task:n,category:m.value,action:N},()=>[e.createVNode(X,{task:n,onAction:o=>N(o,n)},null,8,["task","onAction"])])),128)):e.renderSlot(r.$slots,"empty",{key:3,category:m.value},()=>[e.createVNode($,{text:"暂无任务"})])]),e.renderSlot(r.$slots,"footer",{result:g.value,category:m.value},()=>{var n;return[t.showTotal?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("span",null,e.toDisplayString(((n=g.value)==null?void 0:n.total)||0)+"条记录",1),e.createElementVNode("span",null,e.toDisplayString(t.recentDaysText),1)])):e.createCommentVNode("",!0)]})])])}}}),ie=t=>typeof t=="function"?t():t.value,ce=(t,p)=>{const a=s=>{const u=s.target;if(!u)return;t.some(y=>{var f;return(f=ie(y))==null?void 0:f.contains(u)})||p()};e.onMounted(()=>document.addEventListener("click",a,!0)),e.onBeforeUnmount(()=>document.removeEventListener("click",a,!0))},de=["src"],ue=e.defineComponent({__name:"RhDataCenter",props:{modelValue:{type:Boolean,default:void 0},categories:{},loadTasks:{},label:{default:Y},width:{default:J},panelHeight:{default:Q},sidebarWidth:{default:A},panelRight:{default:0},pollInterval:{default:Z},refreshOnOpen:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0},showCategoryCount:{type:Boolean,default:!0},categoryCounts:{},icon:{default:""},activeIcon:{default:""}},emits:["update:modelValue","open","close","refresh","task-action","error"],setup(t,{emit:p}){const a=t,s=p,u=e.ref(!1),c=e.ref(null),y=e.ref(null),f=e.ref(null),k=e.ref({}),h=e.ref(),C=e.ref(!1),m=e.computed(()=>a.modelValue===void 0?u.value:a.modelValue),_=e.computed(()=>m.value?a.activeIcon||a.icon:a.icon||a.activeIcon),g=o=>typeof o=="number"?`${o}px`:o,R=o=>typeof o=="number"?o:Number.parseFloat(o)||0,E=()=>{const o=c.value,v=y.value;if(!o||!v)return;const d=o.getBoundingClientRect(),b=v.offsetWidth||R(a.width),L=R(a.panelRight),T=8,P=d.right-b-L,z=Math.min(Math.max(T,P),Math.max(T,window.innerWidth-b-T)),I=Math.min(d.bottom+8,Math.max(T,window.innerHeight-v.offsetHeight-T));k.value={top:`${I}px`,left:`${z}px`,width:g(a.width),"--rh-ui-data-center-panel-height":g(a.panelHeight)}},D=()=>{C.value||(C.value=!0,window.addEventListener("resize",E),window.addEventListener("scroll",E,!0))},S=()=>{C.value&&(C.value=!1,window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0))},w=()=>{h.value!==void 0&&(window.clearInterval(h.value),h.value=void 0)},B=()=>{var o;(o=f.value)==null||o.refresh()},V=()=>{w(),!(!m.value||a.pollInterval<=0)&&(h.value=window.setInterval(B,a.pollInterval))},N=o=>{a.modelValue===void 0&&(u.value=o),s("update:modelValue",o)},r=()=>{m.value||(N(!0),s("open"))},i=()=>{m.value&&(N(!1),s("close"))},l=()=>m.value?i():r(),n=()=>{if(document.visibilityState==="hidden"){w();return}V(),B()};return e.watch(m,async o=>{if(w(),S(),!o){document.removeEventListener("visibilitychange",n);return}await e.nextTick(),E(),D(),document.addEventListener("visibilitychange",n),a.refreshOnOpen&&B(),V()},{immediate:!0}),ce([c,y],()=>{a.closeOnClickOutside&&m.value&&i()}),e.onBeforeUnmount(()=>{w(),S(),document.removeEventListener("visibilitychange",n)}),(o,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"triggerRef",ref:c,class:"rh-data-center",onClick:e.withModifiers(l,["stop"])},[e.renderSlot(o.$slots,"trigger",{visible:m.value,open:r,close:i,toggle:l},()=>[e.createElementVNode("span",{class:e.normalizeClass(["rh-data-center__trigger",{"is-active":m.value}])},[_.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:_.value,class:"rh-data-center__icon",alt:""},null,8,de)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],2)],!0)],512),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contentRef",ref:y,class:"rh-data-center__popover",style:e.normalizeStyle(k.value),onClick:v[3]||(v[3]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(x,{ref_key:"panelRef",ref:f,categories:t.categories,"load-tasks":t.loadTasks,"sidebar-width":t.sidebarWidth,closeable:!0,"show-category-count":t.showCategoryCount,"category-counts":t.categoryCounts,onClose:i,onRefresh:v[0]||(v[0]=d=>s("refresh",d)),onTaskAction:v[1]||(v[1]=d=>s("task-action",d)),onError:v[2]||(v[2]=(d,b)=>s("error",d,b))},{header:e.withCtx(d=>[e.renderSlot(o.$slots,"header",e.normalizeProps(e.guardReactiveProps(d)),()=>[v[4]||(v[4]=e.createTextVNode("数据处理进度",-1))],!0)]),task:e.withCtx(d=>[e.renderSlot(o.$slots,"task",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),empty:e.withCtx(d=>[e.renderSlot(o.$slots,"empty",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),error:e.withCtx(d=>[e.renderSlot(o.$slots,"error",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),footer:e.withCtx(d=>[e.renderSlot(o.$slots,"footer",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),_:3},8,["categories","load-tasks","sidebar-width","show-category-count","category-counts"])],4)):e.createCommentVNode("",!0)]))],64))}});const me=H._export_sfc(ue,[["__scopeId","data-v-47bfdbe2"]]),ve={key:0,class:"rh-data-center-tip__guide"},pe={class:"rh-data-center-tip__content"},fe={key:0,class:"rh-data-center-tip__minutes"},ye={key:1,class:"rh-data-center-tip__description"},ke=e.defineComponent({__name:"RhDataCenterTip",props:{modelValue:{type:Boolean,default:!1},minutes:{default:void 0},type:{default:void 0},title:{default:""},content:{default:""},width:{default:"540px"},showGuideAnimation:{type:Boolean,default:!0}},emits:["update:modelValue","close"],setup(t,{emit:p}){const a=p,s=()=>{a("update:modelValue",!1),a("close")};return(u,c)=>{const y=e.resolveComponent("el-button"),f=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(f,{"model-value":t.modelValue,title:t.title||"提示",width:t.width,"append-to-body":"","onUpdate:modelValue":c[0]||(c[0]=k=>a("update:modelValue",k)),onClose:s},{footer:e.withCtx(()=>[e.createVNode(y,{type:"primary",onClick:s},{default:e.withCtx(()=>[...c[1]||(c[1]=[e.createTextVNode("关闭弹框",-1)])]),_:1})]),default:e.withCtx(()=>[t.showGuideAnimation?(e.openBlock(),e.createElementBlock("div",ve)):e.createCommentVNode("",!0),e.createElementVNode("div",pe,[t.minutes!==void 0?(e.openBlock(),e.createElementBlock("span",fe,e.toDisplayString((t.title||"任务处理中,大概需要")+t.minutes+"分钟"),1)):e.createCommentVNode("",!0),t.content?(e.openBlock(),e.createElementBlock("div",ye,e.toDisplayString(t.content),1)):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"extra")])]),_:3},8,["model-value","title","width"])}}}),he=()=>{const t=e.ref(!1),p=e.ref({});return{tipVisible:t,tipConfig:p,showTip:u=>{p.value={...u},t.value=!0},closeTip:()=>{t.value=!1}}};exports.RhDataCenter=me;exports.RhDataCenterPanel=x;exports.RhDataCenterTip=ke;exports.useRhDataCenter=he;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as M, openBlock as
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as M, openBlock as r, createElementBlock as u, createElementVNode as h, toDisplayString as C, createCommentVNode as b, computed as E, normalizeClass as F, normalizeStyle as X, Fragment as U, renderList as j, ref as m, onMounted as ee, withKeys as Q, withModifiers as q, renderSlot as w, createTextVNode as Y, createBlock as J, createVNode as O, onBeforeUnmount as te, watch as re, nextTick as ie, Teleport as ue, withCtx as V, normalizeProps as H, guardReactiveProps as S, resolveComponent as Z } from "vue";
|
|
2
|
+
import { _ as ce } from "../_plugin-vue_export-helper-dad06003.js";
|
|
3
|
+
const de = { class: "rh-data-center-panel__state" }, G = /* @__PURE__ */ M({
|
|
4
4
|
__name: "RhDataCenterState",
|
|
5
5
|
props: {
|
|
6
6
|
text: {},
|
|
@@ -8,73 +8,73 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ M({
|
|
|
8
8
|
},
|
|
9
9
|
emits: ["retry"],
|
|
10
10
|
setup(e, { emit: p }) {
|
|
11
|
-
const
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
e.retryable ? (
|
|
11
|
+
const n = p;
|
|
12
|
+
return (l, v) => (r(), u("div", de, [
|
|
13
|
+
h("span", null, C(e.text), 1),
|
|
14
|
+
e.retryable ? (r(), u("button", {
|
|
15
15
|
key: 0,
|
|
16
16
|
type: "button",
|
|
17
17
|
class: "rh-data-center-panel__retry",
|
|
18
|
-
onClick:
|
|
18
|
+
onClick: v[0] || (v[0] = (c) => n("retry"))
|
|
19
19
|
}, " 重新加载 ")) : b("", !0)
|
|
20
20
|
]));
|
|
21
21
|
}
|
|
22
|
-
}),
|
|
22
|
+
}), ve = { class: "rh-data-center-panel__task" }, fe = { class: "rh-data-center-panel__taskMain" }, he = { class: "rh-data-center-panel__taskTitle" }, ye = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "rh-data-center-panel__taskTag"
|
|
25
|
-
},
|
|
25
|
+
}, me = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "rh-data-center-panel__progress"
|
|
28
|
-
},
|
|
28
|
+
}, pe = { class: "rh-data-center-panel__meta" }, ge = {
|
|
29
29
|
key: 0,
|
|
30
30
|
class: "rh-data-center-panel__actions"
|
|
31
|
-
},
|
|
31
|
+
}, ke = ["disabled", "onClick"], _e = /* @__PURE__ */ M({
|
|
32
32
|
__name: "RhDataCenterTaskItem",
|
|
33
33
|
props: {
|
|
34
34
|
task: {}
|
|
35
35
|
},
|
|
36
36
|
emits: ["action"],
|
|
37
37
|
setup(e, { emit: p }) {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
return Math.min(100, Math.max(0,
|
|
38
|
+
const n = e, l = p, v = E(() => {
|
|
39
|
+
const c = Number(n.task.progress || 0);
|
|
40
|
+
return Math.min(100, Math.max(0, c));
|
|
41
41
|
});
|
|
42
|
-
return (
|
|
42
|
+
return (c, k) => {
|
|
43
43
|
var g;
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
e.task.tag ? (
|
|
44
|
+
return r(), u("div", ve, [
|
|
45
|
+
h("div", fe, [
|
|
46
|
+
h("div", he, [
|
|
47
|
+
h("span", null, C(e.task.title), 1),
|
|
48
|
+
e.task.tag ? (r(), u("span", ye, C(e.task.tag), 1)) : b("", !0)
|
|
49
49
|
]),
|
|
50
|
-
e.task.status !== "success" ? (
|
|
51
|
-
|
|
52
|
-
class:
|
|
53
|
-
style:
|
|
50
|
+
e.task.status !== "success" ? (r(), u("div", me, [
|
|
51
|
+
h("div", {
|
|
52
|
+
class: F(["rh-data-center-panel__progressBar", { "is-failed": e.task.status === "failed" }]),
|
|
53
|
+
style: X({ width: `${v.value}%` })
|
|
54
54
|
}, null, 6)
|
|
55
55
|
])) : b("", !0),
|
|
56
|
-
|
|
57
|
-
e.task.message ? (
|
|
56
|
+
h("div", pe, C(e.task.createdAt), 1),
|
|
57
|
+
e.task.message ? (r(), u("div", {
|
|
58
58
|
key: 1,
|
|
59
|
-
class:
|
|
60
|
-
},
|
|
59
|
+
class: F(["rh-data-center-panel__message", { "is-failed": e.task.status === "failed" }])
|
|
60
|
+
}, C(e.task.message), 3)) : b("", !0)
|
|
61
61
|
]),
|
|
62
|
-
(g = e.task.actions) != null && g.length ? (
|
|
63
|
-
(
|
|
62
|
+
(g = e.task.actions) != null && g.length ? (r(), u("div", ge, [
|
|
63
|
+
(r(!0), u(U, null, j(e.task.actions, (_) => (r(), u("button", {
|
|
64
64
|
key: _.key,
|
|
65
65
|
type: "button",
|
|
66
66
|
class: "rh-data-center-panel__action",
|
|
67
67
|
disabled: _.disabled,
|
|
68
|
-
onClick: (
|
|
69
|
-
},
|
|
68
|
+
onClick: (T) => l("action", _.key)
|
|
69
|
+
}, C(_.label), 9, ke))), 128))
|
|
70
70
|
])) : b("", !0)
|
|
71
71
|
]);
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
}),
|
|
74
|
+
}), Ce = "数据处理中心", be = 606, we = 500, ae = 124, Te = 1e3, $e = "-此处仅展示近15天内的数据-", Ee = { class: "rh-data-center-panel" }, Re = ["aria-pressed", "onClick", "onKeydown"], Ae = {
|
|
75
75
|
key: 0,
|
|
76
76
|
class: "rh-data-center-panel__categoryCount"
|
|
77
|
-
},
|
|
77
|
+
}, De = { class: "rh-data-center-panel__main" }, Le = { class: "rh-data-center-panel__title" }, Ve = { class: "rh-data-center-panel__scroll" }, xe = {
|
|
78
78
|
key: 0,
|
|
79
79
|
class: "rh-data-center-panel__footer"
|
|
80
80
|
}, Be = /* @__PURE__ */ M({
|
|
@@ -83,130 +83,143 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ M({
|
|
|
83
83
|
categories: {},
|
|
84
84
|
loadTasks: {},
|
|
85
85
|
activeCategoryKey: { default: void 0 },
|
|
86
|
+
sidebarWidth: { default: ae },
|
|
86
87
|
closeable: { type: Boolean, default: !0 },
|
|
87
88
|
showTotal: { type: Boolean, default: !0 },
|
|
88
89
|
showCategoryCount: { type: Boolean, default: !0 },
|
|
89
90
|
categoryCounts: {},
|
|
90
|
-
recentDaysText: { default:
|
|
91
|
+
recentDaysText: { default: $e }
|
|
91
92
|
},
|
|
92
93
|
emits: ["close", "refresh", "task-action", "error"],
|
|
93
|
-
setup(e, { expose: p, emit:
|
|
94
|
-
const
|
|
94
|
+
setup(e, { expose: p, emit: n }) {
|
|
95
|
+
const l = e, v = n, c = m(l.activeCategoryKey), k = m({}), g = m({}), _ = m({}), T = m({}), R = m({}), f = E(() => l.categories.find((s) => s.key === c.value) || l.categories[0]), A = E(() => {
|
|
95
96
|
var s;
|
|
96
|
-
return String(((s =
|
|
97
|
-
}),
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
return String(((s = f.value) == null ? void 0 : s.key) ?? "");
|
|
98
|
+
}), $ = E(() => k.value[A.value]), K = E(() => g.value[A.value] === !0), D = E(() => _.value[A.value]), W = (s) => typeof s == "number" ? `${s}px` : s, z = E(() => ({
|
|
99
|
+
width: W(l.sidebarWidth),
|
|
100
|
+
flexBasis: W(l.sidebarWidth)
|
|
101
|
+
})), x = (s) => {
|
|
102
|
+
var a, t, y;
|
|
103
|
+
if (!l.showCategoryCount)
|
|
100
104
|
return;
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
return
|
|
104
|
-
for (const
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
return
|
|
105
|
+
const i = String(s.key), o = (a = l.categoryCounts) == null ? void 0 : a[i];
|
|
106
|
+
if (o !== void 0)
|
|
107
|
+
return o;
|
|
108
|
+
for (const d of Object.values(k.value)) {
|
|
109
|
+
const B = (t = d.counts) == null ? void 0 : t[i];
|
|
110
|
+
if (B !== void 0)
|
|
111
|
+
return B;
|
|
108
112
|
}
|
|
109
|
-
return (
|
|
110
|
-
},
|
|
111
|
-
const
|
|
112
|
-
if (!
|
|
113
|
+
return (y = k.value[i]) == null ? void 0 : y.total;
|
|
114
|
+
}, L = async (s = !1) => {
|
|
115
|
+
const i = f.value;
|
|
116
|
+
if (!i)
|
|
113
117
|
return;
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
118
|
+
const o = String(i.key);
|
|
119
|
+
if (R.value[o] && !s)
|
|
116
120
|
return;
|
|
117
|
-
|
|
118
|
-
const a = (
|
|
119
|
-
|
|
121
|
+
R.value[o] = !0, g.value[o] = !0, _.value[o] = void 0;
|
|
122
|
+
const a = (T.value[o] || 0) + 1;
|
|
123
|
+
T.value[o] = a, v("refresh", i);
|
|
120
124
|
try {
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
125
|
+
const t = await l.loadTasks({ category: i });
|
|
126
|
+
if (T.value[o] !== a || A.value !== o)
|
|
123
127
|
return;
|
|
124
|
-
k.value[
|
|
125
|
-
} catch (
|
|
126
|
-
if (
|
|
128
|
+
k.value[o] = t;
|
|
129
|
+
} catch (t) {
|
|
130
|
+
if (T.value[o] !== a || A.value !== o)
|
|
127
131
|
return;
|
|
128
|
-
_.value[
|
|
132
|
+
_.value[o] = t, v("error", t, i);
|
|
129
133
|
} finally {
|
|
130
|
-
|
|
134
|
+
T.value[o] === a && (g.value[o] = !1, R.value[o] = !1);
|
|
131
135
|
}
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
const
|
|
136
|
-
|
|
136
|
+
}, I = async (s) => {
|
|
137
|
+
c.value !== s.key && (c.value = s.key, await L());
|
|
138
|
+
}, N = (s, i) => {
|
|
139
|
+
const o = f.value;
|
|
140
|
+
o && v("task-action", { action: s, task: i, category: o });
|
|
137
141
|
};
|
|
138
|
-
return
|
|
142
|
+
return ee(() => {
|
|
139
143
|
var s;
|
|
140
|
-
|
|
144
|
+
c.value === void 0 && (c.value = (s = l.categories[0]) == null ? void 0 : s.key);
|
|
141
145
|
}), p({
|
|
142
|
-
refresh:
|
|
143
|
-
}), (s,
|
|
144
|
-
var
|
|
145
|
-
return
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
refresh: L
|
|
147
|
+
}), (s, i) => {
|
|
148
|
+
var o;
|
|
149
|
+
return r(), u("div", Ee, [
|
|
150
|
+
h("aside", {
|
|
151
|
+
class: "rh-data-center-panel__sidebar",
|
|
152
|
+
style: X(z.value)
|
|
153
|
+
}, [
|
|
154
|
+
i[1] || (i[1] = h("div", { class: "rh-data-center-panel__title" }, "数据类型", -1)),
|
|
155
|
+
(r(!0), u(U, null, j(e.categories, (a) => (r(), u("div", {
|
|
149
156
|
key: a.key,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
157
|
+
role: "button",
|
|
158
|
+
tabindex: "0",
|
|
159
|
+
class: F(["rh-data-center-panel__category", { "is-active": c.value === a.key }]),
|
|
160
|
+
"aria-pressed": c.value === a.key,
|
|
161
|
+
onClick: (t) => I(a),
|
|
162
|
+
onKeydown: [
|
|
163
|
+
Q((t) => I(a), ["enter"]),
|
|
164
|
+
Q(q((t) => I(a), ["prevent"]), ["space"])
|
|
165
|
+
]
|
|
153
166
|
}, [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
],
|
|
157
|
-
]),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
167
|
+
h("span", null, C(a.label), 1),
|
|
168
|
+
x(a) !== void 0 ? (r(), u("span", Ae, C(x(a)), 1)) : b("", !0)
|
|
169
|
+
], 42, Re))), 128))
|
|
170
|
+
], 4),
|
|
171
|
+
h("section", De, [
|
|
172
|
+
h("div", Le, [
|
|
173
|
+
w(s.$slots, "header", { category: f.value }, () => [
|
|
174
|
+
i[2] || (i[2] = Y("数据处理进度", -1))
|
|
162
175
|
]),
|
|
163
|
-
e.closeable ? (
|
|
176
|
+
e.closeable ? (r(), u("button", {
|
|
164
177
|
key: 0,
|
|
165
178
|
type: "button",
|
|
166
179
|
class: "rh-data-center-panel__action",
|
|
167
|
-
onClick:
|
|
180
|
+
onClick: i[0] || (i[0] = (a) => v("close"))
|
|
168
181
|
}, "关闭")) : b("", !0)
|
|
169
182
|
]),
|
|
170
|
-
|
|
171
|
-
|
|
183
|
+
h("div", Ve, [
|
|
184
|
+
K.value && !$.value ? (r(), J(G, {
|
|
172
185
|
key: 0,
|
|
173
186
|
text: "加载中..."
|
|
174
|
-
})) : D.value &&
|
|
187
|
+
})) : D.value && !$.value ? w(s.$slots, "error", {
|
|
175
188
|
key: 1,
|
|
176
189
|
error: D.value,
|
|
177
|
-
retry:
|
|
190
|
+
retry: L
|
|
178
191
|
}, () => [
|
|
179
|
-
|
|
192
|
+
O(G, {
|
|
180
193
|
text: "任务加载失败",
|
|
181
194
|
retryable: !0,
|
|
182
|
-
onRetry:
|
|
195
|
+
onRetry: L
|
|
183
196
|
})
|
|
184
|
-
]) : (
|
|
197
|
+
]) : (o = $.value) != null && o.items.length ? (r(!0), u(U, { key: 2 }, j($.value.items, (a) => w(s.$slots, "task", {
|
|
185
198
|
key: a.id,
|
|
186
199
|
task: a,
|
|
187
|
-
category:
|
|
188
|
-
action:
|
|
200
|
+
category: f.value,
|
|
201
|
+
action: N
|
|
189
202
|
}, () => [
|
|
190
|
-
|
|
203
|
+
O(_e, {
|
|
191
204
|
task: a,
|
|
192
|
-
onAction: (
|
|
205
|
+
onAction: (t) => N(t, a)
|
|
193
206
|
}, null, 8, ["task", "onAction"])
|
|
194
|
-
])), 128)) :
|
|
207
|
+
])), 128)) : w(s.$slots, "empty", {
|
|
195
208
|
key: 3,
|
|
196
|
-
category:
|
|
209
|
+
category: f.value
|
|
197
210
|
}, () => [
|
|
198
|
-
|
|
211
|
+
O(G, { text: "暂无任务" })
|
|
199
212
|
])
|
|
200
213
|
]),
|
|
201
|
-
|
|
202
|
-
result:
|
|
203
|
-
category:
|
|
214
|
+
w(s.$slots, "footer", {
|
|
215
|
+
result: $.value,
|
|
216
|
+
category: f.value
|
|
204
217
|
}, () => {
|
|
205
218
|
var a;
|
|
206
219
|
return [
|
|
207
|
-
e.showTotal ? (
|
|
208
|
-
|
|
209
|
-
|
|
220
|
+
e.showTotal ? (r(), u("div", xe, [
|
|
221
|
+
h("span", null, C(((a = $.value) == null ? void 0 : a.total) || 0) + "条记录", 1),
|
|
222
|
+
h("span", null, C(e.recentDaysText), 1)
|
|
210
223
|
])) : b("", !0)
|
|
211
224
|
];
|
|
212
225
|
})
|
|
@@ -214,28 +227,29 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ M({
|
|
|
214
227
|
]);
|
|
215
228
|
};
|
|
216
229
|
}
|
|
217
|
-
}),
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
if (!
|
|
230
|
+
}), Ie = (e) => typeof e == "function" ? e() : e.value, Ne = (e, p) => {
|
|
231
|
+
const n = (l) => {
|
|
232
|
+
const v = l.target;
|
|
233
|
+
if (!v)
|
|
221
234
|
return;
|
|
222
235
|
e.some((k) => {
|
|
223
236
|
var g;
|
|
224
|
-
return (g =
|
|
237
|
+
return (g = Ie(k)) == null ? void 0 : g.contains(v);
|
|
225
238
|
}) || p();
|
|
226
239
|
};
|
|
227
|
-
|
|
228
|
-
},
|
|
240
|
+
ee(() => document.addEventListener("click", n, !0)), te(() => document.removeEventListener("click", n, !0));
|
|
241
|
+
}, Pe = ["src"], He = /* @__PURE__ */ M({
|
|
229
242
|
__name: "RhDataCenter",
|
|
230
243
|
props: {
|
|
231
244
|
modelValue: { type: Boolean, default: void 0 },
|
|
232
245
|
categories: {},
|
|
233
246
|
loadTasks: {},
|
|
234
|
-
label: { default:
|
|
235
|
-
width: { default:
|
|
236
|
-
panelHeight: { default:
|
|
247
|
+
label: { default: Ce },
|
|
248
|
+
width: { default: be },
|
|
249
|
+
panelHeight: { default: we },
|
|
250
|
+
sidebarWidth: { default: ae },
|
|
237
251
|
panelRight: { default: 0 },
|
|
238
|
-
pollInterval: { default:
|
|
252
|
+
pollInterval: { default: Te },
|
|
239
253
|
refreshOnOpen: { type: Boolean, default: !0 },
|
|
240
254
|
closeOnClickOutside: { type: Boolean, default: !0 },
|
|
241
255
|
showCategoryCount: { type: Boolean, default: !0 },
|
|
@@ -245,137 +259,138 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ M({
|
|
|
245
259
|
},
|
|
246
260
|
emits: ["update:modelValue", "open", "close", "refresh", "task-action", "error"],
|
|
247
261
|
setup(e, { emit: p }) {
|
|
248
|
-
const
|
|
249
|
-
const
|
|
250
|
-
if (!
|
|
262
|
+
const n = e, l = p, v = m(!1), c = m(null), k = m(null), g = m(null), _ = m({}), T = m(), R = m(!1), f = E(() => n.modelValue === void 0 ? v.value : n.modelValue), A = E(() => f.value ? n.activeIcon || n.icon : n.icon || n.activeIcon), $ = (t) => typeof t == "number" ? `${t}px` : t, K = (t) => typeof t == "number" ? t : Number.parseFloat(t) || 0, D = () => {
|
|
263
|
+
const t = c.value, y = k.value;
|
|
264
|
+
if (!t || !y)
|
|
251
265
|
return;
|
|
252
|
-
const
|
|
253
|
-
Math.max(
|
|
254
|
-
Math.max(
|
|
255
|
-
),
|
|
256
|
-
|
|
257
|
-
Math.max(
|
|
266
|
+
const d = t.getBoundingClientRect(), B = y.offsetWidth || K(n.width), ne = K(n.panelRight), P = 8, se = d.right - B - ne, oe = Math.min(
|
|
267
|
+
Math.max(P, se),
|
|
268
|
+
Math.max(P, window.innerWidth - B - P)
|
|
269
|
+
), le = Math.min(
|
|
270
|
+
d.bottom + 8,
|
|
271
|
+
Math.max(P, window.innerHeight - y.offsetHeight - P)
|
|
258
272
|
);
|
|
259
273
|
_.value = {
|
|
260
|
-
top: `${
|
|
261
|
-
left: `${
|
|
262
|
-
width:
|
|
263
|
-
"--rh-ui-data-center-panel-height":
|
|
274
|
+
top: `${le}px`,
|
|
275
|
+
left: `${oe}px`,
|
|
276
|
+
width: $(n.width),
|
|
277
|
+
"--rh-ui-data-center-panel-height": $(n.panelHeight)
|
|
264
278
|
};
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
},
|
|
268
|
-
|
|
279
|
+
}, W = () => {
|
|
280
|
+
R.value || (R.value = !0, window.addEventListener("resize", D), window.addEventListener("scroll", D, !0));
|
|
281
|
+
}, z = () => {
|
|
282
|
+
R.value && (R.value = !1, window.removeEventListener("resize", D), window.removeEventListener("scroll", D, !0));
|
|
269
283
|
}, x = () => {
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
var
|
|
273
|
-
(
|
|
284
|
+
T.value !== void 0 && (window.clearInterval(T.value), T.value = void 0);
|
|
285
|
+
}, L = () => {
|
|
286
|
+
var t;
|
|
287
|
+
(t = g.value) == null || t.refresh();
|
|
288
|
+
}, I = () => {
|
|
289
|
+
x(), !(!f.value || n.pollInterval <= 0) && (T.value = window.setInterval(L, n.pollInterval));
|
|
290
|
+
}, N = (t) => {
|
|
291
|
+
n.modelValue === void 0 && (v.value = t), l("update:modelValue", t);
|
|
274
292
|
}, s = () => {
|
|
275
|
-
|
|
276
|
-
},
|
|
277
|
-
|
|
278
|
-
},
|
|
279
|
-
v.value || (c(!0), r("open"));
|
|
280
|
-
}, a = () => {
|
|
281
|
-
v.value && (c(!1), r("close"));
|
|
282
|
-
}, C = () => v.value ? a() : n(), I = () => {
|
|
293
|
+
f.value || (N(!0), l("open"));
|
|
294
|
+
}, i = () => {
|
|
295
|
+
f.value && (N(!1), l("close"));
|
|
296
|
+
}, o = () => f.value ? i() : s(), a = () => {
|
|
283
297
|
if (document.visibilityState === "hidden") {
|
|
284
298
|
x();
|
|
285
299
|
return;
|
|
286
300
|
}
|
|
287
|
-
|
|
301
|
+
I(), L();
|
|
288
302
|
};
|
|
289
|
-
return
|
|
290
|
-
if (x(),
|
|
291
|
-
document.removeEventListener("visibilitychange",
|
|
303
|
+
return re(f, async (t) => {
|
|
304
|
+
if (x(), z(), !t) {
|
|
305
|
+
document.removeEventListener("visibilitychange", a);
|
|
292
306
|
return;
|
|
293
307
|
}
|
|
294
|
-
await
|
|
295
|
-
}, { immediate: !0 }),
|
|
296
|
-
|
|
297
|
-
}),
|
|
298
|
-
x(),
|
|
299
|
-
}), (
|
|
300
|
-
|
|
308
|
+
await ie(), D(), W(), document.addEventListener("visibilitychange", a), n.refreshOnOpen && L(), I();
|
|
309
|
+
}, { immediate: !0 }), Ne([c, k], () => {
|
|
310
|
+
n.closeOnClickOutside && f.value && i();
|
|
311
|
+
}), te(() => {
|
|
312
|
+
x(), z(), document.removeEventListener("visibilitychange", a);
|
|
313
|
+
}), (t, y) => (r(), u(U, null, [
|
|
314
|
+
h("div", {
|
|
301
315
|
ref_key: "triggerRef",
|
|
302
|
-
ref:
|
|
316
|
+
ref: c,
|
|
303
317
|
class: "rh-data-center",
|
|
304
|
-
onClick:
|
|
318
|
+
onClick: q(o, ["stop"])
|
|
305
319
|
}, [
|
|
306
|
-
|
|
307
|
-
visible:
|
|
308
|
-
open:
|
|
309
|
-
close:
|
|
310
|
-
toggle:
|
|
320
|
+
w(t.$slots, "trigger", {
|
|
321
|
+
visible: f.value,
|
|
322
|
+
open: s,
|
|
323
|
+
close: i,
|
|
324
|
+
toggle: o
|
|
311
325
|
}, () => [
|
|
312
|
-
|
|
313
|
-
class:
|
|
326
|
+
h("span", {
|
|
327
|
+
class: F(["rh-data-center__trigger", { "is-active": f.value }])
|
|
314
328
|
}, [
|
|
315
|
-
A.value ? (
|
|
329
|
+
A.value ? (r(), u("img", {
|
|
316
330
|
key: 0,
|
|
317
331
|
src: A.value,
|
|
318
332
|
class: "rh-data-center__icon",
|
|
319
333
|
alt: ""
|
|
320
|
-
}, null, 8,
|
|
321
|
-
|
|
334
|
+
}, null, 8, Pe)) : b("", !0),
|
|
335
|
+
h("span", null, C(e.label), 1)
|
|
322
336
|
], 2)
|
|
323
337
|
], !0)
|
|
324
338
|
], 512),
|
|
325
|
-
(
|
|
326
|
-
|
|
339
|
+
(r(), J(ue, { to: "body" }, [
|
|
340
|
+
f.value ? (r(), u("div", {
|
|
327
341
|
key: 0,
|
|
328
342
|
ref_key: "contentRef",
|
|
329
343
|
ref: k,
|
|
330
344
|
class: "rh-data-center__popover",
|
|
331
|
-
style:
|
|
332
|
-
onClick:
|
|
345
|
+
style: X(_.value),
|
|
346
|
+
onClick: y[3] || (y[3] = q(() => {
|
|
333
347
|
}, ["stop"]))
|
|
334
348
|
}, [
|
|
335
|
-
|
|
349
|
+
O(Be, {
|
|
336
350
|
ref_key: "panelRef",
|
|
337
351
|
ref: g,
|
|
338
352
|
categories: e.categories,
|
|
339
353
|
"load-tasks": e.loadTasks,
|
|
354
|
+
"sidebar-width": e.sidebarWidth,
|
|
340
355
|
closeable: !0,
|
|
341
356
|
"show-category-count": e.showCategoryCount,
|
|
342
357
|
"category-counts": e.categoryCounts,
|
|
343
|
-
onClose:
|
|
344
|
-
onRefresh:
|
|
345
|
-
onTaskAction:
|
|
346
|
-
onError:
|
|
358
|
+
onClose: i,
|
|
359
|
+
onRefresh: y[0] || (y[0] = (d) => l("refresh", d)),
|
|
360
|
+
onTaskAction: y[1] || (y[1] = (d) => l("task-action", d)),
|
|
361
|
+
onError: y[2] || (y[2] = (d, B) => l("error", d, B))
|
|
347
362
|
}, {
|
|
348
|
-
header: V((
|
|
349
|
-
|
|
350
|
-
|
|
363
|
+
header: V((d) => [
|
|
364
|
+
w(t.$slots, "header", H(S(d)), () => [
|
|
365
|
+
y[4] || (y[4] = Y("数据处理进度", -1))
|
|
351
366
|
], !0)
|
|
352
367
|
]),
|
|
353
|
-
task: V((
|
|
354
|
-
|
|
368
|
+
task: V((d) => [
|
|
369
|
+
w(t.$slots, "task", H(S(d)), void 0, !0)
|
|
355
370
|
]),
|
|
356
|
-
empty: V((
|
|
357
|
-
|
|
371
|
+
empty: V((d) => [
|
|
372
|
+
w(t.$slots, "empty", H(S(d)), void 0, !0)
|
|
358
373
|
]),
|
|
359
|
-
error: V((
|
|
360
|
-
|
|
374
|
+
error: V((d) => [
|
|
375
|
+
w(t.$slots, "error", H(S(d)), void 0, !0)
|
|
361
376
|
]),
|
|
362
|
-
footer: V((
|
|
363
|
-
|
|
377
|
+
footer: V((d) => [
|
|
378
|
+
w(t.$slots, "footer", H(S(d)), void 0, !0)
|
|
364
379
|
]),
|
|
365
380
|
_: 3
|
|
366
|
-
}, 8, ["categories", "load-tasks", "show-category-count", "category-counts"])
|
|
381
|
+
}, 8, ["categories", "load-tasks", "sidebar-width", "show-category-count", "category-counts"])
|
|
367
382
|
], 4)) : b("", !0)
|
|
368
383
|
]))
|
|
369
384
|
], 64));
|
|
370
385
|
}
|
|
371
386
|
});
|
|
372
|
-
const
|
|
387
|
+
const Fe = /* @__PURE__ */ ce(He, [["__scopeId", "data-v-47bfdbe2"]]), Se = {
|
|
373
388
|
key: 0,
|
|
374
389
|
class: "rh-data-center-tip__guide"
|
|
375
|
-
}, Oe = { class: "rh-data-center-tip__content" },
|
|
390
|
+
}, Oe = { class: "rh-data-center-tip__content" }, Me = {
|
|
376
391
|
key: 0,
|
|
377
392
|
class: "rh-data-center-tip__minutes"
|
|
378
|
-
},
|
|
393
|
+
}, Ke = {
|
|
379
394
|
key: 1,
|
|
380
395
|
class: "rh-data-center-tip__description"
|
|
381
396
|
}, Ue = /* @__PURE__ */ M({
|
|
@@ -391,36 +406,36 @@ const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-a3a35657"]]), He = {
|
|
|
391
406
|
},
|
|
392
407
|
emits: ["update:modelValue", "close"],
|
|
393
408
|
setup(e, { emit: p }) {
|
|
394
|
-
const
|
|
395
|
-
|
|
409
|
+
const n = p, l = () => {
|
|
410
|
+
n("update:modelValue", !1), n("close");
|
|
396
411
|
};
|
|
397
|
-
return (
|
|
398
|
-
const k =
|
|
399
|
-
return
|
|
412
|
+
return (v, c) => {
|
|
413
|
+
const k = Z("el-button"), g = Z("el-dialog");
|
|
414
|
+
return r(), J(g, {
|
|
400
415
|
"model-value": e.modelValue,
|
|
401
416
|
title: e.title || "提示",
|
|
402
417
|
width: e.width,
|
|
403
418
|
"append-to-body": "",
|
|
404
|
-
"onUpdate:modelValue":
|
|
405
|
-
onClose:
|
|
419
|
+
"onUpdate:modelValue": c[0] || (c[0] = (_) => n("update:modelValue", _)),
|
|
420
|
+
onClose: l
|
|
406
421
|
}, {
|
|
407
422
|
footer: V(() => [
|
|
408
|
-
|
|
423
|
+
O(k, {
|
|
409
424
|
type: "primary",
|
|
410
|
-
onClick:
|
|
425
|
+
onClick: l
|
|
411
426
|
}, {
|
|
412
|
-
default: V(() => [...
|
|
413
|
-
|
|
427
|
+
default: V(() => [...c[1] || (c[1] = [
|
|
428
|
+
Y("关闭弹框", -1)
|
|
414
429
|
])]),
|
|
415
430
|
_: 1
|
|
416
431
|
})
|
|
417
432
|
]),
|
|
418
433
|
default: V(() => [
|
|
419
|
-
e.showGuideAnimation ? (
|
|
420
|
-
|
|
421
|
-
e.minutes !== void 0 ? (
|
|
422
|
-
e.content ? (
|
|
423
|
-
|
|
434
|
+
e.showGuideAnimation ? (r(), u("div", Se)) : b("", !0),
|
|
435
|
+
h("div", Oe, [
|
|
436
|
+
e.minutes !== void 0 ? (r(), u("span", Me, C((e.title || "任务处理中,大概需要") + e.minutes + "分钟"), 1)) : b("", !0),
|
|
437
|
+
e.content ? (r(), u("div", Ke, C(e.content), 1)) : b("", !0),
|
|
438
|
+
w(v.$slots, "extra")
|
|
424
439
|
])
|
|
425
440
|
]),
|
|
426
441
|
_: 3
|
|
@@ -432,8 +447,8 @@ const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-a3a35657"]]), He = {
|
|
|
432
447
|
return {
|
|
433
448
|
tipVisible: e,
|
|
434
449
|
tipConfig: p,
|
|
435
|
-
showTip: (
|
|
436
|
-
p.value = { ...
|
|
450
|
+
showTip: (v) => {
|
|
451
|
+
p.value = { ...v }, e.value = !0;
|
|
437
452
|
},
|
|
438
453
|
closeTip: () => {
|
|
439
454
|
e.value = !1;
|
|
@@ -441,7 +456,7 @@ const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-a3a35657"]]), He = {
|
|
|
441
456
|
};
|
|
442
457
|
};
|
|
443
458
|
export {
|
|
444
|
-
|
|
459
|
+
Fe as RhDataCenter,
|
|
445
460
|
Be as RhDataCenterPanel,
|
|
446
461
|
Ue as RhDataCenterTip,
|
|
447
462
|
Ge as useRhDataCenter
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--rh-ui-data-center-primary: #00828a;--rh-ui-data-center-primary-soft: #cfe8ea;--rh-ui-data-center-panel-width: 606px;--rh-ui-data-center-panel-height: 500px;--rh-ui-data-center-text: #333;--rh-ui-data-center-secondary-text: #999;--rh-ui-data-center-border: #e9e9e9}.rh-data-center-panel{width:var(--rh-ui-data-center-panel-width);height:var(--rh-ui-data-center-panel-height);display:flex;overflow:hidden;box-sizing:border-box;background:#fff;border:1px solid var(--rh-ui-data-center-border);border-radius:8px;box-shadow:0 12px 32px #0f172a29}.rh-data-center-panel__sidebar{width:124px;flex:0 0 124px;box-sizing:border-box;padding:16px 10px;border-right:1px solid var(--rh-ui-data-center-border)}.rh-data-center-panel__main{min-width:0;flex:1;padding:16px 0 10px 15px}.rh-data-center-panel__title{display:flex;align-items:center;justify-content:space-between;margin:0 10px 15px 0;color:var(--rh-ui-data-center-text);font-size:16px;font-weight:600}.rh-data-center-panel__category{width:
|
|
1
|
+
:root{--rh-ui-data-center-primary: #00828a;--rh-ui-data-center-primary-soft: #cfe8ea;--rh-ui-data-center-panel-width: 606px;--rh-ui-data-center-panel-height: 500px;--rh-ui-data-center-text: #333;--rh-ui-data-center-secondary-text: #999;--rh-ui-data-center-border: #e9e9e9}.rh-data-center-panel{width:var(--rh-ui-data-center-panel-width);height:var(--rh-ui-data-center-panel-height);display:flex;overflow:hidden;box-sizing:border-box;background:#fff;border:1px solid var(--rh-ui-data-center-border);border-radius:8px;box-shadow:0 12px 32px #0f172a29}.rh-data-center-panel__sidebar{width:124px;flex:0 0 124px;box-sizing:border-box;padding:16px 10px;border-right:1px solid var(--rh-ui-data-center-border)}.rh-data-center-panel__main{min-width:0;flex:1;padding:16px 0 10px 15px}.rh-data-center-panel__title{display:flex;align-items:center;justify-content:space-between;margin:0 10px 15px 0;color:var(--rh-ui-data-center-text);font-size:16px;font-weight:600}.rh-data-center-panel__category{width:100%;min-height:32px;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;margin:10px 0;padding:0 10px;border-radius:3px;color:#666;cursor:pointer;font-size:14px;-webkit-user-select:none;user-select:none;transition:background-color .15s ease,color .15s ease}.rh-data-center-panel__category:hover{background:#f3f7f7;color:var(--rh-ui-data-center-primary)}.rh-data-center-panel__category:focus-visible{outline:2px solid rgba(0,130,138,.35);outline-offset:1px}.rh-data-center-panel__category.is-active{background:var(--rh-ui-data-center-primary-soft);color:var(--rh-ui-data-center-primary);font-weight:600}.rh-data-center-panel__categoryCount{color:#999;font-size:12px;font-weight:400}.rh-data-center-panel__category.is-active .rh-data-center-panel__categoryCount{color:var(--rh-ui-data-center-primary)}.rh-data-center-panel__scroll{height:calc(100% - 48px);padding-right:10px;overflow-y:auto}.rh-data-center-panel__task{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;box-sizing:border-box;min-height:84px;margin-bottom:10px;padding:0 10px 10px 0;border-bottom:1px solid var(--rh-ui-data-center-border)}.rh-data-center-panel__taskMain{min-width:0;flex:1}.rh-data-center-panel__taskTitle{overflow:hidden;color:var(--rh-ui-data-center-text);font-size:14px;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.rh-data-center-panel__taskTag{display:inline-block;margin-left:8px;padding:1px 8px;border-radius:12px;background:#f5f6f7;color:#999;font-size:12px;line-height:20px;vertical-align:1px}.rh-data-center-panel__progress{width:100%;height:4px;margin:7px 0 5px;overflow:hidden;border-radius:4px;background:#edf0f1}.rh-data-center-panel__progressBar{height:100%;border-radius:inherit;background:var(--rh-ui-data-center-primary);transition:width .3s ease}.rh-data-center-panel__progressBar.is-failed{background:#f04444}.rh-data-center-panel__meta,.rh-data-center-panel__message{color:var(--rh-ui-data-center-secondary-text);font-size:11px;line-height:18px}.rh-data-center-panel__message.is-failed{color:#f04444;font-size:12px}.rh-data-center-panel__actions{flex:0 0 auto;display:flex;align-items:flex-end;gap:10px;min-height:56px;padding-bottom:1px}.rh-data-center-panel__action{padding:0;border:0;background:transparent;color:#008ae6;cursor:pointer;font-size:12px;white-space:nowrap}.rh-data-center-panel__action:disabled{color:#bbb;cursor:not-allowed}.rh-data-center-panel__state{min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--rh-ui-data-center-secondary-text);font-size:14px}.rh-data-center-panel__retry{border:0;background:transparent;color:var(--rh-ui-data-center-primary);cursor:pointer}.rh-data-center-panel__footer{display:flex;justify-content:space-between;box-sizing:border-box;padding:8px 10px 0 0;color:var(--rh-ui-data-center-secondary-text);font-size:12px}.rh-data-center-tip__content{display:flex;flex-direction:column;align-items:center;color:var(--rh-ui-data-center-text)}.rh-data-center-tip__minutes{color:var(--rh-ui-data-center-primary);font-size:18px}.rh-data-center-tip__description{margin:15px 0 30px;font-size:14px;line-height:22px}.rh-data-center-tip__guide{width:120px;height:56px;position:relative;margin:-20px auto 8px;border-radius:50%;background:radial-gradient(circle at 50% 55%,rgba(0,130,138,.18),transparent 65%)}.rh-data-center-tip__guide:after{content:">";position:absolute;top:0;right:15px;color:var(--rh-ui-data-center-primary);font-size:32px;animation:rh-data-center-guide 1.5s ease-in-out infinite}@keyframes rh-data-center-guide{0%,to{transform:translate(-8px,5px)}50%{transform:translate(0)}}.rh-data-center[data-v-47bfdbe2]{position:relative;display:inline-flex;align-items:center}.rh-data-center__trigger[data-v-47bfdbe2]{display:inline-flex;align-items:center;min-height:30px;padding:0 8px;border-radius:4px;color:var(--rh-ui-data-center-text);cursor:pointer;transition:background-color .2s ease,color .2s ease}.rh-data-center__trigger[data-v-47bfdbe2]:hover,.rh-data-center__trigger.is-active[data-v-47bfdbe2]{background:rgba(0,130,138,.08);color:var(--rh-ui-data-center-primary)}.rh-data-center__icon[data-v-47bfdbe2]{width:22px;margin-right:5px}.rh-data-center__popover[data-v-47bfdbe2]{position:fixed;z-index:3000;box-sizing:border-box}.responsive-info-grid[data-v-85b5413b]{display:grid;grid-template-columns:repeat(var(--responsive-info-grid-columns),minmax(0,1fr));gap:var(--responsive-info-grid-gap)}@media (max-width: 1200px){.responsive-info-grid[data-v-85b5413b]{grid-template-columns:repeat(var(--responsive-info-grid-tablet-columns),minmax(0,1fr))}}@media (max-width: 768px){.responsive-info-grid[data-v-85b5413b]{grid-template-columns:repeat(var(--responsive-info-grid-mobile-columns),minmax(0,1fr))}}.responsive-info-grid-item[data-v-67645283]{min-width:0;color:#333;font-size:14px;line-height:22px;word-break:break-all;display:flex}.responsive-info-grid-item__title[data-v-67645283]{display:inline-block;color:#777;white-space:nowrap}.responsive-info-grid-item__content[data-v-67645283]{display:inline}@media (max-width: 768px){.responsive-info-grid-item[data-v-67645283]{grid-column:span 1!important}}
|