| | |
| | | <template> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle" width="50%"> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle" width="60%"> |
| | | <el-form |
| | | ref="formRef" |
| | | v-loading="formLoading" |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="模型类型" prop="modelType"> |
| | | <el-input v-model="formData.modelType" placeholder="请输入模型类型" /> |
| | | <el-select v-model="formData.modelType" placeholder="请选择"> |
| | | <el-option |
| | | v-for="dict in getStrDictOptions(DICT_TYPE.SCHE_MODEL_TYPE)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="调用方式" prop="invocation"> |
| | | <el-input v-model="formData.invocation" placeholder="调用方式" /> |
| | | <el-select v-model="formData.invocation" placeholder="请选择"> |
| | | <el-option |
| | | v-for="dict in getStrDictOptions(DICT_TYPE.SCHE_MODEL_INVOCATION)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="参数数量" prop="portLength"> |
| | | <el-input v-model="formData.portLength" placeholder="请输入参数数量 " /> |
| | | <el-input-number v-model="formData.portLength" :min="0" controls-position="right" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="模型路径" prop="modelPath"> |
| | | <el-input v-model="formData.modelPath" placeholder="模型路径 " /> |
| | | <el-input v-model="formData.modelPath" placeholder="模型路径" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | label="端口" |
| | | width="100" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.modelparamportorder" maxlength="5" clearable |
| | | style="width:100%;hight:100%"></el-input> |
| | | style="width:100%; hight:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | label="序号" |
| | | width="100" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.modelparamorder" maxlength="5" clearable |
| | | style="width:100%;hight:100%"></el-input> |
| | | style="width:100%;hight:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | label="类型" |
| | | width="150" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.modelparamtype" placeholder="请选择"> |
| | | <el-option |
| | | v-for="dict in getIntDictOptions(DICT_TYPE.MODEL_PARAM_TYPE)" |
| | | v-for="dict in getStrDictOptions(DICT_TYPE.MODEL_PARAM_TYPE)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | |
| | | prop="" |
| | | label="参数名称" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-select |
| | | size="mini" |
| | | v-model="scope.row.modelparamid" |
| | | filterable |
| | | placeholder="请选择"> |
| | | <el-option |
| | | v-for="(item, index) in modelparamListMap[scope.row.modelparamtype]" |
| | | v-for="(item, index) in modelparamListMap['k']" |
| | | :key="index" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | :disabled="!(item.type === scope.row.modelparamtype)"> |
| | | </el-option> |
| | | :disabled="!(item.type === scope.row.modelparamtype)"/> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | label="参数长度" |
| | | width="120" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.datalength" maxlength="50" clearable |
| | | style="width:100%;hight:100%"></el-input> |
| | | style="width:100%;hight:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | label="操作" |
| | | width="100" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | @click.native.prevent="addRow(scope.$index, formData.paramList)" |
| | | type="text" |
| | | link |
| | | @click.prevent="addRow(scope.$index, formData.paramList)" |
| | | type="primary" |
| | | size="small"> |
| | | 添加 |
| | | </el-button> |
| | | <el-button |
| | | @click.native.prevent="deleteRow(scope.$index, formData.paramList)" |
| | | type="text" |
| | | link |
| | | @click.prevent="deleteRow(scope.$index, formData.paramList)" |
| | | type="primary" |
| | | size="small"> |
| | | 删除 |
| | | </el-button> |
| | |
| | | |
| | | <el-divider content-position="left">设置参数</el-divider> |
| | | <el-table |
| | | :data="formData.paramList" |
| | | :data="formData.settingList" |
| | | border |
| | | style="width: 100%; margin-top: 5px;"> |
| | | <el-table-column |
| | | prop="" |
| | | label="键" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.key" maxlength="256" clearable |
| | | style="width:100%;hight:100%"></el-input> |
| | | style="width:100%;hight:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="" |
| | | label="名称" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.name" maxlength="256" clearable |
| | | style="width:100%;hight:100%"></el-input> |
| | | style="width:100%;hight:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="" |
| | | label="类型" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.valuetype" maxlength="256" clearable |
| | | style="width:100%;hight:100%"></el-input> |
| | | style="width:100%;hight:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="" |
| | | label="值" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.value" maxlength="256" clearable |
| | | style="width:100%;hight:100%"></el-input> |
| | | style="width:100%;hight:100%"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | label="操作" |
| | | width="100" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | @click.native.prevent="addRow(scope.$index, formData.settingList)" |
| | | type="text" |
| | | @click.prevent="addRow(scope.$index, formData.settingList)" |
| | | link |
| | | type="primary" |
| | | size="small"> |
| | | 添加 |
| | | </el-button> |
| | | <el-button |
| | | @click.native.prevent="deleteRow(scope.$index, formData.settingList)" |
| | | type="text" |
| | | @click.prevent="deleteRow(scope.$index, formData.settingList)" |
| | | link |
| | | type="primary" |
| | | size="small"> |
| | | 删除 |
| | | </el-button> |
| | |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
| | | import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
| | | import * as ScheduleModelApi from '@/api/model/sche/model' |
| | | import { CommonStatusEnum } from '@/utils/constants' |
| | | import * as DataSourceConfigApi from "@/api/infra/dataSourceConfig"; |
| | | |
| | | defineOptions({ name: 'ScheduleModelForm' }) |
| | | |
| | |
| | | modelPath: undefined, |
| | | resultStrId: undefined, |
| | | invocation: undefined, |
| | | status: undefined, |
| | | status: CommonStatusEnum.ENABLE, |
| | | paramList: [{ |
| | | modelparamportorder: '1', |
| | | modelparamorder: '1', |
| | |
| | | modelType: [{ required: true, message: '模型类型不能为空', trigger: 'blur' }] |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | const modelparamListMap = ref([] as ScheduleModelApi.ModelParamVO[]) |
| | | const modelparamListMap = ref({}) |
| | | |
| | | const addRow = function (index, rows) { |
| | | let row = JSON.parse(JSON.stringify(rows[index])) |
| | |
| | | } |
| | | |
| | | // 加载数据源列表 |
| | | modelparamListMap.value = await ScheduleModelApi.getModelParamList() |
| | | await ScheduleModelApi.getModelParamList(modelparamListMap) |
| | | } |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | |
| | | modelPath: undefined, |
| | | resultStrId: undefined, |
| | | invocation: undefined, |
| | | status: undefined, |
| | | status: CommonStatusEnum.ENABLE, |
| | | paramList: [{ |
| | | modelparamportorder: '1', |
| | | modelparamorder: '1', |