cxmo 1 年之前
父节点
当前提交
cd6a2ff3fe
共有 1 个文件被更改,包括 28 次插入7 次删除
  1. 28 7
      src/views/system_manage/dataRefreshSetting.vue

+ 28 - 7
src/views/system_manage/dataRefreshSetting.vue

@@ -18,7 +18,7 @@
             <el-input placeholder="指标ID/指标名称" prefix-icon="el-icon-search"></el-input>
             
         </div>
-        <div class="table-box">
+        <div class="table-box" v-if="hasSelectOption">
             <div class="table-select">
                 <div class="select-list">
                     <el-select placeholder="终端编码">
@@ -101,6 +101,7 @@
 import RefreshConfig from './components/refreshConfig.vue';
 import {dataRefreshInterface} from '@/api/modules/dataApi.js';
 export default {
+    components: { RefreshConfig },
     data() {
         return {
             Source:'',
@@ -116,6 +117,7 @@ export default {
             selectOption:{
                 frequency:''
             },
+            hasSelectOption:false,
 
             columns: [
                 {key: 'code',label: '指标编码'},
@@ -154,9 +156,14 @@ export default {
             //获取默认设置
             dataRefreshInterface.getDefaultConfig({
                 Frequency:this.defaultFrequency,
-                
+                Source:Number(this.Source),
+                SubSource:Number(this.SubSource)
+            }).then(res=>{
+                if(res.Ret!==200) return 
+
             })
         },
+        //获取数据源列表
         getSourceList(){
             dataRefreshInterface.getDataSourceList().then(res=>{
                 if(res.Ret!==200) return 
@@ -168,12 +175,13 @@ export default {
             const source = this.SourceList.find(i=>i.Source===this.Source)||{Child:[]}
             this.SubSourceList = source.Child
             this.SubSource=''
-            //如果没有二级数据源,则请求表格筛选项数据;钢联化工,SMM不需要
-            if(!this.SubSourceList.length){
-                //获取终端编码列表
-                //获取指标库分类列表
+            this.hasSelectOption = ![34,11].includes(this.Source)
+            //如果没有二级数据源,则请求表格筛选项数据;钢联化工,SMM没有筛选项数据
+            if(!this.SubSourceList.length&&this.hasSelectOption){
+                this.getSelectOption()
             }
         },
+        //获取终端编码列表
         getTerminalCodeList(){
             if(!this.Source) return 
             dataRefreshInterface.getTerminalList({
@@ -183,9 +191,15 @@ export default {
                 this.terminalCodeList = res.Data?res.Data.List||[]:[]
             })
         },
+        //获取分类列表
         getClassifyList(){
 
         },
+        getSelectOption(){
+            //获取终端编码列表
+            //获取分类列表
+        },
+        //切换数据源时重置表格选项
         resetSelect(){
 
             this.terminalCodeList=[]
@@ -194,7 +208,9 @@ export default {
             }
         }
     },
-    components: { RefreshConfig }
+    mounted(){
+        this.getSourceList()
+    }
 };
 </script>
 
@@ -217,6 +233,11 @@ export default {
         .el-input{
             width:260px;
         }
+        .select-box{
+            .el-select{
+                margin:0 20px;
+            }
+        }
     }
     .table-box{
         flex:1;