| | |
| | | loading.value = true; |
| | | let postParam = setPostParams(val) |
| | | await pointApi().search({...postParam, ...searchParams.value}).then((res) => { |
| | | monityList.value = res.data.list; |
| | | tableData.value = res.data.list |
| | | pageParam.value.total = res.data.total |
| | | pageParam.value.limit = res.data.limit |
| | |
| | | // 监控点列表 |
| | | const monityList = ref([]); |
| | | // 监控点类型 |
| | | const monityTypeList = ref([]); |
| | | const monityTypeList = [ |
| | | {id: 1, name: '水温监测点'}, |
| | | {id: 2, name: '生态流量监测点'} |
| | | ]; |
| | | const cascaderOption = { label: 'pointName', value: 'id', children: 'childrenList', checkStrictly: true, expandTrigger: 'hover', emitPath: false }; //级联选择器配置 |
| | | |
| | | /** 新增按钮操作 */ |
| | | async function handleAdd() { |
| | |
| | | } |
| | | |
| | | |
| | | // 获取监控点类型 |
| | | const getMonitryType = () => { |
| | | monityTypeList.value = [ |
| | | {id: 1, name: '水温监测点'}, |
| | | {id: 2, name: '生态流量监测点'} |
| | | ] |
| | | // 获取监控点列表 |
| | | const getMonitryList = () => { |
| | | pointApi().getParentPoint().then(res => { |
| | | monityList.value = res.data; |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getMonitryType(); |
| | | getList(); |
| | | getMonitryList(); |
| | | }) |
| | | </script> |
| | | <template> |
| | |
| | | <el-dialog :title="title" v-model="open" append-to-body center> |
| | | <el-form class="form-box" ref="formRef" :model="form" :rules="rules" label-width='auto'> |
| | | <el-form-item :label="formLabel.parentId" prop="parentId"> |
| | | <el-select v-model="form.parentId" :placeholder="'请输入'+formLabel.parentId"> |
| | | <el-option |
| | | v-for="(item,index) in monityList" |
| | | :label="item.pointName" |
| | | :value="item.id" |
| | | :key="index" |
| | | ></el-option> |
| | | </el-select> |
| | | <el-cascader v-model="form.parentId" :options="monityList" :show-all-levels="false" :props="cascaderOption" /> |
| | | </el-form-item> |
| | | <el-form-item :label="formLabel.pointType" prop="pointType"> |
| | | <el-select v-model="form.pointType" :placeholder="'请输入'+formLabel.pointType"> |
| | |
| | | <style lang="scss" scoped> |
| | | .form-box { |
| | | justify-content: normal; |
| | | :deep(.el-cascader){ |
| | | flex-grow: 1; |
| | | } |
| | | } |
| | | </style> |