index.vue 4.39 KB
<template>
    <section class="applications" v-show="isVisible">
        <Card :title="$t('applications')" customClass="applications-list">
            <template v-slot:component>
                <div class="content">
                    <div class="application">
                        <Applications />
                    </div>
                    <div>
                        <span v-text="$t('materials')" />
                        <div class="material">
                            <Materials />
                        </div>
                    </div>
                    <div style="margin-top: 4px">
                        <span v-text="$t('parameters')" />
                        <div class="parameter">
                            <Parameters />
                        </div>
                    </div>
                    <div>
                        <div class="save-button">
                            <span class="button-hollow" v-text="$t('saveDraft')" @click="onSaveDraft" />
                            <span class="button-hollow" v-text="$t('slice')" @click="onSliceButton" />
                        </div>
                        <div class="send-button">
                            <span class="button-big" v-text="$t('sliceAndSend')" @click="onSendToPrinterButton" />
                        </div>
                    </div>
                </div>
            </template>
        </Card>
    </section>
</template>
<script setup>
import Card from '@/components/simple-card.vue';
import { ref } from 'vue';
import { useApplicationSettingIndexStore } from '@/views/stores/applications/useApplicationSettingIndexStore';

import Applications from './applications.vue';
import Materials from './materials.vue';
import Parameters from './parameters.vue';

const store = useApplicationSettingIndexStore();
const { setSliceMessageBoxVisible, setSendToPrinterModalVisible, handleSaveDraft } = store;

const isVisible = ref(true);

const onSaveDraft = () => {
    handleSaveDraft();
};

const onSliceButton = () => {
    setSliceMessageBoxVisible(true);
};

const onSendToPrinterButton = () => {
    setSendToPrinterModalVisible(true);
};
</script>
<style lang="less">
.applications-list {
    width: unset !important;
    padding: 5px 12px 15px 12px !important;
    .header {
        margin-bottom: 8px !important;
    }
    height: 480px !important;
    overflow-y: auto;
}
.applications {
    .content {
        display: flex;
        flex-direction: column;
        .application {
            height: calc(190px * 943 / 1008);
        }
        .material {
            margin-top: 4px;
            height: calc(35px * 943 / 1008);
        }
        .parameter {
            height: calc(100px * 943 / 1008);
        }
        .save-button {
            display: flex;
            justify-content: space-between;
            margin-top: 3px;
            .button-hollow {
                font-size: 14px !important;
                padding: 0px 0px !important;
            }
        }
        .send-button {
            margin-top: 10px;
            .button-big {
                width: 100%;
                font-size: 14px !important;
                padding: 0px 0px !important;
            }
        }
    }
}
@media screen and (min-height: 950px) {
    .applications-list {
        height: 55vh !important;
        padding: 12px !important;
    }
    .applications {
        .content {
            .application {
                height: calc(190px * 943 / 1008) !important;
                padding: 12px 0;
            }
            .material {
                height: calc(70px * 943 / 1008) !important;
            }
            .save-button {
                margin-top: 12px;
            }
        }
    }
}
@media screen and (max-height: 920px) {
    .applications-list {
        height: 50vh !important;
    }
}
@media screen and (max-height: 891px) {
    .applications-list {
        height: 45vh !important;
    }
}
@media screen and (max-height: 828px) {
    .applications-list {
        height: 40vh !important;
    }
}
@media screen and (max-height: 730px) {
    .applications-list {
        height: 35vh !important;
    }
}
@media screen and (max-height: 650px) {
    .applications-list {
        height: 288px !important;
    }
}
@media screen and (max-height: 619px) {
    .applications-list {
        height: 23vh !important;
    }
}
@media screen and (max-height: 570px) {
    .applications-list {
        height: 188px !important;
    }
}
</style>