Commit c0933e0c authored by xioln's avatar xioln

ECN、ECR详情跳转对应详情

parent 930651f6
......@@ -65,7 +65,7 @@ export default {
},
methods: {
onClickLeft () {
history.back(-1)
this.$router.go(-1)
}
}
}
......
......@@ -30,7 +30,8 @@ export default {
computed: {
},
methods: {
onClickLeft() { },
onClickLeft() {
},
goHome() { }
}
}
......
......@@ -11,19 +11,22 @@
<van-col span="24" v-for="column in tableColumns" :key="column.title">
<van-col class="van-col-span" span="8">{{ column.title }}</van-col>
<van-col class="table-cell-content" span="14" offset="1">
<template
v-if="column.hasOwnProperty('relatedDict')"
>
<template v-if="column.hasOwnProperty('relatedDict')">
{{
findDictValue(
column.relatedDict,
getProperty(item, column.key)
)
findDictValue(column.relatedDict, getProperty(item, column.key))
}}
</template>
<template v-else-if="column.key.includes('state')">
{{ findDictValue('ObjStatus', getProperty(item, column.key)) }}
</template>
<template v-else-if="column.key.includes('number')">
<a
@click="goDetail(item)"
style="text-decoration: underline; color: #1b77ea"
>
{{ getProperty(item, column.key) }}
</a>
</template>
<template v-else>
{{ getProperty(item, column.key) || '—' }}
</template>
......@@ -39,6 +42,7 @@
</template>
<script>
import { getDictListByCode } from '@/api/taskDetail'
import moment from 'moment'
export default {
name: 'TableCell', // name写在组件的最前方,自定义组件为必填
......@@ -117,6 +121,23 @@ export default {
},
getProperty (obj, path) {
return path.split('.').reduce((acc, key) => acc[key], obj)
},
goDetail (item) {
const target = item.target
sessionStorage.setItem('taskInfo', JSON.stringify(target))
this.$router.push({
path: '/empty',
query: {
path: 'InfoDetail',
oid: target.id,
subTypeName: target.subTypeName,
dxClassname: target.dxClassname.split('vo.')[1]?.slice(0, -2),
title: target.name,
type: 'TOSELF',
time: moment().valueOf()
}
})
}
}
}
......
......@@ -33,7 +33,7 @@ const routes = [
},
{
path: '/taskDetails-*',
name: '详情',
name: '流程详情',
component: () => import('@/views/busniessComponents/workFlowTask/taskDetails'),
meta: {
keepAlive: false
......@@ -49,12 +49,28 @@ const routes = [
},
{
path: '/InfoDetail-*',
name: '详情页',
name: '任务详情页',
component: () => import('@/views/InfoDetail/index.vue'),
meta: {
keepAlive: false
}
},
{
path: '/InfoDetail',
name: '任务详情页跳转',
component: () => import('@/views/InfoDetail/index.vue'),
meta: {
keepAlive: false
}
},
{
path: '/empty',
name: '空页面',
component: () => import('@/views/empty/index.vue'),
meta: {
keepAlive: false
}
},
{
// 重定向:默认时
path: '/',
......@@ -99,6 +115,9 @@ router.beforeEach((to, from, next) => {
if (token) {
// 判断当前的token是否存在(登录存入的token) 若存在则直接跳转
next()
if (to.name === '空页面' && from.name === '任务详情页跳转') {
to.query.empty = 2
}
} else if (whiteList.includes(to.path)) {
next()
} else {
......
......@@ -35,7 +35,6 @@
<script>
import { getLayOut } from '@/api/taskDetail'
import TableCell from '@/components/tableCell'
export default {
props: {
basicData: {
......@@ -130,7 +129,13 @@ export default {
items: [searchItems],
operator: 'AND'
},
openProps: [{ name: 'source' }, { name: 'target' }],
openProps: [
{ name: 'source' },
{
name: 'target',
openProps: [{ name: 'dxContext' }]
}
],
searchOptions: [{ type: 'QUERY_LINK_BY_SOURCE_LATEST' }],
sortItem: [{ fieldName: 'modifyTime', sortOrder: 'desc' }]
}
......
......@@ -81,6 +81,11 @@ export default {
this.tabs = [{ title: '基本信息', key: 'baseInfo' }]
this.activeTab = 'baseInfo'
await this.getIstartFormData()
} else if (this.$route.query.type === 'TOSELF') {
this.$set(this, 'tabs', [{ title: '基本信息', key: 'baseInfo' }])
await this.getFormData()
this.$set(this, 'form', JSON.parse(sessionStorage.getItem('taskInfo')))
this.activeTab = 'baseInfo'
} else if (['ExtActionItem'].includes(this.$route.query.dxClassname)) {
this.tabs = [
{ title: '基本信息', key: 'baseInfo' }
......@@ -207,7 +212,7 @@ export default {
}
]
this.$set(this, 'formData', formData)
this.$set(this, 'form', JSON.parse(localStorage.getItem('taskInfo')))
this.$set(this, 'form', JSON.parse(sessionStorage.getItem('taskInfo')))
},
async getForm (oid) {
let id = ''
......
<template>
<div class='empty-page'>
</div>
</template>
<script>
export default {
data () {
return {
}
},
components: {
},
created() {
if (this.$route.query.empty === 2) {
this.$router.go(-1)
} else {
this.$router.push({
path: this.$route.query.path,
query: {
...this.$route.query,
empty: 1
}
})
}
},
mounted() {
},
methods: {
}
}
</script>
<style lang='scss' scoped>
</style>
......@@ -126,7 +126,7 @@ export default {
}
]
}
],
]
}
},
computed: {
......@@ -158,7 +158,6 @@ export default {
}
},
changeMenu(item) {
console.log('item', item)
if (item.route) {
this.$router.push(item.route)
} else {
......@@ -182,7 +181,7 @@ export default {
} else {
this.$router.push(component.route)
}
},
}
}
}
......
......@@ -65,7 +65,7 @@ export default {
// 跳转详情页面
goDetailsInfo (item) {
if (this.$route.query.title === '我发起的任务') {
localStorage.setItem('taskInfo', JSON.stringify(item))
sessionStorage.setItem('taskInfo', JSON.stringify(item))
this.$router.push({
path: `/InfoDetail-${item.id}`,
query: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment