|
@@ -2,11 +2,23 @@
|
|
|
<!-- 数据宝页面 -->
|
|
|
<div class="data-bank-base-wrap">
|
|
|
<div class="select-box">
|
|
|
- <el-radio-group v-model="choosedSource" size="medium">
|
|
|
- <el-radio-button v-for="source in sourceList" :key="source.key" :label="source.key">{{source.label}}</el-radio-button>
|
|
|
+ <el-radio-group v-model="choosedSource" size="medium" @input="handleCurrentChange(1)">
|
|
|
+ <el-radio-button v-for="source in sourceList"
|
|
|
+ :key="source.EdbSourceId"
|
|
|
+ :label="source.EdbSourceId">{{source.SourceName}}</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
- <el-select style="width:240px;margin-left: auto;"></el-select>
|
|
|
- <el-input style="width:240px;margin-left:30px;"></el-input>
|
|
|
+ <el-select v-model="selectValue" @change="handleCurrentChange(1)"
|
|
|
+ placeholder="请选择频度"
|
|
|
+ clearable
|
|
|
+ style="width:240px;margin-left: auto;">
|
|
|
+ <el-option v-for="item in frequencyList"
|
|
|
+ :key="item" :value="item" :label="item" />
|
|
|
+ </el-select>
|
|
|
+ <el-input v-model="inputValue" @input="handleCurrentChange(1)"
|
|
|
+ placeholder="指标ID/指标名称"
|
|
|
+ clearable
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
+ style="width:240px;margin-left:30px;"></el-input>
|
|
|
</div>
|
|
|
<div class="table-box">
|
|
|
<el-table :data="tableData" border>
|
|
@@ -15,85 +27,116 @@
|
|
|
:key="column.key"
|
|
|
:label="column.label"
|
|
|
:prop="column.key"
|
|
|
+ :min-width="column.minWidth"
|
|
|
:sortable="column.sortable"></el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <div class="page-box"></div>
|
|
|
+ <div class="page-box">
|
|
|
+ <el-pagination
|
|
|
+ layout="total,prev,pager,next,jumper"
|
|
|
+ background
|
|
|
+ :current-page="pageNo"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :page-size="pageSize"
|
|
|
+ :total="total"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { databankInterface } from "@/api/api.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- sourceList:[
|
|
|
- {
|
|
|
- key:'web',
|
|
|
- label:'网站'
|
|
|
- },
|
|
|
- {
|
|
|
- key:'lz',
|
|
|
- label:'隆众'
|
|
|
- },
|
|
|
- {
|
|
|
- key:'EIA',
|
|
|
- label:'EIA'
|
|
|
- },
|
|
|
- {
|
|
|
- key:'fy',
|
|
|
- label:'风云'
|
|
|
- },
|
|
|
- {
|
|
|
- key:'mlc',
|
|
|
- label:'美联储'
|
|
|
- },
|
|
|
- {
|
|
|
- key:'ps',
|
|
|
- label:'普氏'
|
|
|
- }
|
|
|
- ],
|
|
|
+ sourceList:[],
|
|
|
choosedSource:'web',
|
|
|
+ frequencyList:[],
|
|
|
+ selectValue:'',
|
|
|
+ inputValue:'',
|
|
|
tableColumnList:[
|
|
|
{
|
|
|
- key:'id',
|
|
|
+ key:'Code',
|
|
|
label:'指标ID'
|
|
|
},
|
|
|
{
|
|
|
- key:'name',
|
|
|
- label:'指标名称'
|
|
|
+ key:'Name',
|
|
|
+ label:'指标名称',
|
|
|
+ minWidth:200,
|
|
|
},
|
|
|
{
|
|
|
- key:'frequence',
|
|
|
+ key:'Frequency',
|
|
|
label:'频度'
|
|
|
},
|
|
|
{
|
|
|
- key:'unit',
|
|
|
+ key:'Unit',
|
|
|
label:'单位'
|
|
|
},
|
|
|
{
|
|
|
- key:'startTime',
|
|
|
+ key:'DateFirst',
|
|
|
label:'指标开始时间',
|
|
|
sortable:true,
|
|
|
},
|
|
|
{
|
|
|
- key:'newTime',
|
|
|
+ key:'DateLast',
|
|
|
label:'指标最新时间',
|
|
|
sortable:true
|
|
|
},
|
|
|
{
|
|
|
- key:'updateTime',
|
|
|
+ key:'TimeLastUpdate',
|
|
|
label:'更新时间',
|
|
|
sortable:true
|
|
|
}
|
|
|
],
|
|
|
- tableData:[]
|
|
|
+ tableData:[],
|
|
|
+ pageNo:1,
|
|
|
+ pageSize:10,
|
|
|
+ total:0,
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- getTableData(){}
|
|
|
+ getFrequencyList(){
|
|
|
+ databankInterface.getFrequencyList().then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ this.frequencyList = res.Data||[]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getSourceList(){
|
|
|
+ await databankInterface.getSourceList().then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ this.sourceList = res.Data||[]
|
|
|
+ this.choosedSource = this.sourceList[0].EdbSourceId
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTableData(){
|
|
|
+ databankInterface.getDataList({
|
|
|
+ Source:Number(this.choosedSource),
|
|
|
+ CurrentIndex:this.pageNo,
|
|
|
+ PageSize:this.pageSize,
|
|
|
+ Frequency:this.selectValue,
|
|
|
+ Keyword:this.inputValue
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ if(!res.Data) return
|
|
|
+ this.tableData = res.Data.List
|
|
|
+ this.total = res.Data.Paging.Totals
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleCurrentChange(page){
|
|
|
+ this.pageNo = page
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
+ async pageInit(){
|
|
|
+ await this.getSourceList()
|
|
|
+ this.getFrequencyList()
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
+
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.getTableData()
|
|
|
+ this.pageInit()
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -112,5 +155,8 @@ export default {
|
|
|
.table-box{
|
|
|
margin:30px 0;
|
|
|
}
|
|
|
+ .page-box{
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|