gy-webcode2 1.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.
Files changed (70) hide show
  1. package/components/bar.vue +37 -0
  2. package/components/breadcrumb.vue +127 -0
  3. package/components/javaEditor.vue +88 -0
  4. package/components/sqlEditor.vue +92 -0
  5. package/components/waterfall.vue +484 -0
  6. package/css/common.scss +106 -0
  7. package/css/layout.scss +338 -0
  8. package/css/login.scss +122 -0
  9. package/css/modules/button.scss +2 -0
  10. package/css/modules/color.scss +58 -0
  11. package/css/modules/common.scss +217 -0
  12. package/css/modules/elementUI.scss +426 -0
  13. package/css/modules/form.scss +56 -0
  14. package/css/modules/header.scss +342 -0
  15. package/css/modules/sidebar.scss +214 -0
  16. package/css/modules/table.scss +134 -0
  17. package/css/modules/tabs.scss +54 -0
  18. package/css/modules/tags.scss +149 -0
  19. package/css/modules/tree.scss +120 -0
  20. package/css/modules/tree_check.scss +53 -0
  21. package/css/theme/colors/cheng.scss +17 -0
  22. package/css/theme/colors/default.scss +19 -0
  23. package/css/theme/colors/hong.scss +17 -0
  24. package/css/theme/colors/huang.scss +17 -0
  25. package/css/theme/colors/lv.scss +17 -0
  26. package/css/theme/colors/qing.scss +17 -0
  27. package/css/theme/colors/shenaln.scss +17 -0
  28. package/css/theme/colors/zi.scss +18 -0
  29. package/css/theme/global.scss +8 -0
  30. package/css/theme/styles/default.scss +11 -0
  31. package/css/theme/styles/hailan.scss +11 -0
  32. package/css/theme/styles/shenlan.scss +11 -0
  33. package/css/theme/theme.scss +78 -0
  34. package/extend/axios.js +173 -0
  35. package/extend/formatTime.js +54 -0
  36. package/img/btnActive/1.png +0 -0
  37. package/img/btnActive/2.png +0 -0
  38. package/img/btnActive/3.png +0 -0
  39. package/img/btnActive/4.png +0 -0
  40. package/img/btnActive/5.png +0 -0
  41. package/img/btnActive/6.png +0 -0
  42. package/img/btnActive/7.png +0 -0
  43. package/img/btnActive/8.png +0 -0
  44. package/img/login_bg.jpg +0 -0
  45. package/img/login_bg2.jpg +0 -0
  46. package/img/login_bg2.png +0 -0
  47. package/img/mrtx.jpg +0 -0
  48. package/img/slogan.png +0 -0
  49. package/img/theme/pageStyle_1.png +0 -0
  50. package/img/theme/pageStyle_2.png +0 -0
  51. package/img/theme/pageStyle_3.png +0 -0
  52. package/index.js +17 -0
  53. package/jsconfig.json +19 -0
  54. package/package.json +15 -0
  55. package/plugins/jsencrypt.js +5370 -0
  56. package/plugins/jsencrypt.min.js +1 -0
  57. package/plugins/swiper-4.5.3/css/swiper.css +619 -0
  58. package/plugins/swiper-4.5.3/css/swiper.min.css +12 -0
  59. package/plugins/swiper-4.5.3/js/swiper.esm.bundle.js +7184 -0
  60. package/plugins/swiper-4.5.3/js/swiper.esm.js +7166 -0
  61. package/plugins/swiper-4.5.3/js/swiper.js +8149 -0
  62. package/plugins/swiper-4.5.3/js/swiper.min.js +13 -0
  63. package/plugins/swiper-4.5.3/js/swiper.min.js.map +1 -0
  64. package/scripts/$u.mixin.js +27 -0
  65. package/scripts/crypto.js +184 -0
  66. package/scripts/jsencrypt.js +180 -0
  67. package/scripts/md5.js +259 -0
  68. package/scripts/numberAnimate.js +134 -0
  69. package/scripts/uuid.js +33 -0
  70. package/updateLog.txt +0 -0
@@ -0,0 +1,484 @@
1
+ <template>
2
+ <!-- // 瀑布流布局 -->
3
+ <div
4
+ class="vue-waterfall"
5
+ :style="{ height: height }"
6
+ ref="vueWaterfall"
7
+ id="vueWaterfall"
8
+ :class="isTransition && 'is-transition'"
9
+ >
10
+ <div class="slot-box">
11
+ <slot></slot>
12
+ </div>
13
+ </div>
14
+ </template>
15
+ <style>
16
+ .vue-waterfall {
17
+ width: 100%;
18
+ overflow-y: auto;
19
+ position: relative;
20
+ }
21
+ .vue-waterfall .slot-box {
22
+ position: absolute;
23
+ top: 100%;
24
+ left: 100%;
25
+ width: 0;
26
+ height: 0;
27
+ overflow: hidden;
28
+ }
29
+ .vue-waterfall .vue-waterfall-column {
30
+ float: left;
31
+ }
32
+ .vue-waterfall.is-transition img {
33
+ opacity: 0;
34
+ }
35
+ .vue-waterfall.is-transition img.animation {
36
+ animation: 0.4s lazy-animation linear;
37
+ animation-fill-mode: forwards;
38
+ }
39
+
40
+ @keyframes lazy-animation {
41
+ from {
42
+ opacity: 0;
43
+ }
44
+ to {
45
+ opacity: 1;
46
+ }
47
+ }
48
+ </style>
49
+
50
+
51
+ <script>
52
+ // global.regeneratorRuntime = require("babel-runtime/regenerator");
53
+ // import bus from "./bus";
54
+
55
+ export default {
56
+ props: {
57
+ col: {
58
+ type: Number,
59
+ default: 2,
60
+ },
61
+ width: Number,
62
+ height: {
63
+ type: String,
64
+ // default:'100vh', 取消height默认值
65
+ },
66
+ data: {
67
+ type: Array,
68
+ default: [],
69
+ },
70
+ gutterWidth: {
71
+ type: Number,
72
+ default: 10,
73
+ },
74
+ isTransition: {
75
+ type: Boolean,
76
+ default: true,
77
+ },
78
+ lazyDistance: {
79
+ type: Number,
80
+ default: 300,
81
+ },
82
+ loadDistance: {
83
+ type: Number,
84
+ default: 300,
85
+ },
86
+ },
87
+ data() {
88
+ return {
89
+ root: null,
90
+ columns: [],
91
+ loadmore: true,
92
+ timeout: null,
93
+ lazyTimeout: null,
94
+ lastScrollTop: 0,
95
+ timer: null,
96
+ loadedIndex: 0,
97
+ columnWidth: 0,
98
+ isresizing: false,
99
+ clientHeight:
100
+ document.documentElement.clientHeight ||
101
+ document.body.clientHeight,
102
+ clientWidth:
103
+ document.documentElement.clientWidth ||
104
+ document.body.clientWidth,
105
+ };
106
+ },
107
+ computed: {
108
+ trueLazyDistance() {
109
+ return (this.clientWidth / 375) * this.lazyDistance;
110
+ },
111
+ max() {
112
+ return (this.clientWidth / 375) * this.loadDistance;
113
+ },
114
+ viewHeight() {
115
+ return this.height ? this.root.offsetHeight : this.clientHeight;
116
+ },
117
+ },
118
+ watch: {
119
+ col(val) {
120
+ this.$nextTick(() => {
121
+ this.init();
122
+ });
123
+ },
124
+ data(newVal, oldVal) {
125
+ this.$nextTick(() => {
126
+ clearTimeout(this.timer);
127
+ this.timer = setTimeout(() => {
128
+ if (this.isresizing) {
129
+ return;
130
+ }
131
+ if (newVal.length < this.loadedIndex) {
132
+ this.loadedIndex = newVal.length;
133
+ }
134
+ this.resize(this.loadedIndex > 0 ? this.loadedIndex : null);
135
+ // discard code
136
+ // if (
137
+ // newVal.length > oldVal.length ||
138
+ // newVal.length > this.loadedIndex
139
+ // ) {
140
+ // // if (newVal.length === oldVal.length) {
141
+ // // this.resize(this.loadedIndex > 0 ? this.loadedIndex : null);
142
+ // // return;
143
+ // // }
144
+ // // this.resize(oldVal.length > 0 ? oldVal.length : null);
145
+ // }
146
+ }, 300);
147
+ });
148
+ },
149
+ },
150
+ methods: {
151
+ init() {
152
+ //initialize
153
+ this.root = this.$refs.vueWaterfall;
154
+ this.clearColumn();
155
+ var col = parseInt(this.col);
156
+ for (var i = 0; i < col; i++) {
157
+ let odiv = document.createElement("div");
158
+ odiv.className = "vue-waterfall-column";
159
+ if (this.width) {
160
+ odiv.style.width = this.width + "px";
161
+ if (i != 0) {
162
+ odiv.style.marginLeft = this.gutterWidth + "px";
163
+ }
164
+ this.columnWidth = this.width;
165
+ } else if (this.gutterWidth && !this.width) {
166
+ const width = Math.floor(
167
+ (this.root.offsetWidth - (col - 1) * this.gutterWidth) /
168
+ col
169
+ );
170
+ if (i != 0) {
171
+ odiv.style.marginLeft = this.gutterWidth + "px";
172
+ }
173
+ odiv.style.width = width + "px";
174
+ this.columnWidth = width;
175
+ } else {
176
+ odiv.style.width = 100 / parseInt(col) + "%";
177
+ this.columnWidth =
178
+ (100 / parseInt(col) / 100) *
179
+ document.documentElement.clientWidth;
180
+ }
181
+ if (!this.root) {
182
+ this.root = this.$refs.vueWaterfall;
183
+ }
184
+ this.root && this.root.appendChild(odiv);
185
+ this.columns.push(odiv);
186
+ }
187
+ this.resize();
188
+ },
189
+ async __setDomImageHeight(dom) {
190
+ if (!dom.getElementsByTagName) {
191
+ return;
192
+ }
193
+ var imgs = dom.getElementsByTagName("img");
194
+ for (var i = 0; i < imgs.length; i++) {
195
+ var lazySrc = imgs[i].getAttribute("lazy-src");
196
+ if (!imgs[i].getAttribute("src") && lazySrc) {
197
+ var newImg = new Image();
198
+ newImg.src = lazySrc;
199
+ if (newImg.complete) {
200
+ var trueWidth = imgs[i].offsetWidth || this.columnWidth;
201
+ var imgColumnHeight =
202
+ (newImg.height * trueWidth) / newImg.width;
203
+ if (trueWidth) {
204
+ imgs[i].style.height = imgColumnHeight + "px";
205
+ }
206
+ } else {
207
+ await new Promise((resolve, reject) => {
208
+ newImg.onload = function () {
209
+ var trueWidth =
210
+ imgs[i].offsetWidth || this.columnWidth;
211
+ var imgColumnHeight =
212
+ (newImg.height * trueWidth) / newImg.width;
213
+ if (trueWidth) {
214
+ imgs[i].style.height =
215
+ imgColumnHeight + "px";
216
+ }
217
+ resolve();
218
+ };
219
+ newImg.onerror = function () {
220
+ resolve();
221
+ };
222
+ });
223
+ }
224
+ }
225
+ }
226
+ },
227
+ async append(dom) {
228
+ //append dom element
229
+ var self = this;
230
+ if (this.columns.length > 0) {
231
+ let min = this.columns[0];
232
+ for (var i = 1; i < this.columns.length; i++) {
233
+ if (
234
+ (await self.__getHeight(min)) >
235
+ (await self.__getHeight(self.columns[i]))
236
+ ) {
237
+ min = self.columns[i];
238
+ }
239
+ }
240
+ await this.__setDomImageHeight(dom);
241
+ min && min.appendChild(dom);
242
+ }
243
+ },
244
+ checkImg(dom) {
245
+ //check has image
246
+ if (!dom) {
247
+ return false;
248
+ }
249
+ if (
250
+ dom.getElementsByTagName &&
251
+ dom.getElementsByTagName("img").length
252
+ ) {
253
+ return true;
254
+ } else {
255
+ return false;
256
+ }
257
+ },
258
+ async resize(index, elements) {
259
+ //resize and render
260
+ this.isresizing = true;
261
+ this.routeChanged = false; // 重置routeChanged
262
+ var self = this;
263
+ if (!this.$slots.default) {
264
+ this.isresizing = false;
265
+ return;
266
+ }
267
+ if (!index && index != 0 && !elements) {
268
+ elements = this.$slots.default;
269
+ this.loadedIndex = 0;
270
+ this.clear();
271
+ } else if (!elements) {
272
+ this.loadedIndex = index;
273
+ elements = this.$slots.default.splice(index);
274
+ }
275
+
276
+ for (var j = 0; j < elements.length; j++) {
277
+ if (this.routeChanged) {
278
+ console.warn("路由发生变化,<vue-waterfall>组件停止渲染");
279
+ break;
280
+ }
281
+ if (elements[j].elm && self.checkImg(elements[j].elm)) {
282
+ var imgs = elements[j].elm.getElementsByTagName("img");
283
+ var newImg = new Image();
284
+ newImg.src =
285
+ imgs[0].getAttribute("src") ||
286
+ imgs[0].getAttribute("lazy-src");
287
+ if (newImg.complete) {
288
+ await self.append(elements[j].elm);
289
+ self.lazyLoad(imgs);
290
+ } else {
291
+ await new Promise((resolve, reject) => {
292
+ newImg.onload = async function () {
293
+ await self.append(elements[j].elm);
294
+ self.lazyLoad(imgs);
295
+ resolve();
296
+ };
297
+ newImg.onerror = async function (e) {
298
+ await self.append(elements[j].elm);
299
+ self.lazyLoad(imgs);
300
+ resolve();
301
+ };
302
+ });
303
+ }
304
+ } else {
305
+ await self.append(elements[j].elm);
306
+ }
307
+ self.loadedIndex++;
308
+ }
309
+ this.isresizing = false;
310
+ self.$emit("finish");
311
+ },
312
+ computedPx(img, imgApi) {
313
+ img.style.width = imgApi.width / this.columnWidth;
314
+ },
315
+ lazyLoad(imgs) {
316
+ if (!imgs) {
317
+ if (!this.root) {
318
+ this.root = this.$refs.vueWaterfall;
319
+ }
320
+ imgs = this.root && this.root.getElementsByTagName("img");
321
+ }
322
+
323
+ if (!imgs || imgs.length < 0) {
324
+ return;
325
+ }
326
+ for (var index = 0; index < imgs.length; index++) {
327
+ if (
328
+ imgs[index].className.match("animation") &&
329
+ imgs[index].getAttribute("src")
330
+ ) {
331
+ continue;
332
+ } else if (
333
+ imgs[index].className.match("animation") &&
334
+ !imgs[index].getAttribute("src")
335
+ ) {
336
+ imgs[index].src = imgs[index].getAttribute("lazy-src");
337
+ imgs[index].removeAttribute("lazy-src");
338
+ } else if (
339
+ imgs[index].getAttribute("src") &&
340
+ !imgs[index].className.match("animation")
341
+ ) {
342
+ imgs[index].className =
343
+ imgs[index].className + " animation";
344
+ } else if (
345
+ !imgs[index].getAttribute("src") &&
346
+ imgs[index].getBoundingClientRect().top <
347
+ this.viewHeight + this.trueLazyDistance
348
+ ) {
349
+ imgs[index].src = imgs[index].getAttribute("lazy-src");
350
+ imgs[index].className =
351
+ imgs[index].className + " animation";
352
+ imgs[index].removeAttribute("lazy-src");
353
+ }
354
+ }
355
+ },
356
+ clearColumn() {
357
+ this.columns.forEach((item) => {
358
+ item.remove();
359
+ });
360
+ this.columns = [];
361
+ },
362
+ clear() {
363
+ this.columns.forEach((item) => {
364
+ item.innerHTML = "";
365
+ });
366
+ },
367
+ mix() {
368
+ var elements = this.$slots.default;
369
+ elements.sort(() => {
370
+ return Math.random() - 0.5;
371
+ });
372
+ this.resize(0, elements);
373
+ },
374
+ async __getHeight(dom) {
375
+ return dom.offsetHeight;
376
+ },
377
+ __emitLoadMore() {
378
+ if (!this.root) {
379
+ return;
380
+ }
381
+ var self = this;
382
+ const scrollTop = this.height
383
+ ? this.root.scrollTop
384
+ : document.documentElement.scrollTop || document.body.scrollTop;
385
+ const scrollHeight = this.height
386
+ ? this.root.scrollHeight
387
+ : document.documentElement.offsetHeight;
388
+
389
+ var diff = scrollHeight - scrollTop - this.viewHeight;
390
+ self.$emit("scroll", {
391
+ scrollHeight: scrollHeight,
392
+ scrollTop: scrollTop,
393
+ viewHeight: this.viewHeight,
394
+ clientHeight: self.clientHeight,
395
+ diff: diff,
396
+ time: Date.now(),
397
+ });
398
+ if (
399
+ diff < self.max &&
400
+ self.loadmore &&
401
+ scrollHeight > this.viewHeight
402
+ ) {
403
+ self.lastScrollTop = scrollTop;
404
+ self.loadmore = false;
405
+ self.$emit("loadmore");
406
+ } else if (diff >= self.max) {
407
+ self.loadmore = true;
408
+ }
409
+ clearTimeout(self.lazyTimeout);
410
+ self.lazyTimeout = setTimeout(function () {
411
+ self.lazyLoad();
412
+ }, 14);
413
+ },
414
+
415
+ // 监听路由是否发生变化
416
+ __listenRouterChange() {
417
+ // 重写pushState与replaceState事件函数
418
+ var _wr = function (type) {
419
+ // 记录原生事件
420
+ var orig = history[type];
421
+ return function () {
422
+ // 触发原生事件
423
+ var rv = orig.apply(this, arguments);
424
+ // 自定义事件
425
+ var e = new Event(type);
426
+ e.arguments = arguments;
427
+ // 触发自定义事件
428
+ window.dispatchEvent(e);
429
+ return rv;
430
+ };
431
+ };
432
+ const events = ["replaceState", "pushState"];
433
+ events.forEach((event) => {
434
+ window.addEventListener(event, () => {
435
+ this.routeChanged = true;
436
+ });
437
+ // 重写history
438
+ window.history[event] = _wr(event);
439
+ });
440
+ window.addEventListener("popstate", () => {
441
+ this.routeChanged = true;
442
+ });
443
+ },
444
+ },
445
+
446
+ destroyed() {
447
+ this.root && (this.root.onscroll = null);
448
+ this.root && (this.root.onresize = null);
449
+ window.onscroll = null;
450
+ window.onresize = null;
451
+ },
452
+ beforeCreate() {
453
+ // bus.$on("forceUpdate", () => {
454
+ // this.resize();
455
+ // });
456
+ // bus.$on("mix", () => {
457
+ // this.mix();
458
+ // });
459
+ },
460
+
461
+ mounted() {
462
+ this.__listenRouterChange();
463
+ this.$nextTick(() => {
464
+ this.init();
465
+ var self = this;
466
+ if (this.height) {
467
+ this.root.onscroll = function (e) {
468
+ self.__emitLoadMore();
469
+ };
470
+ this.root.addEventListener("touchmove", function () {
471
+ self.__emitLoadMore();
472
+ });
473
+ } else {
474
+ window.onscroll = function (e) {
475
+ self.__emitLoadMore();
476
+ };
477
+ document.addEventListener("touchmove", function () {
478
+ self.__emitLoadMore();
479
+ });
480
+ }
481
+ });
482
+ },
483
+ };
484
+ </script>
@@ -0,0 +1,106 @@
1
+ @import "../fonts/sjzl/iconfont.css";
2
+ @import "../fonts/common/iconfont.css";
3
+ @import "../fonts/kskpi/iconfont.css";
4
+ @import "./modules/common.scss";
5
+ @import "./modules/elementUI.scss";
6
+ @import "./modules/form.scss";
7
+ @import "./modules/header.scss";
8
+ @import "./modules/sidebar.scss";
9
+ @import "./modules/tree.scss";
10
+ @import "./modules/button.scss";
11
+ @import "./modules/table.scss";
12
+ @import "./modules/tabs.scss";
13
+ @import "./modules/tags.scss";
14
+ @import "./modules/color.scss";
15
+ @import "./modules/tree_check.scss";
16
+ @import "./layout.scss";
17
+
18
+ body{
19
+ color: #262626;
20
+ line-height: 1;
21
+ background: #f0f2f5;
22
+ font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif !important;
23
+ }
24
+ a:hover{
25
+ text-decoration: none;
26
+ }
27
+ .wrapper_bar{
28
+ position: absolute;
29
+ left: 0;
30
+ right: 0;
31
+ top: 0;
32
+ bottom: -17px;
33
+ // bottom: 0;
34
+ overflow: hidden;
35
+ }
36
+
37
+ .myBar,
38
+ .myBar .el-table--scrollable-x .el-table__body-wrapper ,
39
+ .myBar .el-table--scrollable-y .el-table__body-wrapper
40
+ {
41
+ &::-webkit-scrollbar-track-piece {
42
+ border-radius: 3px;
43
+ }
44
+ &::-webkit-scrollbar {
45
+ width: 6px;
46
+ height: 6px;
47
+ }
48
+ &::-webkit-scrollbar-thumb {
49
+ height: 10px;
50
+ background-color: rgba(144,147,153,.3);
51
+ border-radius: 7px;
52
+ }
53
+ }
54
+ .myBar .el-table--scrollable-x .el-table__body-wrapper,
55
+ .myBar .el-table--scrollable-y .el-table__body-wrapper {
56
+ &::-webkit-scrollbar {
57
+ height: 16px;
58
+ width: 16px;
59
+ }
60
+ }
61
+
62
+ .hover,.iconHover{
63
+ cursor: pointer;
64
+ @include themeColor('color','color');
65
+ &:hover{
66
+ @include themeColor('color','hover');
67
+ }
68
+ &:active{
69
+ @include themeColor('color','down');
70
+ }
71
+ }
72
+ .hover2{
73
+ cursor: pointer;
74
+ &:hover{
75
+ @include themeColor('color','hover');
76
+ }
77
+ &:active{
78
+ @include themeColor('color','down');
79
+ }
80
+ }
81
+
82
+ .color_active{
83
+ @include themeColor("color","color");
84
+ }
85
+
86
+ .mxplaceholder{
87
+ // width:50px;
88
+ min-width: 30px;
89
+ float: left;
90
+ height:30px;
91
+ background: #ccc;
92
+ margin-right: 10px;
93
+ border-radius: 3px;
94
+ }
95
+ .draggable_move{
96
+ background: #fff;
97
+ border: 1px solid #eee;
98
+ border-radius: 3px;
99
+ color: #2997ff;
100
+ font-size: 12px;
101
+ padding: 5px 10px;
102
+ cursor: pointer;
103
+ z-index: 3000;
104
+ width: auto !important;
105
+ height: auto !important;
106
+ }