-
+
@@ -118,6 +118,10 @@ import { ResourceCodePattern } from '@/common/pattern';
import { TagResourceTypeEnum } from '@/common/commonEnum';
const props = defineProps({
+ title: {
+ type: String,
+ default: '凭证保存',
+ },
authCert: {
type: Object,
},
@@ -162,7 +166,7 @@ const rules = {
],
};
-const emit = defineEmits(['confirm']);
+const emit = defineEmits(['confirm', 'cancel']);
const dialogVisible = defineModel('visible', { default: false });
@@ -238,9 +242,10 @@ const getCiphertext = async () => {
const cancelEdit = () => {
dialogVisible.value = false;
+ emit('cancel');
setTimeout(() => {
- state.form = { ...DefaultForm };
acForm.value?.resetFields();
+ state.form = { ...DefaultForm };
}, 300);
};
diff --git a/mayfly_go_web/src/views/ops/component/ResourceAuthCertTableEdit.vue b/mayfly_go_web/src/views/ops/component/ResourceAuthCertTableEdit.vue
index eafb1ca4..7a20165a 100644
--- a/mayfly_go_web/src/views/ops/component/ResourceAuthCertTableEdit.vue
+++ b/mayfly_go_web/src/views/ops/component/ResourceAuthCertTableEdit.vue
@@ -34,9 +34,17 @@
+
-
+
@@ -51,6 +59,9 @@ import { ElMessage } from 'element-plus';
const props = defineProps({
resourceType: { type: Number },
resourceCode: { type: String },
+ disableCiphertextType: {
+ type: Array,
+ },
testConnBtnLoading: { type: Boolean },
});
@@ -109,7 +120,19 @@ const cancelEdit = () => {
const btnOk = async (authCert: any) => {
const isEdit = authCert.id;
- if (isEdit || state.idx > 0) {
+ if (!isEdit) {
+ const res = await resourceAuthCertApi.listByQuery.request({
+ name: authCert.name,
+ pageNum: 1,
+ pageSize: 100,
+ });
+ if (res.total) {
+ ElMessage.error('该授权凭证名称已存在');
+ return;
+ }
+ }
+
+ if (isEdit || state.idx >= 0) {
authCerts.value[state.idx] = authCert;
cancelEdit();
return;
@@ -119,15 +142,6 @@ const btnOk = async (authCert: any) => {
ElMessage.error('该名称或用户名已存在于该账号列表中');
return;
}
- const res = await resourceAuthCertApi.listByQuery.request({
- name: authCert.name,
- pageNum: 1,
- pageSize: 100,
- });
- if (res.total) {
- ElMessage.error('该授权凭证名称已存在');
- return;
- }
authCerts.value.push(authCert);
cancelEdit();
diff --git a/mayfly_go_web/src/views/ops/db/DbEdit.vue b/mayfly_go_web/src/views/ops/db/DbEdit.vue
index 7751eef4..d4a2ac8f 100644
--- a/mayfly_go_web/src/views/ops/db/DbEdit.vue
+++ b/mayfly_go_web/src/views/ops/db/DbEdit.vue
@@ -30,13 +30,14 @@
remote
:remote-method="getInstances"
@change="changeInstance"
- v-model="form.instanceId"
+ v-model="state.selectInstalce"
+ value-key="id"
placeholder="请输入实例名称搜索并选择实例"
filterable
clearable
class="w100"
>
-