|
@@ -1,56 +1,108 @@
|
|
|
<template>
|
|
|
<g class="flow-node__activity"
|
|
|
- v-if="status!=''">
|
|
|
+ :status="status"
|
|
|
+ >
|
|
|
<circle
|
|
|
class="flow-node__activity-background"
|
|
|
rx="0"
|
|
|
ry="0"
|
|
|
r="14"/>
|
|
|
+ >
|
|
|
|
|
|
- <g
|
|
|
- v-if="status=='running'"
|
|
|
- transform="rotate(0 0 0)">
|
|
|
- <animateTransform
|
|
|
- attributeType="xml"
|
|
|
- attributeName="transform"
|
|
|
- type="rotate"
|
|
|
- from="0"
|
|
|
- to="360"
|
|
|
- dur="1s"
|
|
|
- repeatCount="indefinite" />
|
|
|
- <object xlink:href="../../assets/icons/refresh.svg"/>
|
|
|
- <image
|
|
|
- x="-10"
|
|
|
- y="-10"
|
|
|
- width="20"
|
|
|
- height="20"
|
|
|
- xlink:href="../../assets/icons/refresh.svg"/>
|
|
|
- </g>
|
|
|
- <g v-if="status=='waiting'"/>
|
|
|
+ <icon-refresh v-if="status=='running'" v-bind="iconProps" class="flow-node__activity-icon" />
|
|
|
+ <icon-wait v-else-if="status=='waiting'" v-bind="iconProps" class="flow-node__activity-icon"/>
|
|
|
+ <icon-ok v-else-if="status=='finish'" v-bind="iconProps"class="flow-node__activity-icon"/>
|
|
|
+ <icon-question v-else v-bind="iconProps" class="flow-node__activity-icon" />
|
|
|
|
|
|
</g>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import IconWait from '@/assets/icons/wait.svg'
|
|
|
+import IconOk from '@/assets/icons/ok.svg'
|
|
|
+import IconQuestion from '@/assets/icons/question.svg'
|
|
|
+import IconRefresh from '@/assets/icons/refresh.svg'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'FlowNodeStatus',
|
|
|
- props: { status: {type: String, default: ''} }
|
|
|
+ components: {IconWait, IconOk, IconQuestion, IconRefresh},
|
|
|
+ props: { status: {type: String, default: ''} },
|
|
|
+ computed: {
|
|
|
+ iconProps () {
|
|
|
+ return {
|
|
|
+ x: -10,
|
|
|
+ y: -10,
|
|
|
+ viewBox: '-4 -4 72 72',
|
|
|
+ width: 20,
|
|
|
+ height: 20
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
+.flow-node__activity {
|
|
|
+ opacity:0.8;
|
|
|
+}
|
|
|
+
|
|
|
.flow-node__activity-background {
|
|
|
- fill: rgba(255,255,255,0.8);
|
|
|
+ fill: inherits;
|
|
|
+ transition: all .3s;
|
|
|
+}
|
|
|
+.flow-node__activity-icon{
|
|
|
+ width:20px;
|
|
|
+ height:20px;
|
|
|
+}
|
|
|
+.flow-node__activity-icon >* {
|
|
|
+ transform-origin: 50% 50%;
|
|
|
+ stroke-width: 8px;
|
|
|
+ stroke: inherits;
|
|
|
}
|
|
|
|
|
|
-.flow-node[status=running] .flow-node__body{
|
|
|
- stroke: yellow !important;
|
|
|
+.flow-node__activity[status=running] .flow-node__activity-icon >* {
|
|
|
+ -webkit-animation: spin 1s infinite linear;
|
|
|
+ -moz-animation: spin 1s infinite linear;
|
|
|
+ animation: spin 1s infinite linear;
|
|
|
+ stroke: #00C;
|
|
|
+}
|
|
|
+.flow-node__activity[status=waiting] .flow-node__activity-icon >* {
|
|
|
+ -webkit-animation: shake 1s infinite linear;
|
|
|
+ -moz-animation: shake 1s infinite linear;
|
|
|
+ animation: shake 1s infinite linear;
|
|
|
+}
|
|
|
+.flow-node__activity[status=finish] .flow-node__activity-icon >* {
|
|
|
+ stroke: #2C2;
|
|
|
}
|
|
|
|
|
|
-.flow-node[status=error] .flow-node__body{
|
|
|
- stroke: red !important;
|
|
|
+/*** ANIMATIONS ***/
|
|
|
+@-moz-keyframes spin {
|
|
|
+ from { -moz-transform: rotate(0deg); }
|
|
|
+ to { -moz-transform: rotate(-360deg); }
|
|
|
+}
|
|
|
+@-webkit-keyframes spin {
|
|
|
+ from { -webkit-transform: rotate(0deg); }
|
|
|
+ to { -webkit-transform: rotate(-360deg); }
|
|
|
}
|
|
|
-.flow-node[status=finished] .flow-node__body{
|
|
|
- stroke: green !important;
|
|
|
+@keyframes spin {
|
|
|
+ from {transform:rotate(0deg);}
|
|
|
+ to {transform:rotate(-360deg);}
|
|
|
+ }
|
|
|
+
|
|
|
+@keyframes shake {
|
|
|
+ 10%, 90% {
|
|
|
+ transform: rotate(-2deg);
|
|
|
+ }
|
|
|
+
|
|
|
+ 20%, 80% {
|
|
|
+ transform: rotate(4deg);
|
|
|
+ }
|
|
|
+
|
|
|
+ 30%, 50%, 70% {
|
|
|
+ transform: rotate(-7deg);
|
|
|
+ }
|
|
|
+ 40%, 60% {
|
|
|
+ transform: rotate(7deg);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
</style>
|