fix: 修改用例管理&缺陷管理重复保存问题&三方插件密码框首次全选不能删除问题

This commit is contained in:
xinxin.wu 2024-05-23 17:05:37 +08:00 committed by 刘瑞斌
parent 8c6358f314
commit ed4c575729
4 changed files with 36 additions and 29 deletions

View File

@ -56,11 +56,18 @@
</div> </div>
<slot name="footerRight"> <slot name="footerRight">
<div class="flex justify-end gap-[16px]"> <div class="flex justify-end gap-[16px]">
<a-button type="secondary" @click="back">{{ t('mscard.defaultCancelText') }}</a-button> <a-button :disabled="props.loading" type="secondary" @click="back">{{
<a-button v-if="!props.hideContinue && !props.isEdit" type="secondary" @click="emit('saveAndContinue')"> t('mscard.defaultCancelText')
}}</a-button>
<a-button
v-if="!props.hideContinue && !props.isEdit"
:loading="props.loading"
type="secondary"
@click="emit('saveAndContinue')"
>
{{ props.saveAndContinueText || t('mscard.defaultSaveAndContinueText') }} {{ props.saveAndContinueText || t('mscard.defaultSaveAndContinueText') }}
</a-button> </a-button>
<a-button type="primary" @click="emit('save')"> <a-button :loading="props.loading" type="primary" @click="emit('save')">
{{ props.saveText || t(props.isEdit ? 'mscard.defaultUpdate' : 'mscard.defaultConfirm') }} {{ props.saveText || t(props.isEdit ? 'mscard.defaultUpdate' : 'mscard.defaultConfirm') }}
</a-button> </a-button>
</div> </div>

View File

@ -1,23 +1,12 @@
<template> <template>
<a-input <a-input-password
v-model="inputValue" v-model="inputValue"
:max-length="255"
:type="isShowPassword ? 'password' : 'text'"
:placeholder="placeholder" :placeholder="placeholder"
style="width: 100%" :default-visibility="false"
autocomplete="username"
allow-clear allow-clear
@clear="clearHandler" @clear="clearHandler"
> @input="inputHandler"
<template #suffix> />
<span v-if="!isShowPassword" @click="togglePasswordVisibility">
<icon-eye />
</span>
<span v-else>
<icon-eye-invisible @click="togglePasswordVisibility" />
</span>
</template>
</a-input>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -44,10 +33,10 @@
emits('update:modelValue', inputValue.value); emits('update:modelValue', inputValue.value);
} }
const isShowPassword = ref<boolean>(true); function inputHandler(value: string) {
const togglePasswordVisibility = () => { inputValue.value = value;
isShowPassword.value = !isShowPassword.value; emits('update:modelValue', inputValue.value);
}; }
</script> </script>
<style scoped></style> <style scoped></style>

View File

@ -16,14 +16,16 @@
/> />
<template #footerRight> <template #footerRight>
<div class="flex justify-end gap-[16px]"> <div class="flex justify-end gap-[16px]">
<a-button type="secondary" @click="cancelHandler">{{ t('mscard.defaultCancelText') }}</a-button> <a-button :disabled="loading" type="secondary" @click="cancelHandler">{{
<a-button v-if="!isEdit" type="secondary" @click="saveHandler(true)"> t('mscard.defaultCancelText')
}}</a-button>
<a-button v-if="!isEdit" :loading="loading" type="secondary" @click="saveHandler(true)">
{{ t('mscard.defaultSaveAndContinueText') }} {{ t('mscard.defaultSaveAndContinueText') }}
</a-button> </a-button>
<a-button v-if="!isFormReviewCase" type="primary" @click="saveHandler(false)"> <a-button v-if="!isFormReviewCase" :loading="loading" type="primary" @click="saveHandler(false)">
{{ okText }} {{ okText }}
</a-button> </a-button>
<a-button v-if="isFormReviewCase" type="primary" @click="saveHandler(false, true)"> <a-button v-if="isFormReviewCase" :loading="loading" type="primary" @click="saveHandler(false, true)">
{{ t('caseManagement.featureCase.createAndLink') }} {{ t('caseManagement.featureCase.createAndLink') }}
</a-button> </a-button>
</div> </div>

View File

@ -186,7 +186,11 @@
<template #operation="{ record }"> <template #operation="{ record }">
<div class="flex items-center"> <div class="flex items-center">
<div <div
v-if="record.functionalCaseCount > 0 && hasAnyPermission(['PROJECT_TEST_PLAN:READ+EXECUTE'])" v-if="
record.functionalCaseCount > 0 &&
hasAnyPermission(['PROJECT_TEST_PLAN:READ+EXECUTE']) &&
record.status !== 'ARCHIVED'
"
class="flex items-center" class="flex items-center"
> >
<MsButton class="!mx-0" @click="openDetail(record.id)">{{ t('testPlan.testPlanIndex.execution') }}</MsButton> <MsButton class="!mx-0" @click="openDetail(record.id)">{{ t('testPlan.testPlanIndex.execution') }}</MsButton>
@ -269,7 +273,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { Message } from '@arco-design/web-vue'; import { Message } from '@arco-design/web-vue';
import { cloneDeep } from 'lodash-es'; import { cloneDeep } from 'lodash-es';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
@ -321,6 +325,7 @@
const tableStore = useTableStore(); const tableStore = useTableStore();
const appStore = useAppStore(); const appStore = useAppStore();
const router = useRouter(); const router = useRouter();
const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const { openModal } = useModal(); const { openModal } = useModal();
@ -565,7 +570,8 @@
function getMoreActions(status: planStatusType, useCount: number) { function getMoreActions(status: planStatusType, useCount: number) {
// //
const copyAction = useCount > 0 && hasAnyPermission(['PROJECT_TEST_PLAN:READ+ADD']) ? copyActions : []; const copyAction =
useCount > 0 && hasAnyPermission(['PROJECT_TEST_PLAN:READ+ADD']) && status !== 'ARCHIVED' ? copyActions : [];
// //
if (status === 'ARCHIVED' || status === 'PREPARED' || status === 'UNDERWAY') { if (status === 'ARCHIVED' || status === 'PREPARED' || status === 'UNDERWAY') {
return [ return [
@ -996,6 +1002,9 @@
); );
onBeforeMount(() => { onBeforeMount(() => {
if (route.query.id) {
openDetail(route.query.id as string);
}
fetchData(); fetchData();
}); });