fix: 修改全局部分bugFix
This commit is contained in:
parent
bc707b8cc7
commit
b86f722afe
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<div class="flex flex-row gap-[8px]">
|
||||
<div class="flex flex-row gap-[8px] break-words">
|
||||
<div class="p-1"> <MsAvatar :avatar="creatorInfo.avatar" /></div>
|
||||
<div class="flex w-full flex-col">
|
||||
<div class="font-medium text-[var(--color-text-1)]">
|
||||
{{ creatorInfo.name }}
|
||||
<span v-if="props.element.replyUser">{{ t('ms.comment.reply') }} {{ replyUserName }}</span>
|
||||
</div>
|
||||
<div v-dompurify-html="props.element.content" class="markdown-body mt-[4px]"></div>
|
||||
<div v-dompurify-html="props.element.content" class="markdown-body mt-[4px] break-words break-all"></div>
|
||||
|
||||
<div class="mb-4 mt-[16px] flex flex-row items-center">
|
||||
<div class="text-[var(--color-text-4)]">{{
|
||||
|
|
|
@ -264,6 +264,7 @@
|
|||
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import { useAppStore, useTableStore } from '@/store';
|
||||
import { characterLimit } from '@/utils';
|
||||
|
||||
import { DragSortParams } from '@/models/common';
|
||||
import { ColumnEditTypeEnum, SelectAllEnum, SpecialColumnEnum } from '@/enums/tableEnum';
|
||||
|
@ -279,7 +280,6 @@
|
|||
} from './type';
|
||||
import type { TableChangeExtra, TableColumnData, TableData } from '@arco-design/web-vue';
|
||||
import type { TableOperationColumn } from '@arco-design/web-vue/es/table/interface';
|
||||
import { log } from 'console';
|
||||
|
||||
const batchLeft = ref('10px');
|
||||
const { t } = useI18n();
|
||||
|
|
|
@ -44,7 +44,7 @@ export enum ProjectManagementRouteEnum {
|
|||
PROJECT_MANAGEMENT_PERMISSION_BASIC_INFO = 'projectManagementPermissionBasicInfo',
|
||||
PROJECT_MANAGEMENT_PERMISSION_MENU_MANAGEMENT = 'projectManagementPermissionMenuManagement',
|
||||
PROJECT_MANAGEMENT_TEMPLATE = 'projectManagementTemplate',
|
||||
PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT = 'projectManagementTemplateManagement',
|
||||
PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT = 'projectManagementTemplateList',
|
||||
PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT_CASE_DETAIL = 'projectManagementTemplateManagementCaseDetail',
|
||||
PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT_API_DETAIL = 'projectManagementTemplateManagementApiDetail',
|
||||
PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT_BUG_DETAIL = 'projectManagementTemplateManagementBugDetail',
|
||||
|
|
|
@ -123,7 +123,7 @@ const ProjectManagement: AppRouteRecordRaw = {
|
|||
},
|
||||
// 項目管理模板
|
||||
{
|
||||
path: 'template',
|
||||
path: 'projectManagementTemplate',
|
||||
name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE,
|
||||
component: () => import('@/views/project-management/template/index.vue'),
|
||||
meta: {
|
||||
|
@ -134,7 +134,7 @@ const ProjectManagement: AppRouteRecordRaw = {
|
|||
},
|
||||
// 模板列表-模板字段设置
|
||||
{
|
||||
path: 'templateFiledSetting',
|
||||
path: 'projectManagementTemplateField',
|
||||
name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE_FIELD_SETTING,
|
||||
component: () => import('@/views/project-management/template/components/projectFieldSetting.vue'),
|
||||
meta: {
|
||||
|
@ -156,7 +156,7 @@ const ProjectManagement: AppRouteRecordRaw = {
|
|||
},
|
||||
// 模板列表-模板管理列表
|
||||
{
|
||||
path: 'templateManagement',
|
||||
path: 'projectManagementTemplateList',
|
||||
name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT,
|
||||
component: () => import('@/views/project-management/template/components/templateManagement.vue'),
|
||||
meta: {
|
||||
|
@ -178,7 +178,7 @@ const ProjectManagement: AppRouteRecordRaw = {
|
|||
},
|
||||
// 项目-模板-用例模板
|
||||
{
|
||||
path: 'templateManagementCaseDetail/:mode?',
|
||||
path: 'projectManagementTemplateCaseDetail/:mode?',
|
||||
name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT_CASE_DETAIL,
|
||||
component: () => import('@/views/project-management/template/components/detail.vue'),
|
||||
meta: {
|
||||
|
@ -206,7 +206,7 @@ const ProjectManagement: AppRouteRecordRaw = {
|
|||
},
|
||||
// 项目-模板-接口模板
|
||||
{
|
||||
path: 'templateManagementApiDetail/:mode?',
|
||||
path: 'projectManagementTemplateApiDetail/:mode?',
|
||||
name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT_API_DETAIL,
|
||||
component: () => import('@/views/project-management/template/components/detail.vue'),
|
||||
meta: {
|
||||
|
@ -234,7 +234,7 @@ const ProjectManagement: AppRouteRecordRaw = {
|
|||
},
|
||||
// 项目-模板-缺陷模板
|
||||
{
|
||||
path: 'templateManagementBugDetail/:mode?',
|
||||
path: 'projectManagementTemplateBugDetail/:mode?',
|
||||
name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT_BUG_DETAIL,
|
||||
component: () => import('@/views/project-management/template/components/detail.vue'),
|
||||
meta: {
|
||||
|
|
|
@ -337,7 +337,7 @@ const Setting: AppRouteRecordRaw = {
|
|||
query: ['type'],
|
||||
},
|
||||
{
|
||||
name: SettingRouteEnum.SETTING_ORGANIZATION_TEMPLATE_MANAGEMENT,
|
||||
name: SettingRouteEnum.SETTING_ORGANIZATION_TEMPLATE_MANAGEMENT_API_DETAIL,
|
||||
locale: 'system.orgTemplate.createApiTemplate',
|
||||
editTag: 'id',
|
||||
editLocale: 'system.orgTemplate.updateApiTemplate',
|
||||
|
@ -365,7 +365,7 @@ const Setting: AppRouteRecordRaw = {
|
|||
query: ['type'],
|
||||
},
|
||||
{
|
||||
name: SettingRouteEnum.SETTING_ORGANIZATION_TEMPLATE_MANAGEMENT,
|
||||
name: SettingRouteEnum.SETTING_ORGANIZATION_TEMPLATE_MANAGEMENT_BUG_DETAIL,
|
||||
locale: 'system.orgTemplate.createDefectTemplate',
|
||||
editTag: 'id',
|
||||
editLocale: 'system.orgTemplate.updateDefectTemplate',
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- 左侧布局默认内容(非平台默认模板时默认展示) -->
|
||||
<div v-if="!isPlatformDefaultTemplate" class="default-content">
|
||||
<div v-if="!isPlatformDefaultTemplate" class="default-content !break-words break-all">
|
||||
<div class="header-title">{{ t('bugManagement.edit.content') }}</div>
|
||||
<div class="mb-4 mt-[16px]" :class="{ 'max-h-[260px]': contentEditAble }">
|
||||
<MsRichText
|
||||
|
|
|
@ -699,8 +699,12 @@
|
|||
// 如果该值在选项中已经被删除掉
|
||||
const optionsIds = (multipleOptions || []).map((e: any) => e.value);
|
||||
if (item.type !== 'MULTIPLE_INPUT') {
|
||||
const currentDefaultValue = optionsIds.filter((e: any) => JSON.parse(item.value).includes(e));
|
||||
tmpObj[item.id] = currentDefaultValue;
|
||||
if (item.value) {
|
||||
const currentDefaultValue = optionsIds.filter((e: any) => JSON.parse(item.value).includes(e));
|
||||
tmpObj[item.id] = currentDefaultValue;
|
||||
} else {
|
||||
tmpObj[item.id] = [];
|
||||
}
|
||||
} else {
|
||||
tmpObj[item.id] = JSON.parse(item.value);
|
||||
}
|
||||
|
@ -739,7 +743,7 @@
|
|||
title: res.title,
|
||||
description: res.description,
|
||||
templateId: res.templateId,
|
||||
tags: res.tags,
|
||||
tags: res.tags || [],
|
||||
projectId: res.projectId,
|
||||
platformSystemFields,
|
||||
};
|
||||
|
|
|
@ -12,17 +12,18 @@
|
|||
@refresh="fetchData()"
|
||||
>
|
||||
<template #left>
|
||||
<a-tooltip
|
||||
:content="moduleNamePath + '(' + (props.modulesCount[props.activeFolder] || 0) + ')'"
|
||||
position="bottom"
|
||||
background-color="#FFFFFF"
|
||||
:content-style="{ color: '#000000' }"
|
||||
>
|
||||
<a-popover title="" position="bottom">
|
||||
<div class="one-line-text max-h-[32px] max-w-[116px] text-[var(--color-text-1)]"
|
||||
>{{ moduleNamePath }}
|
||||
<span class="text-[var(--color-text-4)]"> ({{ props.modulesCount[props.activeFolder] || 0 }})</span></div
|
||||
>
|
||||
</a-tooltip>
|
||||
<template #content>
|
||||
<div class="text-[14px] font-medium text-[var(--color-text-1)]">
|
||||
{{ moduleNamePath }}
|
||||
<span class="text-[var(--color-text-4)]">({{ props.modulesCount[props.activeFolder] || 0 }})</span>
|
||||
</div>
|
||||
</template>
|
||||
</a-popover>
|
||||
</template>
|
||||
<template #right>
|
||||
<a-radio-group v-model:model-value="showType" type="button" class="file-show-type">
|
||||
|
@ -48,7 +49,7 @@
|
|||
</template>
|
||||
<template #name="{ record, rowIndex }">
|
||||
<a-button type="text" class="flex w-full" @click="showCaseDetail(record.id, rowIndex)">{{
|
||||
record.name
|
||||
characterLimit(record.name)
|
||||
}}</a-button>
|
||||
</template>
|
||||
<template #updateUserName="{ record }">
|
||||
|
@ -1590,4 +1591,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
// :deep(.moduleNameClass) {
|
||||
// box-shadow: 0 3px 14px 2px rgba(0/ 0/0 5%), 0 8px 10px 1px rgba(0/ 0/0 6%), 0 5px 5px -3px rgba(0/ 0/0 1%);
|
||||
// }
|
||||
</style>
|
||||
|
|
|
@ -73,17 +73,18 @@
|
|||
@refresh="fetchData()"
|
||||
>
|
||||
<template #left>
|
||||
<a-tooltip
|
||||
:content="moduleNamePath + '(' + (recycleModulesCount[activeFolder] || 0) + ')'"
|
||||
position="bottom"
|
||||
background-color="#FFFFFF"
|
||||
:content-style="{ color: '#000000' }"
|
||||
>
|
||||
<a-popover title="" position="bottom">
|
||||
<div class="one-line-text max-h-[32px] max-w-[116px] text-[var(--color-text-1)]"
|
||||
>{{ moduleNamePath }}
|
||||
<span class="text-[var(--color-text-4)]"> ({{ recycleModulesCount[activeFolder] || 0 }})</span></div
|
||||
>
|
||||
</a-tooltip>
|
||||
<template #content>
|
||||
<div class="text-[14px] font-medium text-[var(--color-text-1)]">
|
||||
{{ moduleNamePath }}
|
||||
<span class="text-[var(--color-text-4)]">({{ recycleModulesCount[activeFolder] || 0 }})</span>
|
||||
</div>
|
||||
</template>
|
||||
</a-popover>
|
||||
</template>
|
||||
</MsAdvanceFilter>
|
||||
<ms-base-table
|
||||
|
|
|
@ -52,16 +52,17 @@
|
|||
@search="getFetch"
|
||||
@press-enter="getFetch"
|
||||
@clear="resetFetch"
|
||||
@input="changeHandler"
|
||||
></a-input-search>
|
||||
</div>
|
||||
</div>
|
||||
<ms-base-table v-if="showType === 'link'" ref="tableRef" v-bind="linkPropsRes" v-on="linkTableEvent">
|
||||
<template #name="{ record }">
|
||||
<span class="one-line-text max-w-[300px]"> {{ record.name }}</span>
|
||||
<a-popover title="" position="right" style="width: 480px">
|
||||
<a-popover title="" position="right" style="width: 480px">
|
||||
<span class="ml-1 text-[rgb(var(--primary-5))]">{{ t('caseManagement.featureCase.preview') }}</span>
|
||||
<template #content>
|
||||
<div class="markdown-body" style="margin-left: 48px" v-html="record.content"> </div>
|
||||
<div v-dompurify-html="record.content" class="markdown-body" style="margin-left: 48px"> </div>
|
||||
</template>
|
||||
</a-popover>
|
||||
</template>
|
||||
|
@ -532,6 +533,13 @@
|
|||
total.value = res.total;
|
||||
}
|
||||
|
||||
function changeHandler() {
|
||||
console.log(keyword.value);
|
||||
if (keyword.value.trim().length === 0) {
|
||||
getFetch();
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getFetch();
|
||||
initFilterOptions();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="mb-4 flex items-center justify-between">
|
||||
<div class="mb-4 flex items-center justify-between break-words break-all">
|
||||
<div class="font-medium">{{ t('caseManagement.featureCase.commentList') }}</div>
|
||||
<div>
|
||||
<a-radio-group v-model="activeComment" type="button">
|
||||
|
@ -52,12 +52,19 @@
|
|||
<div class="markdown-body" style="margin-left: 48px" v-html="item.contentText"></div>
|
||||
<div class="ml-[48px] mt-[8px] text-[var(--color-text-4)]">
|
||||
{{ dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
<span v-if="item.deleted" class="ml-[16px]">
|
||||
{{ item.reviewName }}
|
||||
</span>
|
||||
<span v-else class="ml-[16px] cursor-pointer text-[rgb(var(--primary-5))]" @click="review(item)">
|
||||
{{ item.reviewName }}
|
||||
</span>
|
||||
<a-tooltip :content="item.reviewName" :mouse-enter-delay="300">
|
||||
<span v-if="item.deleted" class="one-text-line ml-[16px] max-w-[300px] break-words break-all">
|
||||
{{ characterLimit(item.reviewName) }}
|
||||
</span>
|
||||
|
||||
<span
|
||||
v-else
|
||||
class="one-text-line ml-[16px] max-w-[300px] cursor-pointer break-words break-all text-[rgb(var(--primary-5))]"
|
||||
@click="review(item)"
|
||||
>
|
||||
{{ characterLimit(item.reviewName) }}
|
||||
</span>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<MsEmpty v-if="reviewCommentList.length === 0" />
|
||||
|
@ -87,6 +94,7 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useModal from '@/hooks/useModal';
|
||||
import useFeatureCaseStore from '@/store/modules/case/featureCase';
|
||||
import { characterLimit } from '@/utils';
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
|
||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!-- eslint-disable vue/no-v-html -->
|
||||
<template>
|
||||
<div class="caseDetailWrapper ml-1">
|
||||
<div class="caseDetailWrapper ml-1 !break-words break-all">
|
||||
<a-form ref="caseFormRef" class="rounded-[4px]" :model="detailForm" layout="vertical">
|
||||
<a-form-item
|
||||
class="relative"
|
||||
|
|
|
@ -172,56 +172,37 @@ export function getTableFields(customFields: CustomAttributes[], itemDataIndex:
|
|||
|
||||
export function initFormCreate(customFields: CustomAttributes[], permission: string[]) {
|
||||
return customFields.map((item: any) => {
|
||||
const multipleType = ['MULTIPLE_SELECT', 'CHECKBOX', 'MULTIPLE_MEMBER', 'MULTIPLE_INPUT'];
|
||||
const multipleType = ['MULTIPLE_SELECT', 'CHECKBOX'];
|
||||
const numberType = ['INT', 'FLOAT'];
|
||||
const memberType = ['MEMBER', 'MULTIPLE_MEMBER'];
|
||||
const multipleInputType = ['MULTIPLE_INPUT'];
|
||||
const singleType = ['SELECT', 'RADIO'];
|
||||
let currentDefaultValue;
|
||||
let optionsValue = item.options;
|
||||
const optionsValue = item.options || [];
|
||||
// 处理数字类型
|
||||
if (numberType.includes(item.type)) {
|
||||
currentDefaultValue = item.defaultValue * 1;
|
||||
currentDefaultValue = Number(item.defaultValue);
|
||||
// 处理多选项类型为空的默认值
|
||||
} else if (multipleType.includes(item.type) && Array.isArray(item.defaultValue) && item.defaultValue.length === 0) {
|
||||
currentDefaultValue = item.defaultValue;
|
||||
// 处理多选情况
|
||||
} else if (multipleType.includes(item.type)) {
|
||||
if (item.type !== 'MULTIPLE_INPUT' && !item.type.includes('MEMBER')) {
|
||||
const tempValue = JSON.parse(item.defaultValue);
|
||||
const optionsIds = item.options?.map((e: any) => e.value);
|
||||
currentDefaultValue = optionsIds.filter((e: any) => tempValue.includes(e));
|
||||
// 多选成员
|
||||
} else if (memberType.includes(item.type)) {
|
||||
optionsValue = [
|
||||
{
|
||||
fieldId: item.fieldId,
|
||||
internal: item.internal,
|
||||
text: userStore.name || '',
|
||||
value: userStore.id || '',
|
||||
},
|
||||
];
|
||||
// 多选成员没有选择CREATE_USER
|
||||
if (Array.isArray(item.defaultValue) && !item.defaultValue.includes('CREATE_USER')) {
|
||||
currentDefaultValue = [];
|
||||
// 选择了创建人
|
||||
} else if (item.defaultValue.includes('CREATE_USER')) {
|
||||
currentDefaultValue = [userStore.id];
|
||||
// 已选择成员
|
||||
} else {
|
||||
currentDefaultValue = JSON.parse(item.defaultValue);
|
||||
}
|
||||
} else {
|
||||
currentDefaultValue = JSON.parse(item.defaultValue);
|
||||
}
|
||||
const tempValue = JSON.parse(item.defaultValue);
|
||||
const optionsIds = optionsValue.map((e: any) => e.value);
|
||||
currentDefaultValue = (optionsIds || []).filter((e: any) => tempValue.includes(e));
|
||||
} else if (memberType.includes(item.type)) {
|
||||
optionsValue = [
|
||||
{
|
||||
fieldId: item.fieldId,
|
||||
internal: item.internal,
|
||||
text: userStore.name || '',
|
||||
value: userStore.id || '',
|
||||
},
|
||||
];
|
||||
currentDefaultValue = item.defaultValue;
|
||||
if (Array.isArray(item.defaultValue) && !item.defaultValue.includes('CREATE_USER')) {
|
||||
currentDefaultValue = item.type === 'MEMBER' ? '' : [];
|
||||
} else if (item.defaultValue.includes('CREATE_USER')) {
|
||||
currentDefaultValue = item.type === 'MEMBER' ? '' : [];
|
||||
} else {
|
||||
currentDefaultValue = item.type === 'MEMBER' ? item.defaultValue : JSON.parse(item.defaultValue);
|
||||
}
|
||||
} else if (multipleInputType.includes(item.type)) {
|
||||
currentDefaultValue = JSON.parse(item.defaultValue);
|
||||
} else if (singleType.includes(item.type)) {
|
||||
const optionsIds = optionsValue.map((e: any) => e.value);
|
||||
currentDefaultValue = (optionsIds || []).find((e: any) => item.defaultValue === e) || '';
|
||||
} else {
|
||||
currentDefaultValue = item.defaultValue;
|
||||
}
|
||||
|
|
|
@ -280,12 +280,12 @@
|
|||
confirmLoading.value = true;
|
||||
const { status, params } = form;
|
||||
paramsList.value = JSON.parse(params);
|
||||
const paramTableList = paramsList.value.slice(0, -1);
|
||||
// const paramTableList = paramsList.value.slice(0, -1);
|
||||
const paramsObj: AddOrUpdateCommonScript = {
|
||||
...form,
|
||||
status: status || 'DRAFT',
|
||||
projectId: currentProjectId.value,
|
||||
params: JSON.stringify(paramTableList),
|
||||
params,
|
||||
};
|
||||
await addOrUpdateCommonScriptReq(paramsObj);
|
||||
showScriptDrawer.value = false;
|
||||
|
|
|
@ -421,7 +421,7 @@
|
|||
} else if (route.query.type === 'API') {
|
||||
routeName.value = ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT_API_DETAIL;
|
||||
} else {
|
||||
routeName.value = ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT_API_DETAIL;
|
||||
routeName.value = ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE_MANAGEMENT_BUG_DETAIL;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -93,12 +93,30 @@
|
|||
/>
|
||||
</a-form-item>
|
||||
<!-- 日期和数值 -->
|
||||
|
||||
<a-form-item
|
||||
v-if="showDateOrNumber?.length"
|
||||
v-if="fieldForm.type === 'NUMBER'"
|
||||
field="selectFormat"
|
||||
:label="
|
||||
fieldForm.type === 'NUMBER' ? t('system.orgTemplate.numberFormat') : t('system.orgTemplate.dateFormat')
|
||||
"
|
||||
:label="t('system.orgTemplate.numberFormat')"
|
||||
asterisk-position="end"
|
||||
>
|
||||
<a-select
|
||||
v-model="selectNumber"
|
||||
class="w-[260px]"
|
||||
:placeholder="t('system.orgTemplate.formatPlaceholder')"
|
||||
allow-clear
|
||||
:default-value="numberTypeOptions[0].value"
|
||||
:disabled="isEdit"
|
||||
>
|
||||
<a-option v-for="item of numberTypeOptions" :key="item.value" :value="item.value">
|
||||
<div class="flex items-center">{{ item.label }}</div>
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
v-if="fieldForm.type === 'DATE'"
|
||||
field="selectFormat"
|
||||
:label="t('system.orgTemplate.dateFormat')"
|
||||
asterisk-position="end"
|
||||
>
|
||||
<a-select
|
||||
|
@ -107,8 +125,9 @@
|
|||
:placeholder="t('system.orgTemplate.formatPlaceholder')"
|
||||
allow-clear
|
||||
:disabled="isEdit"
|
||||
:default-value="dateOptions[0].value"
|
||||
>
|
||||
<a-option v-for="item of showDateOrNumber" :key="item.value" :value="item.value">
|
||||
<a-option v-for="item of dateOptions" :key="item.value" :value="item.value">
|
||||
<div class="flex items-center">{{ item.label }}</div>
|
||||
</a-option>
|
||||
</a-select>
|
||||
|
@ -138,7 +157,7 @@
|
|||
|
||||
import type { AddOrUpdateField, fieldIconAndNameModal, FieldOptions } from '@/models/setting/template';
|
||||
|
||||
import { fieldIconAndName, getFieldRequestApi, getFieldType } from './fieldSetting';
|
||||
import { dateOptions, fieldIconAndName, getFieldRequestApi, getFieldType, numberTypeOptions } from './fieldSetting';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
@ -174,6 +193,7 @@
|
|||
const fieldForm = ref<AddOrUpdateField>({ ...initFieldForm });
|
||||
const isEdit = ref<boolean>(false);
|
||||
const selectFormat = ref<FormItemType>(); // 选择格式
|
||||
const selectNumber = ref<FormItemType>(); // 数字格式
|
||||
const isMultipleSelectMember = ref<boolean | undefined>(false); // 成员多选
|
||||
const fieldType = ref<FormItemType>(); // 整体字段类型
|
||||
|
||||
|
@ -183,18 +203,6 @@
|
|||
return showOptionsType.includes(fieldForm.value.type as FormItemType);
|
||||
});
|
||||
|
||||
// 是否展示日期或数值
|
||||
const showDateOrNumber = computed(() => {
|
||||
// if (getFieldType(fieldForm.value.type)[0]) {
|
||||
// selectFormat.value = getFieldType(fieldForm.value.type)[0]?.value;
|
||||
// if (fieldForm.value.type) return getFieldType(fieldForm.value.type);
|
||||
// }
|
||||
selectFormat.value = getFieldType(fieldForm.value.type)[0]?.value;
|
||||
if (fieldForm.value.type) {
|
||||
return getFieldType(fieldForm.value.type);
|
||||
}
|
||||
});
|
||||
|
||||
// 批量表单-1.仅选项情况
|
||||
const onlyOptions: Ref<FormItemModel> = ref({
|
||||
filed: 'text',
|
||||
|
@ -263,7 +271,7 @@
|
|||
formCopy.scene = route.query.type;
|
||||
formCopy.scopeId = scopeId.value;
|
||||
|
||||
// 如果选择是日期或者数值
|
||||
// 如果选择是日期
|
||||
if (selectFormat.value) {
|
||||
formCopy.type = selectFormat.value;
|
||||
}
|
||||
|
@ -273,9 +281,9 @@
|
|||
formCopy.type = isMultipleSelectMember.value ? 'MULTIPLE_MEMBER' : 'MEMBER';
|
||||
}
|
||||
|
||||
// 如果选择是日期或者是数值
|
||||
if (selectFormat.value) {
|
||||
formCopy.type = selectFormat.value;
|
||||
// 如果选择是数值
|
||||
if (selectNumber.value) {
|
||||
formCopy.type = selectNumber.value;
|
||||
}
|
||||
|
||||
// 处理参数
|
||||
|
@ -362,10 +370,10 @@
|
|||
const getSpecialHandler = (itemType: FormItemType): FormItemType => {
|
||||
switch (itemType) {
|
||||
case 'INT':
|
||||
selectFormat.value = itemType;
|
||||
selectNumber.value = itemType;
|
||||
return 'NUMBER';
|
||||
case 'FLOAT':
|
||||
selectFormat.value = itemType;
|
||||
selectNumber.value = itemType;
|
||||
return 'NUMBER';
|
||||
case 'MULTIPLE_MEMBER':
|
||||
return 'MEMBER';
|
||||
|
|
|
@ -38,7 +38,7 @@ const { t } = useI18n();
|
|||
const templateStore = useTemplateStore();
|
||||
|
||||
// 字段类型-日期
|
||||
const dateOptions: { label: string; value: FormItemType }[] = [
|
||||
export const dateOptions: { label: string; value: FormItemType }[] = [
|
||||
{
|
||||
label: dayjs().format('YYYY-MM-DD'),
|
||||
value: 'DATE',
|
||||
|
@ -50,7 +50,7 @@ const dateOptions: { label: string; value: FormItemType }[] = [
|
|||
];
|
||||
|
||||
// 字段类型- 数字
|
||||
const numberTypeOptions: { label: string; value: FormItemType }[] = [
|
||||
export const numberTypeOptions: { label: string; value: FormItemType }[] = [
|
||||
{
|
||||
label: '整数',
|
||||
value: 'INT',
|
||||
|
|
Loading…
Reference in New Issue