Merge branch 'build' of http://git.sinoecare.com/sinoecare/digital_village_v2/dvcp_v2_webapp into build
This commit is contained in:
		| @@ -58,5 +58,9 @@ export default { | |||||||
| <style lang="scss" scoped> | <style lang="scss" scoped> | ||||||
| .AppAiCode { | .AppAiCode { | ||||||
|   height: 100%; |   height: 100%; | ||||||
|  |  | ||||||
|  |   & > section { | ||||||
|  |     height: 100%; | ||||||
|  |   } | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|   | |||||||
| @@ -251,6 +251,13 @@ export const logs = { | |||||||
|       const i = state.pages.findIndex(e => e.id == id) |       const i = state.pages.findIndex(e => e.id == id) | ||||||
|       i > -1 && state.pages.splice(i, 1) |       i > -1 && state.pages.splice(i, 1) | ||||||
|     }, |     }, | ||||||
|  |     clearAllPages(state) { | ||||||
|  |       state.pages = [] | ||||||
|  |     }, | ||||||
|  |     clearOtherPages(state) { | ||||||
|  |       const id = location.href?.replace(location.origin, "") | ||||||
|  |       state.pages = state.pages.filter(e => e.id == id) || [] | ||||||
|  |     } | ||||||
|   }, |   }, | ||||||
|   actions: { |   actions: { | ||||||
|     closePage({commit}, id) { |     closePage({commit}, id) { | ||||||
|   | |||||||
| @@ -1,21 +1,36 @@ | |||||||
| <template> | <template> | ||||||
|   <section class="AiNavTab"> |   <section class="AiNavTab"> | ||||||
|     <el-tabs class="layout" type="card" :value="currentTab" @tab-click="handleTabClick" @tab-remove="handleTabRemove"> |     <el-tabs class="layout fill" type="card" :value="currentTab" @tab-click="handleTabClick" @tab-remove="handleTabRemove"> | ||||||
|       <el-tab-pane label="首页" name="/"/> |       <el-tab-pane v-for="(op,i) in tabs" :key="i" :name="op.id" :label="op.label" lazy :closable="!op.fixed"/> | ||||||
|       <el-tab-pane v-for="(op,i) in tabs" :key="i" :name="op.id" :label="op.label" lazy closable/> |  | ||||||
|     </el-tabs> |     </el-tabs> | ||||||
|  |     <el-dropdown flex class="more" @visible-change="handleIcon" trigger="click" @command="handleOpt"> | ||||||
|  |       <ai-icon :icon="dropdownIcon"/> | ||||||
|  |       <el-dropdown-menu> | ||||||
|  |         <el-dropdown-item command="clearAllPages">关闭所有</el-dropdown-item> | ||||||
|  |         <el-dropdown-item command="clearOtherPages">只留当前页</el-dropdown-item> | ||||||
|  |       </el-dropdown-menu> | ||||||
|  |     </el-dropdown> | ||||||
|   </section> |   </section> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
| import {mapState, mapMutations} from "vuex"; | import {mapState, mapMutations} from "vuex"; | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
|   name: "AiNavTab", |   name: "AiNavTab", | ||||||
|  |   props: { | ||||||
|  |     fixed: {default: () => ({label: "首页", id: "/"})} | ||||||
|  |   }, | ||||||
|   computed: { |   computed: { | ||||||
|     ...mapState(['apps', 'logs']), |     ...mapState(['apps', 'logs']), | ||||||
|     currentTab: v => v.isHome ? "/" : v.$route.fullPath, |     currentTab: v => v.isHome ? "/" : v.$route.fullPath, | ||||||
|     isHome: v => v.$route.path == '/', |     tabs: v => [{...v.fixed, fixed: 1}, v.logs.pages].flat(), | ||||||
|     tabs: v => v.logs.pages |     isHome: v => v.fixed.id == v.$route.fullPath | ||||||
|  |   }, | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       dropdownIcon: "iconDouble_Down" | ||||||
|  |     } | ||||||
|   }, |   }, | ||||||
|   watch: { |   watch: { | ||||||
|     $route: { |     $route: { | ||||||
| @@ -36,10 +51,17 @@ export default { | |||||||
|       const {pages} = this.logs |       const {pages} = this.logs | ||||||
|       if (id == this.currentTab) { |       if (id == this.currentTab) { | ||||||
|         const index = pages.findIndex(e => e.id == id) |         const index = pages.findIndex(e => e.id == id) | ||||||
|         const next = pages?.[index + 1] || pages?.[index - 1] || {name: '/'} |         const next = pages?.[index + 1] || pages?.[index - 1] || {name: this.fixed.id || "/"} | ||||||
|         this.handleTabClick(next) |         this.handleTabClick(next) | ||||||
|       } |       } | ||||||
|       this.deletePage(id) |       this.deletePage(id) | ||||||
|  |     }, | ||||||
|  |     handleIcon(v) { | ||||||
|  |       this.dropdownIcon = v ? "iconDouble_Up" : "iconDouble_Down" | ||||||
|  |     }, | ||||||
|  |     handleOpt(v) { | ||||||
|  |       this.$store.commit(v) | ||||||
|  |       v == "clearAllPages" && this.handleTabClick({name: this.fixed.id || "/"}) | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
| @@ -47,14 +69,26 @@ export default { | |||||||
|  |  | ||||||
| <style lang="scss" scoped> | <style lang="scss" scoped> | ||||||
| .AiNavTab { | .AiNavTab { | ||||||
|  |   display: flex; | ||||||
|  |   background: linear-gradient(180deg, #FCFCFC 0%, #E0E2E4 100%); | ||||||
|  |  | ||||||
|   :deep(.layout ) { |   :deep(.layout ) { | ||||||
|     background: #F5F6F9; |  | ||||||
|     display: flex; |     display: flex; | ||||||
|     flex-direction: column; |     flex-direction: column; | ||||||
|  |  | ||||||
|  |     .el-tabs__nav-prev, .el-tabs__nav-next { | ||||||
|  |       top: 50%; | ||||||
|  |       line-height: normal; | ||||||
|  |       transform: translateY(-50%); | ||||||
|  |  | ||||||
|  |       & > i { | ||||||
|  |         font-weight: bold !important; | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|     & > .el-tabs__header { |     & > .el-tabs__header { | ||||||
|       margin-bottom: 0; |       margin-bottom: 0; | ||||||
|       background: linear-gradient(180deg, #FCFCFC 0%, #E0E2E4 100%); |  | ||||||
|       height: 40px; |       height: 40px; | ||||||
|       display: flex; |       display: flex; | ||||||
|       align-items: flex-end; |       align-items: flex-end; | ||||||
| @@ -117,5 +151,17 @@ export default { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   :deep(.more) { | ||||||
|  |     .AiIcon { | ||||||
|  |       height: 100%; | ||||||
|  |  | ||||||
|  |       .iconfont { | ||||||
|  |         display: flex; | ||||||
|  |         align-items: center; | ||||||
|  |         justify-content: center; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
| } | } | ||||||
| </style> | </style> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user