style: 修改项目管理&组织管理模板工作流相关展示问题

This commit is contained in:
xinxin.wu 2024-05-09 16:53:57 +08:00 committed by 刘瑞斌
parent bdc1843176
commit 44819f72a4
11 changed files with 54 additions and 48 deletions

View File

@ -162,17 +162,13 @@
import ValidateModal from './components/export/validateModal.vue'; import ValidateModal from './components/export/validateModal.vue';
import ValidateResult from './components/export/validateResult.vue'; import ValidateResult from './components/export/validateResult.vue';
import featureCase, { import { createCaseModuleTree, importExcelCase, importExcelChecked } from '@/api/modules/case-management/featureCase';
createCaseModuleTree,
importExcelCase,
importExcelChecked,
} from '@/api/modules/case-management/featureCase';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';
import useFeatureCaseStore from '@/store/modules/case/featureCase'; import useFeatureCaseStore from '@/store/modules/case/featureCase';
import { hasAllPermission, hasAnyPermission } from '@/utils/permission'; import { hasAllPermission, hasAnyPermission } from '@/utils/permission';
import type { CaseModuleQueryParams, CreateOrUpdateModule, ValidateInfo } from '@/models/caseManagement/featureCase'; import type { CreateOrUpdateModule, ValidateInfo } from '@/models/caseManagement/featureCase';
import { TableQueryParams } from '@/models/common'; import { TableQueryParams } from '@/models/common';
import { CaseManagementRouteEnum } from '@/enums/routeEnum'; import { CaseManagementRouteEnum } from '@/enums/routeEnum';

View File

@ -30,6 +30,7 @@
<MsBaseTable <MsBaseTable
v-bind="propsRes" v-bind="propsRes"
:action-config="tableBatchActions" :action-config="tableBatchActions"
:selectable="hasAnyPermission(['ORGANIZATION_MEMBER:READ+UPDATE'])"
@selected-change="handleTableSelect" @selected-change="handleTableSelect"
v-on="propsEvent" v-on="propsEvent"
@batch-action="handleTableBatch" @batch-action="handleTableBatch"

View File

@ -15,8 +15,7 @@
<div class="inner-wrapper"> <div class="inner-wrapper">
<div class="optional-field"> <div class="optional-field">
<div class="optional-header"> <div class="optional-header">
<div class="font-medium">{{ t('system.orgTemplate.optionalField') }}</div> <a-checkbox :model-value="isCheckedAll" :indeterminate="!indeterminate" @change="handleChangeAll">
<a-checkbox :model-value="isCheckedAll" :indeterminate="indeterminate" @change="handleChangeAll">
<span class="font-medium text-[var(--color-text-3)]">{{ t('system.orgTemplate.selectAll') }}</span> <span class="font-medium text-[var(--color-text-3)]">{{ t('system.orgTemplate.selectAll') }}</span>
</a-checkbox> </a-checkbox>
</div> </div>
@ -28,7 +27,7 @@
<div v-for="field in systemField" :key="field.id" class="item checkbox"> <div v-for="field in systemField" :key="field.id" class="item checkbox">
<a-checkbox :value="field.id" :disabled="field.internal && field.name == t('case.caseLevel')" <a-checkbox :value="field.id" :disabled="field.internal && field.name == t('case.caseLevel')"
><a-tooltip :content="field.name"> ><a-tooltip :content="field.name">
<div>{{ field.name }}</div></a-tooltip <div class="one-line-text max-w-[100px]">{{ field.name }}</div></a-tooltip
></a-checkbox ></a-checkbox
> >
</div> </div>
@ -43,7 +42,7 @@
<div v-for="field in customField" :key="field.id" class="item"> <div v-for="field in customField" :key="field.id" class="item">
<a-checkbox :value="field.id" <a-checkbox :value="field.id"
><a-tooltip :content="field.name"> ><a-tooltip :content="field.name">
<div class="checkbox">{{ field.name }}</div></a-tooltip <div class="one-line-text max-w-[100px]">{{ field.name }}</div></a-tooltip
></a-checkbox ></a-checkbox
> >
</div> </div>
@ -74,9 +73,13 @@
<div class="selected-list p-4"> <div class="selected-list p-4">
<VueDraggable v-model="selectedList" ghost-class="ghost"> <VueDraggable v-model="selectedList" ghost-class="ghost">
<div v-for="element in selectedList" :key="element.dateIndex" class="selected-item"> <div v-for="element in selectedList" :key="element.dateIndex" class="selected-item">
<a-tooltip :content="element.name"> <a-tooltip :content="element.name" position="left">
<span> <MsIcon type="icon-icon_drag" class="mt-[3px] text-[16px] text-[var(--color-text-4)]" /></span> <div class="flex flex-row flex-nowrap">
<span class="one-line-text ml-2 w-[270px]">{{ element.name }}</span> <span>
<MsIcon type="icon-icon_drag" class="mt-[3px] text-[16px] text-[var(--color-text-4)]"
/></span>
<span class="one-line-text ml-2 max-w-[180px]">{{ element.name }}</span>
</div>
</a-tooltip> </a-tooltip>
<icon-close <icon-close
v-if="!element.internal" v-if="!element.internal"
@ -169,7 +172,7 @@
}); });
// //
const indeterminate = computed(() => { const indeterminate = computed(() => {
return selectSystemIds.value.length + selectCustomIds.value.length === selectCustomIds.value.length; return isCheckSystemIdsAll.value && isCheckCustomIdsAll.value;
}); });
// //
@ -265,6 +268,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
border: 1px solid var(--color-text-n8); border: 1px solid var(--color-text-n8);
border-radius: 6px;
// //
.optional-field { .optional-field {
flex-grow: 1; flex-grow: 1;
@ -302,12 +306,7 @@
.checkboxContainer { .checkboxContainer {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
grid-gap: 16px; grid-gap: 8px;
.checkbox {
width: 90px;
white-space: nowrap;
@apply overflow-hidden text-ellipsis;
}
} }
.ghost { .ghost {
border: 1px dashed rgba(var(--primary-5)); border: 1px dashed rgba(var(--primary-5));

View File

@ -742,7 +742,7 @@
position: absolute; position: absolute;
top: -12px; top: -12px;
right: 16px; right: 16px;
z-index: 99999999 !important; z-index: 9 !important;
background: white; background: white;
opacity: 0; opacity: 0;
@apply flex items-center justify-end; @apply flex items-center justify-end;

View File

@ -11,9 +11,7 @@
v-model="viewForm.name" v-model="viewForm.name"
:max-length="255" :max-length="255"
:placeholder="t('system.orgTemplate.caseNamePlaceholder')" :placeholder="t('system.orgTemplate.caseNamePlaceholder')"
show-word-limit
allow-clear allow-clear
:disabled="isDisabled"
></a-input> ></a-input>
</a-form-item> </a-form-item>
<a-form-item field="precondition" :label="t('system.orgTemplate.precondition')" asterisk-position="end"> <a-form-item field="precondition" :label="t('system.orgTemplate.precondition')" asterisk-position="end">

View File

@ -9,10 +9,8 @@
> >
<a-input <a-input
v-model="viewForm.name" v-model="viewForm.name"
:disabled="true"
:max-length="255" :max-length="255"
:placeholder="t('system.orgTemplate.defectNamePlaceholder')" :placeholder="t('system.orgTemplate.defectNamePlaceholder')"
show-word-limit
allow-clear allow-clear
></a-input> ></a-input>
</a-form-item> </a-form-item>

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<a-alert <a-alert
v-if="isShowTip" v-if="isShowTip && hasAnyPermission([...props.createPermission, ...props.updatePermission])"
class="mb-6" class="mb-6"
:type="isEnabledTemplate && props.mode === 'organization' ? 'warning' : 'info'" :type="isEnabledTemplate && props.mode === 'organization' ? 'warning' : 'info'"
> >

View File

@ -247,10 +247,11 @@
cursor: pointer; cursor: pointer;
} }
.enable { .enable {
height: 20px;
font-size: 12px; font-size: 12px;
color: var(--color-text-4); color: var(--color-text-4);
background: var(--color-text-n8); background: var(--color-text-n8);
line-height: 20px; line-height: 14px;
@apply ml-4 rounded p-1; @apply ml-4 rounded p-1;
} }
@apply flex flex-col justify-between; @apply flex flex-col justify-between;

View File

@ -32,7 +32,6 @@
:data="dataList" :data="dataList"
row-key="id" row-key="id"
:bordered="{ cell: true }" :bordered="{ cell: true }"
:hoverable="false"
:pagination="false" :pagination="false"
:scroll="{ x: 'auto' }" :scroll="{ x: 'auto' }"
:draggable="{ type: 'handle', width: 39 }" :draggable="{ type: 'handle', width: 39 }"
@ -53,31 +52,27 @@
<MsTag class="relative" size="large" theme="light">{{ column.title }} </MsTag></div <MsTag class="relative" size="large" theme="light">{{ column.title }} </MsTag></div
> >
<div v-else class="splitBox"> <div v-else class="splitBox">
<div class="startStatus"> {{ t('system.orgTemplate.startState') }} </div> <div class="startStatus font-normal"> {{ t('system.orgTemplate.startState') }} </div>
<div class="line"></div> <div class="line"></div>
<div class="endStatus"> {{ t('system.orgTemplate.flowState') }} </div> <div class="endStatus font-normal"> {{ t('system.orgTemplate.flowState') }} </div>
</div> </div>
</template> </template>
<template #cell="{ record }"> <template #cell="{ record }">
<div v-if="column.dataIndex === 'statusName'"> <div v-if="column.dataIndex === 'statusName'">
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div class="relative"> <div class="relative">
<MsTag class="relative" size="large" theme="light">{{ record.name }}</MsTag> <MsTag class="relative font-normal" size="large" theme="light">{{ record.name }}</MsTag>
<span v-if="record.statusDefinitions.join().includes('START')" class="absolute -top-6 left-7"> <span v-if="record.statusDefinitions.join().includes('START')" class="absolute -top-6 left-7">
<svg-icon width="36px" height="36px" class="inline-block text-[white]" name="start"></svg-icon <svg-icon width="36px" height="36px" class="inline-block text-[white]" name="start"></svg-icon
></span> ></span>
</div> </div>
<div <MsTableMoreAction
v-if="!isEnableProjectState" v-if="!isEnableProjectState"
v-permission="props.updatePermission" class="mr-2"
class="action mr-2 flex h-8 w-8 items-center justify-center rounded opacity-0" :list="getMoreActions(record)"
> @select="(item) => handleMoreActionSelect(item, record)"
<MsTableMoreAction ></MsTableMoreAction>
:list="getMoreActions(record)"
@select="(item) => handleMoreActionSelect(item, record)"
></MsTableMoreAction
></div>
</div> </div>
</div> </div>
<div v-else class="!h-[82px] min-w-[116px] p-[2px]"> <div v-else class="!h-[82px] min-w-[116px] p-[2px]">
@ -98,7 +93,7 @@
</a-table-column> </a-table-column>
<a-table-column <a-table-column
:title="t('system.orgTemplate.operation')" :title="t('system.orgTemplate.operation')"
:width="320" :width="260"
header-cell-class="splitOperation" header-cell-class="splitOperation"
fixed="right" fixed="right"
> >
@ -252,6 +247,7 @@
label: 'system.orgTemplate.setInitState', label: 'system.orgTemplate.setInitState',
eventTag: 'setInit', eventTag: 'setInit',
disabled: record.statusDefinitions.join().includes('START'), disabled: record.statusDefinitions.join().includes('START'),
permission: props.updatePermission,
}, },
{ {
isDivider: true, isDivider: true,
@ -260,6 +256,7 @@
label: 'system.orgTemplate.delete', label: 'system.orgTemplate.delete',
eventTag: 'delete', eventTag: 'delete',
danger: true, danger: true,
permission: props.updatePermission,
}, },
]; ];
return moreActions; return moreActions;
@ -390,6 +387,7 @@
if (isChange) return false; if (isChange) return false;
try { try {
await dragChangeRequest(scopedId.value, route.query.type, dataIds); await dragChangeRequest(scopedId.value, route.query.type, dataIds);
Message.success(t('common.updateSuccess'));
getWorkFetchList(); getWorkFetchList();
} catch (error) { } catch (error) {
console.log(error); console.log(error);
@ -490,7 +488,7 @@
} }
} }
:deep(.arco-table-drag-handle) { :deep(.arco-table-drag-handle) {
border-right: 1px solid transparent !important; border-right: none !important;
.arco-icon-drag-dot-vertical { .arco-icon-drag-dot-vertical {
color: var(--color-text-brand); color: var(--color-text-brand);
} }
@ -506,7 +504,7 @@
} }
} }
:deep(.arco-table-operation) { :deep(.arco-table-operation) {
border-right: 1px solid transparent !important; border-right: none;
} }
.startStatus { .startStatus {
position: absolute; position: absolute;
@ -520,11 +518,11 @@
} }
.line { .line {
position: absolute; position: absolute;
left: -35px; left: -45px;
width: 117%; width: 128%;
height: 1px; height: 1px;
background: var(--color-text-n8); background: var(--color-text-n8);
transform: rotateZ(18deg); transform: rotateZ(19deg);
} }
.label { .label {
margin-top: 16px; margin-top: 16px;
@ -544,4 +542,16 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
:deep(.arco-table-border) {
border-right: none !important;
border-bottom: none !important;
}
:deep(.arco-table-tr):hover {
.arco-table-td:not(.arco-table-col-fixed-right) {
background: transparent !important;
}
.arco-table-td.arco-table-col-fixed-right::before {
background: transparent !important;
}
}
</style> </style>

View File

@ -137,7 +137,8 @@ export default {
'system.orgTemplate.deleteFiledContentNotUsed': 'This field will be lost, please be careful!', 'system.orgTemplate.deleteFiledContentNotUsed': 'This field will be lost, please be careful!',
'system.orgTemplate.deleteSuccess': 'Delete Successfully', 'system.orgTemplate.deleteSuccess': 'Delete Successfully',
'system.orgTemplate.setInitStateSuccess': 'Set the initial state successfully', 'system.orgTemplate.setInitStateSuccess': 'Set the initial state successfully',
'system.orgTemplate.setEndStateSuccess': 'Setting the end status succeeded', 'system.orgTemplate.setEndStateSuccess':
'If the setting is successful, the end state takes effect immediately in the project',
'system.orgTemplate.noAllowDeleteInitState': 'The initial status cannot be deleted', 'system.orgTemplate.noAllowDeleteInitState': 'The initial status cannot be deleted',
'system.orgTemplate.deleteStateStepTitle': 'Are you sure about the delete {name} step?', 'system.orgTemplate.deleteStateStepTitle': 'Are you sure about the delete {name} step?',
'system.orgTemplate.deleteStateStepContent': 'system.orgTemplate.deleteStateStepContent':
@ -212,4 +213,5 @@ export default {
'system.orgTemplate.apiFieldNotEmpty': 'The field API cannot be empty', 'system.orgTemplate.apiFieldNotEmpty': 'The field API cannot be empty',
'system.orgTemplate.selectThirdPlatType': 'Please select the third party platform', 'system.orgTemplate.selectThirdPlatType': 'Please select the third party platform',
'system.orgTemplate.orgNameTip': 'The organization name is incorrect', 'system.orgTemplate.orgNameTip': 'The organization name is incorrect',
'system.orgTemplate.notAllowEditView': 'The template is preview and cannot be edited',
}; };

View File

@ -130,7 +130,7 @@ export default {
'system.orgTemplate.deleteFiledContentNotUsed': '删除后,字段将从字段列表移除,请谨慎操作!', 'system.orgTemplate.deleteFiledContentNotUsed': '删除后,字段将从字段列表移除,请谨慎操作!',
'system.orgTemplate.deleteSuccess': '删除成功', 'system.orgTemplate.deleteSuccess': '删除成功',
'system.orgTemplate.setInitStateSuccess': '设置初始态成功', 'system.orgTemplate.setInitStateSuccess': '设置初始态成功',
'system.orgTemplate.setEndStateSuccess': '设置结束状态成功', 'system.orgTemplate.setEndStateSuccess': '设置成功,结束状态在项目中立即生效',
'system.orgTemplate.noAllowDeleteInitState': '初始状态不可删除', 'system.orgTemplate.noAllowDeleteInitState': '初始状态不可删除',
'system.orgTemplate.deleteStateStepTitle': '确定删除 {name} 步骤吗?', 'system.orgTemplate.deleteStateStepTitle': '确定删除 {name} 步骤吗?',
'system.orgTemplate.deleteStateStepContent': '删除后,会在项目中立即生效且删除不可撤回,请谨慎操作!', 'system.orgTemplate.deleteStateStepContent': '删除后,会在项目中立即生效且删除不可撤回,请谨慎操作!',
@ -201,4 +201,5 @@ export default {
'system.orgTemplate.apiFieldNotEmpty': '字段 API 不能为空', 'system.orgTemplate.apiFieldNotEmpty': '字段 API 不能为空',
'system.orgTemplate.selectThirdPlatType': '请选择三方平台', 'system.orgTemplate.selectThirdPlatType': '请选择三方平台',
'system.orgTemplate.orgNameTip': '组织名称不正确', 'system.orgTemplate.orgNameTip': '组织名称不正确',
'system.orgTemplate.notAllowEditView': '当前为模板预览,不可编辑',
}; };