2021-07-28 18:03:19 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div>
|
2023-09-05 12:49:12 +08:00
|
|
|
|
<el-dialog
|
|
|
|
|
|
:title="title"
|
|
|
|
|
|
v-model="dialogVisible"
|
|
|
|
|
|
@open="open"
|
|
|
|
|
|
:before-close="cancel"
|
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
|
:destroy-on-close="true"
|
|
|
|
|
|
width="38%"
|
|
|
|
|
|
>
|
2023-07-03 21:42:04 +08:00
|
|
|
|
<el-form :model="form" ref="dbForm" :rules="rules" label-width="auto">
|
2023-12-05 23:03:51 +08:00
|
|
|
|
<el-form-item ref="tagSelectRef" prop="tagId" label="标签" required>
|
|
|
|
|
|
<tag-tree-select
|
|
|
|
|
|
@change-tag="
|
|
|
|
|
|
(tagIds) => {
|
|
|
|
|
|
form.tagId = tagIds;
|
|
|
|
|
|
tagSelectRef.validate();
|
|
|
|
|
|
}
|
|
|
|
|
|
"
|
|
|
|
|
|
multiple
|
2024-02-29 22:12:50 +08:00
|
|
|
|
:select-tags="form.tagId"
|
2023-12-05 23:03:51 +08:00
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
/>
|
2023-08-30 22:41:42 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
2023-10-09 17:29:52 +08:00
|
|
|
|
<el-form-item prop="instanceId" label="数据库实例" required>
|
2023-09-05 12:49:12 +08:00
|
|
|
|
<el-select
|
|
|
|
|
|
:disabled="form.id !== undefined"
|
|
|
|
|
|
remote
|
|
|
|
|
|
:remote-method="getInstances"
|
2023-10-27 17:41:45 +08:00
|
|
|
|
@change="changeInstance"
|
2024-04-12 13:24:20 +08:00
|
|
|
|
v-model="state.selectInstalce"
|
|
|
|
|
|
value-key="id"
|
2023-09-05 12:49:12 +08:00
|
|
|
|
placeholder="请输入实例名称搜索并选择实例"
|
|
|
|
|
|
filterable
|
|
|
|
|
|
clearable
|
|
|
|
|
|
class="w100"
|
|
|
|
|
|
>
|
2024-04-12 13:24:20 +08:00
|
|
|
|
<el-option v-for="item in state.instances" :key="item.id" :label="`${item.name}`" :value="item">
|
2023-09-05 12:49:12 +08:00
|
|
|
|
{{ item.name }}
|
|
|
|
|
|
<el-divider direction="vertical" border-style="dashed" />
|
|
|
|
|
|
|
|
|
|
|
|
{{ item.type }} / {{ item.host }}:{{ item.port }}
|
|
|
|
|
|
<el-divider direction="vertical" border-style="dashed" />
|
|
|
|
|
|
{{ item.username }}
|
|
|
|
|
|
</el-option>
|
2023-08-30 22:41:42 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
2024-04-12 13:24:20 +08:00
|
|
|
|
<el-form-item prop="authCertName" label="授权凭证" required>
|
|
|
|
|
|
<el-select @focus="getAuthCerts" @change="changeAuthCert" v-model="form.authCertName" placeholder="请选择授权凭证" filterable>
|
|
|
|
|
|
<el-option v-for="item in state.authCerts" :key="item.id" :label="`${item.name}`" :value="item.name">
|
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
|
|
|
|
|
|
|
<el-divider direction="vertical" border-style="dashed" />
|
|
|
|
|
|
{{ item.username }}
|
|
|
|
|
|
|
|
|
|
|
|
<el-divider direction="vertical" border-style="dashed" />
|
|
|
|
|
|
<EnumTag :value="item.ciphertextType" :enums="AuthCertCiphertextTypeEnum" />
|
|
|
|
|
|
|
|
|
|
|
|
<el-divider direction="vertical" border-style="dashed" />
|
|
|
|
|
|
{{ item.remark }}
|
|
|
|
|
|
</el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
2024-04-06 18:19:17 +08:00
|
|
|
|
<el-form-item prop="code" label="编号" required>
|
2024-04-09 12:55:51 +08:00
|
|
|
|
<el-input :disabled="form.id" v-model.trim="form.code" placeholder="请输入编号 (数字字母下划线), 不可修改" auto-complete="off"></el-input>
|
2024-04-06 18:19:17 +08:00
|
|
|
|
</el-form-item>
|
2023-10-09 17:29:52 +08:00
|
|
|
|
<el-form-item prop="name" label="别名" required>
|
2023-08-30 22:41:42 +08:00
|
|
|
|
<el-input v-model.trim="form.name" placeholder="请输入数据库别名" auto-complete="off"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
2024-01-17 08:37:22 +00:00
|
|
|
|
<el-form-item prop="database" label="数据库名">
|
2023-09-05 12:49:12 +08:00
|
|
|
|
<el-select
|
2024-01-17 08:37:22 +00:00
|
|
|
|
v-model="dbNamesSelected"
|
2023-09-05 12:49:12 +08:00
|
|
|
|
multiple
|
|
|
|
|
|
clearable
|
|
|
|
|
|
collapse-tags
|
|
|
|
|
|
collapse-tags-tooltip
|
|
|
|
|
|
filterable
|
2024-01-17 08:37:22 +00:00
|
|
|
|
:filter-method="filterDbNames"
|
2023-09-05 12:49:12 +08:00
|
|
|
|
allow-create
|
|
|
|
|
|
placeholder="请确保数据库实例信息填写完整后获取库名"
|
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
|
>
|
2024-01-17 08:37:22 +00:00
|
|
|
|
<template #header>
|
|
|
|
|
|
<el-checkbox v-model="checkAllDbNames" :indeterminate="indeterminateDbNames" @change="handleCheckAll"> 全选 </el-checkbox>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<el-option v-for="db in state.dbNamesFiltered" :key="db" :label="db" :value="db" />
|
2023-09-05 12:49:12 +08:00
|
|
|
|
</el-select>
|
2023-08-30 22:41:42 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
2023-10-09 17:29:52 +08:00
|
|
|
|
<el-form-item prop="remark" label="备注">
|
2023-08-30 22:41:42 +08:00
|
|
|
|
<el-input v-model.trim="form.remark" auto-complete="off" type="textarea"></el-input>
|
|
|
|
|
|
</el-form-item>
|
2024-02-29 22:12:50 +08:00
|
|
|
|
|
|
|
|
|
|
<procdef-select-form-item v-model="form.flowProcdefKey" />
|
2021-07-28 18:03:19 +08:00
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
|
<div class="dialog-footer">
|
2022-01-12 16:00:31 +08:00
|
|
|
|
<el-button @click="cancel()">取 消</el-button>
|
2023-12-11 01:00:09 +08:00
|
|
|
|
<el-button type="primary" :loading="saveBtnLoading" @click="btnOk">确 定</el-button>
|
2021-07-28 18:03:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2022-10-29 20:08:15 +08:00
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
import { toRefs, reactive, watch, ref } from 'vue';
|
2021-07-28 18:03:19 +08:00
|
|
|
|
import { dbApi } from './api';
|
|
|
|
|
|
import { ElMessage } from 'element-plus';
|
2023-12-05 23:03:51 +08:00
|
|
|
|
import TagTreeSelect from '../component/TagTreeSelect.vue';
|
2024-01-17 08:37:22 +00:00
|
|
|
|
import type { CheckboxValueType } from 'element-plus';
|
2024-02-29 22:12:50 +08:00
|
|
|
|
import ProcdefSelectFormItem from '@/views/flow/components/ProcdefSelectFormItem.vue';
|
2024-03-01 04:03:03 +00:00
|
|
|
|
import { DbType } from '@/views/ops/db/dialect';
|
2024-04-06 18:19:17 +08:00
|
|
|
|
import { ResourceCodePattern } from '@/common/pattern';
|
2024-04-12 13:24:20 +08:00
|
|
|
|
import { resourceAuthCertApi } from '../tag/api';
|
|
|
|
|
|
import { TagResourceTypeEnum } from '@/common/commonEnum';
|
|
|
|
|
|
import EnumTag from '@/components/enumtag/EnumTag.vue';
|
|
|
|
|
|
import { AuthCertCiphertextTypeEnum } from '../tag/enums';
|
2021-07-28 18:03:19 +08:00
|
|
|
|
|
2022-10-29 20:08:15 +08:00
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
visible: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
},
|
|
|
|
|
|
db: {
|
|
|
|
|
|
type: [Boolean, Object],
|
|
|
|
|
|
},
|
|
|
|
|
|
title: {
|
|
|
|
|
|
type: String,
|
2022-10-26 20:49:29 +08:00
|
|
|
|
},
|
2023-07-06 20:59:22 +08:00
|
|
|
|
});
|
2022-10-29 20:08:15 +08:00
|
|
|
|
|
|
|
|
|
|
//定义事件
|
2023-07-06 20:59:22 +08:00
|
|
|
|
const emit = defineEmits(['update:visible', 'cancel', 'val-change']);
|
2022-10-29 20:08:15 +08:00
|
|
|
|
|
|
|
|
|
|
const rules = {
|
|
|
|
|
|
tagId: [
|
|
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: '请选择标签',
|
|
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
2023-08-30 22:41:42 +08:00
|
|
|
|
|
|
|
|
|
|
instanceId: [
|
2022-10-29 20:08:15 +08:00
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
2023-08-30 22:41:42 +08:00
|
|
|
|
message: '请选择数据库实例',
|
2022-10-29 20:08:15 +08:00
|
|
|
|
trigger: ['change', 'blur'],
|
2021-07-28 18:03:19 +08:00
|
|
|
|
},
|
2022-10-29 20:08:15 +08:00
|
|
|
|
],
|
2024-04-06 18:19:17 +08:00
|
|
|
|
code: [
|
|
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: '请输入编码',
|
|
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
pattern: ResourceCodePattern.pattern,
|
|
|
|
|
|
message: ResourceCodePattern.message,
|
|
|
|
|
|
trigger: ['blur'],
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
2023-08-30 22:41:42 +08:00
|
|
|
|
name: [
|
2022-10-29 20:08:15 +08:00
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
2023-08-30 22:41:42 +08:00
|
|
|
|
message: '请输入别名',
|
2022-10-29 20:08:15 +08:00
|
|
|
|
trigger: ['change', 'blur'],
|
2021-07-28 18:03:19 +08:00
|
|
|
|
},
|
2022-10-29 20:08:15 +08:00
|
|
|
|
],
|
|
|
|
|
|
database: [
|
|
|
|
|
|
{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: '请添加数据库',
|
|
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
2023-07-06 20:59:22 +08:00
|
|
|
|
};
|
2022-10-29 20:08:15 +08:00
|
|
|
|
|
2024-01-17 08:37:22 +00:00
|
|
|
|
const checkAllDbNames = ref(false);
|
|
|
|
|
|
const indeterminateDbNames = ref(false);
|
|
|
|
|
|
|
2022-10-29 20:08:15 +08:00
|
|
|
|
const dbForm: any = ref(null);
|
2023-12-05 23:03:51 +08:00
|
|
|
|
const tagSelectRef: any = ref(null);
|
2022-10-29 20:08:15 +08:00
|
|
|
|
|
|
|
|
|
|
const state = reactive({
|
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
|
allDatabases: [] as any,
|
2024-01-17 08:37:22 +00:00
|
|
|
|
dbNamesSelected: [] as any,
|
|
|
|
|
|
dbNamesFiltered: [] as any,
|
|
|
|
|
|
filterString: '',
|
2024-04-12 13:24:20 +08:00
|
|
|
|
selectInstalce: {} as any,
|
|
|
|
|
|
authCerts: [] as any,
|
2022-10-29 20:08:15 +08:00
|
|
|
|
form: {
|
|
|
|
|
|
id: null,
|
2023-12-05 23:03:51 +08:00
|
|
|
|
tagId: [],
|
2022-10-29 20:08:15 +08:00
|
|
|
|
name: null,
|
2023-12-05 23:03:51 +08:00
|
|
|
|
code: '',
|
2022-10-29 20:08:15 +08:00
|
|
|
|
database: '',
|
|
|
|
|
|
remark: '',
|
2023-08-30 22:41:42 +08:00
|
|
|
|
instanceId: null as any,
|
2024-04-12 13:24:20 +08:00
|
|
|
|
authCertName: '',
|
2024-02-29 22:12:50 +08:00
|
|
|
|
flowProcdefKey: '',
|
2021-07-28 18:03:19 +08:00
|
|
|
|
},
|
2023-08-30 22:41:42 +08:00
|
|
|
|
instances: [] as any,
|
2022-10-29 20:08:15 +08:00
|
|
|
|
});
|
2022-05-08 14:10:57 +08:00
|
|
|
|
|
2024-01-17 08:37:22 +00:00
|
|
|
|
const { dialogVisible, allDatabases, form, dbNamesSelected } = toRefs(state);
|
2023-12-11 01:00:09 +08:00
|
|
|
|
|
|
|
|
|
|
const { isFetching: saveBtnLoading, execute: saveDbExec } = dbApi.saveDb.useApi(form);
|
2021-07-28 18:03:19 +08:00
|
|
|
|
|
2023-12-05 23:03:51 +08:00
|
|
|
|
watch(props, async (newValue: any) => {
|
2022-10-29 20:08:15 +08:00
|
|
|
|
state.dialogVisible = newValue.visible;
|
|
|
|
|
|
if (!state.dialogVisible) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (newValue.db) {
|
|
|
|
|
|
state.form = { ...newValue.db };
|
2024-02-29 22:12:50 +08:00
|
|
|
|
state.form.tagId = newValue.db.tags.map((t: any) => t.tagId);
|
2022-10-29 20:08:15 +08:00
|
|
|
|
// 将数据库名使用空格切割,获取所有数据库列表
|
2024-01-17 08:37:22 +00:00
|
|
|
|
state.dbNamesSelected = newValue.db.database.split(' ');
|
2022-10-29 20:08:15 +08:00
|
|
|
|
} else {
|
2023-08-30 22:41:42 +08:00
|
|
|
|
state.form = {} as any;
|
2024-01-17 08:37:22 +00:00
|
|
|
|
state.dbNamesSelected = [];
|
2022-10-29 20:08:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
2021-07-28 18:03:19 +08:00
|
|
|
|
|
2024-04-12 13:24:20 +08:00
|
|
|
|
const changeInstance = async () => {
|
2024-01-17 08:37:22 +00:00
|
|
|
|
state.dbNamesSelected = [];
|
2024-04-12 13:24:20 +08:00
|
|
|
|
state.form.instanceId = state.selectInstalce.id;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const getAuthCerts = async () => {
|
|
|
|
|
|
const res = await resourceAuthCertApi.listByQuery.request({
|
|
|
|
|
|
resourceCode: state.selectInstalce.code,
|
|
|
|
|
|
resourceType: TagResourceTypeEnum.Db.value,
|
|
|
|
|
|
pageSize: 100,
|
|
|
|
|
|
});
|
|
|
|
|
|
state.authCerts = res.list || [];
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const changeAuthCert = (val: string) => {
|
|
|
|
|
|
getAllDatabase(val);
|
2023-10-27 17:41:45 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2024-04-12 13:24:20 +08:00
|
|
|
|
const getAllDatabase = async (authCertName: string) => {
|
2023-08-30 22:41:42 +08:00
|
|
|
|
if (state.form.instanceId > 0) {
|
2024-04-12 13:24:20 +08:00
|
|
|
|
let dbs = await dbApi.getAllDatabase.request({ instanceId: state.form.instanceId, authCertName });
|
2024-03-01 04:03:03 +00:00
|
|
|
|
state.allDatabases = dbs;
|
|
|
|
|
|
|
|
|
|
|
|
// 如果是oracle,且没查出数据库列表,则取实例sid
|
|
|
|
|
|
let instance = state.instances.find((item: any) => item.id === state.form.instanceId);
|
|
|
|
|
|
if (instance && instance.type === DbType.oracle && dbs.length === 0) {
|
|
|
|
|
|
state.allDatabases = [instance.sid];
|
|
|
|
|
|
}
|
2023-08-30 22:41:42 +08:00
|
|
|
|
}
|
2022-10-29 20:08:15 +08:00
|
|
|
|
};
|
2021-07-28 18:03:19 +08:00
|
|
|
|
|
2023-09-05 12:49:12 +08:00
|
|
|
|
const getInstances = async (instanceName: string = '', id = 0) => {
|
|
|
|
|
|
if (!id && !instanceName) {
|
|
|
|
|
|
state.instances = [];
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
const data = await dbApi.instances.request({ id, name: instanceName });
|
2023-08-30 22:41:42 +08:00
|
|
|
|
if (data) {
|
|
|
|
|
|
state.instances = data.list;
|
|
|
|
|
|
}
|
2023-09-05 12:49:12 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2023-08-30 22:41:42 +08:00
|
|
|
|
const open = async () => {
|
2023-09-05 12:49:12 +08:00
|
|
|
|
if (state.form.instanceId) {
|
|
|
|
|
|
// 根据id获取,因为需要回显实例名称
|
2024-01-17 08:37:22 +00:00
|
|
|
|
await getInstances('', state.form.instanceId);
|
2024-04-12 13:24:20 +08:00
|
|
|
|
state.selectInstalce = state.instances[0];
|
|
|
|
|
|
await getAllDatabase(state.form.authCertName);
|
2023-09-05 12:49:12 +08:00
|
|
|
|
}
|
2022-10-29 20:08:15 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const btnOk = async () => {
|
|
|
|
|
|
dbForm.value.validate(async (valid: boolean) => {
|
2023-12-11 01:00:09 +08:00
|
|
|
|
if (!valid) {
|
2022-10-29 20:08:15 +08:00
|
|
|
|
ElMessage.error('请正确填写信息');
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2023-12-11 01:00:09 +08:00
|
|
|
|
|
|
|
|
|
|
await saveDbExec();
|
|
|
|
|
|
ElMessage.success('保存成功');
|
|
|
|
|
|
emit('val-change', state.form);
|
|
|
|
|
|
cancel();
|
2022-10-29 20:08:15 +08:00
|
|
|
|
});
|
|
|
|
|
|
};
|
2022-05-08 14:10:57 +08:00
|
|
|
|
|
2022-10-29 20:08:15 +08:00
|
|
|
|
const resetInputDb = () => {
|
2024-01-17 08:37:22 +00:00
|
|
|
|
state.dbNamesSelected = [];
|
2022-10-29 20:08:15 +08:00
|
|
|
|
state.allDatabases = [];
|
2023-08-30 22:41:42 +08:00
|
|
|
|
state.instances = [];
|
2022-10-29 20:08:15 +08:00
|
|
|
|
};
|
2021-07-28 18:03:19 +08:00
|
|
|
|
|
2022-10-29 20:08:15 +08:00
|
|
|
|
const cancel = () => {
|
|
|
|
|
|
emit('update:visible', false);
|
|
|
|
|
|
emit('cancel');
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
resetInputDb();
|
|
|
|
|
|
}, 500);
|
|
|
|
|
|
};
|
2024-01-17 08:37:22 +00:00
|
|
|
|
|
|
|
|
|
|
const checkDbSelect = (val: string[]) => {
|
|
|
|
|
|
const selected = val.filter((dbName: string) => {
|
|
|
|
|
|
return dbName.includes(state.filterString);
|
|
|
|
|
|
});
|
|
|
|
|
|
if (selected.length === 0) {
|
|
|
|
|
|
checkAllDbNames.value = false;
|
|
|
|
|
|
indeterminateDbNames.value = false;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (selected.length === state.dbNamesFiltered.length) {
|
|
|
|
|
|
checkAllDbNames.value = true;
|
|
|
|
|
|
indeterminateDbNames.value = false;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
indeterminateDbNames.value = true;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
watch(dbNamesSelected, (val: string[]) => {
|
|
|
|
|
|
checkDbSelect(val);
|
|
|
|
|
|
state.form.database = val.join(' ');
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
watch(allDatabases, (val: string[]) => {
|
|
|
|
|
|
state.dbNamesFiltered = val.map((dbName: string) => dbName);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const handleCheckAll = (val: CheckboxValueType) => {
|
|
|
|
|
|
const otherSelected = state.dbNamesSelected.filter((dbName: string) => {
|
|
|
|
|
|
return !state.dbNamesFiltered.includes(dbName);
|
|
|
|
|
|
});
|
|
|
|
|
|
if (val) {
|
|
|
|
|
|
state.dbNamesSelected = otherSelected.concat(state.dbNamesFiltered);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
state.dbNamesSelected = otherSelected;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const filterDbNames = (filterString: string) => {
|
|
|
|
|
|
const dbNamesCreated = state.dbNamesSelected.filter((dbName: string) => {
|
|
|
|
|
|
return !state.allDatabases.includes(dbName);
|
|
|
|
|
|
});
|
|
|
|
|
|
if (filterString.length === 0) {
|
|
|
|
|
|
state.dbNamesFiltered = dbNamesCreated.concat(state.allDatabases);
|
|
|
|
|
|
checkDbSelect(state.dbNamesSelected);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
state.dbNamesFiltered = dbNamesCreated.concat(state.allDatabases).filter((dbName: string) => {
|
|
|
|
|
|
if (dbName == filterString) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return dbName.includes(filterString);
|
|
|
|
|
|
});
|
|
|
|
|
|
state.dbNamesFiltered.unshift(filterString);
|
|
|
|
|
|
state.filterString = filterString;
|
|
|
|
|
|
checkDbSelect(state.dbNamesSelected);
|
|
|
|
|
|
};
|
2021-07-28 18:03:19 +08:00
|
|
|
|
</script>
|
2023-03-06 16:59:57 +08:00
|
|
|
|
<style lang="scss"></style>
|