From ec9159301e174288bf276b85b52639dcd90feb19 Mon Sep 17 00:00:00 2001 From: shj <1790240199@qq.com> Date: 星期六, 30 七月 2022 15:51:39 +0800 Subject: [PATCH] 对接 --- src/views/facilityManagement/InstrumentationInformation/index.vue | 45 ++++++++++++++++++++++++++------------------- 1 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/views/facilityManagement/InstrumentationInformation/index.vue b/src/views/facilityManagement/InstrumentationInformation/index.vue index d975b7a..3a8d289 100644 --- a/src/views/facilityManagement/InstrumentationInformation/index.vue +++ b/src/views/facilityManagement/InstrumentationInformation/index.vue @@ -17,9 +17,11 @@ </el-form> <el-row> <el-col :span="4"> + <el-input v-model="filterText" style="height: 30px" placeholder="请输入关键字" /> <div class="tree"> - <el-input v-model="filterText" style="height: 30px" placeholder="Filter keyword" /> - <el-tree ref="treeRef" class="filter-tree" :data="data" :props="props" :filter-node-method="filterNode" /> + + <!-- <el-tree ref="treeRef" class="filter-tree" :data="data" :props="props" :filter-node-method="filterNode" /> --> + <el-tree ref="treeRef" :data="data" :props="props" @node-click="handleNodeClick" :filter-node-method="filterNode" /> </div> </el-col> <el-col :span="20"> @@ -81,7 +83,7 @@ </el-tabs> </template> </el-table-column> - <el-table-column property="qName" label="装置设施名称" align="center" sortable/> + <el-table-column property="qName" label="装置设施名称" align="center" sortable /> <el-table-column property="positionNum" align="center" label="装置设施位号" sortable /> <el-table-column property="qUsage" align="center" label="装置设施用途" sortable /> <el-table-column property="model" label="装置设施型号" align="center" sortable show-overflow-tooltip /> @@ -89,8 +91,8 @@ <el-table-column property="setPart" label="设施部位" align="center" sortable show-overflow-tooltip /> <el-table-column label="操作" align="center" width="250"> <template #default="scope"> - <el-button link type="primary" size="default" :icon="View">查看</el-button> - <el-button link type="primary" size="default" :icon="EditPen">修改</el-button> + <el-button link type="primary" size="default" :icon="View" @click="openD('查看', scope.row.id)">查看</el-button> + <el-button link type="primary" size="default" :icon="EditPen" @click="openD('修改', scope.row.id)">修改</el-button> <el-button link type="primary" size="default" :icon="Delete" @click="onDelete(scope.row.id)">删除</el-button> </template> </el-table-column> @@ -99,9 +101,9 @@ <el-pagination v-model:currentPage="currentPage4" v-model:page-size="pageSize4" - :page-sizes="[100, 200, 300, 400]" + :page-sizes="[10, 20, 30, 40]" layout="total, sizes, prev, pager, next, jumper" - :total="400" + :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> @@ -119,7 +121,7 @@ import Dailog from '/@/components/equipmentDailog/Dailog.vue'; import { ElTree, TabsPaneContext, ElMessage, ElMessageBox } from 'element-plus'; import { facilityManagementApi } from '/@/api/facilityManagement'; -import { EditPen, Plus, Delete, Download, Refresh, Upload } from '@element-plus/icons-vue'; +import { EditPen, View, Plus, Delete, Download, Refresh, Upload } from '@element-plus/icons-vue'; interface Tree { label: string; children?: Tree[]; @@ -264,19 +266,13 @@ }; const filterText = ref(''); const treeRef = ref<InstanceType<typeof ElTree>>(); - - const props = { - value: 'id', - lable: 'typeName', - children: 'childList', - }; // 树形 const listApiTree = () => { facilityManagementApi() .getequipmentTypeMngTreeData() .then((res) => { if (res.data.code == 200) { - data.value = res.data.data; + data.value= res.data.data; } else { ElMessage({ showClose: true, @@ -286,28 +282,38 @@ } }); }; + const props = { + label: 'typeName', + children: 'childList', + value: 'id', + } watch(filterText, (val) => { treeRef.value!.filter(val); }); const filterNode = (value: string, data: Tree) => { if (!value) return true; - return data.label.includes(value); + return data.typeName.includes(value); }; - - const data = ref([]); + const handleNodeClick=(data: Tree)=>{ + ruleForm.searchParams.positionNum=data.id + listApi(); + } + const data=ref([]) onMounted(() => { listApiTree(); }); const handleClicks = (tab: TabsPaneContext, event: Event) => { console.log(tab, event); }; - const activeName=ref("first") + + const activeName = ref('first'); // const Show=ref() // const openUp=()=>{ // Show.value.openDialog() // } return { + handleNodeClick, ruleForm, resetForm, listApi, @@ -339,6 +345,7 @@ Delete, Download, Refresh, + View, Upload, }; }, -- Gitblit v1.9.2