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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/src/main.js ADDED
@@ -0,0 +1,15 @@
1
+ import Vue from 'vue'
2
+ import App from './App.vue'
3
+ import ElementUI from "element-ui";
4
+ import "element-ui/lib/theme-chalk/index.css";
5
+ import 'highlight.js/styles/github.css'
6
+ import store from './store'
7
+ import router from './router'
8
+ Vue.config.productionTip = false
9
+ import '@/assets/css/base.css'
10
+ Vue.use(ElementUI);
11
+ new Vue({
12
+ store,
13
+ router,
14
+ render: h => h(App),
15
+ }).$mount('#app')
@@ -0,0 +1,20 @@
1
+ import Vue from 'vue';
2
+ import VueRouter from 'vue-router';
3
+
4
+ Vue.use(VueRouter);
5
+
6
+ const routes = [
7
+ {
8
+ path: '/',
9
+ name: 'Home',
10
+ component: () => import('@/App.vue')
11
+ }
12
+ ];
13
+
14
+ const router = new VueRouter({
15
+ mode: 'history',
16
+ base: process.env.BASE_URL,
17
+ routes
18
+ });
19
+
20
+ export default router;
@@ -0,0 +1,26 @@
1
+ import Vue from 'vue';
2
+ import Vuex from 'vuex';
3
+
4
+ Vue.use(Vuex);
5
+
6
+ export default new Vuex.Store({
7
+ state: {
8
+ userInfo: null,
9
+ siteConfig: {
10
+ aiUrl: '',
11
+ loginUrl: ''
12
+ }
13
+ },
14
+ getters: {
15
+ 'industrial-access-token': () => localStorage.getItem('Industrial-Access-Token')
16
+ },
17
+ mutations: {
18
+ SET_USER_INFO(state, userInfo) {
19
+ state.userInfo = userInfo;
20
+ },
21
+ SET_SITE_CONFIG(state, config) {
22
+ state.siteConfig = config;
23
+ }
24
+ },
25
+ actions: {}
26
+ });
@@ -0,0 +1,48 @@
1
+ import utils from '@/utils/utils';
2
+ import Cookies from 'js-cookie';
3
+ export function setToken(value) {
4
+ Cookies.set('industrial-access-token', value);
5
+ }
6
+ export function getToken() {
7
+ return Cookies.get('industrial-access-token');
8
+ }
9
+ export function removeToken() {
10
+ Cookies.remove('industrial-access-token');
11
+ }
12
+ // 公共存储方法
13
+ export function setByLocalStorage(key, value) {
14
+ localStorage.setItem(key, value);
15
+ }
16
+ export function getByLocalStorage(key) {
17
+ return localStorage.getItem(key);
18
+ }
19
+ export function removeByLocalStorage(key) {
20
+ return localStorage.removeItem(key);
21
+ }
22
+ export function removeAllByLocalStorage() {
23
+ localStorage.clear();
24
+ }
25
+ export function cleanCode(func, route) {
26
+ setTimeout(() => {
27
+ // const newUrl = window.location.origin;
28
+ const newUrl = utils.dealPath(process.env.VUE_APP_DEFAULT_REDIRECTURL_URL);
29
+ window.history.replaceState({ path: newUrl }, '', newUrl);
30
+ console.log('----newUrl------', newUrl);
31
+ func(route);
32
+ });
33
+ }
34
+ export function pathHandle(data) {
35
+ let path = process.env[data];
36
+ if (process.env.NODE_ENV != 'development') {
37
+ path = window.location.origin + path;
38
+ }
39
+ return path;
40
+ }
41
+
42
+ export function routerParams(params) {
43
+ let data = [];
44
+ for (let i in params) {
45
+ data.push(i + '=' + params[i]);
46
+ }
47
+ return data.length > 0 ? '?' + data.join('&') : '';
48
+ }
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Created by PanJiaChen on 16/11/18.
3
+ */
4
+
5
+ /**
6
+ * Parse the time to string
7
+ * @param {(Object|string|number)} time
8
+ * @param {string} cFormat
9
+ * @returns {string | null}
10
+ */
11
+ export function parseTime(time, cFormat) {
12
+ if (arguments.length === 0 || !time) {
13
+ return null;
14
+ }
15
+ const format = cFormat || "{y}-{m}-{d} {h}:{i}:{s}";
16
+ let date;
17
+ if (typeof time === "object") {
18
+ date = time;
19
+ } else {
20
+ if (typeof time === "string") {
21
+ if (/^[0-9]+$/.test(time)) {
22
+ // support "1548221490638"
23
+ time = parseInt(time);
24
+ } else {
25
+ // support safari
26
+ // https://stackoverflow.com/questions/4310953/invalid-date-in-safari
27
+ time = time.replace(new RegExp(/-/gm), "/");
28
+ }
29
+ }
30
+
31
+ if (typeof time === "number" && time.toString().length === 10) {
32
+ time *= 1000;
33
+ }
34
+ date = new Date(time);
35
+ }
36
+ const formatObj = {
37
+ y: date.getFullYear(),
38
+ m: date.getMonth() + 1,
39
+ d: date.getDate(),
40
+ h: date.getHours(),
41
+ i: date.getMinutes(),
42
+ s: date.getSeconds(),
43
+ a: date.getDay(),
44
+ };
45
+ const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
46
+ const value = formatObj[key];
47
+ // Note: getDay() returns 0 on Sunday
48
+ if (key === "a") {
49
+ return ["日", "一", "二", "三", "四", "五", "六"][value];
50
+ }
51
+ return value.toString().padStart(2, "0");
52
+ });
53
+ return time_str;
54
+ }
55
+
56
+ /**
57
+ * @param {number} time
58
+ * @param {string} option
59
+ * @returns {string}
60
+ */
61
+ export function formatTime(time, option) {
62
+ if (`${time}`.length === 10) {
63
+ time = parseInt(time) * 1000;
64
+ } else {
65
+ time = +time;
66
+ }
67
+ const d = new Date(time);
68
+ const now = Date.now();
69
+
70
+ const diff = (now - d) / 1000;
71
+
72
+ if (diff < 30) {
73
+ return "刚刚";
74
+ } else if (diff < 3600) {
75
+ // less 1 hour
76
+ return `${Math.ceil(diff / 60)}分钟前`;
77
+ } else if (diff < 3600 * 24) {
78
+ return `${Math.ceil(diff / 3600)}小时前`;
79
+ } else if (diff < 3600 * 24 * 2) {
80
+ return "1天前";
81
+ }
82
+ if (option) {
83
+ return parseTime(time, option);
84
+ } else {
85
+ return `${
86
+ d.getMonth() + 1
87
+ }月${d.getDate()}日${d.getHours()}时${d.getMinutes()}分`;
88
+ }
89
+ }
90
+
91
+ /**
92
+ * @param {string} url
93
+ * @returns {Object}
94
+ */
95
+ export function param2Obj(url) {
96
+ const search = decodeURIComponent(url.split("?")[1]).replace(/\+/g, " ");
97
+ if (!search) {
98
+ return {};
99
+ }
100
+ const obj = {};
101
+ const searchArr = search.split("&");
102
+ searchArr.forEach((v) => {
103
+ const index = v.indexOf("=");
104
+ if (index !== -1) {
105
+ const name = v.substring(0, index);
106
+ const val = v.substring(index + 1, v.length);
107
+ obj[name] = val;
108
+ }
109
+ });
110
+ return obj;
111
+ }
@@ -0,0 +1,103 @@
1
+ import axios from 'axios';
2
+ import router from '@/router';
3
+ import { Message } from 'element-ui';
4
+ import store from '@/store';
5
+ import utils from '@/utils/utils';
6
+ import { getToken } from '@/utils/auth';
7
+
8
+ const codeMsg = {
9
+ 200: '请求成功',
10
+ 400: '错误请求(400)',
11
+ 401: '未授权,请重新登录(401)',
12
+ 403: '拒绝访问(403)',
13
+ 404: '未找到资源(404)',
14
+ 500: '服务器错误(500)',
15
+ 5001: '当前域暂未开通,请联系管理员',
16
+ };
17
+ // create an axios instance
18
+ const service = axios.create({
19
+ baseURL: utils.dealPath(process.env.VUE_APP_BASE_API), // url = base url + request url
20
+ timeout: process.env.VUE_APP_TIME_OUT || 5000, // 超时时间
21
+ });
22
+
23
+ // 接口请求拦截器
24
+ service.interceptors.request.use(
25
+ (config) => {
26
+ /*if (store.getters['industrial-access-token']) {
27
+ config.headers.Authorization = getToken() ? `bearer ${getToken()}` : '';
28
+ }*/
29
+ // config.headers.Authorization = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6Ijc4NjE0ZjIwLWQ4M2ItNDFhMy1hYTBjLWVjYjU5YTZiMTFmYSJ9.nkxUa_MB4G8NGdeQtpGFTdSnvuK1jUCO4dfKUMHi10VxgEjXU-BkyHG_-eEUOod1lPoBLvIWxDPtoX-P4l52mw';
30
+ config.headers = {
31
+ ...config.headers,
32
+ "Industrial-Access-Token": localStorage.getItem('Industrial-Access-Token'),
33
+ }
34
+ // console.log('config.headers==>',config.headers)
35
+ return config;
36
+ },
37
+ (error) => {
38
+ console.log(error);
39
+ return Promise.reject(error);
40
+ },
41
+ );
42
+
43
+ // 接口响应拦截器
44
+ service.interceptors.response.use(
45
+ (response) => {
46
+ const { code, msg, success } = response.data;
47
+
48
+ if (code === 200 || code === 20000 || code === 20001 || msg === '处理成功' || success === 'success') {
49
+ // 请求成功是根据原来接口判断的,后期会改
50
+ return response;
51
+ } else if (code === 400 || code === 404 || code === 500) {
52
+ Message({
53
+ message: msg || codeMsg[code],
54
+ type: 'error',
55
+ duration: 5 * 1000,
56
+ });
57
+ return Promise.reject(new Error(msg || 'Error'));
58
+ } else if (code === 401) {
59
+ Message({
60
+ message: msg || codeMsg[code],
61
+ type: 'error',
62
+ duration: 5 * 1000,
63
+ });
64
+ // 走退出逻辑---> 重新登陆
65
+ } else if (code === 40004) {
66
+ return response;
67
+ } else if (code === 5001) {
68
+ Message({
69
+ message: msg || codeMsg[code],
70
+ type: 'error',
71
+ duration: 5 * 1000,
72
+ });
73
+ router.push('/default');
74
+ } else if (code === 403) {
75
+ Message({
76
+ message: msg || codeMsg[code],
77
+ type: 'error',
78
+ duration: 5 * 1000,
79
+ });
80
+ router.push('/refuse');
81
+ } else {
82
+ Message({
83
+ message: '链接错误',
84
+ type: 'error',
85
+ duration: 5 * 1000,
86
+ });
87
+ return response;
88
+ }
89
+ },
90
+ (error) => {
91
+ console.log(`err${error}`); // for debug
92
+ Message({
93
+ message: error.msg,
94
+ type: 'error',
95
+ duration: 5 * 1000,
96
+ });
97
+ localStorage.removeItem('Industrial-Access-Token');
98
+ // router.push('/login');
99
+ return Promise.reject(error);
100
+ },
101
+ );
102
+
103
+ export default service;
@@ -0,0 +1,44 @@
1
+ export default{
2
+
3
+ sexList: [
4
+ {label:'男', value:'1'},
5
+ {label:'女', value:'2'},
6
+ ],
7
+ degreeList: [
8
+ {label:'大学本科', value:'1'},
9
+ {label:'硕士研究生', value:'2'},
10
+ {label:'博士研究生', value:'3'}
11
+ ],
12
+ titleList: [
13
+ {label:'初级', value:'1'},
14
+ {label:'中级', value:'2'},
15
+ {label:'副高级', value:'3'},
16
+ {label:'正高级', value:'4'}
17
+ ],
18
+ areaList: [
19
+ {label:'运维服务', value:'1'},
20
+ {label:'节能减排', value:'2'},
21
+ {label:'安全生产', value:'3'},
22
+ {label:'仓储物流', value:'4'},
23
+ {label:'运营管理', value:'5'},
24
+ {label:'质量管控', value:'6'},
25
+ {label:'生产制造', value:'7'},
26
+ {label:'供应链管理', value:'8'},
27
+ {label:'研发设计', value:'9'},
28
+ ],
29
+ serviceList: [
30
+ {label:'政策咨询', value:'1'},
31
+ {label:'市场营销', value:'2'},
32
+ {label:'技术创新', value:'3'},
33
+ {label:'经营管理', value:'4'},
34
+ {label:'财务税务', value:'5'},
35
+ {label:'投资融资', value:'6'},
36
+ {label:'法律服务', value:'7'},
37
+ {label:'人才服务', value:'8'},
38
+ ],
39
+ industryList: [
40
+ {label:'食品', value:'1'},
41
+ {label:'机械', value:'2'},
42
+ {label:'电子', value:'3'},
43
+ ]
44
+ }
@@ -0,0 +1,4 @@
1
+ export function uuid() {
2
+ const uuid = new Date().getTime() + Math.random().toString(36).substring(2)
3
+ return uuid
4
+ }
@@ -0,0 +1,56 @@
1
+ import Vue from 'vue';
2
+ const instance = new Vue();
3
+ export default {
4
+ // 认证状态字典值
5
+ authStatusDicts: [
6
+ { label: '认证失败', value: '0', color: 'white', bgColor: '#F53F3F', type: 'danger' }, // 红色
7
+ { label: '认证待审核', value: '1', color: '#757F92', bgColor: '#F2F3F5', type: '' }, // 灰色
8
+ { label: '认证成功', value: '2', color: '#00b42a', bgColor: '#e8ffea', type: 'success' }, // 绿色
9
+ ],
10
+ // 审核状态
11
+ approveDicts: [
12
+ { label: '通过', value: '2' },
13
+ { label: '驳回', value: '0' },
14
+ ],
15
+ dealPath(baseUrl) {
16
+ // 本地开发环境不用修改
17
+ if (process.env.NODE_ENV === 'development') {
18
+ return baseUrl;
19
+ } else {
20
+ const origin = window.location.origin;
21
+ return origin + baseUrl;
22
+ }
23
+ },
24
+ // 统一处理接口返回
25
+ resCallback(res, sCallback, eCallback) {
26
+ if (res.data.code === 200) {
27
+ sCallback(res.data.data);
28
+ } else {
29
+ eCallback(res.data.msg);
30
+ console.log(res.data.msg);
31
+ }
32
+ },
33
+ // 信息提示
34
+ handlePrompt(msg, callback) {
35
+ instance
36
+ .$confirm(msg, '提示', {
37
+ confirmButtonText: '确定',
38
+ cancelButtonText: '取消',
39
+ type: 'warning',
40
+ callback: () => {},
41
+ beforeClose: async (action, ctx, close) => {
42
+ if (action !== 'confirm') {
43
+ close();
44
+ return;
45
+ }
46
+ ctx.confirmButtonLoading = true;
47
+ try {
48
+ await callback();
49
+ close();
50
+ } catch (error) {}
51
+ ctx.confirmButtonLoading = false;
52
+ },
53
+ })
54
+ .finally(() => {});
55
+ },
56
+ };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Created by PanJiaChen on 16/11/18.
3
+ */
4
+
5
+ /**
6
+ * @param {string} path
7
+ * @returns {Boolean}
8
+ */
9
+ export function isExternal(path) {
10
+ return /^(https?:|mailto:|tel:)/.test(path);
11
+ }
12
+
13
+ /**
14
+ * @param {string} str
15
+ * @returns {Boolean}
16
+ */
17
+ export function validUsername(str) {
18
+ const valid_map = ["admin", "editor"];
19
+ return valid_map.indexOf(str.trim()) >= 0;
20
+ }
package/vue.config.js ADDED
@@ -0,0 +1,42 @@
1
+ const path = require('path');
2
+ const NODE_ENV = 'development'; // 开发环境 打包doc
3
+ // const NODE_ENV = 'lib' // 组件库 上传npm
4
+
5
+ const devConfig = {
6
+ lintOnSave: false,
7
+ // 扩展webpack配置,使packages加入编译
8
+ // 高版本js语法转为低版本
9
+ chainWebpack: (config) => {
10
+ config.module
11
+ .rule('js')
12
+ .include.add(path.resolve(__dirname, 'packages'))
13
+ .end()
14
+ .use('babel')
15
+ .loader('babel-loader')
16
+ .tap((options) => {
17
+ return options;
18
+ });
19
+ },
20
+ configureWebpack: {
21
+ resolve: {
22
+ alias: {
23
+ '@pack': path.resolve(__dirname, 'packages'),
24
+ },
25
+ },
26
+ },
27
+ };
28
+
29
+ const buildConfig = {
30
+ configureWebpack: {
31
+ entry: 'packages/index.js',
32
+ output: {
33
+ filename: '[name].js',
34
+ libraryTarget: 'commonjs2',
35
+ },
36
+ },
37
+ outputDir: 'lib',
38
+ productionSourceMap: false,
39
+ ...devConfig,
40
+ };
41
+
42
+ module.exports = NODE_ENV === 'development' ? devConfig : buildConfig;