@gonsin/gview 1.0.1-alpha.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 (69) hide show
  1. package/.browserslistrc +2 -0
  2. package/README.md +26 -0
  3. package/babel.config.js +5 -0
  4. package/package.json +29 -0
  5. package/postcss.config.js +5 -0
  6. package/public/css/theme/animate.min.css +7 -0
  7. package/public/css/theme/brownishTheme.css +10 -0
  8. package/public/css/theme/coffeeTheme.css +10 -0
  9. package/public/css/theme/cyanTheme.css +10 -0
  10. package/public/css/theme/defaultTheme.css +10 -0
  11. package/public/css/theme/greenTheme.css +16 -0
  12. package/public/css/theme/greyTheme.css +10 -0
  13. package/public/css/theme/orangeTheme.css +10 -0
  14. package/public/css/theme/purpleTheme.css +10 -0
  15. package/public/css/theme/skyblueTheme.css +10 -0
  16. package/public/favicon.ico +0 -0
  17. package/public/imgs/antOutline-border.png +0 -0
  18. package/public/imgs/bg.png +0 -0
  19. package/public/imgs/logo.png +0 -0
  20. package/public/imgs/menu.png +0 -0
  21. package/public/index.html +17 -0
  22. package/src/App.vue +143 -0
  23. package/src/api/api.js +28 -0
  24. package/src/api/index.js +31 -0
  25. package/src/api/request.js +210 -0
  26. package/src/assets/font/font.scss +12 -0
  27. package/src/assets/font/font_dev.scss +12 -0
  28. package/src/assets/font/icon.scss +179 -0
  29. package/src/assets/images/svg/color.svg +1 -0
  30. package/src/assets/logo.png +0 -0
  31. package/src/assets/scss/common.scss +338 -0
  32. package/src/assets/scss/themeColor.scss +35 -0
  33. package/src/components/MyDialog.vue +251 -0
  34. package/src/components/MyForm.vue +324 -0
  35. package/src/components/MyFormAutocomplete.vue +135 -0
  36. package/src/components/MyFormCascader.vue +107 -0
  37. package/src/components/MyFormCheckBox.vue +67 -0
  38. package/src/components/MyFormEditor.vue +85 -0
  39. package/src/components/MyFormInput.vue +68 -0
  40. package/src/components/MyFormLine.vue +49 -0
  41. package/src/components/MyFormRadio.vue +92 -0
  42. package/src/components/MyFormSelect.vue +122 -0
  43. package/src/components/MyFormSelectDate.vue +72 -0
  44. package/src/components/MyFormSelectDateTime.vue +82 -0
  45. package/src/components/MyFormSelectTime.vue +84 -0
  46. package/src/components/MyFormSwitch.vue +60 -0
  47. package/src/components/MyFormTag.vue +67 -0
  48. package/src/components/MyFormTree.vue +137 -0
  49. package/src/components/MyFormUploads.vue +91 -0
  50. package/src/components/MyHeader.vue +176 -0
  51. package/src/components/MyMenus.vue +150 -0
  52. package/src/components/MyPageHeader.vue +344 -0
  53. package/src/components/MyTab.vue +69 -0
  54. package/src/components/MyTable.vue +245 -0
  55. package/src/components/Templatess.vue +630 -0
  56. package/src/index.js +23 -0
  57. package/src/main.js +86 -0
  58. package/src/router.js +52 -0
  59. package/src/store/index.js +71 -0
  60. package/src/utils/common.js +96 -0
  61. package/src/utils/permission.js +36 -0
  62. package/src/views/GView.vue +185 -0
  63. package/src/views/Home.vue +26 -0
  64. package/src/views/Login.vue +249 -0
  65. package/src/websocket/test.js +140 -0
  66. package/src/websocket/websocket.js +141 -0
  67. package/src/websocket/websocket1.js +117 -0
  68. package/src/websocket/websocket2.js +128 -0
  69. package/vue.config.js +42 -0
@@ -0,0 +1,128 @@
1
+ /*
2
+ * @Author: lzx lzx@gonsin.cn
3
+ * @Date: 2022-06-27 13:55:43
4
+ * @LastEditors: lzx lzx@gonsin.cn
5
+ * @LastEditTime: 2022-06-28 14:03:34
6
+ * @FilePath: \client\src\websocket\websocket.js
7
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
+ */
9
+ import { mapActions } from "vuex";
10
+
11
+ export const data = {
12
+ //websocket
13
+ ip: process.env.NODE_ENV !== 'development' ? window.location.origin.replace(window.location.protocol, pre) + '/gview/websocket' : "http://192.168.2.192:8089/gview/websocket".replace('http', 'ws'),
14
+ webSocket: null,
15
+ lockReconnect: false,
16
+ tt: false,
17
+ sendParams: {
18
+ head: "gonsin",
19
+ cmd: {
20
+ cmd: "client",
21
+ subcmd: "heart",
22
+ respone: 0,
23
+ },
24
+ args: {},
25
+ },
26
+ // 心跳发送指令,超过40s未发送则断开连接
27
+ //心跳检测
28
+ heartCheck: null,
29
+ timeoutObj: null,
30
+ serverTimeoutObj: null,
31
+ }
32
+ export const initWebSocket =()=> {
33
+ try {
34
+ if (typeof WebSocket === "undefined") {
35
+ alert("您的浏览器不支持WebSocket,请尽快升级");
36
+ } else {
37
+ console.log(data.ip)
38
+ data.webSocket = new WebSocket(data.ip);
39
+ init(); // 封装有websocket监听方法
40
+ }
41
+ } catch (error) {
42
+ console.log(error);
43
+ }
44
+ }
45
+ export const init =()=> {
46
+
47
+ data.webSocket.onopen = () => {
48
+ // this.$notify.success('Websocket successfully connected')
49
+ console.log("webSocket连接成功至:" + data.ip);
50
+ clearInterval(data.timeoutObj);
51
+ clearTimeout(data.serverTimeoutObj);
52
+ let model = {
53
+ head: "gonsin",
54
+ cmd: {
55
+ cmd: "client",
56
+ subcmd: "heart",
57
+ respone: 0,
58
+ },
59
+ args: {},
60
+ };
61
+ data.timeoutObj = setInterval(function () {
62
+ //这里发送一个心跳,后端收到后,返回一个心跳消息,
63
+ //onmessage拿到返回的心跳就说明连接正常
64
+ data.webSocket.send(JSON.stringify(model));
65
+ }, 40000);
66
+ // // 连接成功,注册dataId
67
+ // that.registerMessage();
68
+ };
69
+ data.webSocket.onmessage = (msg) => {
70
+ console.log("onmessage....................");
71
+ // console.log('on_message:',msg);
72
+ let data = JSON.parse(msg.data);
73
+
74
+ };
75
+ data.webSocket.onerror = () => {
76
+ console.log("websocket连接错误...");
77
+ };
78
+ data.webSocket.onclose = () => {
79
+ console.log("websocket断开连接...");
80
+ };
81
+ }
82
+ /**
83
+ * 注册站内信指令
84
+ */
85
+ export const registerMessage=(dataId, fun)=> {
86
+ console.log(this.$store)
87
+ let params = {
88
+ head: "gonsin",
89
+ cmd: {
90
+ cmd: "gview_client",
91
+ subcmd: "register",
92
+ },
93
+ args: {
94
+ dataId: dataId,
95
+ },
96
+ };
97
+ // data.webSocket.send(JSON.stringify(params));
98
+ // this.$store.dispatch('setUpdateFunction', dataId,fun);
99
+ }
100
+ /**
101
+ * 注销站内信指令
102
+ */
103
+ export const unregisterMessage =(dataId)=> {
104
+ let params = {
105
+ head: "gonsin",
106
+ cmd: {
107
+ cmd: "gview_client",
108
+ subcmd: "unregister",
109
+ },
110
+ args: {
111
+ dataId: dataId,
112
+ },
113
+ };
114
+ data.webSocket.send(JSON.stringify(params));
115
+ }
116
+ /**
117
+ * 处理站内消息回调
118
+ */
119
+ export const handleMessageCallback =(data)=> {
120
+ console.log(data);
121
+ console.log("处理站内消息................");
122
+ this.$notify({
123
+ title: data.args.message,
124
+ message: data.args.message,
125
+ type: "success",
126
+ offset: 100,
127
+ });
128
+ }
package/vue.config.js ADDED
@@ -0,0 +1,42 @@
1
+ /*
2
+ * @Author: your name
3
+ * @Date: 2020-06-30 18:26:00
4
+ * @LastEditTime: 2022-11-28 14:30:14
5
+ * @LastEditors: lrm lrm@gonsin.cn
6
+ * @Description: In User Settings Edit
7
+ * @FilePath: \client\vue.config.js
8
+ */
9
+ module.exports = {
10
+ lintOnSave: false,
11
+ // assetsDir: 'static', // 配置js、css静态资源二级目录的位置
12
+ // publicPath:'./',
13
+ productionSourceMap: false, // 生产环境不生成.map文件
14
+ devServer:{
15
+ port:8085, //端口
16
+ // open:false, //编译完成后是否自动打开浏览器
17
+ proxy:{ // 本地环境代理
18
+ '/api':{
19
+ target:'http://192.168.2.192:8088',
20
+ // target:'http://192.168.2.153:8088',
21
+ // target:'http://192.168.2.194:8888',
22
+ // target:'http://192.168.2.162:8088'
23
+ changeOrigin:true,
24
+ disableHostCheck: false, // 新增该配置项
25
+ // pathRewrite:{
26
+ // '/api':''
27
+ // }
28
+ },
29
+ '/restapi':{
30
+ target:'http://192.168.2.192:8088',
31
+ // target:'http://192.168.2.153:8088',
32
+ // target:'http://192.168.2.194:8888',
33
+ // target:'http://192.168.2.162:8088',
34
+ changeOrigin:true,
35
+ disableHostCheck: false, // 新增该配置项
36
+ // pathRewrite:{
37
+ // '/api':''
38
+ // }
39
+ }
40
+ }
41
+ },
42
+ }