| | |
| | | > |
| | | <el-divider content-position="left">模型信息</el-divider> |
| | | <el-row :gutter="8"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="模型名称" prop="pyName"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="模型类型" prop="pyType"> |
| | | <el-radio-group v-model="formData.pyType" @change="pyTypeChange"> |
| | | <el-radio-button |
| | | v-for="dict in getDictOptions(DICT_TYPE.MODEL_TYPE)" |
| | | :key="dict.label" |
| | | :label="dict.value" |
| | | > |
| | | {{ dict.label }} |
| | | </el-radio-button> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="8"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="模型文件" prop="pyName"> |
| | | <el-input disabled v-model="formData.pyName" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | :on-success="submitFormSuccess" |
| | | accept=".pyd" |
| | | > |
| | | <el-button type="primary"> |
| | | <Icon icon="ep:upload"/> |
| | | 模型上传 |
| | | </el-button> |
| | | <el-tooltip content="上传.pyd算法文件" placement="top" effect="light"> |
| | | <el-button type="primary"> |
| | | <Icon icon="ep:upload"/> |
| | | 模型上传 |
| | | </el-button> |
| | | </el-tooltip> |
| | | </el-upload> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="8"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="模型中文名称" prop="pyChineseName"> |
| | | <el-form-item label="模型名称" prop="pyChineseName"> |
| | | <el-input v-model="formData.pyChineseName" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="模型类型" prop="pyType"> |
| | | <el-select |
| | | v-model="formData.pyType" |
| | | placeholder="请选择" |
| | | @change="pyTypeChange" |
| | | > |
| | | <el-option |
| | | v-for="dict in getDictOptions(DICT_TYPE.MODEL_TYPE)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | <el-row :gutter="8"> |
| | | <el-col :span="12"> |
| | |
| | | </el-row> |
| | | <el-row :gutter="8"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="所属菜单" prop="menuName"> |
| | | <el-input v-model="formData.menuName" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="所属组" prop="groupName"> |
| | | <el-input v-model="formData.groupName" placeholder=""/> |
| | | <el-form-item label="所属目录" prop="menuAndGroup"> |
| | | <el-cascader |
| | | style="width: 100%;" |
| | | v-model="formData.menuAndGroup" |
| | | :options="treeData" |
| | | @change="handleChange" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="8"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="icon" prop="icon"> |
| | | <el-input v-model="formData.icon" placeholder=""/> |
| | | <el-form-item label="图标" prop="icon"> |
| | | <el-select v-model="formData.icon" clearable filterable placeholder="请选择图标"> |
| | | <el-option |
| | | v-for="item in iconList" |
| | | :key="item.iconName" |
| | | :label="item.iconName" |
| | | :value="item.iconName" |
| | | > |
| | | <span style="float: left">{{ item.iconName}}</span> |
| | | <span |
| | | style=" |
| | | float: right; |
| | | color: var(--el-text-color-secondary); |
| | | font-size: 13px;"> |
| | | <img :src="'/SimtreeUnitImage/' + item.iconName" style="height: 24px;" :alt=" item.iconDesc" /> |
| | | </span> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-table-column align="center" label="参数类型" prop="valueType"/> |
| | | <el-table-column align="center" label="最大值" prop="max"/> |
| | | <el-table-column align="center" label="最小值" prop="min"/> |
| | | <!-- <el-table-column align="center" label="选项" width="50">--> |
| | | <!-- <template #default="props">--> |
| | | <!-- <div v-if="props.row.type === 'select'">--> |
| | | <!-- <el-popover placement="left" :width="400">--> |
| | | <!-- <template #reference>--> |
| | | <!-- <Icon icon="ep:more" />--> |
| | | <!-- </template>--> |
| | | <!-- <el-table width="50%" :data="props.row.settingSelects" border size="small">--> |
| | | <!-- <el-table-column align="center" label="key" prop="selectKey"/>--> |
| | | <!-- <el-table-column align="center" label="name" prop="name"/>--> |
| | | <!-- </el-table>--> |
| | | <!-- </el-popover>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column label="操作" fixed="right" header-align="center" align="center" width="100"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | @click="updateSetting(scope.row)" |
| | | key="danger" |
| | | type="danger" |
| | | type="primary" |
| | | link |
| | | >修改 |
| | | </el-button> |
| | |
| | | <SettingForm ref="settingFormRef"/> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {DICT_TYPE, getDictOptions} from '@/utils/dict' |
| | | import * as MpkApi from '@/api/mpk/mpk' |
| | | import {DICT_TYPE, getDictOptions, getIntDictOptions} from '@/utils/dict' |
| | | import * as MpkApi from '@/api/model/mpk/mpk' |
| | | import * as MpkIconApi from '@/api/model/mpk/icon' |
| | | import * as MpkMenuApi from '@/api/model/mpk/menu' |
| | | import {FormRules} from 'element-plus' |
| | | import {getAccessToken, getTenantId} from "@/utils/auth"; |
| | | import SettingForm from './SettingForm.vue' |
| | |
| | | const route = useRoute() // 路由 |
| | | const router = useRouter(); |
| | | |
| | | /** settingForm弹窗 */ |
| | | const treeData = ref([]) |
| | | const iconList = ref([] as MpkIconApi.MpkIconVO) |
| | | |
| | | /** settingForm弹窗 */ |
| | | const settingFormRef = ref() |
| | | // 添加setting |
| | | const addSetting = (methodSettings) => { |
| | |
| | | // 修改setting |
| | | const updateSetting = (info) => { |
| | | settingFormRef.value.open(info) |
| | | } |
| | | // 删除setting |
| | | const deleteSetting = (methodSettings,index) => { |
| | | methodSettings.splice(index, 1); |
| | | } |
| | | |
| | | const methodExpandedRowKeys = ref([]) |
| | |
| | | pyChineseName: undefined, |
| | | pyName: undefined, |
| | | pkgName: undefined, |
| | | pyType: undefined, |
| | | pyType: 'predict', |
| | | className: undefined, |
| | | pyModule: undefined, |
| | | icon: undefined, |
| | |
| | | remark: undefined, |
| | | modelMethods: [], |
| | | filePath: undefined, |
| | | menuAndGroup: [], |
| | | }) |
| | | |
| | | const formRules = reactive<FormRules>({ |
| | |
| | | pyModule: [ |
| | | {required: true, message: '模型路径不能为空', trigger: 'blur'} |
| | | ], |
| | | menuName: [ |
| | | menuAndGroup: [ |
| | | {required: true, message: '所属目录不能为空', trigger: 'blur'} |
| | | ], |
| | | }) |
| | |
| | | pyName: undefined, |
| | | pyChineseName: undefined, |
| | | pkgName: undefined, |
| | | pyType: undefined, |
| | | pyType: 'predict', |
| | | className: undefined, |
| | | pyModule: undefined, |
| | | icon: undefined, |
| | |
| | | filePath: undefined |
| | | } |
| | | formRef.value?.resetFields() |
| | | } |
| | | |
| | | const handleChange = function () { |
| | | |
| | | } |
| | | |
| | | const addRow = function () { |
| | |
| | | title.value = t('action.' + type) |
| | | formType.value = type |
| | | resetForm() |
| | | pyTypeChange() |
| | | // 修改时,设置数据 |
| | | if (id) { |
| | | formLoading.value = true |
| | |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | |
| | | // 加载图标列表 |
| | | iconList.value = await MpkIconApi.getList() |
| | | |
| | | // 加载菜单,分组 |
| | | treeData.value = await MpkMenuApi.getTree() |
| | | }) |
| | | |
| | | const pyTypeChange = () => { |
| | |
| | | methodName: 'train', |
| | | dataLength: 1, |
| | | model: 0, |
| | | resultKey: undefined, |
| | | resultKey: 'result', |
| | | methodSettings: [] |
| | | }, |
| | | { |