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,173 @@
1
+ import axios from "axios";
2
+ import crypto from "../scripts/crypto"
3
+ import router from '@/router'
4
+ // //不加密接口
5
+ let NoEncryptList = [
6
+ ]
7
+ // //必加密接口
8
+ let encryptList = [
9
+ ]
10
+ let http = axios.create({
11
+ // baseURL: '',
12
+ headers: {
13
+ // 'Content-Type': 'application/json;charset=utf-8'
14
+ },
15
+ });
16
+ http.pending = []; //声明一个数组用于存储每个ajax请求的取消函数和ajax标识
17
+ let cancelToken = axios.CancelToken;
18
+ http.removePending = config => {
19
+ // console.log(http.pending)
20
+ for (var i = 0; i < http.pending.length; i++) {
21
+ var p = http.pending[i];
22
+ p.f(); //执行取消操作
23
+ }
24
+ http.pending = [];
25
+ };
26
+
27
+ http.interceptors.request.use(
28
+ function (config) {
29
+ config.cancelToken = new cancelToken(c => {
30
+ http.pending.push({ f: c });
31
+ });
32
+
33
+ // if(config.url !=){}
34
+ // console.log(config);
35
+
36
+
37
+
38
+ let ts = crypto.timestamp()
39
+ // 签名key
40
+ let nonce = crypto.randomString(16);
41
+ // 加密后的签名key
42
+ // 随机字符串
43
+ let key = crypto.RSAencrypt(nonce,window._zgy.publicKeyServer);
44
+
45
+ // console.log("ts",ts);
46
+ // console.log('key',key);
47
+ // console.log('nonce',nonce);
48
+ // console.log(config);
49
+ let token = Cookies.get("gy_token") ? Cookies.get("gy_token") : '';
50
+
51
+ let params =''
52
+ if(config.method==='post'){
53
+ params =config.data;
54
+ }
55
+ else if(config.method==='get'){
56
+ params = config.params
57
+ }
58
+ // 签名串
59
+ let signstr = crypto.sign(token, ts , params , key , nonce).toUpperCase();
60
+ config.headers = {
61
+ ts,
62
+ sign: signstr,
63
+ token,
64
+ key: key,
65
+ };
66
+ if(defaultConfig.safeLevel == 1){
67
+ let isFind = NoEncryptList.find(url => config.url == interfaceUrl+url);
68
+ if(!isFind){
69
+ if(config.method==='post'){
70
+ if(config.data) {
71
+ config.data = {data : crypto.encrypt(JSON.stringify(config.data))}
72
+ }
73
+ }
74
+ else if(config.method==='get'){
75
+ // console.log(crypto.encrypt(JSON.stringify(config.params)));
76
+ if(config.params){
77
+ config.params = {
78
+ data:crypto.encrypt(JSON.stringify(config.params))
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ else {
85
+ let isFind = encryptList.find(url => config.url == interfaceUrl+url);
86
+ if(isFind){
87
+ if(config.method==='post'){
88
+ if(config.data) {
89
+ config.data = {data : crypto.encrypt(JSON.stringify(config.data))}
90
+ }
91
+ }
92
+ else if(config.method==='get'){
93
+ // console.log(crypto.encrypt(JSON.stringify(config.params)));
94
+ if(config.params){
95
+ config.params = {
96
+ data:crypto.encrypt(JSON.stringify(config.params))
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+
104
+
105
+
106
+
107
+ return config;
108
+ },
109
+ function (error) {
110
+ //请求错误时做些事
111
+ return "";
112
+ // return Promise.reject(error);
113
+ }
114
+ );
115
+
116
+ // 添加响应拦截器
117
+ http.interceptors.response.use(
118
+ function (response) {
119
+ // 对响应数据做点什么
120
+
121
+ if(defaultConfig.safeLevel == 1){
122
+ let isFind = NoEncryptList.find(url => response.config.url == interfaceUrl+url);
123
+ if(!isFind){
124
+
125
+ response.data = JSON.parse(crypto.decrypt(response.data.data));
126
+ }
127
+ }
128
+ else {
129
+ let isFind = encryptList.find(url => response.config.url == interfaceUrl+url);
130
+ if(isFind){
131
+ response.data = JSON.parse(crypto.decrypt(response.data.data));
132
+ }
133
+ }
134
+
135
+ let statusArr = [1005,1006,1007];
136
+ let isStatus = statusArr.find(i => i == response.data.status);
137
+ if(isStatus){
138
+ Cookies.remove('gy_login');
139
+ Cookies.remove('gy_token');
140
+ router.push({
141
+ path: '/login',
142
+ query: {
143
+ redirect: router.app.$route.fullPath.slice(1)
144
+ }
145
+ })
146
+ http.removePending(response.config);
147
+ }
148
+ else if(response.data.status == 401){
149
+ userInfo = null;
150
+ Cookies.remove('gy_login');
151
+ Cookies.remove('gy_token');
152
+ router.push({name:'noAccess'})
153
+ }
154
+ return response.data;
155
+ },
156
+ function (error) {
157
+ return "";
158
+ // 对响应错误做点什么
159
+ // return Promise.reject(error);
160
+ }
161
+ );
162
+
163
+ http.all = function (callback) {
164
+ callback(axios);
165
+ };
166
+
167
+ export default {
168
+ install: function (vm,options) {
169
+ NoEncryptList = options.NoEncryptList
170
+ encryptList = options.encryptList
171
+ vm.prototype.$http = http;
172
+ }
173
+ };
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Vue的插件,用来获取和设置localStorage存储
3
+ **/
4
+ const formatTime = function(date, fmt='yyyy-MM-dd HH:mm:ss'){
5
+ if (date == null || date == "") {
6
+ return "";
7
+ } else if (typeof date === 'string') {
8
+ // console.log(date)
9
+ date = date.replace(/-/g, '/');
10
+ date = date.split('.')[0];
11
+ date = new Date(date);
12
+ }
13
+ // console.log(date)
14
+ // alert(date.getMonth())
15
+ var o = {
16
+ "M+": date.getMonth() + 1, //月份
17
+ "d+": date.getDate(), //日
18
+ "h+": date.getHours() % 12 == 0 ? 12 : date.getHours() % 12, //小时
19
+ "H+": date.getHours(), //小时
20
+ "m+": date.getMinutes(), //分
21
+ "s+": date.getSeconds(), //秒
22
+ "q+": Math.floor((date.getMonth() + 3) / 3), //季度
23
+ "S": date.getMilliseconds() //毫秒
24
+ };
25
+ // console.log(o);
26
+ var week = {
27
+ "0": "/u65e5",
28
+ "1": "/u4e00",
29
+ "2": "/u4e8c",
30
+ "3": "/u4e09",
31
+ "4": "/u56db",
32
+ "5": "/u4e94",
33
+ "6": "/u516d"
34
+ };
35
+ if (/(y+)/.test(fmt)) {
36
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
37
+ }
38
+ if (/(E+)/.test(fmt)) {
39
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length > 1 ? RegExp.$1.length > 2 ? "/u661f/u671f" : "/u5468" : "") + week[date.getDay() + ""]);
40
+ }
41
+ for (var k in o) {
42
+ if (new RegExp("(" + k + ")").test(fmt)) {
43
+ fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
44
+ }
45
+ }
46
+
47
+ return fmt;
48
+ }
49
+ export default {
50
+ install: function(vm) {
51
+ vm.prototype.$formatTime = formatTime;
52
+ }
53
+ };
54
+
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/img/mrtx.jpg ADDED
Binary file
package/img/slogan.png ADDED
Binary file
Binary file
Binary file
Binary file
package/index.js ADDED
@@ -0,0 +1,17 @@
1
+ // npm publish 发布
2
+ // npm adduser 登录
3
+ // npm login 登录
4
+
5
+ // 版本号 x.y.z :
6
+ //其中z 表示一些小的bugfix, 更改z的号,
7
+ // y表示一些大的版本更改,比如一些API的变化
8
+ // x表示一些设计的变动及模块的重构之类的,会升级x版本号
9
+ // 在package.json里面dependencies依赖包的版本号前面的符号有两种,一种是~,一种是^。
10
+ // ~的意思是匹配最近的小版本 比如~1.0.2将会匹配所有的1.0.x版本,但不匹配1.1.0
11
+ // ^的意思是最近的一个大版本 比如1.0.2 将会匹配 所有 1.x.x, 但不包括2.x.x
12
+ // * 这意味着安装最新版本的依赖包
13
+ // 已使用项目 指标管理
14
+
15
+ module.exports = {
16
+ version :'1.0.0',
17
+ }
package/jsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "module": "esnext",
5
+ "baseUrl": "./",
6
+ "moduleResolution": "node",
7
+ "paths": {
8
+ "@/*": [
9
+ "src/*"
10
+ ]
11
+ },
12
+ "lib": [
13
+ "esnext",
14
+ "dom",
15
+ "dom.iterable",
16
+ "scripthost"
17
+ ]
18
+ }
19
+ }
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "gy-webcode2",
3
+ "version": "1.0.0",
4
+ "description": "gy前端公共代码",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "lizhi",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "codemirror": "^5.48.0",
13
+ "crypto-js": "^3.1.0"
14
+ }
15
+ }