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",
},
];
// 初始化状态
export const initStatusDict = [
{
label: "否",
value: "0",
elTagType: "warning",
},
{
label: "是",
value: "1",
elTagType: "success",
},
];

View File

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

View File

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