scorpio 2 年 前
コミット
6a4846f8e4
2 ファイル変更25 行追加21 行削除
  1. 23 19
      src/views/home/component/params/params7.vue
  2. 2 2
      vite.config.js

+ 23 - 19
src/views/home/component/params/params7.vue

@@ -26,8 +26,8 @@
           icon="el-icon-plus"
           class="ml-20"
           @click="addYear(1)"
-          >新增年度</el-button
-        >
+          >新增年度
+        </el-button>
       </div>
     </div>
 
@@ -67,8 +67,8 @@
               round
               class="ml-10"
               @click="updateMonth(item, 1, index)"
-              >月填报</el-button
-            >
+              >月填报
+            </el-button>
           </div>
         </div>
       </div>
@@ -90,8 +90,8 @@
           icon="el-icon-plus"
           class="ml-20"
           @click="addYear(2)"
-          >新增年度</el-button
-        >
+          >新增年度
+        </el-button>
       </div>
     </div>
 
@@ -133,8 +133,8 @@
               round
               class="ml-10"
               @click="updateMonth(item, 2, index)"
-              >月填报</el-button
-            >
+              >月填报
+            </el-button>
           </div>
         </div>
       </div>
@@ -194,8 +194,8 @@
             icon="el-icon-check"
             class="full-width flex flex-center flex-justify-end light-blue-bg"
             @click="save"
-            >保存</el-button
-          >
+            >保存
+          </el-button>
         </div>
       </div>
     </el-dialog>
@@ -252,18 +252,19 @@ export default {
   },
   methods: {
     initYear() {
+      this.years.length = 0
+      let localYears = []
       if (this.detail && this.detail.investment) {
-        this.years.length = 0
-        const localYears = this.detail.investment.data.map(ele => ele.year)
-        const year = new Date().getFullYear()
-        for (let i = 2017; i <= year + 1; i++) {
-          const item = { label: i, value: i }
-          if (localYears.findIndex(sub => sub === i) === -1) {
-            this.years.push(item)
-          }
+        localYears = this.detail.investment.data.map(ele => ele.year)
+      }
+      const year = new Date().getFullYear()
+      for (let i = 2017; i <= year + 1; i++) {
+        const item = { label: i, value: i }
+        if (localYears.findIndex(sub => sub === i) === -1) {
+          this.years.push(item)
         }
-        this.years.reverse()
       }
+      this.years.reverse()
     },
     /**
      * 新增年度
@@ -368,6 +369,7 @@ export default {
 :deep(.el-input.is-disabled .el-input__inner) {
   color: #343434;
 }
+
 .value-box {
   width: 100%;
   background-color: #f5f7fa;
@@ -375,12 +377,14 @@ export default {
   padding: 10px 10px;
   border: #e5e7ec solid 1px;
 }
+
 .month-box {
   width: 90px;
   background-color: #f5f7fa;
   margin: 5px;
   height: 35px;
 }
+
 .title-box {
   width: 90px;
   height: 42px;

+ 2 - 2
vite.config.js

@@ -57,8 +57,8 @@ export default defineConfig({
     proxy: {
       '/api': {
         // 正式环境地址
-        target: 'https://dev.wutongresearch.club/api',
-        // target: 'https://prod.wutongshucloud.com/api',
+        // target: 'https://dev.wutongresearch.club/api',
+        target: 'https://prod.wutongshucloud.com/api',
         // target: 'http://192.168.31.181:8110',
         changeOrigin: true,
         rewrite: path => path.replace(/^\/api/, '')