1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <template>
- <a-modal v-model:visible="visible" :title="title" @ok="handleOk" @cancel="handleCancel">
- <div class="modal-container">
- <div class="vent-flex-row">
- <ExclamationCircleFilled style="color: #ffb700; font-size: 30px" />
- <div class="warning-text">您是否要进行{{ title }}操作?</div>
- </div>
- <div v-if="type == '10' || type == '11'">
- <div class="vent-flex-row input-box">
- <div class="label">风窗开启角度:</div>
- <a-input-number size="small" placeholder="0" :min="0" v-model:value="value" />
- </div>
- </div>
- <div v-if="type == 'gasTest'">
- <div class="vent-flex-row input-box">
- <div class="label">{{ title }}:</div>
- <a-input-number size="small" placeholder="0" :min="0" v-model:value="value" />
- </div>
- </div>
- <div class="vent-flex-row input-box">
- <div class="label">操作密码:</div>
- <a-input size="small" type="password" v-model:value="passWord" />
- </div>
- </div>
- </a-modal>
- </template>
- <script setup lang="ts">
- import { watch, ref } from 'vue';
- import { ExclamationCircleFilled } from '@ant-design/icons-vue';
- const props = defineProps({
- modalIsShow: {
- type: Boolean,
- default: false,
- },
- modalTitle: {
- type: String,
- default: '',
- },
- modalType: {
- type: String,
- default: '',
- },
- });
- const emit = defineEmits(['handleOk', 'handleCancel']);
- const visible = ref<Boolean>(false);
- const title = ref<String>('');
- const type = ref<String>('');
- const passWord = ref('');
- const value = ref(0);
- watch([() => props.modalIsShow, () => props.modalTitle, () => props.modalType], ([newVal, newModalTitle, newModalType]) => {
- visible.value = newVal;
- if (newModalTitle) title.value = newModalTitle;
- if (newModalType) type.value = newModalType;
- passWord.value = '';
- });
- function handleOk() {
- //
- if (type.value == '10') {
- emit('handleOk', passWord.value, type.value, value.value);
- } else {
- emit('handleOk', passWord.value, type.value, value.value);
- }
- }
- function handleCancel() {
- //
- emit('handleCancel');
- }
- </script>
- <style scoped lang="less">
- @ventSpace: zxm;
- .label {
- width: 120px;
- }
- .@{ventSpace}-input {
- width: 150px;
- }
- .@{ventSpace}-input-number {
- width: 150px;
- }
- </style>
|