From 02409bfbe15f22fc3b5dccadabfd860a660a49d9 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Sat, 11 Oct 2025 10:37:14 +0800
Subject: [PATCH] feat: 名称修改
---
src/views/device/components/DeviceSettingPopover.vue | 37 +++++++++++++------------------------
1 files changed, 13 insertions(+), 24 deletions(-)
diff --git a/src/views/device/components/DeviceSettingPopover.vue b/src/views/device/components/DeviceSettingPopover.vue
index d0531ba..fb90a89 100644
--- a/src/views/device/components/DeviceSettingPopover.vue
+++ b/src/views/device/components/DeviceSettingPopover.vue
@@ -1,49 +1,38 @@
<template>
- <a-popover
+ <el-popover
:visible="state.sVisible"
trigger="click"
- v-bind="$attrs"
:overlay-class-name="overlayClassName"
placement="bottom"
- @visibleChange=""
- v-on="$attrs"
+ width="200"
>
- <template #content>
+ <template #default>
<div class="title-content"></div>
<slot name="formContent" />
<div class="uranus-popconfirm-btns">
- <a-button size="sm" @click="onCancel">
+ <el-button @click="onCancel">
{{ cancelText || '取消' }}
- </a-button>
- <a-button
- size="sm"
+ </el-button>
+ <el-button
:loading="loading"
type="primary"
class="confirm-btn"
@click="onConfirm"
>
{{ okText || '确定' }}
- </a-button>
+ </el-button>
</div>
</template>
- <template v-if="$slots.default">
+ <template #reference>
<slot></slot>
</template>
- </a-popover>
+ </el-popover>
</template>
-<script lang="ts" setup>
+<script setup>
import { defineProps, defineEmits, reactive, watch, computed } from 'vue';
-const props = defineProps<{
- visible?: boolean;
- loading?: Boolean;
- disabled?: Boolean;
- title?: String;
- okText?: String;
- cancelText?: String;
- width?: Number;
-}>();
+const props = defineProps(['visible', 'loading', 'disabled', 'title', 'cancelText', 'okText', 'width']);
const emit = defineEmits(['cancel', 'confirm']);
@@ -71,14 +60,14 @@
return classList.join(' ');
});
-function onConfirm(e: Event) {
+function onConfirm(e) {
if (props.disabled) {
return;
}
emit('confirm', e);
}
-function onCancel(e: Event) {
+function onCancel(e) {
state.sVisible = false;
emit('cancel', e);
}
--
Gitblit v1.9.3