|
@@ -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>
|
|
|
|