From 10562a6dac1492fe3dda566a800a4fec1f6e3bca Mon Sep 17 00:00:00 2001
From: gaosp <gaosp>
Date: 星期日, 14 一月 2024 15:09:34 +0800
Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdc-front

---
 src/container/deviceType/index.vue |  258 +++++++++++++++++++++++++++------------------------
 1 files changed, 136 insertions(+), 122 deletions(-)

diff --git a/src/container/deviceType/index.vue b/src/container/deviceType/index.vue
index 5800299..2f804fe 100644
--- a/src/container/deviceType/index.vue
+++ b/src/container/deviceType/index.vue
@@ -1,111 +1,77 @@
 <!--
  * @Date: 2024-01-06 17:40:19
  * @LastEditors: Sneed
- * @LastEditTime: 2024-01-12 22:44:37
+ * @LastEditTime: 2024-01-14 14:12:18
  * @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="/component/pageQuery">
+        <div class="nav">璁惧绫诲瀷绠$悊</div>
+        <List ref="list" :url="url">
             <template slot="search">
                 <div class="item">
-                    <span>闆朵欢鍙�</span>
-                    <el-select class="item-value" v-model="queryInfo.component" placeholder="璇烽�夋嫨">
-                        <el-option
-                        v-for="item in componentList"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value">
-                        </el-option>
-                    </el-select>
+                    <span>鍚嶇О</span>
+					<el-input class="item-value" v-model="queryInfo.name"></el-input>
+                    
                 </div>
                 <div class="item">
-                    <span>宸ュ簭鍙�</span>
-                    <!-- <el-input class="item-value" v-model="query.no"></el-input> -->
-                    <el-select class="item-value" v-model="queryInfo.precess" placeholder="璇烽�夋嫨">
-                        <el-option
-                        v-for="item in precessList"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value">
-                        </el-option>
-                    </el-select>
+                    <el-button type="primary" size="small" @click="query">鏌ヨ</el-button>
                 </div>
                 <div class="item">
-                    <span>寮�濮嬫椂闂�</span>
-                    <!-- <el-input class="item-value" v-model="query.no"></el-input> -->
-                    <el-date-picker
-                        class="item-value"
-                        v-model="queryInfo.timeBegin"
-                        align="right"
-                        value-format="yyyy-MM-dd"
-                        type="date"
-                        placeholder="閫夋嫨鏃ユ湡">
-                    </el-date-picker>
-                </div>
-                <div class="item">
-                    <span>缁撴潫鏃堕棿</span>
-                    <el-date-picker
-                        class="item-value"
-                        v-model="queryInfo.timeEnd"
-                        align="right"
-                        value-format="yyyy-MM-dd"
-                        type="date"
-                        placeholder="閫夋嫨鏃ユ湡">
-                    </el-date-picker>
-                </div>
-                <div class="item">
-                    <div class="query btn" @click="query">鏌ヨ</div>
-                </div>
-                <div class="item">
-                    <div class="reset btn" @click="reset">閲嶇疆</div>
+                    <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="date"
-                    label="鏈哄簥鍚�"
+				<el-table-column
+                    prop="id"
+                    label="ID"
                     width="180">
                 </el-table-column>
                 <el-table-column
-                    prop="component"
-                    label="闆朵欢鍙�"
+                    prop="name"
+                    label="鍚嶇О"
                     width="180">
                 </el-table-column>
-                <el-table-column
-                    prop="address"
-                    label="宸ュ簭鍙�">
-                </el-table-column>
-                <el-table-column
-                    prop="address"
-                    label="鍔犲伐鏃堕棿">
+                 <el-table-column align="center" label="鎿嶄綔" prop="editor">
+                    <template slot-scope="scope">
+                        <el-button size="mini" type="text" @click="editDeviceType(scope.row)">缂栬緫</el-button>
+                        <el-button size="mini" type="text" @click="deleteHandle(scope.row)">鍒犻櫎</el-button>
+                    </template>
                 </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,deviceTypeDelete } from '@/api/Api'
     export default {
         components: {
-            List
+            List,
+			ManageAddUpdate
         },
         data () {
             return {
+                url: '',
                 queryInfo: {
-                    timeBegin: '',
-                    timeEnd: '',
-                    precess: '',
-                    component: ''
+                    name: ''
                 },
-                precessList: [],
-                componentList: []
+				row: {},
+				addOrUpdateVisible: false
             }
         },
         created () {
-            this.init()
-            // this.getProtocolList()
+            this.url = getUrl('deviceTypeQuery')
+            //this.init()
         },
         methods: {
             reset () {
@@ -116,18 +82,53 @@
             query () {
                 this.$refs.list.pageQuery(this.queryInfo)
             },
-            changeTime (name,value) {
-                console.log(name,value)
-                this.queryInfo[name] = value
-            },
-            init () {
-                this.$http.get('/component/processlist').then(res => {
-                    this.precessList = res.data
-                })
-                this.$http.post('/component/complist').then(res => {
-                    this.componentList = res.data
-                })
-            }
+			add() {
+				this.row = {id:''}
+				this.addOrUpdateVisible = true
+				
+			},
+			editDeviceType(row){
+				this.row = row;
+				this.addOrUpdateVisible = true;
+			},
+			close() {
+				this.addOrUpdateVisible = false
+			},
+			confirm() {
+				this.query()
+				this.close()
+			},
+			addOrUpdateHandle(row) {
+				this.row = row
+				this.addOrUpdateVisible = true
+			},
+			deleteHandle(row) {
+				let ids = []
+				 
+					ids.push(row.id)
+				  
+				  ids = ids.join(',')
+				  this.$confirm('纭畾瑕佹案涔呭垹闄ゆ椤�?', '鎻愮ず', {
+					confirmButtonText: '纭畾',
+					cancelButtonText: '鍙栨秷',
+					type: 'warning'
+				  }).then(() => {
+					deviceTypeDelete(ids).then(res => {
+					  // if(res.result == ""){}
+					  this.$message({
+						type: 'success',
+						message: '鍒犻櫎鎴愬姛锛�'
+					  })
+					  this.submitForm()
+					})
+				  }).catch(() => {
+					this.$message({
+					  type: 'info',
+					  message: '宸插彇娑堝垹闄�'
+					})
+				  })
+			}
+            
         },
     }
 </script>
@@ -140,51 +141,64 @@
             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;
+.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;
-        flex-direction: column;
-        .nav {
-            padding: 10px 30px;
+        align-items: center;
+
+        span {
+            width: 120px;
+            font-size: 16px;
+            font-family: PingFangSC, PingFang SC;
+            color: #C6DCE0;
+            text-align: right;
+            padding-right: 20px;
         }
-        .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;
-            }
+
+        .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>
\ No newline at end of file

--
Gitblit v1.9.3