|
@@ -4,7 +4,14 @@
|
|
|
<div class="top-box">
|
|
|
<div class="select-box">
|
|
|
<span>选择数据源</span>
|
|
|
- <el-select placeholder="请选择数据源"></el-select>
|
|
|
+ <el-select placeholder="请选择数据源" v-model="Source" @change="handleSourceChange">
|
|
|
+ <el-option v-for="item in SourceList" :key="item.Source"
|
|
|
+ :label="item.SourceName" :value="item.Source"/>
|
|
|
+ </el-select>
|
|
|
+ <el-select placeholder="请选择数据源" v-model="SubSource" v-if="SubSourceList.length">
|
|
|
+ <el-option v-for="item in SubSourceList" :key="item.Source"
|
|
|
+ :label="item.SubSourceName" :value="item.Source"/>
|
|
|
+ </el-select>
|
|
|
<el-button type="primary" @click="showDialog(true)">默认刷新时间</el-button>
|
|
|
</div>
|
|
|
|
|
@@ -14,10 +21,17 @@
|
|
|
<div class="table-box">
|
|
|
<div class="table-select">
|
|
|
<div class="select-list">
|
|
|
- <el-select placeholder="终端编码"></el-select>
|
|
|
+ <el-select placeholder="终端编码">
|
|
|
+ <el-option v-for="i in terminalCodeList" :key="i.TerminalCode"
|
|
|
+ :label="i.Name" :value="i.TerminalCode"/>
|
|
|
+ </el-select>
|
|
|
<el-select placeholder="ETA指标库分类"></el-select>
|
|
|
<el-select placeholder="创建人"></el-select>
|
|
|
- <el-select placeholder="频度"></el-select>
|
|
|
+ <el-select placeholder="频度" v-model="selectOption.frequency">
|
|
|
+ <el-option v-for="i in frequencyList" :key="i"
|
|
|
+ :label="i" :value="i"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
<el-select placeholder="刷新状态"></el-select>
|
|
|
</div>
|
|
|
<div class="select-other">
|
|
@@ -62,8 +76,8 @@
|
|
|
<!-- 默认刷新时间设置数据频度 -->
|
|
|
<div class="default-box" v-if="isDefault">
|
|
|
<label style="display: block;width:88px;text-align:right;padding-right: 12px;">数据频度</label>
|
|
|
- <el-select style="margin-left: 10px;" v-model="defaultFrequence">
|
|
|
- <el-option v-for="i in ['日度','周度','旬度','月度','季度','半年度','年度']" :key="i"
|
|
|
+ <el-select style="margin-left: 10px;" v-model="defaultFrequency" @change="handleDefaultChange">
|
|
|
+ <el-option v-for="i in frequencyList" :key="i"
|
|
|
:label="i" :value="i"
|
|
|
/>
|
|
|
</el-select>
|
|
@@ -85,9 +99,24 @@
|
|
|
|
|
|
<script>
|
|
|
import RefreshConfig from './components/refreshConfig.vue';
|
|
|
+import {dataRefreshInterface} from '@/api/modules/dataApi.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ Source:'',
|
|
|
+ SourceList:[],
|
|
|
+ SubSource:'',
|
|
|
+ SubSourceList:[],
|
|
|
+
|
|
|
+ frequencyList:['日度','周度','旬度','月度','季度','半年度','年度'],
|
|
|
+ terminalCodeList:[],
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ selectOption:{
|
|
|
+ frequency:''
|
|
|
+ },
|
|
|
+
|
|
|
columns: [
|
|
|
{key: 'code',label: '指标编码'},
|
|
|
{key: 'name',label: '指标全称'},
|
|
@@ -100,7 +129,7 @@ export default {
|
|
|
],
|
|
|
tableData: [{ code: 'aaa' }],
|
|
|
isSetTimeDialogShow: false,
|
|
|
- defaultFrequence:'日度',
|
|
|
+ defaultFrequency:'日度',
|
|
|
//全部全选
|
|
|
isIndeterminate:false,
|
|
|
isCheckAll:false,
|
|
@@ -111,8 +140,58 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
showDialog(isDefault){
|
|
|
+ if(isDefault){
|
|
|
+ //判断数据源是否选择
|
|
|
+ if(!this.SubSource||!this.Source){
|
|
|
+ this.$message.warning("请选择数据源")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
this.isDefault = isDefault
|
|
|
this.isSetTimeDialogShow = true
|
|
|
+ },
|
|
|
+ handleDefaultChange(){
|
|
|
+ //获取默认设置
|
|
|
+ dataRefreshInterface.getDefaultConfig({
|
|
|
+ Frequency:this.defaultFrequency,
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getSourceList(){
|
|
|
+ dataRefreshInterface.getDataSourceList().then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ this.SourceList = res.Data||[]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //一级数据源改变时,二级数据源和筛选项也重新赋值
|
|
|
+ handleSourceChange(){
|
|
|
+ const source = this.SourceList.find(i=>i.Source===this.Source)||{Child:[]}
|
|
|
+ this.SubSourceList = source.Child
|
|
|
+ this.SubSource=''
|
|
|
+ //如果没有二级数据源,则请求表格筛选项数据;钢联化工,SMM不需要
|
|
|
+ if(!this.SubSourceList.length){
|
|
|
+ //获取终端编码列表
|
|
|
+ //获取指标库分类列表
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getTerminalCodeList(){
|
|
|
+ if(!this.Source) return
|
|
|
+ dataRefreshInterface.getTerminalList({
|
|
|
+ Source:Number(this.Source)
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ this.terminalCodeList = res.Data?res.Data.List||[]:[]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getClassifyList(){
|
|
|
+
|
|
|
+ },
|
|
|
+ resetSelect(){
|
|
|
+
|
|
|
+ this.terminalCodeList=[]
|
|
|
+ this.selectOption = {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: { RefreshConfig }
|