From ff15c290e6cf81e13519a22f414690017ba86d04 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 18 四月 2024 13:45:35 +0800
Subject: [PATCH] 工单阈值调整
---
src/views/system/threshold/index.vue | 214 ++++++++++++++++++++++++++++++++++++++----
src/api/platform/threshold.js | 55 +++++++++-
2 files changed, 239 insertions(+), 30 deletions(-)
diff --git a/src/api/platform/threshold.js b/src/api/platform/threshold.js
index f11bf24..89086fa 100644
--- a/src/api/platform/threshold.js
+++ b/src/api/platform/threshold.js
@@ -3,16 +3,32 @@
// 鏌ヨ杩愮淮闃堝�煎垪琛�
export function listThreshold(query) {
return request({
- url: '/ycl/threshold/list',
+ url: '/threshold/list',
method: 'get',
params: query
})
}
// 鏌ヨ杩愮淮闃堝�艰缁�
-export function getThreshold(id) {
+export function getVideo(id) {
return request({
- url: '/ycl/threshold/' + id,
+ url: '/threshold/video' + id,
+ method: 'get'
+ })
+}
+
+// 鏌ヨ杩愮淮闃堝�艰缁�
+export function getCar(id) {
+ return request({
+ url: '/threshold/car' + id,
+ method: 'get'
+ })
+}
+
+// 鏌ヨ杩愮淮闃堝�艰缁�
+export function getFace(id) {
+ return request({
+ url: '/threshold/face' + id,
method: 'get'
})
}
@@ -20,7 +36,7 @@
// 鏂板杩愮淮闃堝��
export function addThreshold(data) {
return request({
- url: '/ycl/threshold',
+ url: '/threshold',
method: 'post',
data: data
})
@@ -29,7 +45,7 @@
// 淇敼杩愮淮闃堝��
export function updateThreshold(data) {
return request({
- url: '/ycl/threshold',
+ url: '/threshold',
method: 'put',
data: data
})
@@ -38,7 +54,34 @@
// 鍒犻櫎杩愮淮闃堝��
export function delThreshold(id) {
return request({
- url: '/ycl/threshold/' + id,
+ url: '/threshold/' + id,
method: 'delete'
})
}
+
+// 淇敼瑙嗛闃堝��
+export function editVideo(data) {
+ return request({
+ url: '/threshold/video',
+ method: 'put',
+ data: data
+ })
+}
+
+// 淇敼杞﹁締闃堝��
+export function editCar(data) {
+ return request({
+ url: '/threshold/car',
+ method: 'put',
+ data: data
+ })
+}
+
+// 淇敼浜鸿劯闃堝��
+export function editFace(data) {
+ return request({
+ url: '/threshold/face',
+ method: 'put',
+ data: data
+ })
+}
diff --git a/src/views/system/threshold/index.vue b/src/views/system/threshold/index.vue
index e825916..b1acb98 100644
--- a/src/views/system/threshold/index.vue
+++ b/src/views/system/threshold/index.vue
@@ -23,7 +23,6 @@
<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">
@@ -46,8 +45,8 @@
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-->
@@ -70,36 +69,87 @@
@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 {
@@ -121,7 +171,8 @@
// 寮瑰嚭灞傛爣棰�
title: '',
// 鏄惁鏄剧ず寮瑰嚭灞�
- open: false,
+ videoOpen: false,
+ faceOpen: false,
// 鏌ヨ鍙傛暟
queryParams: {
pageNum: 1,
@@ -129,15 +180,23 @@
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' }
+ ],
}
}
},
@@ -145,6 +204,48 @@
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
@@ -155,9 +256,17 @@
})
},
// 鍙栨秷鎸夐挳
- 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() {
@@ -171,6 +280,45 @@
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() {
@@ -196,13 +344,31 @@
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 = '淇敼杩愮淮闃堝��'
})
},
--
Gitblit v1.8.0