|
|
@@ -11,7 +11,8 @@
|
|
|
<!-- 新增、编辑弹窗 -->
|
|
|
<a-modal v-model:visible="visibleModal" width="650px" :title="titleModal" :footer="null" centered destroyOnClose
|
|
|
@cancel="handleCancel">
|
|
|
- <OperationTable ref="operationModal" :gateId="deviceId" :recordData="recordData" :cameraData="cameraData" @handleClose="handleClose">
|
|
|
+ <OperationTable ref="operationModal" :gateId="deviceId" :recordData="recordData" :cameraData="cameraData"
|
|
|
+ @handleClose="handleClose">
|
|
|
</OperationTable>
|
|
|
</a-modal>
|
|
|
|
|
|
@@ -23,6 +24,7 @@ import { reactive, ref, onMounted } from 'vue'
|
|
|
import { columns } from './faultConfig.data'
|
|
|
import { list, deleteById, cameraList } from './faultConfig.api'
|
|
|
import OperationTable from './components/operationTable.vue'
|
|
|
+import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
|
|
let props = defineProps({
|
|
|
deviceId: {
|
|
|
@@ -31,6 +33,7 @@ let props = defineProps({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const { createMessage } = useMessage();
|
|
|
let operationModal = ref()
|
|
|
let dataSource = ref<any[]>([]);
|
|
|
//分页参数配置
|
|
|
@@ -51,8 +54,8 @@ let cameraData = ref<any[]>([])
|
|
|
async function getList() {
|
|
|
let res = await list({ pageNo: pagination.current, pageSize: pagination.pageSize, gateId: props.deviceId })
|
|
|
console.log(res, '风门故障配置列表---')
|
|
|
- dataSource.value=res.records || []
|
|
|
- pagination.total=res.total
|
|
|
+ dataSource.value = res.records || []
|
|
|
+ pagination.total = res.total
|
|
|
}
|
|
|
//分页切换
|
|
|
function pageChange(val) {
|
|
|
@@ -67,6 +70,7 @@ function handleAdd() {
|
|
|
}
|
|
|
function handleCancel() {
|
|
|
operationModal.value.resetFields()
|
|
|
+ recordData = {}
|
|
|
visibleModal.value = false
|
|
|
}
|
|
|
//编辑
|
|
|
@@ -78,8 +82,11 @@ function handleEdit(record) {
|
|
|
//删除
|
|
|
async function handleDelete(record) {
|
|
|
let res = await deleteById({ id: record.id })
|
|
|
- console.log(res, '删除')
|
|
|
- getList()
|
|
|
+ if (res.code == 200) {
|
|
|
+ createMessage.success('删除成功!')
|
|
|
+ pagination.current = 1
|
|
|
+ getList()
|
|
|
+ }
|
|
|
}
|
|
|
function handleClose() {
|
|
|
visibleModal.value = false
|