|
|
|
@ -13,6 +13,9 @@
|
|
|
|
<template #search>
|
|
|
|
<template #search>
|
|
|
|
<div style="display: flex">
|
|
|
|
<div style="display: flex">
|
|
|
|
<el-date-picker v-model="weekSelect" format="yyyy 第 WW 周" type="week" size="small" style="width: 150px;"></el-date-picker>
|
|
|
|
<el-date-picker v-model="weekSelect" format="yyyy 第 WW 周" type="week" size="small" style="width: 150px;"></el-date-picker>
|
|
|
|
|
|
|
|
<Select clearable v-model="selectArea" placeholder="请选择范围" style="width: 140px;margin-left: 6px;">
|
|
|
|
|
|
|
|
<Option v-for="item in Array.from(areas)" :value="item[0]">{{ item[1] }}</Option>
|
|
|
|
|
|
|
|
</Select>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
style="margin-left: 10px"
|
|
|
|
style="margin-left: 10px"
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
@ -26,6 +29,18 @@
|
|
|
|
</LxHeader>
|
|
|
|
</LxHeader>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10">
|
|
|
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
|
|
|
<el-tree :data="equipments"
|
|
|
|
|
|
|
|
node-key="id"
|
|
|
|
|
|
|
|
:style="{ 'max-height': (tableHeight || 630) + 'px', 'overflow': 'scroll' }"
|
|
|
|
|
|
|
|
ref="elTree"
|
|
|
|
|
|
|
|
:props="{ children: 'children', label: 'name' }"
|
|
|
|
|
|
|
|
show-checkbox
|
|
|
|
|
|
|
|
@check="handleCheckChange">
|
|
|
|
|
|
|
|
</el-tree>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="20">
|
|
|
|
<el-table :data="tableData" :span-method="objectSpanMethod" style="width: 100%" stripe :height="tableHeight">
|
|
|
|
<el-table :data="tableData" :span-method="objectSpanMethod" style="width: 100%" stripe :height="tableHeight">
|
|
|
|
<el-table-column type="index" label="序号" width="50" header-align="center" align="center" fixed="left">
|
|
|
|
<el-table-column type="index" label="序号" width="50" header-align="center" align="center" fixed="left">
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
@ -44,16 +59,16 @@
|
|
|
|
<span>河道处</span>
|
|
|
|
<span>河道处</span>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<!-- <el-table-column prop="gate" label="闸门(孔×米)" header-align="center" width="150" fixed="left">-->
|
|
|
|
<!-- <el-table-column prop="gate" label="闸门(孔×米)" header-align="center" width="150" fixed="left">-->
|
|
|
|
<!-- <template>-->
|
|
|
|
<!-- <template>-->
|
|
|
|
<!-- <span>14m</span>-->
|
|
|
|
<!-- <span>14m</span>-->
|
|
|
|
<!-- </template>-->
|
|
|
|
<!-- </template>-->
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
<!-- <el-table-column prop="gm" label="泵站规模(台×m3/s)" header-align="center" width="150" fixed="left">-->
|
|
|
|
<!-- <el-table-column prop="gm" label="泵站规模(台×m3/s)" header-align="center" width="150" fixed="left">-->
|
|
|
|
<!-- <template>-->
|
|
|
|
<!-- <template>-->
|
|
|
|
<!-- <span>3×5m3/s</span>-->
|
|
|
|
<!-- <span>3×5m3/s</span>-->
|
|
|
|
<!-- </template>-->
|
|
|
|
<!-- </template>-->
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
<el-table-column :label="weekRange[i]" header-align="center" v-for="i in 6">
|
|
|
|
<el-table-column :label="weekRange[i]" header-align="center" v-for="i in 6">
|
|
|
|
<el-table-column prop="x1" :label="weekName[i]" min-width="220" header-align="center">
|
|
|
|
<el-table-column prop="x1" :label="weekName[i]" min-width="220" header-align="center">
|
|
|
|
<template #default="{ row }">
|
|
|
|
<template #default="{ row }">
|
|
|
|
@ -68,6 +83,8 @@
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
@ -88,17 +105,46 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
selectArea: "",
|
|
|
|
weekSelect: new Date(),
|
|
|
|
weekSelect: new Date(),
|
|
|
|
tableHeight: '600px',
|
|
|
|
tableHeight: '600px',
|
|
|
|
abilities: new Map(),
|
|
|
|
abilities: new Map(),
|
|
|
|
areas: new Map(),
|
|
|
|
areas: new Map(),
|
|
|
|
|
|
|
|
equipments: [],
|
|
|
|
tableData: [],
|
|
|
|
tableData: [],
|
|
|
|
list: [],
|
|
|
|
list: [],
|
|
|
|
|
|
|
|
equipmentIds: [],
|
|
|
|
weekRange: [],
|
|
|
|
weekRange: [],
|
|
|
|
weekName: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六']
|
|
|
|
weekName: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
handleCheckChange (data, checked, indeterminate) {
|
|
|
|
|
|
|
|
this.treeValue = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.name).toString()
|
|
|
|
|
|
|
|
this.equipmentIds = this.$refs['elTree'].getCheckedNodes(true)?.filter(i => !i.children)?.map(i => i.id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getData()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async getEquipments () {
|
|
|
|
|
|
|
|
const res = (await index({
|
|
|
|
|
|
|
|
table_name: 'equipments',
|
|
|
|
|
|
|
|
page: 1,
|
|
|
|
|
|
|
|
page_size: 9999
|
|
|
|
|
|
|
|
},false))?.data || []
|
|
|
|
|
|
|
|
this.equipments = Array.from(this.areas).map(i => ({
|
|
|
|
|
|
|
|
id: `area_${i[0]}`,
|
|
|
|
|
|
|
|
name: i[1],
|
|
|
|
|
|
|
|
children: res.filter(j => j.area === i[0])
|
|
|
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
Array.from(this.areas).forEach(i => {
|
|
|
|
|
|
|
|
this.$refs['elTree'].setChecked(`area_${i[0]}`, true, true)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
async getArea() {
|
|
|
|
async getArea() {
|
|
|
|
const obj = (await show({ id: 4 }, false))?.select_item;
|
|
|
|
const obj = (await show({ id: 4 }, false))?.select_item;
|
|
|
|
if (obj && typeof obj === "object") {
|
|
|
|
if (obj && typeof obj === "object") {
|
|
|
|
@ -108,7 +154,7 @@
|
|
|
|
this.areas = new Map(keys.map((key) => [/^\d*$/.test(obj[key]) ? Number(obj[key]) : obj[key],key]));
|
|
|
|
this.areas = new Map(keys.map((key) => [/^\d*$/.test(obj[key]) ? Number(obj[key]) : obj[key],key]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
await this.getEquipments();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async getAbility() {
|
|
|
|
async getAbility() {
|
|
|
|
const obj = (await show({ id: 31 }, false))?.select_item;
|
|
|
|
const obj = (await show({ id: 31 }, false))?.select_item;
|
|
|
|
@ -140,6 +186,11 @@
|
|
|
|
key: "act_start_time",
|
|
|
|
key: "act_start_time",
|
|
|
|
op: "range",
|
|
|
|
op: "range",
|
|
|
|
value: `${this.weekRange.at(0)},${this.weekRange.at(-1)}`
|
|
|
|
value: `${this.weekRange.at(0)},${this.weekRange.at(-1)}`
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "equipment_id",
|
|
|
|
|
|
|
|
op: "in",
|
|
|
|
|
|
|
|
value: this.equipmentIds
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@ -175,7 +226,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.tableData = mergeTableRow({
|
|
|
|
this.tableData = mergeTableRow({
|
|
|
|
data: sortData(res.data),
|
|
|
|
data: this.selectArea ? sortData(res.data).filter(i => (i.equipment?.area === this.selectArea)) : sortData(res.data),
|
|
|
|
mergeColNames: ["equipment_id","equipment.area","equipment.name"], // 需要合并的列,默认合并列相同的数据
|
|
|
|
mergeColNames: ["equipment_id","equipment.area","equipment.name"], // 需要合并的列,默认合并列相同的数据
|
|
|
|
firstMergeColNames: ["equipment_id"], // 受影响的列,只合并以firstMerge为首的同类型数据
|
|
|
|
firstMergeColNames: ["equipment_id"], // 受影响的列,只合并以firstMerge为首的同类型数据
|
|
|
|
firstMerge: "equipment_id", // 以哪列为基础进行合并,一般为第一列
|
|
|
|
firstMerge: "equipment_id", // 以哪列为基础进行合并,一般为第一列
|
|
|
|
|