<template>
|
<el-dialog class="gd-dialog" v-model="visible" :title="dialogTitle" @closed="handleClosed" destroy-on-close
|
:close-on-click-modal="false">
|
<!-- <div class="detail-row-view" v-if="dialogReadonly">-->
|
<el-table :data="detailsList" class="gd-dialog-table">
|
<el-table-column type="index" show-overflow-tooltip label="序号" />
|
<el-table-column prop="deviceStatus" show-overflow-tooltip label="设备状态" />
|
<el-table-column prop="occurTime" show-overflow-tooltip label="发生时间" />
|
</el-table>
|
</el-dialog>
|
</template>
|
|
<script setup>
|
import { computed, onMounted, ref } from 'vue'
|
import { ElMessage } from 'element-plus'
|
import { getDeviceCallRecordDetails } from './deviceCallRecordApi'
|
import { getDeptTree } from '@/api/system/dept'
|
import { getRoleTree } from '@/api/system/role'
|
import func from '@/utils/func'
|
import { saveOperationLog } from '@ztzf/apis'
|
import { useRoute } from 'vue-router'
|
|
const detailsList = ref([])
|
|
const initForm = () => ({
|
callId: '',
|
size: 10,
|
current: 1
|
})
|
|
const treeProps = {
|
label: 'title',
|
children: 'children',
|
}
|
const deptTreeSelectProps = {
|
label: 'name',
|
value: 'id',
|
children: 'children',
|
}
|
|
const emit = defineEmits(['success'])
|
const formRef = ref(null)
|
const formData = ref(initForm())
|
const visible = ref(false)
|
const dialogMode = ref('add')
|
const submitting = ref(false)
|
const dialogReadonly = computed(() => dialogMode.value === 'view')
|
const dialogTitle = computed(() => {
|
if (dialogMode.value === 'edit') return '编辑'
|
if (dialogMode.value === 'view') return '查看'
|
return '新增'
|
})
|
const roleTree = ref([])
|
const deptTree = ref([])
|
const route = useRoute()
|
|
const validatePass = (rule, value, callback) => {
|
if (value === '') {
|
callback(new Error('请输入密码'))
|
} else {
|
callback()
|
}
|
}
|
const validatePass2 = (rule, value, callback) => {
|
if (value === '') {
|
callback(new Error('请再次输入密码'))
|
} else if (value !== formData.value.password) {
|
callback(new Error('两次输入密码不一致'))
|
} else {
|
callback()
|
}
|
}
|
|
|
|
function handleCancel() {
|
visible.value = false
|
}
|
|
async function loadDetail(id) {
|
formData.value.id = id
|
const res = await getDeviceCallRecordDetails(formData)
|
detailsList.value = res?.data?.data.records
|
}
|
|
function handleClosed() {
|
formData.value = initForm()
|
}
|
|
async function open({ mode, row } = {}) {
|
dialogMode.value = mode || 'add'
|
visible.value = true
|
await loadDetail(row.id)
|
}
|
|
onMounted(() => {
|
})
|
|
defineExpose({ open })
|
</script>
|
|
<style scoped lang="scss">
|
:deep(.el-select) {
|
width: 100%;
|
}
|
|
:deep(.el-date-editor) {
|
width: 100%;
|
}
|
|
:deep(.el-tree-select) {
|
width: 100%;
|
}
|
</style>
|