update:路由调整
This commit is contained in:
@@ -41,11 +41,10 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import routerData from '@/router/routerData/index';
|
||||
import { CommonStore } from '@/stores/common';
|
||||
import { jumpPage } from '@/utils/common';
|
||||
|
||||
const router = useRouter();
|
||||
const store = CommonStore();
|
||||
|
||||
const activePath = ref(store.currentPagePath);
|
||||
@@ -59,7 +58,7 @@ watch(
|
||||
);
|
||||
|
||||
const goPageFun = (data: any) => {
|
||||
router.push({
|
||||
jumpPage({
|
||||
path: data.path,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -18,10 +18,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { CommonStore } from '@/stores/common';
|
||||
import { jumpPage } from '@/utils/common';
|
||||
|
||||
const router = useRouter();
|
||||
const store = CommonStore();
|
||||
const activePath = ref(store.currentPagePath);
|
||||
const tagList = ref(store.alivePages);
|
||||
@@ -34,7 +33,7 @@ watch(
|
||||
);
|
||||
|
||||
const goPageFun = (data: any) => {
|
||||
router.push({
|
||||
jumpPage({
|
||||
path: data.path,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { getAllDictionaryDataApi } from '@/api/system/systemData';
|
||||
import { getUserPermissionsApi } from '@/api/system/user';
|
||||
import { CommonStore } from '@/stores/common';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
export const getAllDictDataFun = async (refresh?: boolean) => {
|
||||
const storageDictData = localStorage.getItem('TOTAL_DICTIONARY_DATA');
|
||||
@@ -73,3 +74,20 @@ export const delayTime = async (delayTime: number) => {
|
||||
}, delayTime);
|
||||
});
|
||||
};
|
||||
|
||||
const win: any = window;
|
||||
const router = useRouter();
|
||||
export const jumpPage = (location: any) => {
|
||||
if (win.__POWERED_BY_WUJIE__) {
|
||||
if (typeof location === 'object') {
|
||||
location.path = `/spdm${location.path}`;
|
||||
} else {
|
||||
location = `/spdm${location}`;
|
||||
}
|
||||
// 在无界微服务内部署
|
||||
win.$wujie?.props.jump(location);
|
||||
} else {
|
||||
// 独立部署
|
||||
router.push(location);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
import { computed, nextTick, onMounted, ref, type Ref } from 'vue';
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { cloneDeep, groupBy, isEqual, uniqBy } from 'lodash-es';
|
||||
import { onBeforeRouteLeave, useRouter } from 'vue-router';
|
||||
import { onBeforeRouteLeave } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import loadCaseTable from '@/components/common/treeCaseTable/loadCaseTable.vue';
|
||||
import AddApprove from './addApprove.vue';
|
||||
@@ -252,6 +252,7 @@ import { getUserTenantId } from '@/utils/user';
|
||||
import { TABLE_NAME } from '@/utils/enum/tableName';
|
||||
import { CommonStore } from '@/stores/common';
|
||||
import { useTaskStore, getEarlyPoolData } from '@/stores/taskPool';
|
||||
import { jumpPage } from '@/utils/common';
|
||||
|
||||
const commonStore = CommonStore();
|
||||
const taskStore = useTaskStore();
|
||||
@@ -415,9 +416,7 @@ const onAddApproveConfirmFun = async (formData: any) => {
|
||||
const to = pendingRoute.value;
|
||||
pendingRoute.value = null;
|
||||
suppressConfirm.value = true;
|
||||
router.push(to.fullPath || to.path).catch(() => {
|
||||
suppressConfirm.value = false;
|
||||
});
|
||||
jumpPage(to.fullPath || to.path);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -735,7 +734,6 @@ const formatDelFun = (removeRecords: TreeNode[]) => {
|
||||
};
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
const pendingRoute: any = ref(null);
|
||||
const suppressConfirm = ref(false);
|
||||
onBeforeRouteLeave((to, from, next) => {
|
||||
|
||||
@@ -9,13 +9,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router';
|
||||
import { House } from '@element-plus/icons-vue';
|
||||
|
||||
const router = useRouter();
|
||||
import { jumpPage } from '@/utils/common';
|
||||
|
||||
const goBackFun = () => {
|
||||
router.push({
|
||||
jumpPage({
|
||||
path: '/',
|
||||
});
|
||||
};
|
||||
|
||||
@@ -94,11 +94,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import * as Icons from '@element-plus/icons-vue';
|
||||
|
||||
const router = useRouter();
|
||||
import { jumpPage } from '@/utils/common';
|
||||
|
||||
const pageList = [
|
||||
{ title: '我的任务', path: '/simulation/condition', icon: Icons['Notification'] },
|
||||
@@ -124,7 +122,7 @@ const searchItems2 = ref<any[]>([
|
||||
const tabNum = ref(1);
|
||||
|
||||
const goPageFun = (path: string) => {
|
||||
router.push({
|
||||
jumpPage({
|
||||
path,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -225,7 +225,6 @@ const activeTab = ref('taskList');
|
||||
|
||||
const goProjectListFun = () => {
|
||||
emits('goBack');
|
||||
// router.push({ path: '/task/projectList' });
|
||||
};
|
||||
|
||||
const showProjectInfoDialog = ref(false);
|
||||
|
||||
@@ -319,8 +319,6 @@ const goProjectDetailFun = (uuid: string, nodeName: string) => {
|
||||
showProjectDetailVisible.value = true;
|
||||
currentProject.nodeName = nodeName;
|
||||
currentProject.uuid = uuid;
|
||||
|
||||
// router.push({ path: '/task/projectDetail', query: { nodeId: uuid, nodeName } });
|
||||
};
|
||||
|
||||
const nodeListApi = async (params: any) => {
|
||||
|
||||
@@ -67,10 +67,10 @@ import { nextTick, onMounted, ref } from 'vue';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
import TableForm from '@/components/common/table/tableForm.vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { useRouter } from 'vue-router';
|
||||
import TaskDetail from '@/views/task/projectDetail/components/taskDetail.vue';
|
||||
import { isNumber } from 'lodash-es';
|
||||
import { getMemberListIds } from '@/utils/task';
|
||||
import { jumpPage } from '@/utils/common';
|
||||
|
||||
const props = defineProps({
|
||||
actionList: {
|
||||
@@ -95,7 +95,6 @@ const formAttrs = ref({
|
||||
const taskParams = ref({ type: 0 });
|
||||
|
||||
const exeTableRef = ref();
|
||||
const router = useRouter();
|
||||
const loadingInterface = ref(false);
|
||||
|
||||
const changeTaskStatus = async (row: any, status: string) => {
|
||||
@@ -232,7 +231,7 @@ const jumpToTaskExecutionFun = (row: any) => {
|
||||
|
||||
localStorage.setItem('CURRENT_TASK_RUN_INFO', JSON.stringify({ ...row, nodeType: 'task' }));
|
||||
|
||||
router.push({ path: '/task/execution' });
|
||||
jumpPage({ path: '/task/execution' });
|
||||
};
|
||||
|
||||
const showTaskDetailDialog = ref(false);
|
||||
|
||||
Reference in New Issue
Block a user