fix: 流程内跳转路由修改,组件补全

main
wx-jincw 3 weeks ago
parent 04cf849507
commit d40fcfc5e0

@ -0,0 +1,114 @@
<template>
<div :class="{'hidden':hidden}" class="pagination-container">
<el-pagination
:background="background"
:current-page.sync="currentPage"
:page-size.sync="pageSize"
:layout="layout"
:page-sizes="pageSizes"
:pager-count="pagerCount"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import { scrollTo } from '@/utils/scroll-to'
export default {
name: 'Pagination',
props: {
total: {
required: true,
type: Number
},
page: {
type: Number,
default: 1
},
limit: {
type: Number,
default: 20
},
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50]
}
},
// 5
pagerCount: {
type: Number,
default: document.body.clientWidth < 992 ? 5 : 7
},
layout: {
type: String,
default: 'total, sizes, prev, pager, next, jumper'
},
background: {
type: Boolean,
default: true
},
autoScroll: {
type: Boolean,
default: true
},
hidden: {
type: Boolean,
default: false
}
},
data() {
return {
};
},
computed: {
currentPage: {
get() {
return this.page
},
set(val) {
this.$emit('update:page', val)
}
},
pageSize: {
get() {
return this.limit
},
set(val) {
this.$emit('update:limit', val)
}
}
},
methods: {
handleSizeChange(val) {
if (this.currentPage * val > this.total) {
this.currentPage = 1
}
this.$emit('pagination', { page: this.currentPage, limit: val })
if (this.autoScroll) {
scrollTo(0, 800)
}
},
handleCurrentChange(val) {
this.$emit('pagination', { page: val, limit: this.pageSize })
if (this.autoScroll) {
scrollTo(0, 800)
}
}
}
}
</script>
<style scoped>
.pagination-container {
background: #fff;
padding: 32px 16px;
}
.pagination-container.hidden {
display: none;
}
</style>

@ -0,0 +1,104 @@
<template>
<div class="top-right-btn" :style="style">
<el-row>
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top" v-if="search">
<el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
<el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="columns">
<el-button size="mini" circle icon="el-icon-menu" @click="showColumn()" />
</el-tooltip>
</el-row>
<el-dialog :title="title" :visible.sync="open" append-to-body>
<el-transfer
:titles="['显示', '隐藏']"
v-model="value"
:data="columns"
@change="dataChange"
></el-transfer>
</el-dialog>
</div>
</template>
<script>
export default {
name: "RightToolbar",
data() {
return {
//
value: [],
//
title: "显示/隐藏",
//
open: false,
};
},
props: {
showSearch: {
type: Boolean,
default: true,
},
columns: {
type: Array,
},
search: {
type: Boolean,
default: true,
},
gutter: {
type: Number,
default: 10,
},
},
computed: {
style() {
const ret = {};
if (this.gutter) {
ret.marginRight = `${this.gutter / 2}px`;
}
return ret;
}
},
created() {
//
for (let item in this.columns) {
if (this.columns[item].visible === false) {
this.value.push(parseInt(item));
}
}
},
methods: {
//
toggleSearch() {
this.$emit("update:showSearch", !this.showSearch);
},
//
refresh() {
this.$emit("queryTable");
},
//
dataChange(data) {
for (let item in this.columns) {
const key = this.columns[item].key;
this.columns[item].visible = !data.includes(key);
}
},
// dialog
showColumn() {
this.open = true;
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-transfer__button {
border-radius: 50%;
padding: 12px;
display: block;
margin-left: 0px;
}
::v-deep .el-transfer__button:first-child {
margin-bottom: 10px;
}
</style>

@ -64,6 +64,10 @@ import directive from './directive' //directive
import DictData from '@/components/DictData' import DictData from '@/components/DictData'
// 字典标签组件 // 字典标签组件
import DictTag from '@/components/DictTag' import DictTag from '@/components/DictTag'
// 分页组件
import Pagination from "@/components/Pagination";
// 自定义表格工具组件
import RightToolbar from "@/components/RightToolbar"
Vue.use(VueLazyload, { Vue.use(VueLazyload, {
preLoad: 1.3, preLoad: 1.3,
@ -83,6 +87,8 @@ Vue.use(directive)
DictData.install() DictData.install()
Vue.component('DictTag', DictTag) Vue.component('DictTag', DictTag)
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.component('attrFrom', attrFrom) Vue.component('attrFrom', attrFrom)
Vue.component('UploadIndex', UploadIndex) Vue.component('UploadIndex', UploadIndex)
Vue.component('SelfUpload', SelfUpload) Vue.component('SelfUpload', SelfUpload)
@ -105,6 +111,7 @@ Vue.prototype.$validator = function(rule) {
Vue.prototype.handleTree = handleTree Vue.prototype.handleTree = handleTree
Vue.prototype.parseTime = parseTime Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
let cookieName = "VCONSOLE"; let cookieName = "VCONSOLE";
let query = parseQuery(); let query = parseQuery();

@ -20,7 +20,7 @@ import Layout from '@/layout'
const flowRouter = { const flowRouter = {
path: '/workflow/process', path: '/flow',
component: Layout, component: Layout,
hidden: true, hidden: true,
// permissions: ['workflow:process:query'], // permissions: ['workflow:process:query'],
@ -35,7 +35,7 @@ const flowRouter = {
path: 'detail/:procInsId([\\w|\\-]+)', path: 'detail/:procInsId([\\w|\\-]+)',
component: () => import('@/views/workflow/work/detail'), component: () => import('@/views/workflow/work/detail'),
name: 'WorkDetail', name: 'WorkDetail',
meta: { title: '流程详情', activeMenu: '/work/own' } meta: { title: '流程详情', activeMenu: '/workflow/work/own' }
} }
] ]
} }

@ -209,3 +209,8 @@ aside {
.btn-width100{ .btn-width100{
width: 100%; width: 100%;
} }
.top-right-btn {
position: relative;
float: right;
}

@ -190,7 +190,7 @@ export default {
handleFlowRecord(row){ handleFlowRecord(row){
console.log(row); console.log(row);
this.$router.push({ this.$router.push({
path: '/workflow/process/detail/' + row.instanceId, path: '/flow/detail/' + row.instanceId,
query: { query: {
processed: false processed: false
} }

@ -215,7 +215,7 @@ export default {
/** 流程流转记录 */ /** 流程流转记录 */
handleFlowRecord(row){ handleFlowRecord(row){
this.$router.push({ this.$router.push({
path: '/workflow/process/detail/' + row.procInsId, path: '/flow/detail/' + row.procInsId,
query: { query: {
processed: false processed: false
} }

@ -180,7 +180,7 @@ export default {
}, },
handleStart(row) { handleStart(row) {
this.$router.push({ this.$router.push({
path: '/workflow/process/start/' + row.deploymentId, path: '/flow/start/' + row.deploymentId,
query: { query: {
definitionId: row.definitionId, definitionId: row.definitionId,
} }

@ -247,7 +247,7 @@ export default {
}, },
handleAgain(row) { handleAgain(row) {
this.$router.push({ this.$router.push({
path: '/workflow/process/start/' + row.deployId, path: '/flow/start/' + row.deployId,
query: { query: {
definitionId: row.procDefId, definitionId: row.procDefId,
procInsId: row.procInsId procInsId: row.procInsId
@ -268,7 +268,7 @@ export default {
/** 流程流转记录 */ /** 流程流转记录 */
handleFlowRecord(row) { handleFlowRecord(row) {
this.$router.push({ this.$router.push({
path: '/workflow/process/detail/' + row.procInsId, path: '/flow/detail/' + row.procInsId,
query: { query: {
processed: false processed: false
} }

@ -141,7 +141,7 @@ export default {
// //
handleProcess(row) { handleProcess(row) {
this.$router.push({ this.$router.push({
path: '/workflow/process/detail/' + row.procInsId, path: '/flow/detail/' + row.procInsId,
query: { query: {
taskId: row.taskId, taskId: row.taskId,
processed: true processed: true

Loading…
Cancel
Save