|
@@ -80,7 +80,7 @@
|
|
|
<!-- 上部 -->
|
|
|
<div class="menuMainBox_main_top" v-if="!menuData.topSolt">
|
|
|
<slot name="top"> </slot>
|
|
|
- <TopCard v-if="menuData.commonName == 'TOP'" :dataList="menuData.topData"/>
|
|
|
+ <TopCard v-if="menuData.commonName == 'TOP'" :dataList="menuData.topData" :columnName="menuData.field" />
|
|
|
</div>
|
|
|
<div class="menuMainBox_main_top" v-if="menuData.topSolt">
|
|
|
<TagTableCard
|
|
@@ -234,10 +234,9 @@ export default {
|
|
|
this.dataInitLoading = false;
|
|
|
}
|
|
|
);
|
|
|
- } else if (this.menuData && this.menuData.columnId) {
|
|
|
+ } else if (this.menuData && this.menuData.columnId && this.menuData.commonName !== "SUM") {
|
|
|
this.dataInitLoading = true;
|
|
|
let params = new FormData();
|
|
|
- this.countUser = 0;
|
|
|
params.append("columnId", this.menuData.columnId);
|
|
|
if (this.menuData.field) {
|
|
|
params.append("field", this.menuData.field);
|
|
@@ -245,6 +244,9 @@ export default {
|
|
|
params.append("states", "2,3");
|
|
|
params.append("pageSize", this.menuData.pageSize ? this.menuData.pageSize : 999);
|
|
|
params.append("page", 0);
|
|
|
+ if (this.menuData.paramJson) {
|
|
|
+ params.append("paramJson", JSON.stringify(this.menuData.paramJson));
|
|
|
+ }
|
|
|
if (this.menuData.sortField) {
|
|
|
let sortparam = [
|
|
|
{
|
|
@@ -257,13 +259,13 @@ export default {
|
|
|
this.$Post(this.menuData.getUrl ? this.menuData.getUrl : this.urlsCollection.selectContentList, params).then(
|
|
|
res => {
|
|
|
if (this.menuData.commonName && this.menuData.commonName === "TOP" && res.code === 200 && res.content.length > 0) {
|
|
|
- res.content.forEach((item,index)=>{
|
|
|
- if(this.menuData.dataSize > index){
|
|
|
+ res.content.forEach((item, index) => {
|
|
|
+ if (this.menuData.dataSize > index) {
|
|
|
this.resData[index] = item;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
this.changeHomeSpecialTown();
|
|
|
- }else if (res.code === 200 && res.content.data && res.content.data.length > 0) {
|
|
|
+ } else if (res.code === 200 && res.content.data && res.content.data.length > 0) {
|
|
|
let listMap = {};
|
|
|
let tableData = res.content.data;
|
|
|
tableData.forEach(item => {
|
|
@@ -318,6 +320,8 @@ export default {
|
|
|
this.dataInitLoading = false;
|
|
|
}
|
|
|
);
|
|
|
+ } else if (this.menuData.commonName && this.menuData.commonName === "SUM") {
|
|
|
+ this.sumData();
|
|
|
}
|
|
|
// 只有第一次创建该页面,或刷新页面时。
|
|
|
if (this.menuData.menuIndex) {
|
|
@@ -352,7 +356,6 @@ export default {
|
|
|
* columnId:DMS数据请求columnId
|
|
|
* pageSize:DMS数据请求个数
|
|
|
* field:DMS数据请求field
|
|
|
- * dataType:DMS数据类型
|
|
|
* sortField=>:DMS数据请求排序配置
|
|
|
* field:排序字段
|
|
|
* orderByType:排序类型【1:正序,2:倒序】
|
|
@@ -377,6 +380,58 @@ export default {
|
|
|
*/
|
|
|
props: ["menuData"],
|
|
|
methods: {
|
|
|
+ sumData() {
|
|
|
+ this.dataInitLoading = true;
|
|
|
+ let params = new FormData();
|
|
|
+ params.append("columnId", this.menuData.columnId);
|
|
|
+ if (this.menuData.field) {
|
|
|
+ params.append("field", this.menuData.field);
|
|
|
+ }
|
|
|
+ params.append("states", "2,3");
|
|
|
+ params.append("pageSize", this.menuData.pageSize ? this.menuData.pageSize : 999);
|
|
|
+ params.append("page", 0);
|
|
|
+ if (this.menuData.paramJson) {
|
|
|
+ if (this.menuData.categoryData) {
|
|
|
+ let pramJson = {};
|
|
|
+ this.menuData.categoryData.forEach((item,_index) => {
|
|
|
+ pramJson.c_new_date = item;
|
|
|
+ pramJson.sj_select = this.menuData.paramJson.sj_select;
|
|
|
+ params.append("paramJson", JSON.stringify(pramJson));
|
|
|
+ if (this.menuData.sortField) {
|
|
|
+ let sortparam = [
|
|
|
+ {
|
|
|
+ field: this.menuData.sortField.field,
|
|
|
+ orderByType: this.menuData.sortField.orderByType
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ params.append("orderBy", JSON.stringify(sortparam));
|
|
|
+ }
|
|
|
+ this.$Post(this.menuData.getUrl ? this.menuData.getUrl : this.urlsCollection.selectContentList, params).then(
|
|
|
+ res => {
|
|
|
+ if (res.code === 200 && res.content.length > 0) {
|
|
|
+ this.menuData.topSolt.commonData[0].categoryData[_index] = item;
|
|
|
+ let sumField = 0;
|
|
|
+ res.content.forEach(contentItem => {
|
|
|
+ sumField += Number(contentItem.number);
|
|
|
+ });
|
|
|
+ this.menuData.topSolt.commonData[0].valueData[_index] = sumField;
|
|
|
+ } else {
|
|
|
+ this.menuData.topSolt.commonData[0].categoryData = [];
|
|
|
+ this.menuData.topSolt.commonData[0].valueData = [];
|
|
|
+ }
|
|
|
+ this.dataInitLoading = false;
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.menuData.topSolt.commonData[0].categoryData = [];
|
|
|
+ this.menuData.topSolt.commonData[0].valueData = [];
|
|
|
+ console.log("error:", error, this.menuData);
|
|
|
+ this.dataInitLoading = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 切换街镇时
|
|
|
changeHomeSpecialTown() {
|
|
|
if (this.resData[this.$store.state.homeSpecialTown] && this.menuData.topSolt.commonData) {
|
|
@@ -414,8 +469,10 @@ export default {
|
|
|
this.menuData.topSolt.commonData[index].value = 0;
|
|
|
}
|
|
|
});
|
|
|
- } else if(this.menuData && this.menuData.commonName && this.menuData.commonName === "TOP"){
|
|
|
+ } else if (this.menuData && this.menuData.commonName && this.menuData.commonName === "TOP") {
|
|
|
this.menuData.topData = this.resData;
|
|
|
+ } else if (this.menuData && this.menuData.commonName && this.menuData.commonName === "SUM") {
|
|
|
+ this.sumData(this.$store.state.homeSpecialTown);
|
|
|
}
|
|
|
},
|
|
|
// 当用户使用光标切换交互组件时触发
|