吉安感知网项目-前端
chenyao
2026-02-26 3cd44b7f4f035bd0a3c7ccbfc67e59310213521b
applications/task-work-order/src/views/orderView/deviceInvocation/deviceCallRecord/FormDiaLog.vue
@@ -2,10 +2,10 @@
   <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="list" class="gd-dialog-table">
         <el-table-column prop="resultCode" show-overflow-tooltip label="序号" />
         <el-table-column prop="resultCode" show-overflow-tooltip label="设备状态" />
         <el-table-column prop="shootTime" show-overflow-tooltip label="发生时间" />
      <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>
@@ -13,28 +13,19 @@
<script setup>
import { computed, onMounted, ref } from 'vue'
import { ElMessage } from 'element-plus'
import { add, getUser, update } from '@/api/system/user'
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 list = ref([])
const detailsList = ref([])
const initForm = () => ({
   account: '',
   password: '',
   password2: '',
   realName: '',
   phone: '',
   email: '',
   sex: null,
   birthday: '',
   code: '',
   roleId: '',
   deptId: '',
   // sysType: 6
   callId: '',
   size: 10,
   current: 1
})
const treeProps = {
@@ -80,28 +71,16 @@
   }
}
async function getRoleTreeData() {
   const res = await getRoleTree('000000')
   roleTree.value = res.data.data
}
async function getDeptTreeData() {
   const res = await getDeptTree('000000')
   deptTree.value = res.data.data
}
function handleCancel() {
   visible.value = false
}
async function loadDetail() {
   if (!formData.value.id) return
   const res = await getUser(formData.value.id)
   const data = res?.data?.data ?? {}
   if (data.roleId) {
      data.roleId = func.split(data.roleId)[0] || data.roleId
   }
   formData.value = data
async function loadDetail(id) {
   formData.value.id = id
   const res = await getDeviceCallRecordDetails(formData)
   detailsList.value = res?.data?.data.records
}
function handleClosed() {
@@ -111,17 +90,10 @@
async function open({ mode, row } = {}) {
   dialogMode.value = mode || 'add'
   visible.value = true
   if (dialogMode.value === 'add') {
      formData.value = initForm()
      return
   }
   formData.value = { id: row.id }
   await loadDetail()
   await loadDetail(row.id)
}
onMounted(() => {
   getRoleTreeData()
   getDeptTreeData()
})
defineExpose({ open })