This commit is contained in:
2023-06-30 17:15:25 +08:00
parent 680d6876ba
commit cf3fed6448
3 changed files with 388 additions and 375 deletions

View File

@ -113,3 +113,17 @@ export const tenantStatusDict = [
elTagType: "warning", elTagType: "warning",
}, },
]; ];
// 初始化状态
export const initStatusDict = [
{
label: "否",
value: "0",
elTagType: "warning",
},
{
label: "是",
value: "1",
elTagType: "success",
},
];

View File

@ -86,7 +86,7 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
:disabled="single" :disabled="single || ids[0].initialized === '1'"
icon="Refresh" icon="Refresh"
plain plain
type="primary" type="primary"
@ -127,9 +127,10 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="初始化状态"> <el-table-column align="center" label="初始化状态">
<template #default="{ row }"> <template #default="{ row }">
<el-tag :type="row.initialized === '1' ? 'success' : 'warning'" <!-- <el-tag :type="row.initialized === '1' ? 'success' : 'warning'"-->
>{{ row.initialized === "1" ? "是" : "否" }} <!-- >{{ row.initialized === "1" ? "是" : "否" }}-->
</el-tag> <!-- </el-tag>-->
<dict-tag :options="initStatusDict" :value="row.initialized" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="模式"> <el-table-column align="center" label="模式">
@ -381,22 +382,13 @@
<div v-if="showDatasourceAdvanced"> <div v-if="showDatasourceAdvanced">
<!-- initCount minCount maxCount --> <!-- initCount minCount maxCount -->
<el-form-item label="初始化连接数" prop="initCount"> <el-form-item label="初始化连接数" prop="initCount">
<el-input-number <el-input-number v-model="dataSourceForm.initCount" :min="0" />
v-model="dataSourceForm.initCount"
:min="0"
/>
</el-form-item> </el-form-item>
<el-form-item label="最小连接数" prop="minCount"> <el-form-item label="最小连接数" prop="minCount">
<el-input-number <el-input-number v-model="dataSourceForm.minCount" :min="0" />
v-model="dataSourceForm.minCount"
:min="0"
/>
</el-form-item> </el-form-item>
<el-form-item label="最大连接数" prop="maxCount"> <el-form-item label="最大连接数" prop="maxCount">
<el-input-number <el-input-number v-model="dataSourceForm.maxCount" :min="0" />
v-model="dataSourceForm.maxCount"
:min="0"
/>
</el-form-item> </el-form-item>
</div> </div>
</Transition> </Transition>
@ -501,7 +493,12 @@ import {
} from "@/api/tenant/tenant"; } from "@/api/tenant/tenant";
import { getCurrentInstance, reactive, ref, toRefs } from "vue"; import { getCurrentInstance, reactive, ref, toRefs } from "vue";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
import {database_type_dict, tenantModeDict, tenantStatusDict,} from "@/constant/dict"; import {
database_type_dict,
initStatusDict,
tenantModeDict,
tenantStatusDict,
} from "@/constant/dict";
import DictTag from "@/components/DictTag/index.vue"; import DictTag from "@/components/DictTag/index.vue";
import { cloneDeep } from "lodash-es"; import { cloneDeep } from "lodash-es";
import { ArrowRight } from "@element-plus/icons-vue"; import { ArrowRight } from "@element-plus/icons-vue";
@ -857,8 +854,7 @@ function handleDelete(row) {
getList(); getList();
proxy.$modal.msgSuccess("删除成功"); proxy.$modal.msgSuccess("删除成功");
}) })
.catch(() => { .catch(() => {});
});
} }
/** 导出按钮操作 */ /** 导出按钮操作 */

View File

@ -270,7 +270,8 @@ const tenantInitCheck = () => {
currentStepStatus.value = 2; currentStepStatus.value = 2;
activeStep.value = 0; activeStep.value = 0;
throw new Error("租户初始化检查失败"); throw new Error("租户初始化检查失败");
}).then((resp) => { })
.then((resp) => {
tenantInitCheckResult.value = resp; tenantInitCheckResult.value = resp;
if (resp.result === 200) { if (resp.result === 200) {
currentStepStatus.value = 2; currentStepStatus.value = 2;
@ -278,7 +279,7 @@ const tenantInitCheck = () => {
currentStepStatus.value = 0; currentStepStatus.value = 0;
throw new Error("租户初始化检查失败"); throw new Error("租户初始化检查失败");
} }
}) });
}; };
// 第二步: 创建数据库 // 第二步: 创建数据库
@ -291,7 +292,8 @@ const createDatabase = () => {
currentStepStatus.value = 2; currentStepStatus.value = 2;
activeStep.value = 1; activeStep.value = 1;
throw new Error("创建数据库失败"); throw new Error("创建数据库失败");
}).then((resp) => { })
.then((resp) => {
createTablesResult.value = resp; createTablesResult.value = resp;
if (resp.result === 200) { if (resp.result === 200) {
currentStepStatus.value = 2; currentStepStatus.value = 2;
@ -299,7 +301,7 @@ const createDatabase = () => {
currentStepStatus.value = 0; currentStepStatus.value = 0;
throw new Error("创建数据库失败"); throw new Error("创建数据库失败");
} }
}) });
}; };
// 第三步,导入数据 // 第三步,导入数据
@ -312,7 +314,8 @@ const importData = () => {
currentStepStatus.value = 2; currentStepStatus.value = 2;
activeStep.value = 2; activeStep.value = 2;
throw new Error("导入数据失败"); throw new Error("导入数据失败");
}).then((resp) => { })
.then((resp) => {
initDataResult.value = resp; initDataResult.value = resp;
if (resp.result === 200) { if (resp.result === 200) {
currentStepStatus.value = 2; currentStepStatus.value = 2;
@ -320,7 +323,7 @@ const importData = () => {
currentStepStatus.value = 0; currentStepStatus.value = 0;
throw new Error("导入数据失败"); throw new Error("导入数据失败");
} }
}) });
}; };
onMounted(() => { onMounted(() => {