| | |
| | | import waterFacilityParameter from "@/api/facility/parameter.js"; |
| | | import setPostParams from "@/utils/searchParams.js"; |
| | | import {onMounted} from "vue"; |
| | | |
| | | const route = useRoute(); |
| | | const {proxy} = getCurrentInstance(); |
| | | const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL //图片前缀 |
| | |
| | | */ |
| | | /** 搜索按钮操作 */ |
| | | function handleQuery() { |
| | | getList({keywords: searchParams.value.facilityCode}) |
| | | getList(searchParams.value) |
| | | } |
| | | |
| | | /** 重置按钮操作 */ |
| | |
| | | }); |
| | | //查询监控点 |
| | | const pointList = ref(); |
| | | const cascaderOption = { label: 'pointName', value: 'id', children: 'childrenList', checkStrictly: true, expandTrigger: 'hover', emitPath: false }; //级联选择器配置 |
| | | const cascaderOption = { |
| | | label: 'pointName', |
| | | value: 'id', |
| | | children: 'childrenList', |
| | | checkStrictly: true, |
| | | expandTrigger: 'hover', |
| | | emitPath: false |
| | | }; //级联选择器配置 |
| | | const getPoint = async () => { |
| | | await pointApi().getParentPoint().then((res) => { |
| | | pointList.value = res.data |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** 新增按钮操作 */ |
| | | async function handleAdd() { |
| | | reset(); |
| | |
| | | } |
| | | //上传文件,添加图片地址信息 |
| | | const uploadData = (data) => { |
| | | form.value.facilityUrl = imgBaseUrl + data.toString(); |
| | | form.value.facilityUrl = data.toString(); |
| | | } |
| | | |
| | | /** 提交按钮 */ |
| | |
| | | openParamForm.value = false; |
| | | reset(); |
| | | } |
| | | |
| | | /** 绑定按钮操作 */ |
| | | const handleband = async(row) =>{ |
| | | facilityData.value.facilityId = row.id |
| | |
| | | getSelectParamList(row.id) |
| | | openParamForm.value = true |
| | | } |
| | | |
| | | /** 表单重置 */ |
| | | function reset() { |
| | | form.value = { |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="searchParams" ref="queryRef" :inline="true"> |
| | | <el-form-item label="" prop=""> |
| | | <el-form-item label="" prop="keywords"> |
| | | <el-input |
| | | v-model="searchParams.facilityCode" |
| | | v-model="searchParams.keywords" |
| | | placeholder="请输入搜索信息" |
| | | clearable |
| | | style="width: 200px" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="选择监控点" prop="pointId"> |
| | | <el-cascader v-model="form.pointId" :options="pointList" :show-all-levels="false" :props="cascaderOption" /> |
| | | <el-cascader v-model="form.pointId" :options="pointList" :show-all-levels="false" |
| | | :props="cascaderOption"/> |
| | | </el-form-item> |
| | | <el-form-item label="安装日期" prop="installDate"> |
| | | <el-date-picker |
| | |
| | | max-width: 100px; |
| | | height: 50px; |
| | | } |
| | | |
| | | .form-box{ |
| | | justify-content: normal; |
| | | |
| | | :deep(.el-cascader){ |
| | | flex-grow: 1; |
| | | } |