gy-webcode2 1.2.0 → 2.0.0

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.
@@ -32,7 +32,7 @@
32
32
  {{menuPath.name}}
33
33
  </template>
34
34
  </span>
35
-
35
+
36
36
  </div>
37
37
  <slot name="nameAfter"></slot>
38
38
  </div>
@@ -76,7 +76,7 @@ export default {
76
76
  let menuKey = Object.keys(menu).find(key => {
77
77
  return this.fullPath.includes(key)
78
78
  })
79
- // let findMenu =
79
+ // let findMenu =
80
80
  return menu[menuKey]
81
81
  },
82
82
  names(){
@@ -86,11 +86,11 @@ export default {
86
86
  return this.$store.state.menu.breadcrumb_list;
87
87
  },
88
88
  isBack(){
89
- return this.$listeners && this.$listeners['goBack']
89
+ return this.$listeners && this.$listeners['goBack']
90
90
  },
91
91
  showRow1(){
92
92
  if(this.$store.state.vuex_breadcrumbShow){
93
- return true;
93
+ return true;
94
94
  }
95
95
  },
96
96
  routerBreadcrumb(){
@@ -99,7 +99,7 @@ export default {
99
99
  }
100
100
  return []
101
101
  }
102
-
102
+
103
103
  },
104
104
  created(){
105
105
  let breadcrumb_list = this.breadcrumb_list;
@@ -113,7 +113,7 @@ export default {
113
113
 
114
114
  if(this.names.length){
115
115
  this.names.forEach(item => {
116
-
116
+
117
117
  breadcrumb_list[fullPath].push({
118
118
  name:item,
119
119
  id:myID,
@@ -145,8 +145,15 @@ export default {
145
145
  }
146
146
  },
147
147
  beforeDestroy(){
148
- let rIndex = this.breadcrumb_list[this.fullPath].findIndex(i => i.id == this.myID)
149
- this.breadcrumb_list[this.fullPath].splice(rIndex,1)
148
+ if(this.breadcrumb_list[this.fullPath]){
149
+ let rIndex = this.breadcrumb_list[this.fullPath].reduce((curr,item,index) => {
150
+ if(item.id == this.myID){
151
+ curr.push(index)
152
+ }
153
+ return curr;
154
+ },[])
155
+ this.breadcrumb_list[this.fullPath].splice(rIndex[0],rIndex.length)
156
+ }
150
157
 
151
158
  }
152
159
  }
@@ -154,4 +161,4 @@ export default {
154
161
 
155
162
  <style>
156
163
 
157
- </style>
164
+ </style>
@@ -1,22 +1,39 @@
1
1
  <template>
2
2
  <scrollBar left="24px" top="10px" right="24px">
3
3
  <div class="pageStyle">
4
- <div class="row1">
5
- 整体风格设置
6
- </div>
4
+ <div class="row1">整体风格设置</div>
7
5
  <div class="stylPreview">
8
- <div class="item" @click="changeTheme(item.value)" :class="[`item_${item.id}`,{active:themeName == item.value}]" v-for="item,index in themeList" :key="item.id">
6
+ <div
7
+ class="item"
8
+ @click="changeTheme(item.value)"
9
+ :class="[
10
+ `item_${item.id}`,
11
+ { active: themeName == item.value },
12
+ ]"
13
+ v-for="(item, index) in themeList"
14
+ :key="item.id"
15
+ >
9
16
  <div class="iconBox">
10
17
  <i class="el-icon-check"></i>
11
18
  </div>
12
19
  </div>
13
20
  </div>
14
- <div class="row1 mar_t_10">
15
- 主题色
16
- </div>
21
+ <div class="row1 mar_t_10">主题色</div>
17
22
  <div class="themeColors">
18
- <el-tooltip v-for="item,index in themeColorList" :key="item.id" :open-delay="200" effect="dark" :content="item.name" placement="top">
19
- <div class="item" @click="changeThemeColor(item.value)" :class="{active:themeColor == item.value}" :style="`background-color:${item.color}`">
23
+ <el-tooltip
24
+ v-for="(item, index) in themeColorList"
25
+ :key="item.id"
26
+ :open-delay="200"
27
+ effect="dark"
28
+ :content="item.name"
29
+ placement="top"
30
+ >
31
+ <div
32
+ class="item"
33
+ @click="changeThemeColor(item.value)"
34
+ :class="{ active: themeColor == item.value }"
35
+ :style="`background-color:${item.color}`"
36
+ >
20
37
  <div class="iconBox">
21
38
  <i class="el-icon-check"></i>
22
39
  </div>
@@ -24,9 +41,7 @@
24
41
  </el-tooltip>
25
42
  </div>
26
43
  <el-divider></el-divider>
27
- <div class="row1 mar_t_10">
28
- 内容区域
29
- </div>
44
+ <div class="row1 mar_t_10">内容区域</div>
30
45
  <!-- <div class="flex aic jcb pad_t_10 pad_b_10">
31
46
  <div>水印</div>
32
47
  <div>
@@ -36,154 +51,187 @@
36
51
  <div class="flex aic jcb pad_t_10 pad_b_10">
37
52
  <div>面包屑</div>
38
53
  <div>
39
- <el-switch @change="(value)=>{setPageStyle('breadcrumbShow',value)}" v-model="$store.state.vuex_breadcrumbShow"></el-switch>
54
+ <el-switch
55
+ @change="
56
+ (value) => {
57
+ setPageStyle('breadcrumbShow', value);
58
+ }
59
+ "
60
+ v-model="$store.state.vuex_breadcrumbShow"
61
+ ></el-switch>
62
+ </div>
63
+ </div>
64
+ <div class="flex aic jcb pad_t_10 pad_b_10">
65
+ <div>页面选项卡</div>
66
+ <div>
67
+ <el-switch
68
+ v-model="routeTabsShow"
69
+ @change="tabsChange"
70
+ ></el-switch>
40
71
  </div>
41
72
  </div>
42
73
  </div>
43
-
44
74
  </scrollBar>
45
75
  </template>
46
76
 
47
77
  <script>
48
- export default {
49
- props:['wrapStyle_dialog'],
50
- data(){
51
- return {
52
- themeList:[
53
- {
54
- name:"默认",
55
- id:"1",
56
- value:"default",
57
- img:"pageStyle_1.png"
58
- },
59
- {
60
- name:"深蓝",
61
- id:"2",
62
- value:"shenlan",
63
- img:"pageStyle_2.png"
64
- },
65
- {
66
- name:"海蓝",
67
- id:"3",
68
- value:"hailan",
69
- img:"pageStyle_3.png"
70
- },
71
- // {
72
- // name:"绿",
73
- // id:"4",
74
- // value:"lv"
75
- // },
76
- ],
78
+ export default {
79
+ props: ["wrapStyle_dialog"],
80
+ data() {
81
+ return {
82
+ themeList: [
83
+ {
84
+ name: "默认",
85
+ id: "1",
86
+ value: "default",
87
+ img: "pageStyle_1.png",
88
+ },
89
+ {
90
+ name: "深蓝",
91
+ id: "2",
92
+ value: "shenlan",
93
+ img: "pageStyle_2.png",
94
+ },
95
+ {
96
+ name: "海蓝",
97
+ id: "3",
98
+ value: "hailan",
99
+ img: "pageStyle_3.png",
100
+ },
101
+ // {
102
+ // name:"绿",
103
+ // id:"4",
104
+ // value:"lv"
105
+ // },
106
+ ],
77
107
 
78
- themeColorList:[
79
- {
80
- name:"拂晓蓝(默认)",
81
- value:"lan",
82
- id:1,
83
- color:"#1890ff"
84
- },
85
- {
86
- name:"薄暮",
87
- value:"hong",
88
- id:2,
89
- color:"#f5222d"
90
- },
91
- {
92
- name:"火山",
93
- value:"cheng",
94
- id:3,
95
- color:"#fb551b"
96
- },
97
- {
98
- name:"日暮",
99
- value:"huang",
100
- id:4,
101
- color:"#fa8c16"
102
- },
103
- {
104
- name:"明青",
105
- value:"qing",
106
- id:5,
107
- color:"#15c3c1"
108
- },
109
- {
110
- name:"极光绿",
111
- value:"lv",
112
- id:6,
113
- color:"#52c41a"
114
- },
115
- {
116
- name:"极客蓝",
117
- value:"shenaln",
118
- id:7,
119
- color:"#2f54eb"
120
- },
121
- {
122
- name:"酱紫",
123
- value:"zi",
124
- id:8,
125
- color:"#722ed1"
126
- },
127
- ],
128
- }
108
+ themeColorList: [
109
+ {
110
+ name: "拂晓蓝(默认)",
111
+ value: "lan",
112
+ id: 1,
113
+ color: "#1890ff",
114
+ },
115
+ {
116
+ name: "薄暮",
117
+ value: "hong",
118
+ id: 2,
119
+ color: "#f5222d",
120
+ },
121
+ {
122
+ name: "火山",
123
+ value: "cheng",
124
+ id: 3,
125
+ color: "#fb551b",
126
+ },
127
+ {
128
+ name: "日暮",
129
+ value: "huang",
130
+ id: 4,
131
+ color: "#fa8c16",
132
+ },
133
+ {
134
+ name: "明青",
135
+ value: "qing",
136
+ id: 5,
137
+ color: "#15c3c1",
138
+ },
139
+ {
140
+ name: "极光绿",
141
+ value: "lv",
142
+ id: 6,
143
+ color: "#52c41a",
144
+ },
145
+ {
146
+ name: "极客蓝",
147
+ value: "shenaln",
148
+ id: 7,
149
+ color: "#2f54eb",
150
+ },
151
+ {
152
+ name: "酱紫",
153
+ value: "zi",
154
+ id: 8,
155
+ color: "#722ed1",
156
+ },
157
+ ],
158
+ routeTabsShow:false,
159
+ };
160
+ },
161
+ computed: {
162
+ themeName() {
163
+ return this.$store.state.vuex_themeName;
129
164
  },
130
- computed:{
131
- themeName(){
132
- return this.$store.state.vuex_themeName
133
- },
134
- themeColor(){
135
- return this.$store.state.vuex_themeColor
136
- },
165
+ themeColor() {
166
+ return this.$store.state.vuex_themeColor;
137
167
  },
138
- methods:{
139
- changeTheme(value){
140
- this.$store.state.vuex_themeName = value;
141
- window.document.body.setAttribute('data-theme', value)
142
- this.setPageStyle('themeName',value)
143
- },
144
- changeThemeColor(value){
145
- this.$store.state.vuex_themeColor = value;
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))
168
+ },
169
+ created(){
170
+ this.routeTabsShow = this.$store.state.vuex_routeTabsShow
171
+ },
172
+ methods: {
173
+ tabsChange(value){
174
+ this.$confirm('修改后需要刷新浏览器,确定修改吗?', '提示', {
175
+ confirmButtonText: '确定',
176
+ cancelButtonText: '取消',
177
+ type: 'warning'
178
+ }).then(() => {
179
+ window.location.reload()
180
+ // this.themeStore.setTheme('routeTabsShow',val)
181
+ // this.$store.state.vuex_themeName = value;
182
+ this.setPageStyle("routeTabsShow", value);
183
+
184
+ }).catch(() => {
185
+ this.routeTabsShow = !value;
186
+ });
187
+ },
188
+ changeTheme(value) {
189
+ this.$store.state.vuex_themeName = value;
190
+ window.document.body.setAttribute("data-theme", value);
191
+ this.setPageStyle("themeName", value);
192
+ },
193
+ changeThemeColor(value) {
194
+ this.$store.state.vuex_themeColor = value;
195
+ window.document.body.setAttribute("data-theme-color", value);
196
+ this.setPageStyle("themeColor", value);
197
+ },
198
+ setPageStyle(key, val) {
199
+ let gyPageStyle = localStorage.getItem("gy_pageStyle");
200
+ if (gyPageStyle) {
201
+ gyPageStyle = JSON.parse(gyPageStyle);
202
+ } else {
203
+ gyPageStyle = {};
161
204
  }
162
- }
163
- }
205
+ // console.log(gyPageStyle);
206
+ // console.log(key,val);
207
+ gyPageStyle[key] = val;
208
+ localStorage.setItem("gy_pageStyle", JSON.stringify(gyPageStyle));
209
+ },
210
+ },
211
+ };
164
212
  </script>
165
213
 
166
214
  <style lang="scss" scoped>
167
- .pageStyle{
215
+ .pageStyle {
168
216
  position: relative;
169
- .row1{
217
+ .row1 {
170
218
  padding: 10px 0;
171
219
  // padding: 10px 0 5px 0;
172
220
  font-weight: bold;
173
221
  }
174
- .stylPreview{
222
+ .stylPreview {
175
223
  display: flex;
176
224
  padding: 10px 0;
177
- .item{
225
+ .item {
178
226
  position: relative;
179
227
  width: 64px;
180
228
  height: 48px;
181
229
  margin-right: 16px;
182
230
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.1);
183
231
  cursor: pointer;
184
- .iconBox{
232
+ .iconBox {
185
233
  display: none;
186
- color: #1890ff ;
234
+ color: #1890ff;
187
235
  font-size: 20px;
188
236
  width: 20px;
189
237
  height: 20px;
@@ -191,24 +239,24 @@
191
239
  left: 30px;
192
240
  top: 22px;
193
241
  }
194
- &.active .iconBox{
242
+ &.active .iconBox {
195
243
  display: block;
196
244
  }
197
- &.item_1{
245
+ &.item_1 {
198
246
  background-image: url("~gy-webcode2/img/theme/pageStyle_1.png");
199
247
  }
200
- &.item_2{
248
+ &.item_2 {
201
249
  background-image: url("~gy-webcode2/img/theme/pageStyle_2.png");
202
250
  }
203
- &.item_3{
251
+ &.item_3 {
204
252
  background-image: url("~gy-webcode2/img/theme/pageStyle_3.png");
205
253
  }
206
254
  }
207
255
  }
208
- .themeColors{
256
+ .themeColors {
209
257
  display: flex;
210
258
  padding: 10px 0;
211
- .item{
259
+ .item {
212
260
  width: 20px;
213
261
  height: 20px;
214
262
  background: #000;
@@ -222,14 +270,13 @@
222
270
  color: #fff;
223
271
  font-size: 12px;
224
272
  cursor: pointer;
225
- .iconBox{
226
- display: none;
273
+ .iconBox {
274
+ display: none;
227
275
  }
228
- &.active .iconBox{
276
+ &.active .iconBox {
229
277
  display: block;
230
278
  }
231
279
  }
232
280
  }
233
-
234
281
  }
235
282
  </style>
package/css/common.scss CHANGED
@@ -1,16 +1,16 @@
1
- @import "./modules/common.scss";
2
- @import "./modules/elementUI.scss";
3
- @import "./modules/form.scss";
4
- @import "./modules/header.scss";
5
- @import "./modules/sidebar.scss";
6
- @import "./modules/tree.scss";
7
- @import "./modules/button.scss";
8
- @import "./modules/table.scss";
9
- @import "./modules/tabs.scss";
10
- @import "./modules/tags.scss";
11
- @import "./modules/color.scss";
12
- @import "./modules/tree_check.scss";
13
- @import "./layout.scss";
1
+ @import "modules/common";
2
+ @import "modules/elementUI";
3
+ @import "modules/form";
4
+ @import "modules/header";
5
+ @import "modules/sidebar";
6
+ @import "modules/tree";
7
+ @import "modules/button";
8
+ @import "modules/table";
9
+ @import "modules/tabs";
10
+ @import "modules/tags";
11
+ @import "modules/color";
12
+ @import "modules/tree_check";
13
+ @import "layout";
14
14
 
15
15
 
16
16