Commit a7f181938624a548506ec292fc092ebca65111a2

Authored by xp.Huang
0 parents

Initial commit

Too many changes to show.

To preserve performance only 17 of 763 files are displayed.

  1 +module.exports = {
  2 + extends: ["@commitlint/config-conventional"]
  3 +};
\ No newline at end of file
... ...
  1 +# port
  2 +VITE_DEV_PORT = '8001'
  3 +
  4 +# development path
  5 +VITE_DEV_PATH = '/'
  6 +
  7 +# production path
  8 +VITE_PRO_PATH = '/'
  9 +
  10 +# spa-title
  11 +VITE_GLOB_APP_TITLE = GoView
  12 +
  13 +# spa shortname
  14 +VITE_GLOB_APP_SHORT_NAME = GoView
... ...
  1 +node_modules/
  2 +public/
  3 +es/
  4 +lib/
  5 +dist/
  6 +package.json
  7 +src/assets/
  8 +plop-templates/
  9 +handlebars/
  10 +website/
  11 +build/
... ...
  1 +module.exports = {
  2 + root: true,
  3 + parser: 'vue-eslint-parser',
  4 + globals: {
  5 + postMessage: true
  6 + },
  7 + parserOptions: {
  8 + parser: '@typescript-eslint/parser',
  9 + sourceType: 'module',
  10 + ecmaFeatures: {
  11 + jsx: true,
  12 + tsx: true
  13 + }
  14 + },
  15 + env: {
  16 + node: true,
  17 + // The Follow config only works with eslint-plugin-vue v8.0.0+
  18 + 'vue/setup-compiler-macros': true
  19 + },
  20 + extends: ['plugin:vue/vue3-essential', 'eslint:recommended'],
  21 + rules: {
  22 + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  23 + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  24 + 'no-unused-vars': 'off',
  25 + 'vue/no-unused-vars': 'off',
  26 + 'vue/multi-word-component-names': 'off',
  27 + 'vue/valid-template-root': 'off',
  28 + 'vue/no-mutating-props': 'off'
  29 + }
  30 +}
... ...
  1 +node_modules
  2 +.DS_Store
  3 +dist
  4 +dist-ssr
  5 +*.local
  6 +.vscode
... ...
  1 +MIT License
  2 +
  3 +Copyright (c) 2021-present GoView
  4 +
  5 +Permission is hereby granted, free of charge, to any person obtaining a copy
  6 +of this software and associated documentation files (the "Software"), to deal
  7 +in the Software without restriction, including without limitation the rights
  8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9 +copies of the Software, and to permit persons to whom the Software is
  10 +furnished to do so, subject to the following conditions:
  11 +
  12 +The above copyright notice and this permission notice shall be included in all
  13 +copies or substantial portions of the Software.
  14 +
  15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21 +SOFTWARE.
... ...
  1 +.PHONY: dist test
  2 +default: help
  3 +dev:
  4 + npm run dev
  5 +
  6 +dist:
  7 + npm run build
  8 +
  9 +view:
  10 + npm run preview
  11 +
  12 +lint:
  13 + npm run lint
  14 +
  15 +new:
  16 + npm run new
  17 +
  18 +
  19 +
  20 +help:
  21 + @echo " make dev [npm run dev] 开发模式"
  22 + @echo " make dist [npm run build] 编译模式"
  23 + @echo " make view [npm run preview] 预览打包文件"
  24 + @echo " make new [npm run lint] 通过自动化流程创建代码"
  25 + @echo " make lint [npm run new] 格式校验"
\ No newline at end of file
... ...
  1 +#### ThingsKit可视化自定大屏设计
\ No newline at end of file
... ...
  1 +import path from 'path'
  2 +export const OUTPUT_DIR = 'dist'
  3 +
  4 +// monaco-editor 路径
  5 +export const prefix = `monaco-editor/esm/vs`
  6 +
  7 +// chunk 警告大小
  8 +export const chunkSizeWarningLimit = 2000
  9 +
  10 +// 禁用 brotliSize 压缩大小报告
  11 +export const brotliSize = false
  12 +
  13 +// 分包
  14 +export const rollupOptions = {
  15 + output: {
  16 + chunkFileNames: 'static/js/[name]-[hash].js',
  17 + entryFileNames: 'static/js/[name]-[hash].js',
  18 + assetFileNames: (chunkInfo) => {
  19 + if(['.png', '.jpg', '.jpeg'].includes(path.extname(chunkInfo.name))) {
  20 + return `static/[ext]/[name].[ext]`
  21 + }
  22 + return `static/[ext]/[name]-[hash].[ext]`
  23 + },
  24 + manualChunks: {
  25 + jsonWorker: [`${prefix}/language/json/json.worker`],
  26 + cssWorker: [`${prefix}/language/css/css.worker`],
  27 + htmlWorker: [`${prefix}/language/html/html.worker`],
  28 + tsWorker: [`${prefix}/language/typescript/ts.worker`],
  29 + editorWorker: [`${prefix}/editor/editor.worker`]
  30 + }
  31 + }
  32 +}
  33 +
  34 +// 去除开发代码
  35 +export const terserOptions = {
  36 + compress: {
  37 + keep_infinity: true,
  38 + drop_console: true,
  39 + drop_debugger: true
  40 + }
  41 +}
... ...
  1 +/**
  2 + * Get the configuration file variable name
  3 + * @param env
  4 + */
  5 +export const getConfigFileName = (env: Record<string, any>) => {
  6 + return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`
  7 + .toUpperCase()
  8 + .replace(/\s/g, '');
  9 +};
... ...
  1 +* {
  2 + margin: 0;
  3 +}
  4 +.first-loading-wrp {
  5 + display: flex;
  6 + justify-content: center;
  7 + align-items: center;
  8 + height: 100vh;
  9 + background-color: #17171a;
  10 +}
  11 +.first-loading-wrp > h1 {
  12 + font-size: 128px;
  13 +}
  14 +.first-loading-wrp .loading-wrp {
  15 + padding: 98px;
  16 + display: flex;
  17 + justify-content: center;
  18 + align-items: center;
  19 +}
  20 +.dot {
  21 + animation: antRotate 1.2s infinite linear;
  22 + transform: rotate(45deg);
  23 + position: relative;
  24 + display: inline-block;
  25 + font-size: 32px;
  26 + width: 32px;
  27 + height: 32px;
  28 + box-sizing: border-box;
  29 +}
  30 +.dot i {
  31 + width: 14px;
  32 + height: 14px;
  33 + position: absolute;
  34 + display: block;
  35 + background-color: #1890ff;
  36 + border-radius: 100%;
  37 + transform: scale(0.75);
  38 + transform-origin: 50% 50%;
  39 + opacity: 0.3;
  40 + animation: antSpinMove 1s infinite linear alternate;
  41 +}
  42 +.dot i:nth-child(1) {
  43 + top: 0;
  44 + left: 0;
  45 +}
  46 +.dot i:nth-child(2) {
  47 + top: 0;
  48 + right: 0;
  49 + -webkit-animation-delay: 0.4s;
  50 + animation-delay: 0.4s;
  51 +}
  52 +.dot i:nth-child(3) {
  53 + right: 0;
  54 + bottom: 0;
  55 + -webkit-animation-delay: 0.8s;
  56 + animation-delay: 0.8s;
  57 +}
  58 +.dot i:nth-child(4) {
  59 + bottom: 0;
  60 + left: 0;
  61 + -webkit-animation-delay: 1.2s;
  62 + animation-delay: 1.2s;
  63 +}
  64 +@keyframes antRotate {
  65 + to {
  66 + -webkit-transform: rotate(405deg);
  67 + transform: rotate(405deg);
  68 + }
  69 +}
  70 +@-webkit-keyframes antRotate {
  71 + to {
  72 + -webkit-transform: rotate(405deg);
  73 + transform: rotate(405deg);
  74 + }
  75 +}
  76 +@keyframes antSpinMove {
  77 + to {
  78 + opacity: 1;
  79 + }
  80 +}
  81 +@-webkit-keyframes antSpinMove {
  82 + to {
  83 + opacity: 1;
  84 + }
  85 +}
\ No newline at end of file
... ...
  1 +<!DOCTYPE html>
  2 +<html lang="zh-cmn-Hans">
  3 + <head>
  4 + <meta charset="UTF-8" />
  5 + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  6 + <meta name="renderer" content="webkit" />
  7 + <meta name="description" content="GoView 是高效、高性能的拖拽式低代码数据可视化开发平台,将页面元素封装为基础组件,无需编写代码即可完成业务需求。">
  8 + <meta name="keywords" content="GoView,goview,低代码,可视化">
  9 + <meta name="author" content="奔跑的面条,面条">
  10 + <meta
  11 + name="viewport"
  12 + content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
  13 + />
  14 + <link rel="icon" href="./favicon.ico" />
  15 + <title>GoView</title>
  16 + <link rel="stylesheet" href="./index.css" />
  17 + </head>
  18 + <body>
  19 + <div id="appProvider" style="display: none;"></div>
  20 + <div id="app">
  21 + <div class="first-loading-wrp">
  22 + <div class="loading-wrp">
  23 + <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
  24 + </div>
  25 + </div>
  26 + </div>
  27 + <script type="module" src="/src/main.ts"></script>
  28 + </body>
  29 +</html>
... ...
  1 +{
  2 + "name": "go-view",
  3 + "version": "1.2.0",
  4 + "engines": {
  5 + "node": ">=16.14 <18.0.0"
  6 + },
  7 + "scripts": {
  8 + "dev": "vite --host",
  9 + "build": "vue-tsc --noEmit && vite build",
  10 + "preview": "vite preview",
  11 + "new": "plop --plopfile ./plop/plopfile.js",
  12 + "postinstall": "husky install",
  13 + "lint": "eslint --ext .js,.jsx,.ts,.tsx,.vue src",
  14 + "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx,.vue src --fix"
  15 + },
  16 + "dependencies": {
  17 + "@amap/amap-jsapi-loader": "^1.0.1",
  18 + "@amap/amap-jsapi-types": "^0.0.8",
  19 + "@types/color": "^3.0.3",
  20 + "@types/crypto-js": "^4.1.1",
  21 + "@types/keymaster": "^1.6.30",
  22 + "@types/lodash": "^4.14.184",
  23 + "animate.css": "^4.1.1",
  24 + "axios": "^0.27.2",
  25 + "color": "^4.2.3",
  26 + "crypto-js": "^4.1.1",
  27 + "dom-helpers": "^5.2.1",
  28 + "echarts-liquidfill": "^3.1.0",
  29 + "echarts-stat": "^1.2.0",
  30 + "echarts-wordcloud": "^2.0.0",
  31 + "gsap": "^3.11.3",
  32 + "highlight.js": "^11.5.0",
  33 + "html2canvas": "^1.4.1",
  34 + "keymaster": "^1.6.2",
  35 + "monaco-editor": "^0.33.0",
  36 + "naive-ui": "2.34.3",
  37 + "pinia": "^2.0.13",
  38 + "screenfull": "^6.0.1",
  39 + "three": "^0.145.0",
  40 + "vue": "^3.2.31",
  41 + "vue-demi": "^0.13.1",
  42 + "vue-i18n": "^9.2.2",
  43 + "vue-router": "4.0.12",
  44 + "vue3-lazyload": "^0.2.5-beta",
  45 + "vue3-sketch-ruler": "^1.3.3",
  46 + "vuedraggable": "^4.1.0"
  47 + },
  48 + "devDependencies": {
  49 + "@commitlint/cli": "^17.0.2",
  50 + "@commitlint/config-conventional": "^17.0.2",
  51 + "@types/node": "^16.11.26",
  52 + "@types/three": "^0.144.0",
  53 + "@typescript-eslint/eslint-plugin": "^5.18.0",
  54 + "@typescript-eslint/parser": "^5.18.0",
  55 + "@vicons/carbon": "^0.12.0",
  56 + "@vicons/ionicons5": "~0.11.0",
  57 + "@vitejs/plugin-vue": "^1.10.2",
  58 + "@vitejs/plugin-vue-jsx": "^1.3.9",
  59 + "@vue/compiler-sfc": "^3.2.31",
  60 + "@vueuse/core": "^7.7.1",
  61 + "commitlint": "^17.0.2",
  62 + "default-passive-events": "^2.0.0",
  63 + "echarts": "^5.3.2",
  64 + "eslint": "^8.12.0",
  65 + "eslint-config-prettier": "^8.5.0",
  66 + "eslint-plugin-import": "^2.26.0",
  67 + "eslint-plugin-prettier": "^4.0.0",
  68 + "eslint-plugin-vue": "^8.5.0",
  69 + "husky": "^8.0.1",
  70 + "lodash": "~4.17.21",
  71 + "mockjs": "^1.1.0",
  72 + "plop": "^3.0.5",
  73 + "prettier": "^2.6.2",
  74 + "sass": "^1.49.11",
  75 + "sass-loader": "^12.6.0",
  76 + "typescript": "4.6.3",
  77 + "vite": "2.9.9",
  78 + "vite-plugin-compression": "^0.5.1",
  79 + "vite-plugin-importer": "^0.2.5",
  80 + "vite-plugin-mock": "^2.9.6",
  81 + "vite-plugin-monaco-editor": "^1.1.0",
  82 + "vue-echarts": "^6.0.2",
  83 + "vue-tsc": "^0.28.10"
  84 + }
  85 +}
... ...
  1 +const storeGenerator = require('./store-template/prompt')
  2 +
  3 +module.exports = (plop) => {
  4 + plop.setGenerator('store', storeGenerator)
  5 +}
... ...
  1 +export interface {{upperDataName}}StoreType {
  2 +
  3 +}
\ No newline at end of file
... ...
  1 +import { defineStore } from 'pinia'
  2 +import { {{upperDataName}}StoreType } from './{{name}}Store.d'
  3 +import { setLocalStorage, getLocalStorage } from '@/utils'
  4 +import { StorageEnum } from '@/enums/storageEnum'
  5 +
  6 +export const use{{upperDataName}}Store = defineStore({
  7 + id: 'use{{upperDataName}}Store',
  8 + state: (): {{upperDataName}}StoreType => ({}),
  9 + getters: {},
  10 + actions: {}
  11 +})
\ No newline at end of file
... ...
  1 +module.exports = {
  2 + description: 'create a store',
  3 + prompts: [
  4 + {
  5 + type: 'input',
  6 + name: 'name',
  7 + message: 'Please enter store name,such as "newStoreName" :',
  8 + validate (value) {
  9 + if (!value || value.trim === '') {
  10 + return 'name is required';
  11 + }
  12 + return true;
  13 + },
  14 + }
  15 + ],
  16 + actions: (data) => {
  17 + const dataName = data.name
  18 +
  19 + // 首字母大写
  20 + const upperDataName = dataName.slice(0, 1).toUpperCase() + dataName.slice(1)
  21 +
  22 + const actions = [
  23 + {
  24 + type: 'add',
  25 + path: `${process.cwd()}/src/store/modules/${dataName}Store/${dataName}Store.ts`, // 这里的name就是上面定义的键
  26 + templateFile: './store-template/index.hbs',
  27 + data: {
  28 + name: data.name,
  29 + upperDataName,
  30 + }
  31 + },
  32 + {
  33 + type: 'add',
  34 + path: `${process.cwd()}/src/store/modules/${dataName}Store/${dataName}Store.d.ts`, // 这里的name就是上面定义的键
  35 + templateFile: './store-template/index.d.hbs',
  36 + data: {
  37 + name: data.name,
  38 + upperDataName,
  39 + }
  40 + },
  41 + ]
  42 +
  43 + return actions
  44 + }
  45 +}
\ No newline at end of file
... ...