gy-webcode2 1.1.3 → 1.1.5

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.
@@ -1,19 +1,19 @@
1
1
  <template>
2
- <div class="breadcrumb" :class="{default:position=='default',breadcrumb_top:position == 'top'}">
2
+ <div class="breadcrumb">
3
3
  <div class="row1" v-if="showRow1">
4
4
  <div class="title ">
5
5
  <span class="">{{$route.meta.headerMenuName}}</span>
6
- <span class="breadcrumb_iconBox">
6
+ <!-- <span class="breadcrumb_iconBox">
7
7
  <i class="el-icon-arrow-right"></i>
8
8
  </span>
9
- <span @click="menuClick" :class="{myHover:breadcrumb_list.length,s1:breadcrumb_list.length == 0}" >
9
+ <span @click="menuClick" :class="{myHover:routerBreadcrumb.length,s1:routerBreadcrumb.length == 0}" >
10
10
  {{$route.meta.name}}
11
- </span>
12
- <template v-for="item,index in breadcrumb_list">
11
+ </span> -->
12
+ <template v-for="item,index in routerBreadcrumb">
13
13
  <span class="breadcrumb_iconBox">
14
14
  <i class="el-icon-arrow-right"></i>
15
15
  </span>
16
- <span :class="{hover2:index < breadcrumb_list.length -1,s1:index == breadcrumb_list.length -1}" @click="itemClick(item,index)">
16
+ <span :class="{hover2:index < routerBreadcrumb.length -1,s1:index == routerBreadcrumb.length -1}" @click="itemClick(item,index)">
17
17
  {{item.name}}
18
18
  </span>
19
19
  </template>
@@ -24,13 +24,14 @@
24
24
  <div class="name">
25
25
  <span class="flex aic" :class="{myHover:isBack}" @click="backClick()">
26
26
  <i v-if="isBack" class="el-icon-arrow-left mar_r_6"></i>
27
- <template v-if="breadcrumb_list.length">
28
- {{breadcrumb_list[breadcrumb_list.length -1].name}}
27
+ <template v-if="routerBreadcrumb.length">
28
+ {{routerBreadcrumb[routerBreadcrumb.length -1].name}}
29
29
  </template>
30
30
  <template v-else>
31
31
  {{$route.meta.name}}
32
32
  </template>
33
33
  </span>
34
+
34
35
  </div>
35
36
  <slot name="nameAfter"></slot>
36
37
  </div>
@@ -43,6 +44,7 @@
43
44
  </template>
44
45
 
45
46
  <script>
47
+ import uuid from "gy-webcode2/scripts/uuid"
46
48
  export default {
47
49
  // props:['name','showBack','goBack','pageHeaderShow'],
48
50
  props:{
@@ -57,22 +59,10 @@ export default {
57
59
  },
58
60
  data(){
59
61
  return {
60
- headerMenuHide:defaultConfig.headerMenuHide
62
+ myID:"",
61
63
  }
62
64
  },
63
65
  watch:{
64
- names(){
65
- let breadcrumb_list = this.$store.state.menu.breadcrumb_list;
66
- if(this.names.length){
67
- this.names.forEach(item => {
68
- breadcrumb_list.push({
69
- name:item,
70
- click:this.backClick
71
- })
72
- })
73
- }
74
- // console.log(breadcrumb_list);
75
- }
76
66
  },
77
67
  computed:{
78
68
  names(){
@@ -85,56 +75,67 @@ export default {
85
75
  return this.$listeners && this.$listeners['goBack']
86
76
  },
87
77
  showRow1(){
88
- if(this.position == 'default'){
89
- if(this.$store.state.breadcrumbShow){
90
- return true;
91
- }
78
+ if(this.$store.state.vuex_breadcrumbShow){
79
+ return true;
92
80
  }
93
- else if(this.position == 'top'){
94
- if(this.$store.state.breadcrumbShow){
95
- return true;
96
- }
81
+ },
82
+ routeName(){
83
+ return this.$route.name;
84
+ },
85
+ routerBreadcrumb(){
86
+ if(this.breadcrumb_list[this.routeName]){
87
+ return this.breadcrumb_list[this.routeName]
97
88
  }
89
+ return []
98
90
  }
99
91
 
100
92
  },
101
93
  created(){
102
- // console.log(this.$listeners['goBack']);
103
- let breadcrumb_list = this.$store.state.menu.breadcrumb_list;
94
+ let breadcrumb_list = this.breadcrumb_list;
95
+ let routeName = this.$route.name;
96
+ if(!breadcrumb_list[routeName]){
97
+ this.$set(breadcrumb_list,routeName,[])
98
+ }
99
+ let myID = uuid(10,16)
100
+ this.myID = myID;
101
+
104
102
  if(this.names.length){
105
103
  this.names.forEach(item => {
106
- breadcrumb_list.push({
104
+
105
+ breadcrumb_list[routeName].push({
107
106
  name:item,
107
+ id:myID,
108
108
  click:this.backClick
109
109
  })
110
110
  })
111
111
  }
112
+ else{
113
+ breadcrumb_list[routeName].push({
114
+ name:this.$route.meta.name,
115
+ id:myID,
116
+ click:this.backClick
117
+ })
118
+ }
112
119
  },
113
120
  methods:{
114
121
  backClick(){
115
122
  this.$emit('goBack');
116
123
  },
117
124
  itemClick(data,index){
118
- if(index < this.breadcrumb_list.length -1){
119
- this.breadcrumb_list[index + 1].click()
125
+ if(index != this.routerBreadcrumb.length -1){
126
+ this.routerBreadcrumb[index+1].click()
120
127
  }
121
128
  },
122
129
  menuClick(){
123
- if(this.breadcrumb_list.length){
124
- this.breadcrumb_list[0].click()
130
+ if(this.routerBreadcrumb.length){
131
+ this.routerBreadcrumb[0].click()
125
132
  }
126
133
  }
127
134
  },
128
135
  beforeDestroy(){
129
- let breadcrumb_list = this.$store.state.menu.breadcrumb_list;
130
- if(this.names.length){
131
- this.names.forEach(item => {
132
- let isFind = breadcrumb_list.findIndex(i => i.name == item)
133
- if(isFind > -1){
134
- breadcrumb_list.splice(isFind,1)
135
- }
136
- })
137
- }
136
+ let routeName = this.$route.name;
137
+ let rIndex = this.routerBreadcrumb.findIndex(i => i.id == this.myID)
138
+ this.breadcrumb_list[routeName] = this.routerBreadcrumb.splice(0,rIndex);
138
139
  }
139
140
  }
140
141
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <span class="operateBtnIcon " @click="$emit('click')" >
2
+ <span class="operateBtnIcon " :class="{disabled:disabled}" @click="iconClick" >
3
3
  <el-tooltip :enterable="false" :content="title" popper-class="operateBtnIconPopper" placement="bottom" effect="light">
4
4
  <slot></slot>
5
5
  </el-tooltip>
@@ -12,6 +12,18 @@ export default {
12
12
  title:{
13
13
  type:String,
14
14
  default:"",
15
+ },
16
+ disabled:{
17
+ type:Boolean,
18
+ default:false
19
+ }
20
+ },
21
+ methods:{
22
+ iconClick(){
23
+ if(!this.disabled){
24
+
25
+ this.$emit('click')
26
+ }
15
27
  }
16
28
  }
17
29
  }
@@ -36,7 +36,7 @@
36
36
  <div class="flex aic jcb pad_t_10 pad_b_10">
37
37
  <div>面包屑</div>
38
38
  <div>
39
- <el-switch v-model="$store.state.breadcrumbShow"></el-switch>
39
+ <el-switch @change="(value)=>{setPageStyle('breadcrumbShow',value)}" v-model="$store.state.vuex_breadcrumbShow"></el-switch>
40
40
  </div>
41
41
  </div>
42
42
  </div>
@@ -129,20 +129,35 @@
129
129
  },
130
130
  computed:{
131
131
  themeName(){
132
- return this.$store.state.themeName
132
+ return this.$store.state.vuex_themeName
133
133
  },
134
134
  themeColor(){
135
- return this.$store.state.themeColor
135
+ return this.$store.state.vuex_themeColor
136
136
  },
137
137
  },
138
138
  methods:{
139
139
  changeTheme(value){
140
- this.$store.state.themeName = value;
140
+ this.$store.state.vuex_themeName = value;
141
141
  window.document.body.setAttribute('data-theme', value)
142
+ this.setPageStyle('themeName',value)
142
143
  },
143
144
  changeThemeColor(value){
144
- this.$store.state.themeColor = value;
145
+ this.$store.state.vuex_themeColor = value;
145
146
  window.document.body.setAttribute('data-theme-color', value)
147
+ this.setPageStyle('themeColor',value)
148
+ },
149
+ setPageStyle(key,val){
150
+ let gyPageStyle = localStorage.getItem('gy_pageStyle');
151
+ if(gyPageStyle){
152
+ gyPageStyle =JSON.parse(gyPageStyle)
153
+ }
154
+ else{
155
+ gyPageStyle = {}
156
+ }
157
+ // console.log(gyPageStyle);
158
+ // console.log(key,val);
159
+ gyPageStyle[key] = val;
160
+ localStorage.setItem('gy_pageStyle',JSON.stringify(gyPageStyle))
146
161
  }
147
162
  }
148
163
  }
package/css/layout.scss CHANGED
@@ -173,6 +173,8 @@
173
173
  min-height: 32px;
174
174
  margin-bottom: 5px;
175
175
  margin-top: 5px;
176
+ display: flex;
177
+ align-items: center;
176
178
  }
177
179
  }
178
180
  }
@@ -222,7 +224,7 @@
222
224
  bottom: 0;
223
225
  display: flex;
224
226
  flex-direction: column;
225
- .header{
227
+ >.header{
226
228
  height: 56px;
227
229
  display: flex;
228
230
  align-items: center;
@@ -236,7 +238,7 @@
236
238
  cursor: pointer;
237
239
  }
238
240
  }
239
- .body{
241
+ >.body{
240
242
  position: relative;
241
243
  flex: 1;
242
244
  height: 0;
@@ -59,3 +59,6 @@
59
59
  .color_active{
60
60
  @include themeColor("color","color");
61
61
  }
62
+ .color_lan{
63
+ color: #5487ee;
64
+ }
@@ -78,12 +78,13 @@
78
78
  bottom: -1px;
79
79
  }
80
80
  &.gutter .el-table th.gutter{
81
- background: #fafafa;
81
+ background: #f0f0f0;
82
82
  display: table-cell!important;
83
83
  }
84
84
 
85
85
  .el-table__fixed-right-patch{
86
- background: #fafafa;
86
+ background: #f0f0f0;
87
+ border-radius: 0 8px 0 0;
87
88
  }
88
89
  .tr_error{
89
90
  background: #fff0f0;
@@ -37,7 +37,7 @@
37
37
  // right: 6px;
38
38
  left: 0;
39
39
  right: 0;
40
- width: 60px;
40
+ // width: 60px;
41
41
  height: 2px;
42
42
  margin: auto;
43
43
  @include themeColor('background-color','active');
@@ -53,4 +53,57 @@
53
53
  flex: 1;
54
54
 
55
55
  }
56
+ }
57
+ .tabs2{
58
+ height: 40px;
59
+ background: #fff;
60
+ border-bottom: 1px solid #d9d9d9;
61
+ display: flex;
62
+ .items{
63
+ display: flex;
64
+ }
65
+ .item{
66
+ position: relative;
67
+ min-width: 100px;
68
+ background: #fafafa;
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ font-size: 14px;
73
+ color: #000000;
74
+ padding: 0 20px;
75
+ cursor: pointer;
76
+ transition: all 0.3s ease;
77
+ border: 1px solid #d9d9d9;
78
+ border-right: none;
79
+ position: relative;
80
+ bottom:-1px;
81
+ &:nth-last-of-type(1){
82
+ border-right: 1px solid #d9d9d9;
83
+ border-radius: 0 8px 0 0 ;
84
+ }
85
+ &:nth-of-type(1){
86
+ border-radius: 8px 0 0 0;
87
+ }
88
+
89
+ &.active{
90
+ background: #fff;
91
+ border-bottom-color: #fff;
92
+ position: relative;
93
+ @include themeColor("color",'active');
94
+
95
+ }
96
+ &:hover{
97
+ background: #fff;
98
+ @include themeColor("color",'active');
99
+ }
100
+ }
101
+ .other{
102
+ display: flex;
103
+ align-items: center;
104
+ justify-content: flex-end;
105
+ flex: 1;
106
+
107
+ }
108
+
56
109
  }
@@ -25,6 +25,8 @@
25
25
  .right{
26
26
  overflow: auto;
27
27
  }
28
+ .left,.right{
29
+
28
30
  ul{
29
31
  padding:10px;
30
32
  li{
@@ -50,4 +52,5 @@
50
52
  }
51
53
  }
52
54
  }
55
+ }
53
56
  }
package/index.js CHANGED
@@ -13,5 +13,5 @@
13
13
  // 已使用项目 指标管理
14
14
 
15
15
  module.exports = {
16
- version :'1.1.3',
16
+ version :'1.1.5',
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gy-webcode2",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "gy前端公共代码",
5
5
  "main": "index.js",
6
6
  "scripts": {