@@ -40,7 +42,8 @@
import { ref, watch, watchEffect } from 'vue';
import { Message } from '@arco-design/web-vue';
- import MsFormCreate from '@/components/pure/ms-form-create/formCreate.vue';
+ import MsFormCreate from '@/components/pure/ms-form-create/ms-form-create.vue';
+ import type { FormItem, FormRuleItem } from '@/components/pure/ms-form-create/types';
import { addOrUpdate, configScript, postValidate } from '@/api/modules/setting/serviceIntegration';
import { useI18n } from '@/hooks/useI18n';
@@ -49,8 +52,6 @@
import type { AddOrUpdateServiceModel, ServiceItem } from '@/models/setting/serviceIntegration';
- import { FormRule } from '@form-create/arco-design';
-
const { t } = useI18n();
const appStore = useAppStore();
const lastOrganizationId = appStore.currentOrgId;
@@ -83,7 +84,8 @@
'validate-trigger': ['change'],
},
});
- const formRules = ref
();
+ const formRules = ref([]);
+ const formItemList = ref([]);
const title = ref('');
const formItem = ref({});
watchEffect(() => {
@@ -138,7 +140,7 @@
};
const saveHandler = () => {
fApi.value?.validate((valid: any, fail: any) => {
- if (valid) {
+ if (valid === true) {
submit();
} else {
console.log(fail);
@@ -149,13 +151,15 @@
// 获取配置脚本
const getPluginScript = async (cuurentPluginId: string) => {
try {
+ formRules.value = [];
+ formItemList.value = [];
const result = await configScript(cuurentPluginId);
formRules.value = [...result];
if (type.value === 'edit') {
- fApi.value.nextTick(() => {
- fApi.value.setValue({ ...formItem.value.configuration });
- fApi.value.refresh();
- });
+ // fApi.value.nextTick(() => {
+ fApi.value.setValue({ ...formItem.value.configuration });
+ fApi.value.refresh();
+ // });
}
} catch (error) {
console.log(error);
diff --git a/frontend/src/views/setting/organization/serviceIntegration/components/serviceList.vue b/frontend/src/views/setting/organization/serviceIntegration/components/serviceList.vue
index 0eb3e1cb9f..5d9bd80816 100644
--- a/frontend/src/views/setting/organization/serviceIntegration/components/serviceList.vue
+++ b/frontend/src/views/setting/organization/serviceIntegration/components/serviceList.vue
@@ -107,7 +107,7 @@
import { useRouter } from 'vue-router';
import MsCard from '@/components/pure/ms-card/index.vue';
- import ConfigModal from './conifgModal.vue';
+ import ConfigModal from './configModal.vue';
import { addOrUpdate, getServiceList, getValidate, resetService } from '@/api/modules/setting/serviceIntegration';
import { useI18n } from '@/hooks/useI18n';