| src/components/PageHeader/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/productionManagement/productStructure/Detail/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/components/PageHeader/index.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,53 @@ <template> <div class="page-header-wrapper"> <el-page-header @back="handleBack" :content="content"> <template #icon v-if="$slots.icon"> <slot name="icon"></slot> </template> <template #title v-if="$slots.title"> <slot name="title"></slot> </template> <template #content v-if="$slots.content"> <slot name="content"></slot> </template> <template #extra> <slot name="extra"> <slot name="right-button"></slot> </slot> </template> </el-page-header> </div> </template> <script setup> import { useRouter } from 'vue-router' const props = defineProps({ content: { type: String, default: '' } }) const emit = defineEmits(['back']) const router = useRouter() const handleBack = () => { emit('back') // é»è®¤è¿åå°ä¸ä¸çº§ router.back() } </script> <style scoped> .page-header-wrapper { margin-bottom: 16px; } .page-header-wrapper :deep(.el-page-header__extra) { display: flex; align-items: center; gap: 8px; } </style> src/main.js
@@ -52,6 +52,8 @@ import DictTag from "@/components/DictTag"; // è¡¨æ ¼ç»ä»¶ import PIMTable from "@/components/PIMTable/PIMTable.vue"; // 页é¢å¤´é¨ç»ä»¶ import PageHeader from "@/components/PageHeader/index.vue"; import { getToken } from "@/utils/auth"; import { @@ -93,6 +95,7 @@ app.component("RightToolbar", RightToolbar); app.component("Editor", Editor); app.component("PIMTable", PIMTable); app.component("PageHeader", PageHeader); app.use(router); app.use(store); src/views/productionManagement/productStructure/Detail/index.vue
@@ -1,26 +1,26 @@ <template> <div class="app-container"> <el-button v-if="dataValue.isEdit" type="primary" @click="addItem" style="margin-bottom: 10px">æ·»å </el-button> <el-button v-if="!dataValue.isEdit" type="primary" @click="dataValue.isEdit = true" style="margin-bottom: 10px">ç¼è¾ </el-button> <el-button v-if="dataValue.isEdit" type="primary" @click="cancelEdit" style="margin-bottom: 10px">åæ¶ </el-button> <el-button type="primary" :loading="dataValue.loading" @click="submit" :disabled="!dataValue.isEdit" style="margin-bottom: 10px">确认 </el-button> <PageHeader content="产åç»æè¯¦æ "> <template #right-button> <el-button v-if="dataValue.isEdit" type="primary" @click="addItem">æ·»å </el-button> <el-button v-if="!dataValue.isEdit" type="primary" @click="dataValue.isEdit = true">ç¼è¾ </el-button> <el-button v-if="dataValue.isEdit" type="primary" @click="cancelEdit">åæ¶ </el-button> <el-button type="primary" :loading="dataValue.loading" @click="submit" :disabled="!dataValue.isEdit">确认 </el-button> </template> </PageHeader> <el-table :data="tableData" border