|
@@ -27,6 +27,7 @@
|
|
placeholder="指标名称/指标ID"
|
|
placeholder="指标名称/指标ID"
|
|
@select="handleSelectLeftSearchval"
|
|
@select="handleSelectLeftSearchval"
|
|
popper-class="el-autocomplete-suggestion-data-entry"
|
|
popper-class="el-autocomplete-suggestion-data-entry"
|
|
|
|
+ @clear="clearSearchVal"
|
|
clearable
|
|
clearable
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -34,20 +35,19 @@
|
|
暂无数据
|
|
暂无数据
|
|
</div>
|
|
</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
- {{ scope.item.QuotaName }}
|
|
|
|
- {{ frequencyType.get(scope.item.Frequency) }}
|
|
|
|
|
|
+ {{ scope.item.IndexName }}
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-autocomplete>
|
|
</el-autocomplete>
|
|
</div>
|
|
</div>
|
|
<ul class="classify-list">
|
|
<ul class="classify-list">
|
|
<li
|
|
<li
|
|
- :class="['classify-item', { act: select_classify === item.BreedId }]"
|
|
|
|
|
|
+ :class="['classify-item', { act: select_classify === item.BaseFromIcpiClassifyId }]"
|
|
v-for="item in classifyList"
|
|
v-for="item in classifyList"
|
|
- :key="item.BreedId"
|
|
|
|
|
|
+ :key="item.BaseFromIcpiClassifyId"
|
|
@click="changeClassify(item)"
|
|
@click="changeClassify(item)"
|
|
>
|
|
>
|
|
- {{ item.BreedName }}
|
|
|
|
|
|
+ {{ item.ClassifyName }}
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
@@ -56,14 +56,14 @@
|
|
v-loading="dataloading"
|
|
v-loading="dataloading"
|
|
element-loading-text="获取数据中..."
|
|
element-loading-text="获取数据中..."
|
|
>
|
|
>
|
|
- <div class="right-box" v-if="rightShow">
|
|
|
|
|
|
+ <div class="right-box" v-if="rightShow" @scroll="scrollHandle">
|
|
<template v-if="dateArr.length">
|
|
<template v-if="dateArr.length">
|
|
<div class="data-header">
|
|
<div class="data-header">
|
|
<lz-table
|
|
<lz-table
|
|
:tableOption="tableOption"
|
|
:tableOption="tableOption"
|
|
tableType="header"
|
|
tableType="header"
|
|
ref="table"
|
|
ref="table"
|
|
- source="lz"
|
|
|
|
|
|
+ source="icpi"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div class="data-cont">
|
|
<div class="data-cont">
|
|
@@ -71,7 +71,7 @@
|
|
:tableOption="tableOption"
|
|
:tableOption="tableOption"
|
|
tableType="data"
|
|
tableType="data"
|
|
:dateArr="dateArr"
|
|
:dateArr="dateArr"
|
|
- source="lz"
|
|
|
|
|
|
+ source="icpi"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -94,51 +94,31 @@ export default {
|
|
isLeftWrapShow:true,
|
|
isLeftWrapShow:true,
|
|
dataloading: false,
|
|
dataloading: false,
|
|
rightShow: false,
|
|
rightShow: false,
|
|
- exportBase: process.env.VUE_APP_API_ROOT + "/datamanage/export/lzList", //数据导出接口
|
|
|
|
|
|
+ exportBase: process.env.VUE_APP_API_ROOT + "/data_source/icpi/export/icpiDataList", //数据导出接口
|
|
select_classify: "",
|
|
select_classify: "",
|
|
classifyList: [],
|
|
classifyList: [],
|
|
- frequencyType: new Map([
|
|
|
|
- [1, "日度"],
|
|
|
|
- [2, "周度"],
|
|
|
|
- [3, "月度"],
|
|
|
|
- [4, "季度"],
|
|
|
|
- [5, "年度"],
|
|
|
|
- [99, "无固定频率"],
|
|
|
|
- ]),
|
|
|
|
tableOption: [],
|
|
tableOption: [],
|
|
dateArr: [], //最长的日期数组
|
|
dateArr: [], //最长的日期数组
|
|
btnload: false,
|
|
btnload: false,
|
|
|
|
|
|
leftSearchVal: "", //左侧搜索值
|
|
leftSearchVal: "", //左侧搜索值
|
|
- leftSearchTradeCode: "", //如果是搜索选择的 则有此code
|
|
|
|
- select_quota: "", // 选中的指标名称
|
|
|
|
- select_Unit: "", // 选中的单位
|
|
|
|
- select_ModifyTime: "", //选中的更新时间
|
|
|
|
- select_breed: "", // 选中的分类名称
|
|
|
|
pageParams:{
|
|
pageParams:{
|
|
PageSize:20,
|
|
PageSize:20,
|
|
- CurrentIndex:1
|
|
|
|
- }
|
|
|
|
|
|
+ CurrentIndex:1,
|
|
|
|
+ KeyWord:''
|
|
|
|
+ },
|
|
|
|
+ havemore:true
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- exportLzapi() {
|
|
|
|
|
|
+ exportIcpiApi() {
|
|
// 数据导出接口
|
|
// 数据导出接口
|
|
let urlStr = this.exportBase;
|
|
let urlStr = this.exportBase;
|
|
// token
|
|
// token
|
|
urlStr += `?${localStorage.getItem("auth") || ""}`;
|
|
urlStr += `?${localStorage.getItem("auth") || ""}`;
|
|
- // 指标名称参数
|
|
|
|
- urlStr += `&QuotaName=${this.select_quota}`;
|
|
|
|
- // 指标id
|
|
|
|
- urlStr += `&LzCode=${this.leftSearchTradeCode}`;
|
|
|
|
- // 分类名称
|
|
|
|
- urlStr += `&BreedName=${this.select_breed}`;
|
|
|
|
- // 频度
|
|
|
|
- urlStr += `&Frequency=${this.select_frequency}`;
|
|
|
|
- // 单位
|
|
|
|
- urlStr += `&UnitName=${this.select_Unit}`;
|
|
|
|
- // 修改时间
|
|
|
|
- urlStr += `&ModifyTime=${this.select_ModifyTime}`;
|
|
|
|
|
|
+ // 分类Id参数
|
|
|
|
+ urlStr += `&BaseFromIcpiClassifyId=${this.select_classify}`;
|
|
|
|
+ urlStr += `&KeyWord=${this.pageParams.KeyWord}`;
|
|
return this.escapeStr(urlStr);
|
|
return this.escapeStr(urlStr);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -148,14 +128,12 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
/* 获取分类 */
|
|
/* 获取分类 */
|
|
getClassify() {
|
|
getClassify() {
|
|
- // icpiInterface
|
|
|
|
- lzDataInterface.classifyList().then((res) => {
|
|
|
|
|
|
+ icpiInterface.classifyList().then((res) => {
|
|
if (res.Ret !== 200) return;
|
|
if (res.Ret !== 200) return;
|
|
- console.log(res);
|
|
|
|
this.classifyList = res.Data || [];
|
|
this.classifyList = res.Data || [];
|
|
this.select_classify =
|
|
this.select_classify =
|
|
- this.select_classify || this.classifyList[0].BreedId;
|
|
|
|
- this.select_breed = this.classifyList[0].BreedName;
|
|
|
|
|
|
+ this.select_classify || this.classifyList[0].BaseFromIcpiClassifyId;
|
|
|
|
+
|
|
this.getDataList()
|
|
this.getDataList()
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -163,14 +141,20 @@ export default {
|
|
/* 获取数据 */
|
|
/* 获取数据 */
|
|
getDataList() {
|
|
getDataList() {
|
|
this.dataloading = true;
|
|
this.dataloading = true;
|
|
- // icpiInterface.dataList({
|
|
|
|
- // BaseFromIcpiClassifyId: Number(this.select_classify),
|
|
|
|
- // PageSize:this.pageParams.PageSize,
|
|
|
|
- // CurrentIndex:this.pageParams.CurrentIndex
|
|
|
|
- // })
|
|
|
|
- lzDataInterface.dataList({BaseFromIcpiClassifyId: Number(this.select_classify),Frequency:1}).then((res) => {
|
|
|
|
|
|
+ icpiInterface.dataList({
|
|
|
|
+ BaseFromIcpiClassifyId: Number(this.select_classify),
|
|
|
|
+ PageSize:this.pageParams.PageSize,
|
|
|
|
+ CurrentIndex:this.pageParams.CurrentIndex,
|
|
|
|
+ KeyWord:this.pageParams.KeyWord
|
|
|
|
+ }).then((res) => {
|
|
this.rightShow = true;
|
|
this.rightShow = true;
|
|
if (res.Ret !== 200) return;
|
|
if (res.Ret !== 200) return;
|
|
|
|
+
|
|
|
|
+ // 找出最多的页码 判断是否还有数据
|
|
|
|
+ let page_arrs = res.Data.map((item) => item.Paging?item.Paging.Pages:0);
|
|
|
|
+ let totalPage = Math.max.apply(Math, page_arrs);
|
|
|
|
+ this.havemore = this.pageParams.CurrentIndex < totalPage ? true : false;
|
|
|
|
+
|
|
// 设置表格数据
|
|
// 设置表格数据
|
|
this.setDataList(res.Data);
|
|
this.setDataList(res.Data);
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -182,13 +166,9 @@ export default {
|
|
},
|
|
},
|
|
/* 改变品种 */
|
|
/* 改变品种 */
|
|
changeClassify(item) {
|
|
changeClassify(item) {
|
|
- this.select_classify = item.BreedId;
|
|
|
|
- this.select_breed = item.BreedName;
|
|
|
|
|
|
+ this.select_classify = item.BaseFromIcpiClassifyId;
|
|
this.leftSearchVal = ""
|
|
this.leftSearchVal = ""
|
|
- this.leftSearchTradeCode = ""
|
|
|
|
- this.select_quota = ""
|
|
|
|
- this.select_Unit = ""
|
|
|
|
- this.select_ModifyTime = ""
|
|
|
|
|
|
+ this.pageParams.KeyWord=''
|
|
this.getDataList()
|
|
this.getDataList()
|
|
},
|
|
},
|
|
|
|
|
|
@@ -198,12 +178,15 @@ export default {
|
|
$(".right-box")[0].scrollTop = 0;
|
|
$(".right-box")[0].scrollTop = 0;
|
|
$(".right-box")[0].scrollLeft = 0;
|
|
$(".right-box")[0].scrollLeft = 0;
|
|
},
|
|
},
|
|
|
|
+ // 对[#,;]转义
|
|
|
|
+ escapeStr(str) {
|
|
|
|
+ return str.replace(/#/g, escape("#")).replace(/;/g, escape(";"));
|
|
|
|
+ },
|
|
/* 导出 */
|
|
/* 导出 */
|
|
exportClick() {
|
|
exportClick() {
|
|
this.btnload = true;
|
|
this.btnload = true;
|
|
- // TODO: 导出接口对接
|
|
|
|
const link = document.createElement("a");
|
|
const link = document.createElement("a");
|
|
- link.href = this.exportLzapi;
|
|
|
|
|
|
+ link.href = this.exportIcpiApi;
|
|
link.download = "";
|
|
link.download = "";
|
|
link.click();
|
|
link.click();
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -215,8 +198,8 @@ export default {
|
|
async handleLeftSearch(query, cb) {
|
|
async handleLeftSearch(query, cb) {
|
|
cb([]);
|
|
cb([]);
|
|
if (!query) return;
|
|
if (!query) return;
|
|
- const res = await lzDataInterface.getTargetListByName({
|
|
|
|
- Keyword: query,
|
|
|
|
|
|
+ const res = await icpiInterface.dataList({
|
|
|
|
+ KeyWord: query
|
|
});
|
|
});
|
|
if (res.Ret === 200) {
|
|
if (res.Ret === 200) {
|
|
let arr = res.Data || [];
|
|
let arr = res.Data || [];
|
|
@@ -229,25 +212,22 @@ export default {
|
|
},
|
|
},
|
|
// 选中左侧搜索值
|
|
// 选中左侧搜索值
|
|
handleSelectLeftSearchval(e) {
|
|
handleSelectLeftSearchval(e) {
|
|
- if (!e.LzCode) return;
|
|
|
|
|
|
+ if (!e.BaseFromIcpiIndexId) return;
|
|
this.rightShow = false;
|
|
this.rightShow = false;
|
|
- this.leftSearchTradeCode = e.LzCode;
|
|
|
|
- this.leftSearchVal = e.QuotaName;
|
|
|
|
- this.select_quota = e.QuotaName;
|
|
|
|
- this.select_Unit = e.UnitName;
|
|
|
|
- this.select_ModifyTime = e.ModifyTime;
|
|
|
|
- this.select_classify = this.classifyList.find(
|
|
|
|
- (item) => item.BreedName === e.BreedName
|
|
|
|
- ).BreedId;
|
|
|
|
- this.select_breed = "";
|
|
|
|
-
|
|
|
|
- this.setDataList([e]);
|
|
|
|
|
|
+ this.leftSearchVal = e.IndexName;
|
|
|
|
+ this.pageParams.KeyWord=e.IndexName
|
|
|
|
+ this.select_classify = e.BaseFromIcpiClassifyId;
|
|
|
|
+ this.pageParams.CurrentIndex=1
|
|
this.getDataList()
|
|
this.getDataList()
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.rightShow = true;
|
|
this.rightShow = true;
|
|
this.handleScrollLeftWrap();
|
|
this.handleScrollLeftWrap();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ clearSearchVal(){
|
|
|
|
+ this.pageParams.KeyWord=''
|
|
|
|
+ this.getDataList()
|
|
|
|
+ },
|
|
// 左侧滚动
|
|
// 左侧滚动
|
|
handleScrollLeftWrap() {
|
|
handleScrollLeftWrap() {
|
|
let top = $(".act")[0].offsetTop;
|
|
let top = $(".act")[0].offsetTop;
|
|
@@ -255,19 +235,41 @@ export default {
|
|
scrollTop: top - 200,
|
|
scrollTop: top - 200,
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ /* 滚动加载 */
|
|
|
|
+ scrollHandle(e) {
|
|
|
|
+ const dom = e.target;
|
|
|
|
+ let total = dom.scrollTop + dom.clientHeight;
|
|
|
|
+ if (total >= dom.scrollHeight && this.havemore) {
|
|
|
|
+ this.pageParams.CurrentIndex++;
|
|
|
|
+ // console.log("load下一页");
|
|
|
|
+ this.getDataList();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 设置表格数据
|
|
// 设置表格数据
|
|
- setDataList(tableOption) {
|
|
|
|
- this.tableOption = tableOption;
|
|
|
|
- /* 不满7个追加7个空的显示一排 别问 问就是为了美观 */
|
|
|
|
- if (tableOption.length < 7)
|
|
|
|
- for (let i = 0; i < 7; i++) {
|
|
|
|
- this.tableOption.push({
|
|
|
|
- DataList: [],
|
|
|
|
- });
|
|
|
|
- if (this.tableOption.length >= 7) break;
|
|
|
|
|
|
+ setDataList(data) {
|
|
|
|
+ if(this.pageParams.CurrentIndex==1){
|
|
|
|
+ this.tableOption = data;
|
|
|
|
+ /* 不满7个追加7个空的显示一排 别问 问就是为了美观 */
|
|
|
|
+ if (this.tableOption.length < 7){
|
|
|
|
+ for (let i = 0; i < 7; i++) {
|
|
|
|
+ this.tableOption.push({
|
|
|
|
+ DataList: [],
|
|
|
|
+ });
|
|
|
|
+ if (this.tableOption.length >= 7) break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ }else{
|
|
|
|
+ this.tableOption.forEach((item) => {
|
|
|
|
+ data.forEach((_item) => {
|
|
|
|
+ if (item.IndexCode === _item.IndexCode) {
|
|
|
|
+ item.DataList = item.DataList.concat(_item.DataList);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
// 合并所有日期
|
|
// 合并所有日期
|
|
- let arr = tableOption.map((item) => item.DataList);
|
|
|
|
|
|
+ let arr = this.tableOption.map((item) => item.DataList);
|
|
let obj = [];
|
|
let obj = [];
|
|
arr.forEach((dataList) => {
|
|
arr.forEach((dataList) => {
|
|
obj.push(...dataList.map((item) => item.DataTime));
|
|
obj.push(...dataList.map((item) => item.DataTime));
|
|
@@ -275,11 +277,12 @@ export default {
|
|
// 日期去重倒序排序
|
|
// 日期去重倒序排序
|
|
this.dateArr = [...new Set(obj)].sort().reverse();
|
|
this.dateArr = [...new Set(obj)].sort().reverse();
|
|
//数据最大长度小于13个 追加数据满13个 别问 问就是为了美观
|
|
//数据最大长度小于13个 追加数据满13个 别问 问就是为了美观
|
|
- if (this.dateArr.length < 13)
|
|
|
|
|
|
+ if (this.dateArr.length < 13){
|
|
for (let i = 0; i < 13; i++) {
|
|
for (let i = 0; i < 13; i++) {
|
|
this.dateArr.push("");
|
|
this.dateArr.push("");
|
|
if (this.dateArr.length >= 13) break;
|
|
if (this.dateArr.length >= 13) break;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|