Your Name
2022-06-27 0a3027eccd3b0bb6542e5fc831f7e02740dcfc95
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
<template>
    <div class="workflow-tool">
        <div class="pl15">{{ setToolTitle }}</div>
        <div class="workflow-tool-right">
            <div class="workflow-tool-icon" v-for="(v, k) in toolList" :key="k" :title="v.title" @click="onToolClick(v.fnName)">
                <SvgIcon :name="v.icon" />
            </div>
        </div>
    </div>
</template>
 
<script lang="ts">
import { defineComponent, computed, reactive, toRefs } from 'vue';
import { storeToRefs } from 'pinia';
import { useThemeConfig } from '/@/stores/themeConfig';
 
export default defineComponent({
    name: 'pagesWorkflowTool',
    setup(props, { emit }) {
        const storesThemeConfig = useThemeConfig();
        const { themeConfig } = storeToRefs(storesThemeConfig);
        const state = reactive({
            toolList: [
                { icon: 'ele-Help', title: '帮助', fnName: 'help' },
                { icon: 'ele-Download', title: '下载', fnName: 'download' },
                { icon: 'ele-Check', title: '提交', fnName: 'submit' },
                { icon: 'ele-DocumentCopy', title: '复制', fnName: 'copy' },
                { icon: 'ele-Delete', title: '删除', fnName: 'del' },
                { icon: 'ele-FullScreen', title: '全屏', fnName: 'fullscreen' },
            ],
        });
        // 设置 tool 标题
        const setToolTitle = computed(() => {
            let { globalTitle } = themeConfig.value;
            return `${globalTitle}工作流`;
        });
        // 顶部工具栏
        const onToolClick = (fnName: string) => {
            emit('tool', fnName);
        };
        return {
            setToolTitle,
            onToolClick,
            ...toRefs(state),
        };
    },
});
</script>
 
<style scoped lang="scss">
.workflow-tool {
    height: 35px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--el-border-color-light, #ebeef5);
    color: var(--el-text-color-primary);
    .workflow-tool-right {
        flex: 1;
        display: flex;
        justify-content: flex-end;
    }
    &-icon {
        padding: 0 10px;
        cursor: pointer;
        color: var(--next-bg-topBarColor);
        height: 35px;
        line-height: 35px;
        display: flex;
        align-items: center;
        &:hover {
            background: rgba(0, 0, 0, 0.04);
            i {
                display: inline-block;
                animation: logoAnimation 0.3s ease-in-out;
            }
        }
    }
}
</style>