fix(产品需求): 修复产品需求使用状态和终止态字典的问题。
fix(组织): 修复组织编码下拉框的数据显示问题、修复组织编码负责人无法新增的问题。 fix(管理链路): 修复管理链路高度没固定,节点全部收缩等问题。
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
<script setup lang="tsx">
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
||||
import type { TableInstance } from 'element-plus';
|
||||
import { ElButton, ElTag } from 'element-plus';
|
||||
import dayjs from 'dayjs';
|
||||
import {
|
||||
RDMS_REQ_CATEGORY_DICT_CODE,
|
||||
RDMS_REQ_PRIORITY_DICT_CODE,
|
||||
RDMS_REQ_STATUS_DICT_CODE,
|
||||
RDMS_REQ_TERMINAL_STATUS_DICT_CODE
|
||||
RDMS_REQ_PRIORITY_DICT_CODE
|
||||
} from '@/constants/dict';
|
||||
import {
|
||||
fetchChangeRequirementStatus,
|
||||
fetchDeleteRequirement,
|
||||
fetchGetProductMembers,
|
||||
fetchGetRequirementAllowedTransitions,
|
||||
fetchGetRequirementStatusDict,
|
||||
fetchGetRequirementTerminalStatusDict,
|
||||
fetchGetRequirementTree
|
||||
} from '@/service/api';
|
||||
import { useAuth } from '@/hooks/business/auth';
|
||||
import { useDict } from '@/hooks/business/dict';
|
||||
import BusinessTableActionCell from '@/components/custom/business-table-action-cell';
|
||||
import DictTag from '@/components/custom/dict-tag.vue';
|
||||
import { useCurrentProduct } from '../shared/use-current-product';
|
||||
@@ -42,7 +41,38 @@ defineOptions({ name: 'ProductRequirement' });
|
||||
const { currentObjectId } = useCurrentProduct();
|
||||
const { hasObjectAuth } = useAuth();
|
||||
|
||||
const { dictOptions: terminalStatusOptions } = useDict(RDMS_REQ_TERMINAL_STATUS_DICT_CODE);
|
||||
const statusOptions = ref<Array<{ label: string; value: string }>>([]);
|
||||
const terminalStatusOptions = ref<string[]>([]);
|
||||
|
||||
async function loadStatusOptions() {
|
||||
const { error, data } = await fetchGetRequirementStatusDict();
|
||||
|
||||
if (error || !data) {
|
||||
statusOptions.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
statusOptions.value = data.map(item => ({
|
||||
label: item.statusName,
|
||||
value: item.statusCode
|
||||
}));
|
||||
}
|
||||
|
||||
async function loadTerminalStatusOptions() {
|
||||
const { error, data } = await fetchGetRequirementTerminalStatusDict();
|
||||
|
||||
if (error || !data) {
|
||||
terminalStatusOptions.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
terminalStatusOptions.value = data.map(item => item.statusCode);
|
||||
}
|
||||
|
||||
function getStatusLabel(statusCode: string) {
|
||||
const item = statusOptions.value.find(opt => opt.value === statusCode);
|
||||
return item ? item.label : statusCode;
|
||||
}
|
||||
|
||||
const priorityTagTypeMap: Record<number, UI.ThemeColor> = {
|
||||
0: 'info',
|
||||
@@ -60,7 +90,7 @@ function formatDateTime(value?: string | null) {
|
||||
}
|
||||
|
||||
function isTerminalStatus(statusCode: string) {
|
||||
return terminalStatusOptions.value.some(option => option.value === statusCode);
|
||||
return terminalStatusOptions.value.some(option => option === statusCode);
|
||||
}
|
||||
|
||||
function canSplitRequirement(row: Api.Product.Requirement) {
|
||||
@@ -233,15 +263,15 @@ const columns = computed(() => [
|
||||
minWidth: 120,
|
||||
formatter: (row: Api.Product.Requirement) => row.category
|
||||
},
|
||||
{
|
||||
prop: 'description',
|
||||
label: '描述',
|
||||
minWidth: 200,
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: Api.Product.Requirement) => {
|
||||
return row.description?.replace(/<[^>]+>/g, '').trim() || '--';
|
||||
}
|
||||
},
|
||||
// {
|
||||
// prop: 'description',
|
||||
// label: '描述',
|
||||
// minWidth: 200,
|
||||
// showOverflowTooltip: true,
|
||||
// formatter: (row: Api.Product.Requirement) => {
|
||||
// return row.description?.replace(/<[^>]+>/g, '').trim() || '--';
|
||||
// }
|
||||
// },
|
||||
{
|
||||
prop: 'priority',
|
||||
label: '优先级',
|
||||
@@ -257,11 +287,9 @@ const columns = computed(() => [
|
||||
width: 100,
|
||||
align: 'center',
|
||||
formatter: (row: Api.Product.Requirement) => (
|
||||
<DictTag
|
||||
dictCode={RDMS_REQ_STATUS_DICT_CODE}
|
||||
value={row.statusCode}
|
||||
type={getRequirementStatusTagType(row.statusCode)}
|
||||
/>
|
||||
<ElTag type={getRequirementStatusTagType(row.statusCode)}>
|
||||
{getStatusLabel(row.statusCode)}
|
||||
</ElTag>
|
||||
)
|
||||
},
|
||||
{
|
||||
@@ -601,6 +629,10 @@ watch(
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
await Promise.all([loadStatusOptions(), loadTerminalStatusOptions()]);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { RDMS_REQ_SOURCE_TYPE_DICT_CODE } from '@/constants/dict';
|
||||
import { fetchGetRequirementStatusDict } from '@/service/api';
|
||||
import DictSelect from '@/components/custom/dict-select.vue';
|
||||
import TableSearchPanel from '@/components/custom/table-search-panel.vue';
|
||||
import MemberSelectOption from './member-select-option.vue';
|
||||
@@ -29,16 +31,21 @@ const emit = defineEmits<Emits>();
|
||||
|
||||
const model = defineModel<Api.Product.RequirementSearchParams>('model', { required: true });
|
||||
|
||||
const requirementStatusOptions = [
|
||||
{ label: '待确认', value: 'pending_confirm' },
|
||||
{ label: '待评审', value: 'pending_review' },
|
||||
{ label: '待分流', value: 'pending_dispatch' },
|
||||
{ label: '实施中', value: 'implementing' },
|
||||
{ label: '已验收', value: 'accepted' },
|
||||
{ label: '已关闭', value: 'closed' },
|
||||
{ label: '已拒绝', value: 'rejected' },
|
||||
{ label: '已取消', value: 'cancelled' }
|
||||
];
|
||||
const requirementStatusOptions = ref<Array<{ label: string; value: string }>>([]);
|
||||
|
||||
async function loadStatusOptions() {
|
||||
const { error, data } = await fetchGetRequirementStatusDict();
|
||||
|
||||
if (error || !data) {
|
||||
requirementStatusOptions.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
requirementStatusOptions.value = data.map(item => ({
|
||||
label: item.statusName,
|
||||
value: item.statusCode
|
||||
}));
|
||||
}
|
||||
|
||||
function reset() {
|
||||
emit('reset');
|
||||
@@ -47,6 +54,10 @@ function reset() {
|
||||
function search() {
|
||||
emit('search');
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await loadStatusOptions();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user