| | |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | <el-divider content-position="left">模型下发配置</el-divider> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="4"> |
| | | <el-button type="primary" size="small" @click="addRowOut()" >新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table |
| | | :data="formData.modelOut" |
| | | border |
| | | style="width: 100%; margin-top: 5px;"> |
| | | <el-table-column prop="resultKey`" label="输出key" align="center" min-width="100"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.resultKey" style="width:100%;height:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="resultType`" label="数据类型" align="center" min-width="100"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.resultType" style="width:100%;height:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="resultPort" label="角标1" align="center" min-width="100"> |
| | | <template #default="scope"> |
| | | <el-input-number :min="0" clearable controls-position="right" size="mini" v-model="scope.row.resultPort" style="width:100%;height:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="resultIndex" label="角标2" align="center" min-width="100"> |
| | | <template #default="scope"> |
| | | <el-input-number :min="0" clearable controls-position="right" size="mini" v-model="scope.row.resultIndex" style="width:100%;height:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="isWrite" label="是否下发" align="center" min-width="100"> |
| | | <template #default="scope"> |
| | | <el-switch size="small" v-model="scope.row.isWrite" :active-value="1" |
| | | :inactive-value="0"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="" |
| | | label="测点名称" |
| | | align="center" min-width="200"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.pointNo" |
| | | filterable |
| | | placeholder="请选择"> |
| | | <el-option |
| | | v-for="(item, index) in modelparamListMap['DATAPOINT']" |
| | | :key="index" |
| | | :label="item.name" |
| | | :value="item.itemNo"/> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="disturbancePointNo’" label="无扰切换点位" align="center" min-width="200"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.disturbancePointNo" |
| | | filterable |
| | | placeholder="请选择"> |
| | | <el-option |
| | | v-for="(item, index) in modelparamListMap['DATAPOINT']" |
| | | :key="index" |
| | | :label="item.name" |
| | | :value="item.itemNo"/> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" fixed="right" header-align="center" align="center" width="100"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | @click="deleteModelOutRow(scope.$index)" |
| | | key="danger" |
| | | type="danger" |
| | | link |
| | | >删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
| | |
| | | import * as ScheduleModelApi from '@/api/model/sche/model' |
| | | import { CommonStatusEnum } from '@/utils/constants' |
| | | import * as MpkApi from "@/api/model/mpk/mpk"; |
| | | import {generateUUID} from "@/utils"; |
| | | |
| | | defineOptions({ name: 'ScheduleModelForm' }) |
| | | |
| | |
| | | invocation: undefined, |
| | | status: CommonStatusEnum.ENABLE, |
| | | paramList: [], |
| | | settingList: [] |
| | | settingList: [], |
| | | modelOut: [] |
| | | }) |
| | | const formRules = reactive({ |
| | | modelCode: [{ required: true, message: '模型编号不能为空', trigger: 'blur' }], |
| | |
| | | invocation: undefined, |
| | | status: CommonStatusEnum.ENABLE, |
| | | paramList: [], |
| | | settingList: [] |
| | | settingList: [], |
| | | modelOut: [] |
| | | } |
| | | formRef.value?.resetFields() |
| | | } |
| | |
| | | function changeModelparamtype(row) { |
| | | row.modelparamid = '' |
| | | } |
| | | const addRowOut= function () { |
| | | if(formData.value.modelOut===undefined) { |
| | | formData.value.modelOut = [] |
| | | } |
| | | formData.value.modelOut.push({ |
| | | id: generateUUID(), |
| | | resultKey: undefined, |
| | | resultType: "double[][]", |
| | | port: 0, |
| | | index: 0, |
| | | isWrite: 1, |
| | | pointNo:undefined, |
| | | sort:undefined, |
| | | disturbancePointNo:undefined, |
| | | }) |
| | | } |
| | | const deleteModelOutRow = function (index) { |
| | | formData.value.modelOut.splice(index, 1) |
| | | } |
| | | </script> |