large-model-component 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 (87) hide show
  1. package/.editorconfig +13 -0
  2. package/.env +2 -0
  3. package/.env.development +2 -0
  4. package/.env.production +2 -0
  5. package/.eslintignore +9 -0
  6. package/.eslintrc.js +7 -0
  7. package/.markdownlint.json +3 -0
  8. package/.markdownlintignore +7 -0
  9. package/.prettierrc.js +8 -0
  10. package/.stylelintignore +10 -0
  11. package/.stylelintrc.js +3 -0
  12. package/CHANGELOG.md +4 -0
  13. package/README.md +57 -0
  14. package/babel.config.js +3 -0
  15. package/commitlint.config.js +3 -0
  16. package/dist/css/248.e455a0b7.css +1 -0
  17. package/dist/css/712.3716bdaf.css +1 -0
  18. package/dist/css/792.3716bdaf.css +1 -0
  19. package/dist/demo.html +1 -0
  20. package/dist/img/ai-chart.167a7713.png +0 -0
  21. package/dist/img/scrol-bg.f446933a.png +0 -0
  22. package/dist/img/zhijing-model.6a81c5a7.png +0 -0
  23. package/dist/large-model-component.common.712.js +73 -0
  24. package/dist/large-model-component.common.712.js.map +1 -0
  25. package/dist/large-model-component.common.js +143384 -0
  26. package/dist/large-model-component.common.js.map +1 -0
  27. package/dist/large-model-component.css +1 -0
  28. package/dist/large-model-component.umd.792.js +73 -0
  29. package/dist/large-model-component.umd.792.js.map +1 -0
  30. package/dist/large-model-component.umd.js +143395 -0
  31. package/dist/large-model-component.umd.js.map +1 -0
  32. package/dist/large-model-component.umd.min.248.js +2 -0
  33. package/dist/large-model-component.umd.min.248.js.map +1 -0
  34. package/dist/large-model-component.umd.min.js +32 -0
  35. package/dist/large-model-component.umd.min.js.map +1 -0
  36. package/docs/.vuepress/config.js +30 -0
  37. package/docs/.vuepress/enhanceApp.js +7 -0
  38. package/docs/.vuepress/styles/palette.styl +3 -0
  39. package/docs/README.md +12 -0
  40. package/docs/comps/README.md +18 -0
  41. package/docs/comps/header.md +100 -0
  42. package/docs/config.md +0 -0
  43. package/docs/logs/README.md +42 -0
  44. package/f2elint.config.js +5 -0
  45. package/jsconfig.json +19 -0
  46. package/package.json +80 -0
  47. package/packages/index.js +27 -0
  48. package/packages/largeModel/contentFold.vue +221 -0
  49. package/packages/largeModel/index.js +2 -0
  50. package/packages/largeModel/index.vue +1703 -0
  51. package/packages/largeModel/pubsub.js +30 -0
  52. package/packages/largeModel/wsconnecter.js +60 -0
  53. package/public/index.html +17 -0
  54. package/src/App.vue +33 -0
  55. package/src/api/user.js +68 -0
  56. package/src/assets/css/app.css +3255 -0
  57. package/src/assets/css/base.css +3 -0
  58. package/src/assets/css/chunk-vendors.css +2071 -0
  59. package/src/assets/css/github-markdown.css +985 -0
  60. package/src/assets/img/ai-chart.png +0 -0
  61. package/src/assets/img/close.png +0 -0
  62. package/src/assets/img/delete.png +0 -0
  63. package/src/assets/img/fontawesome-webfont.912ec66d.svg +2671 -0
  64. package/src/assets/img/home-bg.png +0 -0
  65. package/src/assets/img/link.png +0 -0
  66. package/src/assets/img/message.png +0 -0
  67. package/src/assets/img/qas.png +0 -0
  68. package/src/assets/img/quick_finder_icon1.png +0 -0
  69. package/src/assets/img/quick_finder_icon2.png +0 -0
  70. package/src/assets/img/quick_finder_icon3.png +0 -0
  71. package/src/assets/img/quick_finder_icon4.png +0 -0
  72. package/src/assets/img/quizzer.png +0 -0
  73. package/src/assets/img/scrol-bg.png +0 -0
  74. package/src/assets/img/send.png +0 -0
  75. package/src/assets/img/serviceIcon.png +0 -0
  76. package/src/assets/img/zhijing-model.png +0 -0
  77. package/src/main.js +15 -0
  78. package/src/router/index.js +20 -0
  79. package/src/store/index.js +26 -0
  80. package/src/utils/auth.js +48 -0
  81. package/src/utils/index.js +111 -0
  82. package/src/utils/request.js +103 -0
  83. package/src/utils/spceialistConfig.js +44 -0
  84. package/src/utils/tool.js +4 -0
  85. package/src/utils/utils.js +56 -0
  86. package/src/utils/validate.js +20 -0
  87. package/vue.config.js +42 -0
@@ -0,0 +1,30 @@
1
+ class PubSub {
2
+ static instance = null;
3
+
4
+ constructor() {
5
+ if (PubSub.instance) {
6
+ throw new Error("Use PubSub.getInstance() instead");
7
+ }
8
+ this.events = {};
9
+ }
10
+
11
+ static getInstance() {
12
+ if (!PubSub.instance) {
13
+ PubSub.instance = new PubSub();
14
+ }
15
+ return PubSub.instance;
16
+ }
17
+
18
+ subscribe(event, callback) {
19
+ (this.events[event] || (this.events[event] = [])).push(callback);
20
+ return () => {
21
+ this.events[event] = this.events[event].filter(cb => cb !== callback);
22
+ };
23
+ }
24
+
25
+ publish(event, data) {
26
+ (this.events[event] || []).forEach(cb => cb(data));
27
+ }
28
+ }
29
+
30
+ export const pubsub = PubSub.getInstance();
@@ -0,0 +1,60 @@
1
+ export function WebSocketConnectMethod(config) {
2
+ // 定义socket连接方法类
3
+ let speechSocket;
4
+
5
+ const msgHandle = config.msgHandle;
6
+ const stateHandle = config.stateHandle;
7
+
8
+ this.wsStart = function () {
9
+ if ("WebSocket" in window) {
10
+ speechSocket = new WebSocket(config.wsUrl); // 定义socket连接对象
11
+
12
+ speechSocket.onopen = function (e) {
13
+ const request = {
14
+ chunk_size: [5, 20, 5],
15
+ wav_name: "wav_name",
16
+ is_speaking: true,
17
+ chunk_interval: 10,
18
+ itn: true,
19
+ mode: "2pass",
20
+ };
21
+ if (speechSocket.readyState === 1) {
22
+ // 0:CONNECTING, 1:OPEN, 2:CLOSING, 3:CLOSED
23
+ speechSocket.send(JSON.stringify(request));
24
+ }
25
+ };
26
+
27
+ speechSocket.onclose = function (e) {
28
+ stateHandle(3, e);
29
+ };
30
+ speechSocket.onmessage = function (e) {
31
+ msgHandle(e);
32
+ };
33
+ speechSocket.onerror = function (e) {
34
+ stateHandle(2, e);
35
+ };
36
+ return 1;
37
+ } else {
38
+ return 0;
39
+ }
40
+ };
41
+
42
+ // 定义停止与发送函数
43
+ this.wsStop = function () {
44
+ if (speechSocket != undefined) {
45
+ speechSocket.close();
46
+ }
47
+ };
48
+
49
+ this.wsSend = function (oneData) {
50
+ if (speechSocket == undefined) return;
51
+ if (speechSocket.readyState === 1) {
52
+ // 0:CONNECTING, 1:OPEN, 2:CLOSING, 3:CLOSED
53
+ speechSocket.send(oneData);
54
+ }
55
+ };
56
+
57
+ this.readyState = function () {
58
+ return speechSocket.readyState;
59
+ };
60
+ }
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html lang="">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
+ <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
+ <title><%= htmlWebpackPlugin.options.title %></title>
9
+ </head>
10
+ <body>
11
+ <noscript>
12
+ <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13
+ </noscript>
14
+ <div id="app"></div>
15
+ <!-- built files will be auto injected -->
16
+ </body>
17
+ </html>
package/src/App.vue ADDED
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <div id="app">
3
+ <largeModel />
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ import largeModel from "@pack/largeModel";
9
+ export default {
10
+ name: 'App',
11
+ components: {
12
+ largeModel
13
+ },
14
+ data() {
15
+ return {
16
+ };
17
+ },
18
+ methods: {
19
+ },
20
+ };
21
+ </script>
22
+
23
+ <style lang="scss" scope>
24
+ #app {
25
+ font-family: Avenir, Helvetica, Arial, sans-serif;
26
+ -webkit-font-smoothing: antialiased;
27
+ -moz-osx-font-smoothing: grayscale;
28
+ }
29
+ .column {
30
+ padding-left: 10px;
31
+ padding-right: 20px;
32
+ }
33
+ </style>
@@ -0,0 +1,68 @@
1
+ import request from '@/utils/request';
2
+ // 登录:获取token
3
+ export function loginCas(data) {
4
+ return request({
5
+ url: `/gateway/intelligent/graph/user/login/cas?ticket=` + data.ticket +'&service='+ data.serviceUrl,
6
+ // url: `/user/login/cas?ticket=` + data.ticket +'&service='+ data.serviceUrl,
7
+ method: 'get',
8
+ });
9
+ }
10
+ // 临时生成token
11
+ export function userToken(data) {
12
+ return request({
13
+ url: `/gateway/intelligent/graph/user/generate-token`,
14
+ method: 'post',
15
+ params: data
16
+ });
17
+ }
18
+ // 获取建议的问题
19
+ export function suggestive(data) {
20
+ return request({
21
+ url: '/gateway/intelligent/graph/talkbot/suggestive/query',
22
+ method: 'get',
23
+ data
24
+ });
25
+ }
26
+ // 查询历史对话列表
27
+ export function conversationPage(data) {
28
+ return request({
29
+ url: `/gateway/intelligent/graph/talkbot/conversation/page`,
30
+ // url: `/talkbot/conversation/page`,
31
+ method: 'post',
32
+ data,
33
+ });
34
+ }
35
+ // 查询历史对话详情
36
+ export function historyDetail(data) {
37
+ return request({
38
+ url: `/gateway/intelligent/graph/talkbot/history/${data}`,
39
+ // url: `/talkbot/history/${data}`,
40
+ method: 'get',
41
+ data,
42
+ });
43
+ }
44
+ // 删除历史对话
45
+ export function deleteHistory(data) {
46
+ return request({
47
+ url: `/gateway/intelligent/graph/talkbot/conversation/${data}`,
48
+ // url: `/talkbot/conversation/${data}`,
49
+ method: 'delete',
50
+ });
51
+ }
52
+ // 快捷访问列表
53
+ export function quickAccess(data) {
54
+ return request({
55
+ url: `/gateway/intelligent/graph/talkbot/quick-access/list`,
56
+ method: 'get',
57
+ data,
58
+ });
59
+ }
60
+ // 点赞与踩
61
+ export function votePort(data) {
62
+ return request({
63
+ url: `/gateway/intelligent/graph/talkbot/vote`,
64
+ method: 'post',
65
+ data,
66
+ });
67
+ }
68
+