houzhongjian
2024-12-04 bb203eb72ee4604be8c9272cc583ecb9e393aeb8
src/views/data/point/DaPointForm.vue
@@ -283,6 +283,38 @@
          </el-form-item>
        </el-col>
      </el-row>
      <!--累计点-->
      <el-row :gutter="20" v-if="formData.pointType === 'CUMULATE'">
        <el-col :span="24">
          <el-form-item label="瞬时测点" prop="cumulatePoint.momentPoint">
            <el-select
              v-model="formData.cumulatePoint.momentPoint"
              filterable
              placeholder="请选择">
              <el-option
                v-for="(item, index) in pointList"
                :key="index"
                :label="item.pointName"
                :value="item.pointNo"/>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="累计长度" prop="cumulatePoint.length">
            <el-input-number v-model="formData.cumulatePoint.length" style="width: 100%"
                             :min="1" :max="3000"
                             :controls="false"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="除数" prop="cumulatePoint.divisor">
            <el-input-number v-model="formData.cumulatePoint.divisor" style="width: 100%"
                             :min="1" :max="3000"
                             :controls="false"/>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
@@ -343,6 +375,13 @@
    tagNo: '',
    dimension: '',
    valueType: '',
  },
  cumulatePoint: {
    id: '',
    pointId: '',
    momentPoint: '',
    length: '',
    divisor: ''
  }
})
const formRules = reactive({
@@ -350,8 +389,11 @@
  pointType: [{required: true, message: '测点类型不能为空', trigger: 'blur'}],
  dataType: [{required: true, message: '数据类型不能为空', trigger: 'blur'}],
  minfreqid: [{required: true, message: '采集频率不能为空', trigger: 'blur'}],
  "measurePoint.valueType": [{required: true, message: '采集频率不能为空', trigger: 'blur'}],
  "measurePoint.dimension": [{required: true, message: '采集频率不能为空', trigger: 'blur'}],
  "measurePoint.valueType": [{required: true, message: '值类型不能为空', trigger: 'blur'}],
  "measurePoint.dimension": [{required: true, message: '平滑尺度不能为空', trigger: 'blur'}],
  "cumulatePoint.momentPoint": [{required: true, message: '累计测点不能为空', trigger: 'blur'}],
  "cumulatePoint.length": [{required: true, message: '累计长度不能为空', trigger: 'blur'}],
  "cumulatePoint.divisor": [{required: true, message: '除数不能为空', trigger: 'blur'}],
})
const formRef = ref() // 表单 Ref
@@ -465,6 +507,13 @@
      tagNo: '',
      dimension: '1',
      valueType: 'SIMULATE',
    },
    cumulatePoint: {
      id: '',
      pointId: '',
      momentPoint: '',
      length: 60,
      divisor: 60
    }
  }
  formRef.value?.resetFields()