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();
}
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) {
//构造父子级数据
for (FunctionalCaseMindDTO functionalCaseMindDTO : functionalCaseMindDTOList) {

View File

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

View File

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

View File

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

View File

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