فهرست منبع

Merge branch 'release/v1.0.2' into beefcattleAdmin

duanxiaoduan 1 سال پیش
والد
کامیت
2302865593

+ 90 - 16
.drone.yml

@@ -1,19 +1,8 @@
 kind: pipeline
 type: docker
-name: tmp-admin
-
-clone:
-  depth: 1
-  disable: true
+name: test
 
 steps:
-  - name: clone
-    image: alpine/git
-    commands:
-      - git config --global credential.helper store
-      - git clone -b develop http://192.168.1.8:3000/duanxiaoduan/tmr-admin.git
-      - cp -R tmr-admin/* ./
-      - ls -l
   - name: build
     image: plugins/docker
     volumes:
@@ -31,16 +20,25 @@ steps:
         from_secret: aliyun_password
       repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/tmr-admin
       registry: registry.cn-hangzhou.aliyuncs.com
-      tags: [1.0.0,latest]
-
+      tags: [test]
+  - name: ssh commands
+    image: appleboy/drone-ssh
+    settings:
+      host: 192.168.1.70
+      username: tmrwatch
+      password:
+        from_secret: ssh_password
+      port: 22
+      script:
+        - cd /data/docker-compose/calf-feed-admin/
+        - echo "123456" | ./restart.sh
 trigger:
   branch:
     include:
-      - develop
+      - feature/*
   event:
     include:
       - push
-
 volumes:
   - name: host
     host:
@@ -51,3 +49,79 @@ volumes:
   - name: docker-sock
     host:
       path: /var/run/docker.sock
+---
+kind: pipeline
+type: docker
+name: product
+steps:
+  - name: build
+    image: plugins/docker:20.14.2
+    volumes:
+      - name: hosts
+        path: /etc/hosts
+      - name: docker-ca
+        path: /etc/docker
+      - name: docker-sock
+        path: /var/run/docker.sock
+    settings:
+      username:
+        from_secret: aliyun_name
+      password:
+        from_secret: aliyun_password
+      repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/tmr-admin
+      registry: registry.cn-hangzhou.aliyuncs.com
+      tag:
+        - latest
+        - ${DRONE_BRANCH##release/}
+trigger:
+  branch:
+    include:
+      - release/*
+  event:
+    include:
+      - push
+volumes:
+  - name: docker-ca
+    host:
+      path: /etc/docker
+  - name: docker-sock
+    host:
+      path: /var/run/docker.sock
+---
+kind: pipeline
+type: docker
+name: hotfix
+
+steps:
+  - name: build
+    image: plugins/docker:20.14.2
+    volumes:
+      - name: hosts
+        path: /etc/hosts
+      - name: docker-ca
+        path: /etc/docker
+      - name: docker-sock
+        path: /var/run/docker.sock
+    settings:
+      username:
+        from_secret: aliyun_name
+      password:
+        from_secret: aliyun_password
+      repo: registry.cn-hangzhou.aliyuncs.com/kpt-event/tmr-admin
+      registry: registry.cn-hangzhou.aliyuncs.com
+      tag:
+        - latest
+trigger:
+  branch:
+    include:
+      - hotfix/*
+  event:
+    include:
+      - push
+volumes:
+  - name: docker-ca
+    host:
+      path: /etc/docker
+  - name: docker-sock
+    host:
+      path: /var/run/docker.sock

+ 2 - 1
.env.development

@@ -6,7 +6,8 @@ ENV = 'development'
 # VUE_APP_BASE_API = 'http://192.168.1.70:8082/'
 # VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 # 白少后台本地
-VUE_APP_BASE_API = 'http://192.168.1.77:8081/'
+# VUE_APP_BASE_API = 'http://192.168.1.77:8081/'
+VUE_APP_BASE_API = 'http://192.168.1.93/'
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.
 # It only does one thing by converting all import() to require().

+ 1 - 1
Dockerfile

@@ -12,7 +12,7 @@ RUN npm run build:prod
 # 第二阶段构建
 FROM nginx:alpine
 COPY --from=builder /app/tmr-admin/dist/ /usr/share/nginx/html/
-COPY --from=builder /app/tmr-admin/default.conf.template /etc/nginx/templates/default.conf.template
+COPY --from=builder /app/tmr-admin/default.conf.template /etc/nginx/conf.d/default.conf
 EXPOSE 80
 
 CMD ["/bin/sh", "-c", "sed -i \"s@<html@<html domain=\"$DOMAIN\"@\" /usr/share/nginx/html/index.html; nginx -g \"daemon off;\""]

+ 16 - 44
default.conf.template

@@ -1,54 +1,26 @@
 server {
-    listen       80;
-    listen  [::]:80;
-    server_name  localhost;
+   listen       80;
+   listen  [::]:80;
+   server_name  localhost;
 
-    #access_log  /var/log/nginx/host.access.log  main;
+   gzip on;
+   gzip_static on;
+   gzip_comp_level 6;
+   gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
 
    location / {
         root /usr/share/nginx/html;
         #index index.html;
         try_files $uri $uri/ /index.html;
+        client_max_body_size 300m;   #最大接受300m文件以内的
+        client_body_timeout 20s;
    }
-    #error_page  404              /404.html;
+   #error_page  404              /404.html;
 
-    # redirect server error pages to the static page /50x.html
-    #
-    error_page   500 502 503 504  /50x.html;
-    location = /50x.html {
-        root   /usr/share/nginx/html;
-    }
-
-    # location /prod-api/ {
-    #    proxy_pass  ${BACKEND_HOST};
-    #    proxy_set_header Host $host;
-    #    proxy_set_header X-Real-IP $remote_addr;
-    #    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-    #    proxy_http_version 1.1;
-    #    proxy_set_header Connection "";
-    #}
-
-    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
-    #
-    #location ~ \.php$ {
-    #    proxy_pass   http://127.0.0.1;
-    #}
-
-    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
-    #
-    #location ~ \.php$ {
-    #    root           html;
-    #    fastcgi_pass   127.0.0.1:9000;
-    #    fastcgi_index  index.php;
-    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
-    #    include        fastcgi_params;
-    #}
-
-    # deny access to .htaccess files, if Apache's document root
-    # concurs with nginx's one
-    #
-    #location ~ /\.ht {
-    #    deny  all;
-    #}
+   # redirect server error pages to the static page /50x.html
+   #
+   error_page   500 502 503 504  /50x.html;
+   location = /50x.html {
+      root   /usr/share/nginx/html;
+   }
 }
-

+ 1 - 1
src/utils/request.js

@@ -15,7 +15,7 @@ var reg =  /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}
 var browserUrl = window.location.hostname
 console.log("========url===",reg.test(browserUrl))
 if (reg.test(browserUrl)){
-  URL = window.location.protocol +"//"+ browserUrl + ":8082"
+  URL = window.location.protocol +"//"+ browserUrl + ":8082/"
 }
 
 Cookies.set('url',URL)

+ 6 - 16
src/views/formulationPlan/dhedFormula/index.vue

@@ -45,7 +45,6 @@
         class="elTable table-fixed"
         :max-height="myHeight"
         @header-click="headerClick"
-        @cell-click="cellClick"
         @selection-change="handleSelect"
         @cell-dblclick="celldblclick"
       >
@@ -110,7 +109,7 @@
         <el-table-column v-if="table.isRW1 && table.isPtsfname" :key="10" label="第一班补料重量" min-width="100px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.bw1 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.bw1" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw1" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW2" :key="11" label="第二班比例(%)" min-width="85px" align="center">
@@ -128,7 +127,7 @@
         <el-table-column v-if="table.isRW2 && table.isPtsfname" :key="13" label="第二班补料重量" min-width="100px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.bw2 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.bw2" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw2" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW3" :key="14" label="第三班比例(%)" min-width="85px" align="center">
@@ -146,7 +145,7 @@
         <el-table-column v-if="table.isRW3 && table.isPtsfname" :key="16" label="第三班补料重量" min-width="100px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.bw3 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.bw3" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw3" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW4" :key="17" label="第四班比例(%)" min-width="85px" align="center">
@@ -164,7 +163,7 @@
         <el-table-column v-if="table.isRW4 && table.isPtsfname" :key="19" label="第四班补料重量" min-width="90px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.bw4 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.bw4" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw4" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW5" :key="20" label="第五班比例(%)" min-width="85px" align="center">
@@ -182,7 +181,7 @@
         <el-table-column v-if="table.isRW5 && table.isPtsfname" :key="22" label="第五班补料重量" min-width="90px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.bw5 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.bw5" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw5" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
           </template>
         </el-table-column>
         <el-table-column v-if="table.isRW6" :key="23" label="第六班比例(%)" min-width="85px" align="center">
@@ -200,7 +199,7 @@
         <el-table-column v-if="table.isRW6 && table.isPtsfname" :key="25" label="第六班补料重量" min-width="90px" align="center">
           <template slot-scope="scope">
             <span v-if="scope.row.NoEdit">{{ scope.row.bw6 }}</span>
-            <el-input v-if="scope.row.Edit" v-model="scope.row.bw6" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" @blur="blurBw(scope.row)" @focus="focusBw(scope.row)" />
+            <el-input v-if="scope.row.Edit" v-model="scope.row.bw6" :disabled="scope.row.ptsfid == '-1' || scope.row.ptsfid == ''" step="0.01" type="number" style="width:100%;padding:10px 0;" />
           </template>
         </el-table-column>
         <el-table-column :key="26" label="饲喂总比例(%)" min-width="60px" align="center">
@@ -2238,9 +2237,6 @@ export default {
       this.getList()
       // this.$router.push('/formulationPlan/dhedFormula')
     },
-    cellClick(row, column, event) {
-      console.log(column)
-    },
     handleSelect(val) {
       console.log('勾选数据', val)
       this.selectList = val
@@ -3115,12 +3111,6 @@ export default {
       this.$refs.mychild.getBalconicFormula()
       this.$refs.mychild.restTemp()
     },
-    blurBw(row) {
-      console.log(row)
-    },
-    focusBw(row) {
-      console.log(row)
-    },
     handleSynchronous(){
       const url = 'authdata/ud/feedp/sync'
       const data = {}

+ 8 - 2
src/views/formulationPlan/recipeTemplate/index.vue

@@ -841,7 +841,8 @@ export default {
       isRoleEdit: [],
       myheight: document.documentElement.clientHeight - 265,
       requestParams: [
-        { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] },
+        {"name":"getCowclassList","page":1,"offset":1,"pagecount":50,"returntype":"Map","parammaps":{"pastureid":Cookies.get('pastureid'),"classname":"","parentname":"","enable":1}},
+        // { name: 'getDictByName', offset: 0, pagecount: 0, params: ['牲畜父类'] },
         { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['配方类型'] },
         { name: 'getFeedAndPre', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
         { name: 'getDistCattle', offset: 0, pagecount: 0, parammaps: {}}
@@ -1219,7 +1220,12 @@ export default {
     },
     getDownList() {
       GetDataByNames(this.requestParams).then(response => {
-        this.livestockTypeList = response.data.getDictByName.list
+        // this.livestockTypeList = response.data.getDictByName.list
+        this.livestockTypeList = response.data.getCowclassList.list
+        for(var i=0;i<this.livestockTypeList.length;i++){
+        	this.livestockTypeList[i].label = this.livestockTypeList[i].classname;
+        	this.livestockTypeList[i].value = this.livestockTypeList[i].id;
+        }
         this.formulaTypeList = response.data.getDictByName2.list
         this.feedNameList = response.data.getFeedAndPre.list
         this.distCattle = response.data.getDistCattle.list

+ 19 - 5
src/views/statisticalAnalysis/processAnalysis/pasture/index.vue

@@ -728,7 +728,9 @@ export default {
             this.isSpreadingPlan = false
             this.isResidualMaterialPlan = false
             this.isSpreadingPlanSH = false
-            this.isSpreadingPlanSS = false
+            this.isSpreadingPlanSS = false
+            this.table2.getdataListParm.name = 'getprocessAnalysisStr'
+            this.table3.getdataListParm.name = 'getprocessAnalysisHL'
             this.table2.getdataListParm.parammaps.id = response.data.list[0].id
             this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
@@ -763,7 +765,10 @@ export default {
             this.isResidualMaterialPlan = false
             this.isPremixedPlan = false
             this.isSpreadingPlanSH = true
-            this.isSpreadingPlanSS = false
+            this.isSpreadingPlanSS = false
+            this.table2.getdataListParm.name = 'getprocessAnalysisStr'
+            this.table3.getdataListParm.name = 'getprocessAnalysisHL'
+            this.table4.getdataListParm.name = 'getprocessAnalysisSL'
             this.table2.getdataListParm.parammaps.id = response.data.list[0].id
             this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
@@ -784,7 +789,10 @@ export default {
             this.isResidualMaterialPlan = false
             this.isPremixedPlan = false
             this.isSpreadingPlanSH = false
-            this.isSpreadingPlanSS = true
+            this.isSpreadingPlanSS = true
+            this.table2.getdataListParm.name = 'getprocessAnalysisStr'
+            this.table3.getdataListParm.name = 'getprocessAnalysisHL'
+            this.table4.getdataListParm.name = 'getprocessAnalysisSL'
             this.table2.getdataListParm.parammaps.id = response.data.list[0].id
             this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
@@ -805,7 +813,10 @@ export default {
             this.isResidualMaterialPlan = false
             this.isPremixedPlan = false
             this.isSpreadingPlanSH = true
-            this.isSpreadingPlanSS = false
+            this.isSpreadingPlanSS = false
+            this.table2.getdataListParm.name = 'getprocessAnalysisStr'
+            this.table3.getdataListParm.name = 'getprocessAnalysisHL'
+            this.table4.getdataListParm.name = 'getprocessAnalysisSL'
             this.table2.getdataListParm.parammaps.id = response.data.list[0].id
             this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id
@@ -826,7 +837,10 @@ export default {
             this.isResidualMaterialPlan = false
             this.isPremixedPlan = false
             this.isSpreadingPlanSH = false
-            this.isSpreadingPlanSS = false
+            this.isSpreadingPlanSS = false
+            this.table2.getdataListParm.name = 'getprocessAnalysisStr'
+            this.table3.getdataListParm.name = 'getprocessAnalysisHL'
+            this.table4.getdataListParm.name = 'getprocessAnalysisSL'
             this.table2.getdataListParm.parammaps.id = response.data.list[0].id
             this.table2.getdataListParm.parammaps.pastureid = response.data.list[0].pastureid
             this.table3.getdataListParm.parammaps.pid = response.data.list[0].id