feat(系统设置): 自定义机器人非xpack

This commit is contained in:
guoyuqi 2024-06-20 19:23:04 +08:00 committed by Craftsman
parent 29eb6ca709
commit 7a4ed691f6
5 changed files with 69 additions and 69 deletions

View File

@ -161,29 +161,6 @@ public class FunctionalCaseMinderService {
return customFields.stream().map(TemplateCustomFieldDTO::getFieldId).toList(); return customFields.stream().map(TemplateCustomFieldDTO::getFieldId).toList();
} }
private List<FunctionalMinderTreeDTO> buildAdditionalData(String moduleId) {
List<FunctionalMinderTreeDTO> list = new ArrayList<>();
MindAdditionalNodeExample mindAdditionalNodeExample = new MindAdditionalNodeExample();
mindAdditionalNodeExample.createCriteria().andParentIdEqualTo(moduleId);
mindAdditionalNodeExample.setOrderByClause("pos asc");
List<MindAdditionalNode> mindAdditionalNodes = mindAdditionalNodeMapper.selectByExample(mindAdditionalNodeExample);
if (CollectionUtils.isEmpty(mindAdditionalNodes)) {
return new ArrayList<>();
}
for (MindAdditionalNode mindAdditionalNode : mindAdditionalNodes) {
FunctionalMinderTreeDTO root = new FunctionalMinderTreeDTO();
FunctionalMinderTreeNodeDTO rootData = new FunctionalMinderTreeNodeDTO();
rootData.setId(mindAdditionalNode.getId());
rootData.setPos(mindAdditionalNode.getPos());
rootData.setText(mindAdditionalNode.getName());
rootData.setResource(new ArrayList<>());
root.setChildren(buildAdditionalData(mindAdditionalNode.getId()));
root.setData(rootData);
list.add(root);
}
return list;
}
private void buildList(List<FunctionalCaseMindDTO> functionalCaseMindDTOList, List<FunctionalMinderTreeDTO> list, Map<String, String> priorityMap) { private void buildList(List<FunctionalCaseMindDTO> functionalCaseMindDTOList, List<FunctionalMinderTreeDTO> list, Map<String, String> priorityMap) {
//构造父子级数据 //构造父子级数据
for (FunctionalCaseMindDTO functionalCaseMindDTO : functionalCaseMindDTOList) { for (FunctionalCaseMindDTO functionalCaseMindDTO : functionalCaseMindDTOList) {

View File

@ -212,7 +212,9 @@
const unReadCount = ref<number>(0); const unReadCount = ref<number>(0);
async function checkMessageRead() { async function checkMessageRead() {
unReadCount.value = await getMessageUnReadCount(appStore.currentProjectId); if (appStore.currentProjectId) {
unReadCount.value = await getMessageUnReadCount(appStore.currentProjectId);
}
} }
watch( watch(
() => appStore.currentOrgId, () => appStore.currentOrgId,

View File

@ -130,7 +130,6 @@
{{ platform.name }} {{ platform.name }}
</div> </div>
<div <div
v-xpack
:class="['platform-card-custom', robotForm.platform === 'CUSTOM' ? 'platform-card--active' : '']" :class="['platform-card-custom', robotForm.platform === 'CUSTOM' ? 'platform-card--active' : '']"
@click="robotForm.platform = 'CUSTOM'" @click="robotForm.platform = 'CUSTOM'"
> >

View File

@ -10,7 +10,7 @@
{{ t('project.messageManagement.DING_TALK') }} {{ t('project.messageManagement.DING_TALK') }}
</template> </template>
<a-form class="ms-form rounded-[4px]" :model="dingTalkForm" layout="vertical"> <a-form ref="dingTalkFormRef" class="ms-form rounded-[4px]" :model="dingTalkForm" layout="vertical">
<a-form-item <a-form-item
field="appKey" field="appKey"
:label="t('system.config.qrCodeConfig.appKey')" :label="t('system.config.qrCodeConfig.appKey')"
@ -82,6 +82,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import { FormInstance, ValidatedError } from '@arco-design/web-vue';
import { getDingInfo, saveDingTalkConfig, validateDingTalkConfig } from '@/api/modules/setting/qrCode'; import { getDingInfo, saveDingTalkConfig, validateDingTalkConfig } from '@/api/modules/setting/qrCode';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
@ -100,6 +101,8 @@
valid: false, valid: false,
}); });
const dingTalkFormRef = ref<FormInstance | null>(null);
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
const detailVisible = ref<boolean>(false); const detailVisible = ref<boolean>(false);
const props = defineProps<{ const props = defineProps<{
@ -140,30 +143,38 @@
} }
async function validateInfo() { async function validateInfo() {
loading.value = true; dingTalkFormRef.value?.validate(async (errors: Record<string, ValidatedError> | undefined) => {
try { if (!errors) {
await validateDingTalkConfig(dingTalkForm.value); loading.value = true;
dingTalkForm.value.valid = true; try {
Message.success(t('organization.service.testLinkStatusTip')); await validateDingTalkConfig(dingTalkForm.value);
} catch (error) { dingTalkForm.value.valid = true;
console.log(error); Message.success(t('organization.service.testLinkStatusTip'));
} finally { } catch (error) {
loading.value = false; console.log(error);
} } finally {
loading.value = false;
}
}
});
} }
async function saveInfo() { async function saveInfo() {
loading.value = true; dingTalkFormRef.value?.validate(async (errors: Record<string, ValidatedError> | undefined) => {
try { if (!errors) {
await saveDingTalkConfig(dingTalkForm.value); loading.value = true;
Message.success(t('organization.service.testLinkStatusTip')); try {
emits('success'); await saveDingTalkConfig(dingTalkForm.value);
} catch (error) { Message.success(t('organization.service.testLinkStatusTip'));
console.log(error); emits('success');
} finally { } catch (error) {
loading.value = false; console.log(error);
detailVisible.value = false; } finally {
} loading.value = false;
detailVisible.value = false;
}
}
});
} }
</script> </script>

View File

@ -10,7 +10,7 @@
{{ t('project.messageManagement.WE_COM') }} {{ t('project.messageManagement.WE_COM') }}
</template> </template>
<a-form class="ms-form rounded-[4px]" :model="weComForm" layout="vertical"> <a-form ref="weComFormRef" class="ms-form rounded-[4px]" :model="weComForm" layout="vertical">
<a-form-item <a-form-item
field="corpId" field="corpId"
:label="t('system.config.qrCodeConfig.corpId')" :label="t('system.config.qrCodeConfig.corpId')"
@ -79,6 +79,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import { FormInstance, ValidatedError } from '@arco-design/web-vue';
import { getWeComInfo, saveWeComConfig, validateWeComConfig } from '@/api/modules/setting/qrCode'; import { getWeComInfo, saveWeComConfig, validateWeComConfig } from '@/api/modules/setting/qrCode';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
@ -97,6 +98,8 @@
valid: false, valid: false,
}); });
const weComFormRef = ref<FormInstance | null>(null);
const emits = defineEmits<{ const emits = defineEmits<{
(event: 'update:visible', visible: boolean): void; (event: 'update:visible', visible: boolean): void;
(event: 'success'): void; (event: 'success'): void;
@ -137,30 +140,38 @@
} }
async function validateInfo() { async function validateInfo() {
loading.value = true; weComFormRef.value?.validate(async (errors: Record<string, ValidatedError> | undefined) => {
try { if (!errors) {
await validateWeComConfig(weComForm.value); loading.value = true;
weComForm.value.valid = true; try {
Message.success(t('organization.service.testLinkStatusTip')); await validateWeComConfig(weComForm.value);
} catch (error) { weComForm.value.valid = true;
console.log(error); Message.success(t('organization.service.testLinkStatusTip'));
} finally { } catch (error) {
loading.value = false; console.log(error);
} } finally {
loading.value = false;
}
}
});
} }
async function saveInfo() { async function saveInfo() {
loading.value = true; weComFormRef.value?.validate(async (errors: Record<string, ValidatedError> | undefined) => {
try { if (!errors) {
await saveWeComConfig(weComForm.value); loading.value = true;
Message.success(t('organization.service.testLinkStatusTip')); try {
emits('success'); await saveWeComConfig(weComForm.value);
} catch (error) { Message.success(t('organization.service.testLinkStatusTip'));
console.log(error); emits('success');
} finally { } catch (error) {
loading.value = false; console.log(error);
detailVisible.value = false; } finally {
} loading.value = false;
detailVisible.value = false;
}
}
});
} }
</script> </script>