zhaozp 3 лет назад
Родитель
Сommit
b69e1e25ec

+ 1 - 1
config/dev.env.js

@@ -4,7 +4,7 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
-  EMBED_API: '"http://blue.cn1.utools.club/api5/"',
+  BASE_API: '"http://172.18.1.227:30048/"',
   // EMBED_API: '"http://39.100.230.190:8089"',
   TIME_OUT: '"20000"'
 })

+ 2 - 1
config/prod.env.js

@@ -1,6 +1,7 @@
 'use strict'
 module.exports = {
   NODE_ENV: '"production"',
-  // BASE_API: '"http://39.100.230.190:8089"',
+  // BASE_API: '"http://39.100.230.190:30048/"',
+  BASE_API: '"http://81.70.84.72:30048/"',
   TIME_OUT: '"100000"'
 }


+ 1 - 1
src/api/common.js

@@ -4,7 +4,7 @@ import request from '@/utils/request'
 export const refreshToken = (object) => { return request({ url: "/auth/refreshToken", data: {}})}
 
 // 获取所有产品
-export const getAllProject = (object) => { return request({ url: "/common/getAllProduct", data: {}})}
+export const getAllProject = (object) => { return request({ url: "/common/getAllProductNo", data: {}})}
 
 // 查询模具列表
 export const maintainMouldPage = (object) => { return request({ url: "/maintainMould/maintainMouldPage", data: object})}

+ 10 - 7
src/components/navcon.vue

@@ -8,7 +8,7 @@
 <!--    </el-button>-->
     <div class="submenu">
       <div style="margin-right: 20px">责任人:&emsp;{{ username }}</div>
-<!--      <el-button size="small" type="primary" @click="exit">退出登录</el-button>-->
+     <el-button size="small" type="primary" @click="exit">返回</el-button>
     </div>
   </el-menu>
 </template>
@@ -32,12 +32,15 @@ export default {
     this.get_login_user_info()
   },
   methods: {
-     get_login_user_info() {
-      getLoginUserInfo().then(res=> {
-        // setStore({'name': 'user', 'content': res.data, 'type':''})
-        this.username = res.data.name
-      })
-    }
+  get_login_user_info() {
+    getLoginUserInfo().then(res=> {
+      // setStore({'name': 'user', 'content': res.data, 'type':''})
+      this.username = res.data.name
+    })
+  },
+	exit() {
+    window.location.href = `http://81.70.84.72:30043/planWeb/#/choose?token=${getStore({'name':'token','type':'','debug':''})}`
+	}
     // // 退出登录
     // exit() {
     //   this.$confirm('退出登录, 是否继续?', '提示', {

+ 29 - 0
src/utils/debounce.js

@@ -0,0 +1,29 @@
+let timeout = null;
+
+/**
+ * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
+ * 
+ * @param {Function} func 要执行的回调函数 
+ * @param {Number} wait 延时的时间
+ * @param {Boolean} immediate 是否立即执行 
+ * @return null
+ */
+function debounce(func, wait = 500, immediate = false) {
+	// 清除定时器
+	if (timeout !== null) clearTimeout(timeout);
+	// 立即执行,此类情况一般用不到
+	if (immediate) {
+		var callNow = !timeout;
+		timeout = setTimeout(function() {
+			timeout = null;
+		}, wait);
+		if (callNow) typeof func === 'function' && func();
+	} else {
+		// 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
+		timeout = setTimeout(function() {
+			typeof func === 'function' && func();
+		}, wait);
+	}
+}
+
+export default debounce

+ 13 - 12
src/utils/request.js

@@ -2,17 +2,14 @@ import axios from 'axios'
 import { getStore } from '@/utils/store'
 import { Message } from 'element-ui';
 import Router from '../router'
-import { hideFullScreenLoading } from '@/utils/loading'
+import debounce from './debounce.js'
 /**
  * 使用自定义配置新建一个 axios 实例
  * baseURL = 请求路径
  * timeout = 请求超时配置
  */
 const request = axios.create({
-  // baseURL: process.env.BASE_API,
-  // baseURL: '/api',
-  // baseURL: 'http://172.18.0.24:30048/',
-  baseURL: 'http://39.100.230.190:30048/',
+  baseURL: process.env.BASE_API,
   timeout: process.env.TIME_OUT,
   method: "post",
   type: "JSON"
@@ -76,11 +73,14 @@ request.interceptors.response.use(
     //  隐藏加载
     // Spin.hide()
     // 请求成功处理
-    hideFullScreenLoading()
-    if (response.data.status === '50000') {
-      Message.error('凭证过期,请重新登录')
-      // Router.push('/')
-    }
+    if(response.data.message === 'non null hash key required'){
+      let a = debounce(()=>{
+        Message.error('凭证过期,请重新登录')
+      })
+      setTimeout(()=> {
+        window.location.href = 'http://81.70.84.72:8081/baseWeb/login'
+       },1000)
+     }
     return response.data
   },
   error => {
@@ -91,8 +91,9 @@ request.interceptors.response.use(
     console.log(response);
     if (response != undefined && response.data) {
       if (response.data.status == '401' && response.status == 401) {
-        Message.error('凭证过期,请重新登录')
-        // Router.push('/')
+        setTimeout(()=> {
+          window.location.href = 'http://81.70.84.72:8081/baseWeb/login'
+         },1000)
       } else if (response.status == 502) {
         Message.error('网络错误,请检查网络')
       } else if (response.status != 200) {

+ 16 - 3
src/views/everyday/everyday.vue

@@ -37,7 +37,8 @@
     <el-table :data="templateData"
               highlight-current-row
               :header-cell-style="{'background-color':'#FAFAFA','color':'#000'}"
-              border>
+              border
+              size="mini">
       <el-table-column label="序号" width="60" align="center" type="index">
       </el-table-column>
       <el-table-column prop="mouldName" label="模具名称" min-width="60" align="center">
@@ -82,7 +83,7 @@
   import { shiftList,pressTypeList,selectPage,getProjects,getMould_MouldByProjectId,upkeepDelete,exportExcel,exportALLExcel } from "@/api/common"
   import { showFullScreenLoading,hideFullScreenLoading } from '@/utils/loading'
   // 一页数据量
-  const pageSize = 8
+  const pageSize = 10
   export default {
     name: "everyTemplate",
     components: {
@@ -138,11 +139,23 @@
       // 获取点击页数
       get_page(val) {
         this.searchData.page = val
+        this.pageInfo.currentPage = val
         this.get_template_list()
       },
       // 检索
       search() {
-        this.get_template_list()
+        this.searchData.page = 1
+        selectPage(this.searchData).then(res => {
+          if(res.status === '50000') {
+            this.$message.error(res.message)
+            hideFullScreenLoading()
+            return
+          }
+          this.templateData = res.data.row
+          this.pageInfo.currentPage = 1
+          this.pageInfo.total = parseInt(res.data.total)
+          hideFullScreenLoading()
+        })
       },
       // 删除
       del_template(index) {

+ 16 - 3
src/views/everyday/fixture.vue

@@ -37,7 +37,8 @@
     <el-table :data="templateData"
               highlight-current-row
               :header-cell-style="{'background-color':'#FAFAFA','color':'#000'}"
-              border>
+              border
+              size="mini">
       <el-table-column label="序号" width="60" align="center" type="index">
       </el-table-column>
       <el-table-column prop="mouldName" label="夹具名称" min-width="60" align="center">
@@ -82,7 +83,7 @@
   import { shiftList,pressTypeList,selectPages,getProjects,getMould_clampByProjectId,upkeepDelete,exportExcelP,exportALLExcelP } from "@/api/common"
   import { showFullScreenLoading,hideFullScreenLoading } from '@/utils/loading'
   // 一页数据量
-  const pageSize = 8
+  const pageSize = 10
   export default {
     name: "everyTemplate",
     components: {
@@ -138,11 +139,23 @@
       // 获取点击页数
       get_page(val) {
         this.searchData.page = val
+        this.pageInfo.currentPage = val
         this.get_template_list()
       },
       // 检索
       search() {
-        this.get_template_list()
+        this.searchData.page = 1
+        selectPages(this.searchData).then(res => {
+          if(res.status === '50000') {
+            this.$message.error(res.message)
+            hideFullScreenLoading()
+            return
+          }
+          this.templateData = res.data.row
+          this.pageInfo.currentPage = 1
+          this.pageInfo.total = parseInt(res.data.total)
+          hideFullScreenLoading()
+        })
       },
       // 删除
       del_template(index) {

+ 16 - 3
src/views/synthesize/fixture.vue

@@ -37,7 +37,8 @@
     <el-table :data="templateData"
               highlight-current-row
               :header-cell-style="{'background-color':'#FAFAFA','color':'#000'}"
-              border>
+              border
+              size="mini">
       <el-table-column label="序号" width="60" align="center" type="index">
       </el-table-column>
       <el-table-column prop="mouldName" label="夹具名称" min-width="60" align="center">
@@ -82,7 +83,7 @@
   import { shiftList,pressTypeList,selectPageP,getProjects,getMould_clampByProjectId,upkeepDelete,exportExcelM,exportALLExcelM } from "@/api/common"
   import { showFullScreenLoading,hideFullScreenLoading } from '@/utils/loading'
   // 一页数据量
-  const pageSize = 8
+  const pageSize = 10
   export default {
     name: "everyTemplate",
     components: {
@@ -138,11 +139,23 @@
       // 获取点击页数
       get_page(val) {
         this.searchData.page = val
+        this.pageInfo.currentPage = val
         this.get_template_list()
       },
       // 检索
       search() {
-        this.get_template_list()
+        this.searchData.page = 1
+        selectPageP(this.searchData).then(res => {
+          if(res.status === '50000') {
+            this.$message.error(res.message)
+            hideFullScreenLoading()
+            return
+          }
+          this.templateData = res.data.row
+          this.pageInfo.currentPage = 1
+          this.pageInfo.total = parseInt(res.data.total)
+          hideFullScreenLoading()
+        })
       },
       // 删除
       del_template(index) {

+ 16 - 3
src/views/synthesize/synthesize.vue

@@ -37,7 +37,8 @@
     <el-table :data="templateData"
               highlight-current-row
               :header-cell-style="{'background-color':'#FAFAFA','color':'#000'}"
-              border>
+              border
+              size="mini">
       <el-table-column label="序号" width="60" align="center" type="index">
       </el-table-column>
       <el-table-column prop="mouldName" label="模具名称" min-width="60" align="center">
@@ -82,7 +83,7 @@
   import { shiftList,pressTypeList,selectPageZ,getProjects,getMould_MouldByProjectId,upkeepDelete,exportExcelZ,exportALLExcelZ } from "@/api/common"
   import { showFullScreenLoading,hideFullScreenLoading } from '@/utils/loading'
   // 一页数据量
-  const pageSize = 8
+  const pageSize = 10
   export default {
     name: "everyTemplate",
     components: {
@@ -138,11 +139,23 @@
       // 获取点击页数
       get_page(val) {
         this.searchData.page = val
+        this.pageInfo.currentPage = val
         this.get_template_list()
       },
       // 检索
       search() {
-        this.get_template_list()
+        this.searchData.page = 1
+        selectPageZ(this.searchData).then(res => {
+          if(res.status === '50000') {
+            this.$message.error(res.message)
+            hideFullScreenLoading()
+            return
+          }
+          this.templateData = res.data.row
+          this.pageInfo.currentPage = 1
+          this.pageInfo.total = parseInt(res.data.total)
+          hideFullScreenLoading()
+        })
       },
       // 删除
       del_template(index) {

+ 11 - 4
src/views/template/fixture.vue

@@ -30,7 +30,8 @@
     <el-table :data="templateData"
               highlight-current-row
               :header-cell-style="{'background-color':'#FAFAFA','color':'#000'}"
-              border>
+              border
+			  size="mini">
       <el-table-column label="序号" width="60" align="center" type="index">
       </el-table-column>
       <el-table-column prop="mouldName" label="夹具名称" min-width="60" align="center">
@@ -90,7 +91,7 @@
         </el-form-item>
         <el-form-item prop="phone" label-width="80px" >
           <div slot="label">产&emsp;&emsp;品:</div>
-          <el-select v-model="addForm.productId" placeholder="请选择" size="small">
+          <el-select v-model="addForm.productId" filterable placeholder="请选择" size="small">
             <el-option v-for="item in products" :label="item.name" :key="item.id" :value="item.id">
             </el-option>
           </el-select>
@@ -109,7 +110,7 @@
   import { getAllProject,maintainMouldPage,maintainMouldAdd,deleteMaintainMould,maintainMouldUpdate } from "@/api/common"
   import { showFullScreenLoading,hideFullScreenLoading } from '@/utils/loading'
   // 一页数据量
-  const pageSize = 8
+  const pageSize = 10
   export default {
     name: "fixture",
     components: {
@@ -186,11 +187,17 @@
       // 获取点击页数
       get_page(val) {
         this.searchData.page = val
+        this.pageInfo.currentPage = val
         this.get_template_list()
       },
       // 检索
       search() {
-        this.get_template_list()
+        this.searchData.page = 1
+        maintainMouldPage(this.searchData).then(res => {
+          this.templateData = res.data.row
+          this.pageInfo.currentPage = 1
+          this.pageInfo.total = parseInt(res.data.total)
+        })
       },
       // 新增模板
       add_template() {

+ 13 - 5
src/views/template/template.vue

@@ -30,7 +30,8 @@
     <el-table :data="templateData"
               highlight-current-row
               :header-cell-style="{'background-color':'#FAFAFA','color':'#000'}"
-              border>
+              border
+              size="mini">
       <el-table-column label="序号" width="60" align="center" type="index">
       </el-table-column>
       <el-table-column prop="mouldName" label="模具名称" min-width="60" align="center">
@@ -90,7 +91,7 @@
         </el-form-item>
         <el-form-item prop="phone" label-width="80px" >
           <div slot="label">产&emsp;&emsp;品:</div>
-          <el-select v-model="addForm.productId" placeholder="请选择" size="small">
+          <el-select v-model="addForm.productId" filterable placeholder="请选择" size="small">
             <el-option v-for="item in products" :label="item.name" :key="item.id" :value="item.id">
             </el-option>
           </el-select>
@@ -109,8 +110,8 @@
   import { getAllProject,maintainMouldPage,maintainMouldAdd,deleteMaintainMould,maintainMouldUpdate } from "@/api/common"
   import { showFullScreenLoading,hideFullScreenLoading } from '@/utils/loading'
   // 一页数据量
-  const pageSize = 8
-  export default {
+  const pageSize = 10
+  export default { 
     name: "myTemplate",
     components: {
       Pagination
@@ -186,11 +187,18 @@
       // 获取点击页数
       get_page(val) {
         this.searchData.page = val
+        this.pageInfo.currentPage = val
         this.get_template_list()
       },
       // 检索
       search() {
-        this.get_template_list()
+        this.searchData.page = 1
+        maintainMouldPage(this.searchData).then(res => {
+          this.templateData = res.data.row
+          this.pageInfo.currentPage = 1
+          this.pageInfo.total = parseInt(res.data.total)
+          hideFullScreenLoading()
+        })
       },
       // 新增模板
       add_template() {