对tenantManagement页面进行微调

This commit is contained in:
高子兴 2024-07-05 23:23:39 +08:00
parent 5a52a58c0c
commit bb6dc0999f

View File

@ -67,9 +67,8 @@
<script lang="ts">
import tenantService from "../../services/tenantService.js";
import { onMounted, ref, defineComponent } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus'
import type { Action } from 'element-plus'
import {defineComponent, onMounted, ref} from 'vue';
import {ElMessage, ElMessageBox} from 'element-plus'
interface Tenant {
symbol: string;
@ -104,8 +103,7 @@ export default defineComponent({
const fetchData = async () => {
try {
const data = await tenantService.getAll();
tableData.value = data;
tableData.value = await tenantService.getAll();
} catch (error) {
console.error("Error fetching organization:", error);
}
@ -129,11 +127,11 @@ export default defineComponent({
const editFinished = async () => {
try {
await tenantService.update(formData.value);
ElMessageBox.alert('删除成功', '提示', {
await ElMessageBox.alert('删除成功', '提示', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: 'OK',
callback: (action: Action) => {
callback: (action) => {
ElMessage({
type: 'info',
message: `action: ${action}`,
@ -156,18 +154,18 @@ export default defineComponent({
const handleDelete = async () => {
try{
await tenantService.delete(formData.value);
ElMessageBox.alert('删除成功', '提示', {
await ElMessageBox.alert('删除成功', '提示', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: 'OK',
callback: (action: Action) => {
callback: (action) => {
ElMessage({
type: 'info',
message: `action: ${action}`,
})
},
})
fetchData();
await fetchData();
}catch(error){
}