linan há 5 anos atrás
pai
commit
b53f59c7fe

+ 0 - 5
src/api/groupManagment.js

@@ -1,5 +0,0 @@
-import { ajax } from "../sdk/ajax";
-// groupManagment
-
-/* 个体数据 */
-export const reqReportList = (data) => ajax("post", "/analyse/eartag/reportList", data)

Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 0
src/assets/logo2.png


+ 3 - 22
src/router/routes.js

@@ -1,5 +1,5 @@
 import Home from '../views/Home/Home.vue'
-/* 首页 UnityTrace */
+/* 首页  */
 import Index from '@/views/index/Index.vue'
 import DeliveryRoom from '@/views/deliveryRoom/DeliveryRoom.vue'
 import Detail from '@/views/deliveryRoom/detail/Detail.vue'
@@ -8,10 +8,6 @@ import PSY from '@/views/statisticAnalysis/PSY.vue'
 import Crop from '@/views/statisticAnalysis/Crop.vue'
 
 
-/* 群体管理 */
-import GroupRecord from '../views/groupManagment/GroupRecord.vue'
-import UnityTrace from '../views/groupManagment/UnityTrace/UnityTrace.vue'
-
 /* 模板 */
 import Aa from '../views/template/Aa.vue'
 import Ab from '../views/template/Ab.vue'
@@ -23,11 +19,6 @@ import Af from '../views/template/Af.vue'
 
 export default [
   {
-    path: '/about',
-    name: 'about',
-    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
-  },
-  {
 		path: '/home',
 		component: Home,
 		children: [
@@ -58,18 +49,8 @@ export default [
 				name: 'Crop',
 				component: Crop
 			},
-			// 个体管理 deliveryRoom
-			{
-				path: 'UnityTrace',
-				name: 'UnityTrace',
-				component: UnityTrace
-			},
-			// 群体管理
-			{
-				path: 'GroupRecord',
-				name: 'GroupRecord',
-				component: GroupRecord
-			},
+			
+			
 			// 模板
 			{
 				path: 'aa',

+ 0 - 215
src/sdk/index.js

@@ -1,215 +0,0 @@
-import config from './config'
-import axios from 'axios'
-import qs from 'qs'
-
-// 不需要授权的api
-const freeApis = [
-	'/core/auth/login'
-]
-class SDK {
-	constructor() {
-		this._delayedCall = [] // 延迟 处理单元
-		this._errHanlders = [] // 错误 处理器
-		// 创建一个文件上传用的 axios 对象
-		this.uploadInst = axios.create({
-			baseURL: config.serverAddress,
-			timeout: config.timeout,
-			headers: {
-				'Content-Type': 'multipart/form-data'
-			}
-		})
-	}
-	// 设置token 意味着重新登陆了
-	set token(token) {
-		this._token = token
-		// 每次设置token,都需要对延迟调用的 请求 做一次清楚
-		if (this._token) // 只有 token有值的时候才需要请求
-			this._delayedCall.forEach(params => {
-				this.fetch(params)
-			})
-		// 处理完清理,每次新的token来之后都要清理下 老的请求,不管token有没有
-		if (this._delayedCall.length > 0)
-			this._delayedCall.splice(0, this._delayedCall.length)
-	}
-	delDelayedCall(token) {
-		// 每次设置token,都需要对延迟调用的 请求 做一次清楚
-		if (token) // 只有 token有值的时候才需要请求
-			this._delayedCall.forEach(params => {
-				this.fetch(params, token)
-			})
-		// 处理完清理,每次新的token来之后都要清理下 老的请求,不管token有没有
-		if (this._delayedCall.length > 0)
-			this._delayedCall.splice(0, this._delayedCall.length)
-	}
-	// 注册 事件,提供异常过滤事件
-	regErrHanlder(hanlder) {
-		/**
-		 * 如:{
-		 *  errCode : 'token_is_invalid',
-		 *  action: (err,params) => {}
-		 * }
-		 */
-		// 结构正确才可以被接纳
-		if (hanlder.errCode && hanlder.action)
-			this._errHanlders.push(hanlder)
-	}
-
-	// api 请求
-	fetch(params, token) {
-		// console.log('记录请求-----------',params,token)
-		// 错误没必要这里处理,因为 业务有自己的具体处理方案,比如用户状态会维护自己的token,个人认为
-		if (token != null) this.doRequest(params, token)
-		else {
-			if (this.authCheck(params.api)) {
-				this._delayedCall.push(params)
-			} else this.doRequest(params)
-		}
-	}
-
-	/* ======================================================= */
-	// 检查是否需要授权
-	authCheck(api) {
-		return freeApis.findIndex(a => a === api) < 0 // 不存在就 是需要验证的
-	}
-	doRequest(params, token) {
-		// Loading.service({fullscreen: true, text: '拼命加载中....'} )
-		this.checkParams(params) // 异常处理 二选一
-		// 复制一份data
-		if (params.data) {
-			params.data = JSON.parse(JSON.stringify(params.data));
-			// 对 meta数据做下转换
-			if (params.data.meta && typeof params.data.meta === "object") {
-				params.data.meta = JSON.stringify(params.data.meta)
-			}
-		}
-		// if (token) sysParams.token = token // 用户token,新的方式加入header了
-		let method = params.method ? params.method : config.method
-		let timeout = config.timeout;
-		let prepareData = {
-			url: config.serverAddress + params.api,
-			header: {
-				'Content-Type': 'application/x-www-form-urlencoded',
-				'x-auth-token': token
-			},
-			data: {
-				clientid: config.clientid,
-				...params.data
-			},
-			dataType: 'json',
-		}
-		switch (method.toUpperCase()) {
-			case 'POST': {
-				axios.post(prepareData.url, qs.stringify(prepareData.data), { headers: prepareData.header, timeout })
-					.then(response => {
-						this.dealResponse(response, params)
-					}).catch(error => {
-						console.log('post---------', error)
-						if (error.response == null)
-							error.response = { errCode: 'net_error', errMsg: '网络异常' }
-						if (error.response.data && error.response.data.errCode) this.dealResponse(error.response, params)
-						else this.completeSDK(error.response, params)
-					})
-				break
-			}
-			case 'upload': {
-				this.upload(params.api, prepareData)
-					.then(response => {
-						this.dealResponse(response, params)
-					}).catch(error => {
-						console.log('upload---------', error)
-						if (error.response.data && error.response.data.errCode) this.dealResponse(error.response, params)
-						else this.completeSDK(error.response, params)
-					})
-				break
-			}
-			default:
-				axios.get(prepareData.url, { params: prepareData.data, headers: prepareData.header }, { timeout })
-					.then(response => {
-						this.dealResponse(response, params)
-					}).catch(error => {
-						if (error.response && error.response.data && error.response.data.errCode) this.dealResponse(error.response, params)
-						else this.completeSDK(error.response, params)
-					})
-				break
-		}
-	}
-	upload(apiName, prepareData) {
-		return new Promise((resolve, reject) => {
-			// console.log('看看 request',request)
-			// 组装formData
-			let fd = new FormData()
-			fd.append('file', prepareData.data.file, encodeURIComponent(prepareData.data.file.name))
-			Object.keys(prepareData.data).forEach(key => {
-				if (key !== 'file')
-					fd.append(key, prepareData.data[key])
-			})
-			this.uploadInst.post(apiName, fd)
-				.then(response => {
-					resolve(response)
-				}).catch(error => {
-					reject(error)
-				})
-		})
-	}
-	uploadCustom(params, token) {
-		//url,file,fieldName='file'
-		return new Promise((resolve, reject) => {
-			let fd = new FormData()
-			fd.append(params.fieldName, params.file, encodeURIComponent(params.file.name))
-			if (token)
-				fd.append("token", token)
-			this.uploadInst.post(params.url, fd)
-				.then(response => {
-					resolve(response)
-				}).catch(error => {
-					reject(error)
-				})
-		})
-	}
-	//集中处理get,post的respone
-	dealResponse(response, params) {
-		if (response.data.errCode) {
-			// console.log('delresponse-------',response)
-			if (this._errHanlders.length > 0) this.doErrHanlder(response, params)
-			if (params.fail) params.fail(response.data)
-		} else {
-			try {
-				if (params.success) {
-					params.success(response.data)
-				}
-				if (params.complete) params.complete(response.data)
-			} catch (e) {
-				// console.log('截获错误---------', e)
-			}
-		}
-		this.completeSDK(response, params)
-	}
-
-	// 错误回调 这里的错误是指 服务器端 的特定错误
-	doErrHanlder(res, params) {
-		console.log('处理指定错误------', res, params)
-		if (res.data && res.data.errCode) {
-			this._errHanlders.forEach(h => {
-				if (res.data.errCode === h.errCode) // 判断 错误编码是否匹配
-					h.action(res.data, params) // 回调
-			})
-		}
-	}
-
-	// 检查参数
-	checkParams(params) {
-		// console.log('throw error-------',params)
-		if (!params.api) throw new Error("api没有设置")
-	}
-	completeSDK(e, params) {
-		// console.log('----------------------------completeSDK----------------------------')
-		// console.log(e)
-		// console.log(params)
-		// console.log('----------------------------completeSDK end----------------------------')
-		// setTimeout(()=>{
-		//   Loading.service().close()
-		// },500)
-	}
-}
-
-export default new SDK()

+ 0 - 16
src/views/About.vue

@@ -1,16 +0,0 @@
-<template>
-  <div class="about">
-    <h1>关于页面</h1>
-  </div>
-</template>
-<script>
-export default {
-  name: 'about',
-  mounted() {
-    setTimeout(() => {
-      this.$eventBus.emit('visitedAbout')
-    }, 500)
-  }
-}
-</script>
-

+ 6 - 8
src/views/Home/Home.vue

@@ -49,9 +49,9 @@
                         :unique-opened="true"
                         :default-openeds="defaultUnfoldedMenu"
                         select="1-1"
-                        background-color="rgba(46,38,87)"
-                        text-color="#fff"
-                        active-text-color="#ffd04b"
+                        background-color="rgba(40,44,52)"
+                        text-color="#ddd"
+                        active-text-color="#ff4121"
                     >
                         <div v-for="(item) in menuData " :key="item.index">
                             <el-submenu
@@ -225,10 +225,8 @@ export default {
     background-color: #eee;
     display: flex;
     flex-direction: column;
-    .header {
-        // background-color: #029b62;
-        // background-color: rgb(46,38,87);
-        background-color: rgb(85, 70, 148);
+    >.header {
+        background-color: rgb(48, 57, 75);
         height: 40px;
         padding: 10px 20px;
         margin-bottom: 5px;
@@ -259,7 +257,7 @@ export default {
             box-sizing: border-box;
             .col1 {
                 margin-right: 5px;
-                background-color: rgb(46,38,87);
+                background-color: rgb(40,44,52);
                 // background-image: linear-gradient(to bottom, rgb(85, 70, 148) , rgb(41, 33, 85), rgb(41, 33, 85));
             }
             .col2 {

+ 58 - 106
src/views/Home/mencCofig.js

@@ -8,162 +8,114 @@ export const menuData = [
         disabled: false
     },
     {
-        optionName: "产床管理",
+        optionName: "定点屠宰只能管控",
         iconClassName: "el-icon-setting",
         index: '1',
         disabled: false, // 是否禁用
         childList: [
             {
-                optionName: '产房信息',
+                optionName: '企业采购',
                 index: '1-1',
                 routerName: "DeliveryRoom"
             },
-            // {
-            //     optionName: '牧场信息',
-            //     index: '1-2',
-            //     routerName: "aa"
-            // },
-            // {
-            //     optionName: '猪舍信息',
-            //     index: '1-3',
-            //     routerName: "aa"
-            // },
-            // {
-            //     optionName: '人员信息',
-            //     index: '1-4',
-            //     routerName: "aa"
-            // }
-
+            {
+                optionName: '屠宰加工',
+                index: '1-2',
+                routerName: "DeliveryRoom"
+            },
+            {
+                optionName: '分割加工',
+                index: '1-3',
+                routerName: "DeliveryRoom"
+            },
+            {
+                optionName: '产品检测',
+                index: '1-4',
+                routerName: "DeliveryRoom"
+            },
+            {
+                optionName: '销售管理',
+                index: '1-5',
+                routerName: "DeliveryRoom"
+            },
+            {
+                optionName: '成本核算',
+                index: '1-6',
+                routerName: "DeliveryRoom"
+            },
+            {
+                optionName: '冷库管理',
+                index: '1-7',
+                routerName: "DeliveryRoom"
+            },
         ]
     },
     {
-        optionName: "统计分析",
+        optionName: "产品制作智能监控",
         iconClassName: "el-icon-s-flag",
         index: '2',
         disabled: false,
         childList: [
             {
-                optionName: 'PSY分析',
+                optionName: '产品档案',
                 index: '2-1',
                 routerName: "PSY"
             },
             {
-                optionName: '出栏预测',
+                optionName: '分割登记',
                 index: '2-2',
                 routerName: "Crop"
-            }
-            
-        ]
-    },
-
-    {
-        optionName: "群体管理",
-        iconClassName: "el-icon-s-flag",
-        index: '21',
-        disabled: false,
-        childList: [
-            {
-                optionName: '群体档案',
-                index: '21-1',
-                routerName: "GroupRecord"
             },
             {
-                optionName: '健康分析',
-                index: '21-2',
-                routerName: "aa"
+                optionName: '羊皮登记',
+                index: '2-3',
+                routerName: "Crop"
             },
             {
-                optionName: '转群记录',
-                index: '21-3',
-                routerName: "aa"
+                optionName: '羊血登记',
+                index: '2-4',
+                routerName: "Crop"
             },
             {
-                optionName: '群体盘点',
-                index: '21-4',
-                routerName: "aa"
-            }
+                optionName: '羊杂登记',
+                index: '2-5',
+                routerName: "Crop"
+            },
+            
         ]
     },
-    // 无子菜单的
+
     {
-        optionName: "个体管理",
-        iconClassName: "el-icon-message",
+        optionName: "鲜肉储运智能管控",
+        iconClassName: "el-icon-s-flag",
         index: '3',
         disabled: false,
         childList: [
             {
-                optionName: '种猪档案',
+                optionName: '编码管理',
                 index: '3-1',
-                routerName: "aa"
+                routerName: "GroupRecord"
             },
             {
-                optionName: '个体追踪',
+                optionName: '配送管理',
                 index: '3-2',
-                routerName: "UnityTrace"
-            }
-
-
-        ]
-    },
-    {
-        optionName: "系统配置",
-        iconClassName: "el-icon-coordinate",
-        index: '4',
-        disabled: false,
-        childList: [
-            {
-                optionName: '设备配置',
-                index: '4-1',
-                routerName: "aa"
-            },
-            {
-                optionName: '软件设置',
-                index: '4-2',
-                routerName: "aa"
-            },
-            {
-                optionName: '角色设置',
-                index: '4-3',
-                routerName: "aa"
-            },
-            {
-                optionName: '权限管理',
-                index: '4-4',
-                routerName: "aa"
-            }
-        ]
-    },
-    {
-        optionName: "系统设置",
-        iconClassName: "el-icon-monitor",
-        index: '5',
-        disabled: false, // 是否禁用
-        childList: [
-            {
-                optionName: '群体广播',
-                index: '5-1',
                 routerName: "aa"
             },
             {
-                optionName: '设备配置',
-                index: '5-2',
+                optionName: '运输管理',
+                index: '3-3',
                 routerName: "aa"
             },
             {
-                optionName: '系统参数',
-                index: '5-3',
+                optionName: '门店管理',
+                index: '3-4',
                 routerName: "aa"
             },
             {
-                optionName: '角色配置',
-                index: '5-4',
+                optionName: '产品追溯',
+                index: '3-5',
                 routerName: "aa"
             },
-            {
-                optionName: '权限分配',
-                index: '5-5',
-                routerName: "aa"
-            }
         ]
     },
     {

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

@@ -37,7 +37,6 @@
     </div>
 </template>
 <script>
-import sdk from "../../sdk/index";
 
 import { reqLogin, reqOrgChoose, reqOrganizationId } from "@/api/login";
 
@@ -55,15 +54,6 @@ export default {
         };
     },
     created() {
-        //注册一个登录失败的事件
-        sdk.regErrHanlder({
-            errCode: "login_failed",
-            action: e => {
-                if (e.errMsg) {
-                    this.$message.error(e.errMsg);
-                }
-            }
-        });
     },
     methods: {
         /* 登录按钮 */

+ 88 - 3
src/views/template/Aa.vue

@@ -1,6 +1,60 @@
 <template>
+<!-- 静态  -->
     <div class="GroupRecord">
-        
+        <header id="header">
+            <el-row type="flex">
+                <el-col :span="4">
+                    <el-select v-model="value" placeholder="请选择">
+                        <el-option label="1区" value="11"></el-option>
+                        <el-option label="2区" value="22"></el-option>
+                    </el-select>
+                </el-col>
+                <el-col :span="4">
+                    <el-select v-model="value" placeholder="请选择">
+                        <el-option label="1舍" value="13"></el-option>
+                        <el-option label="2舍" value="24"></el-option>
+                    </el-select>
+                </el-col>
+                <el-col :span="4">
+                    <el-select v-model="value" placeholder="请选择">
+                        <el-option label="可用" value="15"></el-option>
+                        <el-option label="可用" value="26"></el-option>
+                    </el-select>
+                </el-col>
+                <el-col :span="4">
+                    <el-button type="primary">查找</el-button>
+                </el-col>
+            </el-row>
+        </header>
+        <section>
+            <article class="table">
+                <el-table :data="tableData" border style="width: 100%">
+                    <el-table-column prop="date" sortable label="日期" width="180"></el-table-column>
+                    <el-table-column prop="id" sortable label="猪编号" width="180"></el-table-column>
+                    <el-table-column prop="name" label="状态" width="180"></el-table-column>
+                    <el-table-column prop="address" label="耳标号"></el-table-column>
+                    <el-table-column label="操作" width="150">
+                        <template slot-scope="scope">
+                            <el-button @click="look(scope.row)" type="text" size="small">查看</el-button>
+                            <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
+                            <el-popconfirm title="是否删除此设备的信息?" @onConfirm="del(scope.row)">
+                                <el-button slot="reference" type="text" size="small">删除</el-button>
+                            </el-popconfirm>
+                        </template>
+                    </el-table-column>
+                </el-table>
+                <el-row type="flex" justify="end">
+                    <el-col :span="8" class="pagination">
+                        <el-pagination
+                            @current-change="pageChange"
+                            background
+                            layout="prev, pager, next"
+                            :page-count="10"
+                        ></el-pagination>
+                    </el-col>
+                </el-row>
+            </article>
+        </section>
     </div>
 </template>
 
@@ -8,12 +62,43 @@
 export default {
     data() {
         return {
-            
+            value: "",
+            tableData: [
+                {
+                    date: "2020-05-02",
+                    name: "可用",
+                    id: '825',
+                    address: "6895564457554"
+                },
+                {
+                    date: "2020-05-04",
+                    name: "不可用",
+                    id: '826',
+                    address: "6895564456725"
+                },
+                {
+                    date: "2020-05-03",
+                    name: "可用",
+                    id: '830',
+                    address: "6895564457594"
+                }
+            ]
         };
     },
     created() {},
     methods: {
-        
+        look(row) {
+            console.log(row)
+            this.$router.push({
+                path: 'UnityTrace',
+                query: row
+            })
+        },
+        edit(row) {},
+        del(row) {},
+        pageChange(p) {
+            console.log(p)
+        }
     }
 };
 </script>

+ 0 - 21
src/views/template/Ad.vue

@@ -13,29 +13,8 @@ export default {
         return {};
     },
     created() {
-        // this.get()
     },
     methods: {
-        ...mapActions(["fetch"]),
-        get() {
-            console.log('999')
-            this.fetch({
-                api: "core/memberInfo/list",
-                method: "GET",
-                data: {
-                    tableId: 1,
-                    breedingId: 1
-                },
-                success: res => {
-                    console.log(res);
-                },
-                fail: err => {
-                    console.log(err);
-                    if (err.errMsg) this.$message.error(err.errMsg);
-                    else this.$message.error("服务器发生异常");
-                }
-            });
-        }
     }
 };
 </script>

+ 0 - 16
src/views/template/Ae.vue

@@ -14,22 +14,6 @@ export default {
     },
     created() {},
     methods: {
-        ...mapActions(["fetch"]),
-        get() {
-            this.fetch({
-                api: "aaa",
-                method: "GET",
-                data: {},
-                success: res => {
-                    console.log(res);
-                },
-                fail: err => {
-                    console.log(err);
-                    if (err.errMsg) this.$message.error(err.errMsg);
-                    else this.$message.error("服务器发生异常");
-                }
-            });
-        }
     }
 };
 </script>