| | |
| | | <span v-show="scope.row['monitorType'] === 'video'">视频</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="超时天数" align="center" prop="timeout"/> |
| | | <el-table-column label="工单阈值" align="center" prop="indicator"> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in JSON.parse(scope.row.indicator)" :key="item" style="display: flex;flex-direction: row"> |
| | |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['ycl:threshold:edit']" |
| | | @click="updateWho(scope.row)" |
| | | >修改 |
| | | </el-button> |
| | | <!-- <el-button--> |
| | |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- 添加或修改运维阈值对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="400px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="150px"> |
| | | <!-- 人脸阈值 --> |
| | | <el-dialog title="修改人脸工单阈值" :visible.sync="faceOpen" width="400px" append-to-body> |
| | | <el-form ref="faceForm" :model="faceForm" :rules="rules" label-width="150px"> |
| | | <el-form-item label="设备类型" prop="monitorType"> |
| | | <el-select v-model="form.monitorType" placeholder="请选择设备类型" @change="handleModeNameChange"> |
| | | <el-select v-model="faceForm.monitorType" placeholder="请选择设备类型" @change="handleModeNameChange"> |
| | | <el-option label="人脸" value="face"/> |
| | | <el-option label="车辆" value="car"/> |
| | | <el-option label="视频" value="video"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="超时天数" prop="timeout" label-width="150px"> |
| | | <el-input type="number" min="0" max="1000" v-model="form.timeout" placeholder="请输入超时天数"/> |
| | | </el-form-item> |
| | | <el-form-item :label="indicator.label" prop="indexOneValue" v-for="indicator in indicators" label-width="150px"> |
| | | <el-input class="el-input-half-width" v-model="indicator.value" placeholder="工单阈值"/> |
| | | <el-input style="float: right;" class="el-input-half-width" v-model="indicator.value2" placeholder="下发阈值"/> |
| | | |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="editFace">确 定</el-button> |
| | | <el-button @click="cancelFace">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- 车辆阈值 --> |
| | | <el-dialog title="修改车辆工单阈值" :visible.sync="faceOpen" width="400px" append-to-body> |
| | | <el-form ref="faceForm" :model="faceForm" :rules="rules" label-width="150px"> |
| | | <el-form-item label="设备类型" prop="monitorType"> |
| | | <el-select v-model="faceForm.monitorType" placeholder="请选择设备类型" @change="handleModeNameChange"> |
| | | <el-option label="人脸" value="face"/> |
| | | <el-option label="车辆" value="car"/> |
| | | <el-option label="视频" value="video"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | <el-button type="primary" @click="editCar">确 定</el-button> |
| | | <el-button @click="cancelCar">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- 视频阈值 --> |
| | | <el-dialog title="修改视频工单阈值" :visible.sync="videoOpen" width="500px" append-to-body> |
| | | <el-form ref="videoForm" :model="videoForm" :rules="rules" label-width="100px"> |
| | | <el-form-item label="设备类型" prop="monitorType"> |
| | | <el-select v-model="videoForm.monitorType" disabled placeholder="请选择设备类型" @change="handleModeNameChange"> |
| | | <el-option label="人脸" value="face"/> |
| | | <el-option label="车辆" value="car"/> |
| | | <el-option label="视频" value="video"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="图像质量" prop="imageQuality" label-width="100px"> |
| | | <el-select v-model="videoForm.imageQuality" placeholder="工单阈值" @change="handleModeNameChange"> |
| | | <el-option :key="dict.value" :label="dict.value" v-for="dict in dict.type.image_qualify"/> |
| | | </el-select> |
| | | <el-select v-model="videoForm.imageQualityAuto" placeholder="下发阈值" @change="handleModeNameChange"> |
| | | <el-option :key="dict.value" :label="dict.value" v-for="dict in dict.type.image_qualify"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="视频质量" prop="videoQuality" label-width="100px"> |
| | | <el-select v-model="videoForm.videoQuality" placeholder="工单阈值" @change="handleModeNameChange"> |
| | | <el-option :key="dict.value" :label="dict.value" v-for="dict in dict.type.video_qualify"/> |
| | | </el-select> |
| | | <el-select v-model="videoForm.videoQualityAuto" placeholder="下发阈值" @change="handleModeNameChange"> |
| | | <el-option :key="dict.value" :label="dict.value" v-for="dict in dict.type.video_qualify"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="标注准确率" prop="annotationAccuracy" label-width="100px"> |
| | | <el-input v-model="videoForm.annotationAccuracy" type="number" size="small" placeholder="工单阈值"></el-input> |
| | | <el-input v-model="videoForm.annotationAccuracy" type="number" size="small" placeholder="下发阈值"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="editVideo">确 定</el-button> |
| | | <el-button @click="cancelVideo">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listThreshold, getThreshold, delThreshold, addThreshold, updateThreshold } from '@/api/platform/threshold' |
| | | import { listThreshold, getThreshold, editVideo } from '@/api/platform/threshold' |
| | | import { editCar, editFace, getCar, getFace, getVideo } from '../../../api/platform/threshold' |
| | | |
| | | export default { |
| | | dicts: ['image_qualify', 'video_qualify'], |
| | | name: 'Threshold', |
| | | data() { |
| | | return { |
| | |
| | | // 弹出层标题 |
| | | title: '', |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | videoOpen: false, |
| | | faceOpen: false, |
| | | // 查询参数 |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | monitorType: null |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | | videoForm: {}, |
| | | carForm: {}, |
| | | faceForm: {}, |
| | | // 表单校验 |
| | | rules: { |
| | | monitorType: [ |
| | | { required: true, message: '设备类型:1人脸 2车辆 3视频不能为空', trigger: 'change' } |
| | | ], |
| | | timeout: [ |
| | | { required: true, message: '超时天数不能为空', trigger: 'blur' } |
| | | ] |
| | | videoQuality: [ |
| | | { required: true, message: '请选择视频质量阈值', trigger: 'change' } |
| | | ], |
| | | imageQuality: [ |
| | | { required: true, message: '请选择图像质量阈值', trigger: 'change' } |
| | | ], |
| | | annotationAccuracy: [ |
| | | { required: true, message: '请填写标注准确率阈值', trigger: 'blur' } |
| | | ], |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.getList() |
| | | }, |
| | | methods: { |
| | | editVideo() { |
| | | this.$refs['videoForm'].validate(validate => { |
| | | if (validate) { |
| | | editVideo(this.videoForm).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("修改成功") |
| | | this.getList(); |
| | | } else { |
| | | this.$message.success("修改失败") |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | editFace() { |
| | | this.$refs['faceForm'].validate(validate => { |
| | | if (validate) { |
| | | editFace(this.videoForm).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("修改成功") |
| | | this.getList(); |
| | | } else { |
| | | this.$message.success("修改失败") |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | editCar() { |
| | | this.$refs['carForm'].validate(validate => { |
| | | if (validate) { |
| | | editCar(this.carForm).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("修改成功") |
| | | this.getList(); |
| | | } else { |
| | | this.$message.success("修改失败") |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | /** 查询运维阈值列表 */ |
| | | getList() { |
| | | this.loading = true |
| | |
| | | }) |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false |
| | | this.reset() |
| | | cancelFace() { |
| | | this.faceOpen = false |
| | | this.resetFace() |
| | | }, |
| | | cancelCar() { |
| | | this.carOpen = false |
| | | this.resetCar() |
| | | }, |
| | | cancelVideo() { |
| | | this.videoOpen = false |
| | | this.resetVideo() |
| | | }, |
| | | // 表单重置 |
| | | reset() { |
| | |
| | | deleted: null |
| | | } |
| | | this.resetForm('form') |
| | | }, |
| | | resetVideo() { |
| | | this.videoForm = { |
| | | id: null, |
| | | monitorType: "", |
| | | imageQuality: "", |
| | | imageQualityAuto: "", |
| | | videoQuality: "", |
| | | videoQualityAuto: "", |
| | | annotationAccuracy: null, |
| | | annotationAccuracyAuto: null, |
| | | } |
| | | this.resetForm('videoForm') |
| | | }, |
| | | resetFace() { |
| | | this.faceForm = { |
| | | id: null, |
| | | monitorType: "", |
| | | imageQuality: "", |
| | | imageQualityAuto: "", |
| | | videoQuality: "", |
| | | videoQualityAuto: "", |
| | | annotationAccuracy: null, |
| | | annotationAccuracyAuto: null, |
| | | } |
| | | this.resetForm('faceForm') |
| | | }, |
| | | resetCar() { |
| | | this.carForm = { |
| | | id: null, |
| | | monitorType: "", |
| | | imageQuality: "", |
| | | imageQualityAuto: "", |
| | | videoQuality: "", |
| | | videoQualityAuto: "", |
| | | annotationAccuracy: null, |
| | | annotationAccuracyAuto: null, |
| | | } |
| | | this.resetForm('carForm') |
| | | }, |
| | | /** 搜索按钮操作 */ |
| | | handleQuery() { |
| | |
| | | this.handleModeNameChange() |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | updateWho(row) { |
| | | if (row.monitorType === 'face') { |
| | | getFace(id).then(response => { |
| | | this.faceForm = response.data |
| | | this.faceOpen = true; |
| | | }) |
| | | } else if (row.monitorType === 'car') { |
| | | getCar(id).then(response => { |
| | | this.carForm = response.data |
| | | this.carOpen = true; |
| | | }) |
| | | } else { |
| | | getVideo(id).then(response => { |
| | | this.videoForm = response.data |
| | | this.videoOpen = true; |
| | | }) |
| | | } |
| | | }, |
| | | handleUpdate(row) { |
| | | this.reset() |
| | | const id = row.id || this.ids |
| | | getThreshold(id).then(response => { |
| | | this.form = response.data |
| | | this.indicators = JSON.parse(this.form.indicator) |
| | | this.open = true |
| | | this.videoOpen = true |
| | | this.title = '修改运维阈值' |
| | | }) |
| | | }, |