fix: 用例管理bug和富文本禁用

This commit is contained in:
xinxin.wu 2024-02-20 12:30:51 +08:00 committed by Craftsman
parent 92cbcc1939
commit 316310716b
10 changed files with 80 additions and 43 deletions

View File

@ -122,7 +122,6 @@
}
const { height } = useWindowSize();
appStore.innerHeight = height.value;
userStore.getAuthentication();
});
/** 屏幕大小改变时重新赋值innerHeight */
useEventListener(window, 'resize', () => {

View File

@ -153,11 +153,7 @@
}"
:max-length="1000"
/>
<a-radio-group
v-else-if="item.type === FilterType.RADIO"
v-model:model-value="item.value"
v-bind="(item.radioProps as any)"
>
<a-radio-group v-else-if="item.type === FilterType.RADIO" v-model:model-value="item.value">
<a-radio
v-for="it of item.radioProps?.options || []"
:key="it[item.radioProps?.valueKey || 'value']"

View File

@ -280,26 +280,26 @@
Extension.create({
addOptions() {
return {
getToolboxItems({ editors }: { editors: Editor }) {
return [
{
priority: 0,
component: markRaw(ToolboxItem),
props: {
editor,
icon: markRaw(
defineComponent({
template: "<MsIcon type='icon-icon_link-copy_outlined' size='16' />",
})
),
title: t('editor.attachment'),
action: () => {
attachmentSelectorModal.value = true;
},
},
},
];
},
// getToolboxItems({ editors }: { editors: Editor }) {
// return [
// {
// priority: 0,
// component: markRaw(ToolboxItem),
// props: {
// editor,
// icon: markRaw(
// defineComponent({
// template: "<MsIcon type='icon-icon_link-copy_outlined' size='16' />",
// })
// ),
// title: t('editor.attachment'),
// action: () => {
// attachmentSelectorModal.value = true;
// },
// },
// },
// ];
// },
getToolbarItems({ editors }: { editors: Editor }) {
return {
priority: 1000,

View File

@ -257,6 +257,13 @@ export const pathMap: PathMapItem[] = [
permission: [],
level: MENU_LEVEL[0],
},
{
key: 'SETTING_SYSTEM_TASK_CENTER', // 系统设置-系统-任务中心
locale: 'menu.projectManagement.taskCenter',
route: RouteEnum.SETTING_SYSTEM_TASK_CENTER,
permission: [],
level: MENU_LEVEL[0],
},
{
key: 'SETTING_SYSTEM_PLUGIN_MANAGEMENT', // 系统设置-系统-插件管理
locale: 'menu.settings.system.pluginManager',
@ -301,6 +308,13 @@ export const pathMap: PathMapItem[] = [
permission: [],
level: MENU_LEVEL[1],
},
{
key: 'SETTING_ORGANIZATION_TASK_CENTER', // 系统设置-组织-任务中心
locale: 'menu.projectManagement.taskCenter',
route: RouteEnum.SETTING_ORGANIZATION_TASK_CENTER,
permission: [],
level: MENU_LEVEL[1],
},
{
key: 'SETTING_ORGANIZATION_TEMPLATE', // 系统设置-组织-模板
locale: 'menu.settings.organization.template',
@ -508,6 +522,13 @@ export const pathMap: PathMapItem[] = [
permission: [],
level: MENU_LEVEL[2],
},
{
key: 'PROJECT_MANAGEMENT_TASK_CENTER', // 项目管理-任务中心
locale: 'menu.projectManagement.taskCenter',
route: '',
permission: [],
level: MENU_LEVEL[2],
},
],
},
// 测试计划

View File

@ -481,6 +481,12 @@
let currentDefaultValue;
if (numberType.includes(item.type)) {
currentDefaultValue = item.defaultValue * 1;
} else if (
multipleType.includes(item.type) &&
Array.isArray(item.defaultValue) &&
item.defaultValue.length === 0
) {
currentDefaultValue = item.defaultValue;
} else if (multipleType.includes(item.type)) {
currentDefaultValue = JSON.parse(item.defaultValue);
} else {

View File

@ -252,6 +252,7 @@
getCustomFieldsTable,
updateCaseRequest,
} from '@/api/modules/case-management/featureCase';
import { getProjectMemberOptions } from '@/api/modules/project-management/projectMember';
import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal';
import { useAppStore, useTableStore } from '@/store';
@ -412,6 +413,8 @@
title: 'caseManagement.featureCase.tableColumnReviewResult',
dataIndex: 'reviewStatus',
slotName: 'reviewStatus',
// TODO
// titleSlotName: 'reviewStatusFilter',
showInTable: true,
width: 200,
showDrag: true,
@ -566,6 +569,8 @@
const scrollWidth = ref<number>(3400);
async function initFilter() {
const result = await getCustomFieldsTable(currentProjectId.value);
let memberOptions = await getProjectMemberOptions(appStore.currentProjectId, keyword.value);
memberOptions = memberOptions.map((e) => ({ label: e.name, value: e.id }));
filterConfigList.value = [
{
title: 'caseManagement.featureCase.tableColumnID',
@ -597,11 +602,11 @@
},
{
title: 'caseManagement.featureCase.tableColumnCreateUser',
dataIndex: 'createUser',
dataIndex: 'createUserName',
type: FilterType.SELECT,
selectProps: {
mode: 'static',
options: [],
options: memberOptions,
},
},
{
@ -611,11 +616,11 @@
},
{
title: 'caseManagement.featureCase.tableColumnUpdateUser',
dataIndex: 'updateUser',
dataIndex: 'updateUserName',
type: FilterType.SELECT,
selectProps: {
mode: 'static',
options: [],
options: memberOptions,
},
},
{

View File

@ -510,7 +510,22 @@
//
formRules.value = (customFields || []).map((item: any) => {
const multipleType = ['MULTIPLE_SELECT', 'CHECKBOX', 'MULTIPLE_MEMBER', 'MULTIPLE_INPUT'];
const currentDefaultValue = multipleType.includes(item.type) ? JSON.parse(item.defaultValue) : item.defaultValue;
const numberType = ['INT', 'FLOAT'];
let currentDefaultValue;
if (numberType.includes(item.type)) {
currentDefaultValue = item.defaultValue * 1;
} else if (
multipleType.includes(item.type) &&
Array.isArray(item.defaultValue) &&
item.defaultValue.length === 0
) {
currentDefaultValue = item.defaultValue;
} else if (multipleType.includes(item.type)) {
currentDefaultValue = JSON.parse(item.defaultValue);
} else {
currentDefaultValue = item.defaultValue;
}
return {
...item,

View File

@ -171,6 +171,7 @@
recoverRecycleCase,
restoreCaseList,
} from '@/api/modules/case-management/featureCase';
import { getProjectMemberOptions } from '@/api/modules/project-management/projectMember';
import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal';
import { useAppStore, useTableStore } from '@/store';
@ -684,6 +685,8 @@
async function initFilter() {
const result = await getCustomFieldsTable(currentProjectId.value);
let memberOptions = await getProjectMemberOptions(appStore.currentProjectId, keyword.value);
memberOptions = memberOptions.map((e) => ({ label: e.name, value: e.id }));
filterConfigList.value = [
{
title: 'caseManagement.featureCase.tableColumnID',
@ -715,11 +718,11 @@
},
{
title: 'caseManagement.featureCase.tableColumnCreateUser',
dataIndex: 'createUser',
dataIndex: 'createUserName',
type: FilterType.SELECT,
selectProps: {
mode: 'static',
options: [],
options: memberOptions,
},
},
{
@ -733,7 +736,7 @@
type: FilterType.SELECT,
selectProps: {
mode: 'static',
options: [],
options: memberOptions,
},
},
{

View File

@ -10,7 +10,7 @@ import { StatusType } from '@/enums/caseEnum';
const { t } = useI18n();
// 获取列表对应的状态图标
const statusIconMap = [
export const statusIconMap = [
{
key: 'UN_REVIEWED',
icon: StatusType.UN_REVIEWED,

View File

@ -17,17 +17,9 @@
import banner from './components/banner.vue';
import loginForm from './components/login-form.vue';
import { useUserStore } from '@/store';
const props = defineProps<{
isPreview?: boolean;
}>();
const userStore = useUserStore();
onMounted(() => {
userStore.getAuthentication();
});
</script>
<style lang="less" scoped>