fix : 修复标签关闭bug, 表格组件列配置, 完善用户管理页面
This commit is contained in:
@@ -35,13 +35,12 @@ export const useProcessStore = defineStore('process', () => {
|
||||
}
|
||||
|
||||
const addProcess = (val) => {
|
||||
console.log("添加节点成功")
|
||||
processData.value.process.push(val)
|
||||
}
|
||||
const delProcess = (delNode) => {
|
||||
processData.value.process.splice(processData.value.process.indexOf(delNode), 1)
|
||||
console.log("删除数据")
|
||||
console.log(processData.value.process)
|
||||
// console.log("删除数据")
|
||||
// console.log(processData.value.process)
|
||||
}
|
||||
|
||||
const getDesign = () => {
|
||||
@@ -60,7 +59,7 @@ export const useProcessStore = defineStore('process', () => {
|
||||
const getFormMap = () => {
|
||||
//表单映射对象
|
||||
const map = new Map();
|
||||
processData.value.formItems.forEach(item => itemToMap(map, item))
|
||||
processData.value.formItems?.forEach(item => itemToMap(map, item))
|
||||
return map
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
export const useTagsView = defineStore('tagsView',()=>{
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
//已显示的标签页list
|
||||
const visitedViews = ref([])
|
||||
|
||||
//添加标签页面
|
||||
const addVisitedViews = ({path,meta}) => {
|
||||
const addVisitedViews = ({path,meta,query}) => {
|
||||
if(visitedViews.value.length == 0) {
|
||||
visitedViews.value.push({path,meta})
|
||||
visitedViews.value.push({path,meta,query})
|
||||
}else {
|
||||
const paths = visitedViews.value.map(item => item.path)
|
||||
if(paths.includes(path) == false) {
|
||||
visitedViews.value.push({path,meta})
|
||||
visitedViews.value.push({path,meta,query})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,17 +33,31 @@ export const useTagsView = defineStore('tagsView',()=>{
|
||||
toLastTagView(visitedViews)
|
||||
}
|
||||
|
||||
//删除当前标签页并跳转到指定路由
|
||||
const delViewAndGoView = (path) => {
|
||||
visitedViews.value.forEach((item,index)=>{
|
||||
if(item.path == route.path) {
|
||||
visitedViews.value.splice(index,1)
|
||||
}
|
||||
})
|
||||
router.push(path)
|
||||
}
|
||||
|
||||
//删除其他标签页
|
||||
const delOtherVisitedViews = ({path,meta}) => {
|
||||
const delOtherVisitedViews = ({path,meta,query}) => {
|
||||
visitedViews.value = []
|
||||
visitedViews.value.push({path,meta})
|
||||
visitedViews.value.push({path,meta,query})
|
||||
toLastTagView(visitedViews)
|
||||
}
|
||||
|
||||
//路由到末尾标签页
|
||||
const toLastTagView = (view) => {
|
||||
const lastTagView = view.value.slice(-1)[0]
|
||||
router.push(lastTagView.path)
|
||||
router.push({path: lastTagView.path, query: lastTagView.query})
|
||||
}
|
||||
|
||||
const removeAllTagView = () => {
|
||||
visitedViews.value.length = 0
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -50,5 +65,7 @@ export const useTagsView = defineStore('tagsView',()=>{
|
||||
addVisitedViews,
|
||||
delVisitedViews,
|
||||
delOtherVisitedViews,
|
||||
delViewAndGoView,
|
||||
removeAllTagView
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user