@@ -1,19 +1,14 @@ | |||
module.exports = { | |||
root: true, | |||
env: { | |||
node: true | |||
}, | |||
extends: ['plugin:vue/essential', 'eslint:recommended'], | |||
parserOptions: { | |||
parser: 'babel-eslint' | |||
}, | |||
rules: { | |||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | |||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | |||
}, | |||
//过滤掉layui检测 | |||
globals: { | |||
layui: true | |||
}, | |||
}; | |||
root: true, | |||
env: { | |||
node: true, | |||
}, | |||
extends: ["plugin:vue/essential", "eslint:recommended"], | |||
parserOptions: { | |||
parser: "babel-eslint", | |||
}, | |||
rules: { | |||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", | |||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", | |||
}, | |||
}; |
@@ -9,31 +9,20 @@ | |||
"test": "vue-cli-service build --mode prod --report" | |||
}, | |||
"dependencies": { | |||
"@tinymce/tinymce-vue": "^3.2.2", | |||
"axios": "^0.19.2", | |||
"core-js": "^3.6.4", | |||
"crypto-js": "^4.0.0", | |||
"dayjs": "^1.10.4", | |||
"echarts": "^4.9.0", | |||
"element-ui": "^2.13.0", | |||
"fundebug-javascript": "^2.4.2", | |||
"fundebug-revideo": "^0.6.2", | |||
"fundebug-vue": "0.0.1", | |||
"html2canvas": "^1.0.0-rc.7", | |||
"js-base64": "^3.6.0", | |||
"prerender-spa-plugin": "^3.4.0", | |||
"npm-check": "^6.0.1", | |||
"qs": "^6.9.4", | |||
"tinymce": "^5.4.1", | |||
"vue": "^2.6.11", | |||
"vue-clipboard2": "^0.3.1", | |||
"vue-lazyload": "^1.3.3", | |||
"vue-meta-info": "^0.1.7", | |||
"vue-router": "^3.1.6", | |||
"vue-seamless-scroll": "^1.1.21", | |||
"vue-wxlogin": "^1.0.2", | |||
"vuedraggable": "^2.24.0", | |||
"vuex": "^3.1.3", | |||
"webpack-spritesmith": "^1.1.0" | |||
"vuex": "^3.1.3" | |||
}, | |||
"devDependencies": { | |||
"@vue/cli-plugin-babel": "^4.3.0", | |||
@@ -49,7 +38,6 @@ | |||
"prettier": "^1.19.1", | |||
"sass-loader": "^8.0.2", | |||
"swiper": "^3.4.2", | |||
"useless-files-webpack-plugin": "^1.0.1", | |||
"vue-awesome-swiper": "^4.1.0", | |||
"vue-template-compiler": "^2.6.11" | |||
} |
@@ -5,6 +5,7 @@ | |||
</template> | |||
<script> | |||
// @ is an alias to /src | |||
export default { | |||
name: "Home", | |||
components: {}, |
@@ -4,8 +4,13 @@ import router from "./router"; | |||
import store from "./store"; | |||
import ElementUI from "element-ui"; | |||
import "element-ui/lib/theme-chalk/index.css"; | |||
import vueSwiper from "vue-awesome-swiper"; | |||
import VueLazyload from "vue-lazyload"; | |||
import "swiper/dist/css/swiper.css"; | |||
import * as filters from "./utils/filters"; | |||
import MetaInfo from "vue-meta-info"; | |||
import scroll from "vue-seamless-scroll"; | |||
import VueClipboard from "vue-clipboard2"; | |||
Vue.use(VueLazyload, { | |||
preLoad: 1.3, | |||
@@ -15,8 +20,14 @@ Vue.use(VueLazyload, { | |||
Vue.use(scroll); | |||
Vue.use(MetaInfo); | |||
Vue.use(VueClipboard); | |||
Object.keys(filters).forEach(key => { | |||
Vue.filter(key, filters[key]); | |||
}); | |||
Vue.config.productionTip = false; | |||
Vue.use(vueSwiper); | |||
Vue.use(ElementUI); | |||
// 克隆对象 方便克隆以及调试 |
@@ -1,4 +1,9 @@ | |||
// 首页、搜索、关于我们路由 | |||
import index from "./modules/index"; | |||
export default [{ | |||
path: "*", | |||
redirect: "/index", // 重定向 | |||
}, ]; | |||
path: "*", | |||
redirect: "/index", // 重定向 | |||
}, | |||
...index, | |||
]; |
@@ -1,12 +1,9 @@ | |||
import Vue from "vue"; | |||
import VueRouter from "vue-router"; | |||
import store from "../store/index"; | |||
import hhr from "./hhr"; | |||
Vue.use(VueRouter); | |||
const routes = [ | |||
...hhr, // 禾获仁官网 | |||
]; | |||
const routes = [...hhr]; | |||
const router = new VueRouter({ | |||
mode: "history", |
@@ -0,0 +1,18 @@ | |||
/** | |||
* | |||
*首页、搜索、关于我们路由 | |||
* | |||
*/ | |||
export default [ | |||
// 官网首页 | |||
{ | |||
path: "/index", | |||
name: "Index", | |||
component: () => | |||
import ("@views/index/Index.vue"), | |||
meta: { | |||
title: "园区首页", | |||
}, | |||
}, | |||
]; |
@@ -0,0 +1,4 @@ | |||
// 状态对象 | |||
export default { | |||
} |
@@ -1,2 +1 @@ | |||
import {} from "./mutation-types"; | |||
export default {}; |
@@ -0,0 +1,12 @@ | |||
import dayjs from "dayjs"; // 时间格式化组件 | |||
const formatDate = (time, fmtstring) => { | |||
time = new Date(time) | |||
// 使用momentjs这个日期格式化类库实现日期的格式化功能 | |||
if (time == '' || !time) { | |||
return '——' | |||
} else { | |||
return dayjs(time).format(fmtstring); | |||
} | |||
} | |||
export { formatDate } |
@@ -0,0 +1,66 @@ | |||
//除法 方法注释了一部分,没有试过,慎 | |||
function accDiv(arg1, arg2) { | |||
var t1 = 0, | |||
t2 = 0, | |||
r1, | |||
r2; | |||
try { | |||
t1 = arg1.toString().split(".")[1].length; | |||
} catch (e) {} | |||
try { | |||
t2 = arg2.toString().split(".")[1].length; | |||
} catch (e) {} | |||
// with(Math){ | |||
r1 = Number(arg1.toString().replace(".", "")); | |||
r2 = Number(arg2.toString().replace(".", "")); | |||
return accMul(r1 / r2, pow(10, t2 - t1)); | |||
// } | |||
} | |||
//乘法 | |||
function accMul(arg1, arg2) { | |||
var m = 0, | |||
s1 = arg1.toString(), | |||
s2 = arg2.toString(); | |||
try { | |||
m += s1.split(".")[1].length; | |||
} catch (e) {} | |||
try { | |||
m += s2.split(".")[1].length; | |||
} catch (e) {} | |||
return (Number(s1.replace(".", "")) * Number(s2.replace(".", ""))) / Math.pow(10, m); | |||
} | |||
//加法 | |||
function accAdd(arg1, arg2) { | |||
var r1, r2, m; | |||
try { | |||
r1 = arg1.toString().split(".")[1].length; | |||
} catch (e) { | |||
r1 = 0; | |||
} | |||
try { | |||
r2 = arg2.toString().split(".")[1].length; | |||
} catch (e) { | |||
r2 = 0; | |||
} | |||
m = Math.pow(10, Math.max(r1, r2)); | |||
return (arg1 * m + arg2 * m) / m; | |||
} | |||
//减法 | |||
function Subtr(arg1, arg2) { | |||
var r1, r2, m, n; | |||
try { | |||
r1 = arg1.toString().split(".")[1].length; | |||
} catch (e) { | |||
r1 = 0; | |||
} | |||
try { | |||
r2 = arg2.toString().split(".")[1].length; | |||
} catch (e) { | |||
r2 = 0; | |||
} | |||
m = Math.pow(10, Math.max(r1, r2)); | |||
n = r1 >= r2 ? r1 : r2; | |||
return ((arg1 * m - arg2 * m) / m).toFixed(n); | |||
} | |||
//导出 {常量名||函数名} | |||
export { accDiv, accMul, accAdd, Subtr }; |
@@ -0,0 +1,99 @@ | |||
<template> | |||
<div class="about"> | |||
首页 | |||
</div> | |||
</template> | |||
<script> | |||
export default { | |||
metaInfo: { | |||
title: "园区首页", // set a title | |||
}, | |||
components: { | |||
}, | |||
data() { | |||
return { | |||
}; | |||
}, | |||
computed: { | |||
}, | |||
mounted() { | |||
}, | |||
methods: { | |||
}, | |||
}; | |||
</script> | |||
/* vue单文件组件中无法修改swiper样式。 */ | |||
.cententSearch /deep/ .el-input { | |||
// width: 410px; | |||
height: 40px; | |||
} | |||
.cententSearchInput { | |||
width: 368px !important; | |||
height: 42px; | |||
} | |||
.cententSearch .el-icon-input { | |||
width: 132px; | |||
margin-right: 4px; | |||
padding-left: 10px; | |||
background: #ffffff; | |||
border-color: #2b5fe4; | |||
line-height: 36px; | |||
font-size: 14px; | |||
color: #999999; | |||
box-sizing: border-box; | |||
} | |||
.cententSearch .el-input__inner { | |||
height: 40px; | |||
background-color: #ffffff; | |||
border: solid 1px #2b5fe4; | |||
border-radius: 20px 0px 0px 20px; | |||
} | |||
.el-select .el-input__inner { | |||
color: #2b5fe4; | |||
} | |||
.featureBox .swiper-pagination-bullet { | |||
width: 26px !important; | |||
height: 7px !important; | |||
background-color: #d0d0d0 !important; | |||
border-radius: 3px !important; | |||
} | |||
.featureBox .swiper-pagination-bullet-active { | |||
background: #c5c5c5 !important; | |||
} | |||
.customer .swiper-pagination-bullet { | |||
background-color: #d0d0d0 !important; | |||
} | |||
.customer .swiper-pagination-bullet-active { | |||
width: 22px !important; | |||
height: 8px !important; | |||
border-radius: 4px !important; | |||
background: #a4beff !important; | |||
} | |||
.swiper-pagination-one .swiper-pagination-bullet { | |||
width: 34px !important; | |||
height: 5px !important; | |||
background-color: #d0d0d0 !important; | |||
border-radius: 3px !important; | |||
} | |||
.swiper-pagination-one .swiper-pagination-bullet { | |||
height: 3px !important; | |||
} | |||
.swiper-pagination-one .swiper-pagination-bullet-active { | |||
background: #ffffff !important; | |||
} | |||
.swiper-pagination .swiper-pagination-bullet, | |||
.swiper-entrepreneur .swiper-pagination-bullet { | |||
margin: 0 5px; | |||
} | |||
</style> | |||
<style lang="scss" scoped> | |||
</style> |
@@ -3,6 +3,8 @@ const resolve = dir => path.join(__dirname, dir); | |||
const IS_PROD = ["production", "prod"].includes(process.env.NODE_ENV); | |||
const CompressionWebpackPlugin = require("compression-webpack-plugin"); | |||
const productionGzipExtensions = /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i; | |||
// 图形化打包详情 | |||
// const BundleAnalyzer = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | |||
module.exports = { | |||
publicPath: "/", // 默认'/',部署应用包时的基本 URL | |||
@@ -15,7 +17,7 @@ module.exports = { | |||
devServer: { | |||
open: true, | |||
index: "index.html", //默认启动serve 打开index页面 | |||
port: 8088, | |||
port: 8089, | |||
https: false, | |||
hotOnly: false, | |||
disableHostCheck: true, | |||
@@ -40,7 +42,11 @@ module.exports = { | |||
.set("@api", resolve("./src/api")) | |||
.set("@utils", resolve("./src/utils")) | |||
.set("@components", resolve("./src/components")) | |||
.set("@views", resolve("./src/views")); | |||
.set("@views", resolve("./src/views")) | |||
.set("@customerService", resolve("./src/customerService")); | |||
// 移除prefetch | |||
config.plugins.delete("prefetch"); | |||
config.plugins.delete("preload"); | |||
}, | |||
configureWebpack: config => { | |||
config.optimization = { | |||
@@ -57,6 +63,7 @@ module.exports = { | |||
threshold: 10240, | |||
minRatio: 0.8, | |||
}) | |||
// new BundleAnalyzer() | |||
); | |||
} | |||
config.plugins = [...config.plugins, ...plugins]; |