移动系统liao
3 天以前 0a4e5fc3bdfca328feb574f1564011abf2a35b76
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<template>
    <div class="flow-container">
        <el-dialog v-model="state.isShowDialog" :width="800" draggable :close-on-click-modal="false">
            <template #header>
                <div style="color: #fff">
                    <el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
                    <span>{{ props.title }}</span>
                </div>
            </template>
            <el-timeline>
                <el-timeline-item
                    v-for="(activity, index) in state.activities"
                    :key="index"
                    :icon="activity.icon"
                    :type="activity.type"
                    :color="activity.color"
                    :size="activity.size"
                    :hollow="activity.hollow"
                    :timestamp="activity.timestamp"
                    placement="top"
                >
                    <el-card shadow="hover">
                        <h4>{{ activity.content }}</h4>
                        <br />
                        <div class="demo-type">
                            <el-avatar :icon="UserFilled" />
                        </div>
                    </el-card>
                </el-timeline-item>
            </el-timeline>
            <!-- <template #footer>
                <span class="dialog-footer">
                    <el-button @click="cancel">取 消</el-button>
                </span>
            </template> -->
        </el-dialog>
    </div>
</template>
 
<script setup lang="ts">
import { reactive, ref, onMounted } from 'vue';
import type { FormRules } from 'element-plus';
 
var props = defineProps({
    title: {
        type: String,
        default: '',
    },
});
 
const emit = defineEmits(['reloadTable']);
const ruleFormRef = ref();
 
const state = reactive({
    loading: false,
    isShowDialog: false,
    ruleForm: {},
    circleUrl: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
    activities: [
        {
            content: 'Event start',
            timestamp: '2018-04-12 20:46',
            size: 'large',
            type: 'primary',
            user: 'admin',
        },
        {
            content: 'Approved',
            timestamp: '2018-04-13',
            color: '#0bbd87',
            user: 'admin',
        },
        {
            content: 'Approved',
            timestamp: '2018-04-11',
            color: '#0bbd87',
            user: 'admin',
        },
        {
            content: 'Success',
            timestamp: '2018-04-11 20:46',
            hollow: true,
            user: 'admin',
        },
    ],
});
 
const rules = ref<FormRules>({});
 
onMounted(() => {});
 
const openDialog = (row: any) => {
    state.ruleForm = JSON.parse(JSON.stringify(row));
    state.isShowDialog = true;
};
 
const closeDialog = () => {
    emit('reloadTable');
    state.isShowDialog = false;
};
 
const cancel = () => {
    state.isShowDialog = false;
};
 
defineExpose({ openDialog });
</script>
 
<style scoped lang="scss">
:deep(.el-select),
:deep(.el-input-number) {
    width: 100%;
}
.demo-type {
    display: flex;
}
.demo-type > div {
    flex: 1;
    text-align: center;
}
 
.demo-type > div:not(:last-child) {
    border-right: 1px solid var(--el-border-color);
}
</style>