使用【微信扫一扫】关注微信公众平台
+diff --git a/.DS_Store b/.DS_Store index 3a9c80d..1a6612a 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6f77dff --- /dev/null +++ b/.editorconfig @@ -0,0 +1,39 @@ +[*] +charset=utf-8 +end_of_line=lf +insert_final_newline=false +indent_style=space +indent_size=2 + +[{*.ng,*.sht,*.html,*.shtm,*.shtml,*.htm}] +indent_style=space +indent_size=2 + +[{*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}] +indent_style=space +indent_size=2 + +[{.babelrc,.stylelintrc,jest.config,.eslintrc,.prettierrc,*.json,*.jsb3,*.jsb2,*.bowerrc}] +indent_style=space +indent_size=2 + +[*.svg] +indent_style=space +indent_size=2 + +[*.js.map] +indent_style=space +indent_size=2 + +[*.less] +indent_style=space +indent_size=2 + +[*.vue] +indent_style=space +indent_size=2 + +[{.analysis_options,*.yml,*.yaml}] +indent_style=space +indent_size=2 + diff --git a/.env b/.env new file mode 100644 index 0000000..ad66e77 --- /dev/null +++ b/.env @@ -0,0 +1,7 @@ +NODE_ENV=production +VUE_APP_PREVIEW=false +# +# VUE_APP_API_BASE_URL=https://douhuo.douhuofalv.com/agent + +# +VUE_APP_API_BASE_URL=https://api.douhuotest.douhuofalv.com/agent diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..f0e67e5 --- /dev/null +++ b/.env.development @@ -0,0 +1,15 @@ +### + # @Author: Aimee~ + # @Date: 2023-05-11 11:17:32 + # @LastEditTime: 2023-07-05 11:08:59 + # @LastEditors: Aimee + # @FilePath: /douhuo-agent/.env.development + # @Description: 正式环境测试环境更改 +### +NODE_ENV=development +VUE_APP_PREVIEW=true +# +# VUE_APP_API_BASE_URL=https://douhuo.douhuofalv.com/agent + +# +VUE_APP_API_BASE_URL=https://api.douhuotest.douhuofalv.com/agent diff --git a/.env.preview b/.env.preview new file mode 100644 index 0000000..9b2676d --- /dev/null +++ b/.env.preview @@ -0,0 +1,15 @@ +### +# @Author: Aimee~ +# @Date: 2023-05-11 11:17:32 + # @LastEditTime: 2023-07-05 11:08:51 + # @LastEditors: Aimee + # @FilePath: /douhuo-agent/.env.preview +# @Description: +### +NODE_ENV=production +VUE_APP_PREVIEW=true +# +# VUE_APP_API_BASE_URL=https://douhuo.douhuofalv.com/agent + +# +VUE_APP_API_BASE_URL=https://api.douhuotest.douhuofalv.com/agent \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..5bece06 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,75 @@ +module.exports = { + root: true, + env: { + node: true + }, + 'extends': [ + 'plugin:vue/strongly-recommended', + '@vue/standard' + ], + rules: { + 'no-console': 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'generator-star-spacing': 'off', + 'no-mixed-operators': 0, + 'vue/max-attributes-per-line': [ + 2, + { + 'singleline': 5, + 'multiline': { + 'max': 1, + 'allowFirstLine': false + } + } + ], + 'vue/attribute-hyphenation': 0, + 'vue/html-self-closing': 0, + 'vue/component-name-in-template-casing': 0, + 'vue/html-closing-bracket-spacing': 0, + 'vue/singleline-html-element-content-newline': 0, + 'vue/no-unused-components': 0, + 'vue/multiline-html-element-content-newline': 0, + 'vue/no-use-v-if-with-v-for': 0, + 'vue/html-closing-bracket-newline': 0, + 'vue/no-parsing-error': 0, + 'no-tabs': 0, + 'quotes': [ + 2, + 'single', + { + 'avoidEscape': true, + 'allowTemplateLiterals': true + } + ], + 'semi': [ + 2, + 'never', + { + 'beforeStatementContinuationChars': 'never' + } + ], + 'no-delete-var': 2, + 'prefer-const': [ + 2, + { + 'ignoreReadBeforeAssign': false + } + ], + 'template-curly-spacing': 'off', + 'indent': 'off' + }, + parserOptions: { + parser: 'babel-eslint' + }, + overrides: [ + { + files: [ + '**/__tests__/*.{j,t}s?(x)', + '**/tests/unit/**/*.spec.{j,t}s?(x)' + ], + env: { + jest: true + } + } + ] +} diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..ed223c7 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,5 @@ +{ + "rules": { + "space-before-function-paren": 0 + } +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e507319 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +public/* linguist-vendored \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..688defc --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ + +.DS_Store +node_modules +/dist + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw* +package-lock.json \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b0e80f7 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "printWidth": 120, + "semi": false, + "singleQuote": true, + "prettier.spaceBeforeFunctionParen": true +} diff --git a/README.md b/README.md index fafe584..c9c82c3 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,20 @@ * @LastEditTime: 2023-06-27 14:25:57 * @LastEditors: Aimee * @FilePath: /douhuo-agent/README.md - * @Description: + * @Description: 备注信息 --> -# 抖火中台 +# 水感应 分公司 中台(数据展示及分公司数据) 打包后文件件需要有一个 static 文件存放 -'/static/vue.min.js', -'/static/vue-router.min.js', -'/static/vuex.min.js', +'/static/vue.min.js' +'/static/vue-router.min.js' +'/static/vuex.min.js' '/static/axios.min.js' 否则报错 # node 版本 10.23.1 -# 抖火测试-存放路径 +# 水感应测试-存放路径 /home/wwwroot/Development/Douhuo/agent -# 抖火正式-存放路径 +# 水感应正式-存放路径 oss://douhuo-agent/ diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..e80ad97 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,28 @@ +const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) + +const plugins = [] +if (IS_PROD) { + plugins.push('transform-remove-console') +} + +// lazy load ant-design-vue +// if your use import on Demand, Use this code +plugins.push(['import', { + 'libraryName': 'ant-design-vue', + 'libraryDirectory': 'es', + 'style': true // `style: true` 会加载 less 文件 +}]) + +module.exports = { + presets: [ + '@vue/cli-plugin-babel/preset', + [ + '@babel/preset-env', + { + 'useBuiltIns': 'entry', + 'corejs': 3 + } + ] + ], + plugins +} diff --git a/config/plugin.config.js b/config/plugin.config.js new file mode 100644 index 0000000..bb51b98 --- /dev/null +++ b/config/plugin.config.js @@ -0,0 +1,49 @@ +const ThemeColorReplacer = require('webpack-theme-color-replacer') +const generate = require('@ant-design/colors/lib/generate').default + +const getAntdSerials = (color) => { + // 淡化(即less的tint) + const lightens = new Array(9).fill().map((t, i) => { + return ThemeColorReplacer.varyColor.lighten(color, i / 10) + }) + const colorPalettes = generate(color) + const rgb = ThemeColorReplacer.varyColor.toNum3(color.replace('#', '')).join(',') + return lightens.concat(colorPalettes).concat(rgb) +} + +const themePluginOption = { + fileName: 'css/theme-colors-[contenthash:8].css', + matchColors: getAntdSerials('#1890ff'), // 主色系列 + // 改变样式选择器,解决样式覆盖问题 + changeSelector (selector) { + switch (selector) { + case '.ant-calendar-today .ant-calendar-date': + return ':not(.ant-calendar-selected-date):not(.ant-calendar-selected-day)' + selector + case '.ant-btn:focus,.ant-btn:hover': + return '.ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger),.ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger)' + case '.ant-btn.active,.ant-btn:active': + return '.ant-btn.active:not(.ant-btn-primary):not(.ant-btn-danger),.ant-btn:active:not(.ant-btn-primary):not(.ant-btn-danger)' + case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon': + case '.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon': + return ':not(.ant-steps-item-process)' + selector + // fixed https://github.com/vueComponent/ant-design-vue-pro/issues/876 + case '.ant-steps-item-process .ant-steps-item-icon': + return ':not(.ant-steps-item-custom)' + selector + case '.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-submenu-selected,.ant-menu-horizontal>.ant-menu-submenu:hover': + case '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal > .ant-menu-submenu-selected,.ant-menu-horizontal > .ant-menu-submenu:hover': + return '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu:hover' + case '.ant-menu-horizontal > .ant-menu-item-selected > a': + case '.ant-menu-horizontal>.ant-menu-item-selected>a': + return '.ant-menu-horizontal:not(ant-menu-light):not(.ant-menu-dark) > .ant-menu-item-selected > a' + case '.ant-menu-horizontal > .ant-menu-item > a:hover': + case '.ant-menu-horizontal>.ant-menu-item>a:hover': + return '.ant-menu-horizontal:not(ant-menu-light):not(.ant-menu-dark) > .ant-menu-item > a:hover' + default : + return selector + } + } +} + +const createThemeColorReplacerPlugin = () => new ThemeColorReplacer(themePluginOption) + +module.exports = createThemeColorReplacerPlugin diff --git a/config/themePluginConfig.js b/config/themePluginConfig.js new file mode 100644 index 0000000..d35ef8b --- /dev/null +++ b/config/themePluginConfig.js @@ -0,0 +1,115 @@ +export default { + theme: [ + { + key: 'dark', + fileName: 'dark.css', + theme: 'dark' + }, + { + key: '#F5222D', + fileName: '#F5222D.css', + modifyVars: { + '@primary-color': '#F5222D' + } + }, + { + key: '#FA541C', + fileName: '#FA541C.css', + modifyVars: { + '@primary-color': '#FA541C' + } + }, + { + key: '#FAAD14', + fileName: '#FAAD14.css', + modifyVars: { + '@primary-color': '#FAAD14' + } + }, + { + key: '#13C2C2', + fileName: '#13C2C2.css', + modifyVars: { + '@primary-color': '#13C2C2' + } + }, + { + key: '#52C41A', + fileName: '#52C41A.css', + modifyVars: { + '@primary-color': '#52C41A' + } + }, + { + key: '#2F54EB', + fileName: '#2F54EB.css', + modifyVars: { + '@primary-color': '#2F54EB' + } + }, + { + key: '#722ED1', + fileName: '#722ED1.css', + modifyVars: { + '@primary-color': '#722ED1' + } + }, + + { + key: '#F5222D', + theme: 'dark', + fileName: 'dark-#F5222D.css', + modifyVars: { + '@primary-color': '#F5222D' + } + }, + { + key: '#FA541C', + theme: 'dark', + fileName: 'dark-#FA541C.css', + modifyVars: { + '@primary-color': '#FA541C' + } + }, + { + key: '#FAAD14', + theme: 'dark', + fileName: 'dark-#FAAD14.css', + modifyVars: { + '@primary-color': '#FAAD14' + } + }, + { + key: '#13C2C2', + theme: 'dark', + fileName: 'dark-#13C2C2.css', + modifyVars: { + '@primary-color': '#13C2C2' + } + }, + { + key: '#52C41A', + theme: 'dark', + fileName: 'dark-#52C41A.css', + modifyVars: { + '@primary-color': '#52C41A' + } + }, + { + key: '#2F54EB', + theme: 'dark', + fileName: 'dark-#2F54EB.css', + modifyVars: { + '@primary-color': '#2F54EB' + } + }, + { + key: '#722ED1', + theme: 'dark', + fileName: 'dark-#722ED1.css', + modifyVars: { + '@primary-color': '#722ED1' + } + } + ] +} diff --git a/docs/add-page-loading-animate.md b/docs/add-page-loading-animate.md new file mode 100644 index 0000000..dfe4919 --- /dev/null +++ b/docs/add-page-loading-animate.md @@ -0,0 +1,31 @@ +为首屏增加 加载动画 +==== + + + +## 需求 + +> 为了缓解用户第一次访问时,加载 JS 过大所导致用户等待白屏时间过长导致的用户体验不好,进行的一个优化动效。 + + + +## 实现方案 + +1. 将 动画加载 dom 元素放在 #app 内,Vue 生命周期开始时,会自动清掉 #app 下的所有元素。 +2. 将 动画加载 dom 元素放在 body 下,Vue 生命周期开始时 App.vue (created, mounted) 调用 `@/utils/utll` 下的 removeLoadingAnimate(#id, timeout) 则会移除加载动画 + +最后一步: + 将样式插入到 `public/index.html` 文件的 `
` 最好写成内联 `` + + + +---- + +目前提供有两个样式,均在 `public/loading` 文件夹内。且 pro 已经默认使用了一套 loading 动画方案,可以直接参考 `public/index.html` + + +## 写在最后 + +目前 pro 有页面 overflow 显示出浏览器滚动条时,页面会抖动一下的问题。 + +欢迎各位提供能解决的方案和实现 demo。如果在条件允许的情况下,建议请直接使用 pro 进行改造,也欢迎直接 PR 到 pro 的仓库 diff --git a/docs/webpack-bundle-analyzer.md b/docs/webpack-bundle-analyzer.md new file mode 100644 index 0000000..c313767 --- /dev/null +++ b/docs/webpack-bundle-analyzer.md @@ -0,0 +1,40 @@ +先增加依赖 + +```bash +// npm +$ npm install --save-dev webpack-bundle-analyzer + +// or yarn +$ yarn add webpack-bundle-analyzer -D +``` + +配置文件 `vue.config.js` 增加 `configureWebpack.plugins` 参数 + +``` +const path = require('path') +const webpack = require('webpack') +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + +function resolve (dir) { + return path.join(__dirname, dir) +} + +// vue.config.js +module.exports = { + configureWebpack: { + plugins: [ + // Ignore all locale files of moment.js + new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), + // 依赖大小分析工具 + new BundleAnalyzerPlugin(), + ] + }, + + + ... +} +``` + + + +启动 `cli` 的 `build` 命令进行项目编译,编译完成时,会自动运行一个 http://localhost:8888 的地址,完整显示了支持库依赖 \ No newline at end of file diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..29fee32 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,23 @@ +module.exports = { + moduleFileExtensions: [ + 'js', + 'jsx', + 'json', + 'vue' + ], + transform: { + '^.+\\.vue$': 'vue-jest', + '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', + '^.+\\.jsx?$': 'babel-jest' + }, + moduleNameMapper: { + '^@/(.*)$': '总销量(单)
+总营业额
+待发货
+待收货
+营业额(元)
+总销量(单)
+消费人数
+购买本店铺商品单数(单)
+购买本店铺商品总金额(元)
+购买其他店铺商品单数(单)
+购买其他店铺商品总金额(元)
+当前货权价格
+当前货权第几轮
+货权出货总量
+货权出货总金额
+认购货权总量
+认购货权总金额
+带票货权总量
+带票货权总金额
+总用户
+普通用户
+水感应大数据分析审核系统会员
+经纪人
+经纪公司
+代理商
+分公司
++ 点击或拖拽文件到此处 +
++ 支持单次或批量上传。最多可上传{{ max }}张图片 +
+
+ 使用【微信扫一扫】关注微信公众平台
+{{ value }}
+ +
+