框架搭建

This commit is contained in:
何嘉峣 2022-11-02 16:46:06 +08:00
commit 8d9fb1ab4a
16 changed files with 12025 additions and 0 deletions

21
.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
.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?

26
README.md Normal file
View File

@ -0,0 +1,26 @@
# yanduscreen
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Run your tests
```
npm run test
```
### Lints and fixes files
```
npm run lint
```

5
babel.config.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/app'
]
}

11576
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

35
package.json Normal file
View File

@ -0,0 +1,35 @@
{
"name": "yanduscreen",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"axios": "^1.1.3",
"core-js": "^2.6.5",
"echarts": "^5.4.0",
"element-ui": "^2.15.10",
"less": "^4.1.3",
"less-loader": "^5.0.0",
"moment": "^2.29.4",
"vue": "^2.6.10",
"vue-router": "^3.0.3",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.4",
"@vue/cli-service": "^3.0.4",
"vue-template-compiler": "^2.6.10"
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

17
public/index.html Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>yanduscreen</title>
</head>
<body>
<noscript>
<strong>We're sorry but yanduscreen doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

28
src/App.vue Normal file
View File

@ -0,0 +1,28 @@
<template>
<div id="app">
<div class="top"></div>
<div class="content">
<router-view />
</div>
</div>
</template>
<style>
@import "./assets/index.css";
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
.top {
width: 100%;
height: 60px;
background: rgb(13, 41, 65);
}
.content {
width: 100%;
height: calc(100% - 120px);
}
</style>

18
src/api/index.js Normal file
View File

@ -0,0 +1,18 @@
import axios from 'axios'
if (process.env.NODE_ENV === 'development') {
axios.defaults.baseURL = '/api'
} else if (process.env.NODE_ENV === 'production') {
axios.defaults.baseURL = '/api'
}
// 电力概况
export const getCompanyInfo = (params) => {
return axios.get('/Handler/Company.ashx', {
params
})
};
// 路线查询 下拉
export const getLine = (params) => {
return axios.get('/Handler/Line.ashx', {
params
})
};

159
src/assets/index.css Normal file
View File

@ -0,0 +1,159 @@
html,
body,
#app {
width: 100%;
height: 100%;
margin: 0px;
font-family: "微软雅黑", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* {
font-family: "微软雅黑", "Helvetica Neue", Helvetica, Arial, sans-serif;
user-select: none;
}
html,
body,
ul,
li,
ol,
dl,
dd,
dt,
p,
h1,
h2,
h3,
h4,
h5,
h6,
form,
fieldset,
legend,
img {
margin: 0;
padding: 0;
}
fieldset,
img,
input,
button,
textarea {
border: none;
padding: 0;
margin: 0;
outline-style: none;
}
ul,
ol {
list-style: none;
}
input {
padding-top: 0;
padding-bottom: 0;
}
select,
input {
vertical-align: middle;
}
select,
input,
textarea {
font-size: 12px;
margin: 0;
}
textarea {
resize: none;
}
/*防止拖动*/
img {
border: 0;
vertical-align: middle;
max-width: 100%;
}
/* 去掉图片低测默认的3像素空白缝隙*/
table {
border-collapse: collapse;
}
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
/*IE/7/6*/
}
a {
color: #666;
text-decoration: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
text-decoration: none;
font-weight: normal;
font-size: 100%;
}
s,
i,
em {
font-style: normal;
text-decoration: none;
}
/* IE 浏览器 */
.scrollbar-body {
/*三角箭头的颜色*/
scrollbar-arrow-color: #0581ab;
/*滚动条滑块按钮的颜色*/
scrollbar-face-color: #0581ab;
/*滚动条整体颜色*/
scrollbar-highlight-color: #0a393f;
/*滚动条阴影*/
scrollbar-shadow-color: #0099dd;
/*滚动条轨道颜色*/
scrollbar-track-color: #0a393f;
/*滚动条3d亮色阴影边框的外观颜色——左边和上边的阴影色*/
scrollbar-3dlight-color: #0099dd;
/*滚动条3d暗色阴影边框的外观颜色——右边和下边的阴影色*/
scrollbar-darkshadow-color: #0099dd;
/*滚动条基准颜色*/
scrollbar-base-color: #0581ab;
}
.scrollbar-body {
overflow: hidden;
overflow-y: auto;
}
.scrollbar-body::-webkit-scrollbar {
width: 0.36vw;
background-color: rgba(51, 238, 255, 0.2);
}
.scrollbar-body::-webkit-scrollbar-thumb {
background-color: rgba(0, 192, 255, 0.51);
border-radius: 0.18vw;
}

31
src/main.js Normal file
View File

@ -0,0 +1,31 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
import moment from 'moment'
//定义一个全局过滤器实现日期格式化
Vue.filter('datefmt',function (input,fmtstring) {//当input为时间戳时需转为Number类型
// 使用momentjs这个日期格式化类库实现日期的格式化功能
return moment(input).format(fmtstring);
});
Vue.prototype.$moment = moment
import Mixin from './mixins.js';
Vue.mixin(Mixin)
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

8
src/mixins.js Normal file
View File

@ -0,0 +1,8 @@
export default {
methods:{
// 路由跳转
handleRouter(routerName,param){
this.$router.push({name:routerName,query:param})
}
}
}

21
src/router.js Normal file
View File

@ -0,0 +1,21 @@
import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
Vue.use(Router)
export default new Router({
mode: 'history',
base: process.env.BASE_URL,
routes: [
{
path: '/',
redirect:'/home',
},
{
path: '/home',
name: 'home',
component: () => import ('./views/Home.vue')
},
]
})

16
src/store.js Normal file
View File

@ -0,0 +1,16 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
},
mutations: {
},
actions: {
}
})

37
src/views/Home.vue Normal file
View File

@ -0,0 +1,37 @@
<template>
<div class="home">
<div class="content">
111
</div>
</div>
</template>
<script>
import {getCompanyInfo} from '../api/index.js'
export default {
name: 'home',
components: {
},
data(){
return{
CompanyInfo:{}
}
},
mounted(){
//
getCompanyInfo().then(res=>{
this.CompanyInfo = res.data.data
console.log(this.CompanyInfo,'aaaa');
})
},
methods:{
}
}
</script>
<style lang="less" scoped>
.home{
width: 100%;
height: 100%;
}
</style>

27
vue.config.js Normal file
View File

@ -0,0 +1,27 @@
module.exports = {
// 打包文件配置
publicPath: "/",
assetsDir: "static",
lintOnSave: false,
devServer: {
// overlay: { // 让浏览器 overlay 同时显示警告和错误
// warnings: true,
// errors: true,
// },
// hotOnly: true,
// open: false, // npm run serve后自动打开页面
// https: false, // https:{type:Boolean}
// host: "0.0.0.0", // 匹配本机IP地址(默认是0.0.0.0)
// port: 8989, // 开发服务器运行端口号
proxy: {
'/api': { //代理的名字
target: 'http://172.16.1.254:3111/',
ws: true,
changeOrigin: true,
pathRewrite:{
'^/api':'',
}
}
}
}
}