suerprisePlus
2024-06-12 76c68b73ec61c505ef91ae2e46ed4eeb704c130b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<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>