|
@@ -42,63 +42,52 @@
|
|
|
<div class="line-between-divs"></div>
|
|
|
<div class="model_table">
|
|
|
<el-table class="info-table" :data="modelShowData" @row-click="showDetail" stripe border style="width: 100%">
|
|
|
- <el-table-column align="center" label="模型名称" :width="200">
|
|
|
+ <el-table-column align="center" label="模型名称" >
|
|
|
<template v-slot="{row}">
|
|
|
<span
|
|
|
>{{ row.modelName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="模型编号" :width="150">
|
|
|
+ <el-table-column align="center" label="模型编号" >
|
|
|
<template v-slot="{row}">
|
|
|
<span>{{ row.modelNo }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="状态" :width="120">
|
|
|
+ <el-table-column align="center" label="状态" >
|
|
|
<template v-slot="{row}">
|
|
|
<span>{{ row.status }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column align="center" label="模型类型" :width="200">
|
|
|
+ <el-table-column align="center" label="模型类型" >
|
|
|
<template v-slot="{row}">
|
|
|
<span>{{ type_list[row.modelType] }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column align="center" label="创建时间" :width="250">
|
|
|
+ <el-table-column align="center" prop="date" label="创建时间" >
|
|
|
<template v-slot="{row}">
|
|
|
<span>{{ row.createTime }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column align="center" label="操作" :width="150">
|
|
|
+ <el-table-column align="center" label="操作" >
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
-
|
|
|
- class="red"
|
|
|
- @click.stop="edit(scope, scope.row)"
|
|
|
- >编辑
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- class="red"
|
|
|
- @click.stop="modelDelet(scope, scope.row)"
|
|
|
- >删除
|
|
|
- </el-button>
|
|
|
+ <el-button size="mini" type="primary" @click.stop="edit(scope, scope.row)">编辑</el-button>
|
|
|
+ <el-button size="mini" type="danger" @click.stop="modelDelet(scope, scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<el-pagination background
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
- :page-sizes="[10, 20, 30, 40]"
|
|
|
- :page-size="pageSize"
|
|
|
- layout="total,jumper,prev, pager, next,sizes"
|
|
|
- :total="totalRows"
|
|
|
- ></el-pagination>
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-size="pagesize"
|
|
|
+ :page-sizes="[5,10,15]"
|
|
|
+ layout="total,jumper,prev, pager, next,sizes"
|
|
|
+ :total=totalSize>
|
|
|
+ </el-pagination>
|
|
|
|
|
|
</div>
|
|
|
<el-dialog
|
|
@@ -133,16 +122,16 @@ export default {
|
|
|
name: "userinfo",
|
|
|
data() {
|
|
|
return {
|
|
|
- userName: "",
|
|
|
- nickName: "",
|
|
|
- fieldState: "",
|
|
|
- fieldData: {},
|
|
|
- fieldExist: false,
|
|
|
+ activeKey: 0,
|
|
|
+ currentPage: 1,
|
|
|
+ pagesize:10,
|
|
|
modelShowData: [],
|
|
|
modelData: [],
|
|
|
- cooperatorProductData: [],
|
|
|
- cooperatorProductShowData: [],
|
|
|
- modelExist: false,
|
|
|
+ // userName: "",
|
|
|
+ // nickName: "",
|
|
|
+ // fieldState: "",
|
|
|
+ // fieldData: {},
|
|
|
+ // fieldExist: false,
|
|
|
type_list: [
|
|
|
"自定义模型",
|
|
|
"jar模型",
|
|
@@ -168,83 +157,49 @@ export default {
|
|
|
|
|
|
selectedItem: null,
|
|
|
rowToDelete:null,
|
|
|
-
|
|
|
- currentPage:1,
|
|
|
- pageSize:10,
|
|
|
- totalRows:0,
|
|
|
+ totalSize:'',
|
|
|
dialogVisible:false
|
|
|
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- userInfo().then((res) => {
|
|
|
- this.nickName = res.data.nickName;
|
|
|
- this.userName = res.data.userName;
|
|
|
- // console.log( res.data);
|
|
|
-
|
|
|
- });
|
|
|
- // fieldInfo().then((res)=>{
|
|
|
- // if(res.data.fieldData)
|
|
|
- // {
|
|
|
- // this.fieldExist=true;
|
|
|
- // this.fieldData = JSON.parse(res.data.fieldData);
|
|
|
- // console.log(res.data);
|
|
|
- // this.fieldState=res.data.fieldState;
|
|
|
- // }
|
|
|
- //
|
|
|
+ // userInfo().then((res) => {
|
|
|
+ // this.nickName = res.data.nickName;
|
|
|
+ // this.userName = res.data.userName;
|
|
|
// });
|
|
|
-
|
|
|
- modelInfo().then((res) => {
|
|
|
- if (res.data.modelData) {
|
|
|
- this.modelExist = true;
|
|
|
- this.modelData = res.data.modelData;
|
|
|
- this.loadData();
|
|
|
- // this.modelShowData = this.modelData;
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- cooperatorProductList(this.currentPage,this.pagesize).then((res) => {
|
|
|
- if (res.data.cooperator_Product_List) {
|
|
|
- this.cooperatorProductData = res.data.cooperator_Product_List;
|
|
|
- console.log(this.cooperatorProductData);
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
+ modelInfo(this.currentPage,this.pagesize).then(res=>
|
|
|
+ {
|
|
|
+ console.log(this.pageSize);
|
|
|
+ this.modelData = res.data.modelData.list;
|
|
|
+ this.modelShowData = this.modelData;
|
|
|
+ var j = parseInt(res.data.modelData.total);
|
|
|
+ this.totalSize = j;
|
|
|
+ // console.log(this.modelShowData[0]);
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
- loadData() {
|
|
|
- // 模拟异步请求数据
|
|
|
- setTimeout(() => {
|
|
|
- // 根据当前页码和每页显示的数据条数计算起始索引和结束索引
|
|
|
- const startIndex = (this.currentPage - 1) * this.pageSize;
|
|
|
- const endIndex = startIndex + this.pageSize;
|
|
|
- // 截取指定范围的数据
|
|
|
- const data = this.modelData.slice(startIndex, endIndex);
|
|
|
- this.modelShowData = data;
|
|
|
- this.totalRows = this.modelData.length;
|
|
|
- }, 500);
|
|
|
+ handleCurrentChange:function(currentPage) {
|
|
|
+ // 当前页码发生变化时触发
|
|
|
+ this.currentPage=currentPage;
|
|
|
+ modelInfo(this.currentPage,this.pagesize).then(res=>
|
|
|
+ {
|
|
|
+ this.modelData = res.data.modelData.list;
|
|
|
+ this.modelShowData = this.modelData;
|
|
|
+ }
|
|
|
+ )
|
|
|
},
|
|
|
- handleSizeChange(size) {
|
|
|
+ handleSizeChange:function(size){
|
|
|
// 每页显示的数据条数发生变化时触发
|
|
|
this.pageSize = size;
|
|
|
- this.currentPage = 1; // 重置当前页码为第一页
|
|
|
- this.loadData();
|
|
|
- },
|
|
|
- handleCurrentChange(page) {
|
|
|
- // 当前页码发生变化时触发
|
|
|
- this.currentPage = page;
|
|
|
- this.loadData();
|
|
|
+ modelInfo(this.currentPage,this.pagesize).then(res=>
|
|
|
+ {
|
|
|
+ this.modelData = res.data.modelData.list;
|
|
|
+ this.modelShowData = this.modelData;
|
|
|
+ }
|
|
|
+ )
|
|
|
},
|
|
|
showDetail(row) {
|
|
|
this.selectedItem = row;
|
|
|
- this.cooperatorProductShowData=this.cooperatorProductData.filter(item => {
|
|
|
- const modelIdMatch = item.modelId==row.modelNo;
|
|
|
- console.log(item);
|
|
|
- console.log(row.modelNo);
|
|
|
- // return true;
|
|
|
- return modelIdMatch;
|
|
|
- });
|
|
|
this.$router.push({
|
|
|
path: '/modelInfo',
|
|
|
query: {
|