|
@@ -476,55 +476,61 @@
|
|
|
>
|
|
|
<el-form label-width="100px">
|
|
|
<el-row>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item
|
|
|
- label="数据源:"
|
|
|
- style="margin-bottom: 20px; width: 300px"
|
|
|
- >
|
|
|
- <el-select v-model="groupBasicForm.dataSourceId" disabled>
|
|
|
- <el-option
|
|
|
- v-for="dict in dataSourceList"
|
|
|
- :key="dict.id"
|
|
|
- :label="dict.dataSourceName"
|
|
|
- :value="dict.id"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- v-if="itemDataStep == 2"
|
|
|
- label="数据项:"
|
|
|
- style="margin-bottom: 0px; width: 300px"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- placeholder="请输入数据项名称进行过滤"
|
|
|
- style=""
|
|
|
- @input="chooseItemChangeEvent"
|
|
|
- v-model="filterChooseItemText"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col >
|
|
|
+ <el-col :span="isScreen ? 6 : 12">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="数据源:"
|
|
|
+ style="margin-bottom: 20px; width: 300px"
|
|
|
+ >
|
|
|
+ <el-select v-model="groupBasicForm.dataSourceId" disabled>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dataSourceList"
|
|
|
+ :key="dict.id"
|
|
|
+ :label="dict.dataSourceName"
|
|
|
+ :value="dict.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ v-if="itemDataStep == 2"
|
|
|
+ label="数据项:"
|
|
|
+ style="margin-bottom: 0px; width: 300px"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入数据项名称进行过滤"
|
|
|
+ style=""
|
|
|
+ @input="chooseItemChangeEvent"
|
|
|
+ v-model="filterChooseItemText"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
<template v-if="isScreen">
|
|
|
<el-select
|
|
|
- v-model="queryParams.needItemStr"
|
|
|
- multiple
|
|
|
- collapse-tags
|
|
|
- placeholder="请选择"
|
|
|
+ v-model="queryParams.needItemStr"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ placeholder="请选择"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in DriverItemData"
|
|
|
- :key="item.id"
|
|
|
- :label="item.itemName"
|
|
|
- :value="item.itemName"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ <el-option
|
|
|
+ v-for="item in DriverItemData"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.itemName"
|
|
|
+ :value="item.itemName"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- style="margin-left: 15px;"
|
|
|
-
|
|
|
- @click="query"
|
|
|
- >复合筛选</el-button>
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ style="margin-left: 15px"
|
|
|
+ @click="query"
|
|
|
+ >复合筛选</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
@@ -552,7 +558,7 @@
|
|
|
: 'height: 100%; overflow: auto;'
|
|
|
"
|
|
|
>
|
|
|
- <!-- :show-checkbox="hasLeavesFlag == 1 ? false : true"-->
|
|
|
+ <!-- :show-checkbox="hasLeavesFlag == 1 ? false : true"-->
|
|
|
<el-tree
|
|
|
class="cy-item-tree"
|
|
|
ref="itemTree"
|
|
@@ -1035,7 +1041,7 @@ export default {
|
|
|
needItemStr: [],
|
|
|
},
|
|
|
chooiseItemData: [],
|
|
|
- isScreen:true
|
|
|
+ isScreen: true,
|
|
|
};
|
|
|
},
|
|
|
props: ["refreshReportTemplateData"],
|
|
@@ -1107,68 +1113,81 @@ export default {
|
|
|
methods: {
|
|
|
query() {
|
|
|
this.queryParams.nextItemStr = this.filterItemData;
|
|
|
- // if (this.filterItemData) {
|
|
|
- // this.queryParams.needItemStr = JSON.stringify(
|
|
|
- // this.queryParams.needItemStr
|
|
|
- // );
|
|
|
- // }
|
|
|
- let params = this.queryParams;
|
|
|
- params.needItemStr = JSON.stringify(this.queryParams.needItemStr.length > 0 ? this.queryParams.needItemStr : [])
|
|
|
- const treeArr = this.$refs.itemTree.getCheckedNodes();
|
|
|
- const treeQ = document.getElementsByClassName('el-tree cy-item-tree el-tree--highlight-current')[0]
|
|
|
- .getElementsByClassName('el-tree-node__content');
|
|
|
- let seTreeArr = []
|
|
|
- if (treeArr.length > 0) {
|
|
|
- for (let i = 0; i < treeQ.length; i++) {
|
|
|
- if (treeQ[i].parentElement.classList.contains('is-current')) {
|
|
|
- // 选择的层级
|
|
|
- let treechild = treeQ[i].nextElementSibling.getElementsByClassName('el-tree-node__content');
|
|
|
- for (let j = 0; j < treechild.length; j++) {
|
|
|
- if (treechild[j].parentElement.classList.contains('is-checked')) {
|
|
|
- seTreeArr.push(treechild[j].textContent)
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
+ // if (this.filterItemData) {
|
|
|
+ // this.queryParams.needItemStr = JSON.stringify(
|
|
|
+ // this.queryParams.needItemStr
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ let params = this.queryParams;
|
|
|
+ params.needItemStr = JSON.stringify(
|
|
|
+ this.queryParams.needItemStr.length > 0
|
|
|
+ ? this.queryParams.needItemStr
|
|
|
+ : []
|
|
|
+ );
|
|
|
+ const treeArr = this.$refs.itemTree.getCheckedNodes();
|
|
|
+ const treeQ = document
|
|
|
+ .getElementsByClassName(
|
|
|
+ "el-tree cy-item-tree el-tree--highlight-current"
|
|
|
+ )[0]
|
|
|
+ .getElementsByClassName("el-tree-node__content");
|
|
|
+ let seTreeArr = [];
|
|
|
+ if (treeArr.length > 0) {
|
|
|
+ for (let i = 0; i < treeQ.length; i++) {
|
|
|
+ if (treeQ[i].parentElement.classList.contains("is-current")) {
|
|
|
+ // 选择的层级
|
|
|
+ let treechild = treeQ[i].nextElementSibling.getElementsByClassName(
|
|
|
+ "el-tree-node__content"
|
|
|
+ );
|
|
|
+ for (let j = 0; j < treechild.length; j++) {
|
|
|
+ if (treechild[j].parentElement.classList.contains("is-checked")) {
|
|
|
+ seTreeArr.push(treechild[j].textContent);
|
|
|
+ }
|
|
|
}
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- params.nextItemStr = JSON.stringify(seTreeArr)
|
|
|
+ }
|
|
|
+ params.nextItemStr = JSON.stringify(seTreeArr);
|
|
|
getCompositeScreen(params).then((res) => {
|
|
|
console.log(this.chooseItemDataListByTree);
|
|
|
if (res.code === 200) {
|
|
|
// this.chooiseItemData = res.data;
|
|
|
// this.chooseItemDataListByTree.push(...res.data);
|
|
|
- let treeData = this.chooseItemDataListByTree ? this.chooseItemDataListByTree : [];
|
|
|
- if (res.data && res.data.length > 0) {
|
|
|
- let lodArr = [];
|
|
|
- for (let j = 0; j < res.data.length; j++) {
|
|
|
- lodArr.push(res.data[j].label ? res.data[j].label : res.data[j].itemName);
|
|
|
- }
|
|
|
- console.log(lodArr)
|
|
|
- let status = false;
|
|
|
- let idArr = {}
|
|
|
- for (let i = 0; i < treeData.length; i++) {
|
|
|
- if (lodArr.indexOf(treeData[i].label) !== -1) {
|
|
|
- idArr[lodArr.indexOf(treeData[i].label)] = '1'
|
|
|
- }
|
|
|
- }
|
|
|
- console.log(idArr)
|
|
|
- for (let j = 0; j < res.data.length; j++) {
|
|
|
- if (!idArr[j]) {
|
|
|
- treeData.push(res.data[j])
|
|
|
- } else {
|
|
|
- status = true;
|
|
|
- }
|
|
|
- }
|
|
|
- console.log(treeData)
|
|
|
- if (status) {
|
|
|
- this.$message({
|
|
|
- message: '请注意,选择的数据项中含有重复的项',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
- }
|
|
|
+ let treeData = this.chooseItemDataListByTree
|
|
|
+ ? this.chooseItemDataListByTree
|
|
|
+ : [];
|
|
|
+ if (res.data && res.data.length > 0) {
|
|
|
+ let lodArr = [];
|
|
|
+ for (let j = 0; j < res.data.length; j++) {
|
|
|
+ lodArr.push(
|
|
|
+ res.data[j].label ? res.data[j].label : res.data[j].itemName
|
|
|
+ );
|
|
|
}
|
|
|
-
|
|
|
+ console.log(lodArr);
|
|
|
+ let status = false;
|
|
|
+ let idArr = {};
|
|
|
+ for (let i = 0; i < treeData.length; i++) {
|
|
|
+ if (lodArr.indexOf(treeData[i].label) !== -1) {
|
|
|
+ idArr[lodArr.indexOf(treeData[i].label)] = "1";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(idArr);
|
|
|
+ for (let j = 0; j < res.data.length; j++) {
|
|
|
+ if (!idArr[j]) {
|
|
|
+ treeData.push(res.data[j]);
|
|
|
+ } else {
|
|
|
+ status = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(treeData);
|
|
|
+ if (status) {
|
|
|
+ this.$message({
|
|
|
+ message: "请注意,选择的数据项中含有重复的项",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// let chooseChannelNameList = [];
|
|
|
// // 去重
|
|
|
// let arr = JSON.parse(JSON.stringify(this.chooseItemDataListByTree));
|
|
@@ -1208,15 +1227,15 @@ export default {
|
|
|
this.leavesChooseList = [];
|
|
|
this.queryParams.needItemStr = [];
|
|
|
this.$refs.itemTree.setCheckedKeys([]);
|
|
|
- this.$refs.itemTree.setCheckedNodes([]);
|
|
|
+ this.$refs.itemTree.setCheckedNodes([]);
|
|
|
// this.$refs.chooseItemTree.setCheckedNodes([])
|
|
|
console.log(this.chooseItemDataListByTree);
|
|
|
});
|
|
|
if (!res.data || res.data.length === 0) {
|
|
|
- this.$message({
|
|
|
- message: '没有筛选出符合条件的数据项,请重新筛选',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
+ this.$message({
|
|
|
+ message: "没有筛选出符合条件的数据项,请重新筛选",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -2421,7 +2440,7 @@ export default {
|
|
|
if (arr.length == 0) {
|
|
|
arr = chooseChannelNameList;
|
|
|
} else {
|
|
|
- let status = false;
|
|
|
+ let status = false;
|
|
|
for (let i in chooseChannelNameList) {
|
|
|
let flag = false;
|
|
|
for (let j in arr) {
|
|
@@ -2429,7 +2448,7 @@ export default {
|
|
|
if (chooseChannelNameList[i].label == tName) {
|
|
|
flag = true;
|
|
|
if (!status) {
|
|
|
- status = true;
|
|
|
+ status = true;
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -2439,11 +2458,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (status) {
|
|
|
- //
|
|
|
- this.$message({
|
|
|
- message: '请注意,选择的数据项中含有重复的项',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
+ //
|
|
|
+ this.$message({
|
|
|
+ message: "请注意,选择的数据项中含有重复的项",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
this.handleCheckAllChange(false);
|
|
@@ -2603,7 +2622,7 @@ export default {
|
|
|
);
|
|
|
// this.getEventReportList(this.chooseItemDataList)
|
|
|
});
|
|
|
- this.isScreen=false
|
|
|
+ this.isScreen = false;
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
loading.close();
|
|
@@ -2874,7 +2893,7 @@ export default {
|
|
|
} else {
|
|
|
this.dataItemDialogVisible = false;
|
|
|
}
|
|
|
- this.isScreen=true
|
|
|
+ this.isScreen = true;
|
|
|
},
|
|
|
/** 弹出层关闭事件 */
|
|
|
dialogDataModelClose() {
|