houzhongjian
2024-07-23 8501060c4f921d1e744c477e4dc08eb47b52693c
提交 | 用户 | 时间
850106 1 <template>
H 2   <el-card shadow="never" class="aui-card--fill">
3     <div class="mod-device__device-account}">
4       <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
5         <el-form-item>
6           <el-input v-model="dataForm.deviceCode" placeholder="设备编号" clearable></el-input>
7         </el-form-item>
8         <el-form-item>
9           <el-input v-model="dataForm.deviceName" placeholder="设备名称" clearable></el-input>
10         </el-form-item>
11         <el-form-item>
12           <el-button @click="getDataList()">{{ $t('query') }}</el-button>
13         </el-form-item>
14       </el-form>
15       <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle"
16                 style="width: 100%;">
17         <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
18         <el-table-column prop="deviceName" label="设备名称" header-align="center" align="center"></el-table-column>
19         <el-table-column prop="deviceCode" label="设备编码" header-align="center" align="center"></el-table-column>
20         <el-table-column prop="deviceClass" label="设备分类" header-align="center" align="center"></el-table-column>
21         <el-table-column prop="workShop" label="所属车间" header-align="center" align="center"></el-table-column>
22 <!--        <el-table-column prop="isPush" label="是否推送工单" header-align="center" align="center">-->
23 <!--          <template slot-scope="scope">-->
24 <!--            <el-button type="text" v-if="scope.row.isPush === 1">是</el-button>-->
25 <!--            <el-button type="text" v-else>否</el-button>-->
26 <!--          </template>-->
27 <!--        </el-table-column>-->
28         <el-table-column prop="runState" label="运行状态" header-align="center" align="center">
29           <template slot-scope="scope">
30             <el-tag v-if="scope.row.runState === 2" size="small" type="success">正常</el-tag>
31             <el-tag v-else size="small" type="danger">异常</el-tag>
32           </template>
33         </el-table-column>
34         <el-table-column prop="updateDate" label="更新时间" header-align="center" align="center"></el-table-column>
35         <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
36           <template slot-scope="scope">
37             <el-button type="text" size="small" @click="viewHandle(scope.row.deviceId)">{{ '查看历史' }}</el-button>
38           </template>
39         </el-table-column>
40       </el-table>
41       <el-pagination
42           :current-page="page"
43           :page-sizes="[10, 20, 50, 100]"
44           :page-size="limit"
45           :total="total"
46           layout="total, sizes, prev, pager, next, jumper"
47           @size-change="pageSizeChangeHandle"
48           @current-change="pageCurrentChangeHandle">
49       </el-pagination>
50       <!-- 弹窗, 新增 / 修改 -->
51       <device-account-history-add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate"
52                                             @refreshDataList="getDataList"></device-account-history-add-or-update>
53     </div>
54   </el-card>
55 </template>
56 <script>
57 import mixinViewModule from '@/mixins/view-module'
58 import DeviceAccountHistoryAddOrUpdate from './device-account-history-add-or-update'
59
60 export default {
61   components: {DeviceAccountHistoryAddOrUpdate},
62   mixins: [mixinViewModule],
63   data() {
64     return {
65       mixinViewModuleOptions: {
66         getDataListURL: '/iailab-ntt-model/device/device-account/page',
67         getDataListIsPage: true,
68       },
69       addOrUpdateVisible: false,
70       dataForm: {
71         deviceCode: '',
72         deviceName: ''
73       }
74     }
75   },
76   methods: {
77     viewHandle(deviceId) {
78       this.addOrUpdateVisible = true
79       this.$nextTick(() => {
80         this.$refs.addOrUpdate.dataForm.deviceId = deviceId
81         this.$refs.addOrUpdate.init()
82       })
83     },
84   }
85 }
86 </script>