2024-04-02 16:29:20 +08:00
|
|
|
<template>
|
|
|
|
<div ref="modal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false">
|
2024-04-19 22:28:00 +08:00
|
|
|
<div class="modal-dialog" role="document" :class="[{'!w-[900px]' : showingInfo}, {'!w-fit' : !showingInfo}]">
|
2024-04-02 16:29:20 +08:00
|
|
|
<div class="modal-content !p-0 bg-sn-white w-full h-full flex" :class="[{'flex-row': showingInfo}, {'flex-col': !showingInfo}]">
|
|
|
|
<div id="body-container" class="flex flex-row w-full h-full">
|
|
|
|
<!-- info -->
|
2024-04-19 22:28:00 +08:00
|
|
|
<div id="info-part" ref="infoPartRef">
|
2024-04-09 20:18:41 +08:00
|
|
|
<InfoComponent
|
2024-04-02 16:29:20 +08:00
|
|
|
v-if="showingInfo"
|
2024-04-09 20:18:41 +08:00
|
|
|
:infoParams="infoParams"
|
2024-04-02 16:29:20 +08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<!-- content -->
|
2024-04-09 20:18:41 +08:00
|
|
|
<div id="content-part" class="flex flex-col w-full p-6 gap-6">
|
2024-04-02 16:29:20 +08:00
|
|
|
<!-- header -->
|
2024-04-19 22:28:00 +08:00
|
|
|
<div id="info-modal-header" class="flex flex-col h-fit w-full gap-2">
|
|
|
|
<div id="title-part" class="flex flex-row h-fit w-full justify-between">
|
|
|
|
<div id="title-with-help" class="flex flex-row gap-3">
|
|
|
|
<h3 class="modal-title text-sn-dark-grey">{{ title }}</h3>
|
|
|
|
<button v-if="helpText" class="btn btn-light btn-sm" @click="showingInfo = !showingInfo">
|
|
|
|
<i class="sn-icon sn-icon-help-s"></i>
|
|
|
|
{{ helpText }}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<button id="close-btn" type="button" class="close my-auto" data-dismiss="modal" aria-label="Close">
|
|
|
|
<i class="sn-icon sn-icon-close"></i>
|
2024-04-02 16:29:20 +08:00
|
|
|
</button>
|
|
|
|
</div>
|
2024-04-19 22:28:00 +08:00
|
|
|
<div id="subtitle-part" class="text-sn-dark-grey">
|
|
|
|
{{ subtitle }}
|
|
|
|
</div>
|
2024-04-02 16:29:20 +08:00
|
|
|
</div>
|
|
|
|
<!-- main content -->
|
2024-04-09 20:18:41 +08:00
|
|
|
<div id="info-modal-main-content" class="h-full">
|
2024-04-02 16:29:20 +08:00
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import modalMixin from './modal_mixin';
|
|
|
|
import InfoComponent from './info_component.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'InfoModal',
|
|
|
|
props: {
|
2024-04-08 17:35:41 +08:00
|
|
|
title: {
|
2024-04-09 20:18:41 +08:00
|
|
|
type: String,
|
|
|
|
required: true
|
2024-04-08 17:35:41 +08:00
|
|
|
},
|
2024-04-19 22:28:00 +08:00
|
|
|
subtitle: {
|
|
|
|
type: String,
|
|
|
|
required: false
|
|
|
|
},
|
2024-04-08 17:35:41 +08:00
|
|
|
helpText: {
|
2024-04-09 20:18:41 +08:00
|
|
|
type: String,
|
2024-04-19 22:28:00 +08:00
|
|
|
required: false
|
2024-04-08 17:35:41 +08:00
|
|
|
},
|
|
|
|
infoParams: {
|
2024-04-02 16:29:20 +08:00
|
|
|
type: Object,
|
|
|
|
required: true
|
2024-04-08 17:35:41 +08:00
|
|
|
},
|
|
|
|
startHidden: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
2024-04-02 16:29:20 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mixins: [modalMixin],
|
2024-04-09 20:18:41 +08:00
|
|
|
components: { InfoComponent },
|
2024-04-02 16:29:20 +08:00
|
|
|
data() {
|
|
|
|
return {
|
2024-04-19 22:28:00 +08:00
|
|
|
showingInfo: false
|
2024-04-02 16:29:20 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|