yangys
2024-01-13 b8d63989635bc9fb58357f76333796e21409985b
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!--
 * @Date: 2024-01-06 17:40:19
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-13 11:35:29
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/deviceType/index.vue
-->
<template>
    <div class="maintenance">
        <div class="nav">设备类型管理</div>
        <List ref="list" :url="url">
            <template slot="search">
                <div class="item">
                    <span>名称</span>
                    <el-input class="item-value" v-model="queryInfo.name"></el-input>
                    
                </div>
               
                
                <div class="item">
                    <el-button type="primary" size="small" @click="query">查询</el-button>
                </div>
                <div class="item">
                    <el-button type="primary" size="small" @click="reset">重置</el-button>
                </div>
            </template>
            
            <template slot="table-tool">
                <el-button type="primary" size="mini" @click="add">添加设备类型</el-button>
            </template>
            
            <template slot="columns">
                <el-table-column
                    prop="id"
                    label="ID"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="name"
                    label="名称"
                    width="180">
                </el-table-column>
                
            </template>
            
        </List>
        <manage-add-update v-if="addOrUpdateVisible" :addVisible="addOrUpdateVisible" @close="close" @confirm="confirm"
             :row="row"></manage-add-update>
    </div>
</template>
<script>
    import List from '../list/index.vue'
    import ManageAddUpdate from './Manage-add-update'
    import { getUrl } from '@/api/Api'
    export default {
        components: {
            List,
            ManageAddUpdate
        },
        data () {
            return {
                url: '',
                queryInfo: {
                    name: ''
                },
                row: {},
                addOrUpdateVisible: false
            }
        },
        created () {
            this.url = getUrl('deviceTypeQuery')
            //this.init()
        },
        methods: {
            reset () {
                Object.keys(this.queryInfo).forEach(key => {
                    this.queryInfo[key] = ''
                })
            },
            query () {
                this.$refs.list.pageQuery(this.queryInfo)
            },
            add() {
                this.row = {}
                this.addOrUpdateVisible = true
                console.log(this.addOrUpdateVisible);
            },
            close() {
                this.addOrUpdateVisible = false
            },
            confirm() {
                this.query()
                this.close()
            },
            addOrUpdateHandle(row) {
                this.row = row
                this.addOrUpdateVisible = true
            }
            
        },
    }
</script>
<style lang="scss">
.maintenance {
    .item-value {
        .el-input__inner {
            background: transparent;
            border-radius: 2px;
            border: 1px solid #435F9E;
        }
    }
    .el-button--mini {
        background: transparent;
    }
    .el-button--primary {
        background-color: transparent;
    }
}
</style>
<style lang="scss" scoped>
.maintenance {
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: #FFF;
    display: flex;
    flex-direction: column;
 
    .nav {
        padding: 10px 30px;
    }
 
    .item {
        margin-top: 20px;
        margin-left: 50px;
        display: flex;
        align-items: center;
 
        span {
            width: 120px;
            font-size: 16px;
            font-family: PingFangSC, PingFang SC;
            color: #C6DCE0;
            text-align: right;
            padding-right: 20px;
        }
 
        .item-value {
            width: 200px;
            border: 1px solid #435F9E;
        }
 
        .btn {
            line-height: 1.5;
            width: 100px;
            text-align: center;
            font-size: 16px;
            cursor: pointer;
        }
 
        .reset {
            background: #AAB6BA;
            color: #FFF;
        }
 
        .query {
            background: #5DD1FC;
            color: #FFF;
        }
    }
}
</style>