|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
- <div id="YS-data-container">
|
|
|
+ <div id="YS-data-container" v-loading="dataLoading" element-loading-text="指标数据加载中,请勿切换页面">
|
|
|
<div class="search-zone">
|
|
|
<div class="search-row">
|
|
|
- <el-cascader @change="searchList" :options="classifyList" v-model="searchParams.classifyId" clearable
|
|
|
+ <el-cascader @change="searchList" :options="classifyList" v-model="typesList" clearable
|
|
|
placeholder="请选择分类" class="search-item"
|
|
|
:props="{
|
|
|
value:'id',
|
|
@@ -10,86 +10,80 @@
|
|
|
children:'children',
|
|
|
emitPath:false
|
|
|
}"></el-cascader>
|
|
|
- <el-select v-model="searchParams.frequency" class="search-item" placeholder="请选择频度" clearable @change="searchList">
|
|
|
+ <el-select v-model="searchParams.Frequency" class="search-item" placeholder="请选择频度" clearable @change="searchList">
|
|
|
<el-option :label="item" :value="item" v-for="item in frequencyList" :key="item"></el-option>
|
|
|
</el-select>
|
|
|
- <el-select v-model="searchParams.dataStatus" class="search-item" placeholder="请选择指标数据状态" clearable @change="searchList">
|
|
|
- <el-option :label="item.label" :value="item.id" v-for="item in dataStatusList" :key="item.id"></el-option>
|
|
|
+ <el-select v-model="searchParams.DataState" class="search-item" placeholder="请选择指标数据状态" clearable @change="searchList">
|
|
|
+ <el-option :label="item.label" :value="item.value" v-for="item in dataStatusList" :key="item.value"></el-option>
|
|
|
</el-select>
|
|
|
<el-select v-model="edbCheckList" multiple filterable remote clearable collapse-tags class="search-item edb-filter"
|
|
|
- reserve-keyword placeholder="指标ID/指标名称" :remote-method="remoteMethod" :loading="edbDataLoading"
|
|
|
- @clear="searchList" @remove-tag="removeEdbFilterTag" ref="edbFilterRef" >
|
|
|
- <el-option v-for="item in edbFilterDataList" :key="item.id"
|
|
|
- :label="item.label" :value="item.id">
|
|
|
+ reserve-keyword placeholder="指标ID/指标名称" :remote-method="remoteMethod"
|
|
|
+ v-loadMore="searchLoad" @clear="searchList" @remove-tag="removeEdbFilterTag" ref="edbFilterRef" >
|
|
|
+ <el-option v-for="item in edbFilterDataList" :key="item.IndexCode"
|
|
|
+ :label="item.IndexName" :value="item.IndexCode">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <el-checkbox label="列表全选" v-model="isCheckAll" :indeterminate="isCheckIndeterminate" style="margin: 0 30px 10px 0;"
|
|
|
+ <el-checkbox label="列表全选" v-model="isCheckAll" :indeterminate="isCheckIndeterminate" style="margin: 0 20px 10px 0;"
|
|
|
@change="listCheckAllChange"></el-checkbox>
|
|
|
</div>
|
|
|
- <el-button type="primary" style="margin: 0 0 10px 0;" @click="addToEdbBase">添加到指标库</el-button>
|
|
|
+ <el-button type="primary" style="margin: 0 0 10px 0;padding:12px 18px ;" @click="addToEdbBase" :disabled="!(isCheckAll || isCheckIndeterminate)">添加到指标库</el-button>
|
|
|
</div>
|
|
|
<div class="table-zone">
|
|
|
<el-table :data="tableData" border @sort-change="sortChange" @selection-change="selectionChange"
|
|
|
ref="edbDataRef" @select="selectHandle" @select-all="selectAllHandle">
|
|
|
<el-table-column type="selection" min-width="50" align="center"></el-table-column>
|
|
|
- <el-table-column label="指标ID" align="center" prop="edbId">
|
|
|
+ <el-table-column label="指标ID" align="center" prop="IndexCode">
|
|
|
<template slot-scope="{row}">
|
|
|
- {{row.edbId}}
|
|
|
+ {{row.IndexCode}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="指标名称" align="center" show-overflow-tooltip prop="edbName">
|
|
|
+ <el-table-column label="指标名称" align="center" prop="IndexName">
|
|
|
<template slot-scope="{row}">
|
|
|
- {{row.edbName}}
|
|
|
+ {{row.IndexName}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="频度" align="center" prop="frequency" width="80">
|
|
|
+ <el-table-column label="频度" align="center" prop="Frequency" width="80">
|
|
|
<template slot-scope="{row}">
|
|
|
- {{row.frequency}}
|
|
|
+ {{row.Frequency}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="单位" align="center" prop="unit" show-overflow-tooltip >
|
|
|
+ <el-table-column label="单位" align="center" prop="Unit" >
|
|
|
<template slot-scope="{row}">
|
|
|
- {{row.unit}}
|
|
|
+ {{row.Unit}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="指标开始时间" align="center" prop="edbStartDate" show-overflow-tooltip
|
|
|
+ <el-table-column label="指标开始时间" align="center" prop="StartDate"
|
|
|
sortable="custom">
|
|
|
<template slot-scope="{row}">
|
|
|
- {{row.edbStartDate}}
|
|
|
+ {{row.StartDate}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="指标最新时间" align="center" prop="ebdNewestDate" show-overflow-tooltip
|
|
|
+ <el-table-column label="指标最新时间" align="center" prop="EndDate"
|
|
|
sortable="custom" >
|
|
|
<template slot-scope="{row}">
|
|
|
- {{row.ebdNewestDate}}
|
|
|
+ {{row.EndDate}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="更新时间" align="center" prop="updateDate" sortable="custom"
|
|
|
- show-overflow-tooltip>
|
|
|
+ <el-table-column label="更新时间" align="center" prop="ModifyTime" sortable="custom">
|
|
|
<template slot-scope="{row}">
|
|
|
- {{row.updateDate}}
|
|
|
+ {{row.ModifyTime}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="预计发布时间" align="center" prop="publishTimePre" sortable="custom"
|
|
|
- show-overflow-tooltip >
|
|
|
+ <el-table-column label="预计发布时间" align="center" prop="ReleaseTime" sortable="custom" >
|
|
|
<template slot-scope="{row}">
|
|
|
- {{row.publishTimePre}}
|
|
|
+ {{row.ReleaseTime}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="数据来源" align="center" prop="source" >
|
|
|
+ <el-table-column label="指标数据状态" align="center" prop="DataState" >
|
|
|
<template slot-scope="{row}">
|
|
|
- {{row.source}}
|
|
|
+ {{row.DataState?
|
|
|
+ dataStatusList.find(it => it.value == row.DataState)?dataStatusList.find(it => it.value == row.DataState).label:''
|
|
|
+ :'正常更新'}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="指标数据状态" align="center" prop="dataStatus"
|
|
|
- show-overflow-tooltip >
|
|
|
+ <el-table-column label="分类" align="center" prop="TypeAll" >
|
|
|
<template slot-scope="{row}">
|
|
|
- {{row.dataStatus}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="分类" align="center" prop="classify" show-overflow-tooltip >
|
|
|
- <template slot-scope="{row}">
|
|
|
- {{row.classify}}
|
|
|
+ {{row.TypeAll}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -98,12 +92,94 @@
|
|
|
:total="total" :pageSize="searchParams.PageSize"
|
|
|
:page_no="searchParams.CurrentIndex"
|
|
|
@handleCurrentChange="pageNumberChange"/>
|
|
|
+ <!-- 指标重复弹窗 -->
|
|
|
+ <el-dialog :visible.sync="checkFailShow" :close-on-click-modal="false" :modal-append-to-body='false'
|
|
|
+ width="600px" title="操作提示">
|
|
|
+ <div class="check-fail-box">
|
|
|
+ <div>
|
|
|
+ <div style="margin-bottom: 20px;">指标库中已存在以下指标,请勿重新输入!</div>
|
|
|
+ <div v-for="(item,index) in existIndexList" class="exist-index-item" @click="existIndexClick(item)">
|
|
|
+ {{ index+1+'、'+item.text }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="check-fail-button">
|
|
|
+ <el-button type="primary" @click="edbCheckFinished" style="width: 120px;">知道了</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 添加到指标库 -->
|
|
|
+ <el-dialog :visible.sync="addToEbdDiaShow" :close-on-click-modal="false" :modal-append-to-body='false'
|
|
|
+ width="980px" title="添加到指标库">
|
|
|
+ <div class="edb-table-preview">
|
|
|
+ <table width="auto" border="0">
|
|
|
+ <thead>
|
|
|
+ <tr v-for="(item, index) in edbTableHeadKey" :key="item">
|
|
|
+ <td class="sticky" style="left: 0;text-align: center;">
|
|
|
+ {{ edbTableHeadData.get(item) }}
|
|
|
+ </td>
|
|
|
+ <td v-for="(data, sub_index) in edbIndexDatas" :key="sub_index" :colspan="2"
|
|
|
+ :class="highLightIndex.includes(data.EdbName) && item=='EdbName' ?'exist-highlight':''">
|
|
|
+ <template v-if="item === 'ClassifyId'">
|
|
|
+ <el-cascader :options="options" v-model="data[item]" placeholder="请选择所属目录"
|
|
|
+ size="mini" :disabled="!data.Source"
|
|
|
+ :props="{label: 'ClassifyName',
|
|
|
+ value: 'ClassifyId',
|
|
|
+ children: 'Children',
|
|
|
+ checkStrictly: true,
|
|
|
+ emitPath:false}">
|
|
|
+ </el-cascader>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item === 'Unit'">
|
|
|
+ <el-autocomplete
|
|
|
+ :disabled="!data.Source"
|
|
|
+ v-model.trim="data[item]"
|
|
|
+ :fetch-suggestions="querySearchUnit"
|
|
|
+ placeholder="请输入单位"
|
|
|
+ suffix-icon="el-icon-arrow-down"
|
|
|
+ size="mini"
|
|
|
+ ></el-autocomplete>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item === 'Frequency'">
|
|
|
+ <el-select v-model="data[item]" placeholder="请选择频度" size="mini" :disabled="!data.Source">
|
|
|
+ <el-option :label="item" :value="item"
|
|
|
+ v-for="item in edbFrequencyList" :key="item"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item === 'EdbName'">
|
|
|
+ <el-input v-model.trim="data[item]" placeholder="请输入指标名称" size="mini" :disabled="!data.Source"></el-input>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <div style="padding: 0 7px;">{{ data[item] }}</div>
|
|
|
+ </template>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody v-if="edbIndexDatas && edbIndexDatas.length>0">
|
|
|
+ <tr v-for="(item,index) in edbIndexDatas[0].DataList.length" :key="index">
|
|
|
+ <td :rowspan="edbIndexDatas[0].DataList.length" v-if="index==0"
|
|
|
+ class="sticky" style="left: 0;text-align: center;">
|
|
|
+ 数据详情
|
|
|
+ </td>
|
|
|
+ <template v-for="(item1,index1) in edbIndexDatas.length">
|
|
|
+ <td>{{ edbIndexDatas[index1].DataList[index].DataTime }}</td>
|
|
|
+ <td>{{ edbIndexDatas[index1].DataList[index].Value }}</td>
|
|
|
+ </template>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div class="dia-bot">
|
|
|
+ <el-button @click="addToEbdDiaShow=false" style="width: 120px;">取消</el-button>
|
|
|
+ <el-button type="primary" @click="wsdSaveHandle" style="width: 120px;margin-left: 30px;" :loading="saveLoading">保存</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import mPage from '@/components/mPage.vue'
|
|
|
-import { dataInterence } from "@/api/api.js";
|
|
|
+import { dataBaseInterface,dataInterence,smmDataInterface} from '@/api/api.js'
|
|
|
+import { frequencyArr} from '../databaseComponents/util';
|
|
|
|
|
|
export default {
|
|
|
name:'ysTargetBase',
|
|
@@ -112,77 +188,67 @@ import { dataInterence } from "@/api/api.js";
|
|
|
this.flowToData=[{id:'M',label:'Import'},{id:'X',label:'Export'}]
|
|
|
return {
|
|
|
searchParams:{
|
|
|
- classifyId:'',
|
|
|
- frequency:'',
|
|
|
- dataStatus:'',
|
|
|
- edbMessage:'',
|
|
|
+ Types:'',
|
|
|
+ Frequency:'',
|
|
|
+ DataState:'',
|
|
|
CurrentIndex:1,
|
|
|
- PageSize:5,
|
|
|
+ PageSize:10,
|
|
|
SortParam:'',
|
|
|
SortType:'',
|
|
|
- checkAll:0
|
|
|
+ IndexCodes:''
|
|
|
},
|
|
|
+ typesList:[],
|
|
|
isCheckAll:false,
|
|
|
isCheckIndeterminate:false,
|
|
|
// 标志列表当前是全选状态还是不是全选状态和 isCheckAll不一样
|
|
|
checkAllStatus:false,
|
|
|
classifyList:[],
|
|
|
- frequencyList: [],
|
|
|
- dataStatusList:[],
|
|
|
+ frequencyList: ["日度", "周度", "月度", "季度", "半年", "年度"],
|
|
|
+ edbFrequencyList:frequencyArr,
|
|
|
+ dataStatusList:[{value:'normal',label:'正常更新'},{value:'ceased',label:'已停更'},{value:'irregular',label:'更新依赖外部会有不定期延迟'}],
|
|
|
+ forSearchParams:{
|
|
|
+ Keyword:'',
|
|
|
+ CurrentIndex:1,
|
|
|
+ PageSize:20,
|
|
|
+ },
|
|
|
+ searchHaveMore: false,
|
|
|
edbFilterDataList:[],
|
|
|
// 选择的指标名称筛选项
|
|
|
edbCheckList:[],
|
|
|
- edbDataLoading:false,
|
|
|
// edb的过滤选项是否有变化,用于失焦是判断是否需要请求
|
|
|
hasEdbFilterChange:false,
|
|
|
- isSortList:false,
|
|
|
- constData:[
|
|
|
- {id:'4',edbId:'a10123431',edbName:'中国金属硅分省份月度开工率:河南',frequency:'日度',unit:'%',edbStartDate:'2008-01-01',ebdNewestDate:'2023-12-06',
|
|
|
- updateDate:'2023-12-06 16:17:09',publishTimePre:'16:17:09',source:'有色',dataStatus:'正常更新',classify:'宏观/房地产/国内'},
|
|
|
- {id:'41',edbId:'a10123431',edbName:'中国金属硅分省份月度开工率:河南',frequency:'日度',unit:'%',edbStartDate:'2008-01-01',ebdNewestDate:'2023-12-06',
|
|
|
- updateDate:'2023-12-06 16:17:09',publishTimePre:'16:17:09',source:'有色',dataStatus:'正常更新',classify:'宏观/房地产/国内'},
|
|
|
- {id:'42',edbId:'a10123431',edbName:'中国金属硅分省份月度开工率:河南',frequency:'日度',unit:'%',edbStartDate:'2008-01-01',ebdNewestDate:'2023-12-06',
|
|
|
- updateDate:'2023-12-06 16:17:09',publishTimePre:'16:17:09',source:'有色',dataStatus:'正常更新',classify:'宏观/房地产/国内'},
|
|
|
- {id:'45',edbId:'a10123431',edbName:'中国金属硅分省份月度开工率:河南',frequency:'日度',unit:'%',edbStartDate:'2008-01-01',ebdNewestDate:'2023-12-06',
|
|
|
- updateDate:'2023-12-06 16:17:09',publishTimePre:'16:17:09',source:'有色',dataStatus:'正常更新',classify:'宏观/房地产/国内'},
|
|
|
- {id:'47',edbId:'a10123431',edbName:'中国金属硅分省份月度开工率:河南',frequency:'日度',unit:'%',edbStartDate:'2008-01-01',ebdNewestDate:'2023-12-06',
|
|
|
- updateDate:'2023-12-06 16:17:09',publishTimePre:'16:17:09',source:'有色',dataStatus:'正常更新',classify:'宏观/房地产/国内'},
|
|
|
- {id:'49',edbId:'a10123431',edbName:'中国金属硅分省份月度开工率:河南',frequency:'日度',unit:'%',edbStartDate:'2008-01-01',ebdNewestDate:'2023-12-06',
|
|
|
- updateDate:'2023-12-06 16:17:09',publishTimePre:'16:17:09',source:'有色',dataStatus:'正常更新',classify:'宏观/房地产/国内'},
|
|
|
- {id:'46',edbId:'a10123431',edbName:'中国金属硅分省份月度开工率:河南',frequency:'日度',unit:'%',edbStartDate:'2008-01-01',ebdNewestDate:'2023-12-06',
|
|
|
- updateDate:'2023-12-06 16:17:09',publishTimePre:'16:17:09',source:'有色',dataStatus:'正常更新',classify:'宏观/房地产/国内'},
|
|
|
- {id:'488',edbId:'a10123431',edbName:'中国金属硅分省份月度开工率:河南',frequency:'日度',unit:'%',edbStartDate:'2008-01-01',ebdNewestDate:'2023-12-06',
|
|
|
- updateDate:'2023-12-06 16:17:09',publishTimePre:'16:17:09',source:'有色',dataStatus:'正常更新',classify:'宏观/房地产/国内'},
|
|
|
- {id:'477',edbId:'a10123431',edbName:'中国金属硅分省份月度开工率:河南',frequency:'日度',unit:'%',edbStartDate:'2008-01-01',ebdNewestDate:'2023-12-06',
|
|
|
- updateDate:'2023-12-06 16:17:09',publishTimePre:'16:17:09',source:'有色',dataStatus:'正常更新',classify:'宏观/房地产/国内'},
|
|
|
- {id:'444',edbId:'a10123431',edbName:'中国金属硅分省份月度开工率:河南',frequency:'日度',unit:'%',edbStartDate:'2008-01-01',ebdNewestDate:'2023-12-06',
|
|
|
- updateDate:'2023-12-06 16:17:09',publishTimePre:'16:17:09',source:'有色',dataStatus:'正常更新',classify:'宏观/房地产/国内'}
|
|
|
- ],
|
|
|
+ selectionReactCancel:false, // 是否不触发 selection的逻辑
|
|
|
tableData:[],
|
|
|
tableDataIds:[],
|
|
|
- total:10,
|
|
|
+ total:20,
|
|
|
dataLoading:false,
|
|
|
- tableDataCheckedList:[]
|
|
|
+ tableDataCheckedList:[],
|
|
|
+ // 添加到指标库
|
|
|
+ existIndexList:[],
|
|
|
+ checkFailShow:false,
|
|
|
+ edbIndexDatas:[],
|
|
|
+ BatchList:[],
|
|
|
+ addToEbdDiaShow:false,
|
|
|
+ saveLoading:false
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
},
|
|
|
watch:{
|
|
|
edbCheckList(value){
|
|
|
- console.log(value);
|
|
|
- if(value){
|
|
|
- this.searchParams.edbMessage = value.join(',')
|
|
|
- }else{
|
|
|
- this.searchParams.edbMessage = ''
|
|
|
- }
|
|
|
this.hasEdbFilterChange=true
|
|
|
},
|
|
|
+ typesList(value){
|
|
|
+ if(value && value.length>0){
|
|
|
+ this.searchParams.Types = value.join(',')
|
|
|
+ }else{
|
|
|
+ this.searchParams.Types=''
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
this.getList()
|
|
|
this.getYsClassifyList()
|
|
|
- this.getYsDataStatusList()
|
|
|
- this.getYsFrequencyList()
|
|
|
},
|
|
|
mounted(){
|
|
|
// el-select 的@blur绑定事件不生效代替方法
|
|
@@ -196,73 +262,89 @@ import { dataInterence } from "@/api/api.js";
|
|
|
},
|
|
|
methods: {
|
|
|
//获取有色数据库数据列表
|
|
|
- getList(){
|
|
|
+ getList(type){
|
|
|
+ if(this.edbCheckList && this.edbCheckList.length>0){
|
|
|
+ this.searchParams.IndexCodes = this.edbCheckList.join(',')
|
|
|
+ }else{
|
|
|
+ this.searchParams.IndexCodes = ''
|
|
|
+ }
|
|
|
console.log(this.searchParams);
|
|
|
- // TODO: 列表接口对接
|
|
|
- if(this.isSortList){
|
|
|
- this.isSortList=false
|
|
|
- }else {
|
|
|
- if(this.searchParams.classifyId || this.searchParams.frequency || this.searchParams.dataStatus || this.searchParams.edbMessage){
|
|
|
- this.isCheckAll=true
|
|
|
- this.checkAllStatus=true
|
|
|
- this.isCheckIndeterminate=false
|
|
|
- }else{
|
|
|
- this.isCheckAll=false
|
|
|
- this.checkAllStatus=false
|
|
|
- this.isCheckIndeterminate=false
|
|
|
+ smmDataInterface.getYsDataList(this.searchParams).then(res=>{
|
|
|
+ if(res.Ret == 200){
|
|
|
+ this.tableData=res.Data.List || []
|
|
|
+ this.total = res.Data.Paging.Totals || 0
|
|
|
+ if(this.tableData.length>0){
|
|
|
+ this.tableDataIds = this.tableData.map(it => it.id)
|
|
|
+ }else{
|
|
|
+ this.tableDataIds = []
|
|
|
+ }
|
|
|
+ if(type == 'adjustSelection'){
|
|
|
+ this.adjustSelection()
|
|
|
+ }else{
|
|
|
+ if(this.searchParams.Types || this.searchParams.Frequency || this.searchParams.DataState || this.searchParams.Keyword){
|
|
|
+ this.isCheckAll=true
|
|
|
+ this.checkAllStatus=true
|
|
|
+ this.isCheckIndeterminate=false
|
|
|
+ }else{
|
|
|
+ this.isCheckAll=false
|
|
|
+ this.checkAllStatus=false
|
|
|
+ this.isCheckIndeterminate=false
|
|
|
+ }
|
|
|
+ this.listCheckAllChange(this.isCheckAll)
|
|
|
+ }
|
|
|
}
|
|
|
- this.listCheckAllChange(this.isCheckAll)
|
|
|
- }
|
|
|
- this.tableData = this.constData.slice((this.searchParams.CurrentIndex-1)*5,this.searchParams.CurrentIndex*5)
|
|
|
- this.tableDataIds = this.constData.map(it => it.id)
|
|
|
+ })
|
|
|
},
|
|
|
// 获取有色数据库分类列表
|
|
|
getYsClassifyList(){
|
|
|
//TODO: 获取分类列表
|
|
|
this.classifyList=[{id:1,label:'宏观',children:[{id:11,label:'房地产',children:[{id:111,label:'国内'},{id:112,label:'国外'}]}]}]
|
|
|
},
|
|
|
- // 获取有色数据库数据状态列表
|
|
|
- getYsDataStatusList(){
|
|
|
- //TODO: 获取状态列表
|
|
|
- this.dataStatusList=[{id:1,label:'正常更新'},{id:2,label:'已停更'},{id:3,label:'不定期延迟'}]
|
|
|
- },
|
|
|
- getYsFrequencyList(){
|
|
|
- //TODO: 获取频度列表
|
|
|
- this.frequencyList=["日度", "周度", "旬度", "月度", "季度", "半年度", "年度"]
|
|
|
- },
|
|
|
// 指标名称的远程搜索方法
|
|
|
remoteMethod(text){
|
|
|
- let query = text.trim()
|
|
|
- if(query){
|
|
|
- // TODO: 指标搜索接口
|
|
|
- this.edbDataLoading=true
|
|
|
- setTimeout(()=>{
|
|
|
- this.edbFilterDataList=[{id:1,label:'中国制造业PMI'},{id:11,label:'中国制造业宏观'},{id:111,label:'中国制造业111'},{id:1111,label:'中国制造业222'},{id:11111,label:'中国制造业333'}]
|
|
|
- this.edbDataLoading=false
|
|
|
- },1000)
|
|
|
+ this.forSearchParams.Keyword = text.trim()
|
|
|
+ this.forSearchParams.CurrentIndex = 1;
|
|
|
+ if(this.forSearchParams.Keyword){
|
|
|
+ this.searchApi()
|
|
|
}else{
|
|
|
this.edbFilterDataList = [];
|
|
|
}
|
|
|
+ },
|
|
|
+ searchApi(){
|
|
|
+ smmDataInterface.getYsDataList(this.forSearchParams).then(res=>{
|
|
|
+ if(res.Ret == 200){
|
|
|
+ let arr=res.Data.List || []
|
|
|
+ let {Paging}=res.Data
|
|
|
+ this.searchHaveMore = this.forSearchParams.CurrentIndex < Paging.Pages;
|
|
|
+ this.edbFilterDataList = this.forSearchParams.CurrentIndex === 1 ? arr : this.edbFilterDataList.concat(arr);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ searchLoad(){
|
|
|
+ if(!this.searchHaveMore) return;
|
|
|
+ this.forSearchParams.CurrentIndex++
|
|
|
+ this.searchApi();
|
|
|
},
|
|
|
removeEdbFilterTag: _.throttle(function() {
|
|
|
console.log('删除标签');
|
|
|
this.searchList()
|
|
|
},1000),
|
|
|
- searchList(){
|
|
|
+ searchList(type){
|
|
|
this.searchParams.CurrentIndex=1
|
|
|
- this.getList()
|
|
|
+ this.getList(type)
|
|
|
},
|
|
|
pageNumberChange(page_no){
|
|
|
this.searchParams.CurrentIndex=page_no
|
|
|
this.getList('adjustSelection')
|
|
|
},
|
|
|
sortChange({prop,order}){
|
|
|
- this.searchParams.SortType = order==='ascending'?'asc':'desc'
|
|
|
- this.searchParams.SortParam = prop
|
|
|
- this.isSortList=true
|
|
|
- this.searchList()
|
|
|
+ this.searchParams.SortType = order?order==='ascending'?'asc':'desc':''
|
|
|
+ this.searchParams.SortParam = order?prop:''
|
|
|
+ this.searchList('adjustSelection')
|
|
|
},
|
|
|
selectionChange(val){
|
|
|
+ console.log(this.selectionReactCancel,'selectionReactCancel');
|
|
|
+ if(this.selectionReactCancel) return
|
|
|
// selectAllHandle的触发在selectionChange后面,将selectionChange的逻辑延迟一下
|
|
|
setTimeout(()=>{
|
|
|
// 去重
|
|
@@ -286,6 +368,8 @@ import { dataInterence } from "@/api/api.js";
|
|
|
|
|
|
},
|
|
|
selectHandle(selection,row){
|
|
|
+ console.log(this.selectionReactCancel,'selectionReactCancel');
|
|
|
+ if(this.selectionReactCancel) return
|
|
|
console.log(selection,row,'row,selectHandle');
|
|
|
let check = false; // 从tableDataCheckedList 添加还是删除
|
|
|
if(selection.some(it => it.id == row.id)){
|
|
@@ -310,6 +394,8 @@ import { dataInterence } from "@/api/api.js";
|
|
|
}
|
|
|
},
|
|
|
selectAllHandle(selection){
|
|
|
+ console.log(this.selectionReactCancel,'selectionReactCancel');
|
|
|
+ if(this.selectionReactCancel) return
|
|
|
console.log(selection,'selectAllHandle');
|
|
|
let check = false; // 从tableDataCheckedList 添加还是删除
|
|
|
if(selection && selection.length>0){
|
|
@@ -346,46 +432,283 @@ import { dataInterence } from "@/api/api.js";
|
|
|
this.$refs.edbDataRef && this.$refs.edbDataRef.clearSelection()
|
|
|
}
|
|
|
},
|
|
|
+ adjustSelection(){
|
|
|
+ this.selectionReactCancel=true
|
|
|
+ console.log('adjustSelection');
|
|
|
+ if(!this.checkAllStatus){
|
|
|
+ this.tableDataCheckedList.map(it =>{
|
|
|
+ console.log(this.tableData,'this.tableData');
|
|
|
+ let row = this.tableData.find(da => da.id==it)
|
|
|
+ if(row){
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.$refs.edbDataRef.toggleRowSelection(row,true)
|
|
|
+ },1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // this.selectionReactCancel=true
|
|
|
+ this.$refs.edbDataRef.toggleAllSelection()
|
|
|
+ this.tableDataCheckedList.map(it =>{
|
|
|
+ console.log(this.tableData,'this.tableData',it);
|
|
|
+ let row = this.tableData.find(da => da.id==it)
|
|
|
+ if(row){
|
|
|
+ console.log(row,'row');
|
|
|
+ setTimeout(()=>{
|
|
|
+ console.log('toggleRowSelection false');
|
|
|
+ this.$refs.edbDataRef.toggleRowSelection(row,false)
|
|
|
+ },50)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.selectionReactCancel=false
|
|
|
+ },50)
|
|
|
+ },
|
|
|
// 添加指标库
|
|
|
- addToEdbBase(){
|
|
|
+ addToEdbBase:_.throttle(function() {
|
|
|
+ if(this.dataLoading || (!this.isCheckAll && !this.isCheckIndeterminate)) return
|
|
|
console.log(this.searchParams,this.checkAllStatus,this.tableDataCheckedList,'请求参数');
|
|
|
+ let params={
|
|
|
+ Source:Number(this.fromCode.get(this.fromType)),
|
|
|
+ SubSource:this.fromDatabase,
|
|
|
+ EdbCode:Array.from(new Set([...this.indexCode,...this.indexCodeSelected])).join(','),
|
|
|
+ StockCode:this.securityCodeText
|
|
|
+ }
|
|
|
+ return
|
|
|
+ // TODO: 检查接口对接
|
|
|
+ dataBaseInterface.edbExistCheck(params).then(res=>{
|
|
|
+ if(res.Ret == 200){
|
|
|
+ // console.log(res,'res');
|
|
|
+ // return
|
|
|
+ if(res.Data.IndexExist){
|
|
|
+ // 有重复
|
|
|
+ this.existIndexList=[]
|
|
|
+ let existEdbInfo=res.Data.ExistEdbInfo || []
|
|
|
+ let text=''
|
|
|
+ existEdbInfo.map(item =>{
|
|
|
+ text=`${item.EdbName}(${item.EdbCode})`
|
|
|
+ this.existIndexList.push({text,code:item.UniqueCode,id:item.EdbInfoId,Types:item.ClassifyId})
|
|
|
+ })
|
|
|
+ this.checkFailShow=true
|
|
|
+ }else{
|
|
|
+ // 没有重复
|
|
|
+ this.getTargetData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },300),
|
|
|
+ edbCheckFinished(){
|
|
|
+ this.checkFailShow=false
|
|
|
+ },
|
|
|
+ getTargetData(){
|
|
|
+ this.dataLoading=true
|
|
|
+ this.getMenu()
|
|
|
+ this.getTargetUnitList()
|
|
|
+ // TODO: 获取数据接口对接
|
|
|
+ dataBaseInterface.getTarget(params).then(res => {
|
|
|
+ if(res.Ret == 200){
|
|
|
+ let stockList = res.Data.SearchItem.StockList || []
|
|
|
+ this.edbIndexDatas=[]
|
|
|
+ this.BatchList=[]
|
|
|
+ stockList.map((item,index) =>{
|
|
|
+ let params={
|
|
|
+ Source,
|
|
|
+ ClassifyId:0,
|
|
|
+ Unit:'',
|
|
|
+ Frequency:'日度',
|
|
|
+ EdbName:isCommon?`${item.StockCode}${isCommon.label}`:`${item.StockCode}${item.EdbCode}`,
|
|
|
+ EdbCode:item.EdbCode,
|
|
|
+ StockCode:item.StockCode
|
|
|
+ }
|
|
|
+ this.BatchList.push(params)
|
|
|
+ let datas = item.DataList || []
|
|
|
+ let datasLength = datas.length
|
|
|
+ if( datasLength<10){
|
|
|
+ for (let i = datasLength; i < 10; i++) {
|
|
|
+ datas.push({DataTime:'',Value:''})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.edbIndexDatas.push({...params,DataList:datas})
|
|
|
+ })
|
|
|
+
|
|
|
+ let edbIndexDataLength = this.edbIndexDatas.length
|
|
|
+ //填充空的列
|
|
|
+ for (let i = edbIndexDataLength; i < 6; i++) {
|
|
|
+ this.edbIndexDatas.push({
|
|
|
+ Source:0,
|
|
|
+ ClassifyId:0,
|
|
|
+ Unit:'',
|
|
|
+ Frequency:'',
|
|
|
+ EdbName:'',
|
|
|
+ EdbCode:'',
|
|
|
+ StockCode:'',
|
|
|
+ DataList:new Array(10).fill({DataTime:'',Value:''})
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.addToEbdDiaShow=true
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ this.dataLoading=false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 获取目录结构 */
|
|
|
+ getMenu() {
|
|
|
+ dataBaseInterface.menuListV3().then(res => {
|
|
|
+ if(res.Ret === 200) {
|
|
|
+ this.filterNodes(res.Data.AllNodes||[]);
|
|
|
+ this.options = res.Data.AllNodes || [];
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 递归改变目录结构
|
|
|
+ filterNodes(arr) {
|
|
|
+ arr.length && arr.forEach(item => {
|
|
|
+ item.Children.length && this.filterNodes(item.Children)
|
|
|
+ if(!item.Children.length) {
|
|
|
+ item.Children=null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取指标单位
|
|
|
+ async getTargetUnitList(){
|
|
|
+ let res=await dataInterence.getTargetUnitList()
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.unitList=res.Data&&res.Data.map(item=>{
|
|
|
+ return {value:item}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ wsdSaveHandle(){
|
|
|
+ let flag = this.edbIndexDatas.some(it => {
|
|
|
+ return (it.StockCode && it.EdbCode) && ((!it.ClassifyId) || (!it.Unit) || (!it.Frequency) || (!it.EdbName))
|
|
|
+ })
|
|
|
+ if(flag){
|
|
|
+ this.$message.warning("指标信息未填写完整")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.BatchList.map((it,ind) => {
|
|
|
+ it.ClassifyId = this.edbIndexDatas[ind].ClassifyId
|
|
|
+ it.EdbCode = this.edbIndexDatas[ind].EdbCode
|
|
|
+ it.EdbName = this.edbIndexDatas[ind].EdbName
|
|
|
+ it.Frequency = this.edbIndexDatas[ind].Frequency
|
|
|
+ it.StockCode = this.edbIndexDatas[ind].StockCode
|
|
|
+ it.Unit = this.edbIndexDatas[ind].Unit
|
|
|
+ })
|
|
|
+ this.saveLoading=true
|
|
|
+ dataBaseInterface.edbAddBatch({BatchList:this.BatchList}).then(res=>{
|
|
|
+ if(res.Ret == 200){
|
|
|
+ this.$message.success("添加指标成功")
|
|
|
+ this.$emit('addSuccessHandle',{ code:res.Data.UniqueCode,id:res.Data.EdbInfoId,classifyId:res.Data.ClassifyId })
|
|
|
+ this.cancelHandle()
|
|
|
+ }else if(res.Ret == 403){
|
|
|
+ this.highLightIndex=res.Data?res.Data.ExistEdbName || []:[]
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ this.saveLoading=false
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
#YS-data-container{
|
|
|
// min-width: 1360px;
|
|
|
- background-color: white;
|
|
|
- min-height: calc(100vh - 120px);
|
|
|
position: relative;
|
|
|
- padding-bottom: 50px;
|
|
|
box-sizing: border-box;
|
|
|
.search-zone{
|
|
|
+ background-color: white;
|
|
|
display: flex;
|
|
|
align-items: flex-start;
|
|
|
justify-content: space-between;
|
|
|
padding: 20px 20px 10px;
|
|
|
+ border: 1px solid #C8CDD9;
|
|
|
+ margin-bottom: 20px;
|
|
|
.search-row{
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
flex-wrap: wrap;
|
|
|
.search-item{
|
|
|
width: 240px;
|
|
|
- margin: 0 30px 10px 0;
|
|
|
+ margin: 0 20px 10px 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
.table-zone{
|
|
|
- padding: 20px;
|
|
|
+ padding: 20px 20px 70px;
|
|
|
+ background-color: white;
|
|
|
+ border: 1px solid #C8CDD9;
|
|
|
+ min-height: calc(100vh - 215px);
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
|
.table-page{
|
|
|
position: absolute;
|
|
|
bottom: 20px;
|
|
|
right: 20px;
|
|
|
}
|
|
|
+ .edb-table-preview {
|
|
|
+ overflow: auto;
|
|
|
+ height: calc(100% - 124px);
|
|
|
+ &::-webkit-scrollbar {
|
|
|
+ width: 5px !important;
|
|
|
+ }
|
|
|
+ table {
|
|
|
+ border-color: #dcdfe6;
|
|
|
+ border-bottom: 1px solid #dcdfe6;
|
|
|
+ border-right: 1px solid #dcdfe6;
|
|
|
+ border-collapse: separate;
|
|
|
+ }
|
|
|
+ thead {
|
|
|
+ position: sticky;
|
|
|
+ z-index: 2;
|
|
|
+ top: 0;
|
|
|
+ }
|
|
|
+ td {
|
|
|
+ min-width: 100px;
|
|
|
+ max-width: 100px;
|
|
|
+ height: 30px;
|
|
|
+ // text-align: center;
|
|
|
+ color: #333;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 0 5px;
|
|
|
+ background-color: #fff;
|
|
|
+ border-top: 1px solid #dcdfe6;
|
|
|
+ border-left: 1px solid #dcdfe6;
|
|
|
+ }
|
|
|
+ .exist-highlight{
|
|
|
+ border: red solid 1px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .dia-bot {
|
|
|
+ margin: 30px 0;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
}
|
|
|
+</style>
|
|
|
+<style lang="scss">
|
|
|
+ #YS-data-container{
|
|
|
+ .edb-table-preview{
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+ .el-cascader{
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .el-autocomplete{
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .el-select{
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .el-input{
|
|
|
+ width: 100%;
|
|
|
+ input{
|
|
|
+ border: none;
|
|
|
+ padding-left: 7px;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
</style>
|