Browse Source

feat: 表单流程创建 通过开启新页面 完善 表单拖动options 问题

lanceJiang 6 months ago
parent
commit
c93292201f

+ 1 - 6
src/layout/components/AppMain.vue

@@ -5,7 +5,7 @@
 		<router-view v-slot="{ Component, route }">
 			<transition :name="pageAnimateMode" mode="out-in">
 				<keep-alive :include="cachedViews">
-					<component :is="Component" :key="getCompKey(route)" />
+					<component :is="Component" :key="route.fullPath" />
 				</keep-alive>
 			</transition>
 		</router-view>
@@ -19,17 +19,12 @@
 import { computed, watch } from 'vue'
 import useStore from '@/store'
 import Footer from '@/layout/components/Footer/index.vue'
-import { AppRouteRecordRaw } from '@/router/types'
 import Tabs from '@/layout/components/Tabs/index.vue'
 import MaximizeQuit from './MaximizeQuit.vue'
 const { tagsView, setting } = useStore()
 const tabsVisible = computed(() => setting.tabsVisible)
 const cachedViews = computed(() => tagsView.cachedViews)
 
-const getCompKey = (route: AppRouteRecordRaw) => {
-	if (route.name === 'flow_create_index') return route.path
-	return route.fullPath
-}
 const pageAnimateMode = computed(() => (setting.animate ? setting.animateMode : undefined))
 watch(
 	() => setting.contentMaximize,

+ 9 - 2
src/views/flow/group/components/listGroup.vue

@@ -332,8 +332,15 @@ const copyEv = (ele: any) => {
 
 // 修改
 const updateEv = async (element: any) => {
-	const jumpRouterUrl = '/flow_create/' + (element.processType === 'main' ? 'index' : element.processType)
-	router.push(`${jumpRouterUrl}?id=${element.processId}`)
+	if (element.processType === 'main') {
+		const { origin, hash } = window.location
+		const hashFlag = hash.indexOf('#') !== -1 // 路由是hash模式
+		const url = `${origin}/${hashFlag ? '#' : ''}/flow_create/index?id=${element.processId}`
+		window.open(url, '_blank')
+		return
+	}
+	const jumpRouterUrl = '/flow_create/' + (element.processType === 'main' ? 'index' : element.processType) + `?id=${element.processId}`
+	router.push(jumpRouterUrl)
 }
 
 // 打开当前流程的历史版本

+ 8 - 1
src/views/flow/group/index.vue

@@ -28,7 +28,7 @@
 					<el-button :type="sortFlag ? 'info' : 'primary'" icon="Plus" :disabled="sortFlag" @click="createProcessEv('index')">创建审批</el-button>
 				</div>
 			</header>
-			<el-alert title="长按流程或分组可拖拽排序" type="warning" show-icon @close="ls.set('tipFlag', false)" v-if="ls.get('tipFlag')"/>
+			<el-alert title="长按流程或分组可拖拽排序" type="warning" show-icon @close="ls.set('tipFlag', false)" v-if="ls.get('tipFlag')" />
 			<div class="mt-4">
 				<component :is="typeComponentMap[pageType]" ref="dyncComponent"></component>
 			</div>
@@ -82,6 +82,13 @@ const searchProcess = async () => {
 const createProcessEv = url => {
 	flowStore.$reset()
 	setTimeout(() => {
+		if (url === 'index') {
+			const { origin, hash } = window.location
+			const hashFlag = hash.indexOf('#') !== -1 // 路由是hash模式
+			const jumpRouterUrl = `${origin}/${hashFlag ? '#' : ''}/flow_create/index`
+			window.open(jumpRouterUrl, '_blank')
+			return
+		}
 		router.push('/flow_create/' + url)
 	}, 0)
 }