Ver Fonte

auto create_time and model_no, enable modify file type, combine modify name and modify file

Danj0rr há 1 ano atrás
pai
commit
b970119855

+ 388 - 294
src/views/system/modelEdit.vue

@@ -1,270 +1,312 @@
 <template>
     <div class="container" style="min-height: 100%; padding-bottom: 100px;">
-      <el-container>
-        <el-aside width="250px">
-  
-          <el-menu
-                default-active="1"
-                class="el-menu-vertical-demo"
+        <el-container>
+            <el-aside width="250px">
+
+                <el-menu
+                        default-active="1"
+                        class="el-menu-vertical-demo"
+                >
+                    <el-menu-item @click="gotolink2" class="vertical-center" index="1">
+                        <i class="el-icon-location"></i>
+                        <span slot="title">模型列表</span>
+                    </el-menu-item>
+                </el-menu>
+
+            </el-aside>
+            <!--      <div class="line" />-->
+
+            <el-main>
+
+                <div>
+                    <el-descriptions title="模型信息" style="margin-top: 20px" direction="vertical" :column="1" border>
+                        <el-descriptions-item label="模型名称">
+                            <p>
+                                {{ modelName }}
+                            </p>
+                        </el-descriptions-item>
+                        <el-descriptions-item label="模型编号">
+                            <p>
+                                {{ modelNo }}
+                            </p>
+                        </el-descriptions-item>
+                        <el-descriptions-item label="模型类型">
+                            <p>
+                                {{ type_list[modelType] }}
+                            </p>
+                        </el-descriptions-item>
+                        <el-descriptions-item label="模型状态">
+                            <p>
+                                {{ modelState }}
+                            </p>
+                        </el-descriptions-item>
+
+                    </el-descriptions>
+                </div>
+                <div class="upper_bottom_bar" style="margin-top: 20px">
+                    <el-button :disabled="this.modelState === '已上线'" round type="success" size="medium"
+                               @click="online" style="margin-right: 10px;">部署
+                    </el-button>
+                    <el-button :disabled="this.modelState === '暂停使用'" round type="danger" size="medium"
+                               @click="offline" style="margin-right: 10px;">暂停
+                    </el-button>
+                    <el-button round type="warning" size="medium" @click="gotoModify" style="margin-right: 10px;">修改
+                    </el-button>
+                    <el-button round type="primary" size="medium" style="margin-right: 10px;" @click="returnLink">返回
+                    </el-button>
+                </div>
+                <!-- <div class = "bottom-bar" style="margin-top: 20px" >
+                        <el-button round type="primary" size="medium" style="position: absolute; left: 55%;" @click="returnLink" >返回</el-button>
+                </div> -->
+                <el-dialog
+                        :visible.sync="dialogVisible"
+                        title="修改"
+                        width="30%"
+                        @close="closeDialog"
                 >
-                <el-menu-item @click="gotolink2" class="vertical-center" index="1">
-                    <i class="el-icon-location"></i>
-                    <span slot="title">模型列表</span>
-                </el-menu-item>
-              </el-menu>
-  
-        </el-aside>
-  <!--      <div class="line" />-->
-  
-        <el-main>
-  
-          <div>
-                <el-descriptions title="模型信息" style="margin-top: 20px" direction="vertical" :column="1" border>
-                    <el-descriptions-item label="模型名称">
-                        <p>
-                            {{modelName}}
-                        </p>
-                    </el-descriptions-item>
-                    <el-descriptions-item label="模型编号">
-                        <p>
-                            {{modelNo}}
-                        </p>
-                    </el-descriptions-item>
-                    <el-descriptions-item label="模型类型">
-                        <p>
-                            {{type_list[modelType]}}
-                        </p>
-                    </el-descriptions-item>
-                    <el-descriptions-item label="模型状态">
-                        <p>
-                            {{modelState}}
-                        </p>
-                    </el-descriptions-item>
-                    
-                </el-descriptions>
-            </div>
-            <div class = "upper_bottom_bar" style="margin-top: 20px" >
-                <el-button :disabled="this.modelState === '已上线'"  round type="success" size="medium" @click="online" style="margin-right: 10px;">部署</el-button>
-                <el-button :disabled="this.modelState === '暂停使用'" round type="danger" size="medium" @click="offline" style="margin-right: 10px;">暂停</el-button>
-                <el-button round type="warning" size="medium" @click="openDialog" style="margin-right: 10px;">修改</el-button>
-                <el-button round type="primary" size="medium" style="margin-right: 10px;" @click="returnLink" >返回</el-button>
-            </div>
-            <!-- <div class = "bottom-bar" style="margin-top: 20px" >
-                    <el-button round type="primary" size="medium" style="position: absolute; left: 55%;" @click="returnLink" >返回</el-button>
-            </div> -->
-            <el-dialog
-                :visible.sync="dialogVisible"
-                title="修改"
-                width="30%"
-                @close="closeDialog"
-            >
-            <el-form ref="modelForm"  label-width="80px">
-                <el-form-item label="模型名称">
-                <el-input v-model="inputValue" placeholder="请输入模型名称"></el-input>
-            </el-form-item>
-                <el-form-item label="选择文件" width="200px">
+                    <el-form ref="modelForm" label-width="80px">
+                        <el-form-item label="模型名称">
+                            <el-input v-model="inputValue" placeholder="请输入模型名称"></el-input>
+                        </el-form-item>
+
+                        <el-form-item label="模型类型" width="100px">
+                            <el-select v-model="model_type" placeholder="选择模型类型">
+                                <el-option v-for='item in type_list' :key="item.key" :label="item.label"
+                                           :value="item.key"
+                                />
+                            </el-select>
+
+                        </el-form-item>
+
+                        <el-form-item v-if="model_type=='3'" label="端口" width="100px">
+                            <el-input v-model="port" style="width:150px"></el-input>
+                        </el-form-item>
+
+
+                        <el-form-item v-if="model_type=='3'" label="url地址" width="100px">
+                            <el-input v-model="url_ad" style="width:150px"></el-input>
+                        </el-form-item>
+
+                        <el-form-item  v-if="model_type!='4'" label="选择文件" width="200px">
                             <input type="file" ref="myfile">
                             <span>  文件大小限制:小于50M </span>
-                </el-form-item>
+                        </el-form-item>
 
-                    <el-button class="model_add_button" type="primary" @click="change_model">提交模型</el-button>
+                        <el-form-item label="选择文件" width="200px">
+                            <input type="file" ref="myfile">
+                            <span>  文件大小限制:小于50M </span>
+                        </el-form-item>
+
+                        <!--                    <el-button class="model_add_button" type="primary" @click="change_model">提交模型</el-button>-->
 
-            </el-form>
+                    </el-form>
 
-            <span slot="footer" class="dialog-footer">
+                    <span slot="footer" class="dialog-footer">
                 <el-button @click="closeDialog">取消</el-button>
-                <el-button type="primary" @click="confirmModelName">确认</el-button>
+                <el-button type="primary" @click="confirmModelChange">确认</el-button>
             </span>
-            </el-dialog>
-        </el-main>
-        
-      </el-container>
-            
-      <div class="yema">
-  
-  </div>
+                </el-dialog>
+            </el-main>
+
+        </el-container>
+
+        <div class="yema">
+
+        </div>
     </div>
-  </template>
-  
-  <script>
-  
-  import {
+</template>
+
+<script>
+
+import {
     cooperatorProductList
-  } from '@/api/index.js'
-  import store from "@/store";
-  import request from '@/utils/request.js'
-  import { fieldInfo, modelInfo } from '../../api';
-  
-  export default {
-  
+} from '@/api/index.js'
+import store from "@/store";
+import request from '@/utils/request.js'
+import {fieldInfo, modelInfo} from '../../api';
+
+export default {
+
     name: "cooperatorInfo",
     props: [],
     components: {},
     data() {
-      return {
-        // cooperatorName : this.$route.query.cooperatorName,
-        modelId: this.$route.query.modelId,
-        modelNo:this.$route.query.modelNo,
-        modelName:this.$route.query.modelName,
-        modelType:this.$route.query.modelType,
-        modelState:this.$route.query.modelState,
-        cooperatorProductData: [],
-        cooperatorProductShowData: [],
-        type_list: [
+        return {
+            // cooperatorName : this.$route.query.cooperatorName,
+            modelId: this.$route.query.modelId,
+            modelNo: this.$route.query.modelNo,
+            modelName: this.$route.query.modelName,
+            modelType: this.$route.query.modelType,
+            modelState: this.$route.query.modelState,
+            filePath: this.$route.query.filePath,
+            cooperatorProductData: [],
+            cooperatorProductShowData: [],
+            // type_list: [
+            //     "自定义模型",
+            //     "jar模型",
+            //     "python模型",
+            //     "http服务",
+            //     "空模型"
+            // ],
+            type_list: [
                 "自定义模型",
                 "jar模型",
                 "python模型",
                 "http服务",
                 "空模型"
             ],
-        currentPage:1,
-        pageSize:10,
-        totalRows:0,
-        model_product_show:false,
-        dialogVisible: false,
-        inputValue:this.$route.query.modelName,
-        upload_file: "",
-        allChunksUploaded: false,
-        uploadProcess: 0,
-        chunkSize: 50*1024*1024,
-
-      }
+            currentPage: 1,
+            pageSize: 10,
+            totalRows: 0,
+            model_product_show: false,
+            dialogVisible: false,
+            inputValue: this.$route.query.modelName,
+            upload_file: "",
+            allChunksUploaded: false,
+            uploadProcess: 0,
+            chunkSize: 50 * 1024 * 1024,
+            model_type:""
+
+        }
     },
     watch: {},
     computed: {},
-    beforeCreate() {},
-    created() {},
-    beforeMount() {},
-    mounted() 
-    {
-        cooperatorProductList().then((res) => {
+    beforeCreate() {
+    },
+    created() {
+    },
+    beforeMount() {
+    },
+    mounted() {
+        cooperatorProductList(this.currentPage,this.pagesize).then((res) => {
                 if (res.data.cooperator_Product_List) {
                     this.cooperatorProductData = res.data.cooperator_Product_List;
-                    console.log(this.cooperatorProductData);
-                    this.cooperatorProductShowData=this.cooperatorProductData.filter(item => {
-                        const modelIdMatch = item.modelId==this.$route.query.modelNo;
-                        console.log(item);
-                        console.log(this.$route.query.modelNo);
+                    console.log("filtertest: %s",this.cooperatorProductData);
+                    this.cooperatorProductShowData = this.cooperatorProductData.filter(item => {
+                        const modelIdMatch = item.modelId == this.$route.query.modelNo;
+
                         // return true;
                         return modelIdMatch;
                     });
                 }
-                
+
             }
         );
     },
-    beforeUpdate() {},
-    updated() {},
-    destroyed() {},
-    methods: {
-        
-    makeChunks(file) {
-        const fileChunks = {
-            file,
-            chunks: [],
-        };
-        if (file.size < this.chunkSize) {
-            fileChunks.chunks.push({start: 0, end: file.size});
-            return fileChunks;
-        }
-        let chunksLength;
-        if (file.size % this.chunkSize === 0) {
-            chunksLength = Math.round(Math.floor(file.size / this.chunkSize));
-        } else {
-            chunksLength = Math.round(Math.floor(file.size / this.chunkSize)) + 1;
-        }
-        let leftSize = file.size;
-        while (leftSize > 0) {
-            const start = fileChunks.chunks.length * this.chunkSize;
-            const end =
-                start + this.chunkSize >= file.size
-                    ? file.size
-                    : start + this.chunkSize;
-            leftSize -= end - start;
-            fileChunks.chunks.push({start, end});
-        }
-        return fileChunks;
+    beforeUpdate() {
     },
-    randomId() {
-        let str = "";
-        for (let i = 0; i < 4; i++) {
-            str += Math.random()
-                .toString()
-                .replace(/\./, "");
-        }
-        str = "uid" + str;
-        // 取前32位随机字符,不足补0
-        return str.length >= 32
-            ? str.substr(0, 32)
-            : str + repeat("0", 32 - str.length);
+    updated() {
     },
-    change_model() {
-        let myfile = this.$refs.myfile;
-        if (!myfile.files.length > 0) {
-            this.$alert("请选择文件");
-            return;
-        }
-        let files = myfile.files;
-        let file = files[0];
-        let fileName = file.name;
-        let index = fileName.lastIndexOf(".");
-        let oldIndex=this.$route.query.filePath.lastIndexOf(".");
-        if (index != -1) {
-            let suffix = fileName.substr(index + 1).toLowerCase();
-            let oldSuffix=this.$route.query.filePath.substr(oldIndex+1).toLowerCase();
-            if (suffix != oldSuffix) {
-                this.$alert("请上传相同格式模型");
+    destroyed() {
+    },
+    methods: {
+
+        makeChunks(file) {
+            const fileChunks = {
+                file,
+                chunks: [],
+            };
+            if (file.size < this.chunkSize) {
+                fileChunks.chunks.push({start: 0, end: file.size});
+                return fileChunks;
+            }
+            let chunksLength;
+            if (file.size % this.chunkSize === 0) {
+                chunksLength = Math.round(Math.floor(file.size / this.chunkSize));
+            } else {
+                chunksLength = Math.round(Math.floor(file.size / this.chunkSize)) + 1;
+            }
+            let leftSize = file.size;
+            while (leftSize > 0) {
+                const start = fileChunks.chunks.length * this.chunkSize;
+                const end =
+                    start + this.chunkSize >= file.size
+                        ? file.size
+                        : start + this.chunkSize;
+                leftSize -= end - start;
+                fileChunks.chunks.push({start, end});
+            }
+            return fileChunks;
+        },
+        randomId() {
+            let str = "";
+            for (let i = 0; i < 4; i++) {
+                str += Math.random()
+                    .toString()
+                    .replace(/\./, "");
+            }
+            str = "uid" + str;
+            // 取前32位随机字符,不足补0
+            return str.length >= 32
+                ? str.substr(0, 32)
+                : str + repeat("0", 32 - str.length);
+        },
+        change_model() {
+            let myfile = this.$refs.myfile;
+            if (!myfile.files.length > 0) {
+                this.$alert("请选择文件");
                 return;
             }
-        }
-        this.upload_file = file;
-        this.handleUpload();
-    },
-    handleUpload() {
-        console.log(`file: ${JSON.stringify(this.upload_file)}`);
-        const fileChunks = this.makeChunks(this.upload_file);
-        // 重置上传进度的状态
-        this.allChunksUploaded = false;
-        this.uploadProcess = 0;
-
-        // 生成uid,传递给后端,后端根据uid对子文件块进行合并
-        const fileUid = this.randomId();
-        console.log(fileChunks.chunks.length);
-        for (var k in fileChunks.chunks) {
-            var chunk = fileChunks.chunks[k];
-            const formData = new FormData();
-            formData.append("index", k + "");
-            formData.append("chunk", fileChunks.file.slice(chunk.start, chunk.end));
-            formData.append("name", fileChunks.file.name);
-            formData.append("chunksLength", fileChunks.chunks.length + "");
-            formData.append("uid", fileUid);
-            formData.append("output_list", this.output_list);
-            formData.append("id", this.modelId);
-
-            console.log("test");
-            console.log(this.modelId);
-
-            request.post("/othermodel/filechange", formData)
-                .catch((reason) => {
-                        console.error(`error: ${JSON.stringify(reason)}`)
-                    }
-                )
-                .then((res) => {
+            let files = myfile.files;
+            let file = files[0];
+            let fileName = file.name;
+            let index = fileName.lastIndexOf(".");
+            let oldIndex = this.$route.query.filePath.lastIndexOf(".");
+            if (index != -1) {
+                let suffix = fileName.substr(index + 1).toLowerCase();
+                let oldSuffix = this.$route.query.filePath.substr(oldIndex + 1).toLowerCase();
+                if (suffix != oldSuffix) {
+                    this.$alert("请上传相同格式模型");
+                    return;
+                }
+            }
+            this.upload_file = file;
+            this.handleUpload();
+        },
+        handleUpload() {
+            console.log(`file: ${JSON.stringify(this.upload_file)}`);
+            const fileChunks = this.makeChunks(this.upload_file);
+            // 重置上传进度的状态
+            this.allChunksUploaded = false;
+            this.uploadProcess = 0;
 
-                    this.$alert("上传成功");
-                    location.reload();
-                    console.log(res);
-                });
-        }
+            // 生成uid,传递给后端,后端根据uid对子文件块进行合并
+            const fileUid = this.randomId();
+            console.log(fileChunks.chunks.length);
+            for (var k in fileChunks.chunks) {
+                var chunk = fileChunks.chunks[k];
+                const formData = new FormData();
+                formData.append("index", k + "");
+                formData.append("chunk", fileChunks.file.slice(chunk.start, chunk.end));
+                formData.append("name", fileChunks.file.name);
+                formData.append("chunksLength", fileChunks.chunks.length + "");
+                formData.append("uid", fileUid);
+                formData.append("output_list", this.output_list);
+                formData.append("id", this.modelId);
 
-        // location.reload();
-    },
-    returnLink()
-      {
-        //指定跳转地址
-        this.$router.push('/userinfo');
-      },
-      handleSizeChange(size) {
+                console.log("test");
+                console.log(this.modelId);
+
+                request.post("/othermodel/filechange", formData)
+                    .catch((reason) => {
+                            console.error(`error: ${JSON.stringify(reason)}`)
+                        }
+                    )
+                    .then((res) => {
+
+                        this.$alert("上传成功");
+                        location.reload();
+                        console.log(res);
+                    });
+            }
+
+            // location.reload();
+        },
+        returnLink() {
+            //指定跳转地址
+            this.$router.push('/userinfo');
+        },
+        handleSizeChange(size) {
             // 每页显示的数据条数发生变化时触发
             this.pageSize = size;
             this.currentPage = 1; // 重置当前页码为第一页
@@ -283,7 +325,7 @@
                 this.$alert("模型已部署");
                 return;
             } else {
-                this.modelState="已上线";
+                this.modelState = "已上线";
                 request.post('/model/changeState',
                     {
                         modelid: this.modelNo,
@@ -300,7 +342,7 @@
                 this.$alert("模型已暂停使用");
                 return;
             } else {
-                this.modelState="暂停使用";
+                this.modelState = "暂停使用";
                 console.log(this.modelNo)
                 request.post('/model/changeState',
                     {
@@ -325,91 +367,143 @@
         closeDialog() {
             this.dialogVisible = false;
         },
-        confirmModelName() {
+        confirmModelChange() {
             if (this.inputValue !== '') {
-            this.modelName=this.inputValue;
-            
-            console.log(this.modelName);
-            console.log(this.modelNo);
-            request.post('model/changeModelName',
-                {
-                    modelName:this.modelName,
-                    modelNo:this.modelNo,
+                this.modelName = this.inputValue;
+
+                console.log(this.modelName);
+                console.log(this.modelNo);
+                request.post('model/changeModelName',
+                    {
+                        modelName: this.modelName,
+                        modelNo: this.modelNo,
+                    }
+                );
+                //this.$message.success('修改成功');
+                //this.closeDialog(); // 关闭窗口
+            } else {
+                //this.$message.error('模型名称不可以为空');
+            }
+
+            let myfile = this.$refs.myfile;
+            if (myfile.files.length > 0) {
+
+                let files = myfile.files;
+                let file = files[0];
+                let fileName = file.name;
+                let index = fileName.lastIndexOf(".");
+                let oldIndex = this.$route.query.filePath.lastIndexOf(".");
+
+                if (index != -1) {
+                    let suffix = fileName.substr(index + 1).toLowerCase();
+                    if (suffix != this.model_type) {
+                        this.$alert("请上传正确格式文件!");
+                    }
                 }
-            );
-            this.$message.success('修改成功');
-            this.closeDialog(); // 关闭窗口
+                // if (index != -1) {
+                //     let suffix = fileName.substr(index + 1).toLowerCase();
+                //     let oldSuffix = this.$route.query.filePath.substr(oldIndex + 1).toLowerCase();
+                //     if (suffix != oldSuffix) {
+                //         this.$alert("请上传相同格式模型");
+                //         return;
+                //     }
+                // }
+                this.upload_file = file;
+                this.handleUpload();
             }
-            else{
-                this.$message.error('模型名称不可以为空');
+
+            if (this.inputValue !== '' || myfile.files.length > 0) {
+                this.$alert("修改成功");
+                this.closeDialog(); // 关闭窗口
             }
+
         },
+        gotoModify() {
+            this.$router.push({
+                path: '/modelModify',
+                query: {
+                    modelId: this.modelId,
+                    modelNo: this.modelNo,
+                    modelName: this.modelName,
+                    modelType: this.modelType,
+                    modelState: this.modelState,
+                    filePath: this.filePath,
+                }
+            })
+        }
     },
     fillter: {},
-  }
-  </script>
-  
-  <style scoped>
-  /* 竖线 */
-  .line{
+}
+</script>
+
+<style scoped>
+/* 竖线 */
+.line {
     float: left;
     width: 0.1em;
     height: 19.5em;
     margin-right: 1em;
     margin-left: 0em;
-    background:#000000;
-  }
-  
-  .button {
-      background-color: white; 
-      border: none;
-      color: black;
-      padding: 15px 32px;
-      text-align: center;
-      text-decoration: none;
-      display: inline-block;
-      font-size: 16px;
-      width:180px;
-      height:50px;
-      font-weight: normal
-  }
-  
-  .buttonselected {
-      background-color: white; 
-      border: none;
-      color: black;
-      padding: 15px 32px;
-      text-align: center;
-      text-decoration: none;
-      display: inline-block;
-      font-size: 18px;
-      width:180px;
-      height:50px;
-      font-weight: 900
-  }
-  .vertical-center {
+    background: #000000;
+}
+
+.button {
+    background-color: white;
+    border: none;
+    color: black;
+    padding: 15px 32px;
+    text-align: center;
+    text-decoration: none;
+    display: inline-block;
+    font-size: 16px;
+    width: 180px;
+    height: 50px;
+    font-weight: normal
+}
+
+.buttonselected {
+    background-color: white;
+    border: none;
+    color: black;
+    padding: 15px 32px;
+    text-align: center;
+    text-decoration: none;
+    display: inline-block;
+    font-size: 18px;
+    width: 180px;
+    height: 50px;
+    font-weight: 900
+}
+
+.vertical-center {
     display: flex;
     align-items: center;
-  }
-  .el-menu-vertical-demo{
+}
+
+.el-menu-vertical-demo {
     font-weight: bold;
-  }
-  .line{
+}
+
+.line {
     float: left;
     width: 0.1em;
     height: 19.5em;
     margin-right: 1em;
     margin-left: 0em;
-    background:#000000;
-  }
-  /deep/ .el-table th {
-  /* 样式设置 */
-  background: #f2f2f2;
-  color: #333;
+    background: #000000;
 }
-.upper_bottom_bar{
-    display:flex;
+
+/deep/ .el-table th {
+    /* 样式设置 */
+    background: #f2f2f2;
+    color: #333;
+}
+
+.upper_bottom_bar {
+    display: flex;
+}
+
+.container {
 }
-  .container {  }
-  </style>
+</style>
   

+ 1 - 1
src/views/system/modelInfo.vue

@@ -138,7 +138,7 @@
     beforeMount() {},
     mounted() 
     {
-        cooperatorProductList().then((res) => {
+        cooperatorProductList(this.currentPage,this.pagesize).then((res) => {
                 if (res.data.cooperator_Product_List) {
                     this.cooperatorProductData = res.data.cooperator_Product_List;
                     console.log(this.cooperatorProductData);

+ 353 - 0
src/views/system/modelModify.vue

@@ -0,0 +1,353 @@
+<template>
+    <div class="container" style="min-height: 100%; padding-bottom: 100px;">
+
+        <el-container>
+            <el-aside width="250px">
+                <el-menu
+                        default-active="1"
+                        class="el-menu-vertical-demo"
+
+                >
+                    <el-menu-item @click="gotolink2" class="vertical-center" index="1">
+                        <i class="el-icon-location"></i>
+                        <span slot="title">模型列表</span>
+                    </el-menu-item>
+                </el-menu>
+            </el-aside>
+            <!-- <div class="line" /> -->
+            <el-main style="height: 80vh;">
+                <el-form class="other_model_view" ref="form" label-width="70px">
+                    <el-form-item label="模型名称" width="150px">
+                        <el-input v-model="inputValue" style="width:200px"></el-input>
+                    </el-form-item>
+
+                    <el-form-item label="模型类型" width="100px">
+                        <el-select v-model="model_type" placeholder="选择模型类型">
+
+                            <el-option v-for='item in type_list' :key="item.key" :label="item.label"
+                                       :value="item.key"
+                            />
+                        </el-select>
+                    </el-form-item>
+
+                    <el-form-item v-if="model_type=='3'" label="端口" width="100px">
+                        <el-input v-model="port" style="width:150px"></el-input>
+                    </el-form-item>
+
+
+                    <el-form-item v-if="model_type=='3'" label="url地址" width="100px">
+                        <el-input v-model="url_ad" style="width:150px"></el-input>
+                    </el-form-item>
+
+                    <el-form-item label="当前文件" width="150px">
+                        <el-input v-model="filePath" :readonly="true" style="width:300px"></el-input>
+                    </el-form-item>
+
+                    <el-form-item v-if="model_type!='4'" label="选择文件" width="200px">
+                        <input type="file" ref="myfile">
+                        <span>  文件大小限制:小于50M </span>
+                    </el-form-item>
+                </el-form>
+                <div class="upper_bottom_bar" style="margin-top: 20px">
+                    <el-button round type="success" size="medium" style="margin-right: 10px;" @click="confirmModel">
+                        确认修改
+                    </el-button>
+                    <el-button round type="primary" size="medium" style="margin-right: 10px;" @click="returnLink">返回
+                    </el-button>
+                </div>
+            </el-main>
+        </el-container>
+    </div>
+</template>
+
+<script>
+import {
+    getList,
+    userInfo,
+    modelSubmit,
+} from '@/api/index.js'
+import store from "@/store";
+import request from '@/utils/request.js'
+import Axios, {AxiosResponse} from "axios";
+// import { randomId } from '../../api';
+export default {
+    name: "mxpz",
+
+    data() {
+        return {
+            modelId: this.$route.query.modelId,
+            modelNo: this.$route.query.modelNo,
+            modelName: this.$route.query.modelName,
+            modelType: this.$route.query.modelType,
+            modelState: this.$route.query.modelState,
+            filePath: this.$route.query.filePath,
+            inputValue: this.$route.query.modelName,
+            upload_file: "",
+            allChunksUploaded: false,
+            uploadProcess: 0,
+            chunkSize: 50 * 1024 * 1024,
+            port: "",
+            url_ad: "",
+            model_name: "",
+            model_type: "",
+            output_list: [],
+            type_list: [
+                {
+                    key: 1,
+                    label: "jar包"
+                },
+                {
+                    key: 2,
+                    label: "python包"
+                },
+                {
+                    key: 3,
+                    label: "http服务"
+                },
+
+            ],
+            suffix_idx:["jar","py","war"],
+
+            // model_type: this.type_list[this.$route.query.modelType - 1].label,
+        }
+    },
+    mounted() {
+        this.model_type = this.type_list[this.$route.query.modelType - 1].key;
+    },
+    methods: {
+        confirmModel() {
+            const isModifyName=this.inputValue !== '' && this.inputValue !==this.$route.query.modelName;
+            if (isModifyName) {
+                this.modelName = this.inputValue;
+
+                request.post('model/changeModelName',
+                    {
+                        modelName: this.modelName,
+                        modelNo: this.modelNo,
+                    }
+                );
+            }
+
+            let myfile = this.$refs.myfile;
+            const isModifyFile=myfile.files.length > 0;
+            if (isModifyFile) {
+
+                if (this.model_type == "") {
+                    this.$alert("请选择模型类型");
+                    return;
+                }
+
+
+                let files = myfile.files;
+                let file = files[0];
+                let fileName = file.name;
+                console.log("filename: %s",fileName);
+                let index = fileName.lastIndexOf(".");
+                if (index != -1) {
+                    let suffix = fileName.substr(index + 1).toLowerCase();
+                    const type = this.type_list.find(item => item.key === this.model_type);
+
+                    if (suffix != this.suffix_idx[type.key-1]) {
+                        this.$alert("请上传正确格式文件!");
+                        return;
+                    }
+                }
+                this.upload_file = file;
+                this.handleUpload();
+            }
+
+            if(!isModifyName&&!isModifyFile){
+                this.$alert("请输入模型名称或上传文件");
+                return;
+            }
+
+            this.$message.success('修改成功');
+            this.$router.push({
+                path: '/modelEdit',
+                query: {
+                    modelId: this.modelId,
+                    modelNo: this.modelNo,
+                    modelName: this.modelName,
+                    modelType: this.modelType,
+                    modelState: this.modelState,
+                    filePath: this.filePath,
+                }
+            })
+        },
+        returnLink() {
+            //指定跳转地址
+            this.$router.push({
+                path: '/modelEdit',
+                query: {
+                    modelId: this.modelId,
+                    modelNo: this.modelNo,
+                    modelName: this.modelName,
+                    modelType: this.modelType,
+                    modelState: this.modelState,
+                    filePath: this.filePath,
+                }
+            })
+        },
+        getFile(event) {
+            let file = event.target.files[0];
+
+        },
+        outputSetup() {
+            //这个地方应该有dialog显示入参类型
+        },
+        submit_model() {
+
+            if (this.model_name == "") {
+                this.$alert("请输入模型名称");
+                return;
+            }
+
+            if (this.model_type == "") {
+                this.$alert("请选择模型类型");
+                return;
+            }
+
+
+            let myfile = this.$refs.myfile;
+            let files = myfile.files;
+            let file = files[0];
+            let fileName = file.name;
+            let index = fileName.lastIndexOf(".");
+            if (index != -1) {
+                let suffix = fileName.substr(index + 1).toLowerCase();
+                if (suffix != 'jar' && suffix != 'py' && suffix != 'war') {
+                    this.$alert("请上传正确格式文件!后缀为jar/py/war");
+                }
+            }
+            this.upload_file = file;
+            this.handleUpload();
+            this.$router.push('/userinfo');
+        },
+        makeChunks(file) {
+            const fileChunks = {
+                file,
+                chunks: [],
+            };
+            if (file.size < this.chunkSize) {
+                fileChunks.chunks.push({start: 0, end: file.size});
+                return fileChunks;
+            }
+            let chunksLength;
+            if (file.size % this.chunkSize === 0) {
+                chunksLength = Math.round(Math.floor(file.size / this.chunkSize));
+            } else {
+                chunksLength = Math.round(Math.floor(file.size / this.chunkSize)) + 1;
+            }
+            let leftSize = file.size;
+            while (leftSize > 0) {
+                const start = fileChunks.chunks.length * this.chunkSize;
+                const end =
+                    start + this.chunkSize >= file.size
+                        ? file.size
+                        : start + this.chunkSize;
+                leftSize -= end - start;
+                fileChunks.chunks.push({start, end});
+            }
+            return fileChunks;
+        },
+        randomId() {
+            let str = "";
+            for (let i = 0; i < 4; i++) {
+                str += Math.random()
+                    .toString()
+                    .replace(/\./, "");
+            }
+            str = "uid" + str;
+            // 取前32位随机字符,不足补0
+            return str.length >= 32
+                ? str.substr(0, 32)
+                : str + repeat("0", 32 - str.length);
+        },
+        handleUpload() {
+            console.log(`file: ${JSON.stringify(this.upload_file)}`);
+            const fileChunks = this.makeChunks(this.upload_file);
+            // 重置上传进度的状态
+            this.allChunksUploaded = false;
+            this.uploadProcess = 0;
+
+            // 生成uid,传递给后端,后端根据uid对子文件块进行合并
+            const fileUid = this.randomId();
+            console.log(fileChunks.chunks.length);
+            for (var k in fileChunks.chunks) {
+                var chunk = fileChunks.chunks[k];
+                const formData = new FormData();
+                formData.append("index", k + "");
+                formData.append("chunk", fileChunks.file.slice(chunk.start, chunk.end));
+                formData.append("name", fileChunks.file.name);
+                formData.append("chunksLength", fileChunks.chunks.length + "");
+                formData.append("uid", fileUid);
+                formData.append("output_list", this.output_list);
+                formData.append("id", this.modelId);
+
+                if (this.model_type == "3") {
+                    formData.append("model_name", this.model_name + ";" + this.port + this.url_ad);
+                } else {
+                    formData.append("model_name", this.model_name);
+                }
+
+                console.log("test");
+                console.log(this.modelId);
+
+                request.post("/othermodel/filechange", formData)
+                    .catch((reason) => {
+                            console.error(`error: ${JSON.stringify(reason)}`)
+                        }
+                    )
+                    .then((res) => {
+
+                        this.$alert("上传成功");
+                        // location.reload();
+                        console.log(res);
+                    });
+            }
+
+            // location.reload();
+        }
+
+    }
+}
+</script>
+
+<style scoped>
+.top_show {
+    margin-bottom: 30px;
+}
+
+.model_add_button {
+    float: right;
+    margin-left: 10px
+}
+
+.txt_show {
+    margin-left: 10px;
+}
+
+.el-select {
+    width: 200px;
+    margin-right: 10px;
+    margin-bottom: 10px
+}
+
+.line {
+    float: left;
+    width: 0.1em;
+    height: 19.5em;
+    margin-right: 1em;
+    margin-left: 0em;
+    background: #000000;
+}
+
+.upper_bottom_bar {
+    display: flex;
+}
+
+.result_view {
+
+    margin-top: 20px
+}
+</style>

+ 289 - 287
src/views/system/otherModel.vue

@@ -1,318 +1,320 @@
 <template>
-   <div class="container" style="min-height: 100%; padding-bottom: 100px;">
-
-  <el-container>
-    <el-aside width="250px">
-        <el-menu
-        default-active="1"
-        class="el-menu-vertical-demo"
-        
-        >
-        <el-menu-item @click="gotolink2" class="vertical-center" index="1">
-            <i class="el-icon-location"></i>
-            <span slot="title">模型列表</span>
-        </el-menu-item>
-        </el-menu>
-    </el-aside>
-    <!-- <div class="line" /> -->
-  <el-main  style="height: 80vh;">
-    <el-form  class="other_model_view" ref="form"  label-width="70px">
-      <el-form-item label="模型名称" width="150px">
-          <el-input v-model="model_name" style="width:200px"></el-input>
-      </el-form-item>
-
-      <el-form-item label="模型类型" width="100px">
-          <el-select v-model="model_type" placeholder="选择模型类型">
-                              <!-- <el-option key="1" label="REC飞行计划" value="Rec_fly"></el-option>
-                              <el-option key="2" label="REC管制操作" value="Rec_control"></el-option>
-                              <el-option key="3" label="自动化系统日志" value="log"></el-option> -->
-                  <el-option v-for='item in type_list' :key="item.key" :label="item.label"
-                  :value="item.key"
-                  />
-          </el-select>
-
-      </el-form-item>
-
-<!--      <el-form-item label="输入参数" width="100px">-->
-<!--          <span> 自定义字段的json类型文件路径 </span>-->
-
-<!--      </el-form-item>-->
-
-
-<!--      <el-form-item label="输出参数" width="100px">-->
-<!--                        <el-button-->
-<!--                            type="text"-->
-<!--                            class="red"-->
-<!--                            @click="outputSetup()"-->
-<!--                        >新增输出类型</el-button>    -->
-<!--      </el-form-item>-->
-
-      
-
-
-
-      <el-form-item v-if="model_type=='3'" label="端口" width="100px">
-              <el-input v-model="port" style="width:150px"></el-input>
-      </el-form-item>
-
-      
-      <el-form-item v-if="model_type=='3'" label="url地址" width="100px">
-              <el-input v-model="url_ad" style="width:150px"></el-input>
-      </el-form-item>
-      
-      <el-form-item  v-if="model_type!='4'" label="选择文件" width="200px">
-            <input type="file" ref="myfile">
-            <span>  文件大小限制:小于50M </span>
-        <!-- <span>{{
-          allChunksUploaded ? "完成" : "上传进度:" + uploadProcess + "%"
-        }}</span> -->
-      </el-form-item>
-  </el-form>
-  <div class = "upper_bottom_bar" style="margin-top: 20px">
-    <el-button round  type="success"  size="medium" style="margin-right: 10px;" @click="submit_model()">提交模型</el-button>
-    <el-button round type="primary" size="medium" style="margin-right: 10px;" @click="returnLink" >返回</el-button>
-  </div>
-</el-main>
-  </el-container>
-  </div>
+    <div class="container" style="min-height: 100%; padding-bottom: 100px;">
+
+        <el-container>
+            <el-aside width="250px">
+                <el-menu
+                        default-active="1"
+                        class="el-menu-vertical-demo"
+
+                >
+                    <el-menu-item @click="gotolink2" class="vertical-center" index="1">
+                        <i class="el-icon-location"></i>
+                        <span slot="title">模型列表</span>
+                    </el-menu-item>
+                </el-menu>
+            </el-aside>
+            <!-- <div class="line" /> -->
+            <el-main style="height: 80vh;">
+                <el-form class="other_model_view" ref="form" label-width="70px">
+                    <el-form-item label="模型名称" width="150px">
+                        <el-input v-model="model_name" style="width:200px"></el-input>
+                    </el-form-item>
+
+                    <el-form-item label="模型编号" width="150px">
+                        <el-input v-model="new_model_no" :readonly="true" style="width:200px"></el-input>
+                    </el-form-item>
+
+                    <el-form-item label="模型类型" width="100px">
+                        <el-select v-model="model_type" placeholder="选择模型类型">
+                            <!-- <el-option key="1" label="REC飞行计划" value="Rec_fly"></el-option>
+                            <el-option key="2" label="REC管制操作" value="Rec_control"></el-option>
+                            <el-option key="3" label="自动化系统日志" value="log"></el-option> -->
+                            <el-option v-for='item in type_list' :key="item.key" :label="item.label"
+                                       :value="item.key"
+                            />
+                        </el-select>
+
+                    </el-form-item>
+
+                    <!--      <el-form-item label="输入参数" width="100px">-->
+                    <!--          <span> 自定义字段的json类型文件路径 </span>-->
+
+                    <!--      </el-form-item>-->
+
+
+                    <!--      <el-form-item label="输出参数" width="100px">-->
+                    <!--                        <el-button-->
+                    <!--                            type="text"-->
+                    <!--                            class="red"-->
+                    <!--                            @click="outputSetup()"-->
+                    <!--                        >新增输出类型</el-button>    -->
+                    <!--      </el-form-item>-->
+
+
+                    <el-form-item v-if="model_type=='3'" label="端口" width="100px">
+                        <el-input v-model="port" style="width:150px"></el-input>
+                    </el-form-item>
+
+
+                    <el-form-item v-if="model_type=='3'" label="url地址" width="100px">
+                        <el-input v-model="url_ad" style="width:150px"></el-input>
+                    </el-form-item>
+
+                    <el-form-item v-if="model_type!='4'" label="选择文件" width="200px">
+                        <input type="file" ref="myfile">
+                        <span>  文件大小限制:小于50M </span>
+                        <!-- <span>{{
+                          allChunksUploaded ? "完成" : "上传进度:" + uploadProcess + "%"
+                        }}</span> -->
+                    </el-form-item>
+                </el-form>
+                <div class="upper_bottom_bar" style="margin-top: 20px">
+                    <el-button round type="success" size="medium" style="margin-right: 10px;" @click="submit_model()">
+                        提交模型
+                    </el-button>
+                    <el-button round type="primary" size="medium" style="margin-right: 10px;" @click="returnLink">返回
+                    </el-button>
+                </div>
+            </el-main>
+        </el-container>
+    </div>
 </template>
 
 <script>
 import {
-  getList,
-  userInfo,
-  modelSubmit,
+    getList,
+    userInfo,
+    modelSubmit,
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
-import Axios, { AxiosResponse } from "axios";
+import Axios, {AxiosResponse} from "axios";
 // import { randomId } from '../../api';
 export default {
-  name: "mxpz",
-  
-  data() {
-    return {
-      upload_file:"",
-      allChunksUploaded:false,
-      uploadProcess:0,
-      chunkSize:50*1024*1024,
-      port:"",
-      url_ad:"",
-      model_name:"",
-      model_type:"",
-      output_list:[
-
-      ],
-      type_list:[
-        {
-          key:1,
-           label:"jar包"
+    name: "mxpz",
+
+    data() {
+        return {
+            upload_file: "",
+            allChunksUploaded: false,
+            uploadProcess: 0,
+            chunkSize: 50 * 1024 * 1024,
+            port: "",
+            url_ad: "",
+            model_name: "",
+            model_type: "",
+            model_no: "",
+            new_model_no: 0,
+            output_list: [],
+            type_list: [
+                {
+                    key: 1,
+                    label: "jar包"
+                },
+                {
+                    key: 2,
+                    label: "python包"
+                },
+                {
+                    key: 3,
+                    label: "http服务"
+                },
+                {
+                    key: 4,
+                    label: "空模型"
+                },
+            ],
+        }
+    },
+    mounted() {
+        request.get('model/getModelNo').then(res => {
+            this.model_no = res.data.model_no;
+            this.new_model_no = parseInt(this.model_no) + 1;
+        });
+    },
+    methods: {
+        returnLink() {
+            //指定跳转地址
+            this.$router.push('/userinfo');
+        },
+        getFile(event) {
+            let file = event.target.files[0];
+
         },
-               {
-          key:2,
-           label:"python包"
+        outputSetup() {
+            //这个地方应该有dialog显示入参类型
+        },
+        submit_model() {
+
+            if (this.model_name == "") {
+                this.$alert("请输入模型名称");
+                return;
+            }
+
+            if (this.model_type == "") {
+                this.$alert("请选择模型类型");
+                return;
+            }
+
+
+            let myfile = this.$refs.myfile;
+            let files = myfile.files;
+            let file = files[0];
+            let fileName = file.name;
+            let index = fileName.lastIndexOf(".");
+            if (index != -1) {
+                let suffix = fileName.substr(index + 1).toLowerCase();
+                if (suffix != 'jar' && suffix != 'py' && suffix != 'war') {
+                    this.$alert("请上传正确格式文件!后缀为jar/py/war");
+                }
+            }
+            this.upload_file = file;
+            this.handleUpload();
+            this.$router.push('/userinfo');
         },
-        {
-          key:3,
-           label:"http服务"
+        makeChunks(file) {
+            const fileChunks = {
+                file,
+                chunks: [],
+            };
+            if (file.size < this.chunkSize) {
+                fileChunks.chunks.push({start: 0, end: file.size});
+                return fileChunks;
+            }
+            let chunksLength;
+            if (file.size % this.chunkSize === 0) {
+                chunksLength = Math.round(Math.floor(file.size / this.chunkSize));
+            } else {
+                chunksLength = Math.round(Math.floor(file.size / this.chunkSize)) + 1;
+            }
+            let leftSize = file.size;
+            while (leftSize > 0) {
+                const start = fileChunks.chunks.length * this.chunkSize;
+                const end =
+                    start + this.chunkSize >= file.size
+                        ? file.size
+                        : start + this.chunkSize;
+                leftSize -= end - start;
+                fileChunks.chunks.push({start, end});
+            }
+            return fileChunks;
         },
-        {
-          key:4,
-          label:"空模型"
+        randomId() {
+            let str = "";
+            for (let i = 0; i < 4; i++) {
+                str += Math.random()
+                    .toString()
+                    .replace(/\./, "");
+            }
+            str = "uid" + str;
+            // 取前32位随机字符,不足补0
+            return str.length >= 32
+                ? str.substr(0, 32)
+                : str + repeat("0", 32 - str.length);
         },
-      ],
-    }
-  },
-  mounted() {
-  },
-  methods: {
-    returnLink()
-      {
-        //指定跳转地址
-        this.$router.push('/userinfo');
-      },
-    getFile(event)
-     {
-        let file = event.target.files[0];
-       
-    },
-    outputSetup()
-    {
-          //这个地方应该有dialog显示入参类型
-    },
-    submit_model()
-    {
-     
-      if(this.model_name=="")
-      {
-        this.$alert("请输入模型名称");
-        return;
-      }
-
-      if(this.model_type=="")
-      {
-         this.$alert("请选择模型类型");
-         return;
-      }
-      
-
-      let myfile = this.$refs.myfile;
-      let files = myfile.files;
-      let file = files[0];
-      let fileName = file.name;
-        let index = fileName.lastIndexOf(".");
-        if (index != -1) {
-            let suffix = fileName.substr(index + 1).toLowerCase();
-            if (suffix != 'jar' &&  suffix != 'py' && suffix!='war' ) {
-                this.$alert("请上传正确格式文件!后缀为jar/py/war");
+        handleUpload() {
+            console.log(`file: ${JSON.stringify(this.upload_file)}`);
+            const fileChunks = this.makeChunks(this.upload_file);
+            // 重置上传进度的状态
+            this.allChunksUploaded = false;
+            this.uploadProcess = 0;
+            // 计算上传进度
+            // const calUploadProcess = (): number => {
+            //   let uploadedCount = 0;
+            //   _.each(allChunksUploadStatus, (item) => {
+            //     if (item) uploadedCount++;
+            //   });
+            //   return new Number(
+            //     ((uploadedCount * 100) / allChunksUploadStatus.length).toFixed(0)
+            //   ).valueOf();
+            // };
+            // 生成uid,传递给后端,后端根据uid对子文件块进行合并
+            const fileUid = this.randomId();
+            console.log(fileChunks.chunks.length);
+            for (var k in fileChunks.chunks) {
+                var chunk = fileChunks.chunks[k];
+                const formData = new FormData();
+                formData.append("index", k + "");
+                formData.append("chunk", fileChunks.file.slice(chunk.start, chunk.end));
+                formData.append("name", fileChunks.file.name);
+                formData.append("chunksLength", fileChunks.chunks.length + "");
+                formData.append("uid", fileUid);
+                formData.append("output_list", this.output_list);
+
+                if (this.model_type == "3") {
+                    formData.append("model_name", this.model_name + ";" + this.port + this.url_ad);
+                } else {
+                    formData.append("model_name", this.model_name);
+                }
+                formData.append("model_type", this.model_type);
+                formData.append("model_no",this.new_model_no.toString());
+                request.post("/othermodel/fileupload", formData)
+                    .catch((reason) => {
+                            console.error(`error: ${JSON.stringify(reason)}`)
+                        }
+                    )
+                    .then((res) => {
+                        // if (typeof res === "object") {
+                        //   const data = res.data;
+                        //   if (isChunkUploadResult(data)) {
+                        //     if (data.status) {
+                        //       allChunksUploadStatus[index] = true;
+                        //       // 更新上传百分比
+                        //       this.uploadProcess = calUploadProcess();
+                        //       // 更新上传状态
+                        //       if (this.uploadProcess === 100) this.allChunksUploaded = true;
+                        //     }
+                        //   }
+                        // }
+                        this.$alert("上传成功");
+                        location.reload();
+                        console.log(res);
+                    });
             }
-        }
-      this.upload_file=file;
-      this.handleUpload();
-      this.$router.push('/userinfo');
-    },
-    makeChunks(file) {
-    const fileChunks={
-      file,
-      chunks: [],
-    };
-    if (file.size < this.chunkSize) {
-      fileChunks.chunks.push({ start: 0, end: file.size });
-      return fileChunks;
-    }
-    let chunksLength;
-    if (file.size % this.chunkSize === 0) {
-      chunksLength = Math.round(Math.floor(file.size / this.chunkSize));
-    } else {
-      chunksLength = Math.round(Math.floor(file.size / this.chunkSize)) + 1;
-    }
-    let leftSize = file.size;
-    while (leftSize > 0) {
-      const start = fileChunks.chunks.length * this.chunkSize;
-      const end =
-        start + this.chunkSize >= file.size
-          ? file.size
-          : start + this.chunkSize;
-      leftSize -= end - start;
-      fileChunks.chunks.push({ start, end });
-    }
-    return fileChunks;
-  },
-  randomId() {
-    let str = "";
-    for (let i = 0; i < 4; i++) {
-      str += Math.random()
-        .toString()
-        .replace(/\./, "");
-    }
-    str = "uid" + str;
-    // 取前32位随机字符,不足补0
-    return str.length >= 32
-      ? str.substr(0, 32)
-      : str + repeat("0", 32 - str.length);
-  },
-  handleUpload() {
-    console.log(`file: ${JSON.stringify(this.upload_file)}`);
-    const fileChunks = this.makeChunks(this.upload_file);
-    // 重置上传进度的状态
-    this.allChunksUploaded = false;
-    this.uploadProcess = 0;
-    // 计算上传进度
-    // const calUploadProcess = (): number => {
-    //   let uploadedCount = 0;
-    //   _.each(allChunksUploadStatus, (item) => {
-    //     if (item) uploadedCount++;
-    //   });
-    //   return new Number(
-    //     ((uploadedCount * 100) / allChunksUploadStatus.length).toFixed(0)
-    //   ).valueOf();
-    // };
-    // 生成uid,传递给后端,后端根据uid对子文件块进行合并
-    const fileUid =this.randomId();
-    console.log(fileChunks.chunks.length);
-    for(var k in fileChunks.chunks)
-    {
-       var chunk=fileChunks.chunks[k];
-      const formData = new FormData();
-      formData.append("index", k + "");
-      formData.append("chunk", fileChunks.file.slice(chunk.start, chunk.end));
-      formData.append("name", fileChunks.file.name);
-      formData.append("chunksLength", fileChunks.chunks.length + "");
-      formData.append("uid", fileUid);
-      formData.append("output_list", this.output_list)
-      if(this.model_type=="3")
-      {
-        formData.append("model_name",this.model_name+";"+this.port+this.url_ad);
-      }
-      else 
-      {
-        formData.append("model_name",this.model_name);
-      }
-      formData.append("model_type",this.model_type);
-      request.post("/othermodel/fileupload", formData)
-        .catch((reason) => 
-        {
-        console.error(`error: ${JSON.stringify(reason)}`)
-        }
-        )
-        .then((res) => {
-          // if (typeof res === "object") {
-          //   const data = res.data;
-          //   if (isChunkUploadResult(data)) {
-          //     if (data.status) {
-          //       allChunksUploadStatus[index] = true;
-          //       // 更新上传百分比
-          //       this.uploadProcess = calUploadProcess();
-          //       // 更新上传状态
-          //       if (this.uploadProcess === 100) this.allChunksUploaded = true;
-          //     }
-          //   }
-          // }
-          this.$alert("上传成功");
-          location.reload();
-          console.log(res);
-        });
-    }
 
-    // location.reload();
-  }
+            // location.reload();
+        }
 
-  }
+    }
 }
 </script>
 
 <style scoped>
-.top_show
-{
+.top_show {
     margin-bottom: 30px;
 }
-.model_add_button{
-float: right;
-margin-left:10px
+
+.model_add_button {
+    float: right;
+    margin-left: 10px
 }
-.txt_show
-{
-  margin-left: 10px;
+
+.txt_show {
+    margin-left: 10px;
 }
-.el-select
-{
-width:200px; 
-margin-right:10px; 
-margin-bottom:10px
+
+.el-select {
+    width: 200px;
+    margin-right: 10px;
+    margin-bottom: 10px
 }
-.line{
-  float: left;
-  width: 0.1em;
-  height: 19.5em;
-  margin-right: 1em;
-  margin-left: 0em;
-  background:#000000;
+
+.line {
+    float: left;
+    width: 0.1em;
+    height: 19.5em;
+    margin-right: 1em;
+    margin-left: 0em;
+    background: #000000;
 }
-.upper_bottom_bar{
-    display:flex;
+
+.upper_bottom_bar {
+    display: flex;
 }
-.result_view{
 
-  margin-top:20px
+.result_view {
+
+    margin-top: 20px
 }
 </style>

+ 1 - 2
src/views/system/userinfo.vue

@@ -200,12 +200,11 @@ export default {
                     this.modelData = res.data.modelData;
                     this.loadData();
                     // this.modelShowData = this.modelData;
-                    console.log(this.modelData);
                 }
             }
         );
 
-        cooperatorProductList().then((res) => {
+        cooperatorProductList(this.currentPage,this.pagesize).then((res) => {
                 if (res.data.cooperator_Product_List) {
                     this.cooperatorProductData = res.data.cooperator_Product_List;
                     console.log(this.cooperatorProductData);