Bläddra i källkod

fix: 食物分页及排序

sh 4 år sedan
förälder
incheckning
b058dd7491
4 ändrade filer med 9 tillägg och 2 borttagningar
  1. 1 1
      package.json
  2. 3 0
      src/views/food/index.vue
  3. 3 0
      src/views/nutrient/index.vue
  4. 2 1
      vue.config.js

+ 1 - 1
package.json

@@ -37,7 +37,7 @@
     "@vue/cli-service": "4.4.4",
     "@vue/test-utils": "1.0.0-beta.29",
     "autoprefixer": "9.5.1",
-    "babel-eslint": "10.1.¬0",
+    "babel-eslint": "10.1.0",
     "babel-jest": "23.6.0",
     "babel-plugin-dynamic-import-node": "2.3.3",
     "chalk": "2.4.2",

+ 3 - 0
src/views/food/index.vue

@@ -50,6 +50,7 @@
       fit
       highlight-current-row
       style="width: 100%;"
+      :max-height="maxHeight"
       @row-dblclick="handleFoodClick"
     >
       <el-table-column type="index" label="序号" align="center" fixed width="60px" />
@@ -228,6 +229,7 @@ export default {
       sortOptions: [{ key: 0, label: '按创建时间倒序排列' }, { key: 1, label: '按ID顺序排列' }],
       list: [],
       listLoading: true,
+      maxHeight: 600,
       listQuery: {
         query: '',
         orderBy: 0,
@@ -254,6 +256,7 @@ export default {
     }
   },
   created() {
+    this.maxHeight = document.documentElement.clientHeight - 205
     this.foodSource = getFoodSourceByUrl(this.$route.path)
     if (this.foodSource === 'ENTRY' || this.foodSource === '') {
       this.listQuery.orderBy = 0

+ 3 - 0
src/views/nutrient/index.vue

@@ -27,6 +27,7 @@
       :key="tableKey"
       v-loading="listLoading"
       :data="list"
+      :max-height="maxHeight"
       border
       fit
       highlight-current-row
@@ -174,6 +175,7 @@ export default {
       dialogFormVisible: false,
       list: [{}],
       listLoading: true,
+      maxHeight: 600,
       listQuery: {
         query: '',
         pageNum: 1,
@@ -193,6 +195,7 @@ export default {
     }
   },
   created() {
+    this.maxHeight = document.documentElement.clientHeight - 205
     this.fetchData()
   },
   methods: {

+ 2 - 1
vue.config.js

@@ -38,7 +38,8 @@ module.exports = {
     },
     proxy: {
       '/api' : {
-        target: 'https://feuc-test.liveplus.online',
+        // target: 'https://feuc-test.liveplus.online',
+        target: 'http://localhost:8084',
         changeOrigin: true
       }
     },