123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <template>
- <div class="side-catalog-wrap">
- <el-scrollbar class="side-catalog-box">
- <div
- v-for="(com,index) in componentList"
- :key="index"
- class="component-item-box"
- :class="{'active-catalog':activeType === com.type}"
- @click="componentHandle(com)"
- >
- {{ com.name }}
- </div>
- </el-scrollbar>
- </div>
- </template>
- <script>
- export default {
- components: { },
- data () {
- return {
- componentList: [
- {
- name: '自定义组件',
- type: 'component'
- },
- {
- name: '业务组件',
- type: 'bizComponent'
- },
- {
- name: '系统组件',
- type: 'system'
- }
- ],
- activeType: 'component'
- }
- },
- mounted () {
- },
- methods: {
- // 点击左侧组件
- componentHandle (com) {
- this.activeType = com.type
- this.$emit('getPageInfo', com.type)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '~packages/assets/style/bsTheme.scss';
- .side-catalog-wrap {
- .component-item-box {
- width: 100%;
- padding: 0px 16px;
- line-height: 36px;
- display: flex;
- justify-content: space-between;
- &:hover {
- cursor: pointer;
- }
- }
- }
- .side-catalog-wrap{
- // padding-top: 16px;
- width: 220px;
- height: 100%;
- box-sizing: border-box;
- color: var(--bs-el-title);
- background-color: var(--bs-background-2);
- .side-catalog-box{
- height: calc(100% - 50px);
- overflow-y: auto;
- .side-catalog-all{
- font-weight: bold;
- }
- .side-catalog-item{
- width: 100%;
- padding: 0px 16px;
- line-height: 36px;
- display: flex;
- justify-content: space-between;
- &:hover{
- cursor: pointer;
- }
- .el-icon-more{
- transform: rotate(90deg);
- color: var(--bs-el-title);
- font-weight: 400;
- }
- .active-icon-more{
- color:var(--bs-el-text);
- }
- .catalog-name{
- overflow:hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- -o-text-overflow:ellipsis;
- }
- .page-list-dropdown{
- opacity: 0;
- }
- .dropdown-show{
- opacity: 1;
- }
- }
- /*菜单激活时的样式*/
- .active-catalog{
- background-color: rgba(var(--bs-el-color-primary-active), 0.4);
- color: var(--bs-el-text);
- &::after{
- content: '';
- position: absolute;
- left: 0;
- width: 4px;
- height: 36px;
- background-color: var(--bs-el-color-primary);
- }
- }
- }
- .add-catalog-box{
- padding: 10px 0;
- box-sizing: border-box;
- display: flex;
- justify-content: center;
- align-items: center;
- border-radius: 10px;
- margin: 0 8px;
- &:hover{
- background-color: var(--bs-background-1);
- cursor: pointer;
- color: var(--bs-el-text);;
- }
- .el-icon-plus{
- padding: 0 5px;
- }
- }
- }
- .dropdown-menu-box{
- left: 50%;
- transform: translateX(-40%);
- width: 100px!important;
- /deep/.el-dropdown-menu__item{
- text-align: center;
- padding: 5px;
- }
- /deep/.popper__arrow{
- left: 50% !important;
- transform: translateX(-50%) !important;
- }
- }
- </style>
|