-
zhangwei
2025-03-10 309cc3fe6303d8464951063e89fc9d623915501e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<template>
    <!--本文件由FirstUI授权予四川政采招投标咨询有限公司(会员ID: 16 3,营业执照号: 9 151 01313 32    0 06  19     3 K)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
    <view class="fui-timeaxis__node-wrap">
        <view class="fui-timeaxis__left" :style="{width:leftWidth+'rpx'}">
            <slot name="left"></slot>
        </view>
        <view class="fui-timeaxis__node-box" :style="{width:width+'rpx'}">
            <view class="fui-timeaxis__node">
                <slot></slot>
            </view>
            <view class="fui-timeaxis__line" :style="{background:lineColor,width:lineWidth+'px'}" v-if="lined"></view>
        </view>
        <view class="fui-timeaxis__content">
            <slot name="right"></slot>
        </view>
    </view>
</template>
 
<script>
    export default {
        name: "fui-timeaxis-node",
        inject: ['timeaxis'],
        props: {
            lined: {
                type: Boolean,
                default: true
            },
            lineColor: {
                type: String,
                default: '#ccc'
            }
        },
        data() {
            return {
                lineWidth: 1,
                width: 48,
                leftWidth: 0
            };
        },
        created() {
            this.init()
        },
        methods: {
            init() {
                if (this.timeaxis) {
                    this.width = this.timeaxis.width
                    this.lineWidth = this.timeaxis.lineWidth
                    this.leftWidth = this.timeaxis.leftWidth
                    this.timeaxis.children.push(this)
                }
            }
        }
    }
</script>
 
<style scoped>
    .fui-timeaxis__node-wrap {
        position: relative;
        /* #ifndef APP-NVUE */
        width: 100%;
        display: flex;
        /* #endif */
        flex-direction: row;
    }
 
    .fui-timeaxis__line {
        /* #ifdef APP-NVUE */
        width: 0.5px;
        /* #endif */
        /* #ifndef APP-NVUE */
        width: 1px;
        transform: scaleX(.5) translateZ(0);
        transform-origin: center center;
        /* #endif */
        flex: 1;
    }
 
    .fui-timeaxis__node-box {
        /* #ifndef APP-NVUE */
        display: flex;
        flex-shrink: 0;
        /* #endif */
        flex-direction: column;
        align-items: center;
        overflow: hidden;
    }
 
    .fui-timeaxis__node {
        /* #ifndef APP-NVUE */
        display: flex;
        /* #endif */
        align-items: center;
        justify-content: center;
    }
 
    .fui-timeaxis__left {
        /* #ifndef APP-NVUE */
        flex-shrink: 0;
        /* #endif */
        overflow: hidden;
    }
 
    .fui-timeaxis__content {
        /* #ifndef APP-NVUE */
        width: 100%;
        /* #endif */
        flex: 1;
    }
</style>