<template>
|
<div v-loading="loading" class="modelLibiraryBox">
|
<el-card>
|
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px" style="margin-bottom: -20px">
|
<el-form-item label="模型名称" prop="templateName">
|
<el-input v-model="queryParams.templateName" placeholder="请输入模型名称" clearable size="small" @keyup.enter.native="handleQuery" />
|
</el-form-item>
|
<el-form-item label="模型类别" prop="type">
|
<el-select v-model="queryParams.type" placeholder="请选择模型类别" clearable size="small">
|
<el-option v-for="dict in dict.type.iot_model_library_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
</el-select>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" size="mini">搜索</el-button>
|
<el-button icon="el-icon-refresh" size="mini">重置</el-button>
|
</el-form-item>
|
<el-form-item style="float: right">
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" v-hasPermi="['iot:modelLibrary:add']">新增</el-button>
|
</el-form-item>
|
</el-form>
|
</el-card>
|
<el-card class="modelLibiraryContent">
|
<div class="modelLibiraryTable">
|
<el-table :data="templateList" border>
|
<el-table-column label="模型名称" align="center" prop="name" />
|
<el-table-column label="模型类型" align="center" prop="type" />
|
<el-table-column label="模型大小" align="center" prop="type" />
|
<el-table-column label="模型地址" align="center" prop="path" />
|
<el-table-column label="创建时间" align="center" prop="createime" />
|
<el-table-column label="描述" align="center" prop="bak" />
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
<template slot-scope="scope">
|
<el-button size="small" type="primary" style="padding: 5px" icon="el-icon-edit" v-hasPermi="['iot:template:query']" v-if="scope.row.isSys == '0' ? true : !isTenant">修改</el-button>
|
<el-button size="small" type="danger" style="padding: 5px" icon="el-icon-delete" v-hasPermi="['iot:template:remove']" v-if="scope.row.isSys == '0' ? true : !isTenant">删除</el-button>
|
<el-button size="small" type="warning" style="padding: 5px" icon="el-icon-download" v-hasPermi="['iot:template:query']" v-if="scope.row.isSys == '0' ? true : !isTenant">下载</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
</div>
|
</el-card>
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false"></el-dialog>
|
</div>
|
</template>
|
|
<script>
|
// import { listModelLibrary } from '@/api/iot/modelLibrary';
|
export default {
|
name: 'modelLibirary',
|
dicts: ['iot_model_library_type'],
|
data() {
|
return {
|
loading: false,
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
name: null,
|
type: null,
|
},
|
// 是否为租户
|
isTenant: false,
|
templateList: [
|
{
|
name: 'test',
|
},
|
],
|
// 总条数
|
total: 0,
|
title: '',
|
// 是否显示弹出层
|
open: false,
|
};
|
},
|
created() {
|
this.init();
|
},
|
methods: {
|
init() {
|
if (this.$store.state.user.roles.indexOf('tenant') !== -1) {
|
this.isTenant = true;
|
}
|
|
this.getList();
|
},
|
getList() {
|
// listModelLibrary(this.queryParams).then((response) => {
|
// }) ;
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.modelLibiraryBox {
|
padding: 6px;
|
width: 100%;
|
height: 100%;
|
position: absolute;
|
display: flex;
|
flex-direction: column;
|
.modelLibiraryContent {
|
margin: 6px 0px;
|
flex: 1;
|
position: relative;
|
|
::v-deep .el-card__body {
|
padding: 15px !important;
|
}
|
.modelLibiraryTable {
|
width: calc(100% - 30px);
|
height: calc(100% - 36px);
|
position: absolute;
|
display: flex;
|
flex-direction: column;
|
}
|
}
|
}
|
</style>
|