|
|
@@ -44,7 +44,7 @@
|
|
|
</div>
|
|
|
<div style="display: flex;width: 20%;align-items: center;margin-left: 20%;">
|
|
|
<el-button type="primary" style="margin-left: 5%;" @click="getModelListTable" :icon="Search">查询</el-button>
|
|
|
- <el-button type="primary" style="margin-left: 5%;" @click="submit" icon="Refresh">重置</el-button>
|
|
|
+ <el-button type="primary" style="margin-left: 5%;" icon="Refresh">重置</el-button>
|
|
|
<el-button type="primary" style="margin-left:5%;" @click="reg" icon="Plus">注册</el-button>
|
|
|
<!-- <el-button type="" style="margin-left:5%;" plain icon="Plus">切换展示模式</el-button> -->
|
|
|
</div>
|
|
|
@@ -69,7 +69,7 @@
|
|
|
:header-cell-style="{ textAlign: 'center'}"
|
|
|
:row-style="{ height: heightAll*0.01+'px',fontSize: '16px',textAlign:'center' }"
|
|
|
border
|
|
|
- :max-height="tableheight">
|
|
|
+ :height="tableheight">
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
<el-table-column type="index" label="序号" width="80"></el-table-column>
|
|
|
<el-table-column prop="name" label="组件名称">
|
|
|
@@ -105,9 +105,9 @@
|
|
|
<div style="display: flex;justify-content: space-between;width: 80%;">
|
|
|
<el-button type="primary" size="mini" text style="margin-left: -2%;">发布</el-button>
|
|
|
<el-button type="primary" text size="mini" style="margin-left: -5%;">测试</el-button>
|
|
|
- <el-button type="primary" size="mini" text style="margin-left: -5%;">编辑</el-button>
|
|
|
+ <el-button type="primary" @click="showEdit(scope.row)" size="mini" text style="margin-left: -5%;">编辑</el-button>
|
|
|
<!-- <el-button type="danger" text size="mini" style="margin-left: -5%;" @click="handleDelete(scope.row)">注销</el-button> -->
|
|
|
- <el-button type="primary" text size="mini" style="margin-left: -5%;">查看</el-button>
|
|
|
+ <el-button @click="showDe(scope.row)" type="primary" text size="mini" style="margin-left: -5%;">查看</el-button>
|
|
|
<el-button type="primary" text size="mini" style="margin-left: -5%;">API管理</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -117,47 +117,47 @@
|
|
|
<el-pagination
|
|
|
small
|
|
|
v-model='currentPage'
|
|
|
- @update = changePage
|
|
|
+ @current-change="changePage"
|
|
|
background
|
|
|
layout="prev, pager, next"
|
|
|
:total="totalComReg"
|
|
|
class="mt-4"
|
|
|
/>
|
|
|
</div>
|
|
|
- <el-dialog v-model="dialogVisible" title="组件注册" width="50%" @close="clearForm">
|
|
|
+ <el-dialog v-model="dialogVisible" title="组件注册" width="50%" @close="clearForm" destroy-on-close :key="tableKey">
|
|
|
<el-steps :active="active" finish-status="success" simple style="margin-top: 20px">
|
|
|
<el-step title="第一步"></el-step>
|
|
|
<el-step title="第二步"></el-step>
|
|
|
<el-step title="第三步"></el-step>
|
|
|
</el-steps>
|
|
|
- <div v-if="active==0">
|
|
|
- <div v-if="active==0" style="margin-left: 1%;margin-top: 1%;display: flex;align-items: center;">
|
|
|
+ <div v-show="active==0">
|
|
|
+ <div style="margin-left: 1%;margin-top: 1%;display: flex;align-items: center;">
|
|
|
<div style="background-color: blue;width: 2px;height: 16px;"></div>
|
|
|
<div style="font-weight: bold;font-size: 16px;margin-left: 0.5%;">基本信息</div>
|
|
|
</div>
|
|
|
- <div v-if="active==0" style="margin-left: 1%;margin-top: 1%;">
|
|
|
- <el-form style="margin-left: 5%;" :model="formJi" label-position="left" ref="formRefJi" class="demo-form-inline" :rules="rulesJi">
|
|
|
+ <div style="margin-left: 1%;margin-top: 1%;">
|
|
|
+ <el-form :key="tableKey" style="margin-left: 5%;" :model="formJi" label-position="left" ref="formRefJi" class="demo-form-inline" :rules="rulesJi">
|
|
|
<el-row :gutter="40">
|
|
|
<el-col :span="9">
|
|
|
<el-form-item label="组件名称:" prop="name" style="margin-left: -3%;">
|
|
|
- <el-input v-model="formJi.name" />
|
|
|
+ <el-input v-model="formJi.name" :disabled="isEdit"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="9">
|
|
|
<el-form-item label="版本号:" prop="version" style="margin-left: -3%;">
|
|
|
- <el-input v-model="formJi.version" />
|
|
|
+ <el-input v-model="formJi.version" :disabled="isEdit"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="40" style="margin-top: 1%;">
|
|
|
<el-col :span="9" >
|
|
|
<el-form-item label="组件英文名称:" prop="enname" style="margin-left: -3%;">
|
|
|
- <el-input v-model="formJi.enname" />
|
|
|
+ <el-input v-model="formJi.enname" :disabled="isEdit"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="9">
|
|
|
<el-form-item label="排序:" prop="">
|
|
|
- <el-input v-model="formJi.region" />
|
|
|
+ <el-input v-model="formJi.region" :disabled="isEdit"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -166,6 +166,7 @@
|
|
|
<el-form-item label="模型分类:" prop="type">
|
|
|
<el-select
|
|
|
v-model="formJi.type"
|
|
|
+ :disabled="isEdit"
|
|
|
style="width: 100%;margin-left: 1%;"
|
|
|
>
|
|
|
<el-option
|
|
|
@@ -179,7 +180,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="9">
|
|
|
<el-form-item label="开发语言:">
|
|
|
- <el-radio-group v-model="formJi.devlang" class="ml-4" size="small" style="margin-top: -10%;">
|
|
|
+ <el-radio-group v-model="formJi.devlang" class="ml-4" size="small" style="margin-top: -10%;" :disabled="isEdit">
|
|
|
<el-radio label="C++" size="large">C++</el-radio>
|
|
|
<el-radio label=".net" size="large">.net</el-radio>
|
|
|
<el-radio label="java" size="large">java</el-radio>
|
|
|
@@ -190,20 +191,20 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-form-item label="组件简介:">
|
|
|
- <el-input v-model="formJi.intro" style="width: 30%;" :rows="2" resize="none" type="textarea"/>
|
|
|
+ <el-input v-model="formJi.intro" style="width: 30%;" :disabled="isEdit" :rows="2" resize="none" type="textarea"/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <div v-if="active==0" style="margin-left: 1%;margin-top: 1%;display: flex;align-items: center;">
|
|
|
+ <div style="margin-left: 1%;margin-top: 1%;display: flex;align-items: center;">
|
|
|
<div style="background-color: blue;width: 2px;height: 16px;"></div>
|
|
|
<div style="font-weight: bold;font-size: 16px;margin-left: 0.5%;">提供单位信息</div>
|
|
|
</div>
|
|
|
- <div v-if="active==0" style="margin-left: 1%;margin-top: 1%;">
|
|
|
- <el-form style="margin-left: 5%;margin-top: 2%;" :model="formTi" ref="formRefTi" class="demo-form-inline" :rules="rulesTi">
|
|
|
+ <div style="margin-left: 1%;margin-top: 1%;">
|
|
|
+ <el-form style="margin-left: 5%;margin-top: 2%;" :disabled="isEdit" :model="formTi" ref="formRefTi" class="demo-form-inline" :rules="rulesTi">
|
|
|
<el-row :gutter="40">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="提供单位:" prop="ti">
|
|
|
- <el-input v-model="formTi.ti" style="width: 65%;margin-left: 1%;" placeholder="" />
|
|
|
+ <el-form-item label="提供单位:" prop="mdUnit">
|
|
|
+ <el-input v-model="formTi.mdUnit" style="width: 65%;margin-left: 1%;" placeholder="" />
|
|
|
<!-- <el-button type="primary" style="margin-left: 1%;">选择</el-button>
|
|
|
<el-button type="" style="margin-left:1%;">清空</el-button> -->
|
|
|
</el-form-item>
|
|
|
@@ -225,65 +226,15 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="active==1">
|
|
|
- <!-- <div style="margin-left: 1%;margin-top: 1%;display: flex;align-items: center;">
|
|
|
- <div style="background-color: blue;width: 2px;height: 16px;"></div>
|
|
|
- <div style="font-weight: bold;font-size: 16px;margin-left: 0.5%;">示例数据</div>
|
|
|
- </div>
|
|
|
- <div style="margin-left: 1%;margin-top: 1%;">
|
|
|
- <el-form style="margin-left: 5%;margin-top: 2%;" :model="form" class="demo-form-inline" :rules="rules">
|
|
|
- <el-row :gutter="40">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="输入示例数据:" prop="name">
|
|
|
- <el-upload
|
|
|
- class="upload-demo"
|
|
|
- drag
|
|
|
- action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
|
|
|
- multiple
|
|
|
- >
|
|
|
- <el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
- <div class="el-upload__text">
|
|
|
- Drop file here or <em>click to upload</em>
|
|
|
- </div>
|
|
|
- <template #tip>
|
|
|
- <div class="el-upload__tip">
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-upload>
|
|
|
- <el-input v-model="form.region" style="width: 75%;" placeholder="请输入示例" :rows="2" type="textarea"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="输入示例数据:" prop="name">
|
|
|
- <el-upload
|
|
|
- class="upload-demo"
|
|
|
- drag
|
|
|
- action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
|
|
|
- multiple
|
|
|
- >
|
|
|
- <el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
- <div class="el-upload__text">
|
|
|
- Drop file here or <em>click to upload</em>
|
|
|
- </div>
|
|
|
- <template #tip>
|
|
|
- <div class="el-upload__tip">
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-upload>
|
|
|
- <el-input v-model="form.region" style="width: 75%;" placeholder="请输入示例" :rows="2" type="textarea"/>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- </div> -->
|
|
|
+ <div v-show="active==1">
|
|
|
<div style="margin-left: 1%;margin-top: 1%;display: flex;align-items: center;">
|
|
|
<div style="background-color: blue;width: 2px;height: 16px;"></div>
|
|
|
<div style="font-weight: bold;font-size: 16px;margin-left: 0.5%;">模型组件上传</div>
|
|
|
</div>
|
|
|
<div style="margin-left: 1%;margin-top: 1%;">
|
|
|
- <el-form style="margin-left: 5%;margin-top: 2%;" :model="formZu" class="demo-form-inline" ref="formRefZu" :rules="rulesZu">
|
|
|
- <el-form-item label="组件执行路径:" prop="name" style="margin-left: -1%;">
|
|
|
- <el-input v-model="rulesZu.mirrorImageEurl" style="width: 75%;" placeholder="请输入组件执行路径" :rows="2" type="textarea" resize="none"/>
|
|
|
+ <el-form :disabled="isEdit" style="margin-left: 5%;margin-top: 2%;" :model="formZu" class="demo-form-inline" ref="formRefZu" :rules="rulesZu">
|
|
|
+ <el-form-item label="组件执行路径:" prop="mirrorImageEurl" style="margin-left: -1%;">
|
|
|
+ <el-input v-model="formZu.mirrorImageEurl" style="width: 75%;" placeholder="请输入组件执行路径" :rows="2" type="textarea" resize="none"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="组件说明文档:" prop="">
|
|
|
<div style="width: 60%;">
|
|
|
@@ -292,7 +243,7 @@
|
|
|
:limit="1"
|
|
|
accept=".xlsx, .xls"
|
|
|
:headers="upload.headers"
|
|
|
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
+ :action="upload.url + '?file=' + upload.updateSupport"
|
|
|
:on-progress="handleFileUploadProgress"
|
|
|
:on-success="handleFileSuccess"
|
|
|
:auto-upload="false"
|
|
|
@@ -313,7 +264,7 @@
|
|
|
<div style="font-weight: bold;font-size: 16px;margin-left: 0.5%;">资源需求</div>
|
|
|
</div>
|
|
|
<div style="margin-left: 1%;margin-top: 1%;">
|
|
|
- <el-form style="margin-left: 5%;margin-top: 2%;" :model="formZu" class="demo-form-inline" ref="formRefZu" :rules="rulesZu">
|
|
|
+ <el-form :disabled="isEdit" style="margin-left: 5%;margin-top: 2%;" :model="formZu" class="demo-form-inline" ref="formRefZu" :rules="rulesZu">
|
|
|
<el-row :gutter="40">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="CPU核心数:" prop="mdCPU" style="margin-left: -2%;">
|
|
|
@@ -324,8 +275,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="内存:" prop="name">
|
|
|
- <el-input v-model="formZu.region" style="width: 50%;" placeholder=""/>
|
|
|
+ <el-form-item label="内存:" prop="nei">
|
|
|
+ <el-input v-model="formZu.nei" style="width: 50%;" placeholder=""/>
|
|
|
<div style="margin-left: 2%;">
|
|
|
M
|
|
|
</div>
|
|
|
@@ -339,9 +290,9 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="平台:" prop="name">
|
|
|
+ <el-form-item label="平台:" prop="ping">
|
|
|
<el-select
|
|
|
- v-model="formZu.name"
|
|
|
+ v-model="formZu.ping"
|
|
|
style="width: 50%;"
|
|
|
>
|
|
|
<el-option
|
|
|
@@ -368,7 +319,7 @@
|
|
|
</el-form>
|
|
|
</div> -->
|
|
|
</div>
|
|
|
- <div v-if="active==2">
|
|
|
+ <div v-show="active==2">
|
|
|
<div style="margin-left: 1%;margin-top: 1%;display: flex;align-items: center;width: 98%;">
|
|
|
<div style="background-color: blue;width: 2px;height: 16px;"></div>
|
|
|
<div style="font-weight: bold;font-size: 16px;margin-left: 0.5%;">输入参数</div>
|
|
|
@@ -566,9 +517,15 @@
|
|
|
<el-button type="primary" @click="next" v-if="active!=2">
|
|
|
下一步
|
|
|
</el-button>
|
|
|
- <el-button type="primary" @click="submit" v-if="active==2">
|
|
|
+ <el-button type="primary" @click="subEdit" v-if="active==2&&isEdit===false&&isAdd===false">
|
|
|
+ 提交
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" @click="submit" v-if="active==2&&isEdit===false&&isAdd===true">
|
|
|
提交
|
|
|
</el-button>
|
|
|
+ <el-button type="primary" @click="dialogVisible = false" v-if="active==2&&isEdit===true">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
@@ -576,9 +533,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { getModelList,addModel,delMdid } from "@/api/register/regCom";
|
|
|
+import { getModelList,addModel,delMdid,getModelFile,getModelDetail,updateModel,modelFile } from "@/api/register/regCom";
|
|
|
import { ref, onMounted, onUnmounted, nextTick } from 'vue';
|
|
|
-import Sortable from 'sortablejs';
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
import {
|
|
|
ArrowLeft,
|
|
|
@@ -587,6 +543,7 @@ import {
|
|
|
import { reactive } from 'vue'
|
|
|
import { forwardRefProps } from 'element-plus/es/components/tooltip-v2/src/forward-ref.mjs';
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
+import { fa } from "element-plus/es/locales.mjs";
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const dragTableRef = ref()
|
|
|
const dialogVisible = ref(false)
|
|
|
@@ -630,18 +587,18 @@ const data = reactive({
|
|
|
"updateTime": "",
|
|
|
"version": ''
|
|
|
},
|
|
|
- rules: {
|
|
|
- name: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
|
- version: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
|
- enname: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
|
- mdUnit: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
|
- developer: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
|
- mdContact: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
|
- mdCPU: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
|
- }
|
|
|
});
|
|
|
|
|
|
-const formJi = ref({});
|
|
|
+const isEdit = ref(true)
|
|
|
+const isAdd = ref(true)
|
|
|
+const formJi = ref({
|
|
|
+ name:'',
|
|
|
+ version:'',
|
|
|
+ enname:'',
|
|
|
+ devlang:'',
|
|
|
+ intro:'',
|
|
|
+ type:''
|
|
|
+});
|
|
|
const rulesJi = reactive({
|
|
|
name: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
version: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
@@ -649,20 +606,26 @@ const rulesJi = reactive({
|
|
|
});
|
|
|
const formRefJi = ref();
|
|
|
|
|
|
-const formTi = ref({});
|
|
|
+const formTi = ref({
|
|
|
+ developer:'',
|
|
|
+ mdContact:'',
|
|
|
+ mdUnit:''
|
|
|
+});
|
|
|
const rulesTi = reactive({
|
|
|
- ti: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
+ mdUnit: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
developer: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
mdContact: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
});
|
|
|
const formRefTi = ref();
|
|
|
|
|
|
-const formZu = ref({});
|
|
|
+const formZu = ref({
|
|
|
+ mirrorImageEurl:'',
|
|
|
+ mdCPU:'',
|
|
|
+ mdGPU:''
|
|
|
+});
|
|
|
const rulesZu = reactive({
|
|
|
- name: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
- developer: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
+ mirrorImageEurl: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
mdCPU: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
- mdContact: [{ required: true, message: '必填', trigger: 'blur' }],
|
|
|
});
|
|
|
const formRefZu = ref();
|
|
|
|
|
|
@@ -674,12 +637,13 @@ const upload = reactive({
|
|
|
// 是否禁用上传
|
|
|
isUploading: false,
|
|
|
// 是否更新已经存在的用户数据
|
|
|
- updateSupport: 0,
|
|
|
+ updateSupport: '',
|
|
|
// 设置上传的请求头部
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
// 上传的地址
|
|
|
- url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData"
|
|
|
+ url: import.meta.env.VITE_APP_BASE_API + "/common/upload"
|
|
|
});
|
|
|
+const tableKey = ref(0);
|
|
|
const totalComReg = ref()
|
|
|
const currentPage = ref(1)
|
|
|
const { queryParams, form, rules } = toRefs(data);
|
|
|
@@ -734,58 +698,129 @@ const options = [
|
|
|
value: 'Option1',
|
|
|
label: 'Option1',
|
|
|
},
|
|
|
- {
|
|
|
- value: 'Option2',
|
|
|
- label: 'Option2',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option3',
|
|
|
- label: 'Option3',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option4',
|
|
|
- label: 'Option4',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option5',
|
|
|
- label: 'Option5',
|
|
|
- },
|
|
|
]
|
|
|
+const uploadRef = ref(null);
|
|
|
+const parForm = ref('')
|
|
|
onMounted(() => {
|
|
|
getModelListTable()
|
|
|
// addNewModel()
|
|
|
});
|
|
|
-function submit(){
|
|
|
- const data = ref({ user:1 });
|
|
|
- data.value = { ...data.value, ...{ age: 20 } };
|
|
|
- console.log(data.value)
|
|
|
- const formTotal = { ...formJi.value,...formTi.value,...formZu.value, };
|
|
|
- addModel(formTotal).then(res=>{
|
|
|
-
|
|
|
+function updateSameProperties(target, source) {
|
|
|
+ Object.keys(target).forEach(key => {
|
|
|
+ if (source.hasOwnProperty(key)) {
|
|
|
+ target[key] = source[key]; // 仅更新同名属性
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return target;
|
|
|
+}
|
|
|
+function showDe(row){
|
|
|
+ dialogVisible.value = true
|
|
|
+ isEdit.value = true
|
|
|
+ getModelDetail(row.mdid).then(res=>{
|
|
|
+ parForm.value = res.data
|
|
|
+ formJi.value = updateSameProperties(formJi.value,res.data)
|
|
|
+ formTi.value = updateSameProperties(formTi.value,res.data)
|
|
|
+ formZu.value = updateSameProperties(formZu.value,res.data)
|
|
|
})
|
|
|
}
|
|
|
-function clearForm(){
|
|
|
- formJi.value = {}
|
|
|
- formTi.value = {}
|
|
|
- formZu.value = {}
|
|
|
+async function showEdit(row){
|
|
|
+ isAdd.value = false
|
|
|
+ dialogVisible.value = true
|
|
|
+ await nextTick()
|
|
|
+ isEdit.value = false
|
|
|
+ getModelDetail(row.mdid).then(res=>{
|
|
|
+ parForm.value = res.data
|
|
|
+ formJi.value = updateSameProperties(formJi.value,res.data)
|
|
|
+ formTi.value = updateSameProperties(formTi.value,res.data)
|
|
|
+ formZu.value = updateSameProperties(formZu.value,res.data)
|
|
|
+ })
|
|
|
}
|
|
|
-function addNewModel(){
|
|
|
- addModel(form).then(res=>{
|
|
|
-
|
|
|
+function mergeObjects(...objects) {
|
|
|
+ return { ...objects.reduce((acc, obj) => ({ ...acc, ...obj }), {}) };
|
|
|
+}
|
|
|
+function subEdit(){
|
|
|
+ const formTotal = { ...formJi.value,...formTi.value,...formZu.value,...parForm.value };
|
|
|
+ const par = mergeObjects(parForm.value, formJi.value, formTi.value,formZu.value)
|
|
|
+ console.log(par)
|
|
|
+ updateModel(par).then(res=>{
|
|
|
+ if(res.code===200){
|
|
|
+ proxy.$modal.msgSuccess("修改成功");
|
|
|
+ dialogVisible.value = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+async function submit(){
|
|
|
+ const formTotal = { ...formJi.value,...formTi.value,...formZu.value,};
|
|
|
+ // debugger
|
|
|
+ await addModel(formTotal).then(res=>{
|
|
|
+ upload.updateSupport = res.msg
|
|
|
})
|
|
|
+ if(uploadRef.value?.uploadFiles?.length > 0){
|
|
|
+ uploadRef.value?.submit()
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ proxy.$modal.msgSuccess("保存成功");
|
|
|
+ dialogVisible.value = false
|
|
|
+ }
|
|
|
+ getModelList()
|
|
|
+}
|
|
|
+async function handleFileSuccess(response, file, fileList){
|
|
|
+ console.log(response)
|
|
|
+ var par = {
|
|
|
+ filename: response.originalFilename,
|
|
|
+ isDocument: '',
|
|
|
+ isMainLibrary: '',
|
|
|
+ mdid: upload.updateSupport,
|
|
|
+ relativePath: response.fileName,
|
|
|
+ signature:''
|
|
|
+ }
|
|
|
+ console.log(par)
|
|
|
+ await modelFile(par).then(res=>{
|
|
|
+ if(res.code===200){
|
|
|
+ proxy.$modal.msgSuccess("保存成功");
|
|
|
+ dialogVisible.value = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ getModelListTable()
|
|
|
+};
|
|
|
+function clearForm(){
|
|
|
+ formJi.value = {
|
|
|
+ name:'',
|
|
|
+ version:'',
|
|
|
+ enname:'',
|
|
|
+ devlang:'',
|
|
|
+ intro:'',
|
|
|
+ type:''
|
|
|
+ }
|
|
|
+ formTi.value = {
|
|
|
+ developer:'',
|
|
|
+ mdContact:'',
|
|
|
+ mdUnit:''
|
|
|
+ }
|
|
|
+ formZu.value = {
|
|
|
+ developer:'',
|
|
|
+ mdContact:'',
|
|
|
+ mdUnit:''
|
|
|
+ }
|
|
|
+ active.value = 0
|
|
|
}
|
|
|
function reg(){
|
|
|
+ isAdd.value = true
|
|
|
+ isEdit.value = false
|
|
|
dialogVisible.value = true
|
|
|
}
|
|
|
-function changePage(a){
|
|
|
+function changePage(a){
|
|
|
+
|
|
|
currentPage.value = a
|
|
|
getModelListTable()
|
|
|
}
|
|
|
function getModelListTable(){
|
|
|
+ tableData.value = []
|
|
|
var par = {
|
|
|
- pageNum: currentPage,
|
|
|
+ pageNum: currentPage.value,
|
|
|
pageSize: 10,
|
|
|
}
|
|
|
+ console.log(par)
|
|
|
getModelList(par).then(res=>{
|
|
|
tableData.value = res.rows
|
|
|
totalComReg.value = res.total
|
|
|
@@ -802,24 +837,25 @@ function handleDelete(row) {
|
|
|
};
|
|
|
const seledMo = ['primary','plain','plain','plain','plain','plain','plain']
|
|
|
const next = () => {
|
|
|
- active.value++
|
|
|
- // if(active.value==0){
|
|
|
- // formRefJi.value.validate((valid) => {
|
|
|
- // formRefTi.value.validate((valid1) => {
|
|
|
- // if(active.value<2&&valid&&valid1){
|
|
|
- // active.value++
|
|
|
- // }
|
|
|
- // });
|
|
|
- // });
|
|
|
- // }
|
|
|
- // if(active.value==1){
|
|
|
- // formRefZu.value.validate((valid) => {
|
|
|
- // if(active.value<2&&valid){
|
|
|
- // active.value++
|
|
|
+ if(active.value==0){
|
|
|
+ formRefJi.value.validate((valid) => {
|
|
|
+ formRefTi.value.validate((valid1) => {
|
|
|
+ // console.log(formTi.value)
|
|
|
+ console.log(valid1)
|
|
|
+ if(active.value<2&&valid&&valid1){
|
|
|
+ active.value++
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if(active.value==1){
|
|
|
+ formRefZu.value.validate((valid) => {
|
|
|
+ if(active.value<2&&valid){
|
|
|
+ active.value++
|
|
|
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
const forward = () => {
|
|
|
if(active.value>0){
|