|
|
@@ -36,9 +36,10 @@
|
|
|
filterable
|
|
|
allow-create
|
|
|
default-first-option
|
|
|
+ :disabled="!leftSearchForm.projectId"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in auditedUnitOptions"
|
|
|
+ v-for="item in leftAuditedUnitOptions"
|
|
|
:key="item.unitId"
|
|
|
:label="item.unitName"
|
|
|
:value="item.unitId"
|
|
|
@@ -67,13 +68,23 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
- <el-button
|
|
|
- icon="iconfont-5039297 icon-chaxun"
|
|
|
- type="primary"
|
|
|
- @click="handleLeftQuery"
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ :content="'查询条件:项目名称、监审对象都需要选择,否则无法查询'"
|
|
|
+ placement="top"
|
|
|
>
|
|
|
- 查询
|
|
|
- </el-button>
|
|
|
+ <el-button
|
|
|
+ icon="iconfont-5039297 icon-chaxun"
|
|
|
+ type="primary"
|
|
|
+ :disabled="
|
|
|
+ !leftSearchForm.projectId || !leftSearchForm.auditedUnitId
|
|
|
+ "
|
|
|
+ @click="handleLeftQuery"
|
|
|
+ >
|
|
|
+ 查询
|
|
|
+ </el-button>
|
|
|
+ </el-tooltip>
|
|
|
+
|
|
|
<el-button
|
|
|
icon="iconfont-5039297 icon-zhongzhi"
|
|
|
style="margin-left: 10px"
|
|
|
@@ -178,6 +189,7 @@
|
|
|
filterable
|
|
|
allow-create
|
|
|
default-first-option
|
|
|
+ :disabled="!rightSearchForm.projectId"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in auditedUnitOptions"
|
|
|
@@ -209,9 +221,21 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="handleRightQuery">
|
|
|
- 查询
|
|
|
- </el-button>
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ :content="'查询条件:项目名称、监审对象都需要选择,否则无法查询'"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :disabled="
|
|
|
+ !rightSearchForm.projectId || !rightSearchForm.auditedUnitId
|
|
|
+ "
|
|
|
+ @click="handleRightQuery"
|
|
|
+ >
|
|
|
+ 查询
|
|
|
+ </el-button>
|
|
|
+ </el-tooltip>
|
|
|
<el-button style="margin-left: 10px" @click="handleRightReset">
|
|
|
重置
|
|
|
</el-button>
|
|
|
@@ -227,31 +251,17 @@
|
|
|
<div class="custom-list">
|
|
|
<div class="list-header">项目</div>
|
|
|
<div class="list-content">
|
|
|
- <div v-if="rightDataItems && rightDataItems.length > 0">
|
|
|
- <div v-for="item in rightDataItems" :key="item.id">
|
|
|
- <div
|
|
|
- class="list-item level-0"
|
|
|
- :class="{ selected: isSelected(item.id, 'right') }"
|
|
|
- @click="selectItem(item.id, 'right')"
|
|
|
- >
|
|
|
- <span class="item-label">{{ item.label }}</span>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- v-if="item.children && item.children.length > 0"
|
|
|
- class="list-children"
|
|
|
- >
|
|
|
- <div
|
|
|
- v-for="child in item.children"
|
|
|
- :key="child.id"
|
|
|
- class="list-item level-1"
|
|
|
- :class="{ selected: isSelected(child.id, 'right') }"
|
|
|
- @click="selectItem(child.id, 'right')"
|
|
|
- >
|
|
|
- <span class="item-label">{{ child.label }}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <el-tree
|
|
|
+ v-if="rightDataItems && rightDataItems.length > 0"
|
|
|
+ ref="rightIndicatorTree"
|
|
|
+ class="indicator-tree"
|
|
|
+ :data="rightDataItems"
|
|
|
+ show-checkbox
|
|
|
+ node-key="id"
|
|
|
+ :props="treeProps"
|
|
|
+ :check-strictly="true"
|
|
|
+ @check="handleRightCheck"
|
|
|
+ ></el-tree>
|
|
|
<Empty v-else description="暂无数据"></Empty>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -307,6 +317,7 @@
|
|
|
startYear: '',
|
|
|
endYear: '',
|
|
|
},
|
|
|
+ leftAuditedUnitOptions: [],
|
|
|
// 右侧搜索表单数据
|
|
|
rightSearchForm: {
|
|
|
projectName: '',
|
|
|
@@ -316,9 +327,9 @@
|
|
|
startYear: '',
|
|
|
endYear: '',
|
|
|
},
|
|
|
- // 左侧数据项树形结构(从mock数据构建)
|
|
|
+ // 左侧数据项树形结构
|
|
|
leftDataItems: [],
|
|
|
- // 右侧数据项树形结构(从mock数据构建)
|
|
|
+ // 右侧数据项树形结构
|
|
|
rightDataItems: [],
|
|
|
// 左侧数据源
|
|
|
leftDataSource: null,
|
|
|
@@ -922,6 +933,16 @@
|
|
|
this.updateLeftChartsBySelection()
|
|
|
},
|
|
|
|
|
|
+ // 右侧树选中变更
|
|
|
+ handleRightCheck() {
|
|
|
+ const checkedKeys =
|
|
|
+ this.$refs.rightIndicatorTree?.getCheckedKeys?.() || []
|
|
|
+ this.rightSelectedItems = checkedKeys
|
|
|
+ .map((id) => this.findItemById(id, 'right'))
|
|
|
+ .filter(Boolean)
|
|
|
+ this.updateRightChartsBySelection()
|
|
|
+ },
|
|
|
+
|
|
|
// 判断节点是否被选中
|
|
|
isSelected(id, type = 'left') {
|
|
|
const selectedItems =
|
|
|
@@ -1184,6 +1205,12 @@
|
|
|
this.auditedUnitOptions.find(
|
|
|
(item) => item.unitId === unitIdArray[0]
|
|
|
)?.unitName || ''
|
|
|
+ } else if (unitIdArray.length > 1) {
|
|
|
+ this.auditedUnitOptions.forEach((item) => {
|
|
|
+ if (unitIdArray.includes(item.unitId)) {
|
|
|
+ this.leftAuditedUnitOptions.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1437,20 +1464,20 @@
|
|
|
// 重置左侧搜索表单
|
|
|
this.leftSearchForm = {
|
|
|
projectName: '',
|
|
|
+ projectId: '',
|
|
|
+ auditedUnitName: '',
|
|
|
auditedUnitId: '',
|
|
|
- startYear: '2024',
|
|
|
- endYear: '2025',
|
|
|
- }
|
|
|
- // 重置左侧树形选择
|
|
|
- if (this.$refs.leftIndicatorTree) {
|
|
|
- this.$refs.leftIndicatorTree.clearChecked()
|
|
|
+ startYear: '',
|
|
|
+ endYear: '',
|
|
|
}
|
|
|
- // 重置后默认选中(与 history 页一致)
|
|
|
- this.setLeftDefaultSelection()
|
|
|
- // 重置左侧图表
|
|
|
+ this.leftSelectedItems = []
|
|
|
+ this.leftDataItems = []
|
|
|
+ this.leftDataSource = []
|
|
|
+ this.leftTrendData = {}
|
|
|
+ this.leftProportionData = []
|
|
|
+ this.leftProportionAllData = []
|
|
|
+ this.leftProportionTotalPages = 0
|
|
|
this.leftProportionCurrentPage = 1
|
|
|
- this.updateLeftTrendChart()
|
|
|
- this.updateLeftProportionChart()
|
|
|
},
|
|
|
|
|
|
// 左侧默认选中:优先根节点(parentId 为 -1),否则第一个叶子
|
|
|
@@ -1485,28 +1512,20 @@
|
|
|
// 重置右侧搜索表单
|
|
|
this.rightSearchForm = {
|
|
|
projectName: '',
|
|
|
+ projectId: '',
|
|
|
+ auditedUnitName: '',
|
|
|
auditedUnitId: '',
|
|
|
- startYear: '2024',
|
|
|
- endYear: '2025',
|
|
|
- }
|
|
|
- // 重置右侧树形选择
|
|
|
- if (this.$refs.rightDataTree) {
|
|
|
- this.$refs.rightDataTree.clearChecked()
|
|
|
- }
|
|
|
- // 重置后默认选中第一个父级节点(单选)
|
|
|
- if (this.rightDataItems && this.rightDataItems.length > 0) {
|
|
|
- const { items: parentItems } = this.getParentIds(this.rightDataItems)
|
|
|
- const defaultItem =
|
|
|
- parentItems.length > 0 ? parentItems[0] : this.rightDataItems[0]
|
|
|
- this.rightSelectedItems = defaultItem ? [defaultItem] : []
|
|
|
- } else {
|
|
|
- // 如果没有数据,清空选中项
|
|
|
- this.rightSelectedItems = []
|
|
|
+ startYear: '',
|
|
|
+ endYear: '',
|
|
|
}
|
|
|
- // 重置右侧图表
|
|
|
+ this.rightSelectedItems = []
|
|
|
+ this.rightDataSource = []
|
|
|
+ this.rightDataItems = []
|
|
|
+ this.rightTrendData = {}
|
|
|
+ this.rightProportionData = {}
|
|
|
+ this.rightProportionAllData = []
|
|
|
+ this.rightProportionTotalPages = 0
|
|
|
this.rightProportionCurrentPage = 1
|
|
|
- this.updateRightTrendChart()
|
|
|
- this.updateRightProportionChart()
|
|
|
},
|
|
|
},
|
|
|
}
|
|
|
@@ -1705,7 +1724,6 @@
|
|
|
.custom-list {
|
|
|
border-radius: 4px;
|
|
|
overflow: hidden;
|
|
|
- border: 1px solid #e0e0e0;
|
|
|
height: 800px;
|
|
|
max-height: 800px;
|
|
|
overflow-x: hidden;
|