mirror of
https://github.com/fugary/simple-element-plus-template.git
synced 2025-11-12 14:27:49 +00:00
tab优化,表格优化
This commit is contained in:
@@ -56,6 +56,10 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: 'small'
|
default: 'small'
|
||||||
},
|
},
|
||||||
|
buttonsColumnAttrs: {
|
||||||
|
type: Object,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
pageInfo: {
|
pageInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
@@ -78,7 +82,8 @@ const calcColumns = computed(() => {
|
|||||||
labelKey: 'common.label.operation',
|
labelKey: 'common.label.operation',
|
||||||
isOperation: true,
|
isOperation: true,
|
||||||
slot: props.buttonsSlot,
|
slot: props.buttonsSlot,
|
||||||
buttons: props.buttons
|
buttons: props.buttons,
|
||||||
|
attrs: props.buttonsColumnAttrs
|
||||||
}
|
}
|
||||||
_columns = [..._columns, buttonColumn]
|
_columns = [..._columns, buttonColumn]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,12 +45,18 @@ export const useTabsViewStore = defineStore('tabsView', () => {
|
|||||||
return historyTab.meta && historyTab.meta.replaceTabHistory && historyTab.meta.replaceTabHistory === tab.name
|
return historyTab.meta && historyTab.meta.replaceTabHistory && historyTab.meta.replaceTabHistory === tab.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isSameReplaceHistory = (historyTab, tab) => {
|
||||||
|
return historyTab.meta && historyTab.meta.replaceTabHistory && tab.meta && tab.meta.replaceTabHistory &&
|
||||||
|
historyTab.meta.replaceTabHistory === tab.meta.replaceTabHistory
|
||||||
|
}
|
||||||
|
|
||||||
const addHistoryTab = (tab) => {
|
const addHistoryTab = (tab) => {
|
||||||
// 添加tab
|
// 添加tab
|
||||||
if (isTabMode.value) {
|
if (isTabMode.value) {
|
||||||
const idx = historyTabs.value.findIndex(v => v.path === tab.path)
|
const idx = historyTabs.value.findIndex(v => v.path === tab.path)
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
const replaceIdx = historyTabs.value.findIndex(v => checkMataReplaceHistory(v, tab) || checkMataReplaceHistory(tab, v))
|
const replaceIdx = historyTabs.value.findIndex(v => checkMataReplaceHistory(v, tab) ||
|
||||||
|
checkMataReplaceHistory(tab, v) || isSameReplaceHistory(v, tab))
|
||||||
if (replaceIdx > -1) {
|
if (replaceIdx > -1) {
|
||||||
console.info(replaceIdx, historyTabs.value[replaceIdx])
|
console.info(replaceIdx, historyTabs.value[replaceIdx])
|
||||||
if (replaceIdx !== undefined) {
|
if (replaceIdx !== undefined) {
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ const buttons = ref([{
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:buttons="buttons"
|
:buttons="buttons"
|
||||||
buttons-slot="buttons"
|
buttons-slot="buttons"
|
||||||
|
:buttons-column-attrs="{width:'300px'}"
|
||||||
>
|
>
|
||||||
<template #gender="{item}">
|
<template #gender="{item}">
|
||||||
<el-tag
|
<el-tag
|
||||||
|
|||||||
Reference in New Issue
Block a user