xsh 3 rokov pred
rodič
commit
2ccb932884

+ 23 - 0
.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*
+pnpm-debug.log*
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?

+ 23 - 2
README.md

@@ -1,3 +1,24 @@
-# hyyfScreen
+# hyyf-screen
 
-海盐数智牧场驾驶舱
+## Project setup
+```
+npm install
+```
+
+### Compiles and hot-reloads for development
+```
+npm run serve
+```
+
+### Compiles and minifies for production
+```
+npm run build
+```
+
+### Lints and fixes files
+```
+npm run lint
+```
+
+### Customize configuration
+See [Configuration Reference](https://cli.vuejs.org/config/).

+ 5 - 0
babel.config.js

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

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 12248 - 0
package-lock.json


+ 48 - 0
package.json

@@ -0,0 +1,48 @@
+{
+  "name": "hyyf-screen",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "serve": "vue-cli-service serve",
+    "build": "vue-cli-service build",
+    "lint": "vue-cli-service lint"
+  },
+  "dependencies": {
+    "core-js": "^3.6.5",
+    "lib-flexible": "^0.3.2",
+    "vue": "^2.6.11",
+    "vue-router": "^3.2.0",
+    "vuex": "^3.4.0"
+  },
+  "devDependencies": {
+    "@vue/cli-plugin-babel": "~4.5.0",
+    "@vue/cli-plugin-eslint": "~4.5.0",
+    "@vue/cli-plugin-router": "~4.5.0",
+    "@vue/cli-plugin-vuex": "~4.5.0",
+    "@vue/cli-service": "~4.5.0",
+    "babel-eslint": "^10.1.0",
+    "eslint": "^6.7.2",
+    "eslint-plugin-vue": "^6.2.2",
+    "px2rem-loader": "^0.1.9",
+    "vue-template-compiler": "^2.6.11"
+  },
+  "eslintConfig": {
+    "root": true,
+    "env": {
+      "node": true
+    },
+    "extends": [
+      "plugin:vue/essential",
+      "eslint:recommended"
+    ],
+    "parserOptions": {
+      "parser": "babel-eslint"
+    },
+    "rules": {}
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not dead"
+  ]
+}

BIN
public/favicon.ico


+ 17 - 0
public/index.html

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="">
+  <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><%= htmlWebpackPlugin.options.title %></title>
+  </head>
+  <body style="margin: 0">
+    <noscript>
+      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> 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 - 0
src/App.vue

@@ -0,0 +1,28 @@
+<template>
+  <div id="app">
+    <router-view/>
+  </div>
+</template>
+
+<style>
+#app {
+  font-family: Avenir, Helvetica, Arial, sans-serif;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+  text-align: center;
+  /*color: #2c3e50;*/
+}
+
+#nav {
+  padding: 30px;
+}
+
+#nav a {
+  font-weight: bold;
+  color: #2c3e50;
+}
+
+#nav a.router-link-exact-active {
+  color: #42b983;
+}
+</style>

BIN
src/assets/home.png


BIN
src/assets/logo.png


BIN
src/assets/u1.jpg


+ 13 - 0
src/main.js

@@ -0,0 +1,13 @@
+import Vue from 'vue'
+import App from './App.vue'
+import router from './router'
+import store from './store'
+import 'lib-flexible/flexible'
+
+Vue.config.productionTip = false
+
+new Vue({
+  router,
+  store,
+  render: h => h(App)
+}).$mount('#app')

+ 20 - 0
src/router/ChildrenRoutes.js

@@ -0,0 +1,20 @@
+const childrenRouters = [
+  {
+    path: '/',
+    name: 'Home',
+    component: () => import('../views/Home/Home.vue'),
+    meta: {
+      title: '海盐数智牧场驾驶舱'
+    }
+  },
+  {
+    path: '/home',
+    name: 'Home',
+    component: () => import('../views/Home/Home.vue'),
+    meta: {
+      title: '海盐数智牧场驾驶舱'
+    }
+  }
+];
+
+export default childrenRouters

+ 23 - 0
src/router/index.js

@@ -0,0 +1,23 @@
+import Vue from 'vue'
+import VueRouter from 'vue-router'
+import childrenRouters from "@/router/ChildrenRoutes";
+
+Vue.use(VueRouter)
+
+let mainRouterChildren = [];
+mainRouterChildren = mainRouterChildren.concat(childrenRouters);
+
+const routes = [
+  {
+    path: '/',
+    name: 'MainLayout',
+    component: () => import('../views/MainLayout.vue'),
+    children: mainRouterChildren
+  }
+]
+
+const router = new VueRouter({
+  routes
+})
+
+export default router

+ 15 - 0
src/store/index.js

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

+ 13 - 0
src/views/Home/Home.vue

@@ -0,0 +1,13 @@
+<template>
+  <div>这是首页111</div>
+</template>
+
+<script>
+export default {
+name: "Home"
+}
+</script>
+
+<style scoped>
+
+</style>

+ 32 - 0
src/views/MainLayout.vue

@@ -0,0 +1,32 @@
+<template>
+  <div class="MainLayout">
+    <div class="content">
+      <router-view></router-view>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+name: "MainLayout"
+}
+</script>
+
+<style scoped>
+  .MainLayout {
+    width: 100vw;
+    height: 100vh;
+    background: url("../assets/u1.jpg") no-repeat;
+    background-size: 100% 100%;
+    box-sizing: border-box;
+    padding: 20px 20px;
+  }
+  .content {
+    width: 100%;
+    height: 100%;
+    background: url('../assets/home.png') no-repeat;
+    background-size: 100% 100%;
+    box-sizing: border-box;
+    padding: 70px 60px;
+  }
+</style>

+ 15 - 0
vue.config.js

@@ -0,0 +1,15 @@
+module.exports = {
+    chainWebpack: config => {
+        config.module
+            .rule('css')
+            .test(/\.css$/)
+            .oneOf('vue')
+            .resourceQuery(/\?vue/)
+            .use('px2rem')
+            .loader('px2rem-loader')
+            .options({
+                remUnit: 192   //代表的是 1rem = ?px  这里假设设计稿是 1920px ,那么这里的比例就是 1/10
+            })
+            .end()
+    }
+}