rhjy-ui 0.2.1 → 0.2.2
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
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
</template>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
See the [Responsive Info Grid component README](https://unpkg.com/rhjy-ui@0.2.
|
|
39
|
+
See the [Responsive Info Grid component README](https://unpkg.com/rhjy-ui@0.2.2/src/responsive-info-grid/README.md) for subpath imports, the complete props and slots reference, responsive behavior, and more examples.
|
|
40
40
|
|
|
41
41
|
## Data center panel
|
|
42
42
|
|
|
@@ -84,7 +84,20 @@ const handleTaskAction = ({ action, task }) => {
|
|
|
84
84
|
</template>
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
The “全部任务” rule is application-owned. It may omit `taskType`, pass a fixed value, or combine multiple requests without changing the component.
|
|
87
|
+
The “全部任务” rule is application-owned. It may omit `taskType`, pass a fixed value, or combine multiple requests without changing the component.
|
|
88
|
+
|
|
89
|
+
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
|
+
|
|
91
|
+
```vue
|
|
92
|
+
<RhDataCenter
|
|
93
|
+
:categories="categories"
|
|
94
|
+
:load-tasks="loadTasks"
|
|
95
|
+
:show-category-count="true"
|
|
96
|
+
:category-counts="{ all: 20, generate: 8, import: 4, export: 8 }"
|
|
97
|
+
/>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
When counts are enabled, the component uses `categoryCounts`, then a loaded result's `counts`, and finally the category result's `total`.
|
|
88
101
|
|
|
89
102
|
## Task tip flow
|
|
90
103
|
|
|
@@ -130,4 +143,4 @@ Override CSS variables at the application root when needed:
|
|
|
130
143
|
|
|
131
144
|
## Releases
|
|
132
145
|
|
|
133
|
-
The package is published with compiled `dist` output. Consumers should use an explicit version such as `rhjy-ui@0.2.
|
|
146
|
+
The package is published with compiled `dist` output. Consumers should use an explicit version such as `rhjy-ui@0.2.2`; application-specific API adapters remain in the consuming project.
|
|
@@ -38,6 +38,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
38
38
|
pollInterval?: number;
|
|
39
39
|
refreshOnOpen?: boolean;
|
|
40
40
|
closeOnClickOutside?: boolean;
|
|
41
|
+
showCategoryCount?: boolean;
|
|
42
|
+
categoryCounts?: Record<string, number>;
|
|
41
43
|
icon?: string;
|
|
42
44
|
activeIcon?: string;
|
|
43
45
|
}>, {
|
|
@@ -49,6 +51,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
49
51
|
pollInterval: number;
|
|
50
52
|
refreshOnOpen: boolean;
|
|
51
53
|
closeOnClickOutside: boolean;
|
|
54
|
+
showCategoryCount: boolean;
|
|
52
55
|
icon: string;
|
|
53
56
|
activeIcon: string;
|
|
54
57
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
@@ -69,6 +72,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
69
72
|
pollInterval?: number;
|
|
70
73
|
refreshOnOpen?: boolean;
|
|
71
74
|
closeOnClickOutside?: boolean;
|
|
75
|
+
showCategoryCount?: boolean;
|
|
76
|
+
categoryCounts?: Record<string, number>;
|
|
72
77
|
icon?: string;
|
|
73
78
|
activeIcon?: string;
|
|
74
79
|
}>, {
|
|
@@ -80,6 +85,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
80
85
|
pollInterval: number;
|
|
81
86
|
refreshOnOpen: boolean;
|
|
82
87
|
closeOnClickOutside: boolean;
|
|
88
|
+
showCategoryCount: boolean;
|
|
83
89
|
icon: string;
|
|
84
90
|
activeIcon: string;
|
|
85
91
|
}>>> & Readonly<{
|
|
@@ -92,6 +98,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
92
98
|
}>, {
|
|
93
99
|
label: string;
|
|
94
100
|
width: string | number;
|
|
101
|
+
showCategoryCount: boolean;
|
|
95
102
|
modelValue: boolean;
|
|
96
103
|
panelHeight: string | number;
|
|
97
104
|
panelRight: string | number;
|
|
@@ -27,11 +27,14 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
27
27
|
activeCategoryKey?: string | number;
|
|
28
28
|
closeable?: boolean;
|
|
29
29
|
showTotal?: boolean;
|
|
30
|
+
showCategoryCount?: boolean;
|
|
31
|
+
categoryCounts?: Record<string, number>;
|
|
30
32
|
recentDaysText?: string;
|
|
31
33
|
}>, {
|
|
32
34
|
activeCategoryKey: any;
|
|
33
35
|
closeable: boolean;
|
|
34
36
|
showTotal: boolean;
|
|
37
|
+
showCategoryCount: boolean;
|
|
35
38
|
recentDaysText: string;
|
|
36
39
|
}>>, {
|
|
37
40
|
refresh: (force?: boolean) => Promise<void>;
|
|
@@ -46,11 +49,14 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
46
49
|
activeCategoryKey?: string | number;
|
|
47
50
|
closeable?: boolean;
|
|
48
51
|
showTotal?: boolean;
|
|
52
|
+
showCategoryCount?: boolean;
|
|
53
|
+
categoryCounts?: Record<string, number>;
|
|
49
54
|
recentDaysText?: string;
|
|
50
55
|
}>, {
|
|
51
56
|
activeCategoryKey: any;
|
|
52
57
|
closeable: boolean;
|
|
53
58
|
showTotal: boolean;
|
|
59
|
+
showCategoryCount: boolean;
|
|
54
60
|
recentDaysText: string;
|
|
55
61
|
}>>> & Readonly<{
|
|
56
62
|
onClose?: () => any;
|
|
@@ -61,6 +67,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
61
67
|
activeCategoryKey: string | number;
|
|
62
68
|
closeable: boolean;
|
|
63
69
|
showTotal: boolean;
|
|
70
|
+
showCategoryCount: boolean;
|
|
64
71
|
recentDaysText: string;
|
|
65
72
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
66
73
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
@@ -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"},$=e.defineComponent({__name:"RhDataCenterState",props:{text:{},retryable:{type:Boolean,default:!1}},emits:["retry"],setup(t,{emit:v}){const o=v;return(i,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:v}){const o=t,i=v,d=e.computed(()=>{const c=Number(o.task.progress||0);return Math.min(100,Math.max(0,c))});return(c,h)=>{var p;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)]),(p=t.task.actions)!=null&&p.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:y=>i("action",k.key)},e.toDisplayString(k.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"},le={class:"rh-data-center-panel__title"},re={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},recentDaysText:{default:Z}},emits:["close","refresh","task-action","error"],setup(t,{expose:v,emit:o}){const i=t,d=o,c=e.ref(i.activeCategoryKey),h=e.ref({}),p=e.ref({}),k=e.ref({}),y=e.ref({}),C=e.ref({}),u=e.computed(()=>i.categories.find(a=>a.key===c.value)||i.categories[0]),E=e.computed(()=>{var a;return String(((a=u.value)==null?void 0:a.key)??"")}),_=e.computed(()=>h.value[E.value]),b=e.computed(()=>p.value[E.value]===!0),B=e.computed(()=>k.value[E.value]),R=a=>{var n;const s=h.value[String(a.key)];return((n=s==null?void 0:s.counts)==null?void 0:n[String(a.key)])??(s==null?void 0:s.total)},V=async(a=!1)=>{const s=u.value;if(!s)return;const n=String(s.key);if(C.value[n]&&!a)return;C.value[n]=!0,p.value[n]=!0,k.value[n]=void 0;const l=(y.value[n]||0)+1;y.value[n]=l,d("refresh",s);try{const g=await i.loadTasks({category:s});if(y.value[n]!==l||E.value!==n)return;h.value[n]=g}catch(g){if(y.value[n]!==l||E.value!==n)return;k.value[n]=g,d("error",g,s)}finally{y.value[n]===l&&(p.value[n]=!1,C.value[n]=!1)}},N=async a=>{c.value!==a.key&&(c.value=a.key,await V())},w=(a,s)=>{const n=u.value;n&&d("task-action",{action:a,task:s,category:n})};return e.onMounted(()=>{var a;c.value===void 0&&(c.value=(a=i.categories[0])==null?void 0:a.key)}),v({refresh:V}),(a,s)=>{var n;return e.openBlock(),e.createElementBlock("div",ee,[e.createElementVNode("aside",te,[s[1]||(s[1]=e.createElementVNode("div",{class:"rh-data-center-panel__title"},"数据类型",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,l=>(e.openBlock(),e.createElementBlock("button",{key:l.key,type:"button",class:e.normalizeClass(["rh-data-center-panel__category",{"is-active":c.value===l.key}]),onClick:g=>N(l)},[e.createElementVNode("span",null,e.toDisplayString(l.label),1),R(l)!==void 0?(e.openBlock(),e.createElementBlock("span",ne,e.toDisplayString(R(l)),1)):e.createCommentVNode("",!0)],10,oe))),128))]),e.createElementVNode("section",ae,[e.createElementVNode("div",le,[e.renderSlot(a.$slots,"header",{category:u.value},()=>[s[2]||(s[2]=e.createTextVNode("数据处理进度",-1))]),t.closeable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rh-data-center-panel__action",onClick:s[0]||(s[0]=l=>d("close"))},"关闭")):e.createCommentVNode("",!0)]),e.createElementVNode("div",re,[b.value&&!_.value?(e.openBlock(),e.createBlock($,{key:0,text:"加载中..."})):B.value&&!_.value?e.renderSlot(a.$slots,"error",{key:1,error:B.value,retry:V},()=>[e.createVNode($,{text:"任务加载失败",retryable:!0,onRetry:V})]):(n=_.value)!=null&&n.items.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(_.value.items,l=>e.renderSlot(a.$slots,"task",{key:l.id,task:l,category:u.value,action:w},()=>[e.createVNode(j,{task:l,onAction:g=>w(g,l)},null,8,["task","onAction"])])),128)):e.renderSlot(a.$slots,"empty",{key:3,category:u.value},()=>[e.createVNode($,{text:"暂无任务"})])]),e.renderSlot(a.$slots,"footer",{result:_.value,category:u.value},()=>{var l;return[t.showTotal?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("span",null,e.toDisplayString(((l=_.value)==null?void 0:l.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,v)=>{const o=i=>{const d=i.target;if(!d)return;t.some(h=>{var p;return(p=ie(h))==null?void 0:p.contains(d)})||v()};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},icon:{default:""},activeIcon:{default:""}},emits:["update:modelValue","open","close","refresh","task-action","error"],setup(t,{emit:v}){const o=t,i=v,d=e.ref(!1),c=e.ref(null),h=e.ref(null),p=e.ref(null),k=e.ref({}),y=e.ref(),C=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),_=r=>typeof r=="number"?`${r}px`:r,b=r=>typeof r=="number"?r:Number.parseFloat(r)||0,B=()=>{const r=c.value,f=h.value;if(!r||!f)return;const m=r.getBoundingClientRect(),D=f.offsetWidth||b(o.width),x=b(o.panelRight),T=8,A=m.right-D-x,P=Math.min(Math.max(T,A),Math.max(T,window.innerWidth-D-T)),z=Math.min(m.bottom+8,Math.max(T,window.innerHeight-f.offsetHeight-T));k.value={top:`${z}px`,left:`${P}px`,width:_(o.width),"--rh-ui-data-center-panel-height":_(o.panelHeight)}},R=()=>{C.value||(C.value=!0,window.addEventListener("resize",B),window.addEventListener("scroll",B,!0))},V=()=>{C.value&&(C.value=!1,window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0))},N=()=>{y.value!==void 0&&(window.clearInterval(y.value),y.value=void 0)},w=()=>{var r;(r=p.value)==null||r.refresh()},a=()=>{N(),!(!u.value||o.pollInterval<=0)&&(y.value=window.setInterval(w,o.pollInterval))},s=r=>{o.modelValue===void 0&&(d.value=r),i("update:modelValue",r)},n=()=>{u.value||(s(!0),i("open"))},l=()=>{u.value&&(s(!1),i("close"))},g=()=>u.value?l():n(),S=()=>{if(document.visibilityState==="hidden"){N();return}a(),w()};return e.watch(u,async r=>{if(N(),V(),!r){document.removeEventListener("visibilitychange",S);return}await e.nextTick(),B(),R(),document.addEventListener("visibilitychange",S),o.refreshOnOpen&&w(),a()},{immediate:!0}),ce([c,h],()=>{o.closeOnClickOutside&&u.value&&l()}),e.onBeforeUnmount(()=>{N(),V(),document.removeEventListener("visibilitychange",S)}),(r,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"triggerRef",ref:c,class:"rh-data-center",onClick:e.withModifiers(g,["stop"])},[e.renderSlot(r.$slots,"trigger",{visible:u.value,open:n,close:l,toggle:g},()=>[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:h,class:"rh-data-center__popover",style:e.normalizeStyle(k.value),onClick:f[3]||(f[3]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(L,{ref_key:"panelRef",ref:p,categories:t.categories,"load-tasks":t.loadTasks,closeable:!0,onClose:l,onRefresh:f[0]||(f[0]=m=>i("refresh",m)),onTaskAction:f[1]||(f[1]=m=>i("task-action",m)),onError:f[2]||(f[2]=(m,D)=>i("error",m,D))},{header:e.withCtx(m=>[e.renderSlot(r.$slots,"header",e.normalizeProps(e.guardReactiveProps(m)),()=>[f[4]||(f[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"])],4)):e.createCommentVNode("",!0)]))],64))}});const me=I._export_sfc(ue,[["__scopeId","data-v-94eef479"]]),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"},he=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:v}){const o=v,i=()=>{o("update:modelValue",!1),o("close")};return(d,c)=>{const h=e.resolveComponent("el-button"),p=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(p,{"model-value":t.modelValue,title:t.title||"提示",width:t.width,"append-to-body":"","onUpdate:modelValue":c[0]||(c[0]=k=>o("update:modelValue",k)),onClose:i},{footer:e.withCtx(()=>[e.createVNode(h,{type:"primary",onClick:i},{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"])}}}),ye=()=>{const t=e.ref(!1),v=e.ref({});return{tipVisible:t,tipConfig:v,showTip:d=>{v.value={...d},t.value=!0},closeTip:()=>{t.value=!1}}};exports.RhDataCenter=me;exports.RhDataCenterPanel=L;exports.RhDataCenterTip=he;exports.useRhDataCenter=ye;
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as M, openBlock as l, createElementBlock as i, createElementVNode as y, toDisplayString as w, createCommentVNode as b, computed as L, normalizeClass as U, normalizeStyle as Q, Fragment as G, renderList as j, ref as m, onMounted as Z, renderSlot as T, createTextVNode as q, createBlock as X, createVNode as S, onBeforeUnmount as ee, watch as se, nextTick as le, withModifiers as Y, Teleport as re, withCtx as V, normalizeProps as H, guardReactiveProps as O, resolveComponent as J } from "vue";
|
|
2
2
|
import { _ as ie } from "../_plugin-vue_export-helper-dad06003.js";
|
|
3
|
-
const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */
|
|
3
|
+
const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ M({
|
|
4
4
|
__name: "RhDataCenterState",
|
|
5
5
|
props: {
|
|
6
6
|
text: {},
|
|
@@ -9,75 +9,75 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
9
9
|
emits: ["retry"],
|
|
10
10
|
setup(e, { emit: p }) {
|
|
11
11
|
const t = p;
|
|
12
|
-
return (
|
|
13
|
-
|
|
12
|
+
return (r, d) => (l(), i("div", ce, [
|
|
13
|
+
y("span", null, w(e.text), 1),
|
|
14
14
|
e.retryable ? (l(), i("button", {
|
|
15
15
|
key: 0,
|
|
16
16
|
type: "button",
|
|
17
17
|
class: "rh-data-center-panel__retry",
|
|
18
18
|
onClick: d[0] || (d[0] = (u) => t("retry"))
|
|
19
|
-
}, " 重新加载 ")) :
|
|
19
|
+
}, " 重新加载 ")) : b("", !0)
|
|
20
20
|
]));
|
|
21
21
|
}
|
|
22
22
|
}), ue = { class: "rh-data-center-panel__task" }, de = { class: "rh-data-center-panel__taskMain" }, ve = { class: "rh-data-center-panel__taskTitle" }, fe = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "rh-data-center-panel__taskTag"
|
|
25
|
-
},
|
|
25
|
+
}, ye = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "rh-data-center-panel__progress"
|
|
28
|
-
},
|
|
28
|
+
}, he = { class: "rh-data-center-panel__meta" }, me = {
|
|
29
29
|
key: 0,
|
|
30
30
|
class: "rh-data-center-panel__actions"
|
|
31
|
-
},
|
|
31
|
+
}, pe = ["disabled", "onClick"], ge = /* @__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 t = e,
|
|
38
|
+
const t = e, r = p, d = L(() => {
|
|
39
39
|
const u = Number(t.task.progress || 0);
|
|
40
40
|
return Math.min(100, Math.max(0, u));
|
|
41
41
|
});
|
|
42
|
-
return (u,
|
|
43
|
-
var
|
|
42
|
+
return (u, k) => {
|
|
43
|
+
var g;
|
|
44
44
|
return l(), i("div", ue, [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
e.task.tag ? (l(), i("span", fe,
|
|
45
|
+
y("div", de, [
|
|
46
|
+
y("div", ve, [
|
|
47
|
+
y("span", null, w(e.task.title), 1),
|
|
48
|
+
e.task.tag ? (l(), i("span", fe, w(e.task.tag), 1)) : b("", !0)
|
|
49
49
|
]),
|
|
50
|
-
e.task.status !== "success" ? (l(), i("div",
|
|
51
|
-
|
|
52
|
-
class:
|
|
50
|
+
e.task.status !== "success" ? (l(), i("div", ye, [
|
|
51
|
+
y("div", {
|
|
52
|
+
class: U(["rh-data-center-panel__progressBar", { "is-failed": e.task.status === "failed" }]),
|
|
53
53
|
style: Q({ width: `${d.value}%` })
|
|
54
54
|
}, null, 6)
|
|
55
|
-
])) :
|
|
56
|
-
|
|
55
|
+
])) : b("", !0),
|
|
56
|
+
y("div", he, w(e.task.createdAt), 1),
|
|
57
57
|
e.task.message ? (l(), i("div", {
|
|
58
58
|
key: 1,
|
|
59
|
-
class:
|
|
60
|
-
},
|
|
59
|
+
class: U(["rh-data-center-panel__message", { "is-failed": e.task.status === "failed" }])
|
|
60
|
+
}, w(e.task.message), 3)) : b("", !0)
|
|
61
61
|
]),
|
|
62
|
-
(
|
|
63
|
-
(l(!0), i(
|
|
64
|
-
key:
|
|
62
|
+
(g = e.task.actions) != null && g.length ? (l(), i("div", me, [
|
|
63
|
+
(l(!0), i(G, null, j(e.task.actions, (_) => (l(), i("button", {
|
|
64
|
+
key: _.key,
|
|
65
65
|
type: "button",
|
|
66
66
|
class: "rh-data-center-panel__action",
|
|
67
|
-
disabled:
|
|
68
|
-
onClick: (
|
|
69
|
-
},
|
|
70
|
-
])) :
|
|
67
|
+
disabled: _.disabled,
|
|
68
|
+
onClick: ($) => r("action", _.key)
|
|
69
|
+
}, w(_.label), 9, pe))), 128))
|
|
70
|
+
])) : b("", !0)
|
|
71
71
|
]);
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
}), ke = "数据处理中心",
|
|
74
|
+
}), ke = "数据处理中心", _e = 606, Ce = 500, we = 1e3, be = "-此处仅展示近15天内的数据-", Te = { class: "rh-data-center-panel" }, $e = { class: "rh-data-center-panel__sidebar" }, Re = ["onClick"], Ee = {
|
|
75
75
|
key: 0,
|
|
76
76
|
class: "rh-data-center-panel__categoryCount"
|
|
77
77
|
}, Ae = { class: "rh-data-center-panel__main" }, De = { class: "rh-data-center-panel__title" }, Le = { class: "rh-data-center-panel__scroll" }, Ve = {
|
|
78
78
|
key: 0,
|
|
79
79
|
class: "rh-data-center-panel__footer"
|
|
80
|
-
},
|
|
80
|
+
}, Be = /* @__PURE__ */ M({
|
|
81
81
|
__name: "RhDataCenterPanel",
|
|
82
82
|
props: {
|
|
83
83
|
categories: {},
|
|
@@ -85,285 +85,300 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
85
85
|
activeCategoryKey: { default: void 0 },
|
|
86
86
|
closeable: { type: Boolean, default: !0 },
|
|
87
87
|
showTotal: { type: Boolean, default: !0 },
|
|
88
|
+
showCategoryCount: { type: Boolean, default: !0 },
|
|
89
|
+
categoryCounts: {},
|
|
88
90
|
recentDaysText: { default: be }
|
|
89
91
|
},
|
|
90
92
|
emits: ["close", "refresh", "task-action", "error"],
|
|
91
93
|
setup(e, { expose: p, emit: t }) {
|
|
92
|
-
const
|
|
93
|
-
var
|
|
94
|
-
return String(((
|
|
95
|
-
}), R = L(() =>
|
|
96
|
-
var a;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
const r = e, d = t, u = m(r.activeCategoryKey), k = m({}), g = m({}), _ = m({}), $ = m({}), E = m({}), v = L(() => r.categories.find((s) => s.key === u.value) || r.categories[0]), A = L(() => {
|
|
95
|
+
var s;
|
|
96
|
+
return String(((s = v.value) == null ? void 0 : s.key) ?? "");
|
|
97
|
+
}), R = L(() => k.value[A.value]), z = L(() => g.value[A.value] === !0), D = L(() => _.value[A.value]), F = (s) => {
|
|
98
|
+
var a, C, I;
|
|
99
|
+
if (!r.showCategoryCount)
|
|
100
|
+
return;
|
|
101
|
+
const c = String(s.key), n = (a = r.categoryCounts) == null ? void 0 : a[c];
|
|
102
|
+
if (n !== void 0)
|
|
103
|
+
return n;
|
|
104
|
+
for (const o of Object.values(k.value)) {
|
|
105
|
+
const h = (C = o.counts) == null ? void 0 : C[c];
|
|
106
|
+
if (h !== void 0)
|
|
107
|
+
return h;
|
|
108
|
+
}
|
|
109
|
+
return (I = k.value[c]) == null ? void 0 : I.total;
|
|
110
|
+
}, B = async (s = !1) => {
|
|
111
|
+
const c = v.value;
|
|
112
|
+
if (!c)
|
|
102
113
|
return;
|
|
103
|
-
const
|
|
104
|
-
if (E.value[
|
|
114
|
+
const n = String(c.key);
|
|
115
|
+
if (E.value[n] && !s)
|
|
105
116
|
return;
|
|
106
|
-
E.value[
|
|
107
|
-
const
|
|
108
|
-
|
|
117
|
+
E.value[n] = !0, g.value[n] = !0, _.value[n] = void 0;
|
|
118
|
+
const a = ($.value[n] || 0) + 1;
|
|
119
|
+
$.value[n] = a, d("refresh", c);
|
|
109
120
|
try {
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
121
|
+
const C = await r.loadTasks({ category: c });
|
|
122
|
+
if ($.value[n] !== a || A.value !== n)
|
|
112
123
|
return;
|
|
113
|
-
|
|
114
|
-
} catch (
|
|
115
|
-
if (
|
|
124
|
+
k.value[n] = C;
|
|
125
|
+
} catch (C) {
|
|
126
|
+
if ($.value[n] !== a || A.value !== n)
|
|
116
127
|
return;
|
|
117
|
-
|
|
128
|
+
_.value[n] = C, d("error", C, c);
|
|
118
129
|
} finally {
|
|
119
|
-
|
|
130
|
+
$.value[n] === a && (g.value[n] = !1, E.value[n] = !1);
|
|
120
131
|
}
|
|
121
|
-
},
|
|
122
|
-
u.value !==
|
|
123
|
-
}, P = (
|
|
124
|
-
const
|
|
125
|
-
|
|
132
|
+
}, x = async (s) => {
|
|
133
|
+
u.value !== s.key && (u.value = s.key, await B());
|
|
134
|
+
}, P = (s, c) => {
|
|
135
|
+
const n = v.value;
|
|
136
|
+
n && d("task-action", { action: s, task: c, category: n });
|
|
126
137
|
};
|
|
127
138
|
return Z(() => {
|
|
128
|
-
var
|
|
129
|
-
u.value === void 0 && (u.value = (
|
|
139
|
+
var s;
|
|
140
|
+
u.value === void 0 && (u.value = (s = r.categories[0]) == null ? void 0 : s.key);
|
|
130
141
|
}), p({
|
|
131
|
-
refresh:
|
|
132
|
-
}), (
|
|
133
|
-
var
|
|
134
|
-
return l(), i("div",
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
(l(!0), i(
|
|
138
|
-
key:
|
|
142
|
+
refresh: B
|
|
143
|
+
}), (s, c) => {
|
|
144
|
+
var n;
|
|
145
|
+
return l(), i("div", Te, [
|
|
146
|
+
y("aside", $e, [
|
|
147
|
+
c[1] || (c[1] = y("div", { class: "rh-data-center-panel__title" }, "数据类型", -1)),
|
|
148
|
+
(l(!0), i(G, null, j(e.categories, (a) => (l(), i("button", {
|
|
149
|
+
key: a.key,
|
|
139
150
|
type: "button",
|
|
140
|
-
class:
|
|
141
|
-
onClick: (
|
|
151
|
+
class: U(["rh-data-center-panel__category", { "is-active": u.value === a.key }]),
|
|
152
|
+
onClick: (C) => x(a)
|
|
142
153
|
}, [
|
|
143
|
-
|
|
144
|
-
|
|
154
|
+
y("span", null, w(a.label), 1),
|
|
155
|
+
F(a) !== void 0 ? (l(), i("span", Ee, w(F(a)), 1)) : b("", !0)
|
|
145
156
|
], 10, Re))), 128))
|
|
146
157
|
]),
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
y("section", Ae, [
|
|
159
|
+
y("div", De, [
|
|
160
|
+
T(s.$slots, "header", { category: v.value }, () => [
|
|
161
|
+
c[2] || (c[2] = q("数据处理进度", -1))
|
|
151
162
|
]),
|
|
152
163
|
e.closeable ? (l(), i("button", {
|
|
153
164
|
key: 0,
|
|
154
165
|
type: "button",
|
|
155
166
|
class: "rh-data-center-panel__action",
|
|
156
|
-
onClick:
|
|
157
|
-
}, "关闭")) :
|
|
167
|
+
onClick: c[0] || (c[0] = (a) => d("close"))
|
|
168
|
+
}, "关闭")) : b("", !0)
|
|
158
169
|
]),
|
|
159
|
-
|
|
160
|
-
|
|
170
|
+
y("div", Le, [
|
|
171
|
+
z.value && !R.value ? (l(), X(W, {
|
|
161
172
|
key: 0,
|
|
162
173
|
text: "加载中..."
|
|
163
|
-
})) : D.value && !R.value ?
|
|
174
|
+
})) : D.value && !R.value ? T(s.$slots, "error", {
|
|
164
175
|
key: 1,
|
|
165
176
|
error: D.value,
|
|
166
|
-
retry:
|
|
177
|
+
retry: B
|
|
167
178
|
}, () => [
|
|
168
179
|
S(W, {
|
|
169
180
|
text: "任务加载失败",
|
|
170
181
|
retryable: !0,
|
|
171
|
-
onRetry:
|
|
182
|
+
onRetry: B
|
|
172
183
|
})
|
|
173
|
-
]) : (
|
|
174
|
-
key:
|
|
175
|
-
task:
|
|
184
|
+
]) : (n = R.value) != null && n.items.length ? (l(!0), i(G, { key: 2 }, j(R.value.items, (a) => T(s.$slots, "task", {
|
|
185
|
+
key: a.id,
|
|
186
|
+
task: a,
|
|
176
187
|
category: v.value,
|
|
177
188
|
action: P
|
|
178
189
|
}, () => [
|
|
179
|
-
S(
|
|
180
|
-
task:
|
|
181
|
-
onAction: (
|
|
190
|
+
S(ge, {
|
|
191
|
+
task: a,
|
|
192
|
+
onAction: (C) => P(C, a)
|
|
182
193
|
}, null, 8, ["task", "onAction"])
|
|
183
|
-
])), 128)) :
|
|
194
|
+
])), 128)) : T(s.$slots, "empty", {
|
|
184
195
|
key: 3,
|
|
185
196
|
category: v.value
|
|
186
197
|
}, () => [
|
|
187
198
|
S(W, { text: "暂无任务" })
|
|
188
199
|
])
|
|
189
200
|
]),
|
|
190
|
-
|
|
201
|
+
T(s.$slots, "footer", {
|
|
191
202
|
result: R.value,
|
|
192
203
|
category: v.value
|
|
193
204
|
}, () => {
|
|
194
|
-
var
|
|
205
|
+
var a;
|
|
195
206
|
return [
|
|
196
207
|
e.showTotal ? (l(), i("div", Ve, [
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
])) :
|
|
208
|
+
y("span", null, w(((a = R.value) == null ? void 0 : a.total) || 0) + "条记录", 1),
|
|
209
|
+
y("span", null, w(e.recentDaysText), 1)
|
|
210
|
+
])) : b("", !0)
|
|
200
211
|
];
|
|
201
212
|
})
|
|
202
213
|
])
|
|
203
214
|
]);
|
|
204
215
|
};
|
|
205
216
|
}
|
|
206
|
-
}),
|
|
207
|
-
const t = (
|
|
208
|
-
const d =
|
|
217
|
+
}), xe = (e) => typeof e == "function" ? e() : e.value, Pe = (e, p) => {
|
|
218
|
+
const t = (r) => {
|
|
219
|
+
const d = r.target;
|
|
209
220
|
if (!d)
|
|
210
221
|
return;
|
|
211
|
-
e.some((
|
|
212
|
-
var
|
|
213
|
-
return (
|
|
222
|
+
e.some((k) => {
|
|
223
|
+
var g;
|
|
224
|
+
return (g = xe(k)) == null ? void 0 : g.contains(d);
|
|
214
225
|
}) || p();
|
|
215
226
|
};
|
|
216
227
|
Z(() => document.addEventListener("click", t, !0)), ee(() => document.removeEventListener("click", t, !0));
|
|
217
|
-
}, Ie = ["src"], Ne = /* @__PURE__ */
|
|
228
|
+
}, Ie = ["src"], Ne = /* @__PURE__ */ M({
|
|
218
229
|
__name: "RhDataCenter",
|
|
219
230
|
props: {
|
|
220
231
|
modelValue: { type: Boolean, default: void 0 },
|
|
221
232
|
categories: {},
|
|
222
233
|
loadTasks: {},
|
|
223
234
|
label: { default: ke },
|
|
224
|
-
width: { default:
|
|
235
|
+
width: { default: _e },
|
|
225
236
|
panelHeight: { default: Ce },
|
|
226
237
|
panelRight: { default: 0 },
|
|
227
|
-
pollInterval: { default:
|
|
238
|
+
pollInterval: { default: we },
|
|
228
239
|
refreshOnOpen: { type: Boolean, default: !0 },
|
|
229
240
|
closeOnClickOutside: { type: Boolean, default: !0 },
|
|
241
|
+
showCategoryCount: { type: Boolean, default: !0 },
|
|
242
|
+
categoryCounts: {},
|
|
230
243
|
icon: { default: "" },
|
|
231
244
|
activeIcon: { default: "" }
|
|
232
245
|
},
|
|
233
246
|
emits: ["update:modelValue", "open", "close", "refresh", "task-action", "error"],
|
|
234
247
|
setup(e, { emit: p }) {
|
|
235
|
-
const t = e,
|
|
236
|
-
const o = u.value,
|
|
237
|
-
if (!o || !
|
|
248
|
+
const t = e, r = p, d = m(!1), u = m(null), k = m(null), g = m(null), _ = m({}), $ = m(), E = m(!1), v = L(() => t.modelValue === void 0 ? d.value : t.modelValue), A = L(() => v.value ? t.activeIcon || t.icon : t.icon || t.activeIcon), R = (o) => typeof o == "number" ? `${o}px` : o, z = (o) => typeof o == "number" ? o : Number.parseFloat(o) || 0, D = () => {
|
|
249
|
+
const o = u.value, h = k.value;
|
|
250
|
+
if (!o || !h)
|
|
238
251
|
return;
|
|
239
|
-
const f = o.getBoundingClientRect(),
|
|
240
|
-
Math.max(
|
|
241
|
-
Math.max(
|
|
242
|
-
),
|
|
252
|
+
const f = o.getBoundingClientRect(), K = h.offsetWidth || z(t.width), te = z(t.panelRight), N = 8, ae = f.right - K - te, ne = Math.min(
|
|
253
|
+
Math.max(N, ae),
|
|
254
|
+
Math.max(N, window.innerWidth - K - N)
|
|
255
|
+
), oe = Math.min(
|
|
243
256
|
f.bottom + 8,
|
|
244
|
-
Math.max(
|
|
257
|
+
Math.max(N, window.innerHeight - h.offsetHeight - N)
|
|
245
258
|
);
|
|
246
|
-
|
|
247
|
-
top: `${
|
|
259
|
+
_.value = {
|
|
260
|
+
top: `${oe}px`,
|
|
248
261
|
left: `${ne}px`,
|
|
249
262
|
width: R(t.width),
|
|
250
263
|
"--rh-ui-data-center-panel-height": R(t.panelHeight)
|
|
251
264
|
};
|
|
252
|
-
},
|
|
265
|
+
}, F = () => {
|
|
253
266
|
E.value || (E.value = !0, window.addEventListener("resize", D), window.addEventListener("scroll", D, !0));
|
|
254
|
-
}, x = () => {
|
|
255
|
-
E.value && (E.value = !1, window.removeEventListener("resize", D), window.removeEventListener("scroll", D, !0));
|
|
256
267
|
}, B = () => {
|
|
257
|
-
|
|
268
|
+
E.value && (E.value = !1, window.removeEventListener("resize", D), window.removeEventListener("scroll", D, !0));
|
|
269
|
+
}, x = () => {
|
|
270
|
+
$.value !== void 0 && (window.clearInterval($.value), $.value = void 0);
|
|
258
271
|
}, P = () => {
|
|
259
272
|
var o;
|
|
260
|
-
(o =
|
|
273
|
+
(o = g.value) == null || o.refresh();
|
|
274
|
+
}, s = () => {
|
|
275
|
+
x(), !(!v.value || t.pollInterval <= 0) && ($.value = window.setInterval(P, t.pollInterval));
|
|
276
|
+
}, c = (o) => {
|
|
277
|
+
t.modelValue === void 0 && (d.value = o), r("update:modelValue", o);
|
|
261
278
|
}, n = () => {
|
|
262
|
-
|
|
263
|
-
}, r = (o) => {
|
|
264
|
-
t.modelValue === void 0 && (d.value = o), c("update:modelValue", o);
|
|
279
|
+
v.value || (c(!0), r("open"));
|
|
265
280
|
}, a = () => {
|
|
266
|
-
v.value
|
|
267
|
-
},
|
|
268
|
-
v.value && (r(!1), c("close"));
|
|
269
|
-
}, $ = () => v.value ? s() : a(), G = () => {
|
|
281
|
+
v.value && (c(!1), r("close"));
|
|
282
|
+
}, C = () => v.value ? a() : n(), I = () => {
|
|
270
283
|
if (document.visibilityState === "hidden") {
|
|
271
|
-
|
|
284
|
+
x();
|
|
272
285
|
return;
|
|
273
286
|
}
|
|
274
|
-
|
|
287
|
+
s(), P();
|
|
275
288
|
};
|
|
276
|
-
return
|
|
277
|
-
if (
|
|
278
|
-
document.removeEventListener("visibilitychange",
|
|
289
|
+
return se(v, async (o) => {
|
|
290
|
+
if (x(), B(), !o) {
|
|
291
|
+
document.removeEventListener("visibilitychange", I);
|
|
279
292
|
return;
|
|
280
293
|
}
|
|
281
|
-
await le(), D(),
|
|
282
|
-
}, { immediate: !0 }), Pe([u,
|
|
283
|
-
t.closeOnClickOutside && v.value &&
|
|
294
|
+
await le(), D(), F(), document.addEventListener("visibilitychange", I), t.refreshOnOpen && P(), s();
|
|
295
|
+
}, { immediate: !0 }), Pe([u, k], () => {
|
|
296
|
+
t.closeOnClickOutside && v.value && a();
|
|
284
297
|
}), ee(() => {
|
|
285
|
-
|
|
286
|
-
}), (o,
|
|
287
|
-
|
|
298
|
+
x(), B(), document.removeEventListener("visibilitychange", I);
|
|
299
|
+
}), (o, h) => (l(), i(G, null, [
|
|
300
|
+
y("div", {
|
|
288
301
|
ref_key: "triggerRef",
|
|
289
302
|
ref: u,
|
|
290
303
|
class: "rh-data-center",
|
|
291
|
-
onClick:
|
|
304
|
+
onClick: Y(C, ["stop"])
|
|
292
305
|
}, [
|
|
293
|
-
|
|
306
|
+
T(o.$slots, "trigger", {
|
|
294
307
|
visible: v.value,
|
|
295
|
-
open:
|
|
296
|
-
close:
|
|
297
|
-
toggle:
|
|
308
|
+
open: n,
|
|
309
|
+
close: a,
|
|
310
|
+
toggle: C
|
|
298
311
|
}, () => [
|
|
299
|
-
|
|
300
|
-
class:
|
|
312
|
+
y("span", {
|
|
313
|
+
class: U(["rh-data-center__trigger", { "is-active": v.value }])
|
|
301
314
|
}, [
|
|
302
315
|
A.value ? (l(), i("img", {
|
|
303
316
|
key: 0,
|
|
304
317
|
src: A.value,
|
|
305
318
|
class: "rh-data-center__icon",
|
|
306
319
|
alt: ""
|
|
307
|
-
}, null, 8, Ie)) :
|
|
308
|
-
|
|
320
|
+
}, null, 8, Ie)) : b("", !0),
|
|
321
|
+
y("span", null, w(e.label), 1)
|
|
309
322
|
], 2)
|
|
310
323
|
], !0)
|
|
311
324
|
], 512),
|
|
312
|
-
(l(),
|
|
325
|
+
(l(), X(re, { to: "body" }, [
|
|
313
326
|
v.value ? (l(), i("div", {
|
|
314
327
|
key: 0,
|
|
315
328
|
ref_key: "contentRef",
|
|
316
|
-
ref:
|
|
329
|
+
ref: k,
|
|
317
330
|
class: "rh-data-center__popover",
|
|
318
|
-
style: Q(
|
|
319
|
-
onClick:
|
|
331
|
+
style: Q(_.value),
|
|
332
|
+
onClick: h[3] || (h[3] = Y(() => {
|
|
320
333
|
}, ["stop"]))
|
|
321
334
|
}, [
|
|
322
|
-
S(
|
|
335
|
+
S(Be, {
|
|
323
336
|
ref_key: "panelRef",
|
|
324
|
-
ref:
|
|
337
|
+
ref: g,
|
|
325
338
|
categories: e.categories,
|
|
326
339
|
"load-tasks": e.loadTasks,
|
|
327
340
|
closeable: !0,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
341
|
+
"show-category-count": e.showCategoryCount,
|
|
342
|
+
"category-counts": e.categoryCounts,
|
|
343
|
+
onClose: a,
|
|
344
|
+
onRefresh: h[0] || (h[0] = (f) => r("refresh", f)),
|
|
345
|
+
onTaskAction: h[1] || (h[1] = (f) => r("task-action", f)),
|
|
346
|
+
onError: h[2] || (h[2] = (f, K) => r("error", f, K))
|
|
332
347
|
}, {
|
|
333
348
|
header: V((f) => [
|
|
334
|
-
|
|
335
|
-
|
|
349
|
+
T(o.$slots, "header", H(O(f)), () => [
|
|
350
|
+
h[4] || (h[4] = q("数据处理进度", -1))
|
|
336
351
|
], !0)
|
|
337
352
|
]),
|
|
338
353
|
task: V((f) => [
|
|
339
|
-
|
|
354
|
+
T(o.$slots, "task", H(O(f)), void 0, !0)
|
|
340
355
|
]),
|
|
341
356
|
empty: V((f) => [
|
|
342
|
-
|
|
357
|
+
T(o.$slots, "empty", H(O(f)), void 0, !0)
|
|
343
358
|
]),
|
|
344
359
|
error: V((f) => [
|
|
345
|
-
|
|
360
|
+
T(o.$slots, "error", H(O(f)), void 0, !0)
|
|
346
361
|
]),
|
|
347
362
|
footer: V((f) => [
|
|
348
|
-
|
|
363
|
+
T(o.$slots, "footer", H(O(f)), void 0, !0)
|
|
349
364
|
]),
|
|
350
365
|
_: 3
|
|
351
|
-
}, 8, ["categories", "load-tasks"])
|
|
352
|
-
], 4)) :
|
|
366
|
+
}, 8, ["categories", "load-tasks", "show-category-count", "category-counts"])
|
|
367
|
+
], 4)) : b("", !0)
|
|
353
368
|
]))
|
|
354
369
|
], 64));
|
|
355
370
|
}
|
|
356
371
|
});
|
|
357
|
-
const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-
|
|
372
|
+
const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-a3a35657"]]), He = {
|
|
358
373
|
key: 0,
|
|
359
374
|
class: "rh-data-center-tip__guide"
|
|
360
|
-
},
|
|
375
|
+
}, Oe = { class: "rh-data-center-tip__content" }, Se = {
|
|
361
376
|
key: 0,
|
|
362
377
|
class: "rh-data-center-tip__minutes"
|
|
363
378
|
}, Me = {
|
|
364
379
|
key: 1,
|
|
365
380
|
class: "rh-data-center-tip__description"
|
|
366
|
-
}, Ue = /* @__PURE__ */
|
|
381
|
+
}, Ue = /* @__PURE__ */ M({
|
|
367
382
|
__name: "RhDataCenterTip",
|
|
368
383
|
props: {
|
|
369
384
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -376,36 +391,36 @@ const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-94eef479"]]), He = {
|
|
|
376
391
|
},
|
|
377
392
|
emits: ["update:modelValue", "close"],
|
|
378
393
|
setup(e, { emit: p }) {
|
|
379
|
-
const t = p,
|
|
394
|
+
const t = p, r = () => {
|
|
380
395
|
t("update:modelValue", !1), t("close");
|
|
381
396
|
};
|
|
382
397
|
return (d, u) => {
|
|
383
|
-
const
|
|
384
|
-
return l(),
|
|
398
|
+
const k = J("el-button"), g = J("el-dialog");
|
|
399
|
+
return l(), X(g, {
|
|
385
400
|
"model-value": e.modelValue,
|
|
386
401
|
title: e.title || "提示",
|
|
387
402
|
width: e.width,
|
|
388
403
|
"append-to-body": "",
|
|
389
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
390
|
-
onClose:
|
|
404
|
+
"onUpdate:modelValue": u[0] || (u[0] = (_) => t("update:modelValue", _)),
|
|
405
|
+
onClose: r
|
|
391
406
|
}, {
|
|
392
407
|
footer: V(() => [
|
|
393
|
-
S(
|
|
408
|
+
S(k, {
|
|
394
409
|
type: "primary",
|
|
395
|
-
onClick:
|
|
410
|
+
onClick: r
|
|
396
411
|
}, {
|
|
397
412
|
default: V(() => [...u[1] || (u[1] = [
|
|
398
|
-
|
|
413
|
+
q("关闭弹框", -1)
|
|
399
414
|
])]),
|
|
400
415
|
_: 1
|
|
401
416
|
})
|
|
402
417
|
]),
|
|
403
418
|
default: V(() => [
|
|
404
|
-
e.showGuideAnimation ? (l(), i("div", He)) :
|
|
405
|
-
|
|
406
|
-
e.minutes !== void 0 ? (l(), i("span",
|
|
407
|
-
e.content ? (l(), i("div", Me,
|
|
408
|
-
|
|
419
|
+
e.showGuideAnimation ? (l(), i("div", He)) : b("", !0),
|
|
420
|
+
y("div", Oe, [
|
|
421
|
+
e.minutes !== void 0 ? (l(), i("span", Se, w((e.title || "任务处理中,大概需要") + e.minutes + "分钟"), 1)) : b("", !0),
|
|
422
|
+
e.content ? (l(), i("div", Me, w(e.content), 1)) : b("", !0),
|
|
423
|
+
T(d.$slots, "extra")
|
|
409
424
|
])
|
|
410
425
|
]),
|
|
411
426
|
_: 3
|
|
@@ -427,7 +442,7 @@ const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-94eef479"]]), He = {
|
|
|
427
442
|
};
|
|
428
443
|
export {
|
|
429
444
|
Ke as RhDataCenter,
|
|
430
|
-
|
|
445
|
+
Be as RhDataCenterPanel,
|
|
431
446
|
Ue as RhDataCenterTip,
|
|
432
447
|
Ge as useRhDataCenter
|
|
433
448
|
};
|
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:104px;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}.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-
|
|
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:104px;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}.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-a3a35657]{position:relative;display:inline-flex;align-items:center}.rh-data-center__trigger[data-v-a3a35657]{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-a3a35657]:hover,.rh-data-center__trigger.is-active[data-v-a3a35657]{background:rgba(0,130,138,.08);color:var(--rh-ui-data-center-primary)}.rh-data-center__icon[data-v-a3a35657]{width:22px;margin-right:5px}.rh-data-center__popover[data-v-a3a35657]{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}}
|