|
|
|
@ -4,12 +4,12 @@
|
|
|
|
|
<el-col :span="3">
|
|
|
|
|
<el-card style="height: calc(100vh - 125px)">
|
|
|
|
|
<div slot="header">
|
|
|
|
|
<span><el-button type="text" size="small">新建标签页</el-button></span>
|
|
|
|
|
<span>导航</span>
|
|
|
|
|
</div>
|
|
|
|
|
<el-menu
|
|
|
|
|
:default-active="localIndex"
|
|
|
|
|
@select="onSelect"
|
|
|
|
|
mode="horizontal"
|
|
|
|
|
mode="vertical"
|
|
|
|
|
>
|
|
|
|
|
<el-menu-item v-for="(tab, index) in tabs"
|
|
|
|
|
:key="index"
|
|
|
|
@ -66,7 +66,6 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
props: {
|
|
|
|
@ -129,32 +128,63 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onSelect(index) {
|
|
|
|
|
try {
|
|
|
|
|
this.localIndex = index;
|
|
|
|
|
this.queryParams.name = this.tabs[index].name;
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error in onSelect:', error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onClick(tab) {
|
|
|
|
|
try {
|
|
|
|
|
this.localIndex = tab.name;
|
|
|
|
|
this.queryParams.name = this.tabs[tab.name].name;
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error in onClick:', error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleQuery(queryParams) {
|
|
|
|
|
try {
|
|
|
|
|
if (queryParams) {
|
|
|
|
|
this.queryParams = queryParams;
|
|
|
|
|
}
|
|
|
|
|
this.$emit('query', this.queryParams);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error in handleQuery:', error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleReset() {
|
|
|
|
|
try {
|
|
|
|
|
this.$emit('reset', this.queryParams);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error in handleReset:', error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
try {
|
|
|
|
|
alert(row.id);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error in handleUpdate:', error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleSortChange() {
|
|
|
|
|
try {
|
|
|
|
|
// 处理排序变化
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error in handleSortChange:', error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handlePageChange() {
|
|
|
|
|
try {
|
|
|
|
|
// 处理分页变化
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error in handlePageChange:', error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
removeTab(targetName) {
|
|
|
|
|
try {
|
|
|
|
|
const tabs = this.tabs;
|
|
|
|
|
let activeName = this.localIndex;
|
|
|
|
|
|
|
|
|
@ -172,20 +202,24 @@ export default {
|
|
|
|
|
this.localIndex = activeName;
|
|
|
|
|
this.$emit('update:index', activeName);
|
|
|
|
|
this.$emit('remove', targetName);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error in removeTab:', error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleOperationClick(operation, row) {
|
|
|
|
|
try {
|
|
|
|
|
this.$emit('operation-click', operation, row);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error in handleOperationClick:', error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
console.log('Received props:', this.$props);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.table-container {
|
|
|
|
|
height: calc(100vh - 250px); /* 调整高度以适应页面布局 */
|
|
|
|
|