|
@@ -82,15 +82,15 @@
|
|
|
<template v-if="item.key==='handle'">
|
|
|
<span
|
|
|
class="editsty"
|
|
|
- @click="lookDataHandle"
|
|
|
+ @click="lookDataHandle(row)"
|
|
|
>
|
|
|
<!-- 查看数据 -->{{$t('Edb.detail_lookdata_btn')}}
|
|
|
</span>
|
|
|
|
|
|
<span
|
|
|
class="editsty"
|
|
|
- v-if="!row.EdbExist"
|
|
|
- @click="handleCheckEdb('single')"
|
|
|
+ v-if="!row.EdbInfoId"
|
|
|
+ @click="handleCheckEdb('single',row)"
|
|
|
>
|
|
|
<!-- 添加到指标库 -->{{$t('YsDataPage.add_base_btn')}}
|
|
|
</span>
|
|
@@ -118,12 +118,14 @@
|
|
|
<!-- 查看数据弹窗 -->
|
|
|
<lookEdbDataDia
|
|
|
:isShow.sync="isLookDataDia"
|
|
|
+ :edbInfo="lookEdbInfo"
|
|
|
/>
|
|
|
|
|
|
<!-- 加入指标库弹窗 -->
|
|
|
<addToBaseDia
|
|
|
:isShow.sync="isAddToBaseDia"
|
|
|
:list="addToBaseList"
|
|
|
+ @success="pageChange(1)"
|
|
|
/>
|
|
|
|
|
|
<!-- 操作提示弹窗 -->
|
|
@@ -139,19 +141,18 @@
|
|
|
<div class="hint-dialog-wrap">
|
|
|
<p style="margin-bottom: 20px;">{{ hintText }}</p>
|
|
|
<ul>
|
|
|
- <li v-for="(item,index) in existEdbList" :key="index" class="hint-item" @click="gotoEdbDetail(item)">
|
|
|
+ <li v-for="(item,index) in existEdbList" :key="index" class="hint-item" @click="goToEdbBase(item)">
|
|
|
{{ index+1 }}、{{ item.IndexName }}({{ item.IndexCode }})
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div style="text-align: center;margin-bottom: 30px;">
|
|
|
- <el-button type="primary" @click="handleCloseDialog">{{$t('Dialog.known')}}</el-button>
|
|
|
+ <el-button type="primary" @click="handleCloseHintDia">{{$t('Dialog.known')}}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { dataBaseInterface } from '@/api/api.js'
|
|
|
import { selfDataInterface } from '@/api/modules/dataSource';
|
|
|
import mPage from '@/components/mPage.vue';
|
|
|
import lookEdbDataDia from './components/lookEdbDataDia.vue';
|
|
@@ -217,28 +218,23 @@ export default {
|
|
|
},
|
|
|
|
|
|
hintText(){
|
|
|
- let msg = ''
|
|
|
- // if(this.afterAddList.length) key++
|
|
|
- // if(!this.beforeAddList.length) key++
|
|
|
- // return {
|
|
|
- // 0:'',
|
|
|
- // 1:this.$t('YsDataPage.haved_all_msg'),//本次添加的指标均已在指标库中,请勿重复添加!
|
|
|
- // 2:this.$t('YsDataPage.haved_some_msg'),//指标库中已存在以下指标,会自动过滤!
|
|
|
- // }[key]
|
|
|
+ let key = 0
|
|
|
+ if(this.existEdbList.length) key++
|
|
|
+ if(!this.addToBaseList.length) key++
|
|
|
+
|
|
|
+ return {
|
|
|
+ 0:'',
|
|
|
+ 1:this.$t('YsDataPage.haved_all_msg'),//本次添加的指标均已在指标库中,请勿重复添加!
|
|
|
+ 2:this.$t('YsDataPage.haved_some_msg'),//指标库中已存在以下指标,会自动过滤!
|
|
|
+ }[key]
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- edbMenuList: [],
|
|
|
tableLoading: false,
|
|
|
total: 0,
|
|
|
|
|
|
- tableData: [
|
|
|
- { EdbCode: 'w102256',EdbName:'1dqwd',Frequency:'日度',Unit:'无',Source:'',StartDate:'',LatestDate:'',CreateTime:'' },
|
|
|
- { EdbCode: 'w102256',EdbName:'1dqwd',Frequency:'日度',Unit:'无',Source:'',StartDate:'',LatestDate:'',CreateTime:'' },
|
|
|
- { EdbCode: 'w102256',EdbName:'1dqwd',Frequency:'日度',Unit:'无',Source:'',StartDate:'',LatestDate:'',CreateTime:'' },
|
|
|
- { EdbCode: 'w102256',EdbName:'1dqwd',Frequency:'日度',Unit:'无',Source:'',StartDate:'',LatestDate:'',CreateTime:'' },
|
|
|
- ],
|
|
|
+ tableData: [],
|
|
|
|
|
|
sourceOptions: [],
|
|
|
|
|
@@ -260,6 +256,7 @@ export default {
|
|
|
|
|
|
/* 查看数据弹窗 */
|
|
|
isLookDataDia: false,
|
|
|
+ lookEdbInfo: {},
|
|
|
|
|
|
/* 加入指标库弹窗 */
|
|
|
isAddToBaseDia: false,
|
|
@@ -274,29 +271,9 @@ export default {
|
|
|
},
|
|
|
mounted(){
|
|
|
this.getSource();
|
|
|
- this.getEdbMenuList();
|
|
|
this.getTableData();
|
|
|
},
|
|
|
methods:{
|
|
|
-
|
|
|
- getEdbMenuList() {
|
|
|
- dataBaseInterface.menuListV3().then(res => {
|
|
|
- if(res.Ret === 200) {
|
|
|
- this.edbMenuList = res.Data.AllNodes || [];
|
|
|
- this.filterNodes(this.edbMenuList);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 递归改变目录结构
|
|
|
- filterNodes(arr) {
|
|
|
- arr.length && arr.forEach(item => {
|
|
|
- item.Children.length && this.filterNodes(item.Children)
|
|
|
- if(!item.Children.length) {
|
|
|
- item.Children=null
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
getSource() {
|
|
|
selfDataInterface.getSourceList().then(res => {
|
|
|
if(res.Ret!==200 ) return
|
|
@@ -308,12 +285,16 @@ export default {
|
|
|
getTableData(type='filter') {
|
|
|
this.tableLoading = true;
|
|
|
|
|
|
+ const { frequency,page_no,pageSize,keyWord,source,sortParam,sortType } = this.filterObj;
|
|
|
+
|
|
|
let params = {
|
|
|
- Frequency: this.filterObj.frequency,
|
|
|
- CurrentIndex: this.filterObj.page_no,
|
|
|
- PageSize: this.filterObj.pageSize,
|
|
|
- Keywords: this.filterObj.keyWord,
|
|
|
- Source: this.filterObj.source
|
|
|
+ Frequency: frequency,
|
|
|
+ CurrentIndex: page_no,
|
|
|
+ PageSize: pageSize,
|
|
|
+ Keywords: keyWord,
|
|
|
+ Source: source,
|
|
|
+ SortField: sortParam,
|
|
|
+ SortRule: sortType
|
|
|
}
|
|
|
selfDataInterface.getEdbList(params).then(res => {
|
|
|
this.tableLoading = false;
|
|
@@ -340,7 +321,7 @@ export default {
|
|
|
|
|
|
if(!this.isSelectAll){
|
|
|
this.checkedList.map(_ =>{
|
|
|
- let row = this.tableData.find(item => item.DataId==_.DataId)
|
|
|
+ let row = this.tableData.find(item => item.IndexCode==_.IndexCode)
|
|
|
if(row){ //设置部分选中
|
|
|
setTimeout(()=>{
|
|
|
this.$refs.table.toggleRowSelection(row,true)
|
|
@@ -350,7 +331,7 @@ export default {
|
|
|
}else{
|
|
|
this.$refs.table &&this.$refs.table.toggleAllSelection()
|
|
|
this.checkedList.map(_ =>{
|
|
|
- let row = this.tableData.find(item => item.DataId==_.DataId)
|
|
|
+ let row = this.tableData.find(item => item.IndexCode==_.IndexCode)
|
|
|
if(row){ //设置部分不勾选
|
|
|
setTimeout(()=>{
|
|
|
this.$refs.table.toggleRowSelection(row,false)
|
|
@@ -406,13 +387,13 @@ export default {
|
|
|
if(this.selectionReactCancel) return
|
|
|
|
|
|
//当前项是选中还是取消选
|
|
|
- let haveChecked = selection.some(_ => _.DataId === row.DataId);
|
|
|
+ let haveChecked = selection.some(_ => _.IndexCode === row.IndexCode);
|
|
|
|
|
|
//全选取消选和不全选选中才有意义
|
|
|
if((haveChecked&&!this.isSelectAll) || (!haveChecked&&this.isSelectAll)) {
|
|
|
this.checkedList.push(row)
|
|
|
}else {
|
|
|
- this.checkedList=this.checkedList.filter(_ => _.DataId!==row.DataId)
|
|
|
+ this.checkedList=this.checkedList.filter(_ => _.IndexCode!==row.IndexCode)
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -428,8 +409,8 @@ export default {
|
|
|
this.checkedList = [...this.checkedList,...this.tableData]
|
|
|
}else {
|
|
|
|
|
|
- let pageIds = this.tableData.map(_ => _.DataId);
|
|
|
- this.checkedList = this.checkedList.filter(_ => !pageIds.includes(_.DataId))
|
|
|
+ let pageIds = this.tableData.map(_ => _.IndexCode);
|
|
|
+ this.checkedList = this.checkedList.filter(_ => !pageIds.includes(_.IndexCode))
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -457,7 +438,9 @@ export default {
|
|
|
},
|
|
|
|
|
|
/* 查看数据 */
|
|
|
- lookDataHandle() {
|
|
|
+ lookDataHandle(item) {
|
|
|
+
|
|
|
+ this.lookEdbInfo = item;
|
|
|
this.isLookDataDia = true
|
|
|
},
|
|
|
|
|
@@ -473,7 +456,7 @@ export default {
|
|
|
SortField:sortParam||0,
|
|
|
SortRule:sortType||0,
|
|
|
ListAll:type==='single'?false:this.isSelectAll,
|
|
|
- IndexCodes:type==='single'?[data.IndexCode]:this.checkedList
|
|
|
+ IndexCodes:type==='single'?[data.IndexCode]:this.checkedList.map(_=>_.IndexCode)
|
|
|
}).then(res=>{
|
|
|
if(res.Ret!==200) return
|
|
|
|
|
@@ -486,21 +469,21 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
-
|
|
|
- //操作提示弹窗关闭
|
|
|
+ //提示弹窗关闭
|
|
|
handleCloseHintDia(){
|
|
|
this.isHintDialogShow = false
|
|
|
//判断是否要展示下一个弹窗
|
|
|
- if(this.addToBaseList.length) return
|
|
|
+ if(!this.addToBaseList.length) return
|
|
|
+
|
|
|
+ if(this.addToBaseList.length>100) return this.$message.warning('批量添加指标数量不得超过100个!')
|
|
|
|
|
|
- this.addForm.list = this.addToBaseList
|
|
|
this.isAddToBaseDia = true
|
|
|
},
|
|
|
|
|
|
//跳转至指标详情
|
|
|
- gotoEdbBase(data){
|
|
|
+ goToEdbBase(data){
|
|
|
const {EdbClassifyId,EdbInfoId,EdbUniqueCode} = data||{}
|
|
|
- const href = this.$router.resolve({
|
|
|
+ const { href } = this.$router.resolve({
|
|
|
path:'/database',
|
|
|
query:{
|
|
|
code:EdbUniqueCode,
|