From 5f20f4bba739f0f81101a2c1d99f494647125e05 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 21 三月 2024 17:19:18 +0800
Subject: [PATCH] 2024.3.21

---
 src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue    |    3 
 src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue |    6 +
 src/views/fysp/config/ProblemType.vue                                           |   28 ++++++
 src/constants/menu.js                                                           |    4 
 src/utils/time-util.js                                                          |    8 ++
 src/views/fysp/evaluation/components/precheck/CompPreCheck.vue                  |   34 +++++++-
 src/router/index.js                                                             |   12 +-
 src/views/fysp/evaluation/EvalutationTask.vue                                   |    2 
 src/api/fysp/evaluateApi.js                                                     |   28 ++++--
 src/test.js                                                                     |   17 ++-
 src/views/baseinfo/fysp/user/CompUserInfo.vue                                   |    2 
 src/api/index.js                                                                |    6 
 index.html                                                                      |    2 
 src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue   |   69 ++++++++++++++++-
 src/views/fysp/evaluation/EvalutationRecord.vue                                 |   13 ++-
 15 files changed, 182 insertions(+), 52 deletions(-)

diff --git a/index.html b/index.html
index 3ef23b6..8cdc486 100644
--- a/index.html
+++ b/index.html
@@ -4,7 +4,7 @@
     <meta charset="UTF-8">
     <link rel="icon" href="/favicon.ico">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Vite App</title>
+    <title>鐢熸�佺幆澧冪嚎涓婄洃绠�</title>
   </head>
   <body>
     <div id="app"></div>
diff --git a/src/api/fysp/evaluateApi.js b/src/api/fysp/evaluateApi.js
index 0c75408..aef8028 100644
--- a/src/api/fysp/evaluateApi.js
+++ b/src/api/fysp/evaluateApi.js
@@ -26,16 +26,22 @@
     return $fysp
       .post(`evaluation/auto/record/download`, param, { responseType: 'blob' })
       .then((res) => {
-        // return res.data;
-        const name = Base64.decode(res.headers.get('filename'));
-        const url = window.URL.createObjectURL(res.data);
-        const link = document.createElement('a');
-        link.href = url;
-        link.setAttribute('download', name);
-        document.body.appendChild(link);
-        link.click();
-        document.body.removeChild(link);
-        window.URL.revokeObjectURL(url);
+        // 鏂囨。鏈敓鎴愶紝宸插惎鍔ㄦ枃妗g敓鎴愬悗鍙颁换鍔�
+        if (res.data.type == 'application/json') {
+          return false
+        } 
+        // 鏂囨。宸插瓨鍦紝鐩存帴涓嬭浇
+        else {
+          const name = Base64.decode(res.headers.get('filename'));
+          const url = window.URL.createObjectURL(res.data);
+          const link = document.createElement('a');
+          link.href = url;
+          link.setAttribute('download', name);
+          document.body.appendChild(link);
+          link.click();
+          document.body.removeChild(link);
+          window.URL.revokeObjectURL(url);
+        }
       });
-  },
+  }
 };
diff --git a/src/api/index.js b/src/api/index.js
index 71e187f..5ef36b4 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -1,7 +1,7 @@
 import axios from 'axios';
 import { ElMessage } from 'element-plus';
 
-const debug = true;
+const debug = false;
 
 let ip1 = 'http://47.100.191.150:9005/';
 let ip1_file = 'http://47.100.191.150:9005/';
@@ -9,9 +9,9 @@
 let ip2_file = 'https://fyami.com.cn/';
 
 if (debug) {
-  ip1 = 'http://192.168.1.9:8082/';
+  ip1 = 'http://192.168.0.138:8082/';
   // ip1_file = 'http://47.100.191.150:9005/';
-  ip2 = 'http://192.168.1.9:8080/';
+  // ip2 = 'http://192.168.0.138:8080/';
   // ip2_file = 'https://fyami.com.cn/';
 }
 
diff --git a/src/constants/menu.js b/src/constants/menu.js
index afb67dd..5740439 100644
--- a/src/constants/menu.js
+++ b/src/constants/menu.js
@@ -34,12 +34,12 @@
     name: '鑷姩璇勪及',
     children: [
       {
-        path: '/fysp/evaluation/datasource',
+        path: '/fysp/evaluation/evalutationTask',
         icon: 'MessageBox',
         name: '璇勪及浠诲姟',
       },
       {
-        path: '/fysp/evaluation/resultManage',
+        path: '/fysp/evaluation/evalutationRecord',
         icon: 'Tickets',
         name: '璇勪及璁板綍',
       },
diff --git a/src/router/index.js b/src/router/index.js
index 1129d92..407d96b 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -80,16 +80,16 @@
   },
   {
     //璇勪及鏁版嵁婧�
-    name: 'fyspDatasource',
-    path: '/fysp/evaluation/datasource',
-    component: () => import('@/views/fysp/evaluation/DataSource.vue'),
+    name: 'fyspEvalutationTask',
+    path: '/fysp/evaluation/evalutationTask',
+    component: () => import('@/views/fysp/evaluation/EvalutationTask.vue'),
     meta: { keepAlive: true }
   },
   {
     //璇勪及绠$悊
-    name: 'fyspResultManage',
-    path: '/fysp/evaluation/resultManage',
-    component: () => import('@/views/fysp/evaluation/ResultManage.vue'),
+    name: 'fyspEvalutationRecord',
+    path: '/fysp/evaluation/evalutationRecord',
+    component: () => import('@/views/fysp/evaluation/EvalutationRecord.vue'),
     meta: { keepAlive: true }
   },
   {
diff --git a/src/test.js b/src/test.js
index 11a2465..547db41 100644
--- a/src/test.js
+++ b/src/test.js
@@ -17,10 +17,13 @@
 // }
 
 
-let a = 4
-let b = new Number(4)
-let c = '4'
-console.log(a == b);
-console.log(a === b);
-console.log(a == c);
-console.log(b === c);
\ No newline at end of file
+// let a = 4
+// let b = new Number(4)
+// let c = '4'
+// console.log(a == b);
+// console.log(a === b);
+// console.log(a == c);
+// console.log(b === c);
+
+var val = 'smtg'
+console.log('Value is' + ((val === 'smtg') ? 'Something' : 'Nothing'));
\ No newline at end of file
diff --git a/src/utils/time-util.js b/src/utils/time-util.js
index 9f62dcb..951116b 100644
--- a/src/utils/time-util.js
+++ b/src/utils/time-util.js
@@ -13,6 +13,14 @@
     }
   },
 
+  formatYM(date){
+    if (date) {
+      return this.format(date, 'YYYY-MM')
+    } else {
+      return '----/--'
+    }
+  },
+
   formatYMD(date){
     if (date) {
       return this.format(date, 'YYYY-MM-DD')
diff --git a/src/views/baseinfo/fysp/user/CompUserInfo.vue b/src/views/baseinfo/fysp/user/CompUserInfo.vue
index 74448a1..378046d 100644
--- a/src/views/baseinfo/fysp/user/CompUserInfo.vue
+++ b/src/views/baseinfo/fysp/user/CompUserInfo.vue
@@ -136,7 +136,7 @@
 
 function updateUser() {
   updateLoading.value = true;
-  userApi.updateUser().finally(() => {
+  userApi.updateUser(formObj.value).finally(() => {
     updateLoading.value = false;
   });
 }
diff --git a/src/views/fysp/config/ProblemType.vue b/src/views/fysp/config/ProblemType.vue
index 177c207..f9a55f1 100644
--- a/src/views/fysp/config/ProblemType.vue
+++ b/src/views/fysp/config/ProblemType.vue
@@ -1,5 +1,21 @@
 <template>
-  <div>ProblemType</div>
+  <FYSearchBar @search="onSearch">
+    <template #options>
+      <!-- 鍖哄幙 -->
+      <FYOptionLocation
+        :allOption="false"
+        :level="3"
+        :checkStrictly="false"
+        v-model:value="formSearch.locations"
+      ></FYOptionLocation>
+      <!-- 鍦烘櫙绫诲瀷 -->
+      <FYOptionScene
+        :allOption="false"
+        :type="2"
+        v-model:value="formSearch.scenetype"
+      ></FYOptionScene>
+    </template>
+  </FYSearchBar>
 </template>
 
 <script>
@@ -7,7 +23,15 @@
   name: 'ProblemType',
   data() {
     return {
-      
+      formSearch: {
+        locations: {},
+        scenetype: {}
+      }
+    };
+  },
+  methods: {
+    onSearch() {
+      this.loading = true;
     }
   }
 };
diff --git a/src/views/fysp/evaluation/ResultManage.vue b/src/views/fysp/evaluation/EvalutationRecord.vue
similarity index 94%
rename from src/views/fysp/evaluation/ResultManage.vue
rename to src/views/fysp/evaluation/EvalutationRecord.vue
index 0ba2bf5..b3dc2c3 100644
--- a/src/views/fysp/evaluation/ResultManage.vue
+++ b/src/views/fysp/evaluation/EvalutationRecord.vue
@@ -124,7 +124,7 @@
       this.$refs.tableRef.onSearch();
     },
     onSearch(page, func) {
-      const area = this._getParam()
+      const area = this._getParam();
       evaluateApi.fetchAutoEvaluation(area).then((res) => {
         if (typeof func === 'function') {
           func({ data: res.data });
@@ -135,10 +135,13 @@
       });
     },
     download() {
-      const area = this._getParam()
-      evaluateApi.downloadAutoEvaluation(area).then(res=>{
-        this.$parent
-      })
+      const area = this._getParam();
+      evaluateApi.downloadAutoEvaluation(area).then((res) => {
+        if (res == false) {
+          // 鏈笅杞芥枃妗o紝鑰屾槸寮�鍚簡鏂囨。鐢熸垚鍚庡彴浠诲姟
+          this.$parent;
+        }
+      });
     },
     getFilters(data) {
       const townList = [];
diff --git a/src/views/fysp/evaluation/DataSource.vue b/src/views/fysp/evaluation/EvalutationTask.vue
similarity index 96%
rename from src/views/fysp/evaluation/DataSource.vue
rename to src/views/fysp/evaluation/EvalutationTask.vue
index aac4e87..239df8c 100644
--- a/src/views/fysp/evaluation/DataSource.vue
+++ b/src/views/fysp/evaluation/EvalutationTask.vue
@@ -13,7 +13,7 @@
 import CompEvaTask from './components/CompEvaTask.vue';
 import CompPreCheck from './components/precheck/CompPreCheck.vue';
 export default {
-  name: 'DataSource',
+  name: 'EvalutationTask',
   components: { CompPreCheck, CompEvaTask },
   data() {
     return {};
diff --git a/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue b/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue
index 7001369..3bb8745 100644
--- a/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue
+++ b/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue
@@ -6,12 +6,23 @@
     <el-step title="鑷姩璇勪及" />
   </el-steps>
   <CompCheckArea v-show="stepIndex == 0" v-model="stepIndex" @change="onAreaChange"></CompCheckArea>
-  <CompCheckSource v-show="stepIndex == 1" v-model="stepIndex" ref="refSource"></CompCheckSource>
-  <CompCheckExemption v-show="stepIndex == 2" v-model="stepIndex"></CompCheckExemption>
+  <CompCheckSource
+    v-show="stepIndex == 1"
+    v-model="stepIndex"
+    ref="refSource"
+    @change="onDataSourceChange"
+  ></CompCheckSource>
+  <CompCheckExemption
+    v-show="stepIndex == 2"
+    v-model="stepIndex"
+    @change="onExemptionChange"
+  ></CompCheckExemption>
   <CompCheckConfirm
     v-show="stepIndex == 3"
     v-model="stepIndex"
     :area-info="area"
+    :data-source="dataSource"
+    :exemption-items="exemptionItems"
     @start="onNewTask"
   ></CompCheckConfirm>
 </template>
@@ -35,7 +46,13 @@
     return {
       // 鎿嶄綔姝ラ涓嬫爣
       stepIndex: 0,
-      area: {}
+      area: {
+        _locations: {},
+        _scenetype: {}
+      },
+      dataSource: {},
+      // 璞佸厤鏉$洰
+      exemptionItems: {}
     };
   },
   methods: {
@@ -44,7 +61,8 @@
      */
     onAreaChange(val) {
       const v = val.value;
-      this.area = {
+      this.area = v;
+      const a = {
         provincecode: v._locations.pCode,
         provincename: v._locations.pName,
         citycode: v._locations.cCode,
@@ -58,7 +76,13 @@
         online: true,
         sourceType: v.sourceType
       };
-      this.$refs.refSource.startCheck(this.area);
+      this.$refs.refSource.startCheck(a);
+    },
+    onDataSourceChange(val) {
+      this.dataSource = val;
+    },
+    onExemptionChange(val) {
+      this.exemptionItems = val;
     },
     /**
      * 鑷姩璇勪及鍓嶇疆鍚堣鎬ф鏌�
diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue
index c117318..1fc99ae 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue
@@ -4,9 +4,41 @@
       <div><el-text tag="b" size="large">鑷姩璇勪及纭</el-text></div>
       <el-text size="small" type="info">鏈�缁堢‘璁よ嚜鍔ㄨ瘎浼板悇閰嶇疆椤癸紝骞跺紑濮嬭嚜鍔ㄨ瘎浼�</el-text>
     </template>
-    <div>璇勪及鑼冨洿</div>
-    <div>璇勪及鏁版嵁婧愬畬鏁村害</div>
-    <div>鏄惁鏈夎眮鍏嶆潯鐩�</div>
+    <el-form label-width="160px" label-position="left">
+      <div class="m-b-16"><el-text tag="b" size="large">璇勪及鑼冨洿</el-text></div>
+      <el-form-item label="鍖哄煙">
+        <el-text size="default">{{ areaInfo._locations.pName }}</el-text>
+        <el-text size="default">{{ areaInfo._locations.cName }}</el-text>
+        <el-text size="default">{{ areaInfo._locations.dName }}</el-text>
+        <el-text size="default">{{ areaInfo.starttime }}</el-text>
+      </el-form-item>
+      <el-form-item label="鏃堕棿">
+        <el-text size="default">{{ $fm.formatYM(areaInfo.time) }}</el-text>
+      </el-form-item>
+      <el-form-item label="鍦烘櫙">
+        <el-text size="default">{{ areaInfo._scenetype.label }}</el-text>
+      </el-form-item>
+      <el-divider />
+      <div class="m-b-16"><el-text tag="b" size="large">璇勪及鏁版嵁婧愬畬鏁村害</el-text></div>
+      <el-form-item :label="v.name" v-for="v in dataSource" :key="v.name">
+        <template v-if="v.pass == true">
+          <el-icon color="var(--el-color-success)"><Check /></el-icon>
+          <el-text size="default" type="success">閫氳繃</el-text>
+        </template>
+        <template v-else-if="v.pass == false">
+          <el-icon color="var(--el-color-danger)"><Close /></el-icon>
+          <el-text size="default" type="danger">缂哄け</el-text>
+        </template>
+        <template v-else>
+          <el-icon color="var(--el-color-warning)"><Warning /></el-icon>
+          <el-text size="default" type="warning">鏆傜暐杩�</el-text>
+        </template>
+      </el-form-item>
+      <el-divider />
+      <div class="m-b-16"><el-text tag="b" size="large">璞佸厤鏉$洰</el-text></div>
+      <div class="m-b-16"><el-text size="default">鏃犺眮鍏嶆潯鐩�</el-text></div>
+    </el-form>
+
     <template #footer>
       <el-row justify="space-around">
         <el-button type="primary" size="default" @click="lastStep">涓婁竴姝�</el-button>
@@ -27,7 +59,19 @@
     // 姝ラ涓嬫爣
     modelValue: Number,
     // 鍖哄煙淇℃伅
-    areaInfo: Object
+    areaInfo: {
+      type: Object,
+      default: () => {
+        return {
+          _locations: {},
+          _scenetype: {}
+        };
+      }
+    },
+    // 鏁版嵁婧愬畬鏁村害鎯呭喌
+    dataSource: Array,
+    // 鏉$洰璞佸厤鎯呭喌
+    exemptionItems: Array
   },
   emits: ['update:modelValue', 'start'],
   data() {
@@ -36,7 +80,22 @@
   methods: {
     // 寮�鍚嚜鍔ㄨ瘎浼颁换鍔�
     startEvaluate() {
-      evaluateApi.autoEvaluate(this.areaInfo).then((res) => {
+      const v = this.areaInfo
+      const a = {
+        provincecode: v._locations.pCode,
+        provincename: v._locations.pName,
+        citycode: v._locations.cCode,
+        cityname: v._locations.cName,
+        districtcode: v._locations.dCode,
+        districtname: v._locations.dName,
+        towncode: v._locations.tCode,
+        townname: v._locations.tName,
+        starttime: this.$fm.formatYMDH(v.time),
+        scensetypeid: v._scenetype.value,
+        online: true,
+        sourceType: v.sourceType
+      };
+      evaluateApi.autoEvaluate(a).then((res) => {
         this.$emit('start', res.data);
       });
     },
diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue
index f9195e4..5578e54 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue
@@ -23,15 +23,17 @@
     // 姝ラ涓嬫爣
     modelValue: Number
   },
-  emits: ['update:modelValue'],
+  emits: ['update:modelValue', 'change'],
   data() {
     return {
-      
+      // 璞佸厤鏉$洰
+      exemptionItems: []
     };
   },
   methods: {
     // 璺宠浆涓嬩竴姝�
     nextStep() {
+      this.$emit('change', this.exemptionItems);
       this.$emit('update:modelValue', this.modelValue + 1);
     },
     // 璺宠浆涓嬩竴姝�
diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
index c098e85..6348a1b 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
@@ -108,7 +108,7 @@
     // 姝ラ涓嬫爣
     modelValue: Number
   },
-  emits: ['update:modelValue'],
+  emits: ['update:modelValue', 'change'],
   data() {
     return {
       areaInfo: {},
@@ -223,6 +223,7 @@
   methods: {
     // 璺宠浆涓嬩竴姝�
     nextStep() {
+      this.$emit('change', this.checkResults);
       this.$emit('update:modelValue', this.modelValue + 1);
     },
     // 璺宠浆涓婁竴姝�

--
Gitblit v1.9.3