rhjy-ui 0.2.0 → 0.2.1
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/dist/data-center/index.cjs +1 -1
- package/dist/data-center/index.js +55 -55
- package/dist/style.css +1 -1
- package/package.json +4 -4
|
@@ -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({}),_=e.ref({}),u=e.computed(()=>i.categories.find(a=>a.key===c.value)||i.categories[0]),C=e.computed(()=>{var a;return String(((a=u.value)==null?void 0:a.key)??"")}),B=e.computed(()=>h.value[C.value]),T=e.computed(()=>p.value[C.value]===!0),E=e.computed(()=>k.value[C.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(_.value[n]&&!a)return;_.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||C.value!==n)return;h.value[n]=g}catch(g){if(y.value[n]!==l||C.value!==n)return;k.value[n]=g,d("error",g,s)}finally{y.value[n]===l&&(p.value[n]=!1,_.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,[T.value?(e.openBlock(),e.createBlock($,{key:0,text:"加载中..."})):E.value?e.renderSlot(a.$slots,"error",{key:1,error:E.value,retry:V},()=>[e.createVNode($,{text:"任务加载失败",retryable:!0,onRetry:V})]):(n=B.value)!=null&&n.items.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(B.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:B.value,category:u.value},()=>{var l;return[t.showTotal?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("span",null,e.toDisplayString(((l=B.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(),_=e.ref(!1),u=e.computed(()=>o.modelValue===void 0?d.value:o.modelValue),C=e.computed(()=>u.value?o.activeIcon||o.icon:o.icon||o.activeIcon),B=r=>typeof r=="number"?`${r}px`:r,T=r=>typeof r=="number"?r:Number.parseFloat(r)||0,E=()=>{const r=c.value,f=h.value;if(!r||!f)return;const m=r.getBoundingClientRect(),D=f.offsetWidth||T(o.width),x=T(o.panelRight),b=8,A=m.right-D-x,P=Math.min(Math.max(b,A),Math.max(b,window.innerWidth-D-b)),z=Math.min(m.bottom+8,Math.max(b,window.innerHeight-f.offsetHeight-b));k.value={top:`${z}px`,left:`${P}px`,width:B(o.width),"--rh-ui-data-center-panel-height":B(o.panelHeight)}},R=()=>{_.value||(_.value=!0,window.addEventListener("resize",E),window.addEventListener("scroll",E,!0))},V=()=>{_.value&&(_.value=!1,window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!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(),E(),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}])},[C.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:C.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-b6caa4d9"]]),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"},$=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,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as O, openBlock as l, createElementBlock as i, createElementVNode as h, toDisplayString as g, createCommentVNode as C, computed as
|
|
1
|
+
import { defineComponent as O, openBlock as l, createElementBlock as i, createElementVNode as h, toDisplayString as g, createCommentVNode as C, computed as L, normalizeClass as K, normalizeStyle as Q, Fragment as U, renderList as q, ref as m, onMounted as Z, renderSlot as b, createTextVNode as X, createBlock as Y, createVNode as S, onBeforeUnmount as ee, watch as oe, nextTick as le, withModifiers as j, Teleport as re, withCtx as V, normalizeProps as N, guardReactiveProps as H, resolveComponent as J } from "vue";
|
|
2
2
|
import { _ as ie } from "../_plugin-vue_export-helper-dad06003.js";
|
|
3
3
|
const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
4
4
|
__name: "RhDataCenterState",
|
|
@@ -35,11 +35,11 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
35
35
|
},
|
|
36
36
|
emits: ["action"],
|
|
37
37
|
setup(e, { emit: p }) {
|
|
38
|
-
const t = e, c = p, d =
|
|
38
|
+
const t = e, c = 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,
|
|
42
|
+
return (u, T) => {
|
|
43
43
|
var y;
|
|
44
44
|
return l(), i("div", ue, [
|
|
45
45
|
h("div", de, [
|
|
@@ -71,7 +71,7 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
71
71
|
]);
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
}), ke = "数据处理中心", ge = 606, Ce = 500,
|
|
74
|
+
}), ke = "数据处理中心", ge = 606, Ce = 500, Te = 1e3, be = "-此处仅展示近15天内的数据-", we = { 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 = {
|
|
@@ -85,38 +85,38 @@ 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
|
-
recentDaysText: { default:
|
|
88
|
+
recentDaysText: { default: be }
|
|
89
89
|
},
|
|
90
90
|
emits: ["close", "refresh", "task-action", "error"],
|
|
91
91
|
setup(e, { expose: p, emit: t }) {
|
|
92
|
-
const c = e, d = t, u = m(c.activeCategoryKey),
|
|
92
|
+
const c = e, d = t, u = m(c.activeCategoryKey), T = m({}), y = m({}), k = m({}), w = m({}), E = m({}), v = L(() => c.categories.find((n) => n.key === u.value) || c.categories[0]), A = L(() => {
|
|
93
93
|
var n;
|
|
94
94
|
return String(((n = v.value) == null ? void 0 : n.key) ?? "");
|
|
95
|
-
}),
|
|
95
|
+
}), R = L(() => T.value[A.value]), M = L(() => y.value[A.value] === !0), D = L(() => k.value[A.value]), z = (n) => {
|
|
96
96
|
var a;
|
|
97
|
-
const r =
|
|
97
|
+
const r = T.value[String(n.key)];
|
|
98
98
|
return ((a = r == null ? void 0 : r.counts) == null ? void 0 : a[String(n.key)]) ?? (r == null ? void 0 : r.total);
|
|
99
99
|
}, x = async (n = !1) => {
|
|
100
100
|
const r = v.value;
|
|
101
101
|
if (!r)
|
|
102
102
|
return;
|
|
103
103
|
const a = String(r.key);
|
|
104
|
-
if (
|
|
104
|
+
if (E.value[a] && !n)
|
|
105
105
|
return;
|
|
106
|
-
|
|
106
|
+
E.value[a] = !0, y.value[a] = !0, k.value[a] = void 0;
|
|
107
107
|
const s = (w.value[a] || 0) + 1;
|
|
108
108
|
w.value[a] = s, d("refresh", r);
|
|
109
109
|
try {
|
|
110
110
|
const $ = await c.loadTasks({ category: r });
|
|
111
|
-
if (w.value[a] !== s ||
|
|
111
|
+
if (w.value[a] !== s || A.value !== a)
|
|
112
112
|
return;
|
|
113
|
-
|
|
113
|
+
T.value[a] = $;
|
|
114
114
|
} catch ($) {
|
|
115
|
-
if (w.value[a] !== s ||
|
|
115
|
+
if (w.value[a] !== s || A.value !== a)
|
|
116
116
|
return;
|
|
117
117
|
k.value[a] = $, d("error", $, r);
|
|
118
118
|
} finally {
|
|
119
|
-
w.value[a] === s && (y.value[a] = !1,
|
|
119
|
+
w.value[a] === s && (y.value[a] = !1, E.value[a] = !1);
|
|
120
120
|
}
|
|
121
121
|
}, B = async (n) => {
|
|
122
122
|
u.value !== n.key && (u.value = n.key, await x());
|
|
@@ -146,7 +146,7 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
146
146
|
]),
|
|
147
147
|
h("section", Ae, [
|
|
148
148
|
h("div", De, [
|
|
149
|
-
|
|
149
|
+
b(n.$slots, "header", { category: v.value }, () => [
|
|
150
150
|
r[2] || (r[2] = X("数据处理进度", -1))
|
|
151
151
|
]),
|
|
152
152
|
e.closeable ? (l(), i("button", {
|
|
@@ -157,12 +157,12 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
157
157
|
}, "关闭")) : C("", !0)
|
|
158
158
|
]),
|
|
159
159
|
h("div", Le, [
|
|
160
|
-
M.value ? (l(), Y(W, {
|
|
160
|
+
M.value && !R.value ? (l(), Y(W, {
|
|
161
161
|
key: 0,
|
|
162
162
|
text: "加载中..."
|
|
163
|
-
})) :
|
|
163
|
+
})) : D.value && !R.value ? b(n.$slots, "error", {
|
|
164
164
|
key: 1,
|
|
165
|
-
error:
|
|
165
|
+
error: D.value,
|
|
166
166
|
retry: x
|
|
167
167
|
}, () => [
|
|
168
168
|
S(W, {
|
|
@@ -170,7 +170,7 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
170
170
|
retryable: !0,
|
|
171
171
|
onRetry: x
|
|
172
172
|
})
|
|
173
|
-
]) : (a =
|
|
173
|
+
]) : (a = R.value) != null && a.items.length ? (l(!0), i(U, { key: 2 }, q(R.value.items, (s) => b(n.$slots, "task", {
|
|
174
174
|
key: s.id,
|
|
175
175
|
task: s,
|
|
176
176
|
category: v.value,
|
|
@@ -180,21 +180,21 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
180
180
|
task: s,
|
|
181
181
|
onAction: ($) => P($, s)
|
|
182
182
|
}, null, 8, ["task", "onAction"])
|
|
183
|
-
])), 128)) :
|
|
183
|
+
])), 128)) : b(n.$slots, "empty", {
|
|
184
184
|
key: 3,
|
|
185
185
|
category: v.value
|
|
186
186
|
}, () => [
|
|
187
187
|
S(W, { text: "暂无任务" })
|
|
188
188
|
])
|
|
189
189
|
]),
|
|
190
|
-
|
|
191
|
-
result:
|
|
190
|
+
b(n.$slots, "footer", {
|
|
191
|
+
result: R.value,
|
|
192
192
|
category: v.value
|
|
193
193
|
}, () => {
|
|
194
194
|
var s;
|
|
195
195
|
return [
|
|
196
196
|
e.showTotal ? (l(), i("div", Ve, [
|
|
197
|
-
h("span", null, g(((s =
|
|
197
|
+
h("span", null, g(((s = R.value) == null ? void 0 : s.total) || 0) + "条记录", 1),
|
|
198
198
|
h("span", null, g(e.recentDaysText), 1)
|
|
199
199
|
])) : C("", !0)
|
|
200
200
|
];
|
|
@@ -208,9 +208,9 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
208
208
|
const d = c.target;
|
|
209
209
|
if (!d)
|
|
210
210
|
return;
|
|
211
|
-
e.some((
|
|
211
|
+
e.some((T) => {
|
|
212
212
|
var y;
|
|
213
|
-
return (y = Be(
|
|
213
|
+
return (y = Be(T)) == null ? void 0 : y.contains(d);
|
|
214
214
|
}) || p();
|
|
215
215
|
};
|
|
216
216
|
Z(() => document.addEventListener("click", t, !0)), ee(() => document.removeEventListener("click", t, !0));
|
|
@@ -224,7 +224,7 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
224
224
|
width: { default: ge },
|
|
225
225
|
panelHeight: { default: Ce },
|
|
226
226
|
panelRight: { default: 0 },
|
|
227
|
-
pollInterval: { default:
|
|
227
|
+
pollInterval: { default: Te },
|
|
228
228
|
refreshOnOpen: { type: Boolean, default: !0 },
|
|
229
229
|
closeOnClickOutside: { type: Boolean, default: !0 },
|
|
230
230
|
icon: { default: "" },
|
|
@@ -232,8 +232,8 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
232
232
|
},
|
|
233
233
|
emits: ["update:modelValue", "open", "close", "refresh", "task-action", "error"],
|
|
234
234
|
setup(e, { emit: p }) {
|
|
235
|
-
const t = e, c = p, d = m(!1), u = m(null),
|
|
236
|
-
const o = u.value, _ =
|
|
235
|
+
const t = e, c = p, d = m(!1), u = m(null), T = m(null), y = m(null), k = m({}), w = 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, M = (o) => typeof o == "number" ? o : Number.parseFloat(o) || 0, D = () => {
|
|
236
|
+
const o = u.value, _ = T.value;
|
|
237
237
|
if (!o || !_)
|
|
238
238
|
return;
|
|
239
239
|
const f = o.getBoundingClientRect(), F = _.offsetWidth || M(t.width), te = M(t.panelRight), I = 8, ae = f.right - F - te, ne = Math.min(
|
|
@@ -246,13 +246,13 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
246
246
|
k.value = {
|
|
247
247
|
top: `${se}px`,
|
|
248
248
|
left: `${ne}px`,
|
|
249
|
-
width:
|
|
250
|
-
"--rh-ui-data-center-panel-height":
|
|
249
|
+
width: R(t.width),
|
|
250
|
+
"--rh-ui-data-center-panel-height": R(t.panelHeight)
|
|
251
251
|
};
|
|
252
252
|
}, z = () => {
|
|
253
|
-
|
|
253
|
+
E.value || (E.value = !0, window.addEventListener("resize", D), window.addEventListener("scroll", D, !0));
|
|
254
254
|
}, x = () => {
|
|
255
|
-
|
|
255
|
+
E.value && (E.value = !1, window.removeEventListener("resize", D), window.removeEventListener("scroll", D, !0));
|
|
256
256
|
}, B = () => {
|
|
257
257
|
w.value !== void 0 && (window.clearInterval(w.value), w.value = void 0);
|
|
258
258
|
}, P = () => {
|
|
@@ -278,8 +278,8 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
278
278
|
document.removeEventListener("visibilitychange", G);
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
|
-
await le(),
|
|
282
|
-
}, { immediate: !0 }), Pe([u,
|
|
281
|
+
await le(), D(), z(), document.addEventListener("visibilitychange", G), t.refreshOnOpen && P(), n();
|
|
282
|
+
}, { immediate: !0 }), Pe([u, T], () => {
|
|
283
283
|
t.closeOnClickOutside && v.value && s();
|
|
284
284
|
}), ee(() => {
|
|
285
285
|
B(), x(), document.removeEventListener("visibilitychange", G);
|
|
@@ -290,7 +290,7 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
290
290
|
class: "rh-data-center",
|
|
291
291
|
onClick: j($, ["stop"])
|
|
292
292
|
}, [
|
|
293
|
-
|
|
293
|
+
b(o.$slots, "trigger", {
|
|
294
294
|
visible: v.value,
|
|
295
295
|
open: a,
|
|
296
296
|
close: s,
|
|
@@ -299,9 +299,9 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
299
299
|
h("span", {
|
|
300
300
|
class: K(["rh-data-center__trigger", { "is-active": v.value }])
|
|
301
301
|
}, [
|
|
302
|
-
|
|
302
|
+
A.value ? (l(), i("img", {
|
|
303
303
|
key: 0,
|
|
304
|
-
src:
|
|
304
|
+
src: A.value,
|
|
305
305
|
class: "rh-data-center__icon",
|
|
306
306
|
alt: ""
|
|
307
307
|
}, null, 8, Ie)) : C("", !0),
|
|
@@ -313,7 +313,7 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
313
313
|
v.value ? (l(), i("div", {
|
|
314
314
|
key: 0,
|
|
315
315
|
ref_key: "contentRef",
|
|
316
|
-
ref:
|
|
316
|
+
ref: T,
|
|
317
317
|
class: "rh-data-center__popover",
|
|
318
318
|
style: Q(k.value),
|
|
319
319
|
onClick: _[3] || (_[3] = j(() => {
|
|
@@ -330,22 +330,22 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
330
330
|
onTaskAction: _[1] || (_[1] = (f) => c("task-action", f)),
|
|
331
331
|
onError: _[2] || (_[2] = (f, F) => c("error", f, F))
|
|
332
332
|
}, {
|
|
333
|
-
header:
|
|
334
|
-
|
|
333
|
+
header: V((f) => [
|
|
334
|
+
b(o.$slots, "header", N(H(f)), () => [
|
|
335
335
|
_[4] || (_[4] = X("数据处理进度", -1))
|
|
336
336
|
], !0)
|
|
337
337
|
]),
|
|
338
|
-
task:
|
|
339
|
-
|
|
338
|
+
task: V((f) => [
|
|
339
|
+
b(o.$slots, "task", N(H(f)), void 0, !0)
|
|
340
340
|
]),
|
|
341
|
-
empty:
|
|
342
|
-
|
|
341
|
+
empty: V((f) => [
|
|
342
|
+
b(o.$slots, "empty", N(H(f)), void 0, !0)
|
|
343
343
|
]),
|
|
344
|
-
error:
|
|
345
|
-
|
|
344
|
+
error: V((f) => [
|
|
345
|
+
b(o.$slots, "error", N(H(f)), void 0, !0)
|
|
346
346
|
]),
|
|
347
|
-
footer:
|
|
348
|
-
|
|
347
|
+
footer: V((f) => [
|
|
348
|
+
b(o.$slots, "footer", N(H(f)), void 0, !0)
|
|
349
349
|
]),
|
|
350
350
|
_: 3
|
|
351
351
|
}, 8, ["categories", "load-tasks"])
|
|
@@ -354,7 +354,7 @@ const ce = { class: "rh-data-center-panel__state" }, W = /* @__PURE__ */ O({
|
|
|
354
354
|
], 64));
|
|
355
355
|
}
|
|
356
356
|
});
|
|
357
|
-
const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-
|
|
357
|
+
const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-94eef479"]]), He = {
|
|
358
358
|
key: 0,
|
|
359
359
|
class: "rh-data-center-tip__guide"
|
|
360
360
|
}, Se = { class: "rh-data-center-tip__content" }, Oe = {
|
|
@@ -380,7 +380,7 @@ const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-b6caa4d9"]]), He = {
|
|
|
380
380
|
t("update:modelValue", !1), t("close");
|
|
381
381
|
};
|
|
382
382
|
return (d, u) => {
|
|
383
|
-
const
|
|
383
|
+
const T = J("el-button"), y = J("el-dialog");
|
|
384
384
|
return l(), Y(y, {
|
|
385
385
|
"model-value": e.modelValue,
|
|
386
386
|
title: e.title || "提示",
|
|
@@ -389,23 +389,23 @@ const Ke = /* @__PURE__ */ ie(Ne, [["__scopeId", "data-v-b6caa4d9"]]), He = {
|
|
|
389
389
|
"onUpdate:modelValue": u[0] || (u[0] = (k) => t("update:modelValue", k)),
|
|
390
390
|
onClose: c
|
|
391
391
|
}, {
|
|
392
|
-
footer:
|
|
393
|
-
S(
|
|
392
|
+
footer: V(() => [
|
|
393
|
+
S(T, {
|
|
394
394
|
type: "primary",
|
|
395
395
|
onClick: c
|
|
396
396
|
}, {
|
|
397
|
-
default:
|
|
397
|
+
default: V(() => [...u[1] || (u[1] = [
|
|
398
398
|
X("关闭弹框", -1)
|
|
399
399
|
])]),
|
|
400
400
|
_: 1
|
|
401
401
|
})
|
|
402
402
|
]),
|
|
403
|
-
default:
|
|
403
|
+
default: V(() => [
|
|
404
404
|
e.showGuideAnimation ? (l(), i("div", He)) : C("", !0),
|
|
405
405
|
h("div", Se, [
|
|
406
406
|
e.minutes !== void 0 ? (l(), i("span", Oe, g((e.title || "任务处理中,大概需要") + e.minutes + "分钟"), 1)) : C("", !0),
|
|
407
407
|
e.content ? (l(), i("div", Me, g(e.content), 1)) : C("", !0),
|
|
408
|
-
|
|
408
|
+
b(d.$slots, "extra")
|
|
409
409
|
])
|
|
410
410
|
]),
|
|
411
411
|
_: 3
|
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-94eef479]{position:relative;display:inline-flex;align-items:center}.rh-data-center__trigger[data-v-94eef479]{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-94eef479]:hover,.rh-data-center__trigger.is-active[data-v-94eef479]{background:rgba(0,130,138,.08);color:var(--rh-ui-data-center-primary)}.rh-data-center__icon[data-v-94eef479]{width:22px;margin-right:5px}.rh-data-center__popover[data-v-94eef479]{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}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rhjy-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Vue 3 and Element Plus business UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"pack:check": "npm pack --dry-run"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@element-plus/icons-vue": "
|
|
43
|
-
"element-plus": "
|
|
44
|
-
"vue": "
|
|
42
|
+
"@element-plus/icons-vue": ">=1.1.4 <3",
|
|
43
|
+
"element-plus": ">=2.4.0 <3",
|
|
44
|
+
"vue": ">=3.2.0 <4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@vitejs/plugin-vue": "^4.1.0",
|