refactor(项目管理): 项目模板&组织模板,用例等级必填

This commit is contained in:
WangXu10 2024-03-13 18:10:48 +08:00 committed by Craftsman
parent 1c86838b8b
commit be3be2d442
1 changed files with 37 additions and 4 deletions

View File

@ -46,9 +46,9 @@
> >
<a-option v-for="item of platFormList" :key="item.value" :value="item.value">{{ item.label }}</a-option> <a-option v-for="item of platFormList" :key="item.value" :value="item.value">{{ item.label }}</a-option>
</a-select> --> </a-select> -->
<a-checkbox v-if="route.query.type === 'BUG'" v-model="templateForm.enableThirdPart" class="mx-2">{{ <a-checkbox v-if="route.query.type === 'BUG'" v-model="templateForm.enableThirdPart" class="mx-2"
t('system.orgTemplate.thirdParty') >{{ t('system.orgTemplate.thirdParty') }}
}}</a-checkbox> </a-checkbox>
<MsTag size="large" class="cursor-pointer" theme="outline" @click="brash"> <MsTag size="large" class="cursor-pointer" theme="outline" @click="brash">
<MsIcon class="text-[var(color-text-4)]" :size="16" type="icon-icon_reset_outlined" /> <MsIcon class="text-[var(color-text-4)]" :size="16" type="icon-icon_reset_outlined" />
</MsTag> </MsTag>
@ -66,11 +66,15 @@
<div class="action"> <div class="action">
<span class="required"> <span class="required">
<a-checkbox <a-checkbox
v-if="!formItem.internal"
v-model="formItem.required" v-model="formItem.required"
class="mr-1" class="mr-1"
@change="(value) => changeState(value, formItem)" @change="(value) => changeState(value, formItem)"
>{{ t('system.orgTemplate.required') }}</a-checkbox >{{ t('system.orgTemplate.required') }}</a-checkbox
> >
<a-checkbox v-else v-model="formItem.required" class="mr-1" disabled>{{
t('system.orgTemplate.required')
}}</a-checkbox>
</span> </span>
<div class="actionList"> <div class="actionList">
<a-tooltip :content="t('system.orgTemplate.toTop')"> <a-tooltip :content="t('system.orgTemplate.toTop')">
@ -142,7 +146,8 @@
:placeholder="t('system.orgTemplate.pleaseEnterAPITip')" :placeholder="t('system.orgTemplate.pleaseEnterAPITip')"
class="mt-1" class="mt-1"
:max-length="255" :max-length="255"
/></a-form-item> />
</a-form-item>
</a-form> </a-form>
</div> </div>
</div> </div>
@ -339,6 +344,7 @@
function resetForm() { function resetForm() {
templateForm.value = { ...initTemplateForm }; templateForm.value = { ...initTemplateForm };
} }
const isError = ref(false); const isError = ref(false);
function inputHandler(value: string) { function inputHandler(value: string) {
@ -347,6 +353,7 @@
} }
isError.value = false; isError.value = false;
} }
// //
async function save() { async function save() {
try { try {
@ -382,12 +389,15 @@
loading.value = false; loading.value = false;
} }
} }
const refStepMap: Record<string, any> = {}; const refStepMap: Record<string, any> = {};
function setStepRefMap(el: refItem, formItem: DefinedFieldItem) { function setStepRefMap(el: refItem, formItem: DefinedFieldItem) {
if (el) { if (el) {
refStepMap[`${formItem.id}`] = el; refStepMap[`${formItem.id}`] = el;
} }
} }
// //
function saveHandler(isContinue = false) { function saveHandler(isContinue = false) {
isContinueFlag.value = isContinue; isContinueFlag.value = isContinue;
@ -442,14 +452,17 @@
}); });
const showFieldDrawer = ref<boolean>(false); const showFieldDrawer = ref<boolean>(false);
function createField() { function createField() {
showFieldDrawer.value = true; showFieldDrawer.value = true;
} }
const showDrawer = ref<boolean>(false); const showDrawer = ref<boolean>(false);
function associatedField() { function associatedField() {
showDrawer.value = true; showDrawer.value = true;
} }
const selectFiled = ref<DefinedFieldItem[]>([]); const selectFiled = ref<DefinedFieldItem[]>([]);
const selectedIds = ref<string[]>(); const selectedIds = ref<string[]>();
@ -502,6 +515,7 @@
formItem.required = value; formItem.required = value;
formItem.formRules[0].effect.required = value; formItem.formRules[0].effect.required = value;
} }
const systemFieldData = ref<CustomField[]>([]); const systemFieldData = ref<CustomField[]>([]);
function getSelectData(customFields: DefinedFieldItem[]) { function getSelectData(customFields: DefinedFieldItem[]) {
@ -561,6 +575,7 @@
}; };
}); });
} }
// //
const getTemplateInfo = async () => { const getTemplateInfo = async () => {
try { try {
@ -620,6 +635,7 @@
}); });
const activeIndex = ref(-1); const activeIndex = ref(-1);
async function brash() { async function brash() {
activeIndex.value = -1; activeIndex.value = -1;
await getClassifyField(); await getClassifyField();
@ -636,6 +652,7 @@
function changeDrag() { function changeDrag() {
activeIndex.value = -1; activeIndex.value = -1;
} }
const configOptions = ref({ const configOptions = ref({
resetBtn: false, resetBtn: false,
submitBtn: false, submitBtn: false,
@ -659,29 +676,35 @@
.wrapper-preview { .wrapper-preview {
display: flex; display: flex;
height: 100%; height: 100%;
.preview-left { .preview-left {
width: 100%; width: 100%;
border-right: 1px solid var(--color-text-n8); border-right: 1px solid var(--color-text-n8);
} }
.preview-right { .preview-right {
padding-top: 8px; padding-top: 8px;
width: 428px; width: 428px;
min-width: 428px; min-width: 428px;
.customWrapper { .customWrapper {
position: relative; position: relative;
margin-bottom: 4px; margin-bottom: 4px;
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 6px; border-radius: 6px;
@apply flex flex-col justify-between; @apply flex flex-col justify-between;
.form { .form {
padding: 8px; padding: 8px;
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 6px; border-radius: 6px;
} }
.form.activeStyle { .form.activeStyle {
border-color: rgb(var(--primary-5)); border-color: rgb(var(--primary-5));
background: var(--color-text-n9); background: var(--color-text-n9);
} }
.action { .action {
position: absolute; position: absolute;
top: -12px; top: -12px;
@ -690,24 +713,29 @@
background: white; background: white;
opacity: 0; opacity: 0;
@apply flex items-center justify-end; @apply flex items-center justify-end;
.actionList { .actionList {
padding: 4px; padding: 4px;
border-radius: 4px; border-radius: 4px;
@apply flex items-center justify-center; @apply flex items-center justify-center;
} }
.required > .arco-checkbox { .required > .arco-checkbox {
padding: 2px 4px; padding: 2px 4px;
border-radius: 4px; border-radius: 4px;
box-shadow: 0 4px 10px -1px rgba(100 100 102/ 15%); box-shadow: 0 4px 10px -1px rgba(100 100 102/ 15%);
} }
} }
&:hover { &:hover {
border: 1px solid var(--color-text-n8); border: 1px solid var(--color-text-n8);
background: var(--color-text-n9); background: var(--color-text-n9);
} }
&:hover > .action { &:hover > .action {
opacity: 1; opacity: 1;
} }
&:hover > .action > .actionList { &:hover > .action > .actionList {
color: rgb(var(--primary-5)); color: rgb(var(--primary-5));
box-shadow: 0 4px 10px -1px rgba(100 100 102/ 15%); box-shadow: 0 4px 10px -1px rgba(100 100 102/ 15%);
@ -715,19 +743,23 @@
} }
} }
} }
.hoverStyle { .hoverStyle {
.customWrapper:hover > .form { .customWrapper:hover > .form {
border-color: var(--color-text-n8) !important; border-color: var(--color-text-n8) !important;
} }
} }
.activeStyle { .activeStyle {
.customWrapper:hover .form { .customWrapper:hover .form {
border-color: rgb(var(--primary-5)); border-color: rgb(var(--primary-5));
} }
} }
:deep(.selfClass) { :deep(.selfClass) {
margin-bottom: 0; margin-bottom: 0;
} }
// :deep(.contentClass > .arco-input-wrapper) { // :deep(.contentClass > .arco-input-wrapper) {
// border-color: transparent; // border-color: transparent;
// &:hover { // &:hover {
@ -755,6 +787,7 @@
border: 1px solid rgba(var(--primary-5)); border: 1px solid rgba(var(--primary-5));
background-color: var(--color-text-n9); background-color: var(--color-text-n9);
} }
:deep(.apiFieldIdClass) { :deep(.apiFieldIdClass) {
margin-bottom: 0; margin-bottom: 0;
} }