Bläddra i källkod

Merge branch 'yh236'

ldong 2 månader sedan
förälder
incheckning
95638ec9f6

+ 4 - 0
src/lang/modules/EtaBase/commonLang.js

@@ -736,6 +736,10 @@ export default {
       zh: '请选择频度',
       en: 'Please input frequency'
     },
+    select_fre: {
+      zh: '请选择频度',
+      en: 'Please select frequency'
+    },
     input_n_val: {
       zh: '请输入N值',
       en: 'Please input N value'

+ 1 - 1
src/views/dataEntry_manage/dataEntry/components/edbDetail.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="edb-detail-data-wrap">
     <div class="handle-list">
-      <span class="editsty" @click="$emit('handle',{item:edbInfo.Detail,type:'edit'})" v-if="hasEditAuth"><!-- 编辑 -->{{$t('Table.edit_btn')}}</span>
+      <span class="editsty" @click="$emit('handle',{item:edbInfo.Detail,type:'edit',from:2})" v-if="hasEditAuth"><!-- 编辑 -->{{$t('Table.edit_btn')}}</span>
 
       <span class="editsty" @click="$emit('handle',{item:edbInfo.Detail,type:'addToBase'})" v-if="edbInfo.Detail&&edbInfo.Detail.IsJoinEdb===0&&permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_add')"><!-- 加入指标库 -->{{$t('ManualEntryPage.add_tobase')}}</span>
 

+ 72 - 10
src/views/dataEntry_manage/dataEntry/index.vue

@@ -26,6 +26,21 @@
           type="primary" 
           @click="$router.push({path: '/batchDelList' })"
         ><!-- 批量删除 -->{{$t('ManualEntryPage.batch_del')}}</el-button>
+        <el-select
+          @change="changeFrequency"
+          v-model="frequencySelect"
+          :placeholder="$t('Edb.InputHolderAll.select_fre')"
+          style="width: 240px;margin-left: 10px"
+          clearable
+        >
+          <el-option
+            v-for="item in frequencyArr"
+            :key="item.label"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
       </div>
 
       <div class="right-wrap">
@@ -133,7 +148,7 @@
               >
                 <template slot-scope="{row}">
                   <div>
-                    <span class="editsty" @click="handleEdb({item:row,type:'edit'})"  v-if="permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_edit')">{{$t('Table.edit_btn')}}</span>
+                    <span class="editsty" @click="handleEdb({item:row,type:'edit',from:1})"  v-if="permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_edit')">{{$t('Table.edit_btn')}}</span>
 
                     <span v-if="row.IsJoinEdb===0&&permissionBtn.isShowBtn('dataSourcePermission','manualDataWrite_add')" class="editsty" @click="handleEdb({item:row,type:'addToBase'})"><!-- 加入指标库 -->{{$t('ManualEntryPage.add_tobase')}}</span>
 
@@ -202,6 +217,7 @@ import edbDetail from './components/edbDetail.vue'
 import operateLogsDia from './components/operateLogsDia.vue';
 import insertData from '../components/insertData.vue';
 import completeTargetDia from '../databaseComponents/completeTargetDia.vue';
+import { frequencySelectList } from '@/utils/defaultOptions';
 export default {
   components: { 
     mPage,
@@ -232,6 +248,9 @@ export default {
       }&StartDate=&EndDate=&Mobile=&${localStorage.getItem("auth")}`;
       return str.replace(/#/g, encodeURIComponent("#")).replace(/;/g, encodeURIComponent(";"));
     },
+    frequencyArr(){
+        return frequencySelectList(['月度'])
+    }
   },
   watch: {
     search_txt(nval) {
@@ -245,6 +264,8 @@ export default {
   },
   data() {
     return {
+      tableSearch:{},
+      frequencySelect:'',
       defaultProp: {
         label: 'ClassifyName',
         children: 'Child',
@@ -284,9 +305,43 @@ export default {
   },
   mounted(){
     this.getClassify();
-    this.getTableData()
+    if(sessionStorage.getItem('cacheDataList')){
+      this.cacheDataList()
+    }else{
+      this.getTableData()
+    }
   },
   methods:{
+    // 缓存列表页面
+    cacheDataList(){
+      const cacheData=JSON.parse(sessionStorage.getItem('cacheDataList'))
+      console.log(cacheData)
+      if(cacheData.editType===1){
+        // 列表进入编辑
+        const dataArr=[
+          {key:'ClassifyId',value:'selectClassifyId'},
+          {key:'CurrentIndex',value:'pageNo'},
+          {key:'PageSize',value:'pageSize'},
+          {key:'Frequency',value:'frequencySelect'},
+          {key:'total',value:'total'}
+        ]
+        dataArr.forEach(el=>{
+          this[el.value]=cacheData.tableSearch[el.key]
+        })
+        this.getTableData()
+      }else{
+        // 详情进入编辑
+        this.selectedEdb = cacheData.id;
+        this.searchHandle(cacheData.id)
+      }
+      sessionStorage.removeItem('cacheDataList')
+    },
+    // 改变频度
+    changeFrequency(){
+      this.selectedEdb=''
+      this.pageNo = 1;
+      this.getTableData()
+    },
     lookDetailHandle(row) {
       this.selectClassifyId = 0;
 			this.selectNode = '';
@@ -328,12 +383,13 @@ export default {
     },
 
     async getTableData() {
-      const res = await dataInterence.getEdbListV2({
+      this.tableSearch={
         ClassifyId: this.selectClassifyId,
         CurrentIndex: this.pageNo,
-        PageSize: this.pageSize
-      })
-
+        PageSize: this.pageSize,
+        Frequency:this.frequencySelect
+      }
+      const res = await dataInterence.getEdbListV2(this.tableSearch)
       if(res.Ret !==200) return 
       this.tableData = res.Data.List || [];
       this.total = res.Data.Paging.Totals;
@@ -396,7 +452,7 @@ export default {
     },
 
     /* 操作 */
-    handleEdb({item,type}) {
+    handleEdb({item,type,from}) {
       const typeMap = {
         'edit': this.handleEditEdb,
         'addToBase': this.handleAddToBase,
@@ -404,14 +460,20 @@ export default {
         'del': this.handleDelEdb
       }
 
-      typeMap[type]&&typeMap[type](item)
+      typeMap[type]&&typeMap[type](item,from)
     },
 
-    handleEditEdb(item) {
+    handleEditEdb(item,from) {
+      let cacheData={
+        editType:from,  // 1-列表编辑 2-详情编辑
+        id:item.TradeCode,
+        tableSearch:{...this.tableSearch,total:this.total}
+      }
+      sessionStorage.setItem('cacheDataList',JSON.stringify(cacheData))
       this.$router.push({
         path: '/dataEdit',
         query: {
-          id: item.TradeCode
+          id: item.TradeCode,
         }
       })
     },