|
@@ -59,7 +59,7 @@
|
|
|
|
|
|
<el-table-column
|
|
|
prop="deviceName"
|
|
|
- label="通信设备名称"
|
|
|
+ label="设备名称"
|
|
|
width="150"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
@@ -68,18 +68,13 @@
|
|
|
width=""
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="deviceSite"
|
|
|
+ prop="siteId"
|
|
|
label="所属站点"
|
|
|
width=""
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="offlineTime"
|
|
|
- label="上次离线时间"
|
|
|
- width=""
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="onlineTime"
|
|
|
- label="上次在线时间"
|
|
|
+ prop="statusTime"
|
|
|
+ label="最后通信时间"
|
|
|
width=""
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
@@ -93,7 +88,7 @@
|
|
|
width=""
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="deviceAdd"
|
|
|
+ prop="deviceAddress"
|
|
|
label="设备地址"
|
|
|
width=""
|
|
|
></el-table-column>
|
|
@@ -107,14 +102,21 @@
|
|
|
>
|
|
|
编辑
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- @click="Delete(scope.$index, scope.row)"
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- style="color: red"
|
|
|
+ <el-popconfirm
|
|
|
+ confirm-button-text="是"
|
|
|
+ cancel-button-text="否"
|
|
|
+ icon="el-icon-info"
|
|
|
+ icon-color="red"
|
|
|
+ title="确定删除?"
|
|
|
+ @confirm="confirmEvent(scope.row)"
|
|
|
+ @cancel="cancelEvent"
|
|
|
>
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
+ <template #reference>
|
|
|
+ <el-button type="text" size="small" style="color: red">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -122,82 +124,167 @@
|
|
|
<el-pagination
|
|
|
v-model:currentPage="currentPage"
|
|
|
:page-sizes="[15, 20, 25, 30]"
|
|
|
- :page-size="15"
|
|
|
+ :page-size="pageSize"
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="tableData.length"
|
|
|
+ :total="total"
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
background
|
|
|
></el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div></div>
|
|
|
+ <div>
|
|
|
+ <insert-Update
|
|
|
+ :dialogBool="dialogBool"
|
|
|
+ :dialogTitle="dialogTitle"
|
|
|
+ :dataList="dataList"
|
|
|
+ @show="showValue"
|
|
|
+ ></insert-Update>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { defineComponent, ref } from 'vue'
|
|
|
+import { useStore } from 'vuex'
|
|
|
+import { defineComponent, onMounted, ref } from 'vue'
|
|
|
+import insertUpdate from './dialog/insert_update.vue'
|
|
|
+
|
|
|
+import * as api from '@/api/deviceManage/powerEquip/communicateEquip'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'powerEquip',
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ insertUpdate,
|
|
|
+ },
|
|
|
props: {
|
|
|
Height: String,
|
|
|
},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- deviceNumData: [],
|
|
|
- tableData: [
|
|
|
- {
|
|
|
- stationStatus: 0,
|
|
|
- deviceName: '测试设备',
|
|
|
- deviceCode: 'cssb1',
|
|
|
- deviceSite: '站点1',
|
|
|
- offlineTime: '2021-1-1 00:00:00',
|
|
|
- onlineTime: '2021-2-1 00:00:00',
|
|
|
- offlineDuration: '180天',
|
|
|
- onlineDuration: '180天',
|
|
|
- deviceAdd: '徐乐路208号',
|
|
|
- },
|
|
|
- {
|
|
|
- stationStatus: 1,
|
|
|
- deviceName: '测试设备',
|
|
|
- deviceCode: 'cssb1',
|
|
|
- deviceSite: '站点1',
|
|
|
- offlineTime: '2021-1-1 00:00:00',
|
|
|
- onlineTime: '2021-2-1 00:00:00',
|
|
|
- offlineDuration: '180天',
|
|
|
- onlineDuration: '180天',
|
|
|
- deviceAdd: '徐乐路208号',
|
|
|
- },
|
|
|
- ],
|
|
|
- activeName: 'powerEquip',
|
|
|
- filterText: '',
|
|
|
- currentPage: ref(15),
|
|
|
+ setup() {
|
|
|
+ const store = useStore()
|
|
|
+ store
|
|
|
+ const pageSize = ref(15)
|
|
|
+ const currentPage = ref(1)
|
|
|
+ const total = ref(0)
|
|
|
+ const filterText = ref('')
|
|
|
+ const tableData = ref([])
|
|
|
+ const activeName = ref('powerEquip')
|
|
|
+ const dialogBool = ref(false)
|
|
|
+ const dialogTitle = ref('')
|
|
|
+ const dataList = ref({})
|
|
|
+
|
|
|
+ //查询
|
|
|
+ function Select() {
|
|
|
+ api
|
|
|
+ .correspondDeviceList({
|
|
|
+ size: pageSize.value,
|
|
|
+ current: currentPage.value,
|
|
|
+ })
|
|
|
+ .then((requset) => {
|
|
|
+ if (requset.status === 'SUCCESS') {
|
|
|
+ total.value = requset.data.total
|
|
|
+ tableData.value = requset.data.records
|
|
|
+ } else {
|
|
|
+ ElMessage.error(requset.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- },
|
|
|
- methods: {
|
|
|
//新增
|
|
|
- Insert() {
|
|
|
- console.log('')
|
|
|
- },
|
|
|
- // 表头样式设置
|
|
|
- headClass() {
|
|
|
- return 'background:#FAFAFA !important;color: black;'
|
|
|
- },
|
|
|
+ const Insert = () => {
|
|
|
+ dialogBool.value = true
|
|
|
+ dialogTitle.value = '新增'
|
|
|
+ dataList.value = {
|
|
|
+ deviceCode: '',
|
|
|
+ deviceName: '',
|
|
|
+ floor: 1,
|
|
|
+ siteId: '',
|
|
|
+ deviceAddress: '',
|
|
|
+ deviceType: 1,
|
|
|
+ sim: '',
|
|
|
+ }
|
|
|
+ }
|
|
|
//修改
|
|
|
- Update(row) {
|
|
|
+ const Update = (row) => {
|
|
|
+ dialogBool.value = true
|
|
|
+ dialogTitle.value = '修改'
|
|
|
console.log(row)
|
|
|
- },
|
|
|
+ dataList.value = {
|
|
|
+ deviceCode: row.deviceCode,
|
|
|
+ deviceName: row.deviceName,
|
|
|
+ floor: row.floor,
|
|
|
+ siteId: row.siteId,
|
|
|
+ deviceAddress: row.deviceAddress,
|
|
|
+ deviceType: row.deviceType,
|
|
|
+ sim: row.sim,
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //新增修改弹窗控制
|
|
|
+ const showValue = (value) => {
|
|
|
+ dialogBool.value = value
|
|
|
+ Select()
|
|
|
+ }
|
|
|
+
|
|
|
+ //是否删除 ---- 是
|
|
|
+ const confirmEvent = (row) => {
|
|
|
+ Delete(row)
|
|
|
+ }
|
|
|
+ //是否删除 ---- 否
|
|
|
+ const cancelEvent = () => {
|
|
|
+ console.log('cancel!')
|
|
|
+ }
|
|
|
//删除
|
|
|
- Delete(ind, row) {
|
|
|
- console.log(ind, row)
|
|
|
- },
|
|
|
- handleSizeChange(val) {
|
|
|
- console.log(`${val} items per page`)
|
|
|
- },
|
|
|
- handleCurrentChange(val) {
|
|
|
- console.log(`current page: ${val}`)
|
|
|
- },
|
|
|
+ const Delete = (row) => {
|
|
|
+ api.correspondDeviceDel({ id: row.id }).then((requset) => {
|
|
|
+ if (requset.status === 'SUCCESS') {
|
|
|
+ ElMessage.success({
|
|
|
+ message: '删除成功',
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ Select()
|
|
|
+ } else {
|
|
|
+ ElMessage.error(requset.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ const handleSizeChange = (val) => {
|
|
|
+ pageSize.value = val
|
|
|
+ Select()
|
|
|
+ }
|
|
|
+ const handleCurrentChange = (val) => {
|
|
|
+ currentPage.value = val
|
|
|
+ Select()
|
|
|
+ }
|
|
|
+ // 表头样式设置
|
|
|
+ const headClass = () => {
|
|
|
+ return 'background:#FAFAFA !important;color: black;'
|
|
|
+ }
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ Select()
|
|
|
+ })
|
|
|
+ return {
|
|
|
+ headClass,
|
|
|
+ handleCurrentChange,
|
|
|
+ handleSizeChange,
|
|
|
+
|
|
|
+ Insert,
|
|
|
+ Update,
|
|
|
+ Delete,
|
|
|
+ confirmEvent,
|
|
|
+ cancelEvent,
|
|
|
+ showValue,
|
|
|
+
|
|
|
+ pageSize,
|
|
|
+ currentPage,
|
|
|
+ total,
|
|
|
+ filterText,
|
|
|
+ tableData,
|
|
|
+ activeName,
|
|
|
+
|
|
|
+ dialogBool,
|
|
|
+ dialogTitle,
|
|
|
+ dataList,
|
|
|
+ }
|
|
|
},
|
|
|
})
|
|
|
</script>
|