feat(缺陷管理): 分享缺陷
This commit is contained in:
parent
fd13deefc8
commit
4a30fb7436
|
@ -158,7 +158,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { debounce } from 'lodash-es';
|
||||
|
||||
|
@ -194,6 +194,7 @@
|
|||
import { RouteEnum } from '@/enums/routeEnum';
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const detailDrawerRef = ref<InstanceType<typeof MsDetailDrawer>>();
|
||||
const wrapperRef = ref();
|
||||
const { isFullScreen, toggleFullScreen } = useFullScreen(wrapperRef);
|
||||
|
@ -290,7 +291,26 @@
|
|||
const shareLoading = ref<boolean>(false);
|
||||
|
||||
function shareHandler() {
|
||||
Message.info(t('bugManagement.detail.shareTip'));
|
||||
const { origin } = window.location;
|
||||
const url = `${origin}/#${route.path}?id=${detailInfo.value.id}&projectId=${appStore.currentProjectId}&organizationId=${appStore.currentOrgId}`;
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(url).then(
|
||||
() => {
|
||||
Message.info(t('bugManagement.detail.shareTip'));
|
||||
},
|
||||
(e) => {
|
||||
Message.error(e);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
const input = document.createElement('input');
|
||||
input.value = url;
|
||||
document.body.appendChild(input);
|
||||
input.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(input);
|
||||
Message.info(t('bugManagement.detail.shareTip'));
|
||||
}
|
||||
}
|
||||
|
||||
const followLoading = ref<boolean>(false);
|
||||
|
|
|
@ -527,7 +527,6 @@
|
|||
});
|
||||
} else {
|
||||
Message.success(t('common.createSuccess'));
|
||||
|
||||
if (isContinue) {
|
||||
// 如果是保存并继续创建
|
||||
const { templateId } = form.value;
|
||||
|
@ -550,10 +549,12 @@
|
|||
});
|
||||
return;
|
||||
}
|
||||
debugger;
|
||||
router.push({
|
||||
name: BugManagementRouteEnum.BUG_MANAGEMENT_CREATE_SUCCESS,
|
||||
query: {
|
||||
id: res.id,
|
||||
...route.query,
|
||||
id: res.data.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -125,6 +125,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" async setup>
|
||||
import { useRoute } from 'vue-router';
|
||||
import { Message, TableData } from '@arco-design/web-vue';
|
||||
|
||||
import { MsAdvanceFilter, timeSelectOptions } from '@/components/pure/ms-advance-filter';
|
||||
|
@ -185,6 +186,7 @@
|
|||
const licenseStore = useLicenseStore();
|
||||
const isXpack = computed(() => licenseStore.hasLicense());
|
||||
const { openDeleteModal } = useModal();
|
||||
const route = useRoute();
|
||||
// 自定义字段
|
||||
const customFields = ref<BugEditCustomField[]>([]);
|
||||
// 当前选择的条数
|
||||
|
@ -579,8 +581,12 @@
|
|||
|
||||
onMounted(() => {
|
||||
setLoadListParams({ projectId: projectId.value });
|
||||
fetchData();
|
||||
setExportOptionData();
|
||||
fetchData();
|
||||
if (route.query.id) {
|
||||
// 分享或成功进来的页面
|
||||
handleShowDetail(route.query.id as string, 0);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ export default {
|
|||
detail: '详情',
|
||||
case: '用例',
|
||||
comment: '评论',
|
||||
shareTip: '分享链接已复制到剪贴板',
|
||||
deleteTitle: '确认删除 {name} 吗?',
|
||||
deleteContent: '删除后,MeterSphere 创建的缺陷进入回收站;第三方平台同步的缺陷将不做回收',
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue