|
@@ -1,31 +1,28 @@
|
|
|
<template>
|
|
|
<!-- 测点操作表单 -->
|
|
|
- <div>
|
|
|
- <BasicForm
|
|
|
- :model="site"
|
|
|
- :schemas="schemas"
|
|
|
- :label-col="{ span: 8 }"
|
|
|
- :wrapper-col="{ span: 16 }"
|
|
|
- label-align="right"
|
|
|
- :showActionButtonGroup="false"
|
|
|
- @register="register"
|
|
|
- >
|
|
|
- <template #create-btn>
|
|
|
- <Button type="primary" :rounded="true" @click="createSite">新建测点</Button>
|
|
|
- </template>
|
|
|
- <template #copy-btn>
|
|
|
+ <BasicForm
|
|
|
+ :model="site"
|
|
|
+ :schemas="schemas"
|
|
|
+ :label-col="{ span: 9 }"
|
|
|
+ :wrapper-col="{ span: 15 }"
|
|
|
+ :showActionButtonGroup="false"
|
|
|
+ size="small"
|
|
|
+ label-align="right"
|
|
|
+ @register="register"
|
|
|
+ >
|
|
|
+ <template #create-btn>
|
|
|
+ <Button type="primary" :rounded="true" @click="createSite">新建测点</Button>
|
|
|
+ </template>
|
|
|
+ <template #edit-btn>
|
|
|
+ <Button type="primary" :rounded="true" @click="editSite">编辑测点</Button>
|
|
|
+ </template>
|
|
|
+ <!-- <template #copy-btn>
|
|
|
<Button type="primary" :rounded="true" @click="copySite">复制测点</Button>
|
|
|
- </template>
|
|
|
- <template #edit-btn>
|
|
|
- <Button type="primary" :rounded="true" @click="editSite">编辑测点</Button>
|
|
|
- </template>
|
|
|
- </BasicForm>
|
|
|
- <Button type="primary" shape="circle" @click="targetSite">
|
|
|
- <template #icon>
|
|
|
- <Icon icon="mdi:target" />
|
|
|
- </template>
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
+ </template> -->
|
|
|
+ <template #pick-btn>
|
|
|
+ <Button type="primary" :rounded="true" @click="pickSite">拾取坐标</Button>
|
|
|
+ </template>
|
|
|
+ </BasicForm>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
import {
|
|
@@ -37,13 +34,12 @@
|
|
|
import { BasicForm, FormSchema, useForm } from '@/components/Form/index';
|
|
|
import { Button } from 'ant-design-vue';
|
|
|
import { SensorDict, SystemSourceDict } from '../const';
|
|
|
- import Icon from '@/components/Icon/Icon.vue';
|
|
|
|
|
|
// props & emits
|
|
|
- defineProps<{ site?: MonitorSiteTreeNode }>();
|
|
|
+ defineProps<{ site: Partial<MonitorSiteTreeNode> }>();
|
|
|
const emit = defineEmits<{
|
|
|
save: [value: SaveMonitorSiteParams];
|
|
|
- message: [value: MonitorSiteOperationParams];
|
|
|
+ operation: [value: MonitorSiteOperationParams];
|
|
|
}>();
|
|
|
|
|
|
// 生成输入类表单项的帮助函数
|
|
@@ -132,13 +128,14 @@
|
|
|
generateInputSchema({ field: 'sensorStatus', label: '测点使用状态', required: true }),
|
|
|
generateInputSchema({ field: 'pos', label: '所属位置', required: true }),
|
|
|
generateInputSchema({ field: 'x', label: 'X', required: true, span: 3 }),
|
|
|
- generateButtonSchema({ slot: 'copy-btn' }),
|
|
|
+ generateButtonSchema({ slot: 'edit-btn' }),
|
|
|
generateSelectSchema({ field: 'srouce', label: '系统来源', dict: SystemSourceDict }),
|
|
|
generateInputSchema({ field: 'data_type', label: '数据类型', required: true }),
|
|
|
generateInputSchema({ field: 'nuit', label: '单位', required: true }),
|
|
|
generateInputSchema({ field: 'distance', label: '巷道距离' }),
|
|
|
generateInputSchema({ field: 'y', label: 'Y', required: true, span: 3 }),
|
|
|
- generateButtonSchema({ slot: 'edit-btn' }),
|
|
|
+ // generateButtonSchema({ slot: 'copy-btn' }),
|
|
|
+ generateButtonSchema({ slot: 'pick-btn' }),
|
|
|
generateInputSchema({ field: 'max_messure', label: '高量程' }),
|
|
|
generateInputSchema({ field: 'min_messure', label: '低量程' }),
|
|
|
generateInputSchema({ field: 'warn_limit', label: '报警上限', required: true }),
|
|
@@ -157,11 +154,11 @@
|
|
|
}
|
|
|
|
|
|
// 提交复制测点所需的数据
|
|
|
- function copySite() {
|
|
|
- validate().then((v) => {
|
|
|
- emit('save', v as SaveMonitorSiteParams);
|
|
|
- });
|
|
|
- }
|
|
|
+ // function copySite() {
|
|
|
+ // validate().then((v) => {
|
|
|
+ // emit('save', v as SaveMonitorSiteParams);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
// 提交编辑测点所需的数据
|
|
|
function editSite() {
|
|
@@ -170,9 +167,9 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- // 定位测点
|
|
|
- function targetSite() {
|
|
|
- emit('message', {
|
|
|
+ // 拾取测点
|
|
|
+ function pickSite() {
|
|
|
+ emit('operation', {
|
|
|
clickType: 'pickPiont', // 拾取坐标
|
|
|
from: 'tank',
|
|
|
});
|