瀏覽代碼

first commit

李楠 4 年之前
父節點
當前提交
55ca47ad64

+ 5 - 0
package.json

@@ -7,8 +7,13 @@
     "build": "vue-cli-service build"
     "build": "vue-cli-service build"
   },
   },
   "dependencies": {
   "dependencies": {
+    "axios": "^0.21.0",
     "core-js": "^3.6.5",
     "core-js": "^3.6.5",
+    "echarts": "^4.9.0",
+    "element-ui": "^2.14.1",
+    "moment": "^2.29.1",
     "vue": "^2.6.11",
     "vue": "^2.6.11",
+    "vue-axios": "^3.2.0",
     "vue-router": "^3.2.0",
     "vue-router": "^3.2.0",
     "vuex": "^3.4.0"
     "vuex": "^3.4.0"
   },
   },

二進制
public/favicon.ico


+ 15 - 23
src/App.vue

@@ -1,32 +1,24 @@
 <template>
 <template>
-  <div id="app">
-    <div id="nav">
-      <router-link to="/">Home</router-link> |
-      <router-link to="/about">About</router-link>
+    <div id="app">
+        <router-view />
     </div>
     </div>
-    <router-view/>
-  </div>
 </template>
 </template>
 
 
+<script>
+export default {
+    created() {}
+};
+</script>
+
 <style lang="scss">
 <style lang="scss">
 #app {
 #app {
-  font-family: Avenir, Helvetica, Arial, sans-serif;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-  text-align: center;
-  color: #2c3e50;
+    height: 100%;
+    margin: 0;
 }
 }
-
-#nav {
-  padding: 30px;
-
-  a {
-    font-weight: bold;
-    color: #2c3e50;
-
-    &.router-link-exact-active {
-      color: #42b983;
-    }
-  }
+body,
+html {
+    height: 100%;
+    width: 100%;
+    margin: 0 0 0 0;
 }
 }
 </style>
 </style>

+ 32 - 0
src/api/fileInfo.js

@@ -0,0 +1,32 @@
+import { ajax } from "../sdk/ajax";
+
+/* 档案信息 */
+/* 企业信息 */
+export const reqFirminfo = () => ajax("get", "/publics/sysconf/get", {code: 'huyang_company'})
+
+export const reqUpdateFirm = (data) => ajax("post", "/publics/sysconf/update", data)
+
+
+/* 牧场信息 */
+export const reqPastureInfo = () => ajax("get", "/publics/sysconf/get", {code: 'huyang_farm_01'})
+
+export const reqUpdatePasture = (data) => ajax("get", "/publics/sysconf/update", data)
+
+
+
+/* 栋舍信息  Build = areaInfo*/
+export const reqBuildList = (data) => ajax("post", "/farm-huyang/building/list", data)
+
+export const reqAddOrUpdateBuild = (data) => ajax("post", "/farm-huyang/building/addOrUpdate", data)
+
+export const reqDelBuild = (id) => ajax("post", "/farm-huyang/building/delete", {id})
+
+
+
+/* 员工信息  Worker*/
+export const reqWorkerList = (data) => ajax("post", "/farm-huyang/employee/list", data)
+
+export const reqAddOrUpdateWorker = (data) => ajax("post", "/farm-huyang/employee/addOrUpdate", data)
+
+export const reqDelWorker = (id) => ajax("post", "/farm-huyang/employee/delete", {id})
+

+ 11 - 0
src/api/login.js

@@ -0,0 +1,11 @@
+import { ajax } from "../sdk/ajax";
+
+
+/* 登录 */
+export const reqLogin = (data) => ajax("post", "/core/auth/login", data)
+
+/* 选择组织 */
+export const reqOrgChoose = () => ajax("get", "/core/employ-relation/under-list")
+
+
+export const reqOrganizationId = (data) => ajax("POST", "/core/auth/choose-org",data)

+ 5 - 0
src/assets/css/reset.scss

@@ -0,0 +1,5 @@
+/* 公用scss */
+div,h1,h2,h3,h4,h5,h3,body,html,ul,li,p{margin: 0;padding: 0;}
+a{text-decoration: none;}
+li{list-style:none;} 
+/*css初始化完成*/

二進制
src/assets/login_bg.jpg


二進制
src/assets/logo.png


+ 15 - 4
src/main.js

@@ -1,12 +1,23 @@
 import Vue from 'vue'
 import Vue from 'vue'
+import ElementUI from 'element-ui';
+// import '../theme/index.css'
+import 'element-ui/lib/theme-chalk/index.css';
 import App from './App.vue'
 import App from './App.vue'
 import router from './router'
 import router from './router'
 import store from './store'
 import store from './store'
+import './assets/css/reset.scss'
+import echarts from "echarts";
+import moment from 'moment'
+moment.locale('zh-cn');  // 汉化
+Vue.prototype.$moment = moment; 
+
+Vue.prototype.$echarts = echarts
+
+Vue.use(ElementUI);
 
 
-Vue.config.productionTip = false
 
 
 new Vue({
 new Vue({
-  router,
-  store,
-  render: h => h(App)
+	router,
+	store,
+	render: h => h(App)
 }).$mount('#app')
 }).$mount('#app')

+ 32 - 15
src/router/index.js

@@ -1,27 +1,44 @@
 import Vue from 'vue'
 import Vue from 'vue'
 import VueRouter from 'vue-router'
 import VueRouter from 'vue-router'
-import Home from '../views/Home.vue'
+// import store from '../store'
+import subRouters from './routes'
+
+import App from '../App.vue'
+import Login from '../views/Login/Login.vue'
+import Home from '../views/Home/Home.vue'
+
 
 
 Vue.use(VueRouter)
 Vue.use(VueRouter)
 
 
 const routes = [
 const routes = [
-  {
-    path: '/',
-    name: 'Home',
-    component: Home
-  },
-  {
-    path: '/about',
-    name: 'About',
-    // route level code-splitting
-    // this generates a separate chunk (about.[hash].js) for this route
-    // which is lazy-loaded when the route is visited.
-    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
-  }
+	{
+		path: '/',
+		component: App,
+		children: [
+			{
+				path: '',
+				redirect: '/login'
+			},
+		]
+	},
+	{
+		path: '/login',
+		name: 'login',
+		component: Login
+	},
+	{
+		path: '/home',
+		component: Home
+	},
+	{
+		path: '*',
+		name: '*',
+		component: Login
+	}
 ]
 ]
 
 
 const router = new VueRouter({
 const router = new VueRouter({
-  routes
+	routes: [...routes, ...subRouters]
 })
 })
 
 
 export default router
 export default router

+ 21 - 0
src/router/routes.js

@@ -0,0 +1,21 @@
+import Home from '../views/Home/Home.vue'
+
+/* 基本信息 */
+import firmInfo from '@/views/basicInfo/firmInfo.vue'
+
+
+export default [
+	{
+		path: '/home',
+		component: Home,
+		children: [
+			/* 档案信息 */
+			{
+				path: 'firmInfo',
+				name: 'firmInfo',
+				component: firmInfo
+			},
+			
+		]
+	},
+]

+ 95 - 0
src/sdk/ajax.js

@@ -0,0 +1,95 @@
+import Vue from 'vue';
+import axios from 'axios';
+import VueAxios from 'vue-axios';
+import config from './config'
+import Qs from 'qs';
+
+const { serverAddress } = config
+
+// import DEV from "@/dev_config"; // 导入上线配置
+// const { ONLINE_BASE_HREF, SERVER_HREF } = DEV;
+
+Vue.use(VueAxios, axios)
+
+
+/* 常用ajax封装 */
+export const ajax = function (type = "post", url, params) {
+    let token = localStorage.getItem("token")
+    if (type.toLowerCase() == 'get') {
+        return new Promise((resole, reject) => {
+            axios({
+                method: type,
+                url: serverAddress + url,
+                params,
+                paramsSerializer(params) {
+                    return Qs.stringify(params, { arrayFormat: 'brackets' })
+                },
+                headers: {
+                    'Content-Type': 'application/x-www-form-urlencoded',
+                    'x-auth-token': token
+                }
+            }).then((res) => {
+                switch (res.data.errCode) {
+                    case 'request_not_authorize': // 登录过期
+                        let url = window.location.protocol + "//" + window.location.host + "/#/login"
+                        window.location.replace(url)
+                        break;
+                }
+                resole(res.data);
+            }).catch((err) => {
+                reject(err);
+            });
+        });
+    } else {
+        return new Promise((resole, reject) => {
+            axios({
+                method: type,
+                url: serverAddress + url,
+                params,
+                headers: {
+                    'Content-Type': 'application/x-www-form-urlencoded',
+                    'x-auth-token': token
+                }
+            }).then((res) => {
+                switch (res.data.errCode) {
+                    case 'request_not_authorize': // 登录过期
+                        let url = window.location.protocol + "//" + window.location.host + "/#/login"
+                        window.location.replace(url)
+                        break;
+                }
+                resole(res.data);
+            }).catch((err) => {
+                reject(err);
+            });
+        });
+    }
+}
+
+
+
+// export const upload = function (url, data) {
+//     let token = localStorage.getItem("token")
+//     return new Promise((resole, reject) => {
+//         axios({
+//             method: 'POST',
+//             url: serverAddress + url,
+//             data,
+//             headers: {
+//                 'Content-Type': 'multipart/form-data',
+//                 'x-auth-token': token
+//             }
+//         }).then((res) => {
+//             switch (res.data.errCode) {
+//                 case 'request_not_authorize': // 登录过期
+//                     let url = window.location.protocol + "//" + window.location.host + "/#/login"
+//                     window.location.replace(url)
+//                     break;
+//             }
+//             resole(res.data);
+//         }).catch((err) => {
+//             reject(err);
+//         });
+//     });
+// }
+
+

+ 6 - 0
src/sdk/config.js

@@ -0,0 +1,6 @@
+export default {
+  // http://192.168.1.6/uploads/20d27b607c8045279f7a41a7defa0d62.jpg
+  // http://115.238.57.190:8888/uploads/20d27b607c8045279f7a41a7defa0d62.jpg
+  serverAddress: 'http://115.238.57.190:8010',
+  IMG_BASE: 'http://115.238.57.190:8888/uploads/'
+}

+ 17 - 8
src/store/index.js

@@ -4,12 +4,21 @@ import Vuex from 'vuex'
 Vue.use(Vuex)
 Vue.use(Vuex)
 
 
 export default new Vuex.Store({
 export default new Vuex.Store({
-  state: {
-  },
-  mutations: {
-  },
-  actions: {
-  },
-  modules: {
-  }
+	state: {},
+	mutations: {
+		setState(state, [key, val]) {
+			state[key] = val
+		}
+	},
+	actions: {
+		// getWorkerList({ commit }) {
+		//   reqWorkerList({
+		//     searchStr: '',
+		//     pageSize: 1000,
+		//     pageNum: 1
+		//   }).then(res => {
+		//     commit('setState', ['workerList', res.content])
+		//   })
+		// },
+	},
 })
 })

+ 0 - 5
src/views/About.vue

@@ -1,5 +0,0 @@
-<template>
-  <div class="about">
-    <h1>This is an about page</h1>
-  </div>
-</template>

+ 0 - 18
src/views/Home.vue

@@ -1,18 +0,0 @@
-<template>
-  <div class="home">
-    <img alt="Vue logo" src="../assets/logo.png">
-    <HelloWorld msg="Welcome to Your Vue.js App"/>
-  </div>
-</template>
-
-<script>
-// @ is an alias to /src
-import HelloWorld from '@/components/HelloWorld.vue'
-
-export default {
-  name: 'Home',
-  components: {
-    HelloWorld
-  }
-}
-</script>

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

@@ -0,0 +1,231 @@
+<template>
+    <div class="home">
+        <header class="header">
+            <div class="left">
+                苏尼特羊区块链平台
+                <el-button
+                    @click="onMenuCollapse"
+                    circle
+                    style="font-size: 20px"
+                    :icon="menuCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
+                ></el-button>
+            </div>
+            <div class="right">
+                <span class="warp">
+                    <el-dropdown @command="onLogOut">
+                        <span class="el-dropdown-link">
+                            账号管理
+                            <i class="el-icon-arrow-down el-icon--right"></i>
+                        </span>
+                        <el-dropdown-menu slot="dropdown">
+                            <el-dropdown-item>退出登录</el-dropdown-item>
+                            <el-dropdown-item>切换账号</el-dropdown-item>
+                        </el-dropdown-menu>
+                    </el-dropdown>
+                </span>
+                <span>
+                    <el-dropdown @command="onLogOut">
+                        <span class="el-dropdown-link">
+                            权限切换
+                            <i class="el-icon-arrow-down el-icon--right"></i>
+                        </span>
+                        <el-dropdown-menu slot="dropdown">
+                            <el-dropdown-item disabled>权限一</el-dropdown-item>
+                            <el-dropdown-item divided>权限二</el-dropdown-item>
+                        </el-dropdown-menu>
+                    </el-dropdown>
+                </span>
+            </div>
+        </header>
+        <section class="section">
+            <!-- <div class="tac"> -->
+            <div class="col1">
+                <el-menu
+                    default-active="2"
+                    class="el-menu-vertical-demo"
+                    @open="handleOpen"
+                    @close="handleClose"
+                    :collapse="menuCollapse"
+                    :unique-opened="true"
+                    :default-openeds="defaultUnfoldedMenu"
+                    select="1-1"
+                    background-color="#545c64"
+                    text-color="#fff"
+                    active-text-color="#ffd04b"
+                >
+                    <div v-for="(item, index1) in menuData" :key="index1">
+                        <el-submenu
+                            v-if="item.childList && item.childList.length > 0"
+                            :index="`${index1}`"
+                        >
+                            <template slot="title">
+                                <i :class="item.iconClassName"></i>
+                                <span slot="title">{{
+                                    !menuCollapse ? item.optionName : ""
+                                }}</span>
+                            </template>
+                            <el-menu-item
+                                v-for="(item1, index2) in item.childList"
+                                :key="`${index1}-${index2}`"
+                                :index="`${index1}-${index2}`"
+                                :routerName="item1.routerName"
+                                @click="onClickMenu(item1)"
+                                >{{ item1.optionName }}</el-menu-item
+                            >
+                        </el-submenu>
+                        <el-menu-item
+                            v-else
+                            :index="`${index1}`"
+                            :disabled="item.disabled"
+                            :routerName="item.routerName"
+                            @click="onClickMenu(item)"
+                        >
+                            <i :class="item.iconClassName"></i>
+                            <span slot="title">{{
+                                !menuCollapse ? item.optionName : ""
+                            }}</span>
+                        </el-menu-item>
+                    </div>
+                </el-menu>
+            </div>
+
+            <div class="col2">
+                <div class="warp">
+                    <router-view />
+                </div>
+            </div>
+
+            <!-- </div> -->
+        </section>
+    </div>
+</template>
+
+<script>
+import { menuData } from "./mencCofig.js";
+
+export default {
+    data() {
+        return {
+            // 菜单配置
+            menuData,
+            menuCollapse: false, //是否水平折叠收起菜单
+            defaultUnfoldedMenu: [menuData[0].index], // 默认展开第一项
+        };
+    },
+    created() {
+        this.defaultUnfoldedMenu = [
+            localStorage.getItem("defaultUnfoldedMenu"),
+        ];
+        this.menuCollapse = JSON.parse(localStorage.getItem("menuCollapse"));
+    },
+    mounted() {},
+    methods: {
+        // 收取菜单按钮
+        onMenuCollapse() {
+            this.menuCollapse = !this.menuCollapse;
+            localStorage.setItem("menuCollapse", this.menuCollapse);
+            this.defaultUnfoldedMenu = [
+                localStorage.getItem("defaultUnfoldedMenu"),
+            ];
+        },
+        // 菜单展开
+        handleOpen(key, keyPath) {
+            localStorage.setItem("defaultUnfoldedMenu", "" + key);
+        },
+        // 菜单收取
+        handleClose(key, keyPath) {},
+        // 点击菜单项
+        onClickMenu(item) {
+            let _this = this;
+            // 如果要跳转的路由和当前路由一致就 return
+            if (this.$router.history.current.name == item.routerName) return;
+            this.$router.push({
+                name: item.routerName,
+            });
+        },
+        onLogOut() {
+            this.$router.replace("login");
+        },
+    },
+};
+</script>
+
+<style lang="scss" scoped>
+.home {
+    height: 100%;
+    overflow: hidden;
+    box-sizing: border-box;
+    background-color: #eee;
+    display: flex;
+    flex-direction: column;
+    > .header {
+        background-color: #4b545e;
+        height: 40px;
+        padding: 10px 20px;
+        margin-bottom: 5px;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        .left {
+            font-size: 25px;
+            color: #fff;
+            /deep/ .is-circle {
+                margin-left: 40px;
+            }
+        }
+        .right {
+            .warp {
+                margin-right: 20px;
+            }
+        }
+    }
+    .section {
+        flex-grow: 1;
+        box-sizing: border-box;
+        overflow: auto;
+        display: flex;
+        // height: 90%;
+        box-sizing: border-box;
+        .col1 {
+            margin-right: 5px;
+            background-color: #545c64;
+            border-radius: 15px;
+            overflow: auto;
+            /deep/ .el-menu-vertical-demo {
+                border: #545c64 1px solid;
+                -webkit-user-select: none;
+                -moz-user-select: none;
+                -ms-user-select: none;
+                user-select: none;
+            }
+        }
+        .col2 {
+            flex: 1;
+            background-color: #fff;
+            padding: 0 15px 0px 15px;
+            border-radius: 5px;
+            margin-right: 5px;
+            height: 100%;
+            overflow: auto;
+            .warp {
+                margin: 15px;
+            }
+        }
+        // }
+    }
+    // border: 1px solid #f00;
+}
+
+.el-menu-vertical-demo:not(.el-menu--collapse) {
+    width: 200px;
+    min-height: 400px;
+}
+// 下拉菜单
+.el-dropdown-link {
+    cursor: pointer;
+    color: #fff;
+}
+.el-icon-arrow-down {
+    font-size: 12px;
+}
+</style>

+ 361 - 0
src/views/Home/mencCofig.js

@@ -0,0 +1,361 @@
+
+export const menuData = [
+    {
+        optionName: "基本信息",
+        iconClassName: "el-icon-s-order",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '企业信息(余)',
+                routerName: "firmInfo"
+            },
+            {
+                optionName: '牧民信息管理',
+                routerName: "workerInfo"
+            },
+
+        ]
+    },
+    {
+        optionName: "羊只收购",
+        iconClassName: "el-icon-shopping-cart-full",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '收购批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '羊只信息',
+                routerName: "aa"
+            },
+
+        ]
+    },
+    {
+        optionName: "运输信息",
+        iconClassName: "el-icon-truck",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '运输批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '羊只信息',
+                routerName: "aa"
+            }
+        ]
+    },
+    {
+        optionName: "羊只入栏",
+        iconClassName: "el-icon-wind-power",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '入栏批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '羊只入栏',
+                routerName: "aa"
+            }
+
+        ]
+    },
+    {
+        optionName: "羊只检疫",
+        iconClassName: "el-icon-magic-stick",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '检疫批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '检疫羊只',
+                routerName: "aa"
+            }
+
+        ]
+    },
+    {
+        optionName: "损失管理",
+        iconClassName: "el-icon-circle-close",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '损失管理',
+                routerName: "aa"
+            }
+        ]
+    },
+    {
+        optionName: "屠宰管理",
+        iconClassName: "el-icon-scissors",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '屠宰批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '羊只管理',
+                routerName: "aa"
+            }
+
+        ]
+    },
+    {
+        optionName: "排酸入库",
+        iconClassName: "el-icon-shopping-cart-1",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '排酸批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '羊只管理',
+                routerName: "aa"
+            }
+
+        ]
+    },
+    {
+        optionName: "胴体分割",
+        iconClassName: "el-icon-aim",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '分割批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '胴体分割管理',
+                routerName: "aa"
+            }
+
+        ]
+    },
+    {
+        optionName: "分割入库",
+        iconClassName: "el-icon-right",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '分割品入库批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '分割品入库管理',
+                routerName: "aa"
+            }
+
+        ]
+    },
+    {
+        optionName: "分割出库",
+        iconClassName: "el-icon-back",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '分割品出库批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '分割品出库管理',
+                routerName: "aa"
+            }
+
+        ]
+    },
+    {
+        optionName: "肉丁加工",
+        iconClassName: "el-icon-cpu",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '肉丁加工批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '肉丁入库批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '肉丁入库',
+                routerName: "aa"
+            },
+            {
+                optionName: '肉丁出库批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '肉丁出库',
+                routerName: "aa"
+            }
+        ]
+    },
+    {
+        optionName: "产品打包",
+        iconClassName: "el-icon-orange",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '打包批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '成品打包',
+                routerName: "aa"
+            }
+        ]
+    },
+    {
+        optionName: "成品入库",
+        iconClassName: "el-icon-star-on",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '成品入库批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '成品入库',
+                routerName: "aa"
+            }
+        ]
+    },
+    {
+        optionName: "成品出库",
+        iconClassName: "el-icon-star-off",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '成品出库批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '成品出库',
+                routerName: "aa"
+            }
+        ]
+    },
+    {
+        optionName: "成品运输",
+        iconClassName: "el-icon-truck",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '成品运输批次管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '成品运输管理',
+                routerName: "aa"
+            }
+        ]
+    },
+    {
+        optionName: "销售管理",
+        iconClassName: "el-icon-files",
+        disabled: false, // 是否禁用
+        childList: [
+            {
+                optionName: '销售订单管理',
+                routerName: "aa"
+            },
+            {
+                optionName: '订单成品管理',
+                routerName: "aa"
+            }
+
+        ]
+    },
+    {
+        optionName: "车辆管理",
+        iconClassName: "el-icon-files",
+        routerName: "home"
+    },
+    {
+        optionName: "冷库管理",
+        iconClassName: "el-icon-school",
+        routerName: "home"
+    },
+    {
+        optionName: "客户管理",
+        iconClassName: "el-icon-user-solid",
+        routerName: "home"
+    },
+    {
+        optionName: "栏舍管理",
+        iconClassName: "el-icon-s-data",
+        routerName: "home"
+    },
+    {
+        optionName: "员工管理",
+        iconClassName: "el-icon-user",
+        routerName: "home"
+    },
+]
+
+// export default {menuData}
+
+
+
+
+/* 菜单配置 描述 */
+const menuData描述 = [
+    // 有子菜单 并且字菜单分组的
+    {
+        optionName: "导航一", // 一级菜单名
+        iconClassName: "aaa", // element-ui图标名
+        childList: [ // 分组的
+            {
+                groupName: '组名一',
+                list: [
+                    {
+                        optionName: '选项1',
+                        routerName: "home"
+                    },
+                    {}
+                ],
+            },
+            {
+                groupName: '组名二',
+                list: [
+                    {
+                        optionName: '选项1',
+                        routerName: "home"
+                    },
+                    {}
+                ],
+            }
+        ],
+    },
+    // 有子菜单 字菜单不分组的
+    {
+        optionName: "导航二",
+        iconClassName: "el-icon-menu",
+        disabled: false, // 是否禁用
+        childList: [ // 不分组的
+            {
+                optionName: '选项1',
+                routerName: "home"
+            },
+            {}
+        ]
+    },
+    // 无子菜单的
+    {
+        optionName: "导航三",
+        iconClassName: "el-icon-document",
+        routerName: "home",
+        disabled: false
+    },
+
+    "导航四"
+]
+
+

+ 167 - 0
src/views/Login/Login.vue

@@ -0,0 +1,167 @@
+<template>
+    <div class="login">
+        <div class="shade">
+            <header class="header">
+                <img class="logo" src="../../assets/logo.png" alt="长兴湖羊LOGO" />
+                长兴湖羊
+            </header>
+            <article class="article">
+                <h1>登录界面</h1>
+                <el-form label-position="right" label-width="80px" :model="form">
+                    <el-form-item label="账号:">
+                        <el-input v-model="form.userName" placeholder="请输入账号"></el-input>
+                    </el-form-item>
+                    <el-form-item label="密码:">
+                        <el-input v-model="form.userPwd" placeholder="请输入密码" show-password></el-input>
+                    </el-form-item>
+                    <el-form-item>
+                        <el-button type="primary" @click="onSignIn">登录</el-button>
+                    </el-form-item>
+                </el-form>
+            </article>
+            <el-dialog title="请选择一个组织" :visible.sync="isShowDialog" append-to-body>
+                <el-select v-model="orgSelected">
+                    <el-option
+                        v-for="item in orgList"
+                        :key="item.id"
+                        :value="item.id"
+                        :label="item.orgName"
+                    ></el-option>
+                </el-select>
+                <div slot="footer">
+                    <el-button @click="isShowDialog=false">取 消</el-button>
+                    <el-button type="primary" @click="handleSet">设置</el-button>
+                </div>
+            </el-dialog>
+        </div>
+    </div>
+</template>
+<script>
+import { reqLogin, reqOrgChoose, reqOrganizationId } from "@/api/login";
+
+export default {
+    name: "login",
+    data() {
+        return {
+            form: {
+                userName: "huyang",
+                userPwd: "123456"
+            },
+            isShowDialog: false,
+            orgList: null,
+            orgSelected: null
+        };
+    },
+    created() {},
+    methods: {
+        /* 登录按钮 */
+        onSignIn() {
+            const loading = this.$loading({
+                lock: true,
+                text: "登录中...",
+                spinner: "el-icon-loading",
+                background: "rgba(0, 0, 0, 0.7)"
+            });
+            reqLogin(this.form)
+                .then(res => {
+                    loading.close();
+                    localStorage.setItem("token", res.token);
+                    this.doOrganizationChoose();
+                })
+                .catch(err => {
+                    console.log("登录失败", err);
+                    this.$message.error("登录失败:" + err);
+                });
+        },
+        handleSet: function() {
+            if (!this.orgSelected) {
+                this.$message.info("请先选择组织");
+            } else this.setOrganizationId(this.orgSelected);
+        },
+        doOrganizationChoose() {
+            this.loading = true;
+            reqOrgChoose()
+                .then(res => {
+                    if (res == null || res.length == 0) {
+                        this.$message.info("您没有加入任何组织!");
+                    } else if (res.length > 1) {
+                        this.isShowDialog = true;
+                        this.orgList = res;
+                    } else {
+                        this.setOrganizationId(res[0].id);
+                    }
+                })
+                .catch(err => {
+                    console.log(err);
+                    this.loading = false;
+                    this.$message.error("登录失败:" + err);
+                });
+        },
+        setOrganizationId(id) {
+            if (!id) {
+                this.$message.error("发生了一点不愉快的错误!");
+                return;
+            }
+            this.loading = true;
+            reqOrganizationId({ orgId: id })
+                .then(res => {
+                    this.isShowDialog = false;
+                    //导航到 正式页面
+                    this.$router.replace("/home");
+                })
+                .catch(err => {
+                    if (err.errMsg) this.$message.error(err.errMsg);
+                    else this.$message.error("服务器发生异常");
+                })
+                .finally(res => {
+                    this.loading = false;
+                });
+        }
+    },
+    mounted() {}
+};
+</script>
+
+<style lang="scss" scoped>
+.login {
+    width: 100%;
+    height: 100%;
+    background: url(../../assets/login_bg.jpg) 0 0 no-repeat;
+    background-size: 100% 100%;
+    .shade {
+        height: 100%;
+        width: 100%;
+        background-color: #8899aa44;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        .header {
+            font-size: 60px;
+            color: #eee;
+            margin: 180px 0 50px 0;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            .logo {
+                height: 70px;
+                width: 70px;
+                margin-right: 20px;
+            }
+        }
+        .article {
+            width: 400px;
+            background-color: #ffffff44;
+            padding: 20px 60px 40px 20px;
+            border-radius: 20px;
+            h1 {
+                font-size: 20px;
+                color: #eee;
+                margin-left: 25px;
+            }
+            /deep/ .el-form-item .el-form-item__label {
+                color: #eee;
+            }
+        }
+    }
+}
+</style>

+ 134 - 0
src/views/basicInfo/firmInfo.vue

@@ -0,0 +1,134 @@
+<template>
+    <div class="firmInfo">
+        <h2
+            style="margin-bottom: 20px;padding-bottom:7px;border-bottom:2px solid #ddd"
+        >
+            企业信息
+        </h2>
+        <div class="left">
+            <el-form ref="form" :model="form">
+                <el-form-item label="企业名称">
+                    <el-input v-model="form.name"></el-input>
+                </el-form-item>
+                <el-form-item label="邮箱">
+                    <el-input v-model="form.email"></el-input>
+                </el-form-item>
+                <el-form-item label="企业简介">
+                    <el-input
+                        type="textarea"
+                        v-model="form.decription"
+                        autosize
+                    ></el-input>
+                </el-form-item>
+                <el-form-item label="国家地区">
+                    <el-input v-model="form.province"></el-input>
+                </el-form-item>
+                <el-form-item label="所在省市">
+                    <el-row type="flex" justify="space-between">
+                        <el-col :span="11">
+                            <el-input v-model="form.country"></el-input>
+                        </el-col>
+                        <el-col :span="11">
+                            <el-input v-model="form.city"></el-input>
+                        </el-col>
+                    </el-row>
+                </el-form-item>
+                <el-form-item label="详细地址">
+                    <el-input v-model="form.address"></el-input>
+                </el-form-item>
+                <el-form-item label="联系电话">
+                    <el-row type="flex" :gutter="19">
+                        <el-input v-model="form.tel"></el-input>
+                    </el-row>
+                </el-form-item>
+                <el-form-item>
+                    <el-button
+                        style="margin-left:60%"
+                        type="primary"
+                        @click="onSubmit"
+                        >更新信息</el-button
+                    >
+                </el-form-item>
+            </el-form>
+        </div>
+    </div>
+</template>
+
+<script>
+// import { reqFirminfo, reqUpdateFirm } from "@/api/fileInfo.js";
+export default {
+    name: "firmInfo",
+    data() {
+        return {
+            // 保留接口结构
+            reqInfo: {},
+            form: {
+                name: "",
+                email: "",
+                decription: "",
+                province: "",
+                country: "",
+                city: "",
+                address: "",
+                tel: ""
+            }
+        };
+    },
+    created() {
+        // this.getFirminfo();
+    },
+    methods: {
+        // 更新企业信息
+        onSubmit() {
+            let tempArr = [];
+            for (const key in this.form) {
+                tempArr.push({ key, val: this.form[key] });
+            }
+            this.reqInfo.conf = JSON.stringify({
+                data: JSON.stringify(tempArr)
+            });
+            console.log(this.reqInfo);
+            reqUpdateFirm(this.reqInfo)
+                .then(res => {
+                    // this.$message.success("更新企业信息成功!");
+                    if (res.errCode) {
+                        this.$message.error(res.errMsg);
+                    } else {
+                        this.$message.success("成功");
+                    }
+                })
+                .catch(err => {
+                    console.log(err);
+                    this.$message.error("更新企业信息失败!");
+                });
+        },
+        // 获取企业信息
+        getFirminfo() {
+            reqFirminfo()
+                .then(res => {
+                    // 保留接口结构
+                    this.reqInfo = res;
+                    if (res.conf.data) {
+                        let obj = {};
+                        JSON.parse(res.conf.data).forEach(item => {
+                            obj[item.key] = item.val;
+                        });
+                        this.form = obj;
+                    }
+                })
+                .catch(err => {
+                    console.error(err);
+                });
+        }
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+.firmInfo {
+    .left {
+        width: 400px;
+        margin-left: 50px;
+    }
+}
+</style>

+ 17 - 0
vue.config.js

@@ -0,0 +1,17 @@
+module.exports = {
+  publicPath: './', // 这个值被设置为空字符串 ('') 或是相对路径 ('./'),这样所有的资源都会被链接为相对路径,这样打出来的包可以被部署在任意路径。
+  devServer: {
+    disableHostCheck: true
+    // proxy: {
+    //   '^/': {                //这里最好有一个 /
+    //     target: 'http://115.238.57.190:8010',         // 服务器端接口地址
+    //     ws: true,            //如果要代理 websockets,配置这个参数
+    //     // 如果是https接口,需要配置这个参数
+    //     changeOrigin: true,  //是否跨域
+    //     pathRewrite: {
+    //       '^/api': ''
+    //     }
+    //   }
+    // }
+  }
+}