@lambo-design/pro-layout 1.0.0-beta.44 → 1.0.0-beta.440

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/package.json +11 -4
  2. package/src/components/pro-layout-header/index.vue +220 -0
  3. package/src/components/pro-layout-header/pro-layout-logo/index.vue +206 -0
  4. package/src/components/pro-layout-header/pro-layout-nav/components/pro-layout-nav-slide-menu.vue +398 -0
  5. package/src/components/pro-layout-header/pro-layout-nav/index-slide.vue +226 -0
  6. package/src/components/pro-layout-header/pro-layout-nav/index.vue +564 -0
  7. package/src/components/pro-layout-header/pro-layout-slogan/index.vue +40 -0
  8. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-collect.vue +79 -0
  9. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-document.vue +20 -0
  10. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-fullscreen.vue +144 -0
  11. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-icons.vue +99 -0
  12. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-intl.vue +109 -0
  13. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-notice.vue +133 -0
  14. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-search.vue +305 -0
  15. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-todo.vue +145 -0
  16. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-user.vue +64 -0
  17. package/src/components/pro-layout-header/pro-layout-tools/index.vue +38 -0
  18. package/src/components/pro-layout-header/pro-layout-trigger/index.vue +84 -0
  19. package/src/components/{pro-layout-sider-collapsed-menu.vue → pro-layout-sider/components/pro-layout-sider-collapsed-menu.vue} +30 -11
  20. package/src/components/{pro-layout-sider-icon.vue → pro-layout-sider/components/pro-layout-sider-icon.vue} +2 -2
  21. package/src/components/pro-layout-sider/components/pro-layout-sider-menu-item.vue +137 -0
  22. package/src/components/pro-layout-sider/components/pro-layout-sider-other-menu.vue +140 -0
  23. package/src/components/pro-layout-sider/components/pro-layout-sider-search.vue +345 -0
  24. package/src/components/pro-layout-sider/index.vue +477 -0
  25. package/src/components/{pro-layout-tabs.vue → pro-layout-tabs/index.vue} +115 -22
  26. package/src/index.vue +302 -38
  27. package/src/styles/color.less +267 -0
  28. package/src/styles/images/xiaoxitongzhi.png +0 -0
  29. package/src/styles/other-menu.less +63 -111
  30. package/src/utils/menuItem.js +10 -0
  31. package/src/utils/sider.js +16 -1
  32. package/src/components/pro-layout-header.vue +0 -52
  33. package/src/components/pro-layout-logo.vue +0 -79
  34. package/src/components/pro-layout-nav.vue +0 -150
  35. package/src/components/pro-layout-other-menu.vue +0 -138
  36. package/src/components/pro-layout-sider-menu-item.vue +0 -37
  37. package/src/components/pro-layout-sider.vue +0 -240
  38. package/src/components/pro-layout-tools-user.vue +0 -84
  39. package/src/components/pro-layout-tools.vue +0 -21
  40. package/src/components/pro-layout-trigger.vue +0 -48
@@ -0,0 +1,144 @@
1
+ <template>
2
+ <Tooltip :content="isFullScreen ? t('pro-layout.header.quit-fullscreen') : t('pro-layout.header.fullscreen')" placement="bottom">
3
+ <Icon @click="handleFullScreen" :type="isFullScreen ? 'md-contract' : 'md-expand'" size="16" style="cursor: pointer"/>
4
+ </Tooltip>
5
+ </template>
6
+
7
+ <script>
8
+ import Locale from "@lambo-design/core/src/mixins/locale";
9
+ import Bus from '@lambo-design/shared/utils/bus'
10
+
11
+ export default {
12
+ name: 'pro-layout-tools-quick-fullscreen',
13
+ mixins: [Locale],
14
+ data() {
15
+ return {
16
+ isFullScreen:false
17
+ }
18
+ },
19
+ methods: {
20
+ handleKeyPress(event){
21
+ // 按下 F11 键时触发全屏切换
22
+ if (event.key === 'F11') {
23
+ event.preventDefault(); // 防止浏览器默认行为
24
+ this.handleFullScreen();
25
+ }
26
+ },
27
+ // 全屏事件
28
+ handleFullScreen() {
29
+ let element = document.documentElement;
30
+ // 如果是全屏,退出
31
+ if (this.isFullScreen) {
32
+ this.isFullScreen = !this.isFullScreen
33
+ if (document.exitFullscreen) {
34
+ document.exitFullscreen();
35
+ } else if (document.webkitCancelFullScreen) {
36
+ document.webkitCancelFullScreen();
37
+ } else if (document.mozCancelFullScreen) {
38
+ document.mozCancelFullScreen();
39
+ } else if (document.msExitFullscreen) {
40
+ document.msExitFullscreen();
41
+ }
42
+ } else { // 否则,进入全屏
43
+ this.isFullScreen = !this.isFullScreen
44
+ if (element.requestFullscreen) {
45
+ element.requestFullscreen();
46
+ } else if (element.webkitRequestFullScreen) {
47
+ element.webkitRequestFullScreen();
48
+ } else if (element.mozRequestFullScreen) {
49
+ element.mozRequestFullScreen();
50
+ } else if (element.msRequestFullscreen) {
51
+ // IE11
52
+ element.msRequestFullscreen();
53
+ }
54
+ }
55
+ Bus.$emit('trigger-change-icon', this.isFullScreen)
56
+ // 改变当前全屏状态
57
+ // this.isFullScreen = !this.isFullScreen;
58
+ },
59
+ handleResize(){
60
+ //增加 timer 定时器的原因是全屏和退出全屏的事件会触发两次窗口大小改变事件,做一次过滤
61
+ if (this.timer) return;
62
+ this.timer = setTimeout(() => {
63
+ // 如果是按 "Esc" 键退出全屏,窗口状态已经是非全屏,但是之前记录的状态还是全屏的状态
64
+ if (!this.checkFull() && this.isFullScreen) {
65
+ //退出全屏状态。。。
66
+ this.isFullScreen = false;
67
+ }else{
68
+ //进入全屏状态。。。
69
+ }
70
+ clearTimeout(this.timer);
71
+ this.timer = null;
72
+ }, 0);
73
+ },
74
+ //判断浏览器是否处于全屏状态
75
+ checkFull() {
76
+ let isFull = document.mozFullScreen ||
77
+ document.fullScreen ||
78
+ document.webkitIsFullScreen ||
79
+ document.webkitRequestFullScreen ||
80
+ document.mozRequestFullScreen ||
81
+ document.msFullscreenEnabled;
82
+ if (isFull === undefined) isFull = false;
83
+ return isFull;
84
+ }
85
+ },
86
+ mounted() {
87
+ document.addEventListener('keydown', this.handleKeyPress);
88
+ //由于 全屏状态下 ,按 "Esc" 键退出全屏,浏览器监听不到 "Esc" 键的事件,所以需要通过浏览器窗口大小改变的事件去触发退出全屏事件
89
+ window.addEventListener("resize", this.handleResize);
90
+ },
91
+ beforeDestroy() {
92
+ document.removeEventListener('keydown', this.handleKeyPress);
93
+ window.removeEventListener("resize", this.handleResize)
94
+ }
95
+ }
96
+ </script>
97
+ <style lang="less" scoped>
98
+ .pro-layout-tools-quick-icons{
99
+ float: left;
100
+ .font-padding {
101
+ padding-right: 10px
102
+ }
103
+ .topInput{
104
+ float: right;
105
+ position: relative;
106
+ z-index: 1000;
107
+ margin-top: 0px;
108
+ margin-left: 10px;
109
+ }
110
+ .slide-enter-active,
111
+ .slide-leave-active{
112
+ transition: transform 0.5s;
113
+ }
114
+ .slide-enter{
115
+ transform: translateX(100%);
116
+ }
117
+ .slide-leave-to{
118
+ transform: translateX(175px);
119
+ }
120
+ }
121
+ </style>
122
+ <style lang="less">
123
+ @import '@lambo-design/core/src/styles/default.less';
124
+ .quick-search-fast-con-modal {
125
+ .modal-content {
126
+ .menu-style {
127
+ margin : 5px;
128
+ font-size : 16px;
129
+ display : inline-block;
130
+ cursor : pointer;
131
+ &:hover{
132
+ color: var(--primary-color,@_primary-color);
133
+ }
134
+ }
135
+ .label-style {
136
+ height : 13px;
137
+ font-size : 14px;
138
+ font-weight : 500;
139
+ margin-left : 5px;
140
+ line-height : 18px;
141
+ }
142
+ }
143
+ }
144
+ </style>
@@ -0,0 +1,99 @@
1
+ <template>
2
+ <Row class="pro-layout-tools-quick-icons">
3
+ <Col class="font-padding" v-show="rightTopOptButtonList.includes('collect')">
4
+ <ProLayoutToolsQuickCollect></ProLayoutToolsQuickCollect>
5
+ </Col>
6
+ <Col class="font-padding" v-show="rightTopOptButtonList.includes('document')">
7
+ <ProLayoutToolsQuickDocument></ProLayoutToolsQuickDocument>
8
+ </Col>
9
+ <Col class="font-padding" v-show="rightTopOptButtonList.includes('fullScreen')">
10
+ <ProLayoutToolsQuickFullscreen></ProLayoutToolsQuickFullscreen>
11
+ </Col>
12
+ <Col class="font-padding" v-show="rightTopOptButtonList.includes('todo')">
13
+ <ProLayoutToolsQuickTodo></ProLayoutToolsQuickTodo>
14
+ </Col>
15
+ <Col class="font-padding" v-show="shouldShowCustomSlot">
16
+ <slot name="pro-layout-custom-icons"></slot>
17
+ </Col>
18
+ <Col class="font-padding" v-show="rightTopOptButtonList.includes('notice')">
19
+ <ProLayoutToolsQuickNotice></ProLayoutToolsQuickNotice>
20
+ </Col>
21
+ <Col class="font-padding" v-show="rightTopOptButtonList.includes('search')">
22
+ <ProLayoutToolsQuickSearch></ProLayoutToolsQuickSearch>
23
+ </Col>
24
+ <Col class="font-padding" v-show="rightTopOptButtonList.includes('i18n')">
25
+ <ProLayoutToolsQuickIntl></ProLayoutToolsQuickIntl>
26
+ </Col>
27
+ </Row>
28
+ </template>
29
+
30
+ <script>
31
+ import ProLayoutToolsQuickSearch from './pro-layout-tools-quick-search';
32
+ import ProLayoutToolsQuickCollect from './pro-layout-tools-quick-collect';
33
+ import ProLayoutToolsQuickFullscreen from './pro-layout-tools-quick-fullscreen';
34
+ import ProLayoutToolsQuickTodo from './pro-layout-tools-quick-todo';
35
+ import ProLayoutToolsQuickNotice from './pro-layout-tools-quick-notice';
36
+ import ProLayoutToolsQuickIntl from './pro-layout-tools-quick-intl';
37
+ import ProLayoutToolsQuickDocument from './pro-layout-tools-quick-document';
38
+ import Bus from '@lambo-design/shared/utils/bus'
39
+ import {deepCopy} from "@lambo-design/shared/utils/assist";
40
+
41
+ export default {
42
+ name: 'pro-layout-tools-quick-icons',
43
+ data() {
44
+ return {
45
+ rightTopOptButtonList: ['search','collect','document','fullScreen'],
46
+ rightTopOptButtonSlots: []
47
+ }
48
+ },
49
+ components:{
50
+ ProLayoutToolsQuickDocument,
51
+ ProLayoutToolsQuickSearch,
52
+ ProLayoutToolsQuickCollect,
53
+ ProLayoutToolsQuickFullscreen,
54
+ ProLayoutToolsQuickTodo,
55
+ ProLayoutToolsQuickNotice,
56
+ ProLayoutToolsQuickIntl
57
+ },
58
+ computed: {
59
+ shouldShowCustomSlot() {
60
+ let self = this;
61
+ return this.rightTopOptButtonList.some(item =>
62
+ self.rightTopOptButtonSlots.includes(item)
63
+ )
64
+ }
65
+ },
66
+ methods: {
67
+ initListener() {
68
+ Bus.$on('system-info',(data) => {
69
+ this.initSystemInfo(data);
70
+ })
71
+ },
72
+ destroyListener() {
73
+ Bus.$off('system-info')
74
+ },
75
+ initSystemInfo(data){
76
+ if (data && data.rightTopOptButtonList) {
77
+ this.rightTopOptButtonList = deepCopy(data.rightTopOptButtonList)
78
+ }
79
+ if(data && data.rightTopOptButtonSlots){
80
+ this.rightTopOptButtonSlots = deepCopy(data.rightTopOptButtonSlots)
81
+ }
82
+ },
83
+ },
84
+ created() {
85
+ this.initListener()
86
+ },
87
+ beforeDestroy() {
88
+ this.destroyListener()
89
+ }
90
+ }
91
+ </script>
92
+ <style lang="less" scoped>
93
+ .pro-layout-tools-quick-icons{
94
+ float: left;
95
+ .font-padding {
96
+ padding-right: 10px
97
+ }
98
+ }
99
+ </style>
@@ -0,0 +1,109 @@
1
+ <template>
2
+ <div class="user-avatar-dropdown">
3
+ <Dropdown @on-click="switchLang" :transfer="false">
4
+ <span>{{defaultLang}}</span>
5
+ <Icon type="ios-arrow-down"/>
6
+ <DropdownMenu slot="list">
7
+ <DropdownItem v-for="(item, index) in intlDictList" :key="index" :name="item.dictKey"><span>{{ item.dictValue }}</span></DropdownItem>
8
+ </DropdownMenu>
9
+ </Dropdown>
10
+ </div>
11
+ </template>
12
+
13
+
14
+ <script>
15
+
16
+ import Bus from "@lambo-design/shared/utils/bus";
17
+ import {deepCopy} from "@lambo-design/shared/utils/assist";
18
+ import config from "@lambo-design/shared/config/config";
19
+ import Locale from "@lambo-design/core/src/mixins/locale";
20
+ import ajax from "@lambo-design/shared/utils/ajax";
21
+
22
+ export default {
23
+ name: 'pro-layout-tools-intl',
24
+ mixins: [Locale],
25
+ data() {
26
+ return {
27
+ defaultLang: this.t('pro-layout.header.language'),
28
+ langCodeDict:{},
29
+ intlDictList:[]
30
+ }
31
+ },
32
+ methods: {
33
+ initListener() {
34
+ Bus.$on('other-datas',(data) => {
35
+ this.initIntlDictList(data);
36
+ })
37
+ },
38
+ destroyListener() {
39
+ Bus.$off('other-datas')
40
+ },
41
+ initIntlDictList(data) {
42
+ if (data && data.intlDatas){
43
+ this.intlDictList = deepCopy(data.intlDatas);
44
+ this.intlDictList.forEach(item => {
45
+ this.langCodeDict[item.dictKey] = item.dictValue;
46
+ })
47
+ }
48
+
49
+ this.setDefaultLang();
50
+ },
51
+ callSwitchLangApi(langCode, reload = false) {
52
+ const self = this;
53
+ const url = config.upmsServerContext + '/anon/acIntlTexts/switchLang';
54
+ ajax.get(url + '?langCode=' + langCode)
55
+ .then(function (resp) {
56
+ if (resp.data.code === 1) {
57
+ if (reload) {
58
+ window.location.reload();
59
+ }
60
+ } else {
61
+ self.$Message.error(resp.data.data)
62
+ }
63
+ })
64
+ .catch(function (err) {
65
+ console.error(err)
66
+ self.$Message.error('操作失败,请联系系统管理员')
67
+ })
68
+ },
69
+ switchLang(name) {
70
+ window.sessionStorage.clear();
71
+ localStorage.removeItem(config.routerBase + '-tagNavList');
72
+ this.defaultLang = this.langCodeDict[name];
73
+ sessionStorage.setItem("lambo_lang_code", name);
74
+ this.callSwitchLangApi(name, true);
75
+ },
76
+ setDefaultLang() {
77
+ let langCode = 'zh';
78
+ if (sessionStorage.getItem("lambo_lang_code")) {
79
+ langCode = sessionStorage.getItem("lambo_lang_code");
80
+ } else if (this.$cookies.get("lambo_lang_code")) {
81
+ langCode = this.$cookies.get("lambo_lang_code");
82
+ } else {
83
+ this.callSwitchLangApi(langCode, false);
84
+ }
85
+ if(langCode){
86
+ this.defaultLang = this.langCodeDict[langCode];
87
+ }
88
+ }
89
+ },
90
+ mounted() {
91
+ this.setDefaultLang();
92
+ },
93
+ created() {
94
+ this.initListener()
95
+ },
96
+ beforeDestroy() {
97
+ this.destroyListener()
98
+ }
99
+ }
100
+ </script>
101
+ <style lang="less" scoped>
102
+ @import '@lambo-design/core/src/styles/default.less';
103
+ .user-avatar-dropdown {
104
+ float: left;
105
+ cursor: pointer;
106
+ vertical-align: middle;
107
+ font-size: var(--font-size-base, @_font-size-base);
108
+ }
109
+ </style>
@@ -0,0 +1,133 @@
1
+ <template>
2
+ <div class="pro-layout-tools-quick-notice">
3
+ <Dropdown >
4
+ <Badge :count="noticeDatas.length" class-name="badge-count">
5
+ <Icon type="ios-notifications-outline" size="20" style="cursor: pointer"></Icon>
6
+ </Badge>
7
+ <template #list>
8
+ <DropdownMenu slot="list" class="notice-dropdown-menu">
9
+ <DropdownItem v-for="(item, index) in noticeDatas" :key="index" class="dropdown-item" @click.native="getDetail(item)" >
10
+ <div class="item-image">
11
+ <Icon type="ios-mail" size="24"/>
12
+ </div>
13
+ <div class="item-title" :title="item.noticeTitle">
14
+ {{ item.noticeTitle }}
15
+ </div>
16
+ <div class="item-time">
17
+ {{ item.publishTime }}
18
+ </div>
19
+ </DropdownItem>
20
+ <div class="dropdown-footer" :class="[noticeDatas.length == 0 ? 'no-line' : '']">
21
+ <Button type="text" v-if="noticeDatas.length > 0" @click="getMore" class="display-more" >{{ t('pro-layout.header.notice-more') }}</Button>
22
+ <Button type="text" v-if="noticeDatas.length > 0" @click="markRead" class="mark-read" >{{ t('pro-layout.header.notice-read') }}</Button>
23
+ <div class="no-data" v-if="noticeDatas.length == 0" >{{ t('pro-layout.header.notice-no-data') }}</div>
24
+ </div>
25
+ </DropdownMenu>
26
+ </template>
27
+ </Dropdown>
28
+ </div>
29
+ </template>
30
+
31
+ <script>
32
+ import Bus from '@lambo-design/shared/utils/bus';
33
+ import {deepCopy} from '@lambo-design/shared/utils/assist';
34
+ import Locale from "@lambo-design/core/src/mixins/locale";
35
+ export default {
36
+ name: "pro-layout-tools-quick-notice",
37
+ mixins: [Locale],
38
+ data() {
39
+ return {
40
+ noticeDatas:[]
41
+ }
42
+ },
43
+ methods: {
44
+ initListener() {
45
+ Bus.$on('other-datas',(data) => {
46
+ this.initNoticeList(data);
47
+ })
48
+ },
49
+ destroyListener() {
50
+ Bus.$off('other-datas')
51
+ },
52
+ initNoticeList(data) {
53
+ if (data && data.noticeDatas) {
54
+ this.noticeDatas = deepCopy(data.noticeDatas);
55
+ }
56
+ },
57
+ getDetail(item){
58
+ Bus.$emit('other-operate','notice-detail',item)
59
+ },
60
+ markRead(){
61
+ Bus.$emit('other-operate','notice-mark-read')
62
+ },
63
+ getMore() {
64
+ Bus.$emit('other-operate','notice-more')
65
+ }
66
+ },
67
+ created() {
68
+ this.initListener()
69
+ },
70
+ beforeDestroy() {
71
+ this.destroyListener()
72
+ }
73
+ }
74
+ </script>
75
+
76
+ <style lang="less">
77
+ @import "@lambo-design/core/src/styles/default";
78
+ .pro-layout-tools-quick-notice{
79
+ .badge-count{
80
+ top:12px;
81
+ height: 10px;
82
+ line-height: 8px;
83
+ min-width: 8px;
84
+ padding: 0;
85
+ font-size: 8px;
86
+ width: 10px;
87
+ }
88
+ }
89
+ .notice-dropdown-menu {
90
+ max-height: 300px;
91
+ width: 300px;
92
+ &::-webkit-scrollbar {
93
+ width: 0;
94
+ height: 0;
95
+ }
96
+ .dropdown-item {
97
+ overflow: hidden;
98
+ line-height: 24px;
99
+ padding: 8px;
100
+ .item-image{
101
+ float: left;
102
+ }
103
+ .item-title{
104
+ float: left;
105
+ margin-left: 5px;
106
+ width: 120px;
107
+ white-space:nowrap;
108
+ overflow:hidden;
109
+ text-overflow: ellipsis;
110
+ }
111
+ .item-time{
112
+ float: right;
113
+ }
114
+ }
115
+ .dropdown-footer{
116
+ line-height: 24px;
117
+ border-top: 1px solid var(--layout-sider-line-color,@_layout-sider-line-color);
118
+ padding: 8px;
119
+ &.no-line{
120
+ border: 0;
121
+ }
122
+ .display-more{
123
+ float: left;
124
+ }
125
+ .mark-read{
126
+ float: right;
127
+ }
128
+ .no-data{
129
+ text-align: center;
130
+ }
131
+ }
132
+ }
133
+ </style>