| New file |
| | |
| | | <template> |
| | | <div class="algorithmMange"> |
| | | <div class="search-box"> |
| | | <el-form :model="params" inline> |
| | | <el-form-item label="算法名称:"> |
| | | <el-input v-model="params.algName" placeholder="请输入算法名称" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="算法类型:"> |
| | | <el-select class="ztzf-select" :teleported="false" v-model="params.algTypeCode" placeholder="请选择算法类型" clearable> |
| | | <el-option v-for="item in sfTypes" :key="item.id" :label="item.dictValue" :value="item.dictKey" ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getList">搜索</el-button> |
| | | <el-button @click="">取消</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="mange-table"> |
| | | <el-table border :data="tableList" class="custom-header"> |
| | | <el-table-column label="序号" type="index" width="60"></el-table-column> |
| | | <el-table-column prop="model_name" label="算法名称" align="center" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="alg_type" label="算法类型" align="center"></el-table-column> |
| | | <el-table-column prop="qua_rate" label="最低准确率" align="center"> |
| | | <template #header> |
| | | <el-tooltip placement="bottom" effect="light" content="AI识别率高于最低准确率时会生成待审核状态的事件"> |
| | | <el-icon><QuestionFilled /></el-icon> |
| | | </el-tooltip> |
| | | <span>最低准确率</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="pass_rate" label="最高准确率" align="center"> |
| | | <template #header> |
| | | <el-tooltip placement="bottom" effect="light" content="AI识别率高于最高准确率时会生成待处理状态的事件"> |
| | | <el-icon><QuestionFilled /></el-icon> |
| | | </el-tooltip> |
| | | <span>最低准确率</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="det_type" label="事件生成类型" show-overflow-tooltip align="center"> |
| | | <template #default="scope"> |
| | | {{ scope.row.det_type === 1 ? '流检测' : scope.row.det_type === 2 ?'事件检测' : '流+事件检测' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remark" label="算法描述" show-overflow-tooltip /> |
| | | <el-table-column label="操作" width="180" align="center"> |
| | | <template #default="scope"> |
| | | <el-button icon="el-icon-view" type="text" @click="handleDetail(scope.row)">查看</el-button> |
| | | <el-button icon="el-icon-edit" type="text" @click="handleEdit(scope.row)">编辑</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div class="pagination"> |
| | | <el-pagination class="ztzf-pagination" popper-class="custom-pagination-dropdown" background |
| | | :page-sizes="[10, 20, 30, 40, 50, 100]" :size="size" v-model:current-page="params.current" |
| | | v-model:page-size="params.size" layout="total, sizes, prev, pager, next, jumper" :total="total" |
| | | @size-change="handleSizeChange" @current-change="handleCurrentChange" /> |
| | | </div> |
| | | </div> |
| | | <el-dialog class="ztzf-dialog" append-to-body v-model="isShowView" title="查看" |
| | | :width="pxToRem(600)" :close-on-click-modal="false" :destroy-on-close="true"> |
| | | <div class="content"> |
| | | <table class="view-table" border> |
| | | <tr> |
| | | <td class="label">算法名称</td> |
| | | <td class="value">{{ rowView.model_name }}</td> |
| | | <td class="label">算法类型</td> |
| | | <td class="value">{{ rowView.alg_type }}</td> |
| | | </tr> |
| | | <tr> |
| | | <td class="label">最低准确率</td> |
| | | <td class="value">{{ rowView.qua_rate }}</td> |
| | | <td class="label">最高准确率</td> |
| | | <td class="value">{{ rowView.pass_rate }}</td> |
| | | </tr> |
| | | <tr> |
| | | <td class="label">事件生成类型</td> |
| | | <td class="value">{{ rowView.det_type }}</td> |
| | | <td class="label">算法描述</td> |
| | | <td class="value">{{ rowView.remark }}</td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog class="ztzf-dialog" append-to-body v-model="isShowEditView" title="编辑" |
| | | :width="pxToRem(800)" :close-on-click-modal="false" :destroy-on-close="true"> |
| | | <div class="content-edit"> |
| | | <el-form ref="ruleFormRef" :model="editParams" :rules="rules" inline> |
| | | <el-form-item label="算法名称"> |
| | | <el-input v-model="editParams.model_name" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="算法类型"> |
| | | <el-select class="ztzf-select" :teleported="false" v-model="editParams.alg_type" disabled> |
| | | <el-option v-for="item in sfTypes" :key="item.id" :label="item.dictValue" :value="item.dictKey" ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="最低准确率" prop="qua_rate"> |
| | | <el-input v-model="editParams.qua_rate" placeholder="请输入最低准确率" required clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="最高准确率" prop="pass_rate"> |
| | | <el-input v-model="editParams.pass_rate" placeholder="请输入最高准确率" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="事件生成类型" prop="det_type"> |
| | | <el-select class="ztzf-select" v-model="editParams.det_type" placeholder="请选择" clearable> |
| | | <el-option label="流检测" value="1"></el-option> |
| | | <el-option label="事件检测" value="2"></el-option> |
| | | <el-option label="流+事件检测" value="3"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="算法描述"> |
| | | <el-input v-model="editParams.remark" placeholder="请输入算法描述" clearable /> |
| | | </el-form-item> |
| | | <div class="btns"> |
| | | <el-button type="primary" @click="submit(ruleFormRef)">确认</el-button> |
| | | <el-button @click="isShowEditView = false">取消</el-button> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | <script setup> |
| | | import { getAlgorithmManageList, algorithmManageEdit } from '@/api/algorithmMange/algorithmMange'; |
| | | import { getDictionaryByCode } from '@/api/system/dictbiz'; |
| | | |
| | | const total = ref(0) |
| | | const params = ref({ |
| | | current: 1, |
| | | size: 10, |
| | | algName: '', |
| | | algTypeCode: '', |
| | | }); |
| | | |
| | | let tableList = ref([]) |
| | | |
| | | let isShowView = ref(false) |
| | | |
| | | let rowView = ref({}) |
| | | |
| | | let isShowEditView = ref(false) |
| | | |
| | | let sfTypes = ref([]) |
| | | const ruleFormRef = ref() |
| | | let editParams = ref({ |
| | | model_name: '', |
| | | alg_type: '', |
| | | qua_rate: '', |
| | | pass_rate: '', |
| | | det_type: '', |
| | | remark: '' |
| | | }) |
| | | const rules = reactive({ |
| | | qua_rate: [ |
| | | { required: true, message: '请输入最低准确率', trigger: 'blur' }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | if (!/^\d+(\.\d+)?$/.test(value)) { |
| | | callback(new Error('请输入有效的数字(整数或小数)')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | pass_rate: [ |
| | | { required: true, message: '请输入最低准确率', trigger: 'blur' }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | if (!/^\d+(\.\d+)?$/.test(value)) { |
| | | callback(new Error('请输入有效的数字(整数或小数)')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | det_type: [ |
| | | { |
| | | required: true, |
| | | message: '请选择事件生成类型', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | }) |
| | | |
| | | function getList() { |
| | | getAlgorithmManageList({current:1,size:10}).then(res => { |
| | | tableList.value = res.data.data.records || [] |
| | | total.value = res.data.data.total || 0 |
| | | }) |
| | | } |
| | | function getSFType() { |
| | | getDictionaryByCode('WORK_ORDER_TYPE').then(res => { |
| | | sfTypes.value = res.data.data.WORK_ORDER_TYPE || [] |
| | | }); |
| | | } |
| | | function handleDetail(row) { |
| | | isShowView.value = true |
| | | rowView.value = row |
| | | } |
| | | function handleEdit(row) { |
| | | isShowEditView.value = true |
| | | editParams.value = row |
| | | } |
| | | |
| | | async function submit(formValidate) { |
| | | if (!formValidate) return |
| | | await formValidate.validate((valid, fields) => { |
| | | if (valid) { |
| | | algorithmManageEdit(editParams.value).then(res => { |
| | | isShowEditView.value = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList() |
| | | getSFType() |
| | | }) |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .algorithmMange { |
| | | height: 0; |
| | | flex: 1; |
| | | margin: 0 10px 10px 10px; |
| | | background-color: #ffffff; |
| | | padding: 10px 20px; |
| | | border-radius: 5px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .search-box { |
| | | height: 40px; |
| | | } |
| | | |
| | | // 表格 |
| | | .mange-table { |
| | | height: 0; |
| | | flex: 1; |
| | | margin-top: 18px; |
| | | overflow: auto; |
| | | } |
| | | :deep(.el-pagination) { |
| | | display: flex; |
| | | justify-content: right; |
| | | } |
| | | |
| | | :deep(.el-pagination button) { |
| | | background: center center no-repeat none !important; |
| | | color: #8eb8ea !important; |
| | | } |
| | | :deep(.ztzf-select){ |
| | | .el-select__selection { |
| | | min-width: 200px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .content { |
| | | padding: 20px; |
| | | |
| | | .view-table { |
| | | width: 100%; |
| | | border-collapse: collapse; |
| | | border: 1px solid #EBEEF5; |
| | | |
| | | tr { |
| | | &:not(:last-child) { |
| | | border-bottom: 1px solid #EBEEF5; |
| | | } |
| | | |
| | | td { |
| | | padding: 12px 10px; |
| | | |
| | | &.label { |
| | | width: 140px; |
| | | text-align: right; |
| | | // color: #909399; |
| | | // background-color: #F5F7FA; |
| | | border-right: 1px solid #EBEEF5; |
| | | } |
| | | |
| | | &.value { |
| | | width: 180px; |
| | | color: #303133; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .content-edit { |
| | | .el-form { |
| | | .el-form-item { |
| | | width: 300px; |
| | | :deep(.el-form-item__label) { |
| | | width: 120px; |
| | | } |
| | | |
| | | } |
| | | .btns { |
| | | display: flex; |
| | | justify-content: center |
| | | } |
| | | } |
| | | } |
| | | </style> |