fix(项目管理): 关联需求缺陷配置交互问题

--bug=1037267 --user=宋昌昌 【项目管理】关联需求/缺陷 需要优化 https://www.tapd.cn/55049933/s/1481068
This commit is contained in:
song-cc-rock 2024-03-26 17:04:44 +08:00 committed by 刘瑞斌
parent 87978e66a6
commit 9610007002
3 changed files with 17 additions and 9 deletions

View File

@ -1,13 +1,15 @@
<template> <template>
<a-select <a-spin :loading="selectLoading" class="block w-full">
v-model:model-value="selectValue" <a-select
:placeholder="t(props.placeholder || 'common.pleaseSelect')" v-model:model-value="selectValue"
allow-search :placeholder="t(props.placeholder || 'common.pleaseSelect')"
:multiple="props.multiple" allow-search
@search="searchHandler" :multiple="props.multiple"
> @search="searchHandler"
<a-option v-for="opt of optionsList" :key="opt.value" :value="opt.value">{{ opt.label }}</a-option> >
</a-select> <a-option v-for="opt of optionsList" :key="opt.value" :value="opt.value">{{ opt.label }}</a-option>
</a-select>
</a-spin>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -45,11 +47,13 @@
const selectValue = ref<string[] | string>(); const selectValue = ref<string[] | string>();
const optionsList = ref<{ label: string; value: string }[]>([]); const optionsList = ref<{ label: string; value: string }[]>([]);
const selectLoading = ref(false);
const params = ref<OptionsParams>(); const params = ref<OptionsParams>();
const pluginId = (sessionStorage.getItem('platformKey') as string) || 'jira'; const pluginId = (sessionStorage.getItem('platformKey') as string) || 'jira';
async function getLinksItem() { async function getLinksItem() {
if (props.optionMethod) { if (props.optionMethod) {
selectLoading.value = true;
params.value = { params.value = {
pluginId, pluginId,
organizationId: organizationId.value, organizationId: organizationId.value,
@ -58,6 +62,7 @@
}; };
try { try {
const res = await getPluginOptions(params.value); const res = await getPluginOptions(params.value);
selectLoading.value = false;
optionsList.value = res.map((item) => { optionsList.value = res.map((item) => {
return { return {
label: item.text, label: item.text,
@ -65,6 +70,7 @@
}; };
}); });
} catch (error) { } catch (error) {
selectLoading.value = false;
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log(error); console.log(error);
} }

View File

@ -63,6 +63,7 @@ export default {
'project.menu.organizationId': 'Organization ID', 'project.menu.organizationId': 'Organization ID',
'project.menu.azureId': 'Azure Filter ID', 'project.menu.azureId': 'Azure Filter ID',
'project.menu.defectType': 'Defect Type', 'project.menu.defectType': 'Defect Type',
'project.menu.demandType': 'Demand Type',
'project.menu.howGetJiraKey': 'How to get JIRA project key', 'project.menu.howGetJiraKey': 'How to get JIRA project key',
'project.menu.preview': 'Preview', 'project.menu.preview': 'Preview',
'project.menu.pleaseInputJiraKey': 'Please enter JIRA project key', 'project.menu.pleaseInputJiraKey': 'Please enter JIRA project key',

View File

@ -58,6 +58,7 @@ export default {
'project.menu.organizationId': '组织 ID', 'project.menu.organizationId': '组织 ID',
'project.menu.azureId': 'Azure 过滤 ID', 'project.menu.azureId': 'Azure 过滤 ID',
'project.menu.defectType': '缺陷类型', 'project.menu.defectType': '缺陷类型',
'project.menu.demandType': '需求类型',
'project.menu.howGetJiraKey': '如何获取JIRA 项目 key ', 'project.menu.howGetJiraKey': '如何获取JIRA 项目 key ',
'project.menu.preview': '预览', 'project.menu.preview': '预览',
'project.menu.pleaseInputJiraKey': '请输入 JIRA 项目 key', 'project.menu.pleaseInputJiraKey': '请输入 JIRA 项目 key',