panhui há 4 anos atrás
pai
commit
cb5ab73268

+ 3 - 0
.browserslistrc

@@ -0,0 +1,3 @@
+last 1 version
+> 5% in alt-AS
+IE 10

+ 19 - 0
.eslintrc.js

@@ -0,0 +1,19 @@
+module.exports = {
+    root: true,
+    env: {
+        node: true
+    },
+    extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/prettier'],
+    parserOptions: {
+        parser: 'babel-eslint'
+    },
+    plugins: ['prettier'],
+    rules: {
+        'prettier/prettier': 'off',
+        'no-console': 'off',
+        'no-debugger': 'off',
+        'vue/no-unused-components': 'warn',
+        'vue/no-unused-vars': 'warn',
+        'vue/no-use-v-if-with-v-for': 'off'
+    }
+};

+ 24 - 0
.gitignore

@@ -0,0 +1,24 @@
+.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?
+yarn.lock

+ 21 - 0
.prettierrc.js

@@ -0,0 +1,21 @@
+module.exports = {
+    printWidth: 120,
+    singleQuote: true,
+    tabWidth: 4,
+    arrowParens: 'avoid',
+    trailingComma: 'none',
+    overrides: [
+        {
+            files: '*.html',
+            options: {
+                parser: 'html'
+            }
+        },
+        {
+            files: '*.vue',
+            options: {
+                parser: 'vue'
+            }
+        }
+    ]
+};

+ 24 - 0
README.md

@@ -0,0 +1,24 @@
+# zhi-rong-web
+
+## Project setup
+```
+yarn install
+```
+
+### Compiles and hot-reloads for development
+```
+yarn serve
+```
+
+### Compiles and minifies for production
+```
+yarn build
+```
+
+### Lints and fixes files
+```
+yarn lint
+```
+
+### Customize configuration
+智戎管理平台官网

+ 3 - 0
babel.config.js

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

+ 47 - 0
package.json

@@ -0,0 +1,47 @@
+{
+  "name": "zhi-rong-web",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "serve": "vue-cli-service serve",
+    "build": "vue-cli-service build",
+    "lint": "vue-cli-service lint"
+  },
+  "dependencies": {
+    "axios": "^0.21.1",
+    "core-js": "^3.6.5",
+    "element-ui": "^2.4.5",
+    "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",
+    "@vue/eslint-config-prettier": "^6.0.0",
+    "babel-eslint": "^10.1.0",
+    "eslint": "^6.7.2",
+    "eslint-plugin-prettier": "^3.3.1",
+    "eslint-plugin-vue": "^6.2.2",
+    "less": "^3.0.4",
+    "less-loader": "^5.0.0",
+    "lint-staged": "^9.5.0",
+    "node-sass": "^4.9.2",
+    "prettier": "^2.2.1",
+    "sass-loader": "^7.0.3",
+    "vue-cli-plugin-element": "^1.0.1",
+    "vue-template-compiler": "^2.6.11"
+  },
+  "gitHooks": {
+    "pre-commit": "lint-staged"
+  },
+  "lint-staged": {
+    "*.{js,jsx,vue}": [
+      "vue-cli-service lint",
+      "git add"
+    ]
+  }
+}

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>
+    <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>

+ 24 - 0
src/App.vue

@@ -0,0 +1,24 @@
+<template>
+    <div id="app">
+        <keep-alive>
+            <router-view class="appContainer" />
+        </keep-alive>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'app'
+};
+</script>
+
+<style>
+#app {
+    font-family: 'Avenir', Helvetica, Arial, sans-serif;
+    -webkit-font-smoothing: antialiased;
+    -moz-osx-font-smoothing: grayscale;
+    text-align: center;
+    color: #2c3e50;
+    margin-top: 60px;
+}
+</style>

BIN
src/assets/logo.png


+ 110 - 0
src/components/HelloWorld.vue

@@ -0,0 +1,110 @@
+<template>
+    <div class="hello">
+        <h1>{{ msg }}</h1>
+        <p>
+            For a guide and recipes on how to configure / customize this project,<br />
+            check out the
+            <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
+        </p>
+        <h3>Installed CLI Plugins</h3>
+        <ul>
+            <li>
+                <a
+                    href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
+                    target="_blank"
+                    rel="noopener"
+                    >babel</a
+                >
+            </li>
+            <li>
+                <a
+                    href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router"
+                    target="_blank"
+                    rel="noopener"
+                    >router</a
+                >
+            </li>
+            <li>
+                <a
+                    href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex"
+                    target="_blank"
+                    rel="noopener"
+                    >vuex</a
+                >
+            </li>
+            <li>
+                <a
+                    href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
+                    target="_blank"
+                    rel="noopener"
+                    >eslint</a
+                >
+            </li>
+        </ul>
+        <h3>Essential Links</h3>
+        <ul>
+            <li>
+                <a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a>
+            </li>
+            <li>
+                <a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a>
+            </li>
+            <li>
+                <a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a>
+            </li>
+            <li>
+                <a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a>
+            </li>
+            <li>
+                <a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a>
+            </li>
+        </ul>
+        <h3>Ecosystem</h3>
+        <ul>
+            <li>
+                <a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a>
+            </li>
+            <li>
+                <a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a>
+            </li>
+            <li>
+                <a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener"
+                    >vue-devtools</a
+                >
+            </li>
+            <li>
+                <a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a>
+            </li>
+            <li>
+                <a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a>
+            </li>
+        </ul>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'HelloWorld',
+    props: {
+        msg: String
+    }
+};
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped lang="less">
+h3 {
+    margin: 40px 0 0;
+}
+ul {
+    list-style-type: none;
+    padding: 0;
+}
+li {
+    display: inline-block;
+    margin: 0 10px;
+}
+a {
+    color: #42b983;
+}
+</style>

+ 11 - 0
src/element-variables.scss

@@ -0,0 +1,11 @@
+/*
+Write your variables here. All available variables can be
+found in element-ui/packages/theme-chalk/src/common/var.scss.
+For example, to overwrite the theme color:
+*/
+$--color-primary: teal;
+
+/* icon font path, required */
+$--font-path: '~element-ui/lib/theme-chalk/fonts';
+
+@import "~element-ui/packages/theme-chalk/src/index";

+ 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 './plugins/element.js'
+
+Vue.config.productionTip = false;
+
+new Vue({
+    router,
+    store,
+    render: h => h(App)
+}).$mount('#app');

+ 5 - 0
src/plugins/element.js

@@ -0,0 +1,5 @@
+import Vue from 'vue'
+import Element from 'element-ui'
+import '../element-variables.scss'
+
+Vue.use(Element)

+ 36 - 0
src/router/index.js

@@ -0,0 +1,36 @@
+import Vue from 'vue';
+import VueRouter from 'vue-router';
+
+Vue.use(VueRouter);
+
+const routes = [
+    {
+        path: '/',
+        redirect: 'home'
+    },
+    {
+        path: '/home',
+        name: 'home',
+        component: () => import('../views/Home.vue'),
+        meta: {
+            title: '首页'
+        }
+    }
+];
+
+const router = new VueRouter({
+    mode: 'history',
+    base: process.env.BASE_URL,
+    routes,
+    scrollBehavior(to, from, savedPosition) {
+        if (to.path !== from.path) {
+            if (savedPosition) {
+                return savedPosition;
+            } else {
+                return { x: 0, y: 0 };
+            }
+        }
+    }
+});
+
+export default router;

+ 13 - 0
src/store/index.js

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

+ 63 - 0
src/styles/common.less

@@ -0,0 +1,63 @@
+@prim: #ff6c00;
+@success: #07c160;
+@danger: #ff6c00;
+@warn: #ff976a;
+@text0: #181818;
+@text1: #323233;
+@text2: #606266;
+@text3: #939599;
+@text4: #c6c8cc;
+@border1: #f5f7fa;
+@border2: #f2f3f5;
+@border3: #dfe1e6;
+@border4: #f2f6fc;
+@bg: #f5f7fa;
+@red:#FD4D49;
+.flex1 {
+    flex-grow: 1;
+}
+.flex() {
+    display: flex;
+    align-items: center;
+}
+.flex-col() {
+    display: flex;
+    flex-direction: column;
+}
+
+.ellipsis() {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+
+.ellipsis-line( @line:2 ) {
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    -webkit-line-clamp: @line;
+    overflow: hidden;
+}
+
+@keyframes iconAnimate {
+    from {
+        -webkit-transform: scale(1);
+        transform: scale(1);
+    }
+
+    20% {
+        -webkit-transform: scale(0.8);
+        transform: scale(0.8);
+    }
+
+    80% {
+        -webkit-transform: scale(1.5);
+        transform: scale(1.5);
+    }
+    100% {
+        -webkit-transform: scale(1);
+        transform: scale(1);
+    }
+}
+.iconAnimate {
+    animation: iconAnimate ease-in-out 0.3s;
+}

+ 39 - 0
src/styles/font.less

@@ -0,0 +1,39 @@
+@font-face {
+    font-family: 'OSP';
+    src: url(https://imttech.oss-cn-hangzhou.aliyuncs.com/micro/OSP-DIN.ttf);
+}
+@font-face {
+    font-family: 'iconfont'; /* Project id 2504712 */
+    src: url('//at.alicdn.com/t/font_2504712_37jeq6r3j0w.woff2?t=1620984863369') format('woff2'),
+        url('//at.alicdn.com/t/font_2504712_37jeq6r3j0w.woff?t=1620984863369') format('woff'),
+        url('//at.alicdn.com/t/font_2504712_37jeq6r3j0w.ttf?t=1620984863369') format('truetype');
+}
+
+.iconfont {
+    font-family: 'iconfont' !important;
+    font-size: 16px;
+    font-style: normal;
+    -webkit-font-smoothing: antialiased;
+    -moz-osx-font-smoothing: grayscale;
+    line-height: 22px;
+}
+
+.iconfont-jiage:before {
+    content: '\e61c';
+}
+
+.iconfont-liebiao:before {
+    content: '\e61d';
+}
+
+.iconfont-button:before {
+    content: '\e61e';
+}
+
+@font-face {
+    font-family: 'color-emoji';
+    src: local('Apple Color Emoji'), local('Segoe UI Emoji'), local('Segoe UI Symbol'), local('Noto Color Emoji');
+}
+article {
+    font-family: 'color-emoji';
+}

+ 11 - 0
src/views/Home.vue

@@ -0,0 +1,11 @@
+<template>
+    <div class="home">
+        <el-button type="primary" size="default">255</el-button>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'Home'
+};
+</script>

+ 25 - 0
vue.config.js

@@ -0,0 +1,25 @@
+const path = require('path');
+module.exports = {
+    publicPath:
+        process.env.NODE_ENV === 'production'
+            ? 'https://cdn.imttech.cn/index/'
+            : process.env.NODE_ENV === 'test'
+            ? '/index'
+            : '/',
+    devServer: {
+        port: 8081,
+        disableHostCheck: true
+    },
+    pluginOptions: {
+        'style-resources-loader': {
+            preProcessor: 'less',
+            patterns: [path.resolve(__dirname, './src/styles/common.less')]
+        }
+    },
+    chainWebpack: config => {
+        if (process.env.NODE_ENV === 'development') {
+            config.output.filename('[name].[hash].js').end();
+        }
+    },
+    transpileDependencies: ['ssr-window', 'dom7', 'vuex']
+};