| | |
| | | <el-input v-model="formData.code" placeholder="请输入编码" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="抓图方式"> |
| | | <el-select v-model="formData.captureType" placeholder="请选择"> |
| | | <el-option |
| | | v-for="dict in getStrDictOptions(DICT_TYPE.CAPTURE_TYPE)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as CameraApi from '@/api/data/dev/camera' |
| | | import {DICT_TYPE, getIntDictOptions, getStrDictOptions} from "@/utils/dict"; |
| | | |
| | | defineOptions({ name: 'CameraForm' }) |
| | | |
| | |
| | | id: undefined, |
| | | nvrId: '', |
| | | code: undefined, |
| | | captureType: '', |
| | | channel: undefined, |
| | | location: undefined, |
| | | remark: undefined |
| | | }) |
| | | const formRules = reactive({ |
| | | code: [{ required: true, message: '编码不能为空', trigger: 'blur' }], |
| | | captureType: [{ required: true, message: '抓图方式不能为空', trigger: 'blur' }], |
| | | channel: [{ required: true, message: '通道不能为空', trigger: 'blur' }], |
| | | location: [{ required: true, message: '监控区域不能为空', trigger: 'blur' }] |
| | | }) |
| | |
| | | const resetForm = () => { |
| | | formData.value = { |
| | | id: undefined, |
| | | brand: undefined, |
| | | nvrId: '', |
| | | code: undefined, |
| | | name: undefined, |
| | | ip: undefined, |
| | | port: undefined, |
| | | username: undefined, |
| | | password: undefined, |
| | | captureType: '', |
| | | channel: undefined, |
| | | location: undefined, |
| | | remark: undefined |
| | | } |
| | | formRef.value?.resetFields() |